From 26745dac67d8b4d948bce63dec4ed5115f4d5225 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Tue, 19 May 2020 15:25:06 -0700 Subject: [PATCH 01/19] Added converter layer for search. Removed the code transformation. --- .../documents/SearchIndexAsyncClient.java | 47 +- .../documents/SearchServiceAsyncClient.java | 211 ++--- .../implementation/DataSourcesImpl.java | 6 +- .../implementation/DocumentsImpl.java | 35 +- .../implementation/IndexersImpl.java | 8 +- .../documents/implementation/IndexesImpl.java | 10 +- .../SearchServiceRestClientBuilder.java | 4 +- .../SearchServiceRestClientImpl.java | 6 +- .../implementation/SkillsetsImpl.java | 6 +- .../implementation/SynonymMapsImpl.java | 6 +- .../converters/AnalyzeRequestConverter.java | 94 +++ .../AnalyzedTokenInfoConverter.java | 62 ++ .../AsciiFoldingTokenFilterConverter.java | 49 ++ .../converters/AutocompleteItemConverter.java | 48 ++ .../converters/AutocompleteModeConverter.java | 55 ++ .../AutocompleteOptionsConverter.java | 99 +++ .../AutocompleteResultConverter.java | 60 ++ ...ectoryApplicationCredentialsConverter.java | 51 ++ .../converters/BM25SimilarityConverter.java | 47 ++ .../converters/CharFilterConverter.java | 46 ++ .../converters/CharFilterNameConverter.java | 34 + .../CjkBigramTokenFilterConverter.java | 65 ++ .../CjkBigramTokenFilterScriptsConverter.java | 59 ++ .../ClassicSimilarityConverter.java | 37 + .../converters/ClassicTokenizerConverter.java | 47 ++ .../CognitiveServicesAccountConverter.java | 48 ++ .../CognitiveServicesAccountKeyConverter.java | 49 ++ .../CommonGramTokenFilterConverter.java | 68 ++ .../converters/ConditionalSkillConverter.java | 82 ++ .../implementation/converters/Constants.java | 9 + .../converters/CorsOptionsConverter.java | 54 ++ .../converters/CustomAnalyzerConverter.java | 82 ++ .../DataChangeDetectionPolicyConverter.java | 48 ++ .../DataDeletionDetectionPolicyConverter.java | 41 + .../DataSourceCredentialsConverter.java | 43 + ...aultCognitiveServicesAccountConverter.java | 42 + ...onaryDecompounderTokenFilterConverter.java | 79 ++ .../DistanceScoringFunctionConverter.java | 74 ++ .../DistanceScoringParametersConverter.java | 49 ++ .../EdgeNGramTokenFilterConverter.java | 67 ++ .../EdgeNGramTokenFilterSideConverter.java | 51 ++ .../EdgeNGramTokenFilterV2Converter.java | 67 ++ .../EdgeNGramTokenizerConverter.java | 71 ++ .../ElisionTokenFilterConverter.java | 56 ++ .../converters/EntityCategoryConverter.java | 71 ++ .../EntityRecognitionSkillConverter.java | 122 +++ ...tityRecognitionSkillLanguageConverter.java | 34 + .../converters/FacetResultConverter.java | 58 ++ .../converters/FieldMappingConverter.java | 58 ++ .../FieldMappingFunctionConverter.java | 58 ++ .../FreshnessScoringFunctionConverter.java | 74 ++ .../FreshnessScoringParametersConverter.java | 45 ++ .../GetIndexStatisticsResultConverter.java | 50 ++ ...terMarkChangeDetectionPolicyConverter.java | 43 + .../ImageAnalysisSkillConverter.java | 123 +++ .../ImageAnalysisSkillLanguageConverter.java | 34 + .../converters/ImageDetailConverter.java | 48 ++ .../converters/IndexActionConverter.java | 66 ++ .../converters/IndexActionTypeConverter.java | 59 ++ .../converters/IndexBatchBaseConverter.java | 52 ++ .../IndexDocumentsResultConverter.java | 54 ++ .../IndexerExecutionResultConverter.java | 122 +++ .../IndexerExecutionStatusConverter.java | 59 ++ .../converters/IndexerStatusConverter.java | 54 ++ .../IndexingParametersConverter.java | 72 ++ .../converters/IndexingResultConverter.java | 60 ++ .../converters/IndexingScheduleConverter.java | 50 ++ .../InputFieldMappingEntryConverter.java | 70 ++ .../converters/KeepTokenFilterConverter.java | 60 ++ .../KeyPhraseExtractionSkillConverter.java | 103 +++ ...hraseExtractionSkillLanguageConverter.java | 34 + .../KeywordMarkerTokenFilterConverter.java | 62 ++ .../converters/KeywordTokenizerConverter.java | 47 ++ .../KeywordTokenizerV2Converter.java | 49 ++ .../LanguageDetectionSkillConverter.java | 84 ++ .../LengthTokenFilterConverter.java | 55 ++ .../converters/LexicalAnalyzerConverter.java | 61 ++ .../LexicalAnalyzerNameConverter.java | 34 + .../converters/LexicalTokenizerConverter.java | 117 +++ .../LexicalTokenizerNameConverter.java | 34 + .../converters/LimitTokenFilterConverter.java | 53 ++ .../LuceneStandardAnalyzerConverter.java | 62 ++ .../LuceneStandardTokenizerConverter.java | 49 ++ .../LuceneStandardTokenizerV2Converter.java | 49 ++ .../MagnitudeScoringFunctionConverter.java | 74 ++ .../MagnitudeScoringParametersConverter.java | 55 ++ .../MappingCharFilterConverter.java | 56 ++ .../converters/MergeSkillConverter.java | 93 +++ ...oftLanguageStemmingTokenizerConverter.java | 68 ++ .../MicrosoftLanguageTokenizerConverter.java | 67 ++ ...oftStemmingTokenizerLanguageConverter.java | 223 +++++ .../MicrosoftTokenizerLanguageConverter.java | 211 +++++ .../converters/NGramTokenFilterConverter.java | 53 ++ .../NGramTokenFilterV2Converter.java | 55 ++ .../converters/NGramTokenizerConverter.java | 69 ++ .../converters/OcrSkillConverter.java | 112 +++ .../converters/OcrSkillLanguageConverter.java | 34 + .../OutputFieldMappingEntryConverter.java | 49 ++ .../PathHierarchyTokenizerV2Converter.java | 73 ++ .../converters/PatternAnalyzerConverter.java | 82 ++ .../PatternCaptureTokenFilterConverter.java | 62 ++ .../PatternReplaceCharFilterConverter.java | 55 ++ .../PatternReplaceTokenFilterConverter.java | 55 ++ .../converters/PatternTokenizerConverter.java | 71 ++ .../converters/PhoneticEncoderConverter.java | 87 ++ .../PhoneticTokenFilterConverter.java | 61 ++ .../converters/QueryTypeConverter.java | 48 ++ .../converters/RegexFlagsConverter.java | 31 + .../converters/RequestOptionsConverter.java | 43 + .../converters/ResourceCounterConverter.java | 47 ++ .../ScoringFunctionAggregationConverter.java | 63 ++ .../converters/ScoringFunctionConverter.java | 61 ++ ...ScoringFunctionInterpolationConverter.java | 59 ++ .../converters/ScoringProfileConverter.java | 82 ++ .../converters/SearchFieldConverter.java | 148 ++++ .../SearchFieldDataTypeConverter.java | 34 + .../converters/SearchIndexConverter.java | 183 +++++ .../converters/SearchIndexerConverter.java | 128 +++ .../SearchIndexerDataContainerConverter.java | 49 ++ .../SearchIndexerDataSourceConverter.java | 116 +++ .../SearchIndexerDataSourceTypeConverter.java | 34 + .../SearchIndexerErrorConverter.java | 74 ++ .../SearchIndexerLimitsConverter.java | 60 ++ .../SearchIndexerSkillConverter.java | 110 +++ .../SearchIndexerSkillsetConverter.java | 84 ++ .../SearchIndexerStatusConverter.java | 89 ++ .../SearchIndexerWarningConverter.java | 68 ++ .../converters/SearchModeConverter.java | 48 ++ .../SearchResourceEncryptionKeyConverter.java | 67 ++ .../converters/SearchResultConverter.java | 64 ++ .../converters/SentimentSkillConverter.java | 95 +++ .../SentimentSkillLanguageConverter.java | 34 + .../converters/ServiceCountersConverter.java | 113 +++ .../converters/ServiceLimitsConverter.java | 58 ++ .../ServiceStatisticsConverter.java | 61 ++ .../converters/ShaperSkillConverter.java | 81 ++ .../ShingleTokenFilterConverter.java | 79 ++ .../converters/SimilarityConverter.java | 34 + .../SnowballTokenFilterConverter.java | 55 ++ .../SnowballTokenFilterLanguageConverter.java | 131 +++ ...olumnDeletionDetectionPolicyConverter.java | 50 ++ .../converters/SplitSkillConverter.java | 111 +++ .../SplitSkillLanguageConverter.java | 34 + ...tegratedChangeTrackingPolicyConverter.java | 36 + .../StemmerOverrideTokenFilterConverter.java | 56 ++ .../StemmerTokenFilterConverter.java | 55 ++ .../StemmerTokenFilterLanguageConverter.java | 259 ++++++ .../converters/StopAnalyzerConverter.java | 53 ++ .../converters/StopwordsListConverter.java | 166 ++++ .../StopwordsTokenFilterConverter.java | 80 ++ .../converters/SuggestOptionsConverter.java | 105 +++ .../converters/SuggestResultConverter.java | 50 ++ .../converters/SuggesterConverter.java | 59 ++ .../converters/SynonymMapConverter.java | 71 ++ .../SynonymTokenFilterConverter.java | 68 ++ .../TagScoringFunctionConverter.java | 74 ++ .../TagScoringParametersConverter.java | 43 + .../TextExtractionAlgorithmConverter.java | 51 ++ .../converters/TextSplitModeConverter.java | 50 ++ .../TextTranslationSkillConverter.java | 121 +++ ...TextTranslationSkillLanguageConverter.java | 34 + .../converters/TextWeightsConverter.java | 49 ++ .../TokenCharacterKindConverter.java | 63 ++ .../converters/TokenFilterConverter.java | 207 +++++ .../converters/TokenFilterNameConverter.java | 34 + .../TruncateTokenFilterConverter.java | 49 ++ .../UaxUrlEmailTokenizerConverter.java | 49 ++ .../UniqueTokenFilterConverter.java | 49 ++ .../converters/VisualFeatureConverter.java | 70 ++ .../converters/WebApiSkillConverter.java | 125 +++ .../WordDelimiterTokenFilterConverter.java | 110 +++ .../implementation/models/AnalyzeRequest.java | 244 ++++++ .../implementation/models/AnalyzeResult.java | 1 - .../models/AnalyzedTokenInfo.java | 85 ++ .../models/AsciiFoldingTokenFilter.java | 52 ++ .../models/AutocompleteItem.java | 46 ++ .../models/AutocompleteMode.java | 62 ++ .../models/AutocompleteOptions.java | 284 +++++++ .../models/AutocompleteRequest.java | 3 +- .../models/AutocompleteResult.java | 51 ++ ...ActiveDirectoryApplicationCredentials.java | 81 ++ .../implementation/models/BM25Similarity.java | 93 +++ .../implementation/models/CharFilter.java | 57 ++ .../implementation/models/CharFilterName.java | 39 + .../models/CjkBigramTokenFilter.java | 79 ++ .../models/CjkBigramTokenFilterScripts.java | 67 ++ .../models/ClassicSimilarity.java | 23 + .../models/ClassicTokenizer.java | 54 ++ .../models/CognitiveServicesAccount.java | 54 ++ .../models/CognitiveServicesAccountKey.java | 50 ++ .../models/CommonGramTokenFilter.java | 113 +++ .../models/ConditionalSkill.java | 21 + .../implementation/models/CorsOptions.java | 85 ++ .../implementation/models/CustomAnalyzer.java | 136 ++++ .../models/DataChangeDetectionPolicy.java | 25 + .../models/DataDeletionDetectionPolicy.java | 24 + .../models/DataSourceCredentials.java | 44 + .../DefaultCognitiveServicesAccount.java | 21 + .../DictionaryDecompounderTokenFilter.java | 164 ++++ .../models/DistanceScoringFunction.java | 49 ++ .../models/DistanceScoringParameters.java | 74 ++ .../models/EdgeNGramTokenFilter.java | 107 +++ .../models/EdgeNGramTokenFilterSide.java | 57 ++ .../models/EdgeNGramTokenFilterV2.java | 109 +++ .../models/EdgeNGramTokenizer.java | 105 +++ .../models/ElisionTokenFilter.java | 48 ++ .../implementation/models/EntityCategory.java | 82 ++ .../models/EntityRecognitionSkill.java | 155 ++++ .../EntityRecognitionSkillLanguage.java | 149 ++++ .../implementation/models/FacetResult.java | 64 ++ .../implementation/models/FieldMapping.java | 102 +++ .../models/FieldMappingFunction.java | 73 ++ .../models/FreshnessScoringFunction.java | 49 ++ .../models/FreshnessScoringParameters.java | 46 ++ .../models/GetIndexStatisticsResult.java | 48 ++ .../HighWaterMarkChangeDetectionPolicy.java | 49 ++ .../models/ImageAnalysisSkill.java | 107 +++ .../models/ImageAnalysisSkillLanguage.java | 59 ++ .../implementation/models/ImageDetail.java | 57 ++ .../implementation/models/IndexAction.java | 76 ++ .../models/IndexActionType.java | 67 ++ .../implementation/models/IndexBatch.java | 43 + .../models/IndexDocumentsResult.java | 35 + .../models/IndexerExecutionResult.java | 181 +++++ .../models/IndexerExecutionStatus.java | 67 ++ .../implementation/models/IndexerStatus.java | 62 ++ .../models/IndexingParameters.java | 143 ++++ .../implementation/models/IndexingResult.java | 90 +++ .../models/IndexingSchedule.java | 74 ++ .../models/InputFieldMappingEntry.java | 125 +++ .../models/KeepTokenFilter.java | 77 ++ .../models/KeyPhraseExtractionSkill.java | 85 ++ .../KeyPhraseExtractionSkillLanguage.java | 114 +++ .../models/KeywordMarkerTokenFilter.java | 77 ++ .../models/KeywordTokenizer.java | 49 ++ .../models/KeywordTokenizerV2.java | 53 ++ .../models/LanguageDetectionSkill.java | 22 + .../models/LengthTokenFilter.java | 78 ++ .../models/LexicalAnalyzer.java | 59 ++ .../models/LexicalAnalyzerName.java | 499 ++++++++++++ .../models/LexicalTokenizer.java | 67 ++ .../models/LexicalTokenizerName.java | 99 +++ .../models/LimitTokenFilter.java | 80 ++ .../models/ListDataSourcesResult.java | 1 - .../models/ListIndexersResult.java | 1 - .../models/ListIndexesResult.java | 1 - .../models/ListSkillsetsResult.java | 1 - .../models/ListSynonymMapsResult.java | 1 - .../models/LuceneStandardAnalyzer.java | 80 ++ .../models/LuceneStandardTokenizer.java | 50 ++ .../models/LuceneStandardTokenizerV2.java | 53 ++ .../models/MagnitudeScoringFunction.java | 49 ++ .../models/MagnitudeScoringParameters.java | 104 +++ .../models/MappingCharFilter.java | 55 ++ .../implementation/models/MergeSkill.java | 79 ++ .../MicrosoftLanguageStemmingTokenizer.java | 141 ++++ .../models/MicrosoftLanguageTokenizer.java | 140 ++++ .../MicrosoftStemmingTokenizerLanguage.java | 272 +++++++ .../models/MicrosoftTokenizerLanguage.java | 257 ++++++ .../models/NGramTokenFilter.java | 76 ++ .../models/NGramTokenFilterV2.java | 78 ++ .../implementation/models/NGramTokenizer.java | 105 +++ .../implementation/models/OcrSkill.java | 117 +++ .../models/OcrSkillLanguage.java | 164 ++++ .../models/OutputFieldMappingEntry.java | 70 ++ .../models/PathHierarchyTokenizerV2.java | 162 ++++ .../models/PatternAnalyzer.java | 139 ++++ .../models/PatternCaptureTokenFilter.java | 79 ++ .../models/PatternReplaceCharFilter.java | 77 ++ .../models/PatternReplaceTokenFilter.java | 77 ++ .../models/PatternTokenizer.java | 119 +++ .../models/PhoneticEncoder.java | 102 +++ .../models/PhoneticTokenFilter.java | 87 ++ .../implementation/models/QueryType.java | 57 ++ .../implementation/models/RegexFlags.java | 74 ++ .../implementation/models/RequestOptions.java | 45 ++ .../models/ResourceCounter.java | 68 ++ .../models/ScoringFunction.java | 116 +++ .../models/ScoringFunctionAggregation.java | 72 ++ .../models/ScoringFunctionInterpolation.java | 67 ++ .../implementation/models/ScoringProfile.java | 136 ++++ .../models/SearchDocumentsResult.java | 2 - .../models/SearchError.java | 2 +- .../models/SearchErrorException.java | 2 +- .../implementation/models/SearchField.java | 760 ++++++++++++++++++ .../models/SearchFieldDataType.java | 74 ++ .../implementation/models/SearchIndex.java | 406 ++++++++++ .../implementation/models/SearchIndexer.java | 317 ++++++++ .../models/SearchIndexerDataContainer.java | 78 ++ .../models/SearchIndexerDataSource.java | 234 ++++++ .../models/SearchIndexerDataSourceType.java | 59 ++ .../models/SearchIndexerError.java | 123 +++ .../models/SearchIndexerLimits.java | 69 ++ .../models/SearchIndexerSkill.java | 191 +++++ .../models/SearchIndexerSkillset.java | 150 ++++ .../models/SearchIndexerStatus.java | 82 ++ .../models/SearchIndexerWarning.java | 101 +++ .../implementation/models/SearchMode.java | 57 ++ .../implementation/models/SearchOptions.java | 562 +++++++++++++ .../implementation/models/SearchRequest.java | 9 +- .../models/SearchResourceEncryptionKey.java | 141 ++++ .../implementation/models/SearchResult.java | 82 ++ .../implementation/models/SentimentSkill.java | 55 ++ .../models/SentimentSkillLanguage.java | 109 +++ .../models/ServiceCounters.java | 202 +++++ .../implementation/models/ServiceLimits.java | 137 ++++ .../models/ServiceStatistics.java | 69 ++ .../implementation/models/ShaperSkill.java | 21 + .../models/ShingleTokenFilter.java | 202 +++++ .../implementation/models/Similarity.java | 28 + .../models/SnowballTokenFilter.java | 59 ++ .../models/SnowballTokenFilterLanguage.java | 157 ++++ ...ftDeleteColumnDeletionDetectionPolicy.java | 78 ++ .../implementation/models/SplitSkill.java | 108 +++ .../models/SplitSkillLanguage.java | 79 ++ .../SqlIntegratedChangeTrackingPolicy.java | 21 + .../models/StemmerOverrideTokenFilter.java | 54 ++ .../models/StemmerTokenFilter.java | 80 ++ .../models/StemmerTokenFilterLanguage.java | 317 ++++++++ .../implementation/models/StopAnalyzer.java | 48 ++ .../implementation/models/StopwordsList.java | 202 +++++ .../models/StopwordsTokenFilter.java | 155 ++++ .../models/SuggestDocumentsResult.java | 1 - .../implementation/models/SuggestOptions.java | 325 ++++++++ .../implementation/models/SuggestRequest.java | 2 +- .../implementation/models/SuggestResult.java | 61 ++ .../implementation/models/Suggester.java | 107 +++ .../implementation/models/SynonymMap.java | 188 +++++ .../models/SynonymTokenFilter.java | 141 ++++ .../models/TagScoringFunction.java | 49 ++ .../models/TagScoringParameters.java | 47 ++ .../models/TextExtractionAlgorithm.java | 57 ++ .../implementation/models/TextSplitMode.java | 57 ++ .../models/TextTranslationSkill.java | 171 ++++ .../models/TextTranslationSkillLanguage.java | 349 ++++++++ .../implementation/models/TextWeights.java | 49 ++ .../models/TokenCharacterKind.java | 72 ++ .../implementation/models/TokenFilter.java | 80 ++ .../models/TokenFilterName.java | 204 +++++ .../models/TruncateTokenFilter.java | 49 ++ .../models/UaxUrlEmailTokenizer.java | 53 ++ .../models/UniqueTokenFilter.java | 50 ++ .../implementation/models/VisualFeature.java | 82 ++ .../implementation/models/WebApiSkill.java | 187 +++++ .../models/WordDelimiterTokenFilter.java | 328 ++++++++ .../implementation/models/package-info.java | 2 +- .../implementation/util/Constants.java | 9 + .../util/DocumentResponseConversions.java | 13 +- .../implementation/util/MappingUtils.java | 171 ++++ .../util/PrivateFieldAccessHelper.java | 67 ++ ...plexSearchField.java => ComplexField.java} | 14 +- .../documents/models/LexicalAnalyzer.java | 2 +- .../documents/models/LexicalTokenizer.java | 2 +- .../documents/models/ScoringParameter.java | 11 + .../search/documents/models/SearchField.java | 50 +- .../documents/models/SearchIndexerSkill.java | 2 +- .../documents/util/SearchPagedResponse.java | 17 +- .../documents/util/SuggestPagedResponse.java | 6 +- .../src/main/java/module-info.java | 1 + .../HttpResponseExceptionExample.java | 3 +- .../search/documents/DataSourceSyncTests.java | 7 +- .../search/documents/FieldBuilderTest.java | 12 +- .../documents/IndexManagementSyncTests.java | 14 +- .../IndexersManagementSyncTests.java | 7 +- .../SkillsetManagementSyncTests.java | 7 +- .../SynonymMapManagementSyncTests.java | 7 +- .../azure/search/documents/TestHelpers.java | 3 +- .../azure-search-documents/swagger/readme.md | 280 +------ 368 files changed, 29381 insertions(+), 546 deletions(-) create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzedTokenInfoConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AsciiFoldingTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteItemConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteModeConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteOptionsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteResultConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AzureActiveDirectoryApplicationCredentialsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/BM25SimilarityConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterNameConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterScriptsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicSimilarityConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountKeyConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CommonGramTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ConditionalSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/Constants.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CorsOptionsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CustomAnalyzerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataChangeDetectionPolicyConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataDeletionDetectionPolicyConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataSourceCredentialsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DefaultCognitiveServicesAccountConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DictionaryDecompounderTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringFunctionConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringParametersConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterSideConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterV2Converter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityCategoryConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FacetResultConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingFunctionConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringFunctionConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringParametersConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/GetIndexStatisticsResultConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/HighWaterMarkChangeDetectionPolicyConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageDetailConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionTypeConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexBatchBaseConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexDocumentsResultConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionResultConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionStatusConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerStatusConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingParametersConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingResultConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingScheduleConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/InputFieldMappingEntryConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeepTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordMarkerTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerV2Converter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LanguageDetectionSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LengthTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerNameConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerNameConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LimitTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerV2Converter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringFunctionConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringParametersConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MappingCharFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MergeSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageStemmingTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftStemmingTokenizerLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftTokenizerLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterV2Converter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OutputFieldMappingEntryConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PathHierarchyTokenizerV2Converter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternCaptureTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceCharFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticEncoderConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/QueryTypeConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RegexFlagsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RequestOptionsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ResourceCounterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionAggregationConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionInterpolationConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldDataTypeConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataContainerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceTypeConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerErrorConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerLimitsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillsetConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerStatusConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerWarningConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchModeConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResourceEncryptionKeyConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResultConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceCountersConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceLimitsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceStatisticsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShaperSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShingleTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SimilarityConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SoftDeleteColumnDeletionDetectionPolicyConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SqlIntegratedChangeTrackingPolicyConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerOverrideTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsListConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestOptionsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestResultConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggesterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymMapConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringFunctionConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringParametersConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextExtractionAlgorithmConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextSplitModeConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillLanguageConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextWeightsConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenCharacterKindConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterNameConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TruncateTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UaxUrlEmailTokenizerConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UniqueTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/VisualFeatureConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WebApiSkillConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzeRequest.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzedTokenInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AsciiFoldingTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteItem.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteMode.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteOptions.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AzureActiveDirectoryApplicationCredentials.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/BM25Similarity.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CharFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CharFilterName.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CjkBigramTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CjkBigramTokenFilterScripts.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ClassicSimilarity.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ClassicTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CognitiveServicesAccount.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CognitiveServicesAccountKey.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CommonGramTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ConditionalSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CorsOptions.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CustomAnalyzer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataChangeDetectionPolicy.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataDeletionDetectionPolicy.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataSourceCredentials.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DefaultCognitiveServicesAccount.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DictionaryDecompounderTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DistanceScoringFunction.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DistanceScoringParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilterSide.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilterV2.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ElisionTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityCategory.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityRecognitionSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityRecognitionSkillLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FacetResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FieldMapping.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FieldMappingFunction.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FreshnessScoringFunction.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FreshnessScoringParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/GetIndexStatisticsResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/HighWaterMarkChangeDetectionPolicy.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageAnalysisSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageAnalysisSkillLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageDetail.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexActionType.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexBatch.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexDocumentsResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerExecutionResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerExecutionStatus.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerStatus.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingSchedule.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/InputFieldMappingEntry.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeepTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeyPhraseExtractionSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeyPhraseExtractionSkillLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordMarkerTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordTokenizerV2.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LanguageDetectionSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LengthTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalAnalyzer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalAnalyzerName.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalTokenizerName.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LimitTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardAnalyzer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardTokenizerV2.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MagnitudeScoringFunction.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MagnitudeScoringParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MappingCharFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MergeSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftLanguageStemmingTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftLanguageTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftStemmingTokenizerLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftTokenizerLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenFilterV2.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OcrSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OcrSkillLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OutputFieldMappingEntry.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PathHierarchyTokenizerV2.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternAnalyzer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternCaptureTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternReplaceCharFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternReplaceTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PhoneticEncoder.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PhoneticTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/QueryType.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/RegexFlags.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/RequestOptions.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ResourceCounter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunction.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunctionAggregation.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunctionInterpolation.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringProfile.java rename sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/{ => implementation}/models/SearchError.java (96%) rename sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/{ => implementation}/models/SearchErrorException.java (95%) create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchField.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchFieldDataType.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndex.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataContainer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataSource.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataSourceType.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerError.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerLimits.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerSkillset.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerStatus.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerWarning.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchMode.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchOptions.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchResourceEncryptionKey.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SentimentSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SentimentSkillLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceCounters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceLimits.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceStatistics.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ShaperSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ShingleTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/Similarity.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SnowballTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SnowballTokenFilterLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SoftDeleteColumnDeletionDetectionPolicy.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SplitSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SplitSkillLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SqlIntegratedChangeTrackingPolicy.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerOverrideTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerTokenFilterLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopAnalyzer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopwordsList.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopwordsTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestOptions.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/Suggester.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SynonymMap.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SynonymTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TagScoringFunction.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TagScoringParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextExtractionAlgorithm.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextSplitMode.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextTranslationSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextTranslationSkillLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextWeights.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenCharacterKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenFilterName.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TruncateTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/UaxUrlEmailTokenizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/UniqueTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/VisualFeature.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/WebApiSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/WordDelimiterTokenFilter.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/MappingUtils.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java rename sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/{ComplexSearchField.java => ComplexField.java} (80%) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexAsyncClient.java index d145f591496f..72539fa82619 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexAsyncClient.java @@ -12,11 +12,18 @@ import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.search.documents.implementation.SearchIndexRestClientImpl; +import com.azure.search.documents.implementation.converters.AutocompleteModeConverter; +import com.azure.search.documents.implementation.converters.IndexBatchBaseConverter; +import com.azure.search.documents.implementation.converters.IndexDocumentsResultConverter; +import com.azure.search.documents.implementation.converters.QueryTypeConverter; +import com.azure.search.documents.implementation.converters.RequestOptionsConverter; +import com.azure.search.documents.implementation.converters.SearchModeConverter; import com.azure.search.documents.implementation.models.AutocompleteRequest; import com.azure.search.documents.implementation.models.SearchContinuationToken; import com.azure.search.documents.implementation.models.SearchRequest; import com.azure.search.documents.implementation.models.SuggestRequest; import com.azure.search.documents.implementation.util.DocumentResponseConversions; +import com.azure.search.documents.implementation.util.MappingUtils; import com.azure.search.documents.implementation.util.SuggestOptionsHandler; import com.azure.search.documents.implementation.SearchIndexRestClientBuilder; import com.azure.search.documents.implementation.SerializationUtil; @@ -27,6 +34,7 @@ import com.azure.search.documents.models.IndexDocumentsBatch; import com.azure.search.documents.models.IndexDocumentsResult; import com.azure.search.documents.models.RequestOptions; +import com.azure.search.documents.models.ScoringParameter; import com.azure.search.documents.models.SearchOptions; import com.azure.search.documents.models.SearchResult; import com.azure.search.documents.models.SuggestOptions; @@ -42,6 +50,7 @@ import java.util.List; import java.util.function.Function; +import java.util.stream.Collectors; import static com.azure.core.util.FluxUtil.monoError; import static com.azure.core.util.FluxUtil.withContext; @@ -351,6 +360,7 @@ Mono> 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/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..f721b75085c5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java @@ -0,0 +1,94 @@ +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..19dbfc6e1545 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AsciiFoldingTokenFilterConverter.java @@ -0,0 +1,49 @@ +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..415515226f4d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteItemConverter.java @@ -0,0 +1,48 @@ +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..213cc295c272 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteModeConverter.java @@ -0,0 +1,55 @@ +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..ca8f13a33ed2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteOptionsConverter.java @@ -0,0 +1,99 @@ +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.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 = obj.getSearchFields().stream().collect(Collectors.toList()); + 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 = obj.getSearchFields().stream().collect(Collectors.toList()); + 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..c262e6d43631 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteResultConverter.java @@ -0,0 +1,60 @@ +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..c29732d2623c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AzureActiveDirectoryApplicationCredentialsConverter.java @@ -0,0 +1,51 @@ +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..be2c88823224 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/BM25SimilarityConverter.java @@ -0,0 +1,47 @@ +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..60f4cc1aa079 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterConverter.java @@ -0,0 +1,46 @@ +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.MappingCharFilter) { + return MappingCharFilterConverter.map((com.azure.search.documents.models.MappingCharFilter) obj); + } + if (obj instanceof com.azure.search.documents.models.PatternReplaceCharFilter) { + return PatternReplaceCharFilterConverter.map((com.azure.search.documents.models.PatternReplaceCharFilter) 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..19c68efc7df2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterNameConverter.java @@ -0,0 +1,34 @@ +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..a7db520455be --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java @@ -0,0 +1,65 @@ +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..2d082cab0202 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterScriptsConverter.java @@ -0,0 +1,59 @@ +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..b750c0205601 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicSimilarityConverter.java @@ -0,0 +1,37 @@ +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..ba10620871de --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicTokenizerConverter.java @@ -0,0 +1,47 @@ +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..975c94e59eba --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountConverter.java @@ -0,0 +1,48 @@ +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 DefaultCognitiveServicesAccount) { + return DefaultCognitiveServicesAccountConverter.map((DefaultCognitiveServicesAccount) obj); + } + if (obj instanceof CognitiveServicesAccountKey) { + return CognitiveServicesAccountKeyConverter.map((CognitiveServicesAccountKey) 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..3d2a67152498 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountKeyConverter.java @@ -0,0 +1,49 @@ +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..27635901c704 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CommonGramTokenFilterConverter.java @@ -0,0 +1,68 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.CommonGramTokenFilter; + +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 = obj.getCommonWords().stream().collect(Collectors.toList()); + 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 = obj.getCommonWords().stream().collect(Collectors.toList()); + 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..3e2124aa1a18 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ConditionalSkillConverter.java @@ -0,0 +1,82 @@ +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..fc0fdec33225 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/Constants.java @@ -0,0 +1,9 @@ +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..0b206fe82210 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CorsOptionsConverter.java @@ -0,0 +1,54 @@ +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.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 = obj.getAllowedOrigins().stream().collect(Collectors.toList()); + 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 = obj.getAllowedOrigins().stream().collect(Collectors.toList()); + 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..ba4ba6ecc052 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CustomAnalyzerConverter.java @@ -0,0 +1,82 @@ +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..4e3c3106bba4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataChangeDetectionPolicyConverter.java @@ -0,0 +1,48 @@ +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 SqlIntegratedChangeTrackingPolicy) { + return SqlIntegratedChangeTrackingPolicyConverter.map((SqlIntegratedChangeTrackingPolicy) obj); + } + if (obj instanceof HighWaterMarkChangeDetectionPolicy) { + return HighWaterMarkChangeDetectionPolicyConverter.map((HighWaterMarkChangeDetectionPolicy) 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..c71738df6ad0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataDeletionDetectionPolicyConverter.java @@ -0,0 +1,41 @@ +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..879d86e07efb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataSourceCredentialsConverter.java @@ -0,0 +1,43 @@ +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..84fa4f387ca7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DefaultCognitiveServicesAccountConverter.java @@ -0,0 +1,42 @@ +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..f3b0ee1fafa7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DictionaryDecompounderTokenFilterConverter.java @@ -0,0 +1,79 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.DictionaryDecompounderTokenFilter; + +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 = obj.getWordList().stream().collect(Collectors.toList()); + 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 = obj.getWordList().stream().collect(Collectors.toList()); + 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..784e1bcf6beb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringFunctionConverter.java @@ -0,0 +1,74 @@ +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..0c49457cbcae --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringParametersConverter.java @@ -0,0 +1,49 @@ +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..09a5511ca583 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterConverter.java @@ -0,0 +1,67 @@ +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..f5d8eef0f305 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterSideConverter.java @@ -0,0 +1,51 @@ +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..f95191c756b9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterV2Converter.java @@ -0,0 +1,67 @@ +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..8243c6d919cb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java @@ -0,0 +1,71 @@ +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..4b8dea33f246 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java @@ -0,0 +1,56 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.ElisionTokenFilter; + +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 = obj.getArticles().stream().collect(Collectors.toList()); + 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 = obj.getArticles().stream().collect(Collectors.toList()); + 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..c1521a372723 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityCategoryConverter.java @@ -0,0 +1,71 @@ +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..8ff6f02e1305 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java @@ -0,0 +1,122 @@ +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..3b8b6bf1e2e4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillLanguageConverter.java @@ -0,0 +1,34 @@ +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..e4c9977c45fc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FacetResultConverter.java @@ -0,0 +1,58 @@ +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(e -> e.getKey(), + e -> e.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(e -> e.getKey(), + e -> e.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..592335f2a8c6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingConverter.java @@ -0,0 +1,58 @@ +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..6294d9aa0edd --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingFunctionConverter.java @@ -0,0 +1,58 @@ +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(e -> e.getKey(), e -> e.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(e -> e.getKey(), e -> e.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..74b85fe1e9b5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringFunctionConverter.java @@ -0,0 +1,74 @@ +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..55d705956566 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringParametersConverter.java @@ -0,0 +1,45 @@ +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..0319d42b8af5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/GetIndexStatisticsResultConverter.java @@ -0,0 +1,50 @@ +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..085b514086f3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/HighWaterMarkChangeDetectionPolicyConverter.java @@ -0,0 +1,43 @@ +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..c9b4f7a4d009 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java @@ -0,0 +1,123 @@ +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..7474f49f3233 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillLanguageConverter.java @@ -0,0 +1,34 @@ +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..00c80b4f6755 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageDetailConverter.java @@ -0,0 +1,48 @@ +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..3841633cfbae --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionConverter.java @@ -0,0 +1,66 @@ +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.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 jsonMapper = new ObjectMapper(); + Map additionalProperties = jsonMapper.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..13d8c343f30a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionTypeConverter.java @@ -0,0 +1,59 @@ +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..1d37e210e5f3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexBatchBaseConverter.java @@ -0,0 +1,52 @@ +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..d3bd4260ca47 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexDocumentsResultConverter.java @@ -0,0 +1,54 @@ +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..36ec80743bee --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionResultConverter.java @@ -0,0 +1,122 @@ +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..7a646ae45dcd --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionStatusConverter.java @@ -0,0 +1,59 @@ +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..09f61d0915c0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerStatusConverter.java @@ -0,0 +1,54 @@ +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..35b7007e83fe --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingParametersConverter.java @@ -0,0 +1,72 @@ +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(e -> e.getKey(), + e -> e.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(e -> e.getKey(), + e -> e.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..4ee76b39fe89 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingResultConverter.java @@ -0,0 +1,60 @@ +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..1f8890fe2617 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingScheduleConverter.java @@ -0,0 +1,50 @@ +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..9062c8e73f79 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/InputFieldMappingEntryConverter.java @@ -0,0 +1,70 @@ +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..d181845cb10c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeepTokenFilterConverter.java @@ -0,0 +1,60 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.KeepTokenFilter; + +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 = obj.getKeepWords().stream().collect(Collectors.toList()); + 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 = obj.getKeepWords().stream().collect(Collectors.toList()); + 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..f89a8d246bcd --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillConverter.java @@ -0,0 +1,103 @@ +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..a758057bd1a6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillLanguageConverter.java @@ -0,0 +1,34 @@ +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..79a5c40dc9b4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordMarkerTokenFilterConverter.java @@ -0,0 +1,62 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.KeywordMarkerTokenFilter; + +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 = obj.getKeywords().stream().collect(Collectors.toList()); + 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 = obj.getKeywords().stream().collect(Collectors.toList()); + 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..32da8b1ecafb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerConverter.java @@ -0,0 +1,47 @@ +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..054ba3cdb086 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerV2Converter.java @@ -0,0 +1,49 @@ +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..dff7fec85133 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LanguageDetectionSkillConverter.java @@ -0,0 +1,84 @@ +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..7b5355ddacbc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LengthTokenFilterConverter.java @@ -0,0 +1,55 @@ +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..36faeb3e4385 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerConverter.java @@ -0,0 +1,61 @@ +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 PatternAnalyzer) { + return PatternAnalyzerConverter.map((PatternAnalyzer) obj); + } + if (obj instanceof LuceneStandardAnalyzer) { + return LuceneStandardAnalyzerConverter.map((LuceneStandardAnalyzer) obj); + } + if (obj instanceof StopAnalyzer) { + return StopAnalyzerConverter.map((StopAnalyzer) obj); + } + if (obj instanceof CustomAnalyzer) { + return CustomAnalyzerConverter.map((CustomAnalyzer) 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.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); + } + if (obj instanceof com.azure.search.documents.models.LuceneStandardAnalyzer) { + return LuceneStandardAnalyzerConverter.map((com.azure.search.documents.models.LuceneStandardAnalyzer) 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..a3df489d48f7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerNameConverter.java @@ -0,0 +1,34 @@ +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..b44f45b7045a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerConverter.java @@ -0,0 +1,117 @@ +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 LuceneStandardTokenizerV2) { + return LuceneStandardTokenizerV2Converter.map((LuceneStandardTokenizerV2) obj); + } + if (obj instanceof MicrosoftLanguageTokenizer) { + return MicrosoftLanguageTokenizerConverter.map((MicrosoftLanguageTokenizer) obj); + } + if (obj instanceof KeywordTokenizer) { + return KeywordTokenizerConverter.map((KeywordTokenizer) obj); + } + if (obj instanceof NGramTokenizer) { + return NGramTokenizerConverter.map((NGramTokenizer) obj); + } + if (obj instanceof ClassicTokenizer) { + return ClassicTokenizerConverter.map((ClassicTokenizer) obj); + } + if (obj instanceof PathHierarchyTokenizerV2) { + return PathHierarchyTokenizerV2Converter.map((PathHierarchyTokenizerV2) obj); + } + if (obj instanceof UaxUrlEmailTokenizer) { + return UaxUrlEmailTokenizerConverter.map((UaxUrlEmailTokenizer) obj); + } + if (obj instanceof PatternTokenizer) { + return PatternTokenizerConverter.map((PatternTokenizer) obj); + } + if (obj instanceof MicrosoftLanguageStemmingTokenizer) { + return MicrosoftLanguageStemmingTokenizerConverter.map((MicrosoftLanguageStemmingTokenizer) obj); + } + if (obj instanceof KeywordTokenizerV2) { + return KeywordTokenizerV2Converter.map((KeywordTokenizerV2) obj); + } + if (obj instanceof EdgeNGramTokenizer) { + return EdgeNGramTokenizerConverter.map((EdgeNGramTokenizer) obj); + } + if (obj instanceof LuceneStandardTokenizer) { + return LuceneStandardTokenizerConverter.map((LuceneStandardTokenizer) 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.MicrosoftLanguageStemmingTokenizer) { + return MicrosoftLanguageStemmingTokenizerConverter.map((com.azure.search.documents.models.MicrosoftLanguageStemmingTokenizer) 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.NGramTokenizer) { + return NGramTokenizerConverter.map((com.azure.search.documents.models.NGramTokenizer) 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.PatternTokenizer) { + return PatternTokenizerConverter.map((com.azure.search.documents.models.PatternTokenizer) 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.KeywordTokenizerV2) { + return KeywordTokenizerV2Converter.map((com.azure.search.documents.models.KeywordTokenizerV2) 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.MicrosoftLanguageTokenizer) { + return MicrosoftLanguageTokenizerConverter.map((com.azure.search.documents.models.MicrosoftLanguageTokenizer) 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.KeywordTokenizer) { + return KeywordTokenizerConverter.map((com.azure.search.documents.models.KeywordTokenizer) obj); + } + if (obj instanceof com.azure.search.documents.models.PathHierarchyTokenizerV2) { + return PathHierarchyTokenizerV2Converter.map((com.azure.search.documents.models.PathHierarchyTokenizerV2) 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..19388fa9bc10 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerNameConverter.java @@ -0,0 +1,34 @@ +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..bc6872c51f10 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LimitTokenFilterConverter.java @@ -0,0 +1,53 @@ +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..cc23617c6fe5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java @@ -0,0 +1,62 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.LuceneStandardAnalyzer; + +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 = obj.getStopwords().stream().collect(Collectors.toList()); + 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 = obj.getStopwords().stream().collect(Collectors.toList()); + 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..8fa7b10a3815 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerConverter.java @@ -0,0 +1,49 @@ +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..8b1685cff2df --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerV2Converter.java @@ -0,0 +1,49 @@ +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..2d00ecdd6cfa --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringFunctionConverter.java @@ -0,0 +1,74 @@ +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..7d26c7513b06 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringParametersConverter.java @@ -0,0 +1,55 @@ +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..1813fea6ac0f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MappingCharFilterConverter.java @@ -0,0 +1,56 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.MappingCharFilter; + +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 = obj.getMappings().stream().collect(Collectors.toList()); + 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 = obj.getMappings().stream().collect(Collectors.toList()); + 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..686f80ca3fc8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MergeSkillConverter.java @@ -0,0 +1,93 @@ +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..c20572127238 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageStemmingTokenizerConverter.java @@ -0,0 +1,68 @@ +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..501deea0a088 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageTokenizerConverter.java @@ -0,0 +1,67 @@ +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..269c60b84201 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftStemmingTokenizerLanguageConverter.java @@ -0,0 +1,223 @@ +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..80c71b085080 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftTokenizerLanguageConverter.java @@ -0,0 +1,211 @@ +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..5a72883b70ed --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterConverter.java @@ -0,0 +1,53 @@ +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..7da060670963 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterV2Converter.java @@ -0,0 +1,55 @@ +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..ee2ea1fc82a7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java @@ -0,0 +1,69 @@ +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..81861e951793 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillConverter.java @@ -0,0 +1,112 @@ +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..3607b1aa399c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillLanguageConverter.java @@ -0,0 +1,34 @@ +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..5314f3f63d4d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OutputFieldMappingEntryConverter.java @@ -0,0 +1,49 @@ +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..039ecfcd1a4c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PathHierarchyTokenizerV2Converter.java @@ -0,0 +1,73 @@ +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..0894661c7586 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java @@ -0,0 +1,82 @@ +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); + private static final String DELIMITER = "\\|"; + + /** + * 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(DELIMITER)).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(DELIMITER)); + patternAnalyzer.setFlags(com.azure.search.documents.implementation.models.RegexFlags.fromString(flattenFlags)); + } + + if (obj.getStopwords() != null) { + List _stopwords = obj.getStopwords().stream().collect(Collectors.toList()); + 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..2be86ab7c20b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternCaptureTokenFilterConverter.java @@ -0,0 +1,62 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.PatternCaptureTokenFilter; + +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 = obj.getPatterns().stream().collect(Collectors.toList()); + 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 = obj.getPatterns().stream().collect(Collectors.toList()); + 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..6f737635c6b6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceCharFilterConverter.java @@ -0,0 +1,55 @@ +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..340d69a95b0e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceTokenFilterConverter.java @@ -0,0 +1,55 @@ +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..96cb375e08cc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java @@ -0,0 +1,71 @@ +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); + private static final String DELIMITER = "\\|"; + + /** + * 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(DELIMITER)).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(DELIMITER)); + 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..51d3d3336cf8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticEncoderConverter.java @@ -0,0 +1,87 @@ +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..1206fd9d7980 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticTokenFilterConverter.java @@ -0,0 +1,61 @@ +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..04c34d260e8a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/QueryTypeConverter.java @@ -0,0 +1,48 @@ +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..f6c96b8ca8a3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RegexFlagsConverter.java @@ -0,0 +1,31 @@ +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..b2df2b4b513a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RequestOptionsConverter.java @@ -0,0 +1,43 @@ +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..4b3a429e1a3b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ResourceCounterConverter.java @@ -0,0 +1,47 @@ +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..70adc5754fe7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionAggregationConverter.java @@ -0,0 +1,63 @@ +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..f469c67bb0ee --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionConverter.java @@ -0,0 +1,61 @@ +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 MagnitudeScoringFunction) { + return MagnitudeScoringFunctionConverter.map((MagnitudeScoringFunction) obj); + } + if (obj instanceof DistanceScoringFunction) { + return DistanceScoringFunctionConverter.map((DistanceScoringFunction) 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.DistanceScoringFunction) { + return DistanceScoringFunctionConverter.map((com.azure.search.documents.models.DistanceScoringFunction) obj); + } + if (obj instanceof com.azure.search.documents.models.FreshnessScoringFunction) { + return FreshnessScoringFunctionConverter.map((com.azure.search.documents.models.FreshnessScoringFunction) 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..7373fd132e29 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionInterpolationConverter.java @@ -0,0 +1,59 @@ +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..ca6b9d686682 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java @@ -0,0 +1,82 @@ +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..07d93a6af966 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldConverter.java @@ -0,0 +1,148 @@ +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 = obj.getSynonymMaps().stream().collect(Collectors.toList()); + 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..cbc9b792fff1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldDataTypeConverter.java @@ -0,0 +1,34 @@ +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..e4f6041f2b3b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexConverter.java @@ -0,0 +1,183 @@ +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..70db8fd1f316 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerConverter.java @@ -0,0 +1,128 @@ +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..f76cceb91303 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataContainerConverter.java @@ -0,0 +1,49 @@ +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..24be44f17b3a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceConverter.java @@ -0,0 +1,116 @@ +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..ad16547f276f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceTypeConverter.java @@ -0,0 +1,34 @@ +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..2a9db18fb164 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerErrorConverter.java @@ -0,0 +1,74 @@ +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..be34e104d11f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerLimitsConverter.java @@ -0,0 +1,60 @@ +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..110ffcd9664d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillConverter.java @@ -0,0 +1,110 @@ +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.InputFieldMappingEntry; +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.OutputFieldMappingEntry; +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 java.util.List; +import java.util.stream.Collectors; + +import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_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 SplitSkill) { + return SplitSkillConverter.map((SplitSkill) obj); + } + if (obj instanceof SentimentSkill) { + return SentimentSkillConverter.map((SentimentSkill) obj); + } + if (obj instanceof MergeSkill) { + return MergeSkillConverter.map((MergeSkill) obj); + } + if (obj instanceof LanguageDetectionSkill) { + return LanguageDetectionSkillConverter.map((LanguageDetectionSkill) obj); + } + if (obj instanceof ImageAnalysisSkill) { + return ImageAnalysisSkillConverter.map((ImageAnalysisSkill) obj); + } + if (obj instanceof OcrSkill) { + return OcrSkillConverter.map((OcrSkill) obj); + } + if (obj instanceof ShaperSkill) { + return ShaperSkillConverter.map((ShaperSkill) obj); + } + if (obj instanceof EntityRecognitionSkill) { + return EntityRecognitionSkillConverter.map((EntityRecognitionSkill) obj); + } + if (obj instanceof WebApiSkill) { + return WebApiSkillConverter.map((WebApiSkill) obj); + } + if (obj instanceof ConditionalSkill) { + return ConditionalSkillConverter.map((ConditionalSkill) obj); + } + if (obj instanceof KeyPhraseExtractionSkill) { + return KeyPhraseExtractionSkillConverter.map((KeyPhraseExtractionSkill) obj); + } + if (obj instanceof TextTranslationSkill) { + return TextTranslationSkillConverter.map((TextTranslationSkill) obj); + } + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + /** + * Maps from {@link SearchIndexerSkill} to + * {@link com.azure.search.documents.implementation.models.SearchIndexerSkill}. + */ + public static com.azure.search.documents.implementation.models.SearchIndexerSkill map(SearchIndexerSkill obj) { + if (obj == null) { + return null; + } + com.azure.search.documents.implementation.models.SearchIndexerSkill searchIndexerSkill = + new com.azure.search.documents.implementation.models.SearchIndexerSkill(); + + if (obj.getOutputs() != null) { + List _outputs = + obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); + searchIndexerSkill.setOutputs(_outputs); + } + + if (obj.getInputs() != null) { + List _inputs = + obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); + searchIndexerSkill.setInputs(_inputs); + } + + String _name = obj.getName(); + searchIndexerSkill.setName(_name); + + String _context = obj.getContext(); + searchIndexerSkill.setContext(_context); + + String _description = obj.getDescription(); + searchIndexerSkill.setDescription(_description); + return searchIndexerSkill; + } +} 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..e4541cfd6b0b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillsetConverter.java @@ -0,0 +1,84 @@ +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..1c817a187520 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerStatusConverter.java @@ -0,0 +1,89 @@ +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..84cd5d07d303 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerWarningConverter.java @@ -0,0 +1,68 @@ +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..e246045d4bae --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchModeConverter.java @@ -0,0 +1,48 @@ +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..d94fb40d80df --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResourceEncryptionKeyConverter.java @@ -0,0 +1,67 @@ +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..7767f91ced67 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResultConverter.java @@ -0,0 +1,64 @@ +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(e -> e.getKey(), e -> e.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..593f76b863a0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillConverter.java @@ -0,0 +1,95 @@ +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..cb02f1b1c39a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillLanguageConverter.java @@ -0,0 +1,34 @@ +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..88fb9662f720 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceCountersConverter.java @@ -0,0 +1,113 @@ +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..a2cbce1f9e55 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceLimitsConverter.java @@ -0,0 +1,58 @@ +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..34d1c56e71a3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceStatisticsConverter.java @@ -0,0 +1,61 @@ +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..d31f88890356 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShaperSkillConverter.java @@ -0,0 +1,81 @@ +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..528dbdf461f6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShingleTokenFilterConverter.java @@ -0,0 +1,79 @@ +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..a7d3f38bec53 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SimilarityConverter.java @@ -0,0 +1,34 @@ +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..c30e8fed5d2f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterConverter.java @@ -0,0 +1,55 @@ +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..e7ffe290879e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterLanguageConverter.java @@ -0,0 +1,131 @@ +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..18bca2c12c25 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SoftDeleteColumnDeletionDetectionPolicyConverter.java @@ -0,0 +1,50 @@ +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..da2d7dd47692 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillConverter.java @@ -0,0 +1,111 @@ +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..852fc005666f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillLanguageConverter.java @@ -0,0 +1,34 @@ +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..e571f9c7e409 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SqlIntegratedChangeTrackingPolicyConverter.java @@ -0,0 +1,36 @@ +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..d5384c226e04 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerOverrideTokenFilterConverter.java @@ -0,0 +1,56 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.StemmerOverrideTokenFilter; + +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 = obj.getRules().stream().collect(Collectors.toList()); + 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 = obj.getRules().stream().collect(Collectors.toList()); + 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..6931a65a331e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterConverter.java @@ -0,0 +1,55 @@ +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..45ab2876c2ff --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterLanguageConverter.java @@ -0,0 +1,259 @@ +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..b3f960f4f792 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java @@ -0,0 +1,53 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.StopAnalyzer; + +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 = obj.getStopwords().stream().collect(Collectors.toList()); + 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 = obj.getStopwords().stream().collect(Collectors.toList()); + 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..ef9ebbc795dd --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsListConverter.java @@ -0,0 +1,166 @@ +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..15d5eba45638 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsTokenFilterConverter.java @@ -0,0 +1,80 @@ +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.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 = obj.getStopwords().stream().collect(Collectors.toList()); + 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 = obj.getStopwords().stream().collect(Collectors.toList()); + 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..b1d78bb184bf --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestOptionsConverter.java @@ -0,0 +1,105 @@ +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..2317f03bd4bf --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestResultConverter.java @@ -0,0 +1,50 @@ +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..5b3ebdd420da --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggesterConverter.java @@ -0,0 +1,59 @@ +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..2f4f19282169 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymMapConverter.java @@ -0,0 +1,71 @@ +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..9cd86d8fe762 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymTokenFilterConverter.java @@ -0,0 +1,68 @@ +package com.azure.search.documents.implementation.converters; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.search.documents.models.SynonymTokenFilter; + +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 = obj.getSynonyms().stream().collect(Collectors.toList()); + 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 = obj.getSynonyms().stream().collect(Collectors.toList()); + 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..7bae414f4168 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringFunctionConverter.java @@ -0,0 +1,74 @@ +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..d9a1ead0886f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringParametersConverter.java @@ -0,0 +1,43 @@ +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..ba9fe3c7db70 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextExtractionAlgorithmConverter.java @@ -0,0 +1,51 @@ +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..6a976d371b0d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextSplitModeConverter.java @@ -0,0 +1,50 @@ +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..9fe4d6fc89b5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillConverter.java @@ -0,0 +1,121 @@ +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..040a509293c9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillLanguageConverter.java @@ -0,0 +1,34 @@ +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..9e1cd2b06392 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextWeightsConverter.java @@ -0,0 +1,49 @@ +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(e -> e.getKey(), e -> e.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(e -> e.getKey(), e -> e.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..675f26983986 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenCharacterKindConverter.java @@ -0,0 +1,63 @@ +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..dc4232cda2c3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterConverter.java @@ -0,0 +1,207 @@ +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 SnowballTokenFilter) { + return SnowballTokenFilterConverter.map((SnowballTokenFilter) obj); + } + if (obj instanceof CjkBigramTokenFilter) { + return CjkBigramTokenFilterConverter.map((CjkBigramTokenFilter) obj); + } + if (obj instanceof LengthTokenFilter) { + return LengthTokenFilterConverter.map((LengthTokenFilter) obj); + } + if (obj instanceof StemmerTokenFilter) { + return StemmerTokenFilterConverter.map((StemmerTokenFilter) obj); + } + if (obj instanceof StemmerOverrideTokenFilter) { + return StemmerOverrideTokenFilterConverter.map((StemmerOverrideTokenFilter) obj); + } + if (obj instanceof EdgeNGramTokenFilterV2) { + return EdgeNGramTokenFilterV2Converter.map((EdgeNGramTokenFilterV2) obj); + } + if (obj instanceof PatternReplaceTokenFilter) { + return PatternReplaceTokenFilterConverter.map((PatternReplaceTokenFilter) obj); + } + if (obj instanceof PatternCaptureTokenFilter) { + return PatternCaptureTokenFilterConverter.map((PatternCaptureTokenFilter) obj); + } + if (obj instanceof LimitTokenFilter) { + return LimitTokenFilterConverter.map((LimitTokenFilter) obj); + } + if (obj instanceof StopwordsTokenFilter) { + return StopwordsTokenFilterConverter.map((StopwordsTokenFilter) obj); + } + if (obj instanceof NGramTokenFilterV2) { + return NGramTokenFilterV2Converter.map((NGramTokenFilterV2) obj); + } + if (obj instanceof KeywordMarkerTokenFilter) { + return KeywordMarkerTokenFilterConverter.map((KeywordMarkerTokenFilter) obj); + } + if (obj instanceof DictionaryDecompounderTokenFilter) { + return DictionaryDecompounderTokenFilterConverter.map((DictionaryDecompounderTokenFilter) obj); + } + if (obj instanceof TruncateTokenFilter) { + return TruncateTokenFilterConverter.map((TruncateTokenFilter) obj); + } + if (obj instanceof ElisionTokenFilter) { + return ElisionTokenFilterConverter.map((ElisionTokenFilter) obj); + } + if (obj instanceof KeepTokenFilter) { + return KeepTokenFilterConverter.map((KeepTokenFilter) obj); + } + if (obj instanceof CommonGramTokenFilter) { + return CommonGramTokenFilterConverter.map((CommonGramTokenFilter) obj); + } + if (obj instanceof ShingleTokenFilter) { + return ShingleTokenFilterConverter.map((ShingleTokenFilter) obj); + } + if (obj instanceof WordDelimiterTokenFilter) { + return WordDelimiterTokenFilterConverter.map((WordDelimiterTokenFilter) obj); + } + if (obj instanceof PhoneticTokenFilter) { + return PhoneticTokenFilterConverter.map((PhoneticTokenFilter) obj); + } + if (obj instanceof NGramTokenFilter) { + return NGramTokenFilterConverter.map((NGramTokenFilter) obj); + } + if (obj instanceof UniqueTokenFilter) { + return UniqueTokenFilterConverter.map((UniqueTokenFilter) obj); + } + if (obj instanceof SynonymTokenFilter) { + return SynonymTokenFilterConverter.map((SynonymTokenFilter) obj); + } + if (obj instanceof AsciiFoldingTokenFilter) { + return AsciiFoldingTokenFilterConverter.map((AsciiFoldingTokenFilter) obj); + } + if (obj instanceof EdgeNGramTokenFilter) { + return EdgeNGramTokenFilterConverter.map((EdgeNGramTokenFilter) 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.CommonGramTokenFilter) { + return CommonGramTokenFilterConverter.map((com.azure.search.documents.models.CommonGramTokenFilter) 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.NGramTokenFilterV2) { + return NGramTokenFilterV2Converter.map((com.azure.search.documents.models.NGramTokenFilterV2) obj); + } + if (obj instanceof com.azure.search.documents.models.StemmerOverrideTokenFilter) { + return StemmerOverrideTokenFilterConverter.map((com.azure.search.documents.models.StemmerOverrideTokenFilter) 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.AsciiFoldingTokenFilter) { + return AsciiFoldingTokenFilterConverter.map((com.azure.search.documents.models.AsciiFoldingTokenFilter) 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.KeywordMarkerTokenFilter) { + return KeywordMarkerTokenFilterConverter.map((com.azure.search.documents.models.KeywordMarkerTokenFilter) 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.EdgeNGramTokenFilter) { + return EdgeNGramTokenFilterConverter.map((com.azure.search.documents.models.EdgeNGramTokenFilter) 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.PatternReplaceTokenFilter) { + return PatternReplaceTokenFilterConverter.map((com.azure.search.documents.models.PatternReplaceTokenFilter) 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.TruncateTokenFilter) { + return TruncateTokenFilterConverter.map((com.azure.search.documents.models.TruncateTokenFilter) 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.UniqueTokenFilter) { + return UniqueTokenFilterConverter.map((com.azure.search.documents.models.UniqueTokenFilter) 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.CjkBigramTokenFilter) { + return CjkBigramTokenFilterConverter.map((com.azure.search.documents.models.CjkBigramTokenFilter) 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.PatternCaptureTokenFilter) { + return PatternCaptureTokenFilterConverter.map((com.azure.search.documents.models.PatternCaptureTokenFilter) 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.StemmerTokenFilter) { + return StemmerTokenFilterConverter.map((com.azure.search.documents.models.StemmerTokenFilter) 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.PhoneticTokenFilter) { + return PhoneticTokenFilterConverter.map((com.azure.search.documents.models.PhoneticTokenFilter) obj); + } + if (obj instanceof com.azure.search.documents.models.DictionaryDecompounderTokenFilter) { + return DictionaryDecompounderTokenFilterConverter.map((com.azure.search.documents.models.DictionaryDecompounderTokenFilter) 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..ccceac52a08f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterNameConverter.java @@ -0,0 +1,34 @@ +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..24e1196e6e88 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TruncateTokenFilterConverter.java @@ -0,0 +1,49 @@ +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..75fad7a10d73 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UaxUrlEmailTokenizerConverter.java @@ -0,0 +1,49 @@ +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..6878cb7efc08 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UniqueTokenFilterConverter.java @@ -0,0 +1,49 @@ +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..5e7a6823c0ed --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/VisualFeatureConverter.java @@ -0,0 +1,70 @@ +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..a7dfec1643c3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WebApiSkillConverter.java @@ -0,0 +1,125 @@ +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(e -> e.getKey(), e -> e.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(e -> e.getKey(), e -> e.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..594f3d38b054 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java @@ -0,0 +1,110 @@ +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/AnalyzeRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzeRequest.java new file mode 100644 index 000000000000..c7e48276f7bb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzeRequest.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Specifies some text and analysis components used to break that text into + * tokens. + */ +@Fluent +public final class AnalyzeRequest { + /* + * The text to break into tokens. + */ + @JsonProperty(value = "text", required = true) + private String text; + + /* + * The name of the analyzer to use to break the given text. If this + * parameter is not specified, you must specify a tokenizer instead. The + * tokenizer and analyzer parameters are mutually exclusive. Possible + * values include: 'ArMicrosoft', 'ArLucene', 'HyLucene', 'BnMicrosoft', + * 'EuLucene', 'BgMicrosoft', 'BgLucene', 'CaMicrosoft', 'CaLucene', + * 'ZhHansMicrosoft', 'ZhHansLucene', 'ZhHantMicrosoft', 'ZhHantLucene', + * 'HrMicrosoft', 'CsMicrosoft', 'CsLucene', 'DaMicrosoft', 'DaLucene', + * 'NlMicrosoft', 'NlLucene', 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', + * 'FiMicrosoft', 'FiLucene', 'FrMicrosoft', 'FrLucene', 'GlLucene', + * 'DeMicrosoft', 'DeLucene', 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', + * 'HeMicrosoft', 'HiMicrosoft', 'HiLucene', 'HuMicrosoft', 'HuLucene', + * 'IsMicrosoft', 'IdMicrosoft', 'IdLucene', 'GaLucene', 'ItMicrosoft', + * 'ItLucene', 'JaMicrosoft', 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', + * 'KoLucene', 'LvMicrosoft', 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', + * 'MsMicrosoft', 'MrMicrosoft', 'NbMicrosoft', 'NoLucene', 'FaLucene', + * 'PlMicrosoft', 'PlLucene', 'PtBrMicrosoft', 'PtBrLucene', + * 'PtPtMicrosoft', 'PtPtLucene', 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', + * 'RuMicrosoft', 'RuLucene', 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', + * 'SkMicrosoft', 'SlMicrosoft', 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', + * 'SvLucene', 'TaMicrosoft', 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', + * 'TrMicrosoft', 'TrLucene', 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', + * 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', + * 'Simple', 'Stop', 'Whitespace' + */ + @JsonProperty(value = "analyzer") + private LexicalAnalyzerName analyzer; + + /* + * The name of the tokenizer to use to break the given text. If this + * parameter is not specified, you must specify an analyzer instead. The + * tokenizer and analyzer parameters are mutually exclusive. Possible + * values include: 'Classic', 'EdgeNGram', 'Keyword', 'Letter', + * 'Lowercase', 'MicrosoftLanguageTokenizer', + * 'MicrosoftLanguageStemmingTokenizer', 'NGram', 'PathHierarchy', + * 'Pattern', 'Standard', 'UaxUrlEmail', 'Whitespace' + */ + @JsonProperty(value = "tokenizer") + private LexicalTokenizerName tokenizer; + + /* + * An optional list of token filters to use when breaking the given text. + * This parameter can only be set when using the tokenizer parameter. + */ + @JsonProperty(value = "tokenFilters") + private List tokenFilters; + + /* + * An optional list of character filters to use when breaking the given + * text. This parameter can only be set when using the tokenizer parameter. + */ + @JsonProperty(value = "charFilters") + private List charFilters; + + /** + * Get the text property: The text to break into tokens. + * + * @return the text value. + */ + public String getText() { + return this.text; + } + + /** + * Set the text property: The text to break into tokens. + * + * @param text the text value to set. + * @return the AnalyzeRequest object itself. + */ + public AnalyzeRequest setText(String text) { + this.text = text; + return this; + } + + /** + * Get the analyzer property: The name of the analyzer to use to break the + * given text. If this parameter is not specified, you must specify a + * tokenizer instead. The tokenizer and analyzer parameters are mutually + * exclusive. Possible values include: 'ArMicrosoft', 'ArLucene', + * 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', + * 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', + * 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', + * 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', 'NlLucene', + * 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', + * 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', 'DeLucene', + * 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', + * 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', + * 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', + * 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', + * 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', + * 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', 'PlLucene', + * 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', 'PtPtLucene', + * 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', 'RuLucene', + * 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', 'SlMicrosoft', + * 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', 'TaMicrosoft', + * 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', 'TrLucene', + * 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', 'StandardLucene', + * 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop', + * 'Whitespace'. + * + * @return the analyzer value. + */ + public LexicalAnalyzerName getAnalyzer() { + return this.analyzer; + } + + /** + * Set the analyzer property: The name of the analyzer to use to break the + * given text. If this parameter is not specified, you must specify a + * tokenizer instead. The tokenizer and analyzer parameters are mutually + * exclusive. Possible values include: 'ArMicrosoft', 'ArLucene', + * 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', + * 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', + * 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', + * 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', 'NlLucene', + * 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', + * 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', 'DeLucene', + * 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', + * 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', + * 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', + * 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', + * 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', + * 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', 'PlLucene', + * 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', 'PtPtLucene', + * 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', 'RuLucene', + * 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', 'SlMicrosoft', + * 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', 'TaMicrosoft', + * 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', 'TrLucene', + * 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', 'StandardLucene', + * 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop', + * 'Whitespace'. + * + * @param analyzer the analyzer value to set. + * @return the AnalyzeRequest object itself. + */ + public AnalyzeRequest setAnalyzer(LexicalAnalyzerName analyzer) { + this.analyzer = analyzer; + return this; + } + + /** + * Get the tokenizer property: The name of the tokenizer to use to break + * the given text. If this parameter is not specified, you must specify an + * analyzer instead. The tokenizer and analyzer parameters are mutually + * exclusive. Possible values include: 'Classic', 'EdgeNGram', 'Keyword', + * 'Letter', 'Lowercase', 'MicrosoftLanguageTokenizer', + * 'MicrosoftLanguageStemmingTokenizer', 'NGram', 'PathHierarchy', + * 'Pattern', 'Standard', 'UaxUrlEmail', 'Whitespace'. + * + * @return the tokenizer value. + */ + public LexicalTokenizerName getTokenizer() { + return this.tokenizer; + } + + /** + * Set the tokenizer property: The name of the tokenizer to use to break + * the given text. If this parameter is not specified, you must specify an + * analyzer instead. The tokenizer and analyzer parameters are mutually + * exclusive. Possible values include: 'Classic', 'EdgeNGram', 'Keyword', + * 'Letter', 'Lowercase', 'MicrosoftLanguageTokenizer', + * 'MicrosoftLanguageStemmingTokenizer', 'NGram', 'PathHierarchy', + * 'Pattern', 'Standard', 'UaxUrlEmail', 'Whitespace'. + * + * @param tokenizer the tokenizer value to set. + * @return the AnalyzeRequest object itself. + */ + public AnalyzeRequest setTokenizer(LexicalTokenizerName tokenizer) { + this.tokenizer = tokenizer; + return this; + } + + /** + * Get the tokenFilters property: An optional list of token filters to use + * when breaking the given text. This parameter can only be set when using + * the tokenizer parameter. + * + * @return the tokenFilters value. + */ + public List getTokenFilters() { + return this.tokenFilters; + } + + /** + * Set the tokenFilters property: An optional list of token filters to use + * when breaking the given text. This parameter can only be set when using + * the tokenizer parameter. + * + * @param tokenFilters the tokenFilters value to set. + * @return the AnalyzeRequest object itself. + */ + public AnalyzeRequest setTokenFilters(List tokenFilters) { + this.tokenFilters = tokenFilters; + return this; + } + + /** + * Get the charFilters property: An optional list of character filters to + * use when breaking the given text. This parameter can only be set when + * using the tokenizer parameter. + * + * @return the charFilters value. + */ + public List getCharFilters() { + return this.charFilters; + } + + /** + * Set the charFilters property: An optional list of character filters to + * use when breaking the given text. This parameter can only be set when + * using the tokenizer parameter. + * + * @param charFilters the charFilters value to set. + * @return the AnalyzeRequest object itself. + */ + public AnalyzeRequest setCharFilters(List charFilters) { + this.charFilters = charFilters; + return this; + } +} 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/AnalyzedTokenInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzedTokenInfo.java new file mode 100644 index 000000000000..97dcb31dd71b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzedTokenInfo.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a token returned by an analyzer. + */ +@Fluent +public final class AnalyzedTokenInfo { + /* + * The token returned by the analyzer. + */ + @JsonProperty(value = "token", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String token; + + /* + * The index of the first character of the token in the input text. + */ + @JsonProperty(value = "startOffset", required = true, access = JsonProperty.Access.WRITE_ONLY) + private int startOffset; + + /* + * The index of the last character of the token in the input text. + */ + @JsonProperty(value = "endOffset", required = true, access = JsonProperty.Access.WRITE_ONLY) + private int endOffset; + + /* + * The position of the token in the input text relative to other tokens. + * The first token in the input text has position 0, the next has position + * 1, and so on. Depending on the analyzer used, some tokens might have the + * same position, for example if they are synonyms of each other. + */ + @JsonProperty(value = "position", required = true, access = JsonProperty.Access.WRITE_ONLY) + private int position; + + /** + * Get the token property: The token returned by the analyzer. + * + * @return the token value. + */ + public String getToken() { + return this.token; + } + + /** + * Get the startOffset property: The index of the first character of the + * token in the input text. + * + * @return the startOffset value. + */ + public int getStartOffset() { + return this.startOffset; + } + + /** + * Get the endOffset property: The index of the last character of the token + * in the input text. + * + * @return the endOffset value. + */ + public int getEndOffset() { + return this.endOffset; + } + + /** + * Get the position property: The position of the token in the input text + * relative to other tokens. The first token in the input text has position + * 0, the next has position 1, and so on. Depending on the analyzer used, + * some tokens might have the same position, for example if they are + * synonyms of each other. + * + * @return the position value. + */ + public int getPosition() { + return this.position; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AsciiFoldingTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AsciiFoldingTokenFilter.java new file mode 100644 index 000000000000..de53c7f825bc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AsciiFoldingTokenFilter.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Converts alphabetic, numeric, and symbolic Unicode characters which are not + * in the first 127 ASCII characters (the "Basic Latin" Unicode block) into + * their ASCII equivalents, if such equivalents exist. This token filter is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.AsciiFoldingTokenFilter") +@Fluent +public final class AsciiFoldingTokenFilter extends TokenFilter { + /* + * A value indicating whether the original token will be kept. Default is + * false. + */ + @JsonProperty(value = "preserveOriginal") + private Boolean preserveOriginal; + + /** + * Get the preserveOriginal property: A value indicating whether the + * original token will be kept. Default is false. + * + * @return the preserveOriginal value. + */ + public Boolean isPreserveOriginal() { + return this.preserveOriginal; + } + + /** + * Set the preserveOriginal property: A value indicating whether the + * original token will be kept. Default is false. + * + * @param preserveOriginal the preserveOriginal value to set. + * @return the AsciiFoldingTokenFilter object itself. + */ + public AsciiFoldingTokenFilter setPreserveOriginal(Boolean preserveOriginal) { + this.preserveOriginal = preserveOriginal; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteItem.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteItem.java new file mode 100644 index 000000000000..4360346cae6a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteItem.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of Autocomplete requests. + */ +@Fluent +public final class AutocompleteItem { + /* + * The completed term. + */ + @JsonProperty(value = "text", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String text; + + /* + * The query along with the completed term. + */ + @JsonProperty(value = "queryPlusText", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String queryPlusText; + + /** + * Get the text property: The completed term. + * + * @return the text value. + */ + public String getText() { + return this.text; + } + + /** + * Get the queryPlusText property: The query along with the completed term. + * + * @return the queryPlusText value. + */ + public String getQueryPlusText() { + return this.queryPlusText; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteMode.java new file mode 100644 index 000000000000..0a111a99c43e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteMode.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AutocompleteMode. + */ +public enum AutocompleteMode { + /** + * Enum value oneTerm. + */ + ONE_TERM("oneTerm"), + + /** + * Enum value twoTerms. + */ + TWO_TERMS("twoTerms"), + + /** + * Enum value oneTermWithContext. + */ + ONE_TERM_WITH_CONTEXT("oneTermWithContext"); + + /** + * The actual serialized value for a AutocompleteMode instance. + */ + private final String value; + + AutocompleteMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AutocompleteMode instance. + * + * @param value the serialized value to parse. + * @return the parsed AutocompleteMode object, or null if unable to parse. + */ + @JsonCreator + public static AutocompleteMode fromString(String value) { + AutocompleteMode[] items = AutocompleteMode.values(); + for (AutocompleteMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteOptions.java new file mode 100644 index 000000000000..5c2c4792181b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteOptions.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Arrays; +import java.util.List; + +/** + * Additional parameters for autocompleteGet operation. + */ +@Fluent +public final class AutocompleteOptions { + /* + * Specifies the mode for Autocomplete. The default is 'oneTerm'. Use + * 'twoTerms' to get shingles and 'oneTermWithContext' to use the current + * context while producing auto-completed terms. Possible values include: + * 'OneTerm', 'TwoTerms', 'OneTermWithContext' + */ + @JsonProperty(value = "") + private AutocompleteMode autocompleteMode; + + /* + * An OData expression that filters the documents used to produce completed + * terms for the Autocomplete result. + */ + @JsonProperty(value = "") + private String filter; + + /* + * A value indicating whether to use fuzzy matching for the autocomplete + * query. Default is false. When set to true, the query will find terms + * even if there's a substituted or missing character in the search text. + * While this provides a better experience in some scenarios, it comes at a + * performance cost as fuzzy autocomplete queries are slower and consume + * more resources. + */ + @JsonProperty(value = "") + private Boolean useFuzzyMatching; + + /* + * A string tag that is appended to hit highlights. Must be set with + * highlightPreTag. If omitted, hit highlighting is disabled. + */ + @JsonProperty(value = "") + private String highlightPostTag; + + /* + * A string tag that is prepended to hit highlights. Must be set with + * highlightPostTag. If omitted, hit highlighting is disabled. + */ + @JsonProperty(value = "") + private String highlightPreTag; + + /* + * A number between 0 and 100 indicating the percentage of the index that + * must be covered by an autocomplete query in order for the query to be + * reported as a success. This parameter can be useful for ensuring search + * availability even for services with only one replica. The default is 80. + */ + @JsonProperty(value = "") + private Double minimumCoverage; + + /* + * The list of field names to consider when querying for auto-completed + * terms. Target fields must be included in the specified suggester. + */ + @JsonProperty(value = "") + private List searchFields; + + /* + * The number of auto-completed terms to retrieve. This must be a value + * between 1 and 100. The default is 5. + */ + @JsonProperty(value = "") + private Integer top; + + /** + * Get the autocompleteMode property: Specifies the mode for Autocomplete. + * The default is 'oneTerm'. Use 'twoTerms' to get shingles and + * 'oneTermWithContext' to use the current context while producing + * auto-completed terms. Possible values include: 'OneTerm', 'TwoTerms', + * 'OneTermWithContext'. + * + * @return the autocompleteMode value. + */ + public AutocompleteMode getAutocompleteMode() { + return this.autocompleteMode; + } + + /** + * Set the autocompleteMode property: Specifies the mode for Autocomplete. + * The default is 'oneTerm'. Use 'twoTerms' to get shingles and + * 'oneTermWithContext' to use the current context while producing + * auto-completed terms. Possible values include: 'OneTerm', 'TwoTerms', + * 'OneTermWithContext'. + * + * @param autocompleteMode the autocompleteMode value to set. + * @return the AutocompleteOptions object itself. + */ + public AutocompleteOptions setAutocompleteMode(AutocompleteMode autocompleteMode) { + this.autocompleteMode = autocompleteMode; + return this; + } + + /** + * Get the filter property: An OData expression that filters the documents + * used to produce completed terms for the Autocomplete result. + * + * @return the filter value. + */ + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData expression that filters the documents + * used to produce completed terms for the Autocomplete result. + * + * @param filter the filter value to set. + * @return the AutocompleteOptions object itself. + */ + public AutocompleteOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the useFuzzyMatching property: A value indicating whether to use + * fuzzy matching for the autocomplete query. Default is false. When set to + * true, the query will find terms even if there's a substituted or missing + * character in the search text. While this provides a better experience in + * some scenarios, it comes at a performance cost as fuzzy autocomplete + * queries are slower and consume more resources. + * + * @return the useFuzzyMatching value. + */ + public Boolean isUseFuzzyMatching() { + return this.useFuzzyMatching; + } + + /** + * Set the useFuzzyMatching property: A value indicating whether to use + * fuzzy matching for the autocomplete query. Default is false. When set to + * true, the query will find terms even if there's a substituted or missing + * character in the search text. While this provides a better experience in + * some scenarios, it comes at a performance cost as fuzzy autocomplete + * queries are slower and consume more resources. + * + * @param useFuzzyMatching the useFuzzyMatching value to set. + * @return the AutocompleteOptions object itself. + */ + public AutocompleteOptions setUseFuzzyMatching(Boolean useFuzzyMatching) { + this.useFuzzyMatching = useFuzzyMatching; + return this; + } + + /** + * Get the highlightPostTag property: A string tag that is appended to hit + * highlights. Must be set with highlightPreTag. If omitted, hit + * highlighting is disabled. + * + * @return the highlightPostTag value. + */ + public String getHighlightPostTag() { + return this.highlightPostTag; + } + + /** + * Set the highlightPostTag property: A string tag that is appended to hit + * highlights. Must be set with highlightPreTag. If omitted, hit + * highlighting is disabled. + * + * @param highlightPostTag the highlightPostTag value to set. + * @return the AutocompleteOptions object itself. + */ + public AutocompleteOptions setHighlightPostTag(String highlightPostTag) { + this.highlightPostTag = highlightPostTag; + return this; + } + + /** + * Get the highlightPreTag property: A string tag that is prepended to hit + * highlights. Must be set with highlightPostTag. If omitted, hit + * highlighting is disabled. + * + * @return the highlightPreTag value. + */ + public String getHighlightPreTag() { + return this.highlightPreTag; + } + + /** + * Set the highlightPreTag property: A string tag that is prepended to hit + * highlights. Must be set with highlightPostTag. If omitted, hit + * highlighting is disabled. + * + * @param highlightPreTag the highlightPreTag value to set. + * @return the AutocompleteOptions object itself. + */ + public AutocompleteOptions setHighlightPreTag(String highlightPreTag) { + this.highlightPreTag = highlightPreTag; + return this; + } + + /** + * Get the minimumCoverage property: A number between 0 and 100 indicating + * the percentage of the index that must be covered by an autocomplete + * query in order for the query to be reported as a success. This parameter + * can be useful for ensuring search availability even for services with + * only one replica. The default is 80. + * + * @return the minimumCoverage value. + */ + public Double getMinimumCoverage() { + return this.minimumCoverage; + } + + /** + * Set the minimumCoverage property: A number between 0 and 100 indicating + * the percentage of the index that must be covered by an autocomplete + * query in order for the query to be reported as a success. This parameter + * can be useful for ensuring search availability even for services with + * only one replica. The default is 80. + * + * @param minimumCoverage the minimumCoverage value to set. + * @return the AutocompleteOptions object itself. + */ + public AutocompleteOptions setMinimumCoverage(Double minimumCoverage) { + this.minimumCoverage = minimumCoverage; + return this; + } + + /** + * Get the searchFields property: The list of field names to consider when + * querying for auto-completed terms. Target fields must be included in the + * specified suggester. + * + * @return the searchFields value. + */ + public List getSearchFields() { + return this.searchFields; + } + + /** + * Set the searchFields property: The list of field names to consider when + * querying for auto-completed terms. Target fields must be included in the + * specified suggester. + * + * @param searchFields the searchFields value to set. + * @return the AutocompleteOptions object itself. + */ + public AutocompleteOptions setSearchFields(String... searchFields) { + this.searchFields = Arrays.asList(searchFields); + return this; + } + + /** + * Get the top property: The number of auto-completed terms to retrieve. + * This must be a value between 1 and 100. The default is 5. + * + * @return the top value. + */ + public Integer getTop() { + return this.top; + } + + /** + * Set the top property: The number of auto-completed terms to retrieve. + * This must be a value between 1 and 100. The default is 5. + * + * @param top the top value to set. + * @return the AutocompleteOptions object itself. + */ + public AutocompleteOptions setTop(Integer top) { + this.top = top; + return this; + } +} 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/AutocompleteResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteResult.java new file mode 100644 index 000000000000..c5bd35133dbf --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The result of Autocomplete query. + */ +@Fluent +public final class AutocompleteResult { + /* + * A value indicating the percentage of the index that was considered by + * the autocomplete request, or null if minimumCoverage was not specified + * in the request. + */ + @JsonProperty(value = "@search.coverage", access = JsonProperty.Access.WRITE_ONLY) + private Double coverage; + + /* + * The list of returned Autocompleted items. + */ + @JsonProperty(value = "value", required = true, access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get the coverage property: A value indicating the percentage of the + * index that was considered by the autocomplete request, or null if + * minimumCoverage was not specified in the request. + * + * @return the coverage value. + */ + public Double getCoverage() { + return this.coverage; + } + + /** + * Get the results property: The list of returned Autocompleted items. + * + * @return the results value. + */ + public List getResults() { + return this.results; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AzureActiveDirectoryApplicationCredentials.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AzureActiveDirectoryApplicationCredentials.java new file mode 100644 index 000000000000..ea3fa28e4708 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AzureActiveDirectoryApplicationCredentials.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Credentials of a registered application created for your search service, + * used for authenticated access to the encryption keys stored in Azure Key + * Vault. + */ +@Fluent +public final class AzureActiveDirectoryApplicationCredentials { + /* + * An AAD Application ID that was granted the required access permissions + * to the Azure Key Vault that is to be used when encrypting your data at + * rest. The Application ID should not be confused with the Object ID for + * your AAD Application. + */ + @JsonProperty(value = "applicationId", required = true) + private String applicationId; + + /* + * The authentication key of the specified AAD application. + */ + @JsonProperty(value = "applicationSecret") + private String applicationSecret; + + /** + * Get the applicationId property: An AAD Application ID that was granted + * the required access permissions to the Azure Key Vault that is to be + * used when encrypting your data at rest. The Application ID should not be + * confused with the Object ID for your AAD Application. + * + * @return the applicationId value. + */ + public String getApplicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: An AAD Application ID that was granted + * the required access permissions to the Azure Key Vault that is to be + * used when encrypting your data at rest. The Application ID should not be + * confused with the Object ID for your AAD Application. + * + * @param applicationId the applicationId value to set. + * @return the AzureActiveDirectoryApplicationCredentials object itself. + */ + public AzureActiveDirectoryApplicationCredentials setApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get the applicationSecret property: The authentication key of the + * specified AAD application. + * + * @return the applicationSecret value. + */ + public String getApplicationSecret() { + return this.applicationSecret; + } + + /** + * Set the applicationSecret property: The authentication key of the + * specified AAD application. + * + * @param applicationSecret the applicationSecret value to set. + * @return the AzureActiveDirectoryApplicationCredentials object itself. + */ + public AzureActiveDirectoryApplicationCredentials setApplicationSecret(String applicationSecret) { + this.applicationSecret = applicationSecret; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/BM25Similarity.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/BM25Similarity.java new file mode 100644 index 000000000000..d58b570422b1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/BM25Similarity.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a + * TF-IDF-like algorithm that includes length normalization (controlled by the + * 'b' parameter) as well as term frequency saturation (controlled by the 'k1' + * parameter). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.BM25Similarity") +@Fluent +public final class BM25Similarity extends Similarity { + /* + * This property controls the scaling function between the term frequency + * of each matching terms and the final relevance score of a document-query + * pair. By default, a value of 1.2 is used. A value of 0.0 means the score + * does not scale with an increase in term frequency. + */ + @JsonProperty(value = "k1") + private Double k1; + + /* + * This property controls how the length of a document affects the + * relevance score. By default, a value of 0.75 is used. A value of 0.0 + * means no length normalization is applied, while a value of 1.0 means the + * score is fully normalized by the length of the document. + */ + @JsonProperty(value = "b") + private Double b; + + /** + * Get the k1 property: This property controls the scaling function between + * the term frequency of each matching terms and the final relevance score + * of a document-query pair. By default, a value of 1.2 is used. A value of + * 0.0 means the score does not scale with an increase in term frequency. + * + * @return the k1 value. + */ + public Double getK1() { + return this.k1; + } + + /** + * Set the k1 property: This property controls the scaling function between + * the term frequency of each matching terms and the final relevance score + * of a document-query pair. By default, a value of 1.2 is used. A value of + * 0.0 means the score does not scale with an increase in term frequency. + * + * @param k1 the k1 value to set. + * @return the BM25Similarity object itself. + */ + public BM25Similarity setK1(Double k1) { + this.k1 = k1; + return this; + } + + /** + * Get the b property: This property controls how the length of a document + * affects the relevance score. By default, a value of 0.75 is used. A + * value of 0.0 means no length normalization is applied, while a value of + * 1.0 means the score is fully normalized by the length of the document. + * + * @return the b value. + */ + public Double getB() { + return this.b; + } + + /** + * Set the b property: This property controls how the length of a document + * affects the relevance score. By default, a value of 0.75 is used. A + * value of 0.0 means no length normalization is applied, while a value of + * 1.0 means the score is fully normalized by the length of the document. + * + * @param b the b value to set. + * @return the BM25Similarity object itself. + */ + public BM25Similarity setB(Double b) { + this.b = b; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CharFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CharFilter.java new file mode 100644 index 000000000000..9b8947f38cb8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CharFilter.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for character filters. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = CharFilter.class) +@JsonTypeName("CharFilter") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.MappingCharFilter", value = MappingCharFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.PatternReplaceCharFilter", value = PatternReplaceCharFilter.class) +}) +@Fluent +public class CharFilter { + /* + * The name of the char filter. It must only contain letters, digits, + * spaces, dashes or underscores, can only start and end with alphanumeric + * characters, and is limited to 128 characters. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: The name of the char filter. It must only contain + * letters, digits, spaces, dashes or underscores, can only start and end + * with alphanumeric characters, and is limited to 128 characters. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the char filter. It must only contain + * letters, digits, spaces, dashes or underscores, can only start and end + * with alphanumeric characters, and is limited to 128 characters. + * + * @param name the name value to set. + * @return the CharFilter object itself. + */ + public CharFilter setName(String name) { + this.name = name; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CharFilterName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CharFilterName.java new file mode 100644 index 000000000000..726c2502fefd --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CharFilterName.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for CharFilterName. + */ +public final class CharFilterName extends ExpandableStringEnum { + /** + * Static value html_strip for CharFilterName. + */ + public static final CharFilterName HTML_STRIP = fromString("html_strip"); + + /** + * Creates or finds a CharFilterName from its string representation. + * + * @param name a name to look for. + * @return the corresponding CharFilterName. + */ + @JsonCreator + public static CharFilterName fromString(String name) { + return fromString(name, CharFilterName.class); + } + + /** + * @return known CharFilterName values. + */ + public static Collection values() { + return values(CharFilterName.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CjkBigramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CjkBigramTokenFilter.java new file mode 100644 index 000000000000..9efe8dbcf87a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CjkBigramTokenFilter.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Forms bigrams of CJK terms that are generated from the standard tokenizer. + * This token filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.CjkBigramTokenFilter") +@Fluent +public final class CjkBigramTokenFilter extends TokenFilter { + /* + * The scripts to ignore. + */ + @JsonProperty(value = "ignoreScripts") + private List ignoreScripts; + + /* + * A value indicating whether to output both unigrams and bigrams (if + * true), or just bigrams (if false). Default is false. + */ + @JsonProperty(value = "outputUnigrams") + private Boolean outputUnigrams; + + /** + * Get the ignoreScripts property: The scripts to ignore. + * + * @return the ignoreScripts value. + */ + public List getIgnoreScripts() { + return this.ignoreScripts; + } + + /** + * Set the ignoreScripts property: The scripts to ignore. + * + * @param ignoreScripts the ignoreScripts value to set. + * @return the CjkBigramTokenFilter object itself. + */ + public CjkBigramTokenFilter setIgnoreScripts(List ignoreScripts) { + this.ignoreScripts = ignoreScripts; + return this; + } + + /** + * Get the outputUnigrams property: A value indicating whether to output + * both unigrams and bigrams (if true), or just bigrams (if false). Default + * is false. + * + * @return the outputUnigrams value. + */ + public Boolean isOutputUnigrams() { + return this.outputUnigrams; + } + + /** + * Set the outputUnigrams property: A value indicating whether to output + * both unigrams and bigrams (if true), or just bigrams (if false). Default + * is false. + * + * @param outputUnigrams the outputUnigrams value to set. + * @return the CjkBigramTokenFilter object itself. + */ + public CjkBigramTokenFilter setOutputUnigrams(Boolean outputUnigrams) { + this.outputUnigrams = outputUnigrams; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CjkBigramTokenFilterScripts.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CjkBigramTokenFilterScripts.java new file mode 100644 index 000000000000..8c0ad50f6bd2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CjkBigramTokenFilterScripts.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CjkBigramTokenFilterScripts. + */ +public enum CjkBigramTokenFilterScripts { + /** + * Enum value han. + */ + HAN("han"), + + /** + * Enum value hiragana. + */ + HIRAGANA("hiragana"), + + /** + * Enum value katakana. + */ + KATAKANA("katakana"), + + /** + * Enum value hangul. + */ + HANGUL("hangul"); + + /** + * The actual serialized value for a CjkBigramTokenFilterScripts instance. + */ + private final String value; + + CjkBigramTokenFilterScripts(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CjkBigramTokenFilterScripts instance. + * + * @param value the serialized value to parse. + * @return the parsed CjkBigramTokenFilterScripts object, or null if unable to parse. + */ + @JsonCreator + public static CjkBigramTokenFilterScripts fromString(String value) { + CjkBigramTokenFilterScripts[] items = CjkBigramTokenFilterScripts.values(); + for (CjkBigramTokenFilterScripts item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ClassicSimilarity.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ClassicSimilarity.java new file mode 100644 index 000000000000..13466235cf31 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ClassicSimilarity.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Legacy similarity algorithm which uses the Lucene TFIDFSimilarity + * implementation of TF-IDF. This variation of TF-IDF introduces static + * document length normalization as well as coordinating factors that penalize + * documents that only partially match the searched queries. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.ClassicSimilarity") +@Fluent +public final class ClassicSimilarity extends Similarity { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ClassicTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ClassicTokenizer.java new file mode 100644 index 000000000000..b51f1c6a4363 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ClassicTokenizer.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Grammar-based tokenizer that is suitable for processing most + * European-language documents. This tokenizer is implemented using Apache + * Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.ClassicTokenizer") +@Fluent +public final class ClassicTokenizer extends LexicalTokenizer { + /* + * The maximum token length. Default is 255. Tokens longer than the maximum + * length are split. The maximum token length that can be used is 300 + * characters. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /** + * Get the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the ClassicTokenizer object itself. + */ + public ClassicTokenizer setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CognitiveServicesAccount.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CognitiveServicesAccount.java new file mode 100644 index 000000000000..42997615ccd9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CognitiveServicesAccount.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for describing any cognitive service resource attached to a + * skillset. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = CognitiveServicesAccount.class) +@JsonTypeName("CognitiveServicesAccount") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.DefaultCognitiveServices", value = DefaultCognitiveServicesAccount.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.CognitiveServicesByKey", value = CognitiveServicesAccountKey.class) +}) +@Fluent +public class CognitiveServicesAccount { + /* + * Description of the cognitive service resource attached to a skillset. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the description property: Description of the cognitive service + * resource attached to a skillset. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Description of the cognitive service + * resource attached to a skillset. + * + * @param description the description value to set. + * @return the CognitiveServicesAccount object itself. + */ + public CognitiveServicesAccount setDescription(String description) { + this.description = description; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CognitiveServicesAccountKey.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CognitiveServicesAccountKey.java new file mode 100644 index 000000000000..fc5ee0c22596 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CognitiveServicesAccountKey.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A cognitive service resource provisioned with a key that is attached to a + * skillset. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.CognitiveServicesByKey") +@Fluent +public final class CognitiveServicesAccountKey extends CognitiveServicesAccount { + /* + * The key used to provision the cognitive service resource attached to a + * skillset. + */ + @JsonProperty(value = "key", required = true) + private String key; + + /** + * Get the key property: The key used to provision the cognitive service + * resource attached to a skillset. + * + * @return the key value. + */ + public String getKey() { + return this.key; + } + + /** + * Set the key property: The key used to provision the cognitive service + * resource attached to a skillset. + * + * @param key the key value to set. + * @return the CognitiveServicesAccountKey object itself. + */ + public CognitiveServicesAccountKey setKey(String key) { + this.key = key; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CommonGramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CommonGramTokenFilter.java new file mode 100644 index 000000000000..d0550ae2fa25 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CommonGramTokenFilter.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Construct bigrams for frequently occurring terms while indexing. Single + * terms are still indexed too, with bigrams overlaid. This token filter is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.CommonGramTokenFilter") +@Fluent +public final class CommonGramTokenFilter extends TokenFilter { + /* + * The set of common words. + */ + @JsonProperty(value = "commonWords", required = true) + private List commonWords; + + /* + * A value indicating whether common words matching will be case + * insensitive. Default is false. + */ + @JsonProperty(value = "ignoreCase") + private Boolean ignoreCase; + + /* + * A value that indicates whether the token filter is in query mode. When + * in query mode, the token filter generates bigrams and then removes + * common words and single terms followed by a common word. Default is + * false. + */ + @JsonProperty(value = "queryMode") + private Boolean useQueryMode; + + /** + * Get the commonWords property: The set of common words. + * + * @return the commonWords value. + */ + public List getCommonWords() { + return this.commonWords; + } + + /** + * Set the commonWords property: The set of common words. + * + * @param commonWords the commonWords value to set. + * @return the CommonGramTokenFilter object itself. + */ + public CommonGramTokenFilter setCommonWords(List commonWords) { + this.commonWords = commonWords; + return this; + } + + /** + * Get the ignoreCase property: A value indicating whether common words + * matching will be case insensitive. Default is false. + * + * @return the ignoreCase value. + */ + public Boolean isIgnoreCase() { + return this.ignoreCase; + } + + /** + * Set the ignoreCase property: A value indicating whether common words + * matching will be case insensitive. Default is false. + * + * @param ignoreCase the ignoreCase value to set. + * @return the CommonGramTokenFilter object itself. + */ + public CommonGramTokenFilter setIgnoreCase(Boolean ignoreCase) { + this.ignoreCase = ignoreCase; + return this; + } + + /** + * Get the useQueryMode property: A value that indicates whether the token + * filter is in query mode. When in query mode, the token filter generates + * bigrams and then removes common words and single terms followed by a + * common word. Default is false. + * + * @return the useQueryMode value. + */ + public Boolean isUseQueryMode() { + return this.useQueryMode; + } + + /** + * Set the useQueryMode property: A value that indicates whether the token + * filter is in query mode. When in query mode, the token filter generates + * bigrams and then removes common words and single terms followed by a + * common word. Default is false. + * + * @param useQueryMode the useQueryMode value to set. + * @return the CommonGramTokenFilter object itself. + */ + public CommonGramTokenFilter setUseQueryMode(Boolean useQueryMode) { + this.useQueryMode = useQueryMode; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ConditionalSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ConditionalSkill.java new file mode 100644 index 000000000000..022fae9c0e05 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ConditionalSkill.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A skill that enables scenarios that require a Boolean operation to determine + * the data to assign to an output. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Util.ConditionalSkill") +@Fluent +public final class ConditionalSkill extends SearchIndexerSkill { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CorsOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CorsOptions.java new file mode 100644 index 000000000000..391d46d9f269 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CorsOptions.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Arrays; +import java.util.List; + +/** + * Defines options to control Cross-Origin Resource Sharing (CORS) for an + * index. + */ +@Fluent +public final class CorsOptions { + /* + * The list of origins from which JavaScript code will be granted access to + * your index. Can contain a list of hosts of the form + * {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to + * allow all origins (not recommended). + */ + @JsonProperty(value = "allowedOrigins", required = true) + private List allowedOrigins; + + /* + * The duration for which browsers should cache CORS preflight responses. + * Defaults to 5 minutes. + */ + @JsonProperty(value = "maxAgeInSeconds") + private Long maxAgeInSeconds; + + /** + * Get the allowedOrigins property: The list of origins from which + * JavaScript code will be granted access to your index. Can contain a list + * of hosts of the form + * {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to + * allow all origins (not recommended). + * + * @return the allowedOrigins value. + */ + public List getAllowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the allowedOrigins property: The list of origins from which + * JavaScript code will be granted access to your index. Can contain a list + * of hosts of the form + * {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to + * allow all origins (not recommended). + * + * @param allowedOrigins the allowedOrigins value to set. + * @return the CorsOptions object itself. + */ + public CorsOptions setAllowedOrigins(String... allowedOrigins) { + this.allowedOrigins = Arrays.asList(allowedOrigins); + return this; + } + + /** + * Get the maxAgeInSeconds property: The duration for which browsers should + * cache CORS preflight responses. Defaults to 5 minutes. + * + * @return the maxAgeInSeconds value. + */ + public Long getMaxAgeInSeconds() { + return this.maxAgeInSeconds; + } + + /** + * Set the maxAgeInSeconds property: The duration for which browsers should + * cache CORS preflight responses. Defaults to 5 minutes. + * + * @param maxAgeInSeconds the maxAgeInSeconds value to set. + * @return the CorsOptions object itself. + */ + public CorsOptions setMaxAgeInSeconds(Long maxAgeInSeconds) { + this.maxAgeInSeconds = maxAgeInSeconds; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CustomAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CustomAnalyzer.java new file mode 100644 index 000000000000..b290aa229db9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/CustomAnalyzer.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Allows you to take control over the process of converting text into + * indexable/searchable tokens. It's a user-defined configuration consisting of + * a single predefined tokenizer and one or more filters. The tokenizer is + * responsible for breaking text into tokens, and the filters for modifying + * tokens emitted by the tokenizer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.CustomAnalyzer") +@Fluent +public final class CustomAnalyzer extends LexicalAnalyzer { + /* + * The name of the tokenizer to use to divide continuous text into a + * sequence of tokens, such as breaking a sentence into words. Possible + * values include: 'Classic', 'EdgeNGram', 'Keyword', 'Letter', + * 'Lowercase', 'MicrosoftLanguageTokenizer', + * 'MicrosoftLanguageStemmingTokenizer', 'NGram', 'PathHierarchy', + * 'Pattern', 'Standard', 'UaxUrlEmail', 'Whitespace' + */ + @JsonProperty(value = "tokenizer", required = true) + private LexicalTokenizerName tokenizer; + + /* + * A list of token filters used to filter out or modify the tokens + * generated by a tokenizer. For example, you can specify a lowercase + * filter that converts all characters to lowercase. The filters are run in + * the order in which they are listed. + */ + @JsonProperty(value = "tokenFilters") + private List tokenFilters; + + /* + * A list of character filters used to prepare input text before it is + * processed by the tokenizer. For instance, they can replace certain + * characters or symbols. The filters are run in the order in which they + * are listed. + */ + @JsonProperty(value = "charFilters") + private List charFilters; + + /** + * Get the tokenizer property: The name of the tokenizer to use to divide + * continuous text into a sequence of tokens, such as breaking a sentence + * into words. Possible values include: 'Classic', 'EdgeNGram', 'Keyword', + * 'Letter', 'Lowercase', 'MicrosoftLanguageTokenizer', + * 'MicrosoftLanguageStemmingTokenizer', 'NGram', 'PathHierarchy', + * 'Pattern', 'Standard', 'UaxUrlEmail', 'Whitespace'. + * + * @return the tokenizer value. + */ + public LexicalTokenizerName getTokenizer() { + return this.tokenizer; + } + + /** + * Set the tokenizer property: The name of the tokenizer to use to divide + * continuous text into a sequence of tokens, such as breaking a sentence + * into words. Possible values include: 'Classic', 'EdgeNGram', 'Keyword', + * 'Letter', 'Lowercase', 'MicrosoftLanguageTokenizer', + * 'MicrosoftLanguageStemmingTokenizer', 'NGram', 'PathHierarchy', + * 'Pattern', 'Standard', 'UaxUrlEmail', 'Whitespace'. + * + * @param tokenizer the tokenizer value to set. + * @return the CustomAnalyzer object itself. + */ + public CustomAnalyzer setTokenizer(LexicalTokenizerName tokenizer) { + this.tokenizer = tokenizer; + return this; + } + + /** + * Get the tokenFilters property: A list of token filters used to filter + * out or modify the tokens generated by a tokenizer. For example, you can + * specify a lowercase filter that converts all characters to lowercase. + * The filters are run in the order in which they are listed. + * + * @return the tokenFilters value. + */ + public List getTokenFilters() { + return this.tokenFilters; + } + + /** + * Set the tokenFilters property: A list of token filters used to filter + * out or modify the tokens generated by a tokenizer. For example, you can + * specify a lowercase filter that converts all characters to lowercase. + * The filters are run in the order in which they are listed. + * + * @param tokenFilters the tokenFilters value to set. + * @return the CustomAnalyzer object itself. + */ + public CustomAnalyzer setTokenFilters(List tokenFilters) { + this.tokenFilters = tokenFilters; + return this; + } + + /** + * Get the charFilters property: A list of character filters used to + * prepare input text before it is processed by the tokenizer. For + * instance, they can replace certain characters or symbols. The filters + * are run in the order in which they are listed. + * + * @return the charFilters value. + */ + public List getCharFilters() { + return this.charFilters; + } + + /** + * Set the charFilters property: A list of character filters used to + * prepare input text before it is processed by the tokenizer. For + * instance, they can replace certain characters or symbols. The filters + * are run in the order in which they are listed. + * + * @param charFilters the charFilters value to set. + * @return the CustomAnalyzer object itself. + */ + public CustomAnalyzer setCharFilters(List charFilters) { + this.charFilters = charFilters; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataChangeDetectionPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataChangeDetectionPolicy.java new file mode 100644 index 000000000000..1589d133ade1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataChangeDetectionPolicy.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for data change detection policies. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = DataChangeDetectionPolicy.class) +@JsonTypeName("DataChangeDetectionPolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", value = HighWaterMarkChangeDetectionPolicy.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy", value = SqlIntegratedChangeTrackingPolicy.class) +}) +@Fluent +public class DataChangeDetectionPolicy { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataDeletionDetectionPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataDeletionDetectionPolicy.java new file mode 100644 index 000000000000..07dc69068021 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataDeletionDetectionPolicy.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for data deletion detection policies. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = DataDeletionDetectionPolicy.class) +@JsonTypeName("DataDeletionDetectionPolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", value = SoftDeleteColumnDeletionDetectionPolicy.class) +}) +@Fluent +public class DataDeletionDetectionPolicy { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataSourceCredentials.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataSourceCredentials.java new file mode 100644 index 000000000000..738051d29e77 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DataSourceCredentials.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents credentials that can be used to connect to a datasource. + */ +@Fluent +public final class DataSourceCredentials { + /* + * The connection string for the datasource. + */ + @JsonProperty(value = "connectionString") + private String connectionString; + + /** + * Get the connectionString property: The connection string for the + * datasource. + * + * @return the connectionString value. + */ + public String getConnectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: The connection string for the + * datasource. + * + * @param connectionString the connectionString value to set. + * @return the DataSourceCredentials object itself. + */ + public DataSourceCredentials setConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DefaultCognitiveServicesAccount.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DefaultCognitiveServicesAccount.java new file mode 100644 index 000000000000..f458a4d2f180 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DefaultCognitiveServicesAccount.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * An empty object that represents the default cognitive service resource for a + * skillset. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.DefaultCognitiveServices") +@Fluent +public final class DefaultCognitiveServicesAccount extends CognitiveServicesAccount { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DictionaryDecompounderTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DictionaryDecompounderTokenFilter.java new file mode 100644 index 000000000000..95f838d64c69 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DictionaryDecompounderTokenFilter.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Decomposes compound words found in many Germanic languages. This token + * filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter") +@Fluent +public final class DictionaryDecompounderTokenFilter extends TokenFilter { + /* + * The list of words to match against. + */ + @JsonProperty(value = "wordList", required = true) + private List wordList; + + /* + * The minimum word size. Only words longer than this get processed. + * Default is 5. Maximum is 300. + */ + @JsonProperty(value = "minWordSize") + private Integer minWordSize; + + /* + * The minimum subword size. Only subwords longer than this are outputted. + * Default is 2. Maximum is 300. + */ + @JsonProperty(value = "minSubwordSize") + private Integer minSubwordSize; + + /* + * The maximum subword size. Only subwords shorter than this are outputted. + * Default is 15. Maximum is 300. + */ + @JsonProperty(value = "maxSubwordSize") + private Integer maxSubwordSize; + + /* + * A value indicating whether to add only the longest matching subword to + * the output. Default is false. + */ + @JsonProperty(value = "onlyLongestMatch") + private Boolean onlyLongestMatch; + + /** + * Get the wordList property: The list of words to match against. + * + * @return the wordList value. + */ + public List getWordList() { + return this.wordList; + } + + /** + * Set the wordList property: The list of words to match against. + * + * @param wordList the wordList value to set. + * @return the DictionaryDecompounderTokenFilter object itself. + */ + public DictionaryDecompounderTokenFilter setWordList(List wordList) { + this.wordList = wordList; + return this; + } + + /** + * Get the minWordSize property: The minimum word size. Only words longer + * than this get processed. Default is 5. Maximum is 300. + * + * @return the minWordSize value. + */ + public Integer getMinWordSize() { + return this.minWordSize; + } + + /** + * Set the minWordSize property: The minimum word size. Only words longer + * than this get processed. Default is 5. Maximum is 300. + * + * @param minWordSize the minWordSize value to set. + * @return the DictionaryDecompounderTokenFilter object itself. + */ + public DictionaryDecompounderTokenFilter setMinWordSize(Integer minWordSize) { + this.minWordSize = minWordSize; + return this; + } + + /** + * Get the minSubwordSize property: The minimum subword size. Only subwords + * longer than this are outputted. Default is 2. Maximum is 300. + * + * @return the minSubwordSize value. + */ + public Integer getMinSubwordSize() { + return this.minSubwordSize; + } + + /** + * Set the minSubwordSize property: The minimum subword size. Only subwords + * longer than this are outputted. Default is 2. Maximum is 300. + * + * @param minSubwordSize the minSubwordSize value to set. + * @return the DictionaryDecompounderTokenFilter object itself. + */ + public DictionaryDecompounderTokenFilter setMinSubwordSize(Integer minSubwordSize) { + this.minSubwordSize = minSubwordSize; + return this; + } + + /** + * Get the maxSubwordSize property: The maximum subword size. Only subwords + * shorter than this are outputted. Default is 15. Maximum is 300. + * + * @return the maxSubwordSize value. + */ + public Integer getMaxSubwordSize() { + return this.maxSubwordSize; + } + + /** + * Set the maxSubwordSize property: The maximum subword size. Only subwords + * shorter than this are outputted. Default is 15. Maximum is 300. + * + * @param maxSubwordSize the maxSubwordSize value to set. + * @return the DictionaryDecompounderTokenFilter object itself. + */ + public DictionaryDecompounderTokenFilter setMaxSubwordSize(Integer maxSubwordSize) { + this.maxSubwordSize = maxSubwordSize; + return this; + } + + /** + * Get the onlyLongestMatch property: A value indicating whether to add + * only the longest matching subword to the output. Default is false. + * + * @return the onlyLongestMatch value. + */ + public Boolean isOnlyLongestMatch() { + return this.onlyLongestMatch; + } + + /** + * Set the onlyLongestMatch property: A value indicating whether to add + * only the longest matching subword to the output. Default is false. + * + * @param onlyLongestMatch the onlyLongestMatch value to set. + * @return the DictionaryDecompounderTokenFilter object itself. + */ + public DictionaryDecompounderTokenFilter setOnlyLongestMatch(Boolean onlyLongestMatch) { + this.onlyLongestMatch = onlyLongestMatch; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DistanceScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DistanceScoringFunction.java new file mode 100644 index 000000000000..c68b84514841 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DistanceScoringFunction.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines a function that boosts scores based on distance from a geographic + * location. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("distance") +@Fluent +public final class DistanceScoringFunction extends ScoringFunction { + /* + * Parameter values for the distance scoring function. + */ + @JsonProperty(value = "distance", required = true) + private DistanceScoringParameters parameters; + + /** + * Get the parameters property: Parameter values for the distance scoring + * function. + * + * @return the parameters value. + */ + public DistanceScoringParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameter values for the distance scoring + * function. + * + * @param parameters the parameters value to set. + * @return the DistanceScoringFunction object itself. + */ + public DistanceScoringFunction setParameters(DistanceScoringParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DistanceScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DistanceScoringParameters.java new file mode 100644 index 000000000000..8973ba9d3c0c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/DistanceScoringParameters.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Provides parameter values to a distance scoring function. + */ +@Fluent +public final class DistanceScoringParameters { + /* + * The name of the parameter passed in search queries to specify the + * reference location. + */ + @JsonProperty(value = "referencePointParameter", required = true) + private String referencePointParameter; + + /* + * The distance in kilometers from the reference location where the + * boosting range ends. + */ + @JsonProperty(value = "boostingDistance", required = true) + private double boostingDistance; + + /** + * Get the referencePointParameter property: The name of the parameter + * passed in search queries to specify the reference location. + * + * @return the referencePointParameter value. + */ + public String getReferencePointParameter() { + return this.referencePointParameter; + } + + /** + * Set the referencePointParameter property: The name of the parameter + * passed in search queries to specify the reference location. + * + * @param referencePointParameter the referencePointParameter value to set. + * @return the DistanceScoringParameters object itself. + */ + public DistanceScoringParameters setReferencePointParameter(String referencePointParameter) { + this.referencePointParameter = referencePointParameter; + return this; + } + + /** + * Get the boostingDistance property: The distance in kilometers from the + * reference location where the boosting range ends. + * + * @return the boostingDistance value. + */ + public double getBoostingDistance() { + return this.boostingDistance; + } + + /** + * Set the boostingDistance property: The distance in kilometers from the + * reference location where the boosting range ends. + * + * @param boostingDistance the boostingDistance value to set. + * @return the DistanceScoringParameters object itself. + */ + public DistanceScoringParameters setBoostingDistance(double boostingDistance) { + this.boostingDistance = boostingDistance; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilter.java new file mode 100644 index 000000000000..77be6478c65f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilter.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Generates n-grams of the given size(s) starting from the front or the back + * of an input token. This token filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.EdgeNGramTokenFilter") +@Fluent +public final class EdgeNGramTokenFilter extends TokenFilter { + /* + * The minimum n-gram length. Default is 1. Must be less than the value of + * maxGram. + */ + @JsonProperty(value = "minGram") + private Integer minGram; + + /* + * The maximum n-gram length. Default is 2. + */ + @JsonProperty(value = "maxGram") + private Integer maxGram; + + /* + * Specifies which side of the input the n-gram should be generated from. + * Default is "front". Possible values include: 'Front', 'Back' + */ + @JsonProperty(value = "side") + private EdgeNGramTokenFilterSide side; + + /** + * Get the minGram property: The minimum n-gram length. Default is 1. Must + * be less than the value of maxGram. + * + * @return the minGram value. + */ + public Integer getMinGram() { + return this.minGram; + } + + /** + * Set the minGram property: The minimum n-gram length. Default is 1. Must + * be less than the value of maxGram. + * + * @param minGram the minGram value to set. + * @return the EdgeNGramTokenFilter object itself. + */ + public EdgeNGramTokenFilter setMinGram(Integer minGram) { + this.minGram = minGram; + return this; + } + + /** + * Get the maxGram property: The maximum n-gram length. Default is 2. + * + * @return the maxGram value. + */ + public Integer getMaxGram() { + return this.maxGram; + } + + /** + * Set the maxGram property: The maximum n-gram length. Default is 2. + * + * @param maxGram the maxGram value to set. + * @return the EdgeNGramTokenFilter object itself. + */ + public EdgeNGramTokenFilter setMaxGram(Integer maxGram) { + this.maxGram = maxGram; + return this; + } + + /** + * Get the side property: Specifies which side of the input the n-gram + * should be generated from. Default is "front". Possible values include: + * 'Front', 'Back'. + * + * @return the side value. + */ + public EdgeNGramTokenFilterSide getSide() { + return this.side; + } + + /** + * Set the side property: Specifies which side of the input the n-gram + * should be generated from. Default is "front". Possible values include: + * 'Front', 'Back'. + * + * @param side the side value to set. + * @return the EdgeNGramTokenFilter object itself. + */ + public EdgeNGramTokenFilter setSide(EdgeNGramTokenFilterSide side) { + this.side = side; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilterSide.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilterSide.java new file mode 100644 index 000000000000..09bce3376c5d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilterSide.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EdgeNGramTokenFilterSide. + */ +public enum EdgeNGramTokenFilterSide { + /** + * Enum value front. + */ + FRONT("front"), + + /** + * Enum value back. + */ + BACK("back"); + + /** + * The actual serialized value for a EdgeNGramTokenFilterSide instance. + */ + private final String value; + + EdgeNGramTokenFilterSide(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EdgeNGramTokenFilterSide instance. + * + * @param value the serialized value to parse. + * @return the parsed EdgeNGramTokenFilterSide object, or null if unable to parse. + */ + @JsonCreator + public static EdgeNGramTokenFilterSide fromString(String value) { + EdgeNGramTokenFilterSide[] items = EdgeNGramTokenFilterSide.values(); + for (EdgeNGramTokenFilterSide item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilterV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilterV2.java new file mode 100644 index 000000000000..833fa83b75ba --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenFilterV2.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Generates n-grams of the given size(s) starting from the front or the back + * of an input token. This token filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.EdgeNGramTokenFilterV2") +@Fluent +public final class EdgeNGramTokenFilterV2 extends TokenFilter { + /* + * The minimum n-gram length. Default is 1. Maximum is 300. Must be less + * than the value of maxGram. + */ + @JsonProperty(value = "minGram") + private Integer minGram; + + /* + * The maximum n-gram length. Default is 2. Maximum is 300. + */ + @JsonProperty(value = "maxGram") + private Integer maxGram; + + /* + * Specifies which side of the input the n-gram should be generated from. + * Default is "front". Possible values include: 'Front', 'Back' + */ + @JsonProperty(value = "side") + private EdgeNGramTokenFilterSide side; + + /** + * Get the minGram property: The minimum n-gram length. Default is 1. + * Maximum is 300. Must be less than the value of maxGram. + * + * @return the minGram value. + */ + public Integer getMinGram() { + return this.minGram; + } + + /** + * Set the minGram property: The minimum n-gram length. Default is 1. + * Maximum is 300. Must be less than the value of maxGram. + * + * @param minGram the minGram value to set. + * @return the EdgeNGramTokenFilterV2 object itself. + */ + public EdgeNGramTokenFilterV2 setMinGram(Integer minGram) { + this.minGram = minGram; + return this; + } + + /** + * Get the maxGram property: The maximum n-gram length. Default is 2. + * Maximum is 300. + * + * @return the maxGram value. + */ + public Integer getMaxGram() { + return this.maxGram; + } + + /** + * Set the maxGram property: The maximum n-gram length. Default is 2. + * Maximum is 300. + * + * @param maxGram the maxGram value to set. + * @return the EdgeNGramTokenFilterV2 object itself. + */ + public EdgeNGramTokenFilterV2 setMaxGram(Integer maxGram) { + this.maxGram = maxGram; + return this; + } + + /** + * Get the side property: Specifies which side of the input the n-gram + * should be generated from. Default is "front". Possible values include: + * 'Front', 'Back'. + * + * @return the side value. + */ + public EdgeNGramTokenFilterSide getSide() { + return this.side; + } + + /** + * Set the side property: Specifies which side of the input the n-gram + * should be generated from. Default is "front". Possible values include: + * 'Front', 'Back'. + * + * @param side the side value to set. + * @return the EdgeNGramTokenFilterV2 object itself. + */ + public EdgeNGramTokenFilterV2 setSide(EdgeNGramTokenFilterSide side) { + this.side = side; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenizer.java new file mode 100644 index 000000000000..69fe9bf303a5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EdgeNGramTokenizer.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Tokenizes the input from an edge into n-grams of the given size(s). This + * tokenizer is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.EdgeNGramTokenizer") +@Fluent +public final class EdgeNGramTokenizer extends LexicalTokenizer { + /* + * The minimum n-gram length. Default is 1. Maximum is 300. Must be less + * than the value of maxGram. + */ + @JsonProperty(value = "minGram") + private Integer minGram; + + /* + * The maximum n-gram length. Default is 2. Maximum is 300. + */ + @JsonProperty(value = "maxGram") + private Integer maxGram; + + /* + * Character classes to keep in the tokens. + */ + @JsonProperty(value = "tokenChars") + private List tokenChars; + + /** + * Get the minGram property: The minimum n-gram length. Default is 1. + * Maximum is 300. Must be less than the value of maxGram. + * + * @return the minGram value. + */ + public Integer getMinGram() { + return this.minGram; + } + + /** + * Set the minGram property: The minimum n-gram length. Default is 1. + * Maximum is 300. Must be less than the value of maxGram. + * + * @param minGram the minGram value to set. + * @return the EdgeNGramTokenizer object itself. + */ + public EdgeNGramTokenizer setMinGram(Integer minGram) { + this.minGram = minGram; + return this; + } + + /** + * Get the maxGram property: The maximum n-gram length. Default is 2. + * Maximum is 300. + * + * @return the maxGram value. + */ + public Integer getMaxGram() { + return this.maxGram; + } + + /** + * Set the maxGram property: The maximum n-gram length. Default is 2. + * Maximum is 300. + * + * @param maxGram the maxGram value to set. + * @return the EdgeNGramTokenizer object itself. + */ + public EdgeNGramTokenizer setMaxGram(Integer maxGram) { + this.maxGram = maxGram; + return this; + } + + /** + * Get the tokenChars property: Character classes to keep in the tokens. + * + * @return the tokenChars value. + */ + public List getTokenChars() { + return this.tokenChars; + } + + /** + * Set the tokenChars property: Character classes to keep in the tokens. + * + * @param tokenChars the tokenChars value to set. + * @return the EdgeNGramTokenizer object itself. + */ + public EdgeNGramTokenizer setTokenChars(List tokenChars) { + this.tokenChars = tokenChars; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ElisionTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ElisionTokenFilter.java new file mode 100644 index 000000000000..e72711c73e0d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ElisionTokenFilter.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Removes elisions. For example, "l'avion" (the plane) will be converted to + * "avion" (plane). This token filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.ElisionTokenFilter") +@Fluent +public final class ElisionTokenFilter extends TokenFilter { + /* + * The set of articles to remove. + */ + @JsonProperty(value = "articles") + private List articles; + + /** + * Get the articles property: The set of articles to remove. + * + * @return the articles value. + */ + public List getArticles() { + return this.articles; + } + + /** + * Set the articles property: The set of articles to remove. + * + * @param articles the articles value to set. + * @return the ElisionTokenFilter object itself. + */ + public ElisionTokenFilter setArticles(List articles) { + this.articles = articles; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityCategory.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityCategory.java new file mode 100644 index 000000000000..854c7822671a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityCategory.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EntityCategory. + */ +public enum EntityCategory { + /** + * Enum value location. + */ + LOCATION("location"), + + /** + * Enum value organization. + */ + ORGANIZATION("organization"), + + /** + * Enum value person. + */ + PERSON("person"), + + /** + * Enum value quantity. + */ + QUANTITY("quantity"), + + /** + * Enum value datetime. + */ + DATETIME("datetime"), + + /** + * Enum value url. + */ + URL("url"), + + /** + * Enum value email. + */ + EMAIL("email"); + + /** + * The actual serialized value for a EntityCategory instance. + */ + private final String value; + + EntityCategory(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EntityCategory instance. + * + * @param value the serialized value to parse. + * @return the parsed EntityCategory object, or null if unable to parse. + */ + @JsonCreator + public static EntityCategory fromString(String value) { + EntityCategory[] items = EntityCategory.values(); + for (EntityCategory item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityRecognitionSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityRecognitionSkill.java new file mode 100644 index 000000000000..435676ed9d8c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityRecognitionSkill.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Text analytics entity recognition. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Text.EntityRecognitionSkill") +@Fluent +public final class EntityRecognitionSkill extends SearchIndexerSkill { + /* + * A list of entity categories that should be extracted. + */ + @JsonProperty(value = "categories") + private List categories; + + /* + * A value indicating which language code to use. Default is en. Possible + * values include: 'ar', 'cs', 'zh-Hans', 'zh-Hant', 'da', 'nl', 'en', + * 'fi', 'fr', 'de', 'el', 'hu', 'it', 'ja', 'ko', 'no', 'pl', 'pt-PT', + * 'pt-BR', 'ru', 'es', 'sv', 'tr' + */ + @JsonProperty(value = "defaultLanguageCode") + private EntityRecognitionSkillLanguage defaultLanguageCode; + + /* + * Determines whether or not to include entities which are well known but + * don't conform to a pre-defined type. If this configuration is not set + * (default), set to null or set to false, entities which don't conform to + * one of the pre-defined types will not be surfaced. + */ + @JsonProperty(value = "includeTypelessEntities") + private Boolean includeTypelessEntities; + + /* + * A value between 0 and 1 that be used to only include entities whose + * confidence score is greater than the value specified. If not set + * (default), or if explicitly set to null, all entities will be included. + */ + @JsonProperty(value = "minimumPrecision") + private Double minimumPrecision; + + /** + * Get the categories property: A list of entity categories that should be + * extracted. + * + * @return the categories value. + */ + public List getCategories() { + return this.categories; + } + + /** + * Set the categories property: A list of entity categories that should be + * extracted. + * + * @param categories the categories value to set. + * @return the EntityRecognitionSkill object itself. + */ + public EntityRecognitionSkill setCategories(List categories) { + this.categories = categories; + return this; + } + + /** + * Get the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'ar', 'cs', + * 'zh-Hans', 'zh-Hant', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'hu', + * 'it', 'ja', 'ko', 'no', 'pl', 'pt-PT', 'pt-BR', 'ru', 'es', 'sv', 'tr'. + * + * @return the defaultLanguageCode value. + */ + public EntityRecognitionSkillLanguage getDefaultLanguageCode() { + return this.defaultLanguageCode; + } + + /** + * Set the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'ar', 'cs', + * 'zh-Hans', 'zh-Hant', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'hu', + * 'it', 'ja', 'ko', 'no', 'pl', 'pt-PT', 'pt-BR', 'ru', 'es', 'sv', 'tr'. + * + * @param defaultLanguageCode the defaultLanguageCode value to set. + * @return the EntityRecognitionSkill object itself. + */ + public EntityRecognitionSkill setDefaultLanguageCode(EntityRecognitionSkillLanguage defaultLanguageCode) { + this.defaultLanguageCode = defaultLanguageCode; + return this; + } + + /** + * Get the includeTypelessEntities property: Determines whether or not to + * include entities which are well known but don't conform to a pre-defined + * type. If this configuration is not set (default), set to null or set to + * false, entities which don't conform to one of the pre-defined types will + * not be surfaced. + * + * @return the includeTypelessEntities value. + */ + public Boolean isIncludeTypelessEntities() { + return this.includeTypelessEntities; + } + + /** + * Set the includeTypelessEntities property: Determines whether or not to + * include entities which are well known but don't conform to a pre-defined + * type. If this configuration is not set (default), set to null or set to + * false, entities which don't conform to one of the pre-defined types will + * not be surfaced. + * + * @param includeTypelessEntities the includeTypelessEntities value to set. + * @return the EntityRecognitionSkill object itself. + */ + public EntityRecognitionSkill setIncludeTypelessEntities(Boolean includeTypelessEntities) { + this.includeTypelessEntities = includeTypelessEntities; + return this; + } + + /** + * Get the minimumPrecision property: A value between 0 and 1 that be used + * to only include entities whose confidence score is greater than the + * value specified. If not set (default), or if explicitly set to null, all + * entities will be included. + * + * @return the minimumPrecision value. + */ + public Double getMinimumPrecision() { + return this.minimumPrecision; + } + + /** + * Set the minimumPrecision property: A value between 0 and 1 that be used + * to only include entities whose confidence score is greater than the + * value specified. If not set (default), or if explicitly set to null, all + * entities will be included. + * + * @param minimumPrecision the minimumPrecision value to set. + * @return the EntityRecognitionSkill object itself. + */ + public EntityRecognitionSkill setMinimumPrecision(Double minimumPrecision) { + this.minimumPrecision = minimumPrecision; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityRecognitionSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityRecognitionSkillLanguage.java new file mode 100644 index 000000000000..04d54a3d3403 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/EntityRecognitionSkillLanguage.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for EntityRecognitionSkillLanguage. + */ +public final class EntityRecognitionSkillLanguage extends ExpandableStringEnum { + /** + * Static value ar for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage AR = fromString("ar"); + + /** + * Static value cs for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage CS = fromString("cs"); + + /** + * Static value zh-Hans for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage ZH_HANS = fromString("zh-Hans"); + + /** + * Static value zh-Hant for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage ZH_HANT = fromString("zh-Hant"); + + /** + * Static value da for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage DA = fromString("da"); + + /** + * Static value nl for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage NL = fromString("nl"); + + /** + * Static value en for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage EN = fromString("en"); + + /** + * Static value fi for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage FI = fromString("fi"); + + /** + * Static value fr for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage FR = fromString("fr"); + + /** + * Static value de for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage DE = fromString("de"); + + /** + * Static value el for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage EL = fromString("el"); + + /** + * Static value hu for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage HU = fromString("hu"); + + /** + * Static value it for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage IT = fromString("it"); + + /** + * Static value ja for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage JA = fromString("ja"); + + /** + * Static value ko for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage KO = fromString("ko"); + + /** + * Static value no for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage NO = fromString("no"); + + /** + * Static value pl for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage PL = fromString("pl"); + + /** + * Static value pt-PT for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage PT_PT = fromString("pt-PT"); + + /** + * Static value pt-BR for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage PT_BR = fromString("pt-BR"); + + /** + * Static value ru for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage RU = fromString("ru"); + + /** + * Static value es for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage ES = fromString("es"); + + /** + * Static value sv for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage SV = fromString("sv"); + + /** + * Static value tr for EntityRecognitionSkillLanguage. + */ + public static final EntityRecognitionSkillLanguage TR = fromString("tr"); + + /** + * Creates or finds a EntityRecognitionSkillLanguage from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityRecognitionSkillLanguage. + */ + @JsonCreator + public static EntityRecognitionSkillLanguage fromString(String name) { + return fromString(name, EntityRecognitionSkillLanguage.class); + } + + /** + * @return known EntityRecognitionSkillLanguage values. + */ + public static Collection values() { + return values(EntityRecognitionSkillLanguage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FacetResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FacetResult.java new file mode 100644 index 000000000000..0e1df08e33d2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FacetResult.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * A single bucket of a facet query result. Reports the number of documents + * with a field value falling within a particular range or having a particular + * value or interval. + */ +@Fluent +public final class FacetResult { + /* + * Unmatched properties from the message are deserialized this collection + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /* + * The approximate count of documents falling within the bucket described + * by this facet. + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Long count; + + /** + * Get the additionalProperties property: Unmatched properties from the + * message are deserialized this collection. + * + * @return the additionalProperties value. + */ + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Unmatched properties from the + * message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set. + * @return the FacetResult object itself. + */ + public FacetResult setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the count property: The approximate count of documents falling + * within the bucket described by this facet. + * + * @return the count value. + */ + public Long getCount() { + return this.count; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FieldMapping.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FieldMapping.java new file mode 100644 index 000000000000..f673b2bcbf1b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FieldMapping.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a mapping between a field in a data source and a target field in an + * index. + */ +@Fluent +public final class FieldMapping { + /* + * The name of the field in the data source. + */ + @JsonProperty(value = "sourceFieldName", required = true) + private String sourceFieldName; + + /* + * The name of the target field in the index. Same as the source field name + * by default. + */ + @JsonProperty(value = "targetFieldName") + private String targetFieldName; + + /* + * A function to apply to each source field value before indexing. + */ + @JsonProperty(value = "mappingFunction") + private FieldMappingFunction mappingFunction; + + /** + * Get the sourceFieldName property: The name of the field in the data + * source. + * + * @return the sourceFieldName value. + */ + public String getSourceFieldName() { + return this.sourceFieldName; + } + + /** + * Set the sourceFieldName property: The name of the field in the data + * source. + * + * @param sourceFieldName the sourceFieldName value to set. + * @return the FieldMapping object itself. + */ + public FieldMapping setSourceFieldName(String sourceFieldName) { + this.sourceFieldName = sourceFieldName; + return this; + } + + /** + * Get the targetFieldName property: The name of the target field in the + * index. Same as the source field name by default. + * + * @return the targetFieldName value. + */ + public String getTargetFieldName() { + return this.targetFieldName; + } + + /** + * Set the targetFieldName property: The name of the target field in the + * index. Same as the source field name by default. + * + * @param targetFieldName the targetFieldName value to set. + * @return the FieldMapping object itself. + */ + public FieldMapping setTargetFieldName(String targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + * Get the mappingFunction property: A function to apply to each source + * field value before indexing. + * + * @return the mappingFunction value. + */ + public FieldMappingFunction getMappingFunction() { + return this.mappingFunction; + } + + /** + * Set the mappingFunction property: A function to apply to each source + * field value before indexing. + * + * @param mappingFunction the mappingFunction value to set. + * @return the FieldMapping object itself. + */ + public FieldMapping setMappingFunction(FieldMappingFunction mappingFunction) { + this.mappingFunction = mappingFunction; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FieldMappingFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FieldMappingFunction.java new file mode 100644 index 000000000000..6243b1805ba8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FieldMappingFunction.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Represents a function that transforms a value from a data source before + * indexing. + */ +@Fluent +public final class FieldMappingFunction { + /* + * The name of the field mapping function. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * A dictionary of parameter name/value pairs to pass to the function. Each + * value must be of a primitive type. + */ + @JsonProperty(value = "parameters") + private Map parameters; + + /** + * Get the name property: The name of the field mapping function. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the field mapping function. + * + * @param name the name value to set. + * @return the FieldMappingFunction object itself. + */ + public FieldMappingFunction setName(String name) { + this.name = name; + return this; + } + + /** + * Get the parameters property: A dictionary of parameter name/value pairs + * to pass to the function. Each value must be of a primitive type. + * + * @return the parameters value. + */ + public Map getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: A dictionary of parameter name/value pairs + * to pass to the function. Each value must be of a primitive type. + * + * @param parameters the parameters value to set. + * @return the FieldMappingFunction object itself. + */ + public FieldMappingFunction setParameters(Map parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FreshnessScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FreshnessScoringFunction.java new file mode 100644 index 000000000000..c56a75d7d3a7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FreshnessScoringFunction.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines a function that boosts scores based on the value of a date-time + * field. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("freshness") +@Fluent +public final class FreshnessScoringFunction extends ScoringFunction { + /* + * Parameter values for the freshness scoring function. + */ + @JsonProperty(value = "freshness", required = true) + private FreshnessScoringParameters parameters; + + /** + * Get the parameters property: Parameter values for the freshness scoring + * function. + * + * @return the parameters value. + */ + public FreshnessScoringParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameter values for the freshness scoring + * function. + * + * @param parameters the parameters value to set. + * @return the FreshnessScoringFunction object itself. + */ + public FreshnessScoringFunction setParameters(FreshnessScoringParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FreshnessScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FreshnessScoringParameters.java new file mode 100644 index 000000000000..bd695ea721a9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/FreshnessScoringParameters.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** + * Provides parameter values to a freshness scoring function. + */ +@Fluent +public final class FreshnessScoringParameters { + /* + * The expiration period after which boosting will stop for a particular + * document. + */ + @JsonProperty(value = "boostingDuration", required = true) + private Duration boostingDuration; + + /** + * Get the boostingDuration property: The expiration period after which + * boosting will stop for a particular document. + * + * @return the boostingDuration value. + */ + public Duration getBoostingDuration() { + return this.boostingDuration; + } + + /** + * Set the boostingDuration property: The expiration period after which + * boosting will stop for a particular document. + * + * @param boostingDuration the boostingDuration value to set. + * @return the FreshnessScoringParameters object itself. + */ + public FreshnessScoringParameters setBoostingDuration(Duration boostingDuration) { + this.boostingDuration = boostingDuration; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/GetIndexStatisticsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/GetIndexStatisticsResult.java new file mode 100644 index 000000000000..3da2b3f65f1d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/GetIndexStatisticsResult.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Statistics for a given index. Statistics are collected periodically and are + * not guaranteed to always be up-to-date. + */ +@Fluent +public final class GetIndexStatisticsResult { + /* + * The number of documents in the index. + */ + @JsonProperty(value = "documentCount", required = true, access = JsonProperty.Access.WRITE_ONLY) + private long documentCount; + + /* + * The amount of storage in bytes consumed by the index. + */ + @JsonProperty(value = "storageSize", required = true, access = JsonProperty.Access.WRITE_ONLY) + private long storageSize; + + /** + * Get the documentCount property: The number of documents in the index. + * + * @return the documentCount value. + */ + public long getDocumentCount() { + return this.documentCount; + } + + /** + * Get the storageSize property: The amount of storage in bytes consumed by + * the index. + * + * @return the storageSize value. + */ + public long getStorageSize() { + return this.storageSize; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/HighWaterMarkChangeDetectionPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/HighWaterMarkChangeDetectionPolicy.java new file mode 100644 index 000000000000..d3e91ee06989 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/HighWaterMarkChangeDetectionPolicy.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines a data change detection policy that captures changes based on the + * value of a high water mark column. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy") +@Fluent +public final class HighWaterMarkChangeDetectionPolicy extends DataChangeDetectionPolicy { + /* + * The name of the high water mark column. + */ + @JsonProperty(value = "highWaterMarkColumnName", required = true) + private String highWaterMarkColumnName; + + /** + * Get the highWaterMarkColumnName property: The name of the high water + * mark column. + * + * @return the highWaterMarkColumnName value. + */ + public String getHighWaterMarkColumnName() { + return this.highWaterMarkColumnName; + } + + /** + * Set the highWaterMarkColumnName property: The name of the high water + * mark column. + * + * @param highWaterMarkColumnName the highWaterMarkColumnName value to set. + * @return the HighWaterMarkChangeDetectionPolicy object itself. + */ + public HighWaterMarkChangeDetectionPolicy setHighWaterMarkColumnName(String highWaterMarkColumnName) { + this.highWaterMarkColumnName = highWaterMarkColumnName; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageAnalysisSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageAnalysisSkill.java new file mode 100644 index 000000000000..2b046922623e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageAnalysisSkill.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * A skill that analyzes image files. It extracts a rich set of visual features + * based on the image content. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Vision.ImageAnalysisSkill") +@Fluent +public final class ImageAnalysisSkill extends SearchIndexerSkill { + /* + * A value indicating which language code to use. Default is en. Possible + * values include: 'en', 'es', 'ja', 'pt', 'zh' + */ + @JsonProperty(value = "defaultLanguageCode") + private ImageAnalysisSkillLanguage defaultLanguageCode; + + /* + * A list of visual features. + */ + @JsonProperty(value = "visualFeatures") + private List visualFeatures; + + /* + * A string indicating which domain-specific details to return. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'en', 'es', 'ja', + * 'pt', 'zh'. + * + * @return the defaultLanguageCode value. + */ + public ImageAnalysisSkillLanguage getDefaultLanguageCode() { + return this.defaultLanguageCode; + } + + /** + * Set the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'en', 'es', 'ja', + * 'pt', 'zh'. + * + * @param defaultLanguageCode the defaultLanguageCode value to set. + * @return the ImageAnalysisSkill object itself. + */ + public ImageAnalysisSkill setDefaultLanguageCode(ImageAnalysisSkillLanguage defaultLanguageCode) { + this.defaultLanguageCode = defaultLanguageCode; + return this; + } + + /** + * Get the visualFeatures property: A list of visual features. + * + * @return the visualFeatures value. + */ + public List getVisualFeatures() { + return this.visualFeatures; + } + + /** + * Set the visualFeatures property: A list of visual features. + * + * @param visualFeatures the visualFeatures value to set. + * @return the ImageAnalysisSkill object itself. + */ + public ImageAnalysisSkill setVisualFeatures(List visualFeatures) { + this.visualFeatures = visualFeatures; + return this; + } + + /** + * Get the details property: A string indicating which domain-specific + * details to return. + * + * @return the details value. + */ + public List getDetails() { + return this.details; + } + + /** + * Set the details property: A string indicating which domain-specific + * details to return. + * + * @param details the details value to set. + * @return the ImageAnalysisSkill object itself. + */ + public ImageAnalysisSkill setDetails(List details) { + this.details = details; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageAnalysisSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageAnalysisSkillLanguage.java new file mode 100644 index 000000000000..186603574af4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageAnalysisSkillLanguage.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for ImageAnalysisSkillLanguage. + */ +public final class ImageAnalysisSkillLanguage extends ExpandableStringEnum { + /** + * Static value en for ImageAnalysisSkillLanguage. + */ + public static final ImageAnalysisSkillLanguage EN = fromString("en"); + + /** + * Static value es for ImageAnalysisSkillLanguage. + */ + public static final ImageAnalysisSkillLanguage ES = fromString("es"); + + /** + * Static value ja for ImageAnalysisSkillLanguage. + */ + public static final ImageAnalysisSkillLanguage JA = fromString("ja"); + + /** + * Static value pt for ImageAnalysisSkillLanguage. + */ + public static final ImageAnalysisSkillLanguage PT = fromString("pt"); + + /** + * Static value zh for ImageAnalysisSkillLanguage. + */ + public static final ImageAnalysisSkillLanguage ZH = fromString("zh"); + + /** + * Creates or finds a ImageAnalysisSkillLanguage from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageAnalysisSkillLanguage. + */ + @JsonCreator + public static ImageAnalysisSkillLanguage fromString(String name) { + return fromString(name, ImageAnalysisSkillLanguage.class); + } + + /** + * @return known ImageAnalysisSkillLanguage values. + */ + public static Collection values() { + return values(ImageAnalysisSkillLanguage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageDetail.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageDetail.java new file mode 100644 index 000000000000..c0e0eac84c2b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ImageDetail.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ImageDetail. + */ +public enum ImageDetail { + /** + * Enum value celebrities. + */ + CELEBRITIES("celebrities"), + + /** + * Enum value landmarks. + */ + LANDMARKS("landmarks"); + + /** + * The actual serialized value for a ImageDetail instance. + */ + private final String value; + + ImageDetail(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ImageDetail instance. + * + * @param value the serialized value to parse. + * @return the parsed ImageDetail object, or null if unable to parse. + */ + @JsonCreator + public static ImageDetail fromString(String value) { + ImageDetail[] items = ImageDetail.values(); + for (ImageDetail item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java new file mode 100644 index 000000000000..25047ed18f29 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Represents an index action that operates on a document. + */ +@Fluent +public final class IndexAction { + /* + * Unmatched properties from the message are deserialized this collection + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /* + * The operation to perform on a document in an indexing batch. Possible + * values include: 'Upload', 'Merge', 'MergeOrUpload', 'Delete' + */ + @JsonProperty(value = "@search.action") + private IndexActionType actionType; + + /** + * Get the additionalProperties property: Unmatched properties from the + * message are deserialized this collection. + * + * @return the additionalProperties value. + */ + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Unmatched properties from the + * message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IndexAction object itself. + */ + public IndexAction setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the actionType property: The operation to perform on a document in + * an indexing batch. Possible values include: 'Upload', 'Merge', + * 'MergeOrUpload', 'Delete'. + * + * @return the actionType value. + */ + public IndexActionType getActionType() { + return this.actionType; + } + + /** + * Set the actionType property: The operation to perform on a document in + * an indexing batch. Possible values include: 'Upload', 'Merge', + * 'MergeOrUpload', 'Delete'. + * + * @param actionType the actionType value to set. + * @return the IndexAction object itself. + */ + public IndexAction setActionType(IndexActionType actionType) { + this.actionType = actionType; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexActionType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexActionType.java new file mode 100644 index 000000000000..2b63035eeb81 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexActionType.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IndexActionType. + */ +public enum IndexActionType { + /** + * Enum value upload. + */ + UPLOAD("upload"), + + /** + * Enum value merge. + */ + MERGE("merge"), + + /** + * Enum value mergeOrUpload. + */ + MERGE_OR_UPLOAD("mergeOrUpload"), + + /** + * Enum value delete. + */ + DELETE("delete"); + + /** + * The actual serialized value for a IndexActionType instance. + */ + private final String value; + + IndexActionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IndexActionType instance. + * + * @param value the serialized value to parse. + * @return the parsed IndexActionType object, or null if unable to parse. + */ + @JsonCreator + public static IndexActionType fromString(String value) { + IndexActionType[] items = IndexActionType.values(); + for (IndexActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexBatch.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexBatch.java new file mode 100644 index 000000000000..c7a36557d863 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexBatch.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Contains a batch of document write actions to send to the index. + */ +@Fluent +public final class IndexBatch { + /* + * The actions in the batch. + */ + @JsonProperty(value = "value", required = true) + private List actions; + + /** + * Get the actions property: The actions in the batch. + * + * @return the actions value. + */ + public List getActions() { + return this.actions; + } + + /** + * Set the actions property: The actions in the batch. + * + * @param actions the actions value to set. + * @return the IndexBatch object itself. + */ + public IndexBatch setActions(List actions) { + this.actions = actions; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexDocumentsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexDocumentsResult.java new file mode 100644 index 000000000000..8ccafc74952c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexDocumentsResult.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response containing the status of operations for all documents in the + * indexing request. + */ +@Fluent +public final class IndexDocumentsResult { + /* + * The list of status information for each document in the indexing + * request. + */ + @JsonProperty(value = "value", required = true, access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get the results property: The list of status information for each + * document in the indexing request. + * + * @return the results value. + */ + public List getResults() { + return this.results; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerExecutionResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerExecutionResult.java new file mode 100644 index 000000000000..400bd4ac8461 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerExecutionResult.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Represents the result of an individual indexer execution. + */ +@Fluent +public final class IndexerExecutionResult { + /* + * The outcome of this indexer execution. Possible values include: + * 'TransientFailure', 'Success', 'InProgress', 'Reset' + */ + @JsonProperty(value = "status", required = true, access = JsonProperty.Access.WRITE_ONLY) + private IndexerExecutionStatus status; + + /* + * The error message indicating the top-level error, if any. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The start time of this indexer execution. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The end time of this indexer execution, if the execution has already + * completed. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /* + * The item-level indexing errors. + */ + @JsonProperty(value = "errors", required = true, access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /* + * The item-level indexing warnings. + */ + @JsonProperty(value = "warnings", required = true, access = JsonProperty.Access.WRITE_ONLY) + private List warnings; + + /* + * The number of items that were processed during this indexer execution. + * This includes both successfully processed items and items where indexing + * was attempted but failed. + */ + @JsonProperty(value = "itemsProcessed", required = true, access = JsonProperty.Access.WRITE_ONLY) + private int itemCount; + + /* + * The number of items that failed to be indexed during this indexer + * execution. + */ + @JsonProperty(value = "itemsFailed", required = true, access = JsonProperty.Access.WRITE_ONLY) + private int failedItemCount; + + /* + * Change tracking state with which an indexer execution started. + */ + @JsonProperty(value = "initialTrackingState", access = JsonProperty.Access.WRITE_ONLY) + private String initialTrackingState; + + /* + * Change tracking state with which an indexer execution finished. + */ + @JsonProperty(value = "finalTrackingState", access = JsonProperty.Access.WRITE_ONLY) + private String finalTrackingState; + + /** + * Get the status property: The outcome of this indexer execution. Possible + * values include: 'TransientFailure', 'Success', 'InProgress', 'Reset'. + * + * @return the status value. + */ + public IndexerExecutionStatus getStatus() { + return this.status; + } + + /** + * Get the errorMessage property: The error message indicating the + * top-level error, if any. + * + * @return the errorMessage value. + */ + public String getErrorMessage() { + return this.errorMessage; + } + + /** + * Get the startTime property: The start time of this indexer execution. + * + * @return the startTime value. + */ + public OffsetDateTime getStartTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of this indexer execution, if the + * execution has already completed. + * + * @return the endTime value. + */ + public OffsetDateTime getEndTime() { + return this.endTime; + } + + /** + * Get the errors property: The item-level indexing errors. + * + * @return the errors value. + */ + public List getErrors() { + return this.errors; + } + + /** + * Get the warnings property: The item-level indexing warnings. + * + * @return the warnings value. + */ + public List getWarnings() { + return this.warnings; + } + + /** + * Get the itemCount property: The number of items that were processed + * during this indexer execution. This includes both successfully processed + * items and items where indexing was attempted but failed. + * + * @return the itemCount value. + */ + public int getItemCount() { + return this.itemCount; + } + + /** + * Get the failedItemCount property: The number of items that failed to be + * indexed during this indexer execution. + * + * @return the failedItemCount value. + */ + public int getFailedItemCount() { + return this.failedItemCount; + } + + /** + * Get the initialTrackingState property: Change tracking state with which + * an indexer execution started. + * + * @return the initialTrackingState value. + */ + public String getInitialTrackingState() { + return this.initialTrackingState; + } + + /** + * Get the finalTrackingState property: Change tracking state with which an + * indexer execution finished. + * + * @return the finalTrackingState value. + */ + public String getFinalTrackingState() { + return this.finalTrackingState; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerExecutionStatus.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerExecutionStatus.java new file mode 100644 index 000000000000..9dfd84c90ddb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerExecutionStatus.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IndexerExecutionStatus. + */ +public enum IndexerExecutionStatus { + /** + * Enum value transientFailure. + */ + TRANSIENT_FAILURE("transientFailure"), + + /** + * Enum value success. + */ + SUCCESS("success"), + + /** + * Enum value inProgress. + */ + IN_PROGRESS("inProgress"), + + /** + * Enum value reset. + */ + RESET("reset"); + + /** + * The actual serialized value for a IndexerExecutionStatus instance. + */ + private final String value; + + IndexerExecutionStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IndexerExecutionStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed IndexerExecutionStatus object, or null if unable to parse. + */ + @JsonCreator + public static IndexerExecutionStatus fromString(String value) { + IndexerExecutionStatus[] items = IndexerExecutionStatus.values(); + for (IndexerExecutionStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerStatus.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerStatus.java new file mode 100644 index 000000000000..0b20a11ad812 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexerStatus.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IndexerStatus. + */ +public enum IndexerStatus { + /** + * Enum value unknown. + */ + UNKNOWN("unknown"), + + /** + * Enum value error. + */ + ERROR("error"), + + /** + * Enum value running. + */ + RUNNING("running"); + + /** + * The actual serialized value for a IndexerStatus instance. + */ + private final String value; + + IndexerStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IndexerStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed IndexerStatus object, or null if unable to parse. + */ + @JsonCreator + public static IndexerStatus fromString(String value) { + IndexerStatus[] items = IndexerStatus.values(); + for (IndexerStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingParameters.java new file mode 100644 index 000000000000..1515d9d90807 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingParameters.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Represents parameters for indexer execution. + */ +@Fluent +public final class IndexingParameters { + /* + * The number of items that are read from the data source and indexed as a + * single batch in order to improve performance. The default depends on the + * data source type. + */ + @JsonProperty(value = "batchSize") + private Integer batchSize; + + /* + * The maximum number of items that can fail indexing for indexer execution + * to still be considered successful. -1 means no limit. Default is 0. + */ + @JsonProperty(value = "maxFailedItems") + private Integer maxFailedItems; + + /* + * The maximum number of items in a single batch that can fail indexing for + * the batch to still be considered successful. -1 means no limit. Default + * is 0. + */ + @JsonProperty(value = "maxFailedItemsPerBatch") + private Integer maxFailedItemsPerBatch; + + /* + * A dictionary of indexer-specific configuration properties. Each name is + * the name of a specific property. Each value must be of a primitive type. + */ + @JsonProperty(value = "configuration") + private Map configuration; + + /** + * Get the batchSize property: The number of items that are read from the + * data source and indexed as a single batch in order to improve + * performance. The default depends on the data source type. + * + * @return the batchSize value. + */ + public Integer getBatchSize() { + return this.batchSize; + } + + /** + * Set the batchSize property: The number of items that are read from the + * data source and indexed as a single batch in order to improve + * performance. The default depends on the data source type. + * + * @param batchSize the batchSize value to set. + * @return the IndexingParameters object itself. + */ + public IndexingParameters setBatchSize(Integer batchSize) { + this.batchSize = batchSize; + return this; + } + + /** + * Get the maxFailedItems property: The maximum number of items that can + * fail indexing for indexer execution to still be considered successful. + * -1 means no limit. Default is 0. + * + * @return the maxFailedItems value. + */ + public Integer getMaxFailedItems() { + return this.maxFailedItems; + } + + /** + * Set the maxFailedItems property: The maximum number of items that can + * fail indexing for indexer execution to still be considered successful. + * -1 means no limit. Default is 0. + * + * @param maxFailedItems the maxFailedItems value to set. + * @return the IndexingParameters object itself. + */ + public IndexingParameters setMaxFailedItems(Integer maxFailedItems) { + this.maxFailedItems = maxFailedItems; + return this; + } + + /** + * Get the maxFailedItemsPerBatch property: The maximum number of items in + * a single batch that can fail indexing for the batch to still be + * considered successful. -1 means no limit. Default is 0. + * + * @return the maxFailedItemsPerBatch value. + */ + public Integer getMaxFailedItemsPerBatch() { + return this.maxFailedItemsPerBatch; + } + + /** + * Set the maxFailedItemsPerBatch property: The maximum number of items in + * a single batch that can fail indexing for the batch to still be + * considered successful. -1 means no limit. Default is 0. + * + * @param maxFailedItemsPerBatch the maxFailedItemsPerBatch value to set. + * @return the IndexingParameters object itself. + */ + public IndexingParameters setMaxFailedItemsPerBatch(Integer maxFailedItemsPerBatch) { + this.maxFailedItemsPerBatch = maxFailedItemsPerBatch; + return this; + } + + /** + * Get the configuration property: A dictionary of indexer-specific + * configuration properties. Each name is the name of a specific property. + * Each value must be of a primitive type. + * + * @return the configuration value. + */ + public Map getConfiguration() { + return this.configuration; + } + + /** + * Set the configuration property: A dictionary of indexer-specific + * configuration properties. Each name is the name of a specific property. + * Each value must be of a primitive type. + * + * @param configuration the configuration value to set. + * @return the IndexingParameters object itself. + */ + public IndexingParameters setConfiguration(Map configuration) { + this.configuration = configuration; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingResult.java new file mode 100644 index 000000000000..691261a1b72f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingResult.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status of an indexing operation for a single document. + */ +@Fluent +public final class IndexingResult { + /* + * The key of a document that was in the indexing request. + */ + @JsonProperty(value = "key", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String key; + + /* + * The error message explaining why the indexing operation failed for the + * document identified by the key; null if indexing succeeded. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * A value indicating whether the indexing operation succeeded for the + * document identified by the key. + */ + @JsonProperty(value = "status", required = true, access = JsonProperty.Access.WRITE_ONLY) + private boolean succeeded; + + /* + * The status code of the indexing operation. Possible values include: 200 + * for a successful update or delete, 201 for successful document creation, + * 400 for a malformed input document, 404 for document not found, 409 for + * a version conflict, 422 when the index is temporarily unavailable, or + * 503 for when the service is too busy. + */ + @JsonProperty(value = "statusCode", required = true, access = JsonProperty.Access.WRITE_ONLY) + private int statusCode; + + /** + * Get the key property: The key of a document that was in the indexing + * request. + * + * @return the key value. + */ + public String getKey() { + return this.key; + } + + /** + * Get the errorMessage property: The error message explaining why the + * indexing operation failed for the document identified by the key; null + * if indexing succeeded. + * + * @return the errorMessage value. + */ + public String getErrorMessage() { + return this.errorMessage; + } + + /** + * Get the succeeded property: A value indicating whether the indexing + * operation succeeded for the document identified by the key. + * + * @return the succeeded value. + */ + public boolean isSucceeded() { + return this.succeeded; + } + + /** + * Get the statusCode property: The status code of the indexing operation. + * Possible values include: 200 for a successful update or delete, 201 for + * successful document creation, 400 for a malformed input document, 404 + * for document not found, 409 for a version conflict, 422 when the index + * is temporarily unavailable, or 503 for when the service is too busy. + * + * @return the statusCode value. + */ + public int getStatusCode() { + return this.statusCode; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingSchedule.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingSchedule.java new file mode 100644 index 000000000000..0ad3c411816a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexingSchedule.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** + * Represents a schedule for indexer execution. + */ +@Fluent +public final class IndexingSchedule { + /* + * The interval of time between indexer executions. + */ + @JsonProperty(value = "interval", required = true) + private Duration interval; + + /* + * The time when an indexer should start running. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /** + * Get the interval property: The interval of time between indexer + * executions. + * + * @return the interval value. + */ + public Duration getInterval() { + return this.interval; + } + + /** + * Set the interval property: The interval of time between indexer + * executions. + * + * @param interval the interval value to set. + * @return the IndexingSchedule object itself. + */ + public IndexingSchedule setInterval(Duration interval) { + this.interval = interval; + return this; + } + + /** + * Get the startTime property: The time when an indexer should start + * running. + * + * @return the startTime value. + */ + public OffsetDateTime getStartTime() { + return this.startTime; + } + + /** + * Set the startTime property: The time when an indexer should start + * running. + * + * @param startTime the startTime value to set. + * @return the IndexingSchedule object itself. + */ + public IndexingSchedule setStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/InputFieldMappingEntry.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/InputFieldMappingEntry.java new file mode 100644 index 000000000000..7256d6b26781 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/InputFieldMappingEntry.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Input field mapping for a skill. + */ +@Fluent +public final class InputFieldMappingEntry { + /* + * The name of the input. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The source of the input. + */ + @JsonProperty(value = "source") + private String source; + + /* + * The source context used for selecting recursive inputs. + */ + @JsonProperty(value = "sourceContext") + private String sourceContext; + + /* + * The recursive inputs used when creating a complex type. + */ + @JsonProperty(value = "inputs") + private List inputs; + + /** + * Get the name property: The name of the input. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the input. + * + * @param name the name value to set. + * @return the InputFieldMappingEntry object itself. + */ + public InputFieldMappingEntry setName(String name) { + this.name = name; + return this; + } + + /** + * Get the source property: The source of the input. + * + * @return the source value. + */ + public String getSource() { + return this.source; + } + + /** + * Set the source property: The source of the input. + * + * @param source the source value to set. + * @return the InputFieldMappingEntry object itself. + */ + public InputFieldMappingEntry setSource(String source) { + this.source = source; + return this; + } + + /** + * Get the sourceContext property: The source context used for selecting + * recursive inputs. + * + * @return the sourceContext value. + */ + public String getSourceContext() { + return this.sourceContext; + } + + /** + * Set the sourceContext property: The source context used for selecting + * recursive inputs. + * + * @param sourceContext the sourceContext value to set. + * @return the InputFieldMappingEntry object itself. + */ + public InputFieldMappingEntry setSourceContext(String sourceContext) { + this.sourceContext = sourceContext; + return this; + } + + /** + * Get the inputs property: The recursive inputs used when creating a + * complex type. + * + * @return the inputs value. + */ + public List getInputs() { + return this.inputs; + } + + /** + * Set the inputs property: The recursive inputs used when creating a + * complex type. + * + * @param inputs the inputs value to set. + * @return the InputFieldMappingEntry object itself. + */ + public InputFieldMappingEntry setInputs(List inputs) { + this.inputs = inputs; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeepTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeepTokenFilter.java new file mode 100644 index 000000000000..da793ed70bde --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeepTokenFilter.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * A token filter that only keeps tokens with text contained in a specified + * list of words. This token filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.KeepTokenFilter") +@Fluent +public final class KeepTokenFilter extends TokenFilter { + /* + * The list of words to keep. + */ + @JsonProperty(value = "keepWords", required = true) + private List keepWords; + + /* + * A value indicating whether to lower case all words first. Default is + * false. + */ + @JsonProperty(value = "keepWordsCase") + private Boolean lowerCaseKeepWords; + + /** + * Get the keepWords property: The list of words to keep. + * + * @return the keepWords value. + */ + public List getKeepWords() { + return this.keepWords; + } + + /** + * Set the keepWords property: The list of words to keep. + * + * @param keepWords the keepWords value to set. + * @return the KeepTokenFilter object itself. + */ + public KeepTokenFilter setKeepWords(List keepWords) { + this.keepWords = keepWords; + return this; + } + + /** + * Get the lowerCaseKeepWords property: A value indicating whether to lower + * case all words first. Default is false. + * + * @return the lowerCaseKeepWords value. + */ + public Boolean isLowerCaseKeepWords() { + return this.lowerCaseKeepWords; + } + + /** + * Set the lowerCaseKeepWords property: A value indicating whether to lower + * case all words first. Default is false. + * + * @param lowerCaseKeepWords the lowerCaseKeepWords value to set. + * @return the KeepTokenFilter object itself. + */ + public KeepTokenFilter setLowerCaseKeepWords(Boolean lowerCaseKeepWords) { + this.lowerCaseKeepWords = lowerCaseKeepWords; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeyPhraseExtractionSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeyPhraseExtractionSkill.java new file mode 100644 index 000000000000..dd76b0a538bd --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeyPhraseExtractionSkill.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A skill that uses text analytics for key phrase extraction. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Text.KeyPhraseExtractionSkill") +@Fluent +public final class KeyPhraseExtractionSkill extends SearchIndexerSkill { + /* + * A value indicating which language code to use. Default is en. Possible + * values include: 'da', 'nl', 'en', 'fi', 'fr', 'de', 'it', 'ja', 'ko', + * 'no', 'pl', 'pt-PT', 'pt-BR', 'ru', 'es', 'sv' + */ + @JsonProperty(value = "defaultLanguageCode") + private KeyPhraseExtractionSkillLanguage defaultLanguageCode; + + /* + * A number indicating how many key phrases to return. If absent, all + * identified key phrases will be returned. + */ + @JsonProperty(value = "maxKeyPhraseCount") + private Integer maxKeyPhraseCount; + + /** + * Get the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'da', 'nl', 'en', + * 'fi', 'fr', 'de', 'it', 'ja', 'ko', 'no', 'pl', 'pt-PT', 'pt-BR', 'ru', + * 'es', 'sv'. + * + * @return the defaultLanguageCode value. + */ + public KeyPhraseExtractionSkillLanguage getDefaultLanguageCode() { + return this.defaultLanguageCode; + } + + /** + * Set the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'da', 'nl', 'en', + * 'fi', 'fr', 'de', 'it', 'ja', 'ko', 'no', 'pl', 'pt-PT', 'pt-BR', 'ru', + * 'es', 'sv'. + * + * @param defaultLanguageCode the defaultLanguageCode value to set. + * @return the KeyPhraseExtractionSkill object itself. + */ + public KeyPhraseExtractionSkill setDefaultLanguageCode(KeyPhraseExtractionSkillLanguage defaultLanguageCode) { + this.defaultLanguageCode = defaultLanguageCode; + return this; + } + + /** + * Get the maxKeyPhraseCount property: A number indicating how many key + * phrases to return. If absent, all identified key phrases will be + * returned. + * + * @return the maxKeyPhraseCount value. + */ + public Integer getMaxKeyPhraseCount() { + return this.maxKeyPhraseCount; + } + + /** + * Set the maxKeyPhraseCount property: A number indicating how many key + * phrases to return. If absent, all identified key phrases will be + * returned. + * + * @param maxKeyPhraseCount the maxKeyPhraseCount value to set. + * @return the KeyPhraseExtractionSkill object itself. + */ + public KeyPhraseExtractionSkill setMaxKeyPhraseCount(Integer maxKeyPhraseCount) { + this.maxKeyPhraseCount = maxKeyPhraseCount; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeyPhraseExtractionSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeyPhraseExtractionSkillLanguage.java new file mode 100644 index 000000000000..e185cb498c5d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeyPhraseExtractionSkillLanguage.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for KeyPhraseExtractionSkillLanguage. + */ +public final class KeyPhraseExtractionSkillLanguage extends ExpandableStringEnum { + /** + * Static value da for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage DA = fromString("da"); + + /** + * Static value nl for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage NL = fromString("nl"); + + /** + * Static value en for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage EN = fromString("en"); + + /** + * Static value fi for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage FI = fromString("fi"); + + /** + * Static value fr for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage FR = fromString("fr"); + + /** + * Static value de for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage DE = fromString("de"); + + /** + * Static value it for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage IT = fromString("it"); + + /** + * Static value ja for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage JA = fromString("ja"); + + /** + * Static value ko for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage KO = fromString("ko"); + + /** + * Static value no for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage NO = fromString("no"); + + /** + * Static value pl for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage PL = fromString("pl"); + + /** + * Static value pt-PT for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage PT_PT = fromString("pt-PT"); + + /** + * Static value pt-BR for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage PT_BR = fromString("pt-BR"); + + /** + * Static value ru for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage RU = fromString("ru"); + + /** + * Static value es for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage ES = fromString("es"); + + /** + * Static value sv for KeyPhraseExtractionSkillLanguage. + */ + public static final KeyPhraseExtractionSkillLanguage SV = fromString("sv"); + + /** + * Creates or finds a KeyPhraseExtractionSkillLanguage from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyPhraseExtractionSkillLanguage. + */ + @JsonCreator + public static KeyPhraseExtractionSkillLanguage fromString(String name) { + return fromString(name, KeyPhraseExtractionSkillLanguage.class); + } + + /** + * @return known KeyPhraseExtractionSkillLanguage values. + */ + public static Collection values() { + return values(KeyPhraseExtractionSkillLanguage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordMarkerTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordMarkerTokenFilter.java new file mode 100644 index 000000000000..a655f7bfa1ba --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordMarkerTokenFilter.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Marks terms as keywords. This token filter is implemented using Apache + * Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.KeywordMarkerTokenFilter") +@Fluent +public final class KeywordMarkerTokenFilter extends TokenFilter { + /* + * A list of words to mark as keywords. + */ + @JsonProperty(value = "keywords", required = true) + private List keywords; + + /* + * A value indicating whether to ignore case. If true, all words are + * converted to lower case first. Default is false. + */ + @JsonProperty(value = "ignoreCase") + private Boolean ignoreCase; + + /** + * Get the keywords property: A list of words to mark as keywords. + * + * @return the keywords value. + */ + public List getKeywords() { + return this.keywords; + } + + /** + * Set the keywords property: A list of words to mark as keywords. + * + * @param keywords the keywords value to set. + * @return the KeywordMarkerTokenFilter object itself. + */ + public KeywordMarkerTokenFilter setKeywords(List keywords) { + this.keywords = keywords; + return this; + } + + /** + * Get the ignoreCase property: A value indicating whether to ignore case. + * If true, all words are converted to lower case first. Default is false. + * + * @return the ignoreCase value. + */ + public Boolean isIgnoreCase() { + return this.ignoreCase; + } + + /** + * Set the ignoreCase property: A value indicating whether to ignore case. + * If true, all words are converted to lower case first. Default is false. + * + * @param ignoreCase the ignoreCase value to set. + * @return the KeywordMarkerTokenFilter object itself. + */ + public KeywordMarkerTokenFilter setIgnoreCase(Boolean ignoreCase) { + this.ignoreCase = ignoreCase; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordTokenizer.java new file mode 100644 index 000000000000..ed9dfe2eceb0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordTokenizer.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Emits the entire input as a single token. This tokenizer is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.KeywordTokenizer") +@Fluent +public final class KeywordTokenizer extends LexicalTokenizer { + /* + * The read buffer size in bytes. Default is 256. + */ + @JsonProperty(value = "bufferSize") + private Integer bufferSize; + + /** + * Get the bufferSize property: The read buffer size in bytes. Default is + * 256. + * + * @return the bufferSize value. + */ + public Integer getBufferSize() { + return this.bufferSize; + } + + /** + * Set the bufferSize property: The read buffer size in bytes. Default is + * 256. + * + * @param bufferSize the bufferSize value to set. + * @return the KeywordTokenizer object itself. + */ + public KeywordTokenizer setBufferSize(Integer bufferSize) { + this.bufferSize = bufferSize; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordTokenizerV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordTokenizerV2.java new file mode 100644 index 000000000000..cf95d549cd7f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/KeywordTokenizerV2.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Emits the entire input as a single token. This tokenizer is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.KeywordTokenizerV2") +@Fluent +public final class KeywordTokenizerV2 extends LexicalTokenizer { + /* + * The maximum token length. Default is 256. Tokens longer than the maximum + * length are split. The maximum token length that can be used is 300 + * characters. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /** + * Get the maxTokenLength property: The maximum token length. Default is + * 256. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Default is + * 256. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the KeywordTokenizerV2 object itself. + */ + public KeywordTokenizerV2 setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LanguageDetectionSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LanguageDetectionSkill.java new file mode 100644 index 000000000000..b015ffd92ed8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LanguageDetectionSkill.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A skill that detects the language of input text and reports a single + * language code for every document submitted on the request. The language code + * is paired with a score indicating the confidence of the analysis. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Text.LanguageDetectionSkill") +@Fluent +public final class LanguageDetectionSkill extends SearchIndexerSkill { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LengthTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LengthTokenFilter.java new file mode 100644 index 000000000000..a2d83fe1ceef --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LengthTokenFilter.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Removes words that are too long or too short. This token filter is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.LengthTokenFilter") +@Fluent +public final class LengthTokenFilter extends TokenFilter { + /* + * The minimum length in characters. Default is 0. Maximum is 300. Must be + * less than the value of max. + */ + @JsonProperty(value = "min") + private Integer minLength; + + /* + * The maximum length in characters. Default and maximum is 300. + */ + @JsonProperty(value = "max") + private Integer maxLength; + + /** + * Get the minLength property: The minimum length in characters. Default is + * 0. Maximum is 300. Must be less than the value of max. + * + * @return the minLength value. + */ + public Integer getMinLength() { + return this.minLength; + } + + /** + * Set the minLength property: The minimum length in characters. Default is + * 0. Maximum is 300. Must be less than the value of max. + * + * @param minLength the minLength value to set. + * @return the LengthTokenFilter object itself. + */ + public LengthTokenFilter setMinLength(Integer minLength) { + this.minLength = minLength; + return this; + } + + /** + * Get the maxLength property: The maximum length in characters. Default + * and maximum is 300. + * + * @return the maxLength value. + */ + public Integer getMaxLength() { + return this.maxLength; + } + + /** + * Set the maxLength property: The maximum length in characters. Default + * and maximum is 300. + * + * @param maxLength the maxLength value to set. + * @return the LengthTokenFilter object itself. + */ + public LengthTokenFilter setMaxLength(Integer maxLength) { + this.maxLength = maxLength; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalAnalyzer.java new file mode 100644 index 000000000000..8a12531b3c78 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalAnalyzer.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for analyzers. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = LexicalAnalyzer.class) +@JsonTypeName("LexicalAnalyzer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.CustomAnalyzer", value = CustomAnalyzer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.PatternAnalyzer", value = PatternAnalyzer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StandardAnalyzer", value = LuceneStandardAnalyzer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StopAnalyzer", value = StopAnalyzer.class) +}) +@Fluent +public class LexicalAnalyzer { + /* + * The name of the analyzer. It must only contain letters, digits, spaces, + * dashes or underscores, can only start and end with alphanumeric + * characters, and is limited to 128 characters. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: The name of the analyzer. It must only contain + * letters, digits, spaces, dashes or underscores, can only start and end + * with alphanumeric characters, and is limited to 128 characters. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the analyzer. It must only contain + * letters, digits, spaces, dashes or underscores, can only start and end + * with alphanumeric characters, and is limited to 128 characters. + * + * @param name the name value to set. + * @return the LexicalAnalyzer object itself. + */ + public LexicalAnalyzer setName(String name) { + this.name = name; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalAnalyzerName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalAnalyzerName.java new file mode 100644 index 000000000000..6132ada32fb4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalAnalyzerName.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for LexicalAnalyzerName. + */ +public final class LexicalAnalyzerName extends ExpandableStringEnum { + /** + * Static value ar.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName AR_MICROSOFT = fromString("ar.microsoft"); + + /** + * Static value ar.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName AR_LUCENE = fromString("ar.lucene"); + + /** + * Static value hy.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName HY_LUCENE = fromString("hy.lucene"); + + /** + * Static value bn.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName BN_MICROSOFT = fromString("bn.microsoft"); + + /** + * Static value eu.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName EU_LUCENE = fromString("eu.lucene"); + + /** + * Static value bg.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName BG_MICROSOFT = fromString("bg.microsoft"); + + /** + * Static value bg.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName BG_LUCENE = fromString("bg.lucene"); + + /** + * Static value ca.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName CA_MICROSOFT = fromString("ca.microsoft"); + + /** + * Static value ca.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName CA_LUCENE = fromString("ca.lucene"); + + /** + * Static value zh-Hans.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ZH_HANS_MICROSOFT = fromString("zh-Hans.microsoft"); + + /** + * Static value zh-Hans.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ZH_HANS_LUCENE = fromString("zh-Hans.lucene"); + + /** + * Static value zh-Hant.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ZH_HANT_MICROSOFT = fromString("zh-Hant.microsoft"); + + /** + * Static value zh-Hant.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ZH_HANT_LUCENE = fromString("zh-Hant.lucene"); + + /** + * Static value hr.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName HR_MICROSOFT = fromString("hr.microsoft"); + + /** + * Static value cs.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName CS_MICROSOFT = fromString("cs.microsoft"); + + /** + * Static value cs.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName CS_LUCENE = fromString("cs.lucene"); + + /** + * Static value da.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName DA_MICROSOFT = fromString("da.microsoft"); + + /** + * Static value da.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName DA_LUCENE = fromString("da.lucene"); + + /** + * Static value nl.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName NL_MICROSOFT = fromString("nl.microsoft"); + + /** + * Static value nl.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName NL_LUCENE = fromString("nl.lucene"); + + /** + * Static value en.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName EN_MICROSOFT = fromString("en.microsoft"); + + /** + * Static value en.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName EN_LUCENE = fromString("en.lucene"); + + /** + * Static value et.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ET_MICROSOFT = fromString("et.microsoft"); + + /** + * Static value fi.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName FI_MICROSOFT = fromString("fi.microsoft"); + + /** + * Static value fi.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName FI_LUCENE = fromString("fi.lucene"); + + /** + * Static value fr.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName FR_MICROSOFT = fromString("fr.microsoft"); + + /** + * Static value fr.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName FR_LUCENE = fromString("fr.lucene"); + + /** + * Static value gl.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName GL_LUCENE = fromString("gl.lucene"); + + /** + * Static value de.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName DE_MICROSOFT = fromString("de.microsoft"); + + /** + * Static value de.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName DE_LUCENE = fromString("de.lucene"); + + /** + * Static value el.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName EL_MICROSOFT = fromString("el.microsoft"); + + /** + * Static value el.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName EL_LUCENE = fromString("el.lucene"); + + /** + * Static value gu.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName GU_MICROSOFT = fromString("gu.microsoft"); + + /** + * Static value he.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName HE_MICROSOFT = fromString("he.microsoft"); + + /** + * Static value hi.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName HI_MICROSOFT = fromString("hi.microsoft"); + + /** + * Static value hi.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName HI_LUCENE = fromString("hi.lucene"); + + /** + * Static value hu.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName HU_MICROSOFT = fromString("hu.microsoft"); + + /** + * Static value hu.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName HU_LUCENE = fromString("hu.lucene"); + + /** + * Static value is.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName IS_MICROSOFT = fromString("is.microsoft"); + + /** + * Static value id.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ID_MICROSOFT = fromString("id.microsoft"); + + /** + * Static value id.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ID_LUCENE = fromString("id.lucene"); + + /** + * Static value ga.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName GA_LUCENE = fromString("ga.lucene"); + + /** + * Static value it.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName IT_MICROSOFT = fromString("it.microsoft"); + + /** + * Static value it.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName IT_LUCENE = fromString("it.lucene"); + + /** + * Static value ja.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName JA_MICROSOFT = fromString("ja.microsoft"); + + /** + * Static value ja.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName JA_LUCENE = fromString("ja.lucene"); + + /** + * Static value kn.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName KN_MICROSOFT = fromString("kn.microsoft"); + + /** + * Static value ko.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName KO_MICROSOFT = fromString("ko.microsoft"); + + /** + * Static value ko.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName KO_LUCENE = fromString("ko.lucene"); + + /** + * Static value lv.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName LV_MICROSOFT = fromString("lv.microsoft"); + + /** + * Static value lv.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName LV_LUCENE = fromString("lv.lucene"); + + /** + * Static value lt.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName LT_MICROSOFT = fromString("lt.microsoft"); + + /** + * Static value ml.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ML_MICROSOFT = fromString("ml.microsoft"); + + /** + * Static value ms.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName MS_MICROSOFT = fromString("ms.microsoft"); + + /** + * Static value mr.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName MR_MICROSOFT = fromString("mr.microsoft"); + + /** + * Static value nb.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName NB_MICROSOFT = fromString("nb.microsoft"); + + /** + * Static value no.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName NO_LUCENE = fromString("no.lucene"); + + /** + * Static value fa.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName FA_LUCENE = fromString("fa.lucene"); + + /** + * Static value pl.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName PL_MICROSOFT = fromString("pl.microsoft"); + + /** + * Static value pl.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName PL_LUCENE = fromString("pl.lucene"); + + /** + * Static value pt-BR.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName PT_BR_MICROSOFT = fromString("pt-BR.microsoft"); + + /** + * Static value pt-BR.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName PT_BR_LUCENE = fromString("pt-BR.lucene"); + + /** + * Static value pt-PT.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName PT_PT_MICROSOFT = fromString("pt-PT.microsoft"); + + /** + * Static value pt-PT.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName PT_PT_LUCENE = fromString("pt-PT.lucene"); + + /** + * Static value pa.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName PA_MICROSOFT = fromString("pa.microsoft"); + + /** + * Static value ro.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName RO_MICROSOFT = fromString("ro.microsoft"); + + /** + * Static value ro.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName RO_LUCENE = fromString("ro.lucene"); + + /** + * Static value ru.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName RU_MICROSOFT = fromString("ru.microsoft"); + + /** + * Static value ru.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName RU_LUCENE = fromString("ru.lucene"); + + /** + * Static value sr-cyrillic.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName SR_CYRILLIC_MICROSOFT = fromString("sr-cyrillic.microsoft"); + + /** + * Static value sr-latin.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName SR_LATIN_MICROSOFT = fromString("sr-latin.microsoft"); + + /** + * Static value sk.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName SK_MICROSOFT = fromString("sk.microsoft"); + + /** + * Static value sl.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName SL_MICROSOFT = fromString("sl.microsoft"); + + /** + * Static value es.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ES_MICROSOFT = fromString("es.microsoft"); + + /** + * Static value es.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName ES_LUCENE = fromString("es.lucene"); + + /** + * Static value sv.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName SV_MICROSOFT = fromString("sv.microsoft"); + + /** + * Static value sv.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName SV_LUCENE = fromString("sv.lucene"); + + /** + * Static value ta.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName TA_MICROSOFT = fromString("ta.microsoft"); + + /** + * Static value te.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName TE_MICROSOFT = fromString("te.microsoft"); + + /** + * Static value th.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName TH_MICROSOFT = fromString("th.microsoft"); + + /** + * Static value th.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName TH_LUCENE = fromString("th.lucene"); + + /** + * Static value tr.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName TR_MICROSOFT = fromString("tr.microsoft"); + + /** + * Static value tr.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName TR_LUCENE = fromString("tr.lucene"); + + /** + * Static value uk.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName UK_MICROSOFT = fromString("uk.microsoft"); + + /** + * Static value ur.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName UR_MICROSOFT = fromString("ur.microsoft"); + + /** + * Static value vi.microsoft for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName VI_MICROSOFT = fromString("vi.microsoft"); + + /** + * Static value standard.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName STANDARD_LUCENE = fromString("standard.lucene"); + + /** + * Static value standardasciifolding.lucene for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName STANDARD_ASCII_FOLDING_LUCENE = fromString("standardasciifolding.lucene"); + + /** + * Static value keyword for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName KEYWORD = fromString("keyword"); + + /** + * Static value pattern for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName PATTERN = fromString("pattern"); + + /** + * Static value simple for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName SIMPLE = fromString("simple"); + + /** + * Static value stop for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName STOP = fromString("stop"); + + /** + * Static value whitespace for LexicalAnalyzerName. + */ + public static final LexicalAnalyzerName WHITESPACE = fromString("whitespace"); + + /** + * Creates or finds a LexicalAnalyzerName from its string representation. + * + * @param name a name to look for. + * @return the corresponding LexicalAnalyzerName. + */ + @JsonCreator + public static LexicalAnalyzerName fromString(String name) { + return fromString(name, LexicalAnalyzerName.class); + } + + /** + * @return known LexicalAnalyzerName values. + */ + public static Collection values() { + return values(LexicalAnalyzerName.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalTokenizer.java new file mode 100644 index 000000000000..3570a0fb1aee --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalTokenizer.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for tokenizers. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = LexicalTokenizer.class) +@JsonTypeName("LexicalTokenizer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.ClassicTokenizer", value = ClassicTokenizer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.EdgeNGramTokenizer", value = EdgeNGramTokenizer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.KeywordTokenizer", value = KeywordTokenizer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.KeywordTokenizerV2", value = KeywordTokenizerV2.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer", value = MicrosoftLanguageTokenizer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer", value = MicrosoftLanguageStemmingTokenizer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.NGramTokenizer", value = NGramTokenizer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.PathHierarchyTokenizerV2", value = PathHierarchyTokenizerV2.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.PatternTokenizer", value = PatternTokenizer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StandardTokenizer", value = LuceneStandardTokenizer.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StandardTokenizerV2", value = LuceneStandardTokenizerV2.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.UaxUrlEmailTokenizer", value = UaxUrlEmailTokenizer.class) +}) +@Fluent +public class LexicalTokenizer { + /* + * The name of the tokenizer. It must only contain letters, digits, spaces, + * dashes or underscores, can only start and end with alphanumeric + * characters, and is limited to 128 characters. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: The name of the tokenizer. It must only contain + * letters, digits, spaces, dashes or underscores, can only start and end + * with alphanumeric characters, and is limited to 128 characters. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the tokenizer. It must only contain + * letters, digits, spaces, dashes or underscores, can only start and end + * with alphanumeric characters, and is limited to 128 characters. + * + * @param name the name value to set. + * @return the LexicalTokenizer object itself. + */ + public LexicalTokenizer setName(String name) { + this.name = name; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalTokenizerName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalTokenizerName.java new file mode 100644 index 000000000000..e2fb106fce27 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LexicalTokenizerName.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for LexicalTokenizerName. + */ +public final class LexicalTokenizerName extends ExpandableStringEnum { + /** + * Static value classic for LexicalTokenizerName. + */ + public static final LexicalTokenizerName CLASSIC = fromString("classic"); + + /** + * Static value edgeNGram for LexicalTokenizerName. + */ + public static final LexicalTokenizerName EDGE_NGRAM = fromString("edgeNGram"); + + /** + * Static value keyword_v2 for LexicalTokenizerName. + */ + public static final LexicalTokenizerName KEYWORD = fromString("keyword_v2"); + + /** + * Static value letter for LexicalTokenizerName. + */ + public static final LexicalTokenizerName LETTER = fromString("letter"); + + /** + * Static value lowercase for LexicalTokenizerName. + */ + public static final LexicalTokenizerName LOWERCASE = fromString("lowercase"); + + /** + * Static value microsoft_language_tokenizer for LexicalTokenizerName. + */ + public static final LexicalTokenizerName MICROSOFT_LANGUAGE_TOKENIZER = fromString("microsoft_language_tokenizer"); + + /** + * Static value microsoft_language_stemming_tokenizer for LexicalTokenizerName. + */ + public static final LexicalTokenizerName MICROSOFT_LANGUAGE_STEMMING_TOKENIZER = fromString("microsoft_language_stemming_tokenizer"); + + /** + * Static value nGram for LexicalTokenizerName. + */ + public static final LexicalTokenizerName NGRAM = fromString("nGram"); + + /** + * Static value path_hierarchy_v2 for LexicalTokenizerName. + */ + public static final LexicalTokenizerName PATH_HIERARCHY = fromString("path_hierarchy_v2"); + + /** + * Static value pattern for LexicalTokenizerName. + */ + public static final LexicalTokenizerName PATTERN = fromString("pattern"); + + /** + * Static value standard_v2 for LexicalTokenizerName. + */ + public static final LexicalTokenizerName STANDARD = fromString("standard_v2"); + + /** + * Static value uax_url_email for LexicalTokenizerName. + */ + public static final LexicalTokenizerName UAX_URL_EMAIL = fromString("uax_url_email"); + + /** + * Static value whitespace for LexicalTokenizerName. + */ + public static final LexicalTokenizerName WHITESPACE = fromString("whitespace"); + + /** + * Creates or finds a LexicalTokenizerName from its string representation. + * + * @param name a name to look for. + * @return the corresponding LexicalTokenizerName. + */ + @JsonCreator + public static LexicalTokenizerName fromString(String name) { + return fromString(name, LexicalTokenizerName.class); + } + + /** + * @return known LexicalTokenizerName values. + */ + public static Collection values() { + return values(LexicalTokenizerName.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LimitTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LimitTokenFilter.java new file mode 100644 index 000000000000..b5994e19f87d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LimitTokenFilter.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Limits the number of tokens while indexing. This token filter is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.LimitTokenFilter") +@Fluent +public final class LimitTokenFilter extends TokenFilter { + /* + * The maximum number of tokens to produce. Default is 1. + */ + @JsonProperty(value = "maxTokenCount") + private Integer maxTokenCount; + + /* + * A value indicating whether all tokens from the input must be consumed + * even if maxTokenCount is reached. Default is false. + */ + @JsonProperty(value = "consumeAllTokens") + private Boolean consumeAllTokens; + + /** + * Get the maxTokenCount property: The maximum number of tokens to produce. + * Default is 1. + * + * @return the maxTokenCount value. + */ + public Integer getMaxTokenCount() { + return this.maxTokenCount; + } + + /** + * Set the maxTokenCount property: The maximum number of tokens to produce. + * Default is 1. + * + * @param maxTokenCount the maxTokenCount value to set. + * @return the LimitTokenFilter object itself. + */ + public LimitTokenFilter setMaxTokenCount(Integer maxTokenCount) { + this.maxTokenCount = maxTokenCount; + return this; + } + + /** + * Get the consumeAllTokens property: A value indicating whether all tokens + * from the input must be consumed even if maxTokenCount is reached. + * Default is false. + * + * @return the consumeAllTokens value. + */ + public Boolean isConsumeAllTokens() { + return this.consumeAllTokens; + } + + /** + * Set the consumeAllTokens property: A value indicating whether all tokens + * from the input must be consumed even if maxTokenCount is reached. + * Default is false. + * + * @param consumeAllTokens the consumeAllTokens value to set. + * @return the LimitTokenFilter object itself. + */ + public LimitTokenFilter setConsumeAllTokens(Boolean consumeAllTokens) { + this.consumeAllTokens = consumeAllTokens; + return this; + } +} 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/LuceneStandardAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardAnalyzer.java new file mode 100644 index 000000000000..ca3b7d9a6e39 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardAnalyzer.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Standard Apache Lucene analyzer; Composed of the standard tokenizer, + * lowercase filter and stop filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.StandardAnalyzer") +@Fluent +public final class LuceneStandardAnalyzer extends LexicalAnalyzer { + /* + * The maximum token length. Default is 255. Tokens longer than the maximum + * length are split. The maximum token length that can be used is 300 + * characters. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /* + * A list of stopwords. + */ + @JsonProperty(value = "stopwords") + private List stopwords; + + /** + * Get the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the LuceneStandardAnalyzer object itself. + */ + public LuceneStandardAnalyzer setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } + + /** + * Get the stopwords property: A list of stopwords. + * + * @return the stopwords value. + */ + public List getStopwords() { + return this.stopwords; + } + + /** + * Set the stopwords property: A list of stopwords. + * + * @param stopwords the stopwords value to set. + * @return the LuceneStandardAnalyzer object itself. + */ + public LuceneStandardAnalyzer setStopwords(List stopwords) { + this.stopwords = stopwords; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardTokenizer.java new file mode 100644 index 000000000000..48baa67a8a28 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardTokenizer.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Breaks text following the Unicode Text Segmentation rules. This tokenizer is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.StandardTokenizer") +@Fluent +public final class LuceneStandardTokenizer extends LexicalTokenizer { + /* + * The maximum token length. Default is 255. Tokens longer than the maximum + * length are split. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /** + * Get the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the LuceneStandardTokenizer object itself. + */ + public LuceneStandardTokenizer setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardTokenizerV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardTokenizerV2.java new file mode 100644 index 000000000000..92724b5ce9bc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/LuceneStandardTokenizerV2.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Breaks text following the Unicode Text Segmentation rules. This tokenizer is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.StandardTokenizerV2") +@Fluent +public final class LuceneStandardTokenizerV2 extends LexicalTokenizer { + /* + * The maximum token length. Default is 255. Tokens longer than the maximum + * length are split. The maximum token length that can be used is 300 + * characters. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /** + * Get the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the LuceneStandardTokenizerV2 object itself. + */ + public LuceneStandardTokenizerV2 setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MagnitudeScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MagnitudeScoringFunction.java new file mode 100644 index 000000000000..6d256865ad16 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MagnitudeScoringFunction.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines a function that boosts scores based on the magnitude of a numeric + * field. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("magnitude") +@Fluent +public final class MagnitudeScoringFunction extends ScoringFunction { + /* + * Parameter values for the magnitude scoring function. + */ + @JsonProperty(value = "magnitude", required = true) + private MagnitudeScoringParameters parameters; + + /** + * Get the parameters property: Parameter values for the magnitude scoring + * function. + * + * @return the parameters value. + */ + public MagnitudeScoringParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameter values for the magnitude scoring + * function. + * + * @param parameters the parameters value to set. + * @return the MagnitudeScoringFunction object itself. + */ + public MagnitudeScoringFunction setParameters(MagnitudeScoringParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MagnitudeScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MagnitudeScoringParameters.java new file mode 100644 index 000000000000..6c50fdd4ae47 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MagnitudeScoringParameters.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Provides parameter values to a magnitude scoring function. + */ +@Fluent +public final class MagnitudeScoringParameters { + /* + * The field value at which boosting starts. + */ + @JsonProperty(value = "boostingRangeStart", required = true) + private double boostingRangeStart; + + /* + * The field value at which boosting ends. + */ + @JsonProperty(value = "boostingRangeEnd", required = true) + private double boostingRangeEnd; + + /* + * A value indicating whether to apply a constant boost for field values + * beyond the range end value; default is false. + */ + @JsonProperty(value = "constantBoostBeyondRange") + private Boolean shouldBoostBeyondRangeByConstant; + + /** + * Get the boostingRangeStart property: The field value at which boosting + * starts. + * + * @return the boostingRangeStart value. + */ + public double getBoostingRangeStart() { + return this.boostingRangeStart; + } + + /** + * Set the boostingRangeStart property: The field value at which boosting + * starts. + * + * @param boostingRangeStart the boostingRangeStart value to set. + * @return the MagnitudeScoringParameters object itself. + */ + public MagnitudeScoringParameters setBoostingRangeStart(double boostingRangeStart) { + this.boostingRangeStart = boostingRangeStart; + return this; + } + + /** + * Get the boostingRangeEnd property: The field value at which boosting + * ends. + * + * @return the boostingRangeEnd value. + */ + public double getBoostingRangeEnd() { + return this.boostingRangeEnd; + } + + /** + * Set the boostingRangeEnd property: The field value at which boosting + * ends. + * + * @param boostingRangeEnd the boostingRangeEnd value to set. + * @return the MagnitudeScoringParameters object itself. + */ + public MagnitudeScoringParameters setBoostingRangeEnd(double boostingRangeEnd) { + this.boostingRangeEnd = boostingRangeEnd; + return this; + } + + /** + * Get the shouldBoostBeyondRangeByConstant property: A value indicating + * whether to apply a constant boost for field values beyond the range end + * value; default is false. + * + * @return the shouldBoostBeyondRangeByConstant value. + */ + public Boolean isShouldBoostBeyondRangeByConstant() { + return this.shouldBoostBeyondRangeByConstant; + } + + /** + * Set the shouldBoostBeyondRangeByConstant property: A value indicating + * whether to apply a constant boost for field values beyond the range end + * value; default is false. + * + * @param shouldBoostBeyondRangeByConstant the + * shouldBoostBeyondRangeByConstant value to set. + * @return the MagnitudeScoringParameters object itself. + */ + public MagnitudeScoringParameters setShouldBoostBeyondRangeByConstant(Boolean shouldBoostBeyondRangeByConstant) { + this.shouldBoostBeyondRangeByConstant = shouldBoostBeyondRangeByConstant; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MappingCharFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MappingCharFilter.java new file mode 100644 index 000000000000..5d3430095fa6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MappingCharFilter.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * A character filter that applies mappings defined with the mappings option. + * Matching is greedy (longest pattern matching at a given point wins). + * Replacement is allowed to be the empty string. This character filter is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.MappingCharFilter") +@Fluent +public final class MappingCharFilter extends CharFilter { + /* + * A list of mappings of the following format: "a=>b" (all occurrences of + * the character "a" will be replaced with character "b"). + */ + @JsonProperty(value = "mappings", required = true) + private List mappings; + + /** + * Get the mappings property: A list of mappings of the following format: + * "a=>b" (all occurrences of the character "a" will be replaced with + * character "b"). + * + * @return the mappings value. + */ + public List getMappings() { + return this.mappings; + } + + /** + * Set the mappings property: A list of mappings of the following format: + * "a=>b" (all occurrences of the character "a" will be replaced with + * character "b"). + * + * @param mappings the mappings value to set. + * @return the MappingCharFilter object itself. + */ + public MappingCharFilter setMappings(List mappings) { + this.mappings = mappings; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MergeSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MergeSkill.java new file mode 100644 index 000000000000..c96ac6c302bf --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MergeSkill.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A skill for merging two or more strings into a single unified string, with + * an optional user-defined delimiter separating each component part. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Text.MergeSkill") +@Fluent +public final class MergeSkill extends SearchIndexerSkill { + /* + * The tag indicates the start of the merged text. By default, the tag is + * an empty space. + */ + @JsonProperty(value = "insertPreTag") + private String insertPreTag; + + /* + * The tag indicates the end of the merged text. By default, the tag is an + * empty space. + */ + @JsonProperty(value = "insertPostTag") + private String insertPostTag; + + /** + * Get the insertPreTag property: The tag indicates the start of the merged + * text. By default, the tag is an empty space. + * + * @return the insertPreTag value. + */ + public String getInsertPreTag() { + return this.insertPreTag; + } + + /** + * Set the insertPreTag property: The tag indicates the start of the merged + * text. By default, the tag is an empty space. + * + * @param insertPreTag the insertPreTag value to set. + * @return the MergeSkill object itself. + */ + public MergeSkill setInsertPreTag(String insertPreTag) { + this.insertPreTag = insertPreTag; + return this; + } + + /** + * Get the insertPostTag property: The tag indicates the end of the merged + * text. By default, the tag is an empty space. + * + * @return the insertPostTag value. + */ + public String getInsertPostTag() { + return this.insertPostTag; + } + + /** + * Set the insertPostTag property: The tag indicates the end of the merged + * text. By default, the tag is an empty space. + * + * @param insertPostTag the insertPostTag value to set. + * @return the MergeSkill object itself. + */ + public MergeSkill setInsertPostTag(String insertPostTag) { + this.insertPostTag = insertPostTag; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftLanguageStemmingTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftLanguageStemmingTokenizer.java new file mode 100644 index 000000000000..fed67bcd1036 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftLanguageStemmingTokenizer.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Divides text using language-specific rules and reduces words to their base + * forms. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer") +@Fluent +public final class MicrosoftLanguageStemmingTokenizer extends LexicalTokenizer { + /* + * The maximum token length. Tokens longer than the maximum length are + * split. Maximum token length that can be used is 300 characters. Tokens + * longer than 300 characters are first split into tokens of length 300 and + * then each of those tokens is split based on the max token length set. + * Default is 255. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /* + * A value indicating how the tokenizer is used. Set to true if used as the + * search tokenizer, set to false if used as the indexing tokenizer. + * Default is false. + */ + @JsonProperty(value = "isSearchTokenizer") + private Boolean isSearchTokenizer; + + /* + * The language to use. The default is English. Possible values include: + * 'Arabic', 'Bangla', 'Bulgarian', 'Catalan', 'Croatian', 'Czech', + * 'Danish', 'Dutch', 'English', 'Estonian', 'Finnish', 'French', 'German', + * 'Greek', 'Gujarati', 'Hebrew', 'Hindi', 'Hungarian', 'Icelandic', + * 'Indonesian', 'Italian', 'Kannada', 'Latvian', 'Lithuanian', 'Malay', + * 'Malayalam', 'Marathi', 'NorwegianBokmaal', 'Polish', 'Portuguese', + * 'PortugueseBrazilian', 'Punjabi', 'Romanian', 'Russian', + * 'SerbianCyrillic', 'SerbianLatin', 'Slovak', 'Slovenian', 'Spanish', + * 'Swedish', 'Tamil', 'Telugu', 'Turkish', 'Ukrainian', 'Urdu' + */ + @JsonProperty(value = "language") + private MicrosoftStemmingTokenizerLanguage language; + + /** + * Get the maxTokenLength property: The maximum token length. Tokens longer + * than the maximum length are split. Maximum token length that can be used + * is 300 characters. Tokens longer than 300 characters are first split + * into tokens of length 300 and then each of those tokens is split based + * on the max token length set. Default is 255. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Tokens longer + * than the maximum length are split. Maximum token length that can be used + * is 300 characters. Tokens longer than 300 characters are first split + * into tokens of length 300 and then each of those tokens is split based + * on the max token length set. Default is 255. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the MicrosoftLanguageStemmingTokenizer object itself. + */ + public MicrosoftLanguageStemmingTokenizer setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } + + /** + * Get the isSearchTokenizer property: A value indicating how the tokenizer + * is used. Set to true if used as the search tokenizer, set to false if + * used as the indexing tokenizer. Default is false. + * + * @return the isSearchTokenizer value. + */ + public Boolean isSearchTokenizer() { + return this.isSearchTokenizer; + } + + /** + * Set the isSearchTokenizer property: A value indicating how the tokenizer + * is used. Set to true if used as the search tokenizer, set to false if + * used as the indexing tokenizer. Default is false. + * + * @param isSearchTokenizer the isSearchTokenizer value to set. + * @return the MicrosoftLanguageStemmingTokenizer object itself. + */ + public MicrosoftLanguageStemmingTokenizer setIsSearchTokenizer(Boolean isSearchTokenizer) { + this.isSearchTokenizer = isSearchTokenizer; + return this; + } + + /** + * Get the language property: The language to use. The default is English. + * Possible values include: 'Arabic', 'Bangla', 'Bulgarian', 'Catalan', + * 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', 'Estonian', + * 'Finnish', 'French', 'German', 'Greek', 'Gujarati', 'Hebrew', 'Hindi', + * 'Hungarian', 'Icelandic', 'Indonesian', 'Italian', 'Kannada', 'Latvian', + * 'Lithuanian', 'Malay', 'Malayalam', 'Marathi', 'NorwegianBokmaal', + * 'Polish', 'Portuguese', 'PortugueseBrazilian', 'Punjabi', 'Romanian', + * 'Russian', 'SerbianCyrillic', 'SerbianLatin', 'Slovak', 'Slovenian', + * 'Spanish', 'Swedish', 'Tamil', 'Telugu', 'Turkish', 'Ukrainian', 'Urdu'. + * + * @return the language value. + */ + public MicrosoftStemmingTokenizerLanguage getLanguage() { + return this.language; + } + + /** + * Set the language property: The language to use. The default is English. + * Possible values include: 'Arabic', 'Bangla', 'Bulgarian', 'Catalan', + * 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', 'Estonian', + * 'Finnish', 'French', 'German', 'Greek', 'Gujarati', 'Hebrew', 'Hindi', + * 'Hungarian', 'Icelandic', 'Indonesian', 'Italian', 'Kannada', 'Latvian', + * 'Lithuanian', 'Malay', 'Malayalam', 'Marathi', 'NorwegianBokmaal', + * 'Polish', 'Portuguese', 'PortugueseBrazilian', 'Punjabi', 'Romanian', + * 'Russian', 'SerbianCyrillic', 'SerbianLatin', 'Slovak', 'Slovenian', + * 'Spanish', 'Swedish', 'Tamil', 'Telugu', 'Turkish', 'Ukrainian', 'Urdu'. + * + * @param language the language value to set. + * @return the MicrosoftLanguageStemmingTokenizer object itself. + */ + public MicrosoftLanguageStemmingTokenizer setLanguage(MicrosoftStemmingTokenizerLanguage language) { + this.language = language; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftLanguageTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftLanguageTokenizer.java new file mode 100644 index 000000000000..2be482240760 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftLanguageTokenizer.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Divides text using language-specific rules. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.MicrosoftLanguageTokenizer") +@Fluent +public final class MicrosoftLanguageTokenizer extends LexicalTokenizer { + /* + * The maximum token length. Tokens longer than the maximum length are + * split. Maximum token length that can be used is 300 characters. Tokens + * longer than 300 characters are first split into tokens of length 300 and + * then each of those tokens is split based on the max token length set. + * Default is 255. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /* + * A value indicating how the tokenizer is used. Set to true if used as the + * search tokenizer, set to false if used as the indexing tokenizer. + * Default is false. + */ + @JsonProperty(value = "isSearchTokenizer") + private Boolean isSearchTokenizer; + + /* + * The language to use. The default is English. Possible values include: + * 'Bangla', 'Bulgarian', 'Catalan', 'ChineseSimplified', + * 'ChineseTraditional', 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', + * 'French', 'German', 'Greek', 'Gujarati', 'Hindi', 'Icelandic', + * 'Indonesian', 'Italian', 'Japanese', 'Kannada', 'Korean', 'Malay', + * 'Malayalam', 'Marathi', 'NorwegianBokmaal', 'Polish', 'Portuguese', + * 'PortugueseBrazilian', 'Punjabi', 'Romanian', 'Russian', + * 'SerbianCyrillic', 'SerbianLatin', 'Slovenian', 'Spanish', 'Swedish', + * 'Tamil', 'Telugu', 'Thai', 'Ukrainian', 'Urdu', 'Vietnamese' + */ + @JsonProperty(value = "language") + private MicrosoftTokenizerLanguage language; + + /** + * Get the maxTokenLength property: The maximum token length. Tokens longer + * than the maximum length are split. Maximum token length that can be used + * is 300 characters. Tokens longer than 300 characters are first split + * into tokens of length 300 and then each of those tokens is split based + * on the max token length set. Default is 255. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Tokens longer + * than the maximum length are split. Maximum token length that can be used + * is 300 characters. Tokens longer than 300 characters are first split + * into tokens of length 300 and then each of those tokens is split based + * on the max token length set. Default is 255. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the MicrosoftLanguageTokenizer object itself. + */ + public MicrosoftLanguageTokenizer setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } + + /** + * Get the isSearchTokenizer property: A value indicating how the tokenizer + * is used. Set to true if used as the search tokenizer, set to false if + * used as the indexing tokenizer. Default is false. + * + * @return the isSearchTokenizer value. + */ + public Boolean isSearchTokenizer() { + return this.isSearchTokenizer; + } + + /** + * Set the isSearchTokenizer property: A value indicating how the tokenizer + * is used. Set to true if used as the search tokenizer, set to false if + * used as the indexing tokenizer. Default is false. + * + * @param isSearchTokenizer the isSearchTokenizer value to set. + * @return the MicrosoftLanguageTokenizer object itself. + */ + public MicrosoftLanguageTokenizer setIsSearchTokenizer(Boolean isSearchTokenizer) { + this.isSearchTokenizer = isSearchTokenizer; + return this; + } + + /** + * Get the language property: The language to use. The default is English. + * Possible values include: 'Bangla', 'Bulgarian', 'Catalan', + * 'ChineseSimplified', 'ChineseTraditional', 'Croatian', 'Czech', + * 'Danish', 'Dutch', 'English', 'French', 'German', 'Greek', 'Gujarati', + * 'Hindi', 'Icelandic', 'Indonesian', 'Italian', 'Japanese', 'Kannada', + * 'Korean', 'Malay', 'Malayalam', 'Marathi', 'NorwegianBokmaal', 'Polish', + * 'Portuguese', 'PortugueseBrazilian', 'Punjabi', 'Romanian', 'Russian', + * 'SerbianCyrillic', 'SerbianLatin', 'Slovenian', 'Spanish', 'Swedish', + * 'Tamil', 'Telugu', 'Thai', 'Ukrainian', 'Urdu', 'Vietnamese'. + * + * @return the language value. + */ + public MicrosoftTokenizerLanguage getLanguage() { + return this.language; + } + + /** + * Set the language property: The language to use. The default is English. + * Possible values include: 'Bangla', 'Bulgarian', 'Catalan', + * 'ChineseSimplified', 'ChineseTraditional', 'Croatian', 'Czech', + * 'Danish', 'Dutch', 'English', 'French', 'German', 'Greek', 'Gujarati', + * 'Hindi', 'Icelandic', 'Indonesian', 'Italian', 'Japanese', 'Kannada', + * 'Korean', 'Malay', 'Malayalam', 'Marathi', 'NorwegianBokmaal', 'Polish', + * 'Portuguese', 'PortugueseBrazilian', 'Punjabi', 'Romanian', 'Russian', + * 'SerbianCyrillic', 'SerbianLatin', 'Slovenian', 'Spanish', 'Swedish', + * 'Tamil', 'Telugu', 'Thai', 'Ukrainian', 'Urdu', 'Vietnamese'. + * + * @param language the language value to set. + * @return the MicrosoftLanguageTokenizer object itself. + */ + public MicrosoftLanguageTokenizer setLanguage(MicrosoftTokenizerLanguage language) { + this.language = language; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftStemmingTokenizerLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftStemmingTokenizerLanguage.java new file mode 100644 index 000000000000..e3c421dedd62 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftStemmingTokenizerLanguage.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MicrosoftStemmingTokenizerLanguage. + */ +public enum MicrosoftStemmingTokenizerLanguage { + /** + * Enum value arabic. + */ + ARABIC("arabic"), + + /** + * Enum value bangla. + */ + BANGLA("bangla"), + + /** + * Enum value bulgarian. + */ + BULGARIAN("bulgarian"), + + /** + * Enum value catalan. + */ + CATALAN("catalan"), + + /** + * Enum value croatian. + */ + CROATIAN("croatian"), + + /** + * Enum value czech. + */ + CZECH("czech"), + + /** + * Enum value danish. + */ + DANISH("danish"), + + /** + * Enum value dutch. + */ + DUTCH("dutch"), + + /** + * Enum value english. + */ + ENGLISH("english"), + + /** + * Enum value estonian. + */ + ESTONIAN("estonian"), + + /** + * Enum value finnish. + */ + FINNISH("finnish"), + + /** + * Enum value french. + */ + FRENCH("french"), + + /** + * Enum value german. + */ + GERMAN("german"), + + /** + * Enum value greek. + */ + GREEK("greek"), + + /** + * Enum value gujarati. + */ + GUJARATI("gujarati"), + + /** + * Enum value hebrew. + */ + HEBREW("hebrew"), + + /** + * Enum value hindi. + */ + HINDI("hindi"), + + /** + * Enum value hungarian. + */ + HUNGARIAN("hungarian"), + + /** + * Enum value icelandic. + */ + ICELANDIC("icelandic"), + + /** + * Enum value indonesian. + */ + INDONESIAN("indonesian"), + + /** + * Enum value italian. + */ + ITALIAN("italian"), + + /** + * Enum value kannada. + */ + KANNADA("kannada"), + + /** + * Enum value latvian. + */ + LATVIAN("latvian"), + + /** + * Enum value lithuanian. + */ + LITHUANIAN("lithuanian"), + + /** + * Enum value malay. + */ + MALAY("malay"), + + /** + * Enum value malayalam. + */ + MALAYALAM("malayalam"), + + /** + * Enum value marathi. + */ + MARATHI("marathi"), + + /** + * Enum value norwegianBokmaal. + */ + NORWEGIAN_BOKMAAL("norwegianBokmaal"), + + /** + * Enum value polish. + */ + POLISH("polish"), + + /** + * Enum value portuguese. + */ + PORTUGUESE("portuguese"), + + /** + * Enum value portugueseBrazilian. + */ + PORTUGUESE_BRAZILIAN("portugueseBrazilian"), + + /** + * Enum value punjabi. + */ + PUNJABI("punjabi"), + + /** + * Enum value romanian. + */ + ROMANIAN("romanian"), + + /** + * Enum value russian. + */ + RUSSIAN("russian"), + + /** + * Enum value serbianCyrillic. + */ + SERBIAN_CYRILLIC("serbianCyrillic"), + + /** + * Enum value serbianLatin. + */ + SERBIAN_LATIN("serbianLatin"), + + /** + * Enum value slovak. + */ + SLOVAK("slovak"), + + /** + * Enum value slovenian. + */ + SLOVENIAN("slovenian"), + + /** + * Enum value spanish. + */ + SPANISH("spanish"), + + /** + * Enum value swedish. + */ + SWEDISH("swedish"), + + /** + * Enum value tamil. + */ + TAMIL("tamil"), + + /** + * Enum value telugu. + */ + TELUGU("telugu"), + + /** + * Enum value turkish. + */ + TURKISH("turkish"), + + /** + * Enum value ukrainian. + */ + UKRAINIAN("ukrainian"), + + /** + * Enum value urdu. + */ + URDU("urdu"); + + /** + * The actual serialized value for a MicrosoftStemmingTokenizerLanguage instance. + */ + private final String value; + + MicrosoftStemmingTokenizerLanguage(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MicrosoftStemmingTokenizerLanguage instance. + * + * @param value the serialized value to parse. + * @return the parsed MicrosoftStemmingTokenizerLanguage object, or null if unable to parse. + */ + @JsonCreator + public static MicrosoftStemmingTokenizerLanguage fromString(String value) { + MicrosoftStemmingTokenizerLanguage[] items = MicrosoftStemmingTokenizerLanguage.values(); + for (MicrosoftStemmingTokenizerLanguage item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftTokenizerLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftTokenizerLanguage.java new file mode 100644 index 000000000000..1958aacb9363 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/MicrosoftTokenizerLanguage.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MicrosoftTokenizerLanguage. + */ +public enum MicrosoftTokenizerLanguage { + /** + * Enum value bangla. + */ + BANGLA("bangla"), + + /** + * Enum value bulgarian. + */ + BULGARIAN("bulgarian"), + + /** + * Enum value catalan. + */ + CATALAN("catalan"), + + /** + * Enum value chineseSimplified. + */ + CHINESE_SIMPLIFIED("chineseSimplified"), + + /** + * Enum value chineseTraditional. + */ + CHINESE_TRADITIONAL("chineseTraditional"), + + /** + * Enum value croatian. + */ + CROATIAN("croatian"), + + /** + * Enum value czech. + */ + CZECH("czech"), + + /** + * Enum value danish. + */ + DANISH("danish"), + + /** + * Enum value dutch. + */ + DUTCH("dutch"), + + /** + * Enum value english. + */ + ENGLISH("english"), + + /** + * Enum value french. + */ + FRENCH("french"), + + /** + * Enum value german. + */ + GERMAN("german"), + + /** + * Enum value greek. + */ + GREEK("greek"), + + /** + * Enum value gujarati. + */ + GUJARATI("gujarati"), + + /** + * Enum value hindi. + */ + HINDI("hindi"), + + /** + * Enum value icelandic. + */ + ICELANDIC("icelandic"), + + /** + * Enum value indonesian. + */ + INDONESIAN("indonesian"), + + /** + * Enum value italian. + */ + ITALIAN("italian"), + + /** + * Enum value japanese. + */ + JAPANESE("japanese"), + + /** + * Enum value kannada. + */ + KANNADA("kannada"), + + /** + * Enum value korean. + */ + KOREAN("korean"), + + /** + * Enum value malay. + */ + MALAY("malay"), + + /** + * Enum value malayalam. + */ + MALAYALAM("malayalam"), + + /** + * Enum value marathi. + */ + MARATHI("marathi"), + + /** + * Enum value norwegianBokmaal. + */ + NORWEGIAN_BOKMAAL("norwegianBokmaal"), + + /** + * Enum value polish. + */ + POLISH("polish"), + + /** + * Enum value portuguese. + */ + PORTUGUESE("portuguese"), + + /** + * Enum value portugueseBrazilian. + */ + PORTUGUESE_BRAZILIAN("portugueseBrazilian"), + + /** + * Enum value punjabi. + */ + PUNJABI("punjabi"), + + /** + * Enum value romanian. + */ + ROMANIAN("romanian"), + + /** + * Enum value russian. + */ + RUSSIAN("russian"), + + /** + * Enum value serbianCyrillic. + */ + SERBIAN_CYRILLIC("serbianCyrillic"), + + /** + * Enum value serbianLatin. + */ + SERBIAN_LATIN("serbianLatin"), + + /** + * Enum value slovenian. + */ + SLOVENIAN("slovenian"), + + /** + * Enum value spanish. + */ + SPANISH("spanish"), + + /** + * Enum value swedish. + */ + SWEDISH("swedish"), + + /** + * Enum value tamil. + */ + TAMIL("tamil"), + + /** + * Enum value telugu. + */ + TELUGU("telugu"), + + /** + * Enum value thai. + */ + THAI("thai"), + + /** + * Enum value ukrainian. + */ + UKRAINIAN("ukrainian"), + + /** + * Enum value urdu. + */ + URDU("urdu"), + + /** + * Enum value vietnamese. + */ + VIETNAMESE("vietnamese"); + + /** + * The actual serialized value for a MicrosoftTokenizerLanguage instance. + */ + private final String value; + + MicrosoftTokenizerLanguage(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MicrosoftTokenizerLanguage instance. + * + * @param value the serialized value to parse. + * @return the parsed MicrosoftTokenizerLanguage object, or null if unable to parse. + */ + @JsonCreator + public static MicrosoftTokenizerLanguage fromString(String value) { + MicrosoftTokenizerLanguage[] items = MicrosoftTokenizerLanguage.values(); + for (MicrosoftTokenizerLanguage item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenFilter.java new file mode 100644 index 000000000000..044ba606971a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenFilter.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Generates n-grams of the given size(s). This token filter is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.NGramTokenFilter") +@Fluent +public final class NGramTokenFilter extends TokenFilter { + /* + * The minimum n-gram length. Default is 1. Must be less than the value of + * maxGram. + */ + @JsonProperty(value = "minGram") + private Integer minGram; + + /* + * The maximum n-gram length. Default is 2. + */ + @JsonProperty(value = "maxGram") + private Integer maxGram; + + /** + * Get the minGram property: The minimum n-gram length. Default is 1. Must + * be less than the value of maxGram. + * + * @return the minGram value. + */ + public Integer getMinGram() { + return this.minGram; + } + + /** + * Set the minGram property: The minimum n-gram length. Default is 1. Must + * be less than the value of maxGram. + * + * @param minGram the minGram value to set. + * @return the NGramTokenFilter object itself. + */ + public NGramTokenFilter setMinGram(Integer minGram) { + this.minGram = minGram; + return this; + } + + /** + * Get the maxGram property: The maximum n-gram length. Default is 2. + * + * @return the maxGram value. + */ + public Integer getMaxGram() { + return this.maxGram; + } + + /** + * Set the maxGram property: The maximum n-gram length. Default is 2. + * + * @param maxGram the maxGram value to set. + * @return the NGramTokenFilter object itself. + */ + public NGramTokenFilter setMaxGram(Integer maxGram) { + this.maxGram = maxGram; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenFilterV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenFilterV2.java new file mode 100644 index 000000000000..448e56a703a0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenFilterV2.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Generates n-grams of the given size(s). This token filter is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.NGramTokenFilterV2") +@Fluent +public final class NGramTokenFilterV2 extends TokenFilter { + /* + * The minimum n-gram length. Default is 1. Maximum is 300. Must be less + * than the value of maxGram. + */ + @JsonProperty(value = "minGram") + private Integer minGram; + + /* + * The maximum n-gram length. Default is 2. Maximum is 300. + */ + @JsonProperty(value = "maxGram") + private Integer maxGram; + + /** + * Get the minGram property: The minimum n-gram length. Default is 1. + * Maximum is 300. Must be less than the value of maxGram. + * + * @return the minGram value. + */ + public Integer getMinGram() { + return this.minGram; + } + + /** + * Set the minGram property: The minimum n-gram length. Default is 1. + * Maximum is 300. Must be less than the value of maxGram. + * + * @param minGram the minGram value to set. + * @return the NGramTokenFilterV2 object itself. + */ + public NGramTokenFilterV2 setMinGram(Integer minGram) { + this.minGram = minGram; + return this; + } + + /** + * Get the maxGram property: The maximum n-gram length. Default is 2. + * Maximum is 300. + * + * @return the maxGram value. + */ + public Integer getMaxGram() { + return this.maxGram; + } + + /** + * Set the maxGram property: The maximum n-gram length. Default is 2. + * Maximum is 300. + * + * @param maxGram the maxGram value to set. + * @return the NGramTokenFilterV2 object itself. + */ + public NGramTokenFilterV2 setMaxGram(Integer maxGram) { + this.maxGram = maxGram; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenizer.java new file mode 100644 index 000000000000..234d975dc97f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/NGramTokenizer.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Tokenizes the input into n-grams of the given size(s). This tokenizer is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.NGramTokenizer") +@Fluent +public final class NGramTokenizer extends LexicalTokenizer { + /* + * The minimum n-gram length. Default is 1. Maximum is 300. Must be less + * than the value of maxGram. + */ + @JsonProperty(value = "minGram") + private Integer minGram; + + /* + * The maximum n-gram length. Default is 2. Maximum is 300. + */ + @JsonProperty(value = "maxGram") + private Integer maxGram; + + /* + * Character classes to keep in the tokens. + */ + @JsonProperty(value = "tokenChars") + private List tokenChars; + + /** + * Get the minGram property: The minimum n-gram length. Default is 1. + * Maximum is 300. Must be less than the value of maxGram. + * + * @return the minGram value. + */ + public Integer getMinGram() { + return this.minGram; + } + + /** + * Set the minGram property: The minimum n-gram length. Default is 1. + * Maximum is 300. Must be less than the value of maxGram. + * + * @param minGram the minGram value to set. + * @return the NGramTokenizer object itself. + */ + public NGramTokenizer setMinGram(Integer minGram) { + this.minGram = minGram; + return this; + } + + /** + * Get the maxGram property: The maximum n-gram length. Default is 2. + * Maximum is 300. + * + * @return the maxGram value. + */ + public Integer getMaxGram() { + return this.maxGram; + } + + /** + * Set the maxGram property: The maximum n-gram length. Default is 2. + * Maximum is 300. + * + * @param maxGram the maxGram value to set. + * @return the NGramTokenizer object itself. + */ + public NGramTokenizer setMaxGram(Integer maxGram) { + this.maxGram = maxGram; + return this; + } + + /** + * Get the tokenChars property: Character classes to keep in the tokens. + * + * @return the tokenChars value. + */ + public List getTokenChars() { + return this.tokenChars; + } + + /** + * Set the tokenChars property: Character classes to keep in the tokens. + * + * @param tokenChars the tokenChars value to set. + * @return the NGramTokenizer object itself. + */ + public NGramTokenizer setTokenChars(List tokenChars) { + this.tokenChars = tokenChars; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OcrSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OcrSkill.java new file mode 100644 index 000000000000..92655bbf2ac6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OcrSkill.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A skill that extracts text from image files. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Vision.OcrSkill") +@Fluent +public final class OcrSkill extends SearchIndexerSkill { + /* + * A value indicating which algorithm to use for extracting text. Default + * is printed. Possible values include: 'Printed', 'Handwritten' + */ + @JsonProperty(value = "textExtractionAlgorithm") + private TextExtractionAlgorithm textExtractionAlgorithm; + + /* + * A value indicating which language code to use. Default is en. Possible + * values include: 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', + * 'fr', 'de', 'el', 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', + * 'sv', 'tr', 'ar', 'ro', 'sr-Cyrl', 'sr-Latn', 'sk' + */ + @JsonProperty(value = "defaultLanguageCode") + private OcrSkillLanguage defaultLanguageCode; + + /* + * A value indicating to turn orientation detection on or not. Default is + * false. + */ + @JsonProperty(value = "detectOrientation") + private Boolean shouldDetectOrientation; + + /** + * Get the textExtractionAlgorithm property: A value indicating which + * algorithm to use for extracting text. Default is printed. Possible + * values include: 'Printed', 'Handwritten'. + * + * @return the textExtractionAlgorithm value. + */ + public TextExtractionAlgorithm getTextExtractionAlgorithm() { + return this.textExtractionAlgorithm; + } + + /** + * Set the textExtractionAlgorithm property: A value indicating which + * algorithm to use for extracting text. Default is printed. Possible + * values include: 'Printed', 'Handwritten'. + * + * @param textExtractionAlgorithm the textExtractionAlgorithm value to set. + * @return the OcrSkill object itself. + */ + public OcrSkill setTextExtractionAlgorithm(TextExtractionAlgorithm textExtractionAlgorithm) { + this.textExtractionAlgorithm = textExtractionAlgorithm; + return this; + } + + /** + * Get the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'zh-Hans', + * 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'hu', 'it', + * 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', + * 'sr-Cyrl', 'sr-Latn', 'sk'. + * + * @return the defaultLanguageCode value. + */ + public OcrSkillLanguage getDefaultLanguageCode() { + return this.defaultLanguageCode; + } + + /** + * Set the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'zh-Hans', + * 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'hu', 'it', + * 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', + * 'sr-Cyrl', 'sr-Latn', 'sk'. + * + * @param defaultLanguageCode the defaultLanguageCode value to set. + * @return the OcrSkill object itself. + */ + public OcrSkill setDefaultLanguageCode(OcrSkillLanguage defaultLanguageCode) { + this.defaultLanguageCode = defaultLanguageCode; + return this; + } + + /** + * Get the shouldDetectOrientation property: A value indicating to turn + * orientation detection on or not. Default is false. + * + * @return the shouldDetectOrientation value. + */ + public Boolean isShouldDetectOrientation() { + return this.shouldDetectOrientation; + } + + /** + * Set the shouldDetectOrientation property: A value indicating to turn + * orientation detection on or not. Default is false. + * + * @param shouldDetectOrientation the shouldDetectOrientation value to set. + * @return the OcrSkill object itself. + */ + public OcrSkill setShouldDetectOrientation(Boolean shouldDetectOrientation) { + this.shouldDetectOrientation = shouldDetectOrientation; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OcrSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OcrSkillLanguage.java new file mode 100644 index 000000000000..aa9d2bd6f030 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OcrSkillLanguage.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for OcrSkillLanguage. + */ +public final class OcrSkillLanguage extends ExpandableStringEnum { + /** + * Static value zh-Hans for OcrSkillLanguage. + */ + public static final OcrSkillLanguage ZH_HANS = fromString("zh-Hans"); + + /** + * Static value zh-Hant for OcrSkillLanguage. + */ + public static final OcrSkillLanguage ZH_HANT = fromString("zh-Hant"); + + /** + * Static value cs for OcrSkillLanguage. + */ + public static final OcrSkillLanguage CS = fromString("cs"); + + /** + * Static value da for OcrSkillLanguage. + */ + public static final OcrSkillLanguage DA = fromString("da"); + + /** + * Static value nl for OcrSkillLanguage. + */ + public static final OcrSkillLanguage NL = fromString("nl"); + + /** + * Static value en for OcrSkillLanguage. + */ + public static final OcrSkillLanguage EN = fromString("en"); + + /** + * Static value fi for OcrSkillLanguage. + */ + public static final OcrSkillLanguage FI = fromString("fi"); + + /** + * Static value fr for OcrSkillLanguage. + */ + public static final OcrSkillLanguage FR = fromString("fr"); + + /** + * Static value de for OcrSkillLanguage. + */ + public static final OcrSkillLanguage DE = fromString("de"); + + /** + * Static value el for OcrSkillLanguage. + */ + public static final OcrSkillLanguage EL = fromString("el"); + + /** + * Static value hu for OcrSkillLanguage. + */ + public static final OcrSkillLanguage HU = fromString("hu"); + + /** + * Static value it for OcrSkillLanguage. + */ + public static final OcrSkillLanguage IT = fromString("it"); + + /** + * Static value ja for OcrSkillLanguage. + */ + public static final OcrSkillLanguage JA = fromString("ja"); + + /** + * Static value ko for OcrSkillLanguage. + */ + public static final OcrSkillLanguage KO = fromString("ko"); + + /** + * Static value nb for OcrSkillLanguage. + */ + public static final OcrSkillLanguage NB = fromString("nb"); + + /** + * Static value pl for OcrSkillLanguage. + */ + public static final OcrSkillLanguage PL = fromString("pl"); + + /** + * Static value pt for OcrSkillLanguage. + */ + public static final OcrSkillLanguage PT = fromString("pt"); + + /** + * Static value ru for OcrSkillLanguage. + */ + public static final OcrSkillLanguage RU = fromString("ru"); + + /** + * Static value es for OcrSkillLanguage. + */ + public static final OcrSkillLanguage ES = fromString("es"); + + /** + * Static value sv for OcrSkillLanguage. + */ + public static final OcrSkillLanguage SV = fromString("sv"); + + /** + * Static value tr for OcrSkillLanguage. + */ + public static final OcrSkillLanguage TR = fromString("tr"); + + /** + * Static value ar for OcrSkillLanguage. + */ + public static final OcrSkillLanguage AR = fromString("ar"); + + /** + * Static value ro for OcrSkillLanguage. + */ + public static final OcrSkillLanguage RO = fromString("ro"); + + /** + * Static value sr-Cyrl for OcrSkillLanguage. + */ + public static final OcrSkillLanguage SR_CYRL = fromString("sr-Cyrl"); + + /** + * Static value sr-Latn for OcrSkillLanguage. + */ + public static final OcrSkillLanguage SR_LATN = fromString("sr-Latn"); + + /** + * Static value sk for OcrSkillLanguage. + */ + public static final OcrSkillLanguage SK = fromString("sk"); + + /** + * Creates or finds a OcrSkillLanguage from its string representation. + * + * @param name a name to look for. + * @return the corresponding OcrSkillLanguage. + */ + @JsonCreator + public static OcrSkillLanguage fromString(String name) { + return fromString(name, OcrSkillLanguage.class); + } + + /** + * @return known OcrSkillLanguage values. + */ + public static Collection values() { + return values(OcrSkillLanguage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OutputFieldMappingEntry.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OutputFieldMappingEntry.java new file mode 100644 index 000000000000..0fd0712dbbe1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/OutputFieldMappingEntry.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output field mapping for a skill. + */ +@Fluent +public final class OutputFieldMappingEntry { + /* + * The name of the output defined by the skill. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The target name of the output. It is optional and default to name. + */ + @JsonProperty(value = "targetName") + private String targetName; + + /** + * Get the name property: The name of the output defined by the skill. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the output defined by the skill. + * + * @param name the name value to set. + * @return the OutputFieldMappingEntry object itself. + */ + public OutputFieldMappingEntry setName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetName property: The target name of the output. It is + * optional and default to name. + * + * @return the targetName value. + */ + public String getTargetName() { + return this.targetName; + } + + /** + * Set the targetName property: The target name of the output. It is + * optional and default to name. + * + * @param targetName the targetName value to set. + * @return the OutputFieldMappingEntry object itself. + */ + public OutputFieldMappingEntry setTargetName(String targetName) { + this.targetName = targetName; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PathHierarchyTokenizerV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PathHierarchyTokenizerV2.java new file mode 100644 index 000000000000..f891345a1c0c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PathHierarchyTokenizerV2.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Tokenizer for path-like hierarchies. This tokenizer is implemented using + * Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.PathHierarchyTokenizerV2") +@Fluent +public final class PathHierarchyTokenizerV2 extends LexicalTokenizer { + /* + * The delimiter character to use. Default is "/". + */ + @JsonProperty(value = "delimiter") + private String delimiter; + + /* + * A value that, if set, replaces the delimiter character. Default is "/". + */ + @JsonProperty(value = "replacement") + private String replacement; + + /* + * The maximum token length. Default and maximum is 300. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /* + * A value indicating whether to generate tokens in reverse order. Default + * is false. + */ + @JsonProperty(value = "reverse") + private Boolean reverseTokenOrder; + + /* + * The number of initial tokens to skip. Default is 0. + */ + @JsonProperty(value = "skip") + private Integer numberOfTokensToSkip; + + /** + * Get the delimiter property: The delimiter character to use. Default is + * "/". + * + * @return the delimiter value. + */ + public String getDelimiter() { + return this.delimiter; + } + + /** + * Set the delimiter property: The delimiter character to use. Default is + * "/". + * + * @param delimiter the delimiter value to set. + * @return the PathHierarchyTokenizerV2 object itself. + */ + public PathHierarchyTokenizerV2 setDelimiter(String delimiter) { + this.delimiter = delimiter; + return this; + } + + /** + * Get the replacement property: A value that, if set, replaces the + * delimiter character. Default is "/". + * + * @return the replacement value. + */ + public String getReplacement() { + return this.replacement; + } + + /** + * Set the replacement property: A value that, if set, replaces the + * delimiter character. Default is "/". + * + * @param replacement the replacement value to set. + * @return the PathHierarchyTokenizerV2 object itself. + */ + public PathHierarchyTokenizerV2 setReplacement(String replacement) { + this.replacement = replacement; + return this; + } + + /** + * Get the maxTokenLength property: The maximum token length. Default and + * maximum is 300. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Default and + * maximum is 300. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the PathHierarchyTokenizerV2 object itself. + */ + public PathHierarchyTokenizerV2 setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } + + /** + * Get the reverseTokenOrder property: A value indicating whether to + * generate tokens in reverse order. Default is false. + * + * @return the reverseTokenOrder value. + */ + public Boolean isReverseTokenOrder() { + return this.reverseTokenOrder; + } + + /** + * Set the reverseTokenOrder property: A value indicating whether to + * generate tokens in reverse order. Default is false. + * + * @param reverseTokenOrder the reverseTokenOrder value to set. + * @return the PathHierarchyTokenizerV2 object itself. + */ + public PathHierarchyTokenizerV2 setReverseTokenOrder(Boolean reverseTokenOrder) { + this.reverseTokenOrder = reverseTokenOrder; + return this; + } + + /** + * Get the numberOfTokensToSkip property: The number of initial tokens to + * skip. Default is 0. + * + * @return the numberOfTokensToSkip value. + */ + public Integer getNumberOfTokensToSkip() { + return this.numberOfTokensToSkip; + } + + /** + * Set the numberOfTokensToSkip property: The number of initial tokens to + * skip. Default is 0. + * + * @param numberOfTokensToSkip the numberOfTokensToSkip value to set. + * @return the PathHierarchyTokenizerV2 object itself. + */ + public PathHierarchyTokenizerV2 setNumberOfTokensToSkip(Integer numberOfTokensToSkip) { + this.numberOfTokensToSkip = numberOfTokensToSkip; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternAnalyzer.java new file mode 100644 index 000000000000..aeac4d1566fb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternAnalyzer.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Flexibly separates text into terms via a regular expression pattern. This + * analyzer is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.PatternAnalyzer") +@Fluent +public final class PatternAnalyzer extends LexicalAnalyzer { + /* + * A value indicating whether terms should be lower-cased. Default is true. + */ + @JsonProperty(value = "lowercase") + private Boolean lowerCaseTerms; + + /* + * A regular expression pattern to match token separators. Default is an + * expression that matches one or more non-word characters. + */ + @JsonProperty(value = "pattern") + private String pattern; + + /* + * Regular expression flags. Possible values include: 'CanonEq', + * 'CaseInsensitive', 'Comments', 'DotAll', 'Literal', 'Multiline', + * 'UnicodeCase', 'UnixLines' + */ + @JsonProperty(value = "flags") + private RegexFlags flags; + + /* + * A list of stopwords. + */ + @JsonProperty(value = "stopwords") + private List stopwords; + + /** + * Get the lowerCaseTerms property: A value indicating whether terms should + * be lower-cased. Default is true. + * + * @return the lowerCaseTerms value. + */ + public Boolean isLowerCaseTerms() { + return this.lowerCaseTerms; + } + + /** + * Set the lowerCaseTerms property: A value indicating whether terms should + * be lower-cased. Default is true. + * + * @param lowerCaseTerms the lowerCaseTerms value to set. + * @return the PatternAnalyzer object itself. + */ + public PatternAnalyzer setLowerCaseTerms(Boolean lowerCaseTerms) { + this.lowerCaseTerms = lowerCaseTerms; + return this; + } + + /** + * Get the pattern property: A regular expression pattern to match token + * separators. Default is an expression that matches one or more non-word + * characters. + * + * @return the pattern value. + */ + public String getPattern() { + return this.pattern; + } + + /** + * Set the pattern property: A regular expression pattern to match token + * separators. Default is an expression that matches one or more non-word + * characters. + * + * @param pattern the pattern value to set. + * @return the PatternAnalyzer object itself. + */ + public PatternAnalyzer setPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the flags property: Regular expression flags. Possible values + * include: 'CanonEq', 'CaseInsensitive', 'Comments', 'DotAll', 'Literal', + * 'Multiline', 'UnicodeCase', 'UnixLines'. + * + * @return the flags value. + */ + public RegexFlags getFlags() { + return this.flags; + } + + /** + * Set the flags property: Regular expression flags. Possible values + * include: 'CanonEq', 'CaseInsensitive', 'Comments', 'DotAll', 'Literal', + * 'Multiline', 'UnicodeCase', 'UnixLines'. + * + * @param flags the flags value to set. + * @return the PatternAnalyzer object itself. + */ + public PatternAnalyzer setFlags(RegexFlags flags) { + this.flags = flags; + return this; + } + + /** + * Get the stopwords property: A list of stopwords. + * + * @return the stopwords value. + */ + public List getStopwords() { + return this.stopwords; + } + + /** + * Set the stopwords property: A list of stopwords. + * + * @param stopwords the stopwords value to set. + * @return the PatternAnalyzer object itself. + */ + public PatternAnalyzer setStopwords(List stopwords) { + this.stopwords = stopwords; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternCaptureTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternCaptureTokenFilter.java new file mode 100644 index 000000000000..4244da3e0fd9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternCaptureTokenFilter.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Uses Java regexes to emit multiple tokens - one for each capture group in + * one or more patterns. This token filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.PatternCaptureTokenFilter") +@Fluent +public final class PatternCaptureTokenFilter extends TokenFilter { + /* + * A list of patterns to match against each token. + */ + @JsonProperty(value = "patterns", required = true) + private List patterns; + + /* + * A value indicating whether to return the original token even if one of + * the patterns matches. Default is true. + */ + @JsonProperty(value = "preserveOriginal") + private Boolean preserveOriginal; + + /** + * Get the patterns property: A list of patterns to match against each + * token. + * + * @return the patterns value. + */ + public List getPatterns() { + return this.patterns; + } + + /** + * Set the patterns property: A list of patterns to match against each + * token. + * + * @param patterns the patterns value to set. + * @return the PatternCaptureTokenFilter object itself. + */ + public PatternCaptureTokenFilter setPatterns(List patterns) { + this.patterns = patterns; + return this; + } + + /** + * Get the preserveOriginal property: A value indicating whether to return + * the original token even if one of the patterns matches. Default is true. + * + * @return the preserveOriginal value. + */ + public Boolean isPreserveOriginal() { + return this.preserveOriginal; + } + + /** + * Set the preserveOriginal property: A value indicating whether to return + * the original token even if one of the patterns matches. Default is true. + * + * @param preserveOriginal the preserveOriginal value to set. + * @return the PatternCaptureTokenFilter object itself. + */ + public PatternCaptureTokenFilter setPreserveOriginal(Boolean preserveOriginal) { + this.preserveOriginal = preserveOriginal; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternReplaceCharFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternReplaceCharFilter.java new file mode 100644 index 000000000000..a0606b50f104 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternReplaceCharFilter.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A character filter that replaces characters in the input string. It uses a + * regular expression to identify character sequences to preserve and a + * replacement pattern to identify characters to replace. For example, given + * the input text "aa bb aa bb", pattern "(aa)\s+(bb)", and replacement + * "$1#$2", the result would be "aa#bb aa#bb". This character filter is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.PatternReplaceCharFilter") +@Fluent +public final class PatternReplaceCharFilter extends CharFilter { + /* + * A regular expression pattern. + */ + @JsonProperty(value = "pattern", required = true) + private String pattern; + + /* + * The replacement text. + */ + @JsonProperty(value = "replacement", required = true) + private String replacement; + + /** + * Get the pattern property: A regular expression pattern. + * + * @return the pattern value. + */ + public String getPattern() { + return this.pattern; + } + + /** + * Set the pattern property: A regular expression pattern. + * + * @param pattern the pattern value to set. + * @return the PatternReplaceCharFilter object itself. + */ + public PatternReplaceCharFilter setPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the replacement property: The replacement text. + * + * @return the replacement value. + */ + public String getReplacement() { + return this.replacement; + } + + /** + * Set the replacement property: The replacement text. + * + * @param replacement the replacement value to set. + * @return the PatternReplaceCharFilter object itself. + */ + public PatternReplaceCharFilter setReplacement(String replacement) { + this.replacement = replacement; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternReplaceTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternReplaceTokenFilter.java new file mode 100644 index 000000000000..8c029df758d1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternReplaceTokenFilter.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A character filter that replaces characters in the input string. It uses a + * regular expression to identify character sequences to preserve and a + * replacement pattern to identify characters to replace. For example, given + * the input text "aa bb aa bb", pattern "(aa)\s+(bb)", and replacement + * "$1#$2", the result would be "aa#bb aa#bb". This token filter is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.PatternReplaceTokenFilter") +@Fluent +public final class PatternReplaceTokenFilter extends TokenFilter { + /* + * A regular expression pattern. + */ + @JsonProperty(value = "pattern", required = true) + private String pattern; + + /* + * The replacement text. + */ + @JsonProperty(value = "replacement", required = true) + private String replacement; + + /** + * Get the pattern property: A regular expression pattern. + * + * @return the pattern value. + */ + public String getPattern() { + return this.pattern; + } + + /** + * Set the pattern property: A regular expression pattern. + * + * @param pattern the pattern value to set. + * @return the PatternReplaceTokenFilter object itself. + */ + public PatternReplaceTokenFilter setPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the replacement property: The replacement text. + * + * @return the replacement value. + */ + public String getReplacement() { + return this.replacement; + } + + /** + * Set the replacement property: The replacement text. + * + * @param replacement the replacement value to set. + * @return the PatternReplaceTokenFilter object itself. + */ + public PatternReplaceTokenFilter setReplacement(String replacement) { + this.replacement = replacement; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternTokenizer.java new file mode 100644 index 000000000000..f750f9aa04df --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PatternTokenizer.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Tokenizer that uses regex pattern matching to construct distinct tokens. + * This tokenizer is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.PatternTokenizer") +@Fluent +public final class PatternTokenizer extends LexicalTokenizer { + /* + * A regular expression pattern to match token separators. Default is an + * expression that matches one or more non-word characters. + */ + @JsonProperty(value = "pattern") + private String pattern; + + /* + * Regular expression flags. Possible values include: 'CanonEq', + * 'CaseInsensitive', 'Comments', 'DotAll', 'Literal', 'Multiline', + * 'UnicodeCase', 'UnixLines' + */ + @JsonProperty(value = "flags") + private RegexFlags flags; + + /* + * The zero-based ordinal of the matching group in the regular expression + * pattern to extract into tokens. Use -1 if you want to use the entire + * pattern to split the input into tokens, irrespective of matching groups. + * Default is -1. + */ + @JsonProperty(value = "group") + private Integer group; + + /** + * Get the pattern property: A regular expression pattern to match token + * separators. Default is an expression that matches one or more non-word + * characters. + * + * @return the pattern value. + */ + public String getPattern() { + return this.pattern; + } + + /** + * Set the pattern property: A regular expression pattern to match token + * separators. Default is an expression that matches one or more non-word + * characters. + * + * @param pattern the pattern value to set. + * @return the PatternTokenizer object itself. + */ + public PatternTokenizer setPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the flags property: Regular expression flags. Possible values + * include: 'CanonEq', 'CaseInsensitive', 'Comments', 'DotAll', 'Literal', + * 'Multiline', 'UnicodeCase', 'UnixLines'. + * + * @return the flags value. + */ + public RegexFlags getFlags() { + return this.flags; + } + + /** + * Set the flags property: Regular expression flags. Possible values + * include: 'CanonEq', 'CaseInsensitive', 'Comments', 'DotAll', 'Literal', + * 'Multiline', 'UnicodeCase', 'UnixLines'. + * + * @param flags the flags value to set. + * @return the PatternTokenizer object itself. + */ + public PatternTokenizer setFlags(RegexFlags flags) { + this.flags = flags; + return this; + } + + /** + * Get the group property: The zero-based ordinal of the matching group in + * the regular expression pattern to extract into tokens. Use -1 if you + * want to use the entire pattern to split the input into tokens, + * irrespective of matching groups. Default is -1. + * + * @return the group value. + */ + public Integer getGroup() { + return this.group; + } + + /** + * Set the group property: The zero-based ordinal of the matching group in + * the regular expression pattern to extract into tokens. Use -1 if you + * want to use the entire pattern to split the input into tokens, + * irrespective of matching groups. Default is -1. + * + * @param group the group value to set. + * @return the PatternTokenizer object itself. + */ + public PatternTokenizer setGroup(Integer group) { + this.group = group; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PhoneticEncoder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PhoneticEncoder.java new file mode 100644 index 000000000000..8d901d4b27db --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PhoneticEncoder.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PhoneticEncoder. + */ +public enum PhoneticEncoder { + /** + * Enum value metaphone. + */ + METAPHONE("metaphone"), + + /** + * Enum value doubleMetaphone. + */ + DOUBLE_METAPHONE("doubleMetaphone"), + + /** + * Enum value soundex. + */ + SOUNDEX("soundex"), + + /** + * Enum value refinedSoundex. + */ + REFINED_SOUNDEX("refinedSoundex"), + + /** + * Enum value caverphone1. + */ + CAVERPHONE1("caverphone1"), + + /** + * Enum value caverphone2. + */ + CAVERPHONE2("caverphone2"), + + /** + * Enum value cologne. + */ + COLOGNE("cologne"), + + /** + * Enum value nysiis. + */ + NYSIIS("nysiis"), + + /** + * Enum value koelnerPhonetik. + */ + KOELNER_PHONETIK("koelnerPhonetik"), + + /** + * Enum value haasePhonetik. + */ + HAASE_PHONETIK("haasePhonetik"), + + /** + * Enum value beiderMorse. + */ + BEIDER_MORSE("beiderMorse"); + + /** + * The actual serialized value for a PhoneticEncoder instance. + */ + private final String value; + + PhoneticEncoder(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PhoneticEncoder instance. + * + * @param value the serialized value to parse. + * @return the parsed PhoneticEncoder object, or null if unable to parse. + */ + @JsonCreator + public static PhoneticEncoder fromString(String value) { + PhoneticEncoder[] items = PhoneticEncoder.values(); + for (PhoneticEncoder item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PhoneticTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PhoneticTokenFilter.java new file mode 100644 index 000000000000..723229e54c44 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/PhoneticTokenFilter.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Create tokens for phonetic matches. This token filter is implemented using + * Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.PhoneticTokenFilter") +@Fluent +public final class PhoneticTokenFilter extends TokenFilter { + /* + * The phonetic encoder to use. Default is "metaphone". Possible values + * include: 'Metaphone', 'DoubleMetaphone', 'Soundex', 'RefinedSoundex', + * 'Caverphone1', 'Caverphone2', 'Cologne', 'Nysiis', 'KoelnerPhonetik', + * 'HaasePhonetik', 'BeiderMorse' + */ + @JsonProperty(value = "encoder") + private PhoneticEncoder encoder; + + /* + * A value indicating whether encoded tokens should replace original + * tokens. If false, encoded tokens are added as synonyms. Default is true. + */ + @JsonProperty(value = "replace") + private Boolean replaceOriginalTokens; + + /** + * Get the encoder property: The phonetic encoder to use. Default is + * "metaphone". Possible values include: 'Metaphone', 'DoubleMetaphone', + * 'Soundex', 'RefinedSoundex', 'Caverphone1', 'Caverphone2', 'Cologne', + * 'Nysiis', 'KoelnerPhonetik', 'HaasePhonetik', 'BeiderMorse'. + * + * @return the encoder value. + */ + public PhoneticEncoder getEncoder() { + return this.encoder; + } + + /** + * Set the encoder property: The phonetic encoder to use. Default is + * "metaphone". Possible values include: 'Metaphone', 'DoubleMetaphone', + * 'Soundex', 'RefinedSoundex', 'Caverphone1', 'Caverphone2', 'Cologne', + * 'Nysiis', 'KoelnerPhonetik', 'HaasePhonetik', 'BeiderMorse'. + * + * @param encoder the encoder value to set. + * @return the PhoneticTokenFilter object itself. + */ + public PhoneticTokenFilter setEncoder(PhoneticEncoder encoder) { + this.encoder = encoder; + return this; + } + + /** + * Get the replaceOriginalTokens property: A value indicating whether + * encoded tokens should replace original tokens. If false, encoded tokens + * are added as synonyms. Default is true. + * + * @return the replaceOriginalTokens value. + */ + public Boolean isReplaceOriginalTokens() { + return this.replaceOriginalTokens; + } + + /** + * Set the replaceOriginalTokens property: A value indicating whether + * encoded tokens should replace original tokens. If false, encoded tokens + * are added as synonyms. Default is true. + * + * @param replaceOriginalTokens the replaceOriginalTokens value to set. + * @return the PhoneticTokenFilter object itself. + */ + public PhoneticTokenFilter setReplaceOriginalTokens(Boolean replaceOriginalTokens) { + this.replaceOriginalTokens = replaceOriginalTokens; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/QueryType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/QueryType.java new file mode 100644 index 000000000000..c01dc06bbf0b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/QueryType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for QueryType. + */ +public enum QueryType { + /** + * Enum value simple. + */ + SIMPLE("simple"), + + /** + * Enum value full. + */ + FULL("full"); + + /** + * The actual serialized value for a QueryType instance. + */ + private final String value; + + QueryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a QueryType instance. + * + * @param value the serialized value to parse. + * @return the parsed QueryType object, or null if unable to parse. + */ + @JsonCreator + public static QueryType fromString(String value) { + QueryType[] items = QueryType.values(); + for (QueryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/RegexFlags.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/RegexFlags.java new file mode 100644 index 000000000000..ee550e59f55d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/RegexFlags.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for RegexFlags. + */ +public final class RegexFlags extends ExpandableStringEnum { + /** + * Static value CANON_EQ for RegexFlags. + */ + public static final RegexFlags CANON_EQ = fromString("CANON_EQ"); + + /** + * Static value CASE_INSENSITIVE for RegexFlags. + */ + public static final RegexFlags CASE_INSENSITIVE = fromString("CASE_INSENSITIVE"); + + /** + * Static value COMMENTS for RegexFlags. + */ + public static final RegexFlags COMMENTS = fromString("COMMENTS"); + + /** + * Static value DOTALL for RegexFlags. + */ + public static final RegexFlags DOT_ALL = fromString("DOTALL"); + + /** + * Static value LITERAL for RegexFlags. + */ + public static final RegexFlags LITERAL = fromString("LITERAL"); + + /** + * Static value MULTILINE for RegexFlags. + */ + public static final RegexFlags MULTILINE = fromString("MULTILINE"); + + /** + * Static value UNICODE_CASE for RegexFlags. + */ + public static final RegexFlags UNICODE_CASE = fromString("UNICODE_CASE"); + + /** + * Static value UNIX_LINES for RegexFlags. + */ + public static final RegexFlags UNIX_LINES = fromString("UNIX_LINES"); + + /** + * Creates or finds a RegexFlags from its string representation. + * + * @param name a name to look for. + * @return the corresponding RegexFlags. + */ + @JsonCreator + public static RegexFlags fromString(String name) { + return fromString(name, RegexFlags.class); + } + + /** + * @return known RegexFlags values. + */ + public static Collection values() { + return values(RegexFlags.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/RequestOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/RequestOptions.java new file mode 100644 index 000000000000..f7299890d514 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/RequestOptions.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * Additional parameters for a set of operations. + */ +@Fluent +public final class RequestOptions { + /* + * The tracking ID sent with the request to help with debugging. + */ + @JsonProperty(value = "") + private UUID xMsClientRequestId; + + /** + * Get the xMsClientRequestId property: The tracking ID sent with the + * request to help with debugging. + * + * @return the xMsClientRequestId value. + */ + public UUID getXMsClientRequestId() { + return this.xMsClientRequestId; + } + + /** + * Set the xMsClientRequestId property: The tracking ID sent with the + * request to help with debugging. + * + * @param xMsClientRequestId the xMsClientRequestId value to set. + * @return the RequestOptions object itself. + */ + public RequestOptions setXMsClientRequestId(UUID xMsClientRequestId) { + this.xMsClientRequestId = xMsClientRequestId; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ResourceCounter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ResourceCounter.java new file mode 100644 index 000000000000..85c509b61573 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ResourceCounter.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a resource's usage and quota. + */ +@Fluent +public final class ResourceCounter { + /* + * The resource usage amount. + */ + @JsonProperty(value = "usage", required = true) + private long usage; + + /* + * The resource amount quota. + */ + @JsonProperty(value = "quota") + private Long quota; + + /** + * Get the usage property: The resource usage amount. + * + * @return the usage value. + */ + public long getUsage() { + return this.usage; + } + + /** + * Set the usage property: The resource usage amount. + * + * @param usage the usage value to set. + * @return the ResourceCounter object itself. + */ + public ResourceCounter setUsage(long usage) { + this.usage = usage; + return this; + } + + /** + * Get the quota property: The resource amount quota. + * + * @return the quota value. + */ + public Long getQuota() { + return this.quota; + } + + /** + * Set the quota property: The resource amount quota. + * + * @param quota the quota value to set. + * @return the ResourceCounter object itself. + */ + public ResourceCounter setQuota(Long quota) { + this.quota = quota; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunction.java new file mode 100644 index 000000000000..0b09b1230796 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunction.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for functions that can modify document scores during ranking. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = ScoringFunction.class) +@JsonTypeName("ScoringFunction") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "distance", value = DistanceScoringFunction.class), + @JsonSubTypes.Type(name = "freshness", value = FreshnessScoringFunction.class), + @JsonSubTypes.Type(name = "magnitude", value = MagnitudeScoringFunction.class), + @JsonSubTypes.Type(name = "tag", value = TagScoringFunction.class) +}) +@Fluent +public class ScoringFunction { + /* + * The name of the field used as input to the scoring function. + */ + @JsonProperty(value = "fieldName", required = true) + private String fieldName; + + /* + * A multiplier for the raw score. Must be a positive number not equal to + * 1.0. + */ + @JsonProperty(value = "boost", required = true) + private double boost; + + /* + * A value indicating how boosting will be interpolated across document + * scores; defaults to "Linear". Possible values include: 'Linear', + * 'Constant', 'Quadratic', 'Logarithmic' + */ + @JsonProperty(value = "interpolation") + private ScoringFunctionInterpolation interpolation; + + /** + * Get the fieldName property: The name of the field used as input to the + * scoring function. + * + * @return the fieldName value. + */ + public String getFieldName() { + return this.fieldName; + } + + /** + * Set the fieldName property: The name of the field used as input to the + * scoring function. + * + * @param fieldName the fieldName value to set. + * @return the ScoringFunction object itself. + */ + public ScoringFunction setFieldName(String fieldName) { + this.fieldName = fieldName; + return this; + } + + /** + * Get the boost property: A multiplier for the raw score. Must be a + * positive number not equal to 1.0. + * + * @return the boost value. + */ + public double getBoost() { + return this.boost; + } + + /** + * Set the boost property: A multiplier for the raw score. Must be a + * positive number not equal to 1.0. + * + * @param boost the boost value to set. + * @return the ScoringFunction object itself. + */ + public ScoringFunction setBoost(double boost) { + this.boost = boost; + return this; + } + + /** + * Get the interpolation property: A value indicating how boosting will be + * interpolated across document scores; defaults to "Linear". Possible + * values include: 'Linear', 'Constant', 'Quadratic', 'Logarithmic'. + * + * @return the interpolation value. + */ + public ScoringFunctionInterpolation getInterpolation() { + return this.interpolation; + } + + /** + * Set the interpolation property: A value indicating how boosting will be + * interpolated across document scores; defaults to "Linear". Possible + * values include: 'Linear', 'Constant', 'Quadratic', 'Logarithmic'. + * + * @param interpolation the interpolation value to set. + * @return the ScoringFunction object itself. + */ + public ScoringFunction setInterpolation(ScoringFunctionInterpolation interpolation) { + this.interpolation = interpolation; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunctionAggregation.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunctionAggregation.java new file mode 100644 index 000000000000..fc9513e61e69 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunctionAggregation.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ScoringFunctionAggregation. + */ +public enum ScoringFunctionAggregation { + /** + * Enum value sum. + */ + SUM("sum"), + + /** + * Enum value average. + */ + AVERAGE("average"), + + /** + * Enum value minimum. + */ + MINIMUM("minimum"), + + /** + * Enum value maximum. + */ + MAXIMUM("maximum"), + + /** + * Enum value firstMatching. + */ + FIRST_MATCHING("firstMatching"); + + /** + * The actual serialized value for a ScoringFunctionAggregation instance. + */ + private final String value; + + ScoringFunctionAggregation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ScoringFunctionAggregation instance. + * + * @param value the serialized value to parse. + * @return the parsed ScoringFunctionAggregation object, or null if unable to parse. + */ + @JsonCreator + public static ScoringFunctionAggregation fromString(String value) { + ScoringFunctionAggregation[] items = ScoringFunctionAggregation.values(); + for (ScoringFunctionAggregation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunctionInterpolation.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunctionInterpolation.java new file mode 100644 index 000000000000..d3531fa27fe7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringFunctionInterpolation.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ScoringFunctionInterpolation. + */ +public enum ScoringFunctionInterpolation { + /** + * Enum value linear. + */ + LINEAR("linear"), + + /** + * Enum value constant. + */ + CONSTANT("constant"), + + /** + * Enum value quadratic. + */ + QUADRATIC("quadratic"), + + /** + * Enum value logarithmic. + */ + LOGARITHMIC("logarithmic"); + + /** + * The actual serialized value for a ScoringFunctionInterpolation instance. + */ + private final String value; + + ScoringFunctionInterpolation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ScoringFunctionInterpolation instance. + * + * @param value the serialized value to parse. + * @return the parsed ScoringFunctionInterpolation object, or null if unable to parse. + */ + @JsonCreator + public static ScoringFunctionInterpolation fromString(String value) { + ScoringFunctionInterpolation[] items = ScoringFunctionInterpolation.values(); + for (ScoringFunctionInterpolation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringProfile.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringProfile.java new file mode 100644 index 000000000000..7167a046f527 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ScoringProfile.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Defines parameters for a search index that influence scoring in search + * queries. + */ +@Fluent +public final class ScoringProfile { + /* + * The name of the scoring profile. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Parameters that boost scoring based on text matches in certain index + * fields. + */ + @JsonProperty(value = "text") + private TextWeights textWeights; + + /* + * The collection of functions that influence the scoring of documents. + */ + @JsonProperty(value = "functions") + private List functions; + + /* + * A value indicating how the results of individual scoring functions + * should be combined. Defaults to "Sum". Ignored if there are no scoring + * functions. Possible values include: 'Sum', 'Average', 'Minimum', + * 'Maximum', 'FirstMatching' + */ + @JsonProperty(value = "functionAggregation") + private ScoringFunctionAggregation functionAggregation; + + /** + * Get the name property: The name of the scoring profile. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the scoring profile. + * + * @param name the name value to set. + * @return the ScoringProfile object itself. + */ + public ScoringProfile setName(String name) { + this.name = name; + return this; + } + + /** + * Get the textWeights property: Parameters that boost scoring based on + * text matches in certain index fields. + * + * @return the textWeights value. + */ + public TextWeights getTextWeights() { + return this.textWeights; + } + + /** + * Set the textWeights property: Parameters that boost scoring based on + * text matches in certain index fields. + * + * @param textWeights the textWeights value to set. + * @return the ScoringProfile object itself. + */ + public ScoringProfile setTextWeights(TextWeights textWeights) { + this.textWeights = textWeights; + return this; + } + + /** + * Get the functions property: The collection of functions that influence + * the scoring of documents. + * + * @return the functions value. + */ + public List getFunctions() { + return this.functions; + } + + /** + * Set the functions property: The collection of functions that influence + * the scoring of documents. + * + * @param functions the functions value to set. + * @return the ScoringProfile object itself. + */ + public ScoringProfile setFunctions(List functions) { + this.functions = functions; + return this; + } + + /** + * Get the functionAggregation property: A value indicating how the results + * of individual scoring functions should be combined. Defaults to "Sum". + * Ignored if there are no scoring functions. Possible values include: + * 'Sum', 'Average', 'Minimum', 'Maximum', 'FirstMatching'. + * + * @return the functionAggregation value. + */ + public ScoringFunctionAggregation getFunctionAggregation() { + return this.functionAggregation; + } + + /** + * Set the functionAggregation property: A value indicating how the results + * of individual scoring functions should be combined. Defaults to "Sum". + * Ignored if there are no scoring functions. Possible values include: + * 'Sum', 'Average', 'Minimum', 'Maximum', 'FirstMatching'. + * + * @param functionAggregation the functionAggregation value to set. + * @return the ScoringProfile object itself. + */ + public ScoringProfile setFunctionAggregation(ScoringFunctionAggregation functionAggregation) { + this.functionAggregation = functionAggregation; + return this; + } +} 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/models/SearchError.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchError.java similarity index 96% rename from sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchError.java rename to sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchError.java index d6e53ac816e4..481b932f177f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchError.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchError.java @@ -4,7 +4,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -package com.azure.search.documents.models; +package com.azure.search.documents.implementation.models; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchErrorException.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchErrorException.java similarity index 95% rename from sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchErrorException.java rename to sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchErrorException.java index e76df537059d..4e59c2d4227e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchErrorException.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchErrorException.java @@ -4,7 +4,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -package com.azure.search.documents.models; +package com.azure.search.documents.implementation.models; import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpResponse; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchField.java new file mode 100644 index 000000000000..5510d8d9c7a8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchField.java @@ -0,0 +1,760 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents a field in an index definition, which describes the name, data + * type, and search behavior of a field. + */ +@Fluent +public final class SearchField { + /* + * The name of the field, which must be unique within the fields collection + * of the index or parent field. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The data type of the field. Possible values include: 'String', 'Int32', + * 'Int64', 'Double', 'Boolean', 'DateTimeOffset', 'GeographyPoint', + * 'Complex' + */ + @JsonProperty(value = "type", required = true) + private SearchFieldDataType type; + + /* + * A value indicating whether the field uniquely identifies documents in + * the index. Exactly one top-level field in each index must be chosen as + * the key field and it must be of type Edm.String. Key fields can be used + * to look up documents directly and update or delete specific documents. + * Default is false for simple fields and null for complex fields. + */ + @JsonProperty(value = "key") + private Boolean key; + + /* + * A value indicating whether the field can be returned in a search result. + * You can disable this option if you want to use a field (for example, + * margin) as a filter, sorting, or scoring mechanism but do not want the + * field to be visible to the end user. This property must be true for key + * fields, and it must be null for complex fields. This property can be + * changed on existing fields. Enabling this property does not cause any + * increase in index storage requirements. Default is true for simple + * fields and null for complex fields. + */ + @JsonProperty(value = "retrievable") + private Boolean retrievable; + + /* + * A value indicating whether the field is full-text searchable. This means + * it will undergo analysis such as word-breaking during indexing. If you + * set a searchable field to a value like "sunny day", internally it will + * be split into the individual tokens "sunny" and "day". This enables + * full-text searches for these terms. Fields of type Edm.String or + * Collection(Edm.String) are searchable by default. This property must be + * false for simple fields of other non-string data types, and it must be + * null for complex fields. Note: searchable fields consume extra space in + * your index since Azure Cognitive Search will store an additional + * tokenized version of the field value for full-text searches. If you want + * to save space in your index and you don't need a field to be included in + * searches, set searchable to false. + */ + @JsonProperty(value = "searchable") + private Boolean searchable; + + /* + * A value indicating whether to enable the field to be referenced in + * $filter queries. filterable differs from searchable in how strings are + * handled. Fields of type Edm.String or Collection(Edm.String) that are + * filterable do not undergo word-breaking, so comparisons are for exact + * matches only. For example, if you set such a field f to "sunny day", + * $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' + * will. This property must be null for complex fields. Default is true for + * simple fields and null for complex fields. + */ + @JsonProperty(value = "filterable") + private Boolean filterable; + + /* + * A value indicating whether to enable the field to be referenced in + * $orderby expressions. By default Azure Cognitive Search sorts results by + * score, but in many experiences users will want to sort by fields in the + * documents. A simple field can be sortable only if it is single-valued + * (it has a single value in the scope of the parent document). Simple + * collection fields cannot be sortable, since they are multi-valued. + * Simple sub-fields of complex collections are also multi-valued, and + * therefore cannot be sortable. This is true whether it's an immediate + * parent field, or an ancestor field, that's the complex collection. + * Complex fields cannot be sortable and the sortable property must be null + * for such fields. The default for sortable is true for single-valued + * simple fields, false for multi-valued simple fields, and null for + * complex fields. + */ + @JsonProperty(value = "sortable") + private Boolean sortable; + + /* + * A value indicating whether to enable the field to be referenced in facet + * queries. Typically used in a presentation of search results that + * includes hit count by category (for example, search for digital cameras + * and see hits by brand, by megapixels, by price, and so on). This + * property must be null for complex fields. Fields of type + * Edm.GeographyPoint or Collection(Edm.GeographyPoint) cannot be + * facetable. Default is true for all other simple fields. + */ + @JsonProperty(value = "facetable") + private Boolean facetable; + + /* + * The name of the analyzer to use for the field. This option can be used + * only with searchable fields and it can't be set together with either + * searchAnalyzer or indexAnalyzer. Once the analyzer is chosen, it cannot + * be changed for the field. Must be null for complex fields. Possible + * values include: 'ArMicrosoft', 'ArLucene', 'HyLucene', 'BnMicrosoft', + * 'EuLucene', 'BgMicrosoft', 'BgLucene', 'CaMicrosoft', 'CaLucene', + * 'ZhHansMicrosoft', 'ZhHansLucene', 'ZhHantMicrosoft', 'ZhHantLucene', + * 'HrMicrosoft', 'CsMicrosoft', 'CsLucene', 'DaMicrosoft', 'DaLucene', + * 'NlMicrosoft', 'NlLucene', 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', + * 'FiMicrosoft', 'FiLucene', 'FrMicrosoft', 'FrLucene', 'GlLucene', + * 'DeMicrosoft', 'DeLucene', 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', + * 'HeMicrosoft', 'HiMicrosoft', 'HiLucene', 'HuMicrosoft', 'HuLucene', + * 'IsMicrosoft', 'IdMicrosoft', 'IdLucene', 'GaLucene', 'ItMicrosoft', + * 'ItLucene', 'JaMicrosoft', 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', + * 'KoLucene', 'LvMicrosoft', 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', + * 'MsMicrosoft', 'MrMicrosoft', 'NbMicrosoft', 'NoLucene', 'FaLucene', + * 'PlMicrosoft', 'PlLucene', 'PtBrMicrosoft', 'PtBrLucene', + * 'PtPtMicrosoft', 'PtPtLucene', 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', + * 'RuMicrosoft', 'RuLucene', 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', + * 'SkMicrosoft', 'SlMicrosoft', 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', + * 'SvLucene', 'TaMicrosoft', 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', + * 'TrMicrosoft', 'TrLucene', 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', + * 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', + * 'Simple', 'Stop', 'Whitespace' + */ + @JsonProperty(value = "analyzer") + private LexicalAnalyzerName analyzer; + + /* + * The name of the analyzer used at search time for the field. This option + * can be used only with searchable fields. It must be set together with + * indexAnalyzer and it cannot be set together with the analyzer option. + * This property cannot be set to the name of a language analyzer; use the + * analyzer property instead if you need a language analyzer. This analyzer + * can be updated on an existing field. Must be null for complex fields. + * Possible values include: 'ArMicrosoft', 'ArLucene', 'HyLucene', + * 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', 'CaMicrosoft', + * 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', 'ZhHantMicrosoft', + * 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', 'CsLucene', 'DaMicrosoft', + * 'DaLucene', 'NlMicrosoft', 'NlLucene', 'EnMicrosoft', 'EnLucene', + * 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', 'FrMicrosoft', 'FrLucene', + * 'GlLucene', 'DeMicrosoft', 'DeLucene', 'ElMicrosoft', 'ElLucene', + * 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', 'HiLucene', 'HuMicrosoft', + * 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', 'IdLucene', 'GaLucene', + * 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', 'JaLucene', 'KnMicrosoft', + * 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', 'LvLucene', 'LtMicrosoft', + * 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', 'NbMicrosoft', 'NoLucene', + * 'FaLucene', 'PlMicrosoft', 'PlLucene', 'PtBrMicrosoft', 'PtBrLucene', + * 'PtPtMicrosoft', 'PtPtLucene', 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', + * 'RuMicrosoft', 'RuLucene', 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', + * 'SkMicrosoft', 'SlMicrosoft', 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', + * 'SvLucene', 'TaMicrosoft', 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', + * 'TrMicrosoft', 'TrLucene', 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', + * 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', + * 'Simple', 'Stop', 'Whitespace' + */ + @JsonProperty(value = "searchAnalyzer") + private LexicalAnalyzerName searchAnalyzer; + + /* + * The name of the analyzer used at indexing time for the field. This + * option can be used only with searchable fields. It must be set together + * with searchAnalyzer and it cannot be set together with the analyzer + * option. This property cannot be set to the name of a language analyzer; + * use the analyzer property instead if you need a language analyzer. Once + * the analyzer is chosen, it cannot be changed for the field. Must be null + * for complex fields. Possible values include: 'ArMicrosoft', 'ArLucene', + * 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', + * 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', + * 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', + * 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', 'NlLucene', + * 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', + * 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', 'DeLucene', + * 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', + * 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', + * 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', + * 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', + * 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', + * 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', 'PlLucene', + * 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', 'PtPtLucene', + * 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', 'RuLucene', + * 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', 'SlMicrosoft', + * 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', 'TaMicrosoft', + * 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', 'TrLucene', + * 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', 'StandardLucene', + * 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop', + * 'Whitespace' + */ + @JsonProperty(value = "indexAnalyzer") + private LexicalAnalyzerName indexAnalyzer; + + /* + * A list of the names of synonym maps to associate with this field. This + * option can be used only with searchable fields. Currently only one + * synonym map per field is supported. Assigning a synonym map to a field + * ensures that query terms targeting that field are expanded at query-time + * using the rules in the synonym map. This attribute can be changed on + * existing fields. Must be null or an empty collection for complex fields. + */ + @JsonProperty(value = "synonymMaps") + private List synonymMaps; + + /* + * A list of sub-fields if this is a field of type Edm.ComplexType or + * Collection(Edm.ComplexType). Must be null or empty for simple fields. + */ + @JsonProperty(value = "fields") + private List fields; + + /** + * Get the name property: The name of the field, which must be unique + * within the fields collection of the index or parent field. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the field, which must be unique + * within the fields collection of the index or parent field. + * + * @param name the name value to set. + * @return the SearchField object itself. + */ + public SearchField setName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The data type of the field. Possible values + * include: 'String', 'Int32', 'Int64', 'Double', 'Boolean', + * 'DateTimeOffset', 'GeographyPoint', 'Complex'. + * + * @return the type value. + */ + public SearchFieldDataType getType() { + return this.type; + } + + /** + * Set the type property: The data type of the field. Possible values + * include: 'String', 'Int32', 'Int64', 'Double', 'Boolean', + * 'DateTimeOffset', 'GeographyPoint', 'Complex'. + * + * @param type the type value to set. + * @return the SearchField object itself. + */ + public SearchField setType(SearchFieldDataType type) { + this.type = type; + return this; + } + + /** + * Get the key property: A value indicating whether the field uniquely + * identifies documents in the index. Exactly one top-level field in each + * index must be chosen as the key field and it must be of type Edm.String. + * Key fields can be used to look up documents directly and update or + * delete specific documents. Default is false for simple fields and null + * for complex fields. + * + * @return the key value. + */ + public Boolean isKey() { + return this.key; + } + + /** + * Set the key property: A value indicating whether the field uniquely + * identifies documents in the index. Exactly one top-level field in each + * index must be chosen as the key field and it must be of type Edm.String. + * Key fields can be used to look up documents directly and update or + * delete specific documents. Default is false for simple fields and null + * for complex fields. + * + * @param key the key value to set. + * @return the SearchField object itself. + */ + public SearchField setKey(Boolean key) { + this.key = key; + return this; + } + + /** + * Get the retrievable property: A value indicating whether the field can + * be returned in a search result. You can disable this option if you want + * to use a field (for example, margin) as a filter, sorting, or scoring + * mechanism but do not want the field to be visible to the end user. This + * property must be true for key fields, and it must be null for complex + * fields. This property can be changed on existing fields. Enabling this + * property does not cause any increase in index storage requirements. + * Default is true for simple fields and null for complex fields. + * + * @return the retrievable value. + */ + public Boolean isRetrievable() { + return this.retrievable; + } + + /** + * Set the retrievable property: A value indicating whether the field can + * be returned in a search result. You can disable this option if you want + * to use a field (for example, margin) as a filter, sorting, or scoring + * mechanism but do not want the field to be visible to the end user. This + * property must be true for key fields, and it must be null for complex + * fields. This property can be changed on existing fields. Enabling this + * property does not cause any increase in index storage requirements. + * Default is true for simple fields and null for complex fields. + * + * @param retrievable the retrievable value to set. + * @return the SearchField object itself. + */ + public SearchField setRetrievable(Boolean retrievable) { + this.retrievable = retrievable; + return this; + } + + /** + * Get the searchable property: A value indicating whether the field is + * full-text searchable. This means it will undergo analysis such as + * word-breaking during indexing. If you set a searchable field to a value + * like "sunny day", internally it will be split into the individual tokens + * "sunny" and "day". This enables full-text searches for these terms. + * Fields of type Edm.String or Collection(Edm.String) are searchable by + * default. This property must be false for simple fields of other + * non-string data types, and it must be null for complex fields. Note: + * searchable fields consume extra space in your index since Azure + * Cognitive Search will store an additional tokenized version of the field + * value for full-text searches. If you want to save space in your index + * and you don't need a field to be included in searches, set searchable to + * false. + * + * @return the searchable value. + */ + public Boolean isSearchable() { + return this.searchable; + } + + /** + * Set the searchable property: A value indicating whether the field is + * full-text searchable. This means it will undergo analysis such as + * word-breaking during indexing. If you set a searchable field to a value + * like "sunny day", internally it will be split into the individual tokens + * "sunny" and "day". This enables full-text searches for these terms. + * Fields of type Edm.String or Collection(Edm.String) are searchable by + * default. This property must be false for simple fields of other + * non-string data types, and it must be null for complex fields. Note: + * searchable fields consume extra space in your index since Azure + * Cognitive Search will store an additional tokenized version of the field + * value for full-text searches. If you want to save space in your index + * and you don't need a field to be included in searches, set searchable to + * false. + * + * @param searchable the searchable value to set. + * @return the SearchField object itself. + */ + public SearchField setSearchable(Boolean searchable) { + this.searchable = searchable; + return this; + } + + /** + * Get the filterable property: A value indicating whether to enable the + * field to be referenced in $filter queries. filterable differs from + * searchable in how strings are handled. Fields of type Edm.String or + * Collection(Edm.String) that are filterable do not undergo word-breaking, + * so comparisons are for exact matches only. For example, if you set such + * a field f to "sunny day", $filter=f eq 'sunny' will find no matches, but + * $filter=f eq 'sunny day' will. This property must be null for complex + * fields. Default is true for simple fields and null for complex fields. + * + * @return the filterable value. + */ + public Boolean isFilterable() { + return this.filterable; + } + + /** + * Set the filterable property: A value indicating whether to enable the + * field to be referenced in $filter queries. filterable differs from + * searchable in how strings are handled. Fields of type Edm.String or + * Collection(Edm.String) that are filterable do not undergo word-breaking, + * so comparisons are for exact matches only. For example, if you set such + * a field f to "sunny day", $filter=f eq 'sunny' will find no matches, but + * $filter=f eq 'sunny day' will. This property must be null for complex + * fields. Default is true for simple fields and null for complex fields. + * + * @param filterable the filterable value to set. + * @return the SearchField object itself. + */ + public SearchField setFilterable(Boolean filterable) { + this.filterable = filterable; + return this; + } + + /** + * Get the sortable property: A value indicating whether to enable the + * field to be referenced in $orderby expressions. By default Azure + * Cognitive Search sorts results by score, but in many experiences users + * will want to sort by fields in the documents. A simple field can be + * sortable only if it is single-valued (it has a single value in the scope + * of the parent document). Simple collection fields cannot be sortable, + * since they are multi-valued. Simple sub-fields of complex collections + * are also multi-valued, and therefore cannot be sortable. This is true + * whether it's an immediate parent field, or an ancestor field, that's the + * complex collection. Complex fields cannot be sortable and the sortable + * property must be null for such fields. The default for sortable is true + * for single-valued simple fields, false for multi-valued simple fields, + * and null for complex fields. + * + * @return the sortable value. + */ + public Boolean isSortable() { + return this.sortable; + } + + /** + * Set the sortable property: A value indicating whether to enable the + * field to be referenced in $orderby expressions. By default Azure + * Cognitive Search sorts results by score, but in many experiences users + * will want to sort by fields in the documents. A simple field can be + * sortable only if it is single-valued (it has a single value in the scope + * of the parent document). Simple collection fields cannot be sortable, + * since they are multi-valued. Simple sub-fields of complex collections + * are also multi-valued, and therefore cannot be sortable. This is true + * whether it's an immediate parent field, or an ancestor field, that's the + * complex collection. Complex fields cannot be sortable and the sortable + * property must be null for such fields. The default for sortable is true + * for single-valued simple fields, false for multi-valued simple fields, + * and null for complex fields. + * + * @param sortable the sortable value to set. + * @return the SearchField object itself. + */ + public SearchField setSortable(Boolean sortable) { + this.sortable = sortable; + return this; + } + + /** + * Get the facetable property: A value indicating whether to enable the + * field to be referenced in facet queries. Typically used in a + * presentation of search results that includes hit count by category (for + * example, search for digital cameras and see hits by brand, by + * megapixels, by price, and so on). This property must be null for complex + * fields. Fields of type Edm.GeographyPoint or + * Collection(Edm.GeographyPoint) cannot be facetable. Default is true for + * all other simple fields. + * + * @return the facetable value. + */ + public Boolean isFacetable() { + return this.facetable; + } + + /** + * Set the facetable property: A value indicating whether to enable the + * field to be referenced in facet queries. Typically used in a + * presentation of search results that includes hit count by category (for + * example, search for digital cameras and see hits by brand, by + * megapixels, by price, and so on). This property must be null for complex + * fields. Fields of type Edm.GeographyPoint or + * Collection(Edm.GeographyPoint) cannot be facetable. Default is true for + * all other simple fields. + * + * @param facetable the facetable value to set. + * @return the SearchField object itself. + */ + public SearchField setFacetable(Boolean facetable) { + this.facetable = facetable; + return this; + } + + /** + * Get the analyzer property: The name of the analyzer to use for the + * field. This option can be used only with searchable fields and it can't + * be set together with either searchAnalyzer or indexAnalyzer. Once the + * analyzer is chosen, it cannot be changed for the field. Must be null for + * complex fields. Possible values include: 'ArMicrosoft', 'ArLucene', + * 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', + * 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', + * 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', + * 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', 'NlLucene', + * 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', + * 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', 'DeLucene', + * 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', + * 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', + * 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', + * 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', + * 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', + * 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', 'PlLucene', + * 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', 'PtPtLucene', + * 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', 'RuLucene', + * 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', 'SlMicrosoft', + * 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', 'TaMicrosoft', + * 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', 'TrLucene', + * 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', 'StandardLucene', + * 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop', + * 'Whitespace'. + * + * @return the analyzer value. + */ + public LexicalAnalyzerName getAnalyzer() { + return this.analyzer; + } + + /** + * Set the analyzer property: The name of the analyzer to use for the + * field. This option can be used only with searchable fields and it can't + * be set together with either searchAnalyzer or indexAnalyzer. Once the + * analyzer is chosen, it cannot be changed for the field. Must be null for + * complex fields. Possible values include: 'ArMicrosoft', 'ArLucene', + * 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', + * 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', + * 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', + * 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', 'NlLucene', + * 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', + * 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', 'DeLucene', + * 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', + * 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', + * 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', + * 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', + * 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', + * 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', 'PlLucene', + * 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', 'PtPtLucene', + * 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', 'RuLucene', + * 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', 'SlMicrosoft', + * 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', 'TaMicrosoft', + * 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', 'TrLucene', + * 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', 'StandardLucene', + * 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop', + * 'Whitespace'. + * + * @param analyzer the analyzer value to set. + * @return the SearchField object itself. + */ + public SearchField setAnalyzer(LexicalAnalyzerName analyzer) { + this.analyzer = analyzer; + return this; + } + + /** + * Get the searchAnalyzer property: The name of the analyzer used at search + * time for the field. This option can be used only with searchable fields. + * It must be set together with indexAnalyzer and it cannot be set together + * with the analyzer option. This property cannot be set to the name of a + * language analyzer; use the analyzer property instead if you need a + * language analyzer. This analyzer can be updated on an existing field. + * Must be null for complex fields. Possible values include: 'ArMicrosoft', + * 'ArLucene', 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', + * 'BgLucene', 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', + * 'ZhHansLucene', 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', + * 'CsMicrosoft', 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', + * 'NlLucene', 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', + * 'FiLucene', 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', + * 'DeLucene', 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', + * 'HiMicrosoft', 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', + * 'IdMicrosoft', 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', + * 'JaMicrosoft', 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', + * 'LvMicrosoft', 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', + * 'MrMicrosoft', 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', + * 'PlLucene', 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', + * 'PtPtLucene', 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', + * 'RuLucene', 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', + * 'SlMicrosoft', 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', + * 'TaMicrosoft', 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', + * 'TrLucene', 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', + * 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', + * 'Simple', 'Stop', 'Whitespace'. + * + * @return the searchAnalyzer value. + */ + public LexicalAnalyzerName getSearchAnalyzer() { + return this.searchAnalyzer; + } + + /** + * Set the searchAnalyzer property: The name of the analyzer used at search + * time for the field. This option can be used only with searchable fields. + * It must be set together with indexAnalyzer and it cannot be set together + * with the analyzer option. This property cannot be set to the name of a + * language analyzer; use the analyzer property instead if you need a + * language analyzer. This analyzer can be updated on an existing field. + * Must be null for complex fields. Possible values include: 'ArMicrosoft', + * 'ArLucene', 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', + * 'BgLucene', 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', + * 'ZhHansLucene', 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', + * 'CsMicrosoft', 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', + * 'NlLucene', 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', + * 'FiLucene', 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', + * 'DeLucene', 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', + * 'HiMicrosoft', 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', + * 'IdMicrosoft', 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', + * 'JaMicrosoft', 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', + * 'LvMicrosoft', 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', + * 'MrMicrosoft', 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', + * 'PlLucene', 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', + * 'PtPtLucene', 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', + * 'RuLucene', 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', + * 'SlMicrosoft', 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', + * 'TaMicrosoft', 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', + * 'TrLucene', 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', + * 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', + * 'Simple', 'Stop', 'Whitespace'. + * + * @param searchAnalyzer the searchAnalyzer value to set. + * @return the SearchField object itself. + */ + public SearchField setSearchAnalyzer(LexicalAnalyzerName searchAnalyzer) { + this.searchAnalyzer = searchAnalyzer; + return this; + } + + /** + * Get the indexAnalyzer property: The name of the analyzer used at + * indexing time for the field. This option can be used only with + * searchable fields. It must be set together with searchAnalyzer and it + * cannot be set together with the analyzer option. This property cannot + * be set to the name of a language analyzer; use the analyzer property + * instead if you need a language analyzer. Once the analyzer is chosen, it + * cannot be changed for the field. Must be null for complex fields. + * Possible values include: 'ArMicrosoft', 'ArLucene', 'HyLucene', + * 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', 'CaMicrosoft', + * 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', 'ZhHantMicrosoft', + * 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', 'CsLucene', 'DaMicrosoft', + * 'DaLucene', 'NlMicrosoft', 'NlLucene', 'EnMicrosoft', 'EnLucene', + * 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', 'FrMicrosoft', 'FrLucene', + * 'GlLucene', 'DeMicrosoft', 'DeLucene', 'ElMicrosoft', 'ElLucene', + * 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', 'HiLucene', 'HuMicrosoft', + * 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', 'IdLucene', 'GaLucene', + * 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', 'JaLucene', 'KnMicrosoft', + * 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', 'LvLucene', 'LtMicrosoft', + * 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', 'NbMicrosoft', 'NoLucene', + * 'FaLucene', 'PlMicrosoft', 'PlLucene', 'PtBrMicrosoft', 'PtBrLucene', + * 'PtPtMicrosoft', 'PtPtLucene', 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', + * 'RuMicrosoft', 'RuLucene', 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', + * 'SkMicrosoft', 'SlMicrosoft', 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', + * 'SvLucene', 'TaMicrosoft', 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', + * 'TrMicrosoft', 'TrLucene', 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', + * 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', + * 'Simple', 'Stop', 'Whitespace'. + * + * @return the indexAnalyzer value. + */ + public LexicalAnalyzerName getIndexAnalyzer() { + return this.indexAnalyzer; + } + + /** + * Set the indexAnalyzer property: The name of the analyzer used at + * indexing time for the field. This option can be used only with + * searchable fields. It must be set together with searchAnalyzer and it + * cannot be set together with the analyzer option. This property cannot + * be set to the name of a language analyzer; use the analyzer property + * instead if you need a language analyzer. Once the analyzer is chosen, it + * cannot be changed for the field. Must be null for complex fields. + * Possible values include: 'ArMicrosoft', 'ArLucene', 'HyLucene', + * 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', 'CaMicrosoft', + * 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', 'ZhHantMicrosoft', + * 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', 'CsLucene', 'DaMicrosoft', + * 'DaLucene', 'NlMicrosoft', 'NlLucene', 'EnMicrosoft', 'EnLucene', + * 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', 'FrMicrosoft', 'FrLucene', + * 'GlLucene', 'DeMicrosoft', 'DeLucene', 'ElMicrosoft', 'ElLucene', + * 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', 'HiLucene', 'HuMicrosoft', + * 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', 'IdLucene', 'GaLucene', + * 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', 'JaLucene', 'KnMicrosoft', + * 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', 'LvLucene', 'LtMicrosoft', + * 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', 'NbMicrosoft', 'NoLucene', + * 'FaLucene', 'PlMicrosoft', 'PlLucene', 'PtBrMicrosoft', 'PtBrLucene', + * 'PtPtMicrosoft', 'PtPtLucene', 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', + * 'RuMicrosoft', 'RuLucene', 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', + * 'SkMicrosoft', 'SlMicrosoft', 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', + * 'SvLucene', 'TaMicrosoft', 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', + * 'TrMicrosoft', 'TrLucene', 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', + * 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', + * 'Simple', 'Stop', 'Whitespace'. + * + * @param indexAnalyzer the indexAnalyzer value to set. + * @return the SearchField object itself. + */ + public SearchField setIndexAnalyzer(LexicalAnalyzerName indexAnalyzer) { + this.indexAnalyzer = indexAnalyzer; + return this; + } + + /** + * Get the synonymMaps property: A list of the names of synonym maps to + * associate with this field. This option can be used only with searchable + * fields. Currently only one synonym map per field is supported. Assigning + * a synonym map to a field ensures that query terms targeting that field + * are expanded at query-time using the rules in the synonym map. This + * attribute can be changed on existing fields. Must be null or an empty + * collection for complex fields. + * + * @return the synonymMaps value. + */ + public List getSynonymMaps() { + return this.synonymMaps; + } + + /** + * Set the synonymMaps property: A list of the names of synonym maps to + * associate with this field. This option can be used only with searchable + * fields. Currently only one synonym map per field is supported. Assigning + * a synonym map to a field ensures that query terms targeting that field + * are expanded at query-time using the rules in the synonym map. This + * attribute can be changed on existing fields. Must be null or an empty + * collection for complex fields. + * + * @param synonymMaps the synonymMaps value to set. + * @return the SearchField object itself. + */ + public SearchField setSynonymMaps(List synonymMaps) { + this.synonymMaps = synonymMaps; + return this; + } + + /** + * Get the fields property: A list of sub-fields if this is a field of type + * Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty + * for simple fields. + * + * @return the fields value. + */ + public List getFields() { + return this.fields; + } + + /** + * Set the fields property: A list of sub-fields if this is a field of type + * Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty + * for simple fields. + * + * @param fields the fields value to set. + * @return the SearchField object itself. + */ + public SearchField setFields(List fields) { + this.fields = fields; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchFieldDataType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchFieldDataType.java new file mode 100644 index 000000000000..422a8137c006 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchFieldDataType.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for SearchFieldDataType. + */ +public final class SearchFieldDataType extends ExpandableStringEnum { + /** + * Static value Edm.String for SearchFieldDataType. + */ + public static final SearchFieldDataType STRING = fromString("Edm.String"); + + /** + * Static value Edm.Int32 for SearchFieldDataType. + */ + public static final SearchFieldDataType INT32 = fromString("Edm.Int32"); + + /** + * Static value Edm.Int64 for SearchFieldDataType. + */ + public static final SearchFieldDataType INT64 = fromString("Edm.Int64"); + + /** + * Static value Edm.Double for SearchFieldDataType. + */ + public static final SearchFieldDataType DOUBLE = fromString("Edm.Double"); + + /** + * Static value Edm.Boolean for SearchFieldDataType. + */ + public static final SearchFieldDataType BOOLEAN = fromString("Edm.Boolean"); + + /** + * Static value Edm.DateTimeOffset for SearchFieldDataType. + */ + public static final SearchFieldDataType DATE_TIME_OFFSET = fromString("Edm.DateTimeOffset"); + + /** + * Static value Edm.GeographyPoint for SearchFieldDataType. + */ + public static final SearchFieldDataType GEOGRAPHY_POINT = fromString("Edm.GeographyPoint"); + + /** + * Static value Edm.ComplexType for SearchFieldDataType. + */ + public static final SearchFieldDataType COMPLEX = fromString("Edm.ComplexType"); + + /** + * Creates or finds a SearchFieldDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SearchFieldDataType. + */ + @JsonCreator + public static SearchFieldDataType fromString(String name) { + return fromString(name, SearchFieldDataType.class); + } + + /** + * @return known SearchFieldDataType values. + */ + public static Collection values() { + return values(SearchFieldDataType.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndex.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndex.java new file mode 100644 index 000000000000..686132aae47d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndex.java @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents a search index definition, which describes the fields and search + * behavior of an index. + */ +@Fluent +public final class SearchIndex { + /* + * The name of the index. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The fields of the index. + */ + @JsonProperty(value = "fields", required = true) + private List fields; + + /* + * The scoring profiles for the index. + */ + @JsonProperty(value = "scoringProfiles") + private List scoringProfiles; + + /* + * The name of the scoring profile to use if none is specified in the + * query. If this property is not set and no scoring profile is specified + * in the query, then default scoring (tf-idf) will be used. + */ + @JsonProperty(value = "defaultScoringProfile") + private String defaultScoringProfile; + + /* + * Options to control Cross-Origin Resource Sharing (CORS) for the index. + */ + @JsonProperty(value = "corsOptions") + private CorsOptions corsOptions; + + /* + * The suggesters for the index. + */ + @JsonProperty(value = "suggesters") + private List suggesters; + + /* + * The analyzers for the index. + */ + @JsonProperty(value = "analyzers") + private List analyzers; + + /* + * The tokenizers for the index. + */ + @JsonProperty(value = "tokenizers") + private List tokenizers; + + /* + * The token filters for the index. + */ + @JsonProperty(value = "tokenFilters") + private List tokenFilters; + + /* + * The character filters for the index. + */ + @JsonProperty(value = "charFilters") + private List charFilters; + + /* + * A description of an encryption key that you create in Azure Key Vault. + * This key is used to provide an additional level of encryption-at-rest + * for your data when you want full assurance that no one, not even + * Microsoft, can decrypt your data in Azure Cognitive Search. Once you + * have encrypted your data, it will always remain encrypted. Azure + * Cognitive Search will ignore attempts to set this property to null. You + * can change this property as needed if you want to rotate your encryption + * key; Your data will be unaffected. Encryption with customer-managed keys + * is not available for free search services, and is only available for + * paid services created on or after January 1, 2019. + */ + @JsonProperty(value = "encryptionKey") + private SearchResourceEncryptionKey encryptionKey; + + /* + * The type of similarity algorithm to be used when scoring and ranking the + * documents matching a search query. The similarity algorithm can only be + * defined at index creation time and cannot be modified on existing + * indexes. If null, the ClassicSimilarity algorithm is used. + */ + @JsonProperty(value = "similarity") + private Similarity similarity; + + /* + * The ETag of the index. + */ + @JsonProperty(value = "@odata.etag") + private String eTag; + + /** + * Get the name property: The name of the index. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the index. + * + * @param name the name value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setName(String name) { + this.name = name; + return this; + } + + /** + * Get the fields property: The fields of the index. + * + * @return the fields value. + */ + public List getFields() { + return this.fields; + } + + /** + * Set the fields property: The fields of the index. + * + * @param fields the fields value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setFields(List fields) { + this.fields = fields; + return this; + } + + /** + * Get the scoringProfiles property: The scoring profiles for the index. + * + * @return the scoringProfiles value. + */ + public List getScoringProfiles() { + return this.scoringProfiles; + } + + /** + * Set the scoringProfiles property: The scoring profiles for the index. + * + * @param scoringProfiles the scoringProfiles value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setScoringProfiles(List scoringProfiles) { + this.scoringProfiles = scoringProfiles; + return this; + } + + /** + * Get the defaultScoringProfile property: The name of the scoring profile + * to use if none is specified in the query. If this property is not set + * and no scoring profile is specified in the query, then default scoring + * (tf-idf) will be used. + * + * @return the defaultScoringProfile value. + */ + public String getDefaultScoringProfile() { + return this.defaultScoringProfile; + } + + /** + * Set the defaultScoringProfile property: The name of the scoring profile + * to use if none is specified in the query. If this property is not set + * and no scoring profile is specified in the query, then default scoring + * (tf-idf) will be used. + * + * @param defaultScoringProfile the defaultScoringProfile value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setDefaultScoringProfile(String defaultScoringProfile) { + this.defaultScoringProfile = defaultScoringProfile; + return this; + } + + /** + * Get the corsOptions property: Options to control Cross-Origin Resource + * Sharing (CORS) for the index. + * + * @return the corsOptions value. + */ + public CorsOptions getCorsOptions() { + return this.corsOptions; + } + + /** + * Set the corsOptions property: Options to control Cross-Origin Resource + * Sharing (CORS) for the index. + * + * @param corsOptions the corsOptions value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setCorsOptions(CorsOptions corsOptions) { + this.corsOptions = corsOptions; + return this; + } + + /** + * Get the suggesters property: The suggesters for the index. + * + * @return the suggesters value. + */ + public List getSuggesters() { + return this.suggesters; + } + + /** + * Set the suggesters property: The suggesters for the index. + * + * @param suggesters the suggesters value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setSuggesters(List suggesters) { + this.suggesters = suggesters; + return this; + } + + /** + * Get the analyzers property: The analyzers for the index. + * + * @return the analyzers value. + */ + public List getAnalyzers() { + return this.analyzers; + } + + /** + * Set the analyzers property: The analyzers for the index. + * + * @param analyzers the analyzers value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setAnalyzers(List analyzers) { + this.analyzers = analyzers; + return this; + } + + /** + * Get the tokenizers property: The tokenizers for the index. + * + * @return the tokenizers value. + */ + public List getTokenizers() { + return this.tokenizers; + } + + /** + * Set the tokenizers property: The tokenizers for the index. + * + * @param tokenizers the tokenizers value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setTokenizers(List tokenizers) { + this.tokenizers = tokenizers; + return this; + } + + /** + * Get the tokenFilters property: The token filters for the index. + * + * @return the tokenFilters value. + */ + public List getTokenFilters() { + return this.tokenFilters; + } + + /** + * Set the tokenFilters property: The token filters for the index. + * + * @param tokenFilters the tokenFilters value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setTokenFilters(List tokenFilters) { + this.tokenFilters = tokenFilters; + return this; + } + + /** + * Get the charFilters property: The character filters for the index. + * + * @return the charFilters value. + */ + public List getCharFilters() { + return this.charFilters; + } + + /** + * Set the charFilters property: The character filters for the index. + * + * @param charFilters the charFilters value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setCharFilters(List charFilters) { + this.charFilters = charFilters; + return this; + } + + /** + * Get the encryptionKey property: A description of an encryption key that + * you create in Azure Key Vault. This key is used to provide an additional + * level of encryption-at-rest for your data when you want full assurance + * that no one, not even Microsoft, can decrypt your data in Azure + * Cognitive Search. Once you have encrypted your data, it will always + * remain encrypted. Azure Cognitive Search will ignore attempts to set + * this property to null. You can change this property as needed if you + * want to rotate your encryption key; Your data will be unaffected. + * Encryption with customer-managed keys is not available for free search + * services, and is only available for paid services created on or after + * January 1, 2019. + * + * @return the encryptionKey value. + */ + public SearchResourceEncryptionKey getEncryptionKey() { + return this.encryptionKey; + } + + /** + * Set the encryptionKey property: A description of an encryption key that + * you create in Azure Key Vault. This key is used to provide an additional + * level of encryption-at-rest for your data when you want full assurance + * that no one, not even Microsoft, can decrypt your data in Azure + * Cognitive Search. Once you have encrypted your data, it will always + * remain encrypted. Azure Cognitive Search will ignore attempts to set + * this property to null. You can change this property as needed if you + * want to rotate your encryption key; Your data will be unaffected. + * Encryption with customer-managed keys is not available for free search + * services, and is only available for paid services created on or after + * January 1, 2019. + * + * @param encryptionKey the encryptionKey value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setEncryptionKey(SearchResourceEncryptionKey encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Get the similarity property: The type of similarity algorithm to be used + * when scoring and ranking the documents matching a search query. The + * similarity algorithm can only be defined at index creation time and + * cannot be modified on existing indexes. If null, the ClassicSimilarity + * algorithm is used. + * + * @return the similarity value. + */ + public Similarity getSimilarity() { + return this.similarity; + } + + /** + * Set the similarity property: The type of similarity algorithm to be used + * when scoring and ranking the documents matching a search query. The + * similarity algorithm can only be defined at index creation time and + * cannot be modified on existing indexes. If null, the ClassicSimilarity + * algorithm is used. + * + * @param similarity the similarity value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setSimilarity(Similarity similarity) { + this.similarity = similarity; + return this; + } + + /** + * Get the eTag property: The ETag of the index. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag of the index. + * + * @param eTag the eTag value to set. + * @return the SearchIndex object itself. + */ + public SearchIndex setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexer.java new file mode 100644 index 000000000000..4a793c30e8be --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexer.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents an indexer. + */ +@Fluent +public final class SearchIndexer { + /* + * The name of the indexer. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The description of the indexer. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The name of the datasource from which this indexer reads data. + */ + @JsonProperty(value = "dataSourceName", required = true) + private String dataSourceName; + + /* + * The name of the skillset executing with this indexer. + */ + @JsonProperty(value = "skillsetName") + private String skillsetName; + + /* + * The name of the index to which this indexer writes data. + */ + @JsonProperty(value = "targetIndexName", required = true) + private String targetIndexName; + + /* + * The schedule for this indexer. + */ + @JsonProperty(value = "schedule") + private IndexingSchedule schedule; + + /* + * Parameters for indexer execution. + */ + @JsonProperty(value = "parameters") + private IndexingParameters parameters; + + /* + * Defines mappings between fields in the data source and corresponding + * target fields in the index. + */ + @JsonProperty(value = "fieldMappings") + private List fieldMappings; + + /* + * Output field mappings are applied after enrichment and immediately + * before indexing. + */ + @JsonProperty(value = "outputFieldMappings") + private List outputFieldMappings; + + /* + * A value indicating whether the indexer is disabled. Default is false. + */ + @JsonProperty(value = "disabled") + private Boolean isDisabled; + + /* + * The ETag of the indexer. + */ + @JsonProperty(value = "@odata.etag") + private String eTag; + + /** + * Get the name property: The name of the indexer. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the indexer. + * + * @param name the name value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The description of the indexer. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The description of the indexer. + * + * @param description the description value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the dataSourceName property: The name of the datasource from which + * this indexer reads data. + * + * @return the dataSourceName value. + */ + public String getDataSourceName() { + return this.dataSourceName; + } + + /** + * Set the dataSourceName property: The name of the datasource from which + * this indexer reads data. + * + * @param dataSourceName the dataSourceName value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setDataSourceName(String dataSourceName) { + this.dataSourceName = dataSourceName; + return this; + } + + /** + * Get the skillsetName property: The name of the skillset executing with + * this indexer. + * + * @return the skillsetName value. + */ + public String getSkillsetName() { + return this.skillsetName; + } + + /** + * Set the skillsetName property: The name of the skillset executing with + * this indexer. + * + * @param skillsetName the skillsetName value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setSkillsetName(String skillsetName) { + this.skillsetName = skillsetName; + return this; + } + + /** + * Get the targetIndexName property: The name of the index to which this + * indexer writes data. + * + * @return the targetIndexName value. + */ + public String getTargetIndexName() { + return this.targetIndexName; + } + + /** + * Set the targetIndexName property: The name of the index to which this + * indexer writes data. + * + * @param targetIndexName the targetIndexName value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setTargetIndexName(String targetIndexName) { + this.targetIndexName = targetIndexName; + return this; + } + + /** + * Get the schedule property: The schedule for this indexer. + * + * @return the schedule value. + */ + public IndexingSchedule getSchedule() { + return this.schedule; + } + + /** + * Set the schedule property: The schedule for this indexer. + * + * @param schedule the schedule value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setSchedule(IndexingSchedule schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the parameters property: Parameters for indexer execution. + * + * @return the parameters value. + */ + public IndexingParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters for indexer execution. + * + * @param parameters the parameters value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setParameters(IndexingParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the fieldMappings property: Defines mappings between fields in the + * data source and corresponding target fields in the index. + * + * @return the fieldMappings value. + */ + public List getFieldMappings() { + return this.fieldMappings; + } + + /** + * Set the fieldMappings property: Defines mappings between fields in the + * data source and corresponding target fields in the index. + * + * @param fieldMappings the fieldMappings value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setFieldMappings(List fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + /** + * Get the outputFieldMappings property: Output field mappings are applied + * after enrichment and immediately before indexing. + * + * @return the outputFieldMappings value. + */ + public List getOutputFieldMappings() { + return this.outputFieldMappings; + } + + /** + * Set the outputFieldMappings property: Output field mappings are applied + * after enrichment and immediately before indexing. + * + * @param outputFieldMappings the outputFieldMappings value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setOutputFieldMappings(List outputFieldMappings) { + this.outputFieldMappings = outputFieldMappings; + return this; + } + + /** + * Get the isDisabled property: A value indicating whether the indexer is + * disabled. Default is false. + * + * @return the isDisabled value. + */ + public Boolean isDisabled() { + return this.isDisabled; + } + + /** + * Set the isDisabled property: A value indicating whether the indexer is + * disabled. Default is false. + * + * @param isDisabled the isDisabled value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setIsDisabled(Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + /** + * Get the eTag property: The ETag of the indexer. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag of the indexer. + * + * @param eTag the eTag value to set. + * @return the SearchIndexer object itself. + */ + public SearchIndexer setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataContainer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataContainer.java new file mode 100644 index 000000000000..8713b8ad7730 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataContainer.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents information about the entity (such as Azure SQL table or CosmosDB + * collection) that will be indexed. + */ +@Fluent +public final class SearchIndexerDataContainer { + /* + * The name of the table or view (for Azure SQL data source) or collection + * (for CosmosDB data source) that will be indexed. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * A query that is applied to this data container. The syntax and meaning + * of this parameter is datasource-specific. Not supported by Azure SQL + * datasources. + */ + @JsonProperty(value = "query") + private String query; + + /** + * Get the name property: The name of the table or view (for Azure SQL data + * source) or collection (for CosmosDB data source) that will be indexed. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the table or view (for Azure SQL data + * source) or collection (for CosmosDB data source) that will be indexed. + * + * @param name the name value to set. + * @return the SearchIndexerDataContainer object itself. + */ + public SearchIndexerDataContainer setName(String name) { + this.name = name; + return this; + } + + /** + * Get the query property: A query that is applied to this data container. + * The syntax and meaning of this parameter is datasource-specific. Not + * supported by Azure SQL datasources. + * + * @return the query value. + */ + public String getQuery() { + return this.query; + } + + /** + * Set the query property: A query that is applied to this data container. + * The syntax and meaning of this parameter is datasource-specific. Not + * supported by Azure SQL datasources. + * + * @param query the query value to set. + * @return the SearchIndexerDataContainer object itself. + */ + public SearchIndexerDataContainer setQuery(String query) { + this.query = query; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataSource.java new file mode 100644 index 000000000000..dccf3d64df3b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataSource.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a datasource definition, which can be used to configure an + * indexer. + */ +@Fluent +public final class SearchIndexerDataSource { + /* + * The name of the datasource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The description of the datasource. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The type of the datasource. Possible values include: 'AzureSql', + * 'CosmosDb', 'AzureBlob', 'AzureTable', 'MySql' + */ + @JsonProperty(value = "type", required = true) + private SearchIndexerDataSourceType type; + + /* + * Credentials for the datasource. + */ + @JsonProperty(value = "credentials", required = true) + private DataSourceCredentials credentials; + + /* + * The data container for the datasource. + */ + @JsonProperty(value = "container", required = true) + private SearchIndexerDataContainer container; + + /* + * The data change detection policy for the datasource. + */ + @JsonProperty(value = "dataChangeDetectionPolicy") + private DataChangeDetectionPolicy dataChangeDetectionPolicy; + + /* + * The data deletion detection policy for the datasource. + */ + @JsonProperty(value = "dataDeletionDetectionPolicy") + private DataDeletionDetectionPolicy dataDeletionDetectionPolicy; + + /* + * The ETag of the data source. + */ + @JsonProperty(value = "@odata.etag") + private String eTag; + + /** + * Get the name property: The name of the datasource. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the datasource. + * + * @param name the name value to set. + * @return the SearchIndexerDataSource object itself. + */ + public SearchIndexerDataSource setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The description of the datasource. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The description of the datasource. + * + * @param description the description value to set. + * @return the SearchIndexerDataSource object itself. + */ + public SearchIndexerDataSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the type property: The type of the datasource. Possible values + * include: 'AzureSql', 'CosmosDb', 'AzureBlob', 'AzureTable', 'MySql'. + * + * @return the type value. + */ + public SearchIndexerDataSourceType getType() { + return this.type; + } + + /** + * Set the type property: The type of the datasource. Possible values + * include: 'AzureSql', 'CosmosDb', 'AzureBlob', 'AzureTable', 'MySql'. + * + * @param type the type value to set. + * @return the SearchIndexerDataSource object itself. + */ + public SearchIndexerDataSource setType(SearchIndexerDataSourceType type) { + this.type = type; + return this; + } + + /** + * Get the credentials property: Credentials for the datasource. + * + * @return the credentials value. + */ + public DataSourceCredentials getCredentials() { + return this.credentials; + } + + /** + * Set the credentials property: Credentials for the datasource. + * + * @param credentials the credentials value to set. + * @return the SearchIndexerDataSource object itself. + */ + public SearchIndexerDataSource setCredentials(DataSourceCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the container property: The data container for the datasource. + * + * @return the container value. + */ + public SearchIndexerDataContainer getContainer() { + return this.container; + } + + /** + * Set the container property: The data container for the datasource. + * + * @param container the container value to set. + * @return the SearchIndexerDataSource object itself. + */ + public SearchIndexerDataSource setContainer(SearchIndexerDataContainer container) { + this.container = container; + return this; + } + + /** + * Get the dataChangeDetectionPolicy property: The data change detection + * policy for the datasource. + * + * @return the dataChangeDetectionPolicy value. + */ + public DataChangeDetectionPolicy getDataChangeDetectionPolicy() { + return this.dataChangeDetectionPolicy; + } + + /** + * Set the dataChangeDetectionPolicy property: The data change detection + * policy for the datasource. + * + * @param dataChangeDetectionPolicy the dataChangeDetectionPolicy value to + * set. + * @return the SearchIndexerDataSource object itself. + */ + public SearchIndexerDataSource setDataChangeDetectionPolicy(DataChangeDetectionPolicy dataChangeDetectionPolicy) { + this.dataChangeDetectionPolicy = dataChangeDetectionPolicy; + return this; + } + + /** + * Get the dataDeletionDetectionPolicy property: The data deletion + * detection policy for the datasource. + * + * @return the dataDeletionDetectionPolicy value. + */ + public DataDeletionDetectionPolicy getDataDeletionDetectionPolicy() { + return this.dataDeletionDetectionPolicy; + } + + /** + * Set the dataDeletionDetectionPolicy property: The data deletion + * detection policy for the datasource. + * + * @param dataDeletionDetectionPolicy the dataDeletionDetectionPolicy value + * to set. + * @return the SearchIndexerDataSource object itself. + */ + public SearchIndexerDataSource setDataDeletionDetectionPolicy(DataDeletionDetectionPolicy dataDeletionDetectionPolicy) { + this.dataDeletionDetectionPolicy = dataDeletionDetectionPolicy; + return this; + } + + /** + * Get the eTag property: The ETag of the data source. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag of the data source. + * + * @param eTag the eTag value to set. + * @return the SearchIndexerDataSource object itself. + */ + public SearchIndexerDataSource setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataSourceType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataSourceType.java new file mode 100644 index 000000000000..35952703c1cf --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerDataSourceType.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for SearchIndexerDataSourceType. + */ +public final class SearchIndexerDataSourceType extends ExpandableStringEnum { + /** + * Static value azuresql for SearchIndexerDataSourceType. + */ + public static final SearchIndexerDataSourceType AZURE_SQL = fromString("azuresql"); + + /** + * Static value cosmosdb for SearchIndexerDataSourceType. + */ + public static final SearchIndexerDataSourceType COSMOS_DB = fromString("cosmosdb"); + + /** + * Static value azureblob for SearchIndexerDataSourceType. + */ + public static final SearchIndexerDataSourceType AZURE_BLOB = fromString("azureblob"); + + /** + * Static value azuretable for SearchIndexerDataSourceType. + */ + public static final SearchIndexerDataSourceType AZURE_TABLE = fromString("azuretable"); + + /** + * Static value mysql for SearchIndexerDataSourceType. + */ + public static final SearchIndexerDataSourceType MY_SQL = fromString("mysql"); + + /** + * Creates or finds a SearchIndexerDataSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SearchIndexerDataSourceType. + */ + @JsonCreator + public static SearchIndexerDataSourceType fromString(String name) { + return fromString(name, SearchIndexerDataSourceType.class); + } + + /** + * @return known SearchIndexerDataSourceType values. + */ + public static Collection values() { + return values(SearchIndexerDataSourceType.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerError.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerError.java new file mode 100644 index 000000000000..dca8fb4bcaa8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerError.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents an item- or document-level indexing error. + */ +@Fluent +public final class SearchIndexerError { + /* + * The key of the item for which indexing failed. + */ + @JsonProperty(value = "key", access = JsonProperty.Access.WRITE_ONLY) + private String key; + + /* + * The message describing the error that occurred while processing the + * item. + */ + @JsonProperty(value = "errorMessage", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The status code indicating why the indexing operation failed. Possible + * values include: 400 for a malformed input document, 404 for document not + * found, 409 for a version conflict, 422 when the index is temporarily + * unavailable, or 503 for when the service is too busy. + */ + @JsonProperty(value = "statusCode", required = true, access = JsonProperty.Access.WRITE_ONLY) + private int statusCode; + + /* + * The name of the source at which the error originated. For example, this + * could refer to a particular skill in the attached skillset. This may not + * be always available. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Additional, verbose details about the error to assist in debugging the + * indexer. This may not be always available. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /* + * A link to a troubleshooting guide for these classes of errors. This may + * not be always available. + */ + @JsonProperty(value = "documentationLink", access = JsonProperty.Access.WRITE_ONLY) + private String documentationLink; + + /** + * Get the key property: The key of the item for which indexing failed. + * + * @return the key value. + */ + public String getKey() { + return this.key; + } + + /** + * Get the errorMessage property: The message describing the error that + * occurred while processing the item. + * + * @return the errorMessage value. + */ + public String getErrorMessage() { + return this.errorMessage; + } + + /** + * Get the statusCode property: The status code indicating why the indexing + * operation failed. Possible values include: 400 for a malformed input + * document, 404 for document not found, 409 for a version conflict, 422 + * when the index is temporarily unavailable, or 503 for when the service + * is too busy. + * + * @return the statusCode value. + */ + public int getStatusCode() { + return this.statusCode; + } + + /** + * Get the name property: The name of the source at which the error + * originated. For example, this could refer to a particular skill in the + * attached skillset. This may not be always available. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Get the details property: Additional, verbose details about the error to + * assist in debugging the indexer. This may not be always available. + * + * @return the details value. + */ + public String getDetails() { + return this.details; + } + + /** + * Get the documentationLink property: A link to a troubleshooting guide + * for these classes of errors. This may not be always available. + * + * @return the documentationLink value. + */ + public String getDocumentationLink() { + return this.documentationLink; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerLimits.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerLimits.java new file mode 100644 index 000000000000..1d823ee637a0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerLimits.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** + * The SearchIndexerLimits model. + */ +@Fluent +public final class SearchIndexerLimits { + /* + * The maximum duration that the indexer is permitted to run for one + * execution. + */ + @JsonProperty(value = "maxRunTime", access = JsonProperty.Access.WRITE_ONLY) + private Duration maxRunTime; + + /* + * The maximum size of a document, in bytes, which will be considered valid + * for indexing. + */ + @JsonProperty(value = "maxDocumentExtractionSize", access = JsonProperty.Access.WRITE_ONLY) + private Double maxDocumentExtractionSize; + + /* + * The maximum number of characters that will be extracted from a document + * picked up for indexing. + */ + @JsonProperty(value = "maxDocumentContentCharactersToExtract", access = JsonProperty.Access.WRITE_ONLY) + private Double maxDocumentContentCharactersToExtract; + + /** + * Get the maxRunTime property: The maximum duration that the indexer is + * permitted to run for one execution. + * + * @return the maxRunTime value. + */ + public Duration getMaxRunTime() { + return this.maxRunTime; + } + + /** + * Get the maxDocumentExtractionSize property: The maximum size of a + * document, in bytes, which will be considered valid for indexing. + * + * @return the maxDocumentExtractionSize value. + */ + public Double getMaxDocumentExtractionSize() { + return this.maxDocumentExtractionSize; + } + + /** + * Get the maxDocumentContentCharactersToExtract property: The maximum + * number of characters that will be extracted from a document picked up + * for indexing. + * + * @return the maxDocumentContentCharactersToExtract value. + */ + public Double getMaxDocumentContentCharactersToExtract() { + return this.maxDocumentContentCharactersToExtract; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerSkill.java new file mode 100644 index 000000000000..f441a433674a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerSkill.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Base type for skills. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = SearchIndexerSkill.class) +@JsonTypeName("SearchIndexerSkill") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Skills.Util.ConditionalSkill", value = ConditionalSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", value = KeyPhraseExtractionSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Vision.OcrSkill", value = OcrSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Vision.ImageAnalysisSkill", value = ImageAnalysisSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.LanguageDetectionSkill", value = LanguageDetectionSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Util.ShaperSkill", value = ShaperSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.MergeSkill", value = MergeSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.EntityRecognitionSkill", value = EntityRecognitionSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.SentimentSkill", value = SentimentSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.SplitSkill", value = SplitSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.TranslationSkill", value = TextTranslationSkill.class), + @JsonSubTypes.Type(name = "#Microsoft.Skills.Custom.WebApiSkill", value = WebApiSkill.class) +}) +@Fluent +public class SearchIndexerSkill { + /* + * The name of the skill which uniquely identifies it within the skillset. + * A skill with no name defined will be given a default name of its 1-based + * index in the skills array, prefixed with the character '#'. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The description of the skill which describes the inputs, outputs, and + * usage of the skill. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Represents the level at which operations take place, such as the + * document root or document content (for example, /document or + * /document/content). The default is /document. + */ + @JsonProperty(value = "context") + private String context; + + /* + * Inputs of the skills could be a column in the source data set, or the + * output of an upstream skill. + */ + @JsonProperty(value = "inputs", required = true) + private List inputs; + + /* + * The output of a skill is either a field in a search index, or a value + * that can be consumed as an input by another skill. + */ + @JsonProperty(value = "outputs", required = true) + private List outputs; + + /** + * Get the name property: The name of the skill which uniquely identifies + * it within the skillset. A skill with no name defined will be given a + * default name of its 1-based index in the skills array, prefixed with the + * character '#'. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the skill which uniquely identifies + * it within the skillset. A skill with no name defined will be given a + * default name of its 1-based index in the skills array, prefixed with the + * character '#'. + * + * @param name the name value to set. + * @return the SearchIndexerSkill object itself. + */ + public SearchIndexerSkill setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The description of the skill which + * describes the inputs, outputs, and usage of the skill. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The description of the skill which + * describes the inputs, outputs, and usage of the skill. + * + * @param description the description value to set. + * @return the SearchIndexerSkill object itself. + */ + public SearchIndexerSkill setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the context property: Represents the level at which operations take + * place, such as the document root or document content (for example, + * /document or /document/content). The default is /document. + * + * @return the context value. + */ + public String getContext() { + return this.context; + } + + /** + * Set the context property: Represents the level at which operations take + * place, such as the document root or document content (for example, + * /document or /document/content). The default is /document. + * + * @param context the context value to set. + * @return the SearchIndexerSkill object itself. + */ + public SearchIndexerSkill setContext(String context) { + this.context = context; + return this; + } + + /** + * Get the inputs property: Inputs of the skills could be a column in the + * source data set, or the output of an upstream skill. + * + * @return the inputs value. + */ + public List getInputs() { + return this.inputs; + } + + /** + * Set the inputs property: Inputs of the skills could be a column in the + * source data set, or the output of an upstream skill. + * + * @param inputs the inputs value to set. + * @return the SearchIndexerSkill object itself. + */ + public SearchIndexerSkill setInputs(List inputs) { + this.inputs = inputs; + return this; + } + + /** + * Get the outputs property: The output of a skill is either a field in a + * search index, or a value that can be consumed as an input by another + * skill. + * + * @return the outputs value. + */ + public List getOutputs() { + return this.outputs; + } + + /** + * Set the outputs property: The output of a skill is either a field in a + * search index, or a value that can be consumed as an input by another + * skill. + * + * @param outputs the outputs value to set. + * @return the SearchIndexerSkill object itself. + */ + public SearchIndexerSkill setOutputs(List outputs) { + this.outputs = outputs; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerSkillset.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerSkillset.java new file mode 100644 index 000000000000..5544dc6ec10f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerSkillset.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of skills. + */ +@Fluent +public final class SearchIndexerSkillset { + /* + * The name of the skillset. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The description of the skillset. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * A list of skills in the skillset. + */ + @JsonProperty(value = "skills", required = true) + private List skills; + + /* + * Details about cognitive services to be used when running skills. + */ + @JsonProperty(value = "cognitiveServices") + private CognitiveServicesAccount cognitiveServicesAccount; + + /* + * The ETag of the skillset. + */ + @JsonProperty(value = "@odata.etag") + private String eTag; + + /** + * Get the name property: The name of the skillset. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the skillset. + * + * @param name the name value to set. + * @return the SearchIndexerSkillset object itself. + */ + public SearchIndexerSkillset setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The description of the skillset. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The description of the skillset. + * + * @param description the description value to set. + * @return the SearchIndexerSkillset object itself. + */ + public SearchIndexerSkillset setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the skills property: A list of skills in the skillset. + * + * @return the skills value. + */ + public List getSkills() { + return this.skills; + } + + /** + * Set the skills property: A list of skills in the skillset. + * + * @param skills the skills value to set. + * @return the SearchIndexerSkillset object itself. + */ + public SearchIndexerSkillset setSkills(List skills) { + this.skills = skills; + return this; + } + + /** + * Get the cognitiveServicesAccount property: Details about cognitive + * services to be used when running skills. + * + * @return the cognitiveServicesAccount value. + */ + public CognitiveServicesAccount getCognitiveServicesAccount() { + return this.cognitiveServicesAccount; + } + + /** + * Set the cognitiveServicesAccount property: Details about cognitive + * services to be used when running skills. + * + * @param cognitiveServicesAccount the cognitiveServicesAccount value to + * set. + * @return the SearchIndexerSkillset object itself. + */ + public SearchIndexerSkillset setCognitiveServicesAccount(CognitiveServicesAccount cognitiveServicesAccount) { + this.cognitiveServicesAccount = cognitiveServicesAccount; + return this; + } + + /** + * Get the eTag property: The ETag of the skillset. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag of the skillset. + * + * @param eTag the eTag value to set. + * @return the SearchIndexerSkillset object itself. + */ + public SearchIndexerSkillset setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerStatus.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerStatus.java new file mode 100644 index 000000000000..6feb583a2f15 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerStatus.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents the current status and execution history of an indexer. + */ +@Fluent +public final class SearchIndexerStatus { + /* + * Overall indexer status. Possible values include: 'Unknown', 'Error', + * 'Running' + */ + @JsonProperty(value = "status", required = true, access = JsonProperty.Access.WRITE_ONLY) + private IndexerStatus status; + + /* + * The result of the most recent or an in-progress indexer execution. + */ + @JsonProperty(value = "lastResult", access = JsonProperty.Access.WRITE_ONLY) + private IndexerExecutionResult lastResult; + + /* + * History of the recent indexer executions, sorted in reverse + * chronological order. + */ + @JsonProperty(value = "executionHistory", required = true, access = JsonProperty.Access.WRITE_ONLY) + private List executionHistory; + + /* + * The execution limits for the indexer. + */ + @JsonProperty(value = "limits", required = true, access = JsonProperty.Access.WRITE_ONLY) + private SearchIndexerLimits limits; + + /** + * Get the status property: Overall indexer status. Possible values + * include: 'Unknown', 'Error', 'Running'. + * + * @return the status value. + */ + public IndexerStatus getStatus() { + return this.status; + } + + /** + * Get the lastResult property: The result of the most recent or an + * in-progress indexer execution. + * + * @return the lastResult value. + */ + public IndexerExecutionResult getLastResult() { + return this.lastResult; + } + + /** + * Get the executionHistory property: History of the recent indexer + * executions, sorted in reverse chronological order. + * + * @return the executionHistory value. + */ + public List getExecutionHistory() { + return this.executionHistory; + } + + /** + * Get the limits property: The execution limits for the indexer. + * + * @return the limits value. + */ + public SearchIndexerLimits getLimits() { + return this.limits; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerWarning.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerWarning.java new file mode 100644 index 000000000000..7aee4ea82456 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchIndexerWarning.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents an item-level warning. + */ +@Fluent +public final class SearchIndexerWarning { + /* + * The key of the item which generated a warning. + */ + @JsonProperty(value = "key", access = JsonProperty.Access.WRITE_ONLY) + private String key; + + /* + * The message describing the warning that occurred while processing the + * item. + */ + @JsonProperty(value = "message", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The name of the source at which the warning originated. For example, + * this could refer to a particular skill in the attached skillset. This + * may not be always available. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Additional, verbose details about the warning to assist in debugging the + * indexer. This may not be always available. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /* + * A link to a troubleshooting guide for these classes of warnings. This + * may not be always available. + */ + @JsonProperty(value = "documentationLink", access = JsonProperty.Access.WRITE_ONLY) + private String documentationLink; + + /** + * Get the key property: The key of the item which generated a warning. + * + * @return the key value. + */ + public String getKey() { + return this.key; + } + + /** + * Get the message property: The message describing the warning that + * occurred while processing the item. + * + * @return the message value. + */ + public String getMessage() { + return this.message; + } + + /** + * Get the name property: The name of the source at which the warning + * originated. For example, this could refer to a particular skill in the + * attached skillset. This may not be always available. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Get the details property: Additional, verbose details about the warning + * to assist in debugging the indexer. This may not be always available. + * + * @return the details value. + */ + public String getDetails() { + return this.details; + } + + /** + * Get the documentationLink property: A link to a troubleshooting guide + * for these classes of warnings. This may not be always available. + * + * @return the documentationLink value. + */ + public String getDocumentationLink() { + return this.documentationLink; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchMode.java new file mode 100644 index 000000000000..9dc3c7573b2c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchMode.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SearchMode. + */ +public enum SearchMode { + /** + * Enum value any. + */ + ANY("any"), + + /** + * Enum value all. + */ + ALL("all"); + + /** + * The actual serialized value for a SearchMode instance. + */ + private final String value; + + SearchMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SearchMode instance. + * + * @param value the serialized value to parse. + * @return the parsed SearchMode object, or null if unable to parse. + */ + @JsonCreator + public static SearchMode fromString(String value) { + SearchMode[] items = SearchMode.values(); + for (SearchMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchOptions.java new file mode 100644 index 000000000000..75b5c4f84f74 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchOptions.java @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Arrays; +import java.util.List; + +/** + * Additional parameters for searchGet operation. + */ +@Fluent +public final class SearchOptions { + /* + * A value that specifies whether to fetch the total count of results. + * Default is false. Setting this value to true may have a performance + * impact. Note that the count returned is an approximation. + */ + @JsonProperty(value = "") + private Boolean includeTotalResultCount; + + /* + * The list of facet expressions to apply to the search query. Each facet + * expression contains a field name, optionally followed by a + * comma-separated list of name:value pairs. + */ + @JsonProperty(value = "") + private List facets; + + /* + * The OData $filter expression to apply to the search query. + */ + @JsonProperty(value = "") + private String filter; + + /* + * The list of field names to use for hit highlights. Only searchable + * fields can be used for hit highlighting. + */ + @JsonProperty(value = "") + private List highlightFields; + + /* + * A string tag that is appended to hit highlights. Must be set with + * highlightPreTag. Default is </em>. + */ + @JsonProperty(value = "") + private String highlightPostTag; + + /* + * A string tag that is prepended to hit highlights. Must be set with + * highlightPostTag. Default is <em>. + */ + @JsonProperty(value = "") + private String highlightPreTag; + + /* + * A number between 0 and 100 indicating the percentage of the index that + * must be covered by a search query in order for the query to be reported + * as a success. This parameter can be useful for ensuring search + * availability even for services with only one replica. The default is + * 100. + */ + @JsonProperty(value = "") + private Double minimumCoverage; + + /* + * The list of OData $orderby expressions by which to sort the results. + * Each expression can be either a field name or a call to either the + * geo.distance() or the search.score() functions. Each expression can be + * followed by asc to indicate ascending, and desc to indicate descending. + * The default is ascending order. Ties will be broken by the match scores + * of documents. If no OrderBy is specified, the default sort order is + * descending by document match score. There can be at most 32 $orderby + * clauses. + */ + @JsonProperty(value = "") + private List orderBy; + + /* + * A value that specifies the syntax of the search query. The default is + * 'simple'. Use 'full' if your query uses the Lucene query syntax. + * Possible values include: 'Simple', 'Full' + */ + @JsonProperty(value = "") + private QueryType queryType; + + /* + * The list of parameter values to be used in scoring functions (for + * example, referencePointParameter) using the format name-values. For + * example, if the scoring profile defines a function with a parameter + * called 'mylocation' the parameter string would be + * "mylocation--122.2,44.8" (without the quotes). + */ + @JsonProperty(value = "") + private List scoringParameters; + + /* + * The name of a scoring profile to evaluate match scores for matching + * documents in order to sort the results. + */ + @JsonProperty(value = "") + private String scoringProfile; + + /* + * The list of field names to which to scope the full-text search. When + * using fielded search (fieldName:searchExpression) in a full Lucene + * query, the field names of each fielded search expression take precedence + * over any field names listed in this parameter. + */ + @JsonProperty(value = "") + private List searchFields; + + /* + * A value that specifies whether any or all of the search terms must be + * matched in order to count the document as a match. Possible values + * include: 'Any', 'All' + */ + @JsonProperty(value = "") + private SearchMode searchMode; + + /* + * The list of fields to retrieve. If unspecified, all fields marked as + * retrievable in the schema are included. + */ + @JsonProperty(value = "") + private List select; + + /* + * The number of search results to skip. This value cannot be greater than + * 100,000. If you need to scan documents in sequence, but cannot use $skip + * due to this limitation, consider using $orderby on a totally-ordered key + * and $filter with a range query instead. + */ + @JsonProperty(value = "") + private Integer skip; + + /* + * The number of search results to retrieve. This can be used in + * conjunction with $skip to implement client-side paging of search + * results. If results are truncated due to server-side paging, the + * response will include a continuation token that can be used to issue + * another Search request for the next page of results. + */ + @JsonProperty(value = "") + private Integer top; + + /** + * Get the includeTotalResultCount property: A value that specifies whether + * to fetch the total count of results. Default is false. Setting this + * value to true may have a performance impact. Note that the count + * returned is an approximation. + * + * @return the includeTotalResultCount value. + */ + public Boolean isIncludeTotalResultCount() { + return this.includeTotalResultCount; + } + + /** + * Set the includeTotalResultCount property: A value that specifies whether + * to fetch the total count of results. Default is false. Setting this + * value to true may have a performance impact. Note that the count + * returned is an approximation. + * + * @param includeTotalResultCount the includeTotalResultCount value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setIncludeTotalResultCount(Boolean includeTotalResultCount) { + this.includeTotalResultCount = includeTotalResultCount; + return this; + } + + /** + * Get the facets property: The list of facet expressions to apply to the + * search query. Each facet expression contains a field name, optionally + * followed by a comma-separated list of name:value pairs. + * + * @return the facets value. + */ + public List getFacets() { + return this.facets; + } + + /** + * Set the facets property: The list of facet expressions to apply to the + * search query. Each facet expression contains a field name, optionally + * followed by a comma-separated list of name:value pairs. + * + * @param facets the facets value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setFacets(String... facets) { + this.facets = Arrays.asList(facets); + return this; + } + + /** + * Get the filter property: The OData $filter expression to apply to the + * search query. + * + * @return the filter value. + */ + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: The OData $filter expression to apply to the + * search query. + * + * @param filter the filter value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the highlightFields property: The list of field names to use for hit + * highlights. Only searchable fields can be used for hit highlighting. + * + * @return the highlightFields value. + */ + public List getHighlightFields() { + return this.highlightFields; + } + + /** + * Set the highlightFields property: The list of field names to use for hit + * highlights. Only searchable fields can be used for hit highlighting. + * + * @param highlightFields the highlightFields value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setHighlightFields(String... highlightFields) { + this.highlightFields = Arrays.asList(highlightFields); + return this; + } + + /** + * Get the highlightPostTag property: A string tag that is appended to hit + * highlights. Must be set with highlightPreTag. Default is + * &lt;/em&gt;. + * + * @return the highlightPostTag value. + */ + public String getHighlightPostTag() { + return this.highlightPostTag; + } + + /** + * Set the highlightPostTag property: A string tag that is appended to hit + * highlights. Must be set with highlightPreTag. Default is + * &lt;/em&gt;. + * + * @param highlightPostTag the highlightPostTag value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setHighlightPostTag(String highlightPostTag) { + this.highlightPostTag = highlightPostTag; + return this; + } + + /** + * Get the highlightPreTag property: A string tag that is prepended to hit + * highlights. Must be set with highlightPostTag. Default is + * &lt;em&gt;. + * + * @return the highlightPreTag value. + */ + public String getHighlightPreTag() { + return this.highlightPreTag; + } + + /** + * Set the highlightPreTag property: A string tag that is prepended to hit + * highlights. Must be set with highlightPostTag. Default is + * &lt;em&gt;. + * + * @param highlightPreTag the highlightPreTag value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setHighlightPreTag(String highlightPreTag) { + this.highlightPreTag = highlightPreTag; + return this; + } + + /** + * Get the minimumCoverage property: A number between 0 and 100 indicating + * the percentage of the index that must be covered by a search query in + * order for the query to be reported as a success. This parameter can be + * useful for ensuring search availability even for services with only one + * replica. The default is 100. + * + * @return the minimumCoverage value. + */ + public Double getMinimumCoverage() { + return this.minimumCoverage; + } + + /** + * Set the minimumCoverage property: A number between 0 and 100 indicating + * the percentage of the index that must be covered by a search query in + * order for the query to be reported as a success. This parameter can be + * useful for ensuring search availability even for services with only one + * replica. The default is 100. + * + * @param minimumCoverage the minimumCoverage value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setMinimumCoverage(Double minimumCoverage) { + this.minimumCoverage = minimumCoverage; + return this; + } + + /** + * Get the orderBy property: The list of OData $orderby expressions by + * which to sort the results. Each expression can be either a field name or + * a call to either the geo.distance() or the search.score() functions. + * Each expression can be followed by asc to indicate ascending, and desc + * to indicate descending. The default is ascending order. Ties will be + * broken by the match scores of documents. If no OrderBy is specified, the + * default sort order is descending by document match score. There can be + * at most 32 $orderby clauses. + * + * @return the orderBy value. + */ + public List getOrderBy() { + return this.orderBy; + } + + /** + * Set the orderBy property: The list of OData $orderby expressions by + * which to sort the results. Each expression can be either a field name or + * a call to either the geo.distance() or the search.score() functions. + * Each expression can be followed by asc to indicate ascending, and desc + * to indicate descending. The default is ascending order. Ties will be + * broken by the match scores of documents. If no OrderBy is specified, the + * default sort order is descending by document match score. There can be + * at most 32 $orderby clauses. + * + * @param orderBy the orderBy value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setOrderBy(String... orderBy) { + this.orderBy = Arrays.asList(orderBy); + return this; + } + + /** + * Get the queryType property: A value that specifies the syntax of the + * search query. The default is 'simple'. Use 'full' if your query uses the + * Lucene query syntax. Possible values include: 'Simple', 'Full'. + * + * @return the queryType value. + */ + public QueryType getQueryType() { + return this.queryType; + } + + /** + * Set the queryType property: A value that specifies the syntax of the + * search query. The default is 'simple'. Use 'full' if your query uses the + * Lucene query syntax. Possible values include: 'Simple', 'Full'. + * + * @param queryType the queryType value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setQueryType(QueryType queryType) { + this.queryType = queryType; + return this; + } + + /** + * Get the scoringParameters property: The list of parameter values to be + * used in scoring functions (for example, referencePointParameter) using + * the format name-values. For example, if the scoring profile defines a + * function with a parameter called 'mylocation' the parameter string would + * be "mylocation--122.2,44.8" (without the quotes). + * + * @return the scoringParameters value. + */ + public List getScoringParameters() { + return this.scoringParameters; + } + + /** + * Set the scoringParameters property: The list of parameter values to be + * used in scoring functions (for example, referencePointParameter) using + * the format name-values. For example, if the scoring profile defines a + * function with a parameter called 'mylocation' the parameter string would + * be "mylocation--122.2,44.8" (without the quotes). + * + * @param scoringParameters the scoringParameters value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setScoringParameters(String... scoringParameters) { + this.scoringParameters = Arrays.asList(scoringParameters); + return this; + } + + /** + * Get the scoringProfile property: The name of a scoring profile to + * evaluate match scores for matching documents in order to sort the + * results. + * + * @return the scoringProfile value. + */ + public String getScoringProfile() { + return this.scoringProfile; + } + + /** + * Set the scoringProfile property: The name of a scoring profile to + * evaluate match scores for matching documents in order to sort the + * results. + * + * @param scoringProfile the scoringProfile value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setScoringProfile(String scoringProfile) { + this.scoringProfile = scoringProfile; + return this; + } + + /** + * Get the searchFields property: The list of field names to which to scope + * the full-text search. When using fielded search + * (fieldName:searchExpression) in a full Lucene query, the field names of + * each fielded search expression take precedence over any field names + * listed in this parameter. + * + * @return the searchFields value. + */ + public List getSearchFields() { + return this.searchFields; + } + + /** + * Set the searchFields property: The list of field names to which to scope + * the full-text search. When using fielded search + * (fieldName:searchExpression) in a full Lucene query, the field names of + * each fielded search expression take precedence over any field names + * listed in this parameter. + * + * @param searchFields the searchFields value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setSearchFields(String... searchFields) { + this.searchFields = Arrays.asList(searchFields); + return this; + } + + /** + * Get the searchMode property: A value that specifies whether any or all + * of the search terms must be matched in order to count the document as a + * match. Possible values include: 'Any', 'All'. + * + * @return the searchMode value. + */ + public SearchMode getSearchMode() { + return this.searchMode; + } + + /** + * Set the searchMode property: A value that specifies whether any or all + * of the search terms must be matched in order to count the document as a + * match. Possible values include: 'Any', 'All'. + * + * @param searchMode the searchMode value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setSearchMode(SearchMode searchMode) { + this.searchMode = searchMode; + return this; + } + + /** + * Get the select property: The list of fields to retrieve. If unspecified, + * all fields marked as retrievable in the schema are included. + * + * @return the select value. + */ + public List getSelect() { + return this.select; + } + + /** + * Set the select property: The list of fields to retrieve. If unspecified, + * all fields marked as retrievable in the schema are included. + * + * @param select the select value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setSelect(String... select) { + this.select = Arrays.asList(select); + return this; + } + + /** + * Get the skip property: The number of search results to skip. This value + * cannot be greater than 100,000. If you need to scan documents in + * sequence, but cannot use $skip due to this limitation, consider using + * $orderby on a totally-ordered key and $filter with a range query + * instead. + * + * @return the skip value. + */ + public Integer getSkip() { + return this.skip; + } + + /** + * Set the skip property: The number of search results to skip. This value + * cannot be greater than 100,000. If you need to scan documents in + * sequence, but cannot use $skip due to this limitation, consider using + * $orderby on a totally-ordered key and $filter with a range query + * instead. + * + * @param skip the skip value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setSkip(Integer skip) { + this.skip = skip; + return this; + } + + /** + * Get the top property: The number of search results to retrieve. This can + * be used in conjunction with $skip to implement client-side paging of + * search results. If results are truncated due to server-side paging, the + * response will include a continuation token that can be used to issue + * another Search request for the next page of results. + * + * @return the top value. + */ + public Integer getTop() { + return this.top; + } + + /** + * Set the top property: The number of search results to retrieve. This can + * be used in conjunction with $skip to implement client-side paging of + * search results. If results are truncated due to server-side paging, the + * response will include a continuation token that can be used to issue + * another Search request for the next page of results. + * + * @param top the top value to set. + * @return the SearchOptions object itself. + */ + public SearchOptions setTop(Integer top) { + this.top = top; + return this; + } +} 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 scoringParameters) { + public SearchRequest setScoringParameters(List scoringParameters) { this.scoringParameters = scoringParameters; return this; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchResourceEncryptionKey.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchResourceEncryptionKey.java new file mode 100644 index 000000000000..f18791dae27f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchResourceEncryptionKey.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A customer-managed encryption key in Azure Key Vault. Keys that you create + * and manage can be used to encrypt or decrypt data-at-rest in Azure Cognitive + * Search, such as indexes and synonym maps. + */ +@Fluent +public final class SearchResourceEncryptionKey { + /* + * The name of your Azure Key Vault key to be used to encrypt your data at + * rest. + */ + @JsonProperty(value = "keyVaultKeyName", required = true) + private String keyName; + + /* + * The version of your Azure Key Vault key to be used to encrypt your data + * at rest. + */ + @JsonProperty(value = "keyVaultKeyVersion", required = true) + private String keyVersion; + + /* + * The URI of your Azure Key Vault, also referred to as DNS name, that + * contains the key to be used to encrypt your data at rest. An example URI + * might be https://my-keyvault-name.vault.azure.net. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String vaultUri; + + /* + * Optional Azure Active Directory credentials used for accessing your + * Azure Key Vault. Not required if using managed identity instead. + */ + @JsonProperty(value = "accessCredentials") + private AzureActiveDirectoryApplicationCredentials accessCredentials; + + /** + * Get the keyName property: The name of your Azure Key Vault key to be + * used to encrypt your data at rest. + * + * @return the keyName value. + */ + public String getKeyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of your Azure Key Vault key to be + * used to encrypt your data at rest. + * + * @param keyName the keyName value to set. + * @return the SearchResourceEncryptionKey object itself. + */ + public SearchResourceEncryptionKey setKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The version of your Azure Key Vault key to + * be used to encrypt your data at rest. + * + * @return the keyVersion value. + */ + public String getKeyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The version of your Azure Key Vault key to + * be used to encrypt your data at rest. + * + * @param keyVersion the keyVersion value to set. + * @return the SearchResourceEncryptionKey object itself. + */ + public SearchResourceEncryptionKey setKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the vaultUri property: The URI of your Azure Key Vault, also + * referred to as DNS name, that contains the key to be used to encrypt + * your data at rest. An example URI might be + * https://my-keyvault-name.vault.azure.net. + * + * @return the vaultUri value. + */ + public String getVaultUri() { + return this.vaultUri; + } + + /** + * Set the vaultUri property: The URI of your Azure Key Vault, also + * referred to as DNS name, that contains the key to be used to encrypt + * your data at rest. An example URI might be + * https://my-keyvault-name.vault.azure.net. + * + * @param vaultUri the vaultUri value to set. + * @return the SearchResourceEncryptionKey object itself. + */ + public SearchResourceEncryptionKey setVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get the accessCredentials property: Optional Azure Active Directory + * credentials used for accessing your Azure Key Vault. Not required if + * using managed identity instead. + * + * @return the accessCredentials value. + */ + public AzureActiveDirectoryApplicationCredentials getAccessCredentials() { + return this.accessCredentials; + } + + /** + * Set the accessCredentials property: Optional Azure Active Directory + * credentials used for accessing your Azure Key Vault. Not required if + * using managed identity instead. + * + * @param accessCredentials the accessCredentials value to set. + * @return the SearchResourceEncryptionKey object itself. + */ + public SearchResourceEncryptionKey setAccessCredentials(AzureActiveDirectoryApplicationCredentials accessCredentials) { + this.accessCredentials = accessCredentials; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchResult.java new file mode 100644 index 000000000000..5aa98c43f65b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Contains a document found by a search query, plus associated metadata. + */ +@Fluent +public final class SearchResult { + /* + * Unmatched properties from the message are deserialized this collection + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /* + * The relevance score of the document compared to other documents returned + * by the query. + */ + @JsonProperty(value = "@search.score", required = true, access = JsonProperty.Access.WRITE_ONLY) + private double score; + + /* + * Text fragments from the document that indicate the matching search + * terms, organized by each applicable field; null if hit highlighting was + * not enabled for the query. + */ + @JsonProperty(value = "@search.highlights", access = JsonProperty.Access.WRITE_ONLY) + private Map> highlights; + + /** + * Get the additionalProperties property: Unmatched properties from the + * message are deserialized this collection. + * + * @return the additionalProperties value. + */ + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Unmatched properties from the + * message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set. + * @return the SearchResult object itself. + */ + public SearchResult setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the score property: The relevance score of the document compared to + * other documents returned by the query. + * + * @return the score value. + */ + public double getScore() { + return this.score; + } + + /** + * Get the highlights property: Text fragments from the document that + * indicate the matching search terms, organized by each applicable field; + * null if hit highlighting was not enabled for the query. + * + * @return the highlights value. + */ + public Map> getHighlights() { + return this.highlights; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SentimentSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SentimentSkill.java new file mode 100644 index 000000000000..96311c0a9de5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SentimentSkill.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Text analytics positive-negative sentiment analysis, scored as a floating + * point value in a range of zero to 1. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Text.SentimentSkill") +@Fluent +public final class SentimentSkill extends SearchIndexerSkill { + /* + * A value indicating which language code to use. Default is en. Possible + * values include: 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'it', 'no', + * 'pl', 'pt-PT', 'ru', 'es', 'sv', 'tr' + */ + @JsonProperty(value = "defaultLanguageCode") + private SentimentSkillLanguage defaultLanguageCode; + + /** + * Get the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'da', 'nl', 'en', + * 'fi', 'fr', 'de', 'el', 'it', 'no', 'pl', 'pt-PT', 'ru', 'es', 'sv', + * 'tr'. + * + * @return the defaultLanguageCode value. + */ + public SentimentSkillLanguage getDefaultLanguageCode() { + return this.defaultLanguageCode; + } + + /** + * Set the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'da', 'nl', 'en', + * 'fi', 'fr', 'de', 'el', 'it', 'no', 'pl', 'pt-PT', 'ru', 'es', 'sv', + * 'tr'. + * + * @param defaultLanguageCode the defaultLanguageCode value to set. + * @return the SentimentSkill object itself. + */ + public SentimentSkill setDefaultLanguageCode(SentimentSkillLanguage defaultLanguageCode) { + this.defaultLanguageCode = defaultLanguageCode; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SentimentSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SentimentSkillLanguage.java new file mode 100644 index 000000000000..4006f53ae799 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SentimentSkillLanguage.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for SentimentSkillLanguage. + */ +public final class SentimentSkillLanguage extends ExpandableStringEnum { + /** + * Static value da for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage DA = fromString("da"); + + /** + * Static value nl for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage NL = fromString("nl"); + + /** + * Static value en for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage EN = fromString("en"); + + /** + * Static value fi for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage FI = fromString("fi"); + + /** + * Static value fr for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage FR = fromString("fr"); + + /** + * Static value de for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage DE = fromString("de"); + + /** + * Static value el for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage EL = fromString("el"); + + /** + * Static value it for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage IT = fromString("it"); + + /** + * Static value no for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage NO = fromString("no"); + + /** + * Static value pl for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage PL = fromString("pl"); + + /** + * Static value pt-PT for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage PT_PT = fromString("pt-PT"); + + /** + * Static value ru for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage RU = fromString("ru"); + + /** + * Static value es for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage ES = fromString("es"); + + /** + * Static value sv for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage SV = fromString("sv"); + + /** + * Static value tr for SentimentSkillLanguage. + */ + public static final SentimentSkillLanguage TR = fromString("tr"); + + /** + * Creates or finds a SentimentSkillLanguage from its string representation. + * + * @param name a name to look for. + * @return the corresponding SentimentSkillLanguage. + */ + @JsonCreator + public static SentimentSkillLanguage fromString(String name) { + return fromString(name, SentimentSkillLanguage.class); + } + + /** + * @return known SentimentSkillLanguage values. + */ + public static Collection values() { + return values(SentimentSkillLanguage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceCounters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceCounters.java new file mode 100644 index 000000000000..c1af3af3b3fc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceCounters.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents service-level resource counters and quotas. + */ +@Fluent +public final class ServiceCounters { + /* + * Total number of documents across all indexes in the service. + */ + @JsonProperty(value = "documentCount", required = true) + private ResourceCounter documentCounter; + + /* + * Total number of indexes. + */ + @JsonProperty(value = "indexesCount", required = true) + private ResourceCounter indexCounter; + + /* + * Total number of indexers. + */ + @JsonProperty(value = "indexersCount", required = true) + private ResourceCounter indexerCounter; + + /* + * Total number of data sources. + */ + @JsonProperty(value = "dataSourcesCount", required = true) + private ResourceCounter dataSourceCounter; + + /* + * Total size of used storage in bytes. + */ + @JsonProperty(value = "storageSize", required = true) + private ResourceCounter storageSizeCounter; + + /* + * Total number of synonym maps. + */ + @JsonProperty(value = "synonymMaps", required = true) + private ResourceCounter synonymMapCounter; + + /* + * Total number of skillsets. + */ + @JsonProperty(value = "skillsetCount", required = true) + private ResourceCounter skillsetCounter; + + /** + * Get the documentCounter property: Total number of documents across all + * indexes in the service. + * + * @return the documentCounter value. + */ + public ResourceCounter getDocumentCounter() { + return this.documentCounter; + } + + /** + * Set the documentCounter property: Total number of documents across all + * indexes in the service. + * + * @param documentCounter the documentCounter value to set. + * @return the ServiceCounters object itself. + */ + public ServiceCounters setDocumentCounter(ResourceCounter documentCounter) { + this.documentCounter = documentCounter; + return this; + } + + /** + * Get the indexCounter property: Total number of indexes. + * + * @return the indexCounter value. + */ + public ResourceCounter getIndexCounter() { + return this.indexCounter; + } + + /** + * Set the indexCounter property: Total number of indexes. + * + * @param indexCounter the indexCounter value to set. + * @return the ServiceCounters object itself. + */ + public ServiceCounters setIndexCounter(ResourceCounter indexCounter) { + this.indexCounter = indexCounter; + return this; + } + + /** + * Get the indexerCounter property: Total number of indexers. + * + * @return the indexerCounter value. + */ + public ResourceCounter getIndexerCounter() { + return this.indexerCounter; + } + + /** + * Set the indexerCounter property: Total number of indexers. + * + * @param indexerCounter the indexerCounter value to set. + * @return the ServiceCounters object itself. + */ + public ServiceCounters setIndexerCounter(ResourceCounter indexerCounter) { + this.indexerCounter = indexerCounter; + return this; + } + + /** + * Get the dataSourceCounter property: Total number of data sources. + * + * @return the dataSourceCounter value. + */ + public ResourceCounter getDataSourceCounter() { + return this.dataSourceCounter; + } + + /** + * Set the dataSourceCounter property: Total number of data sources. + * + * @param dataSourceCounter the dataSourceCounter value to set. + * @return the ServiceCounters object itself. + */ + public ServiceCounters setDataSourceCounter(ResourceCounter dataSourceCounter) { + this.dataSourceCounter = dataSourceCounter; + return this; + } + + /** + * Get the storageSizeCounter property: Total size of used storage in + * bytes. + * + * @return the storageSizeCounter value. + */ + public ResourceCounter getStorageSizeCounter() { + return this.storageSizeCounter; + } + + /** + * Set the storageSizeCounter property: Total size of used storage in + * bytes. + * + * @param storageSizeCounter the storageSizeCounter value to set. + * @return the ServiceCounters object itself. + */ + public ServiceCounters setStorageSizeCounter(ResourceCounter storageSizeCounter) { + this.storageSizeCounter = storageSizeCounter; + return this; + } + + /** + * Get the synonymMapCounter property: Total number of synonym maps. + * + * @return the synonymMapCounter value. + */ + public ResourceCounter getSynonymMapCounter() { + return this.synonymMapCounter; + } + + /** + * Set the synonymMapCounter property: Total number of synonym maps. + * + * @param synonymMapCounter the synonymMapCounter value to set. + * @return the ServiceCounters object itself. + */ + public ServiceCounters setSynonymMapCounter(ResourceCounter synonymMapCounter) { + this.synonymMapCounter = synonymMapCounter; + return this; + } + + /** + * Get the skillsetCounter property: Total number of skillsets. + * + * @return the skillsetCounter value. + */ + public ResourceCounter getSkillsetCounter() { + return this.skillsetCounter; + } + + /** + * Set the skillsetCounter property: Total number of skillsets. + * + * @param skillsetCounter the skillsetCounter value to set. + * @return the ServiceCounters object itself. + */ + public ServiceCounters setSkillsetCounter(ResourceCounter skillsetCounter) { + this.skillsetCounter = skillsetCounter; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceLimits.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceLimits.java new file mode 100644 index 000000000000..c24fdfea4bb0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceLimits.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents various service level limits. + */ +@Fluent +public final class ServiceLimits { + /* + * The maximum allowed fields per index. + */ + @JsonProperty(value = "maxFieldsPerIndex") + private Integer maxFieldsPerIndex; + + /* + * The maximum depth which you can nest sub-fields in an index, including + * the top-level complex field. For example, a/b/c has a nesting depth of + * 3. + */ + @JsonProperty(value = "maxFieldNestingDepthPerIndex") + private Integer maxFieldNestingDepthPerIndex; + + /* + * The maximum number of fields of type Collection(Edm.ComplexType) allowed + * in an index. + */ + @JsonProperty(value = "maxComplexCollectionFieldsPerIndex") + private Integer maxComplexCollectionFieldsPerIndex; + + /* + * The maximum number of objects in complex collections allowed per + * document. + */ + @JsonProperty(value = "maxComplexObjectsInCollectionsPerDocument") + private Integer maxComplexObjectsInCollectionsPerDocument; + + /** + * Get the maxFieldsPerIndex property: The maximum allowed fields per + * index. + * + * @return the maxFieldsPerIndex value. + */ + public Integer getMaxFieldsPerIndex() { + return this.maxFieldsPerIndex; + } + + /** + * Set the maxFieldsPerIndex property: The maximum allowed fields per + * index. + * + * @param maxFieldsPerIndex the maxFieldsPerIndex value to set. + * @return the ServiceLimits object itself. + */ + public ServiceLimits setMaxFieldsPerIndex(Integer maxFieldsPerIndex) { + this.maxFieldsPerIndex = maxFieldsPerIndex; + return this; + } + + /** + * Get the maxFieldNestingDepthPerIndex property: The maximum depth which + * you can nest sub-fields in an index, including the top-level complex + * field. For example, a/b/c has a nesting depth of 3. + * + * @return the maxFieldNestingDepthPerIndex value. + */ + public Integer getMaxFieldNestingDepthPerIndex() { + return this.maxFieldNestingDepthPerIndex; + } + + /** + * Set the maxFieldNestingDepthPerIndex property: The maximum depth which + * you can nest sub-fields in an index, including the top-level complex + * field. For example, a/b/c has a nesting depth of 3. + * + * @param maxFieldNestingDepthPerIndex the maxFieldNestingDepthPerIndex + * value to set. + * @return the ServiceLimits object itself. + */ + public ServiceLimits setMaxFieldNestingDepthPerIndex(Integer maxFieldNestingDepthPerIndex) { + this.maxFieldNestingDepthPerIndex = maxFieldNestingDepthPerIndex; + return this; + } + + /** + * Get the maxComplexCollectionFieldsPerIndex property: The maximum number + * of fields of type Collection(Edm.ComplexType) allowed in an index. + * + * @return the maxComplexCollectionFieldsPerIndex value. + */ + public Integer getMaxComplexCollectionFieldsPerIndex() { + return this.maxComplexCollectionFieldsPerIndex; + } + + /** + * Set the maxComplexCollectionFieldsPerIndex property: The maximum number + * of fields of type Collection(Edm.ComplexType) allowed in an index. + * + * @param maxComplexCollectionFieldsPerIndex the + * maxComplexCollectionFieldsPerIndex value to set. + * @return the ServiceLimits object itself. + */ + public ServiceLimits setMaxComplexCollectionFieldsPerIndex(Integer maxComplexCollectionFieldsPerIndex) { + this.maxComplexCollectionFieldsPerIndex = maxComplexCollectionFieldsPerIndex; + return this; + } + + /** + * Get the maxComplexObjectsInCollectionsPerDocument property: The maximum + * number of objects in complex collections allowed per document. + * + * @return the maxComplexObjectsInCollectionsPerDocument value. + */ + public Integer getMaxComplexObjectsInCollectionsPerDocument() { + return this.maxComplexObjectsInCollectionsPerDocument; + } + + /** + * Set the maxComplexObjectsInCollectionsPerDocument property: The maximum + * number of objects in complex collections allowed per document. + * + * @param maxComplexObjectsInCollectionsPerDocument the + * maxComplexObjectsInCollectionsPerDocument value to set. + * @return the ServiceLimits object itself. + */ + public ServiceLimits setMaxComplexObjectsInCollectionsPerDocument(Integer maxComplexObjectsInCollectionsPerDocument) { + this.maxComplexObjectsInCollectionsPerDocument = maxComplexObjectsInCollectionsPerDocument; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceStatistics.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceStatistics.java new file mode 100644 index 000000000000..ed52f778f0e2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ServiceStatistics.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response from a get service statistics request. If successful, it includes + * service level counters and limits. + */ +@Fluent +public final class ServiceStatistics { + /* + * Service level resource counters. + */ + @JsonProperty(value = "counters", required = true) + private ServiceCounters counters; + + /* + * Service level general limits. + */ + @JsonProperty(value = "limits", required = true) + private ServiceLimits limits; + + /** + * Get the counters property: Service level resource counters. + * + * @return the counters value. + */ + public ServiceCounters getCounters() { + return this.counters; + } + + /** + * Set the counters property: Service level resource counters. + * + * @param counters the counters value to set. + * @return the ServiceStatistics object itself. + */ + public ServiceStatistics setCounters(ServiceCounters counters) { + this.counters = counters; + return this; + } + + /** + * Get the limits property: Service level general limits. + * + * @return the limits value. + */ + public ServiceLimits getLimits() { + return this.limits; + } + + /** + * Set the limits property: Service level general limits. + * + * @param limits the limits value to set. + * @return the ServiceStatistics object itself. + */ + public ServiceStatistics setLimits(ServiceLimits limits) { + this.limits = limits; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ShaperSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ShaperSkill.java new file mode 100644 index 000000000000..96fb75f6a666 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ShaperSkill.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A skill for reshaping the outputs. It creates a complex type to support + * composite fields (also known as multipart fields). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Util.ShaperSkill") +@Fluent +public final class ShaperSkill extends SearchIndexerSkill { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ShingleTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ShingleTokenFilter.java new file mode 100644 index 000000000000..50a34c51eb7b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ShingleTokenFilter.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Creates combinations of tokens as a single token. This token filter is + * implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.ShingleTokenFilter") +@Fluent +public final class ShingleTokenFilter extends TokenFilter { + /* + * The maximum shingle size. Default and minimum value is 2. + */ + @JsonProperty(value = "maxShingleSize") + private Integer maxShingleSize; + + /* + * The minimum shingle size. Default and minimum value is 2. Must be less + * than the value of maxShingleSize. + */ + @JsonProperty(value = "minShingleSize") + private Integer minShingleSize; + + /* + * A value indicating whether the output stream will contain the input + * tokens (unigrams) as well as shingles. Default is true. + */ + @JsonProperty(value = "outputUnigrams") + private Boolean outputUnigrams; + + /* + * A value indicating whether to output unigrams for those times when no + * shingles are available. This property takes precedence when + * outputUnigrams is set to false. Default is false. + */ + @JsonProperty(value = "outputUnigramsIfNoShingles") + private Boolean outputUnigramsIfNoShingles; + + /* + * The string to use when joining adjacent tokens to form a shingle. + * Default is a single space (" "). + */ + @JsonProperty(value = "tokenSeparator") + private String tokenSeparator; + + /* + * The string to insert for each position at which there is no token. + * Default is an underscore ("_"). + */ + @JsonProperty(value = "filterToken") + private String filterToken; + + /** + * Get the maxShingleSize property: The maximum shingle size. Default and + * minimum value is 2. + * + * @return the maxShingleSize value. + */ + public Integer getMaxShingleSize() { + return this.maxShingleSize; + } + + /** + * Set the maxShingleSize property: The maximum shingle size. Default and + * minimum value is 2. + * + * @param maxShingleSize the maxShingleSize value to set. + * @return the ShingleTokenFilter object itself. + */ + public ShingleTokenFilter setMaxShingleSize(Integer maxShingleSize) { + this.maxShingleSize = maxShingleSize; + return this; + } + + /** + * Get the minShingleSize property: The minimum shingle size. Default and + * minimum value is 2. Must be less than the value of maxShingleSize. + * + * @return the minShingleSize value. + */ + public Integer getMinShingleSize() { + return this.minShingleSize; + } + + /** + * Set the minShingleSize property: The minimum shingle size. Default and + * minimum value is 2. Must be less than the value of maxShingleSize. + * + * @param minShingleSize the minShingleSize value to set. + * @return the ShingleTokenFilter object itself. + */ + public ShingleTokenFilter setMinShingleSize(Integer minShingleSize) { + this.minShingleSize = minShingleSize; + return this; + } + + /** + * Get the outputUnigrams property: A value indicating whether the output + * stream will contain the input tokens (unigrams) as well as shingles. + * Default is true. + * + * @return the outputUnigrams value. + */ + public Boolean isOutputUnigrams() { + return this.outputUnigrams; + } + + /** + * Set the outputUnigrams property: A value indicating whether the output + * stream will contain the input tokens (unigrams) as well as shingles. + * Default is true. + * + * @param outputUnigrams the outputUnigrams value to set. + * @return the ShingleTokenFilter object itself. + */ + public ShingleTokenFilter setOutputUnigrams(Boolean outputUnigrams) { + this.outputUnigrams = outputUnigrams; + return this; + } + + /** + * Get the outputUnigramsIfNoShingles property: A value indicating whether + * to output unigrams for those times when no shingles are available. This + * property takes precedence when outputUnigrams is set to false. Default + * is false. + * + * @return the outputUnigramsIfNoShingles value. + */ + public Boolean isOutputUnigramsIfNoShingles() { + return this.outputUnigramsIfNoShingles; + } + + /** + * Set the outputUnigramsIfNoShingles property: A value indicating whether + * to output unigrams for those times when no shingles are available. This + * property takes precedence when outputUnigrams is set to false. Default + * is false. + * + * @param outputUnigramsIfNoShingles the outputUnigramsIfNoShingles value + * to set. + * @return the ShingleTokenFilter object itself. + */ + public ShingleTokenFilter setOutputUnigramsIfNoShingles(Boolean outputUnigramsIfNoShingles) { + this.outputUnigramsIfNoShingles = outputUnigramsIfNoShingles; + return this; + } + + /** + * Get the tokenSeparator property: The string to use when joining adjacent + * tokens to form a shingle. Default is a single space (" "). + * + * @return the tokenSeparator value. + */ + public String getTokenSeparator() { + return this.tokenSeparator; + } + + /** + * Set the tokenSeparator property: The string to use when joining adjacent + * tokens to form a shingle. Default is a single space (" "). + * + * @param tokenSeparator the tokenSeparator value to set. + * @return the ShingleTokenFilter object itself. + */ + public ShingleTokenFilter setTokenSeparator(String tokenSeparator) { + this.tokenSeparator = tokenSeparator; + return this; + } + + /** + * Get the filterToken property: The string to insert for each position at + * which there is no token. Default is an underscore ("_"). + * + * @return the filterToken value. + */ + public String getFilterToken() { + return this.filterToken; + } + + /** + * Set the filterToken property: The string to insert for each position at + * which there is no token. Default is an underscore ("_"). + * + * @param filterToken the filterToken value to set. + * @return the ShingleTokenFilter object itself. + */ + public ShingleTokenFilter setFilterToken(String filterToken) { + this.filterToken = filterToken; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/Similarity.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/Similarity.java new file mode 100644 index 000000000000..b96c257c8d51 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/Similarity.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for similarity algorithms. Similarity algorithms are used to + * calculate scores that tie queries to documents. The higher the score, the + * more relevant the document is to that specific query. Those scores are used + * to rank the search results. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = Similarity.class) +@JsonTypeName("Similarity") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.ClassicSimilarity", value = ClassicSimilarity.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.BM25Similarity", value = BM25Similarity.class) +}) +@Fluent +public class Similarity { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SnowballTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SnowballTokenFilter.java new file mode 100644 index 000000000000..cc500d94410c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SnowballTokenFilter.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A filter that stems words using a Snowball-generated stemmer. This token + * filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.SnowballTokenFilter") +@Fluent +public final class SnowballTokenFilter extends TokenFilter { + /* + * The language to use. Possible values include: 'Armenian', 'Basque', + * 'Catalan', 'Danish', 'Dutch', 'English', 'Finnish', 'French', 'German', + * 'German2', 'Hungarian', 'Italian', 'Kp', 'Lovins', 'Norwegian', + * 'Porter', 'Portuguese', 'Romanian', 'Russian', 'Spanish', 'Swedish', + * 'Turkish' + */ + @JsonProperty(value = "language", required = true) + private SnowballTokenFilterLanguage language; + + /** + * Get the language property: The language to use. Possible values include: + * 'Armenian', 'Basque', 'Catalan', 'Danish', 'Dutch', 'English', + * 'Finnish', 'French', 'German', 'German2', 'Hungarian', 'Italian', 'Kp', + * 'Lovins', 'Norwegian', 'Porter', 'Portuguese', 'Romanian', 'Russian', + * 'Spanish', 'Swedish', 'Turkish'. + * + * @return the language value. + */ + public SnowballTokenFilterLanguage getLanguage() { + return this.language; + } + + /** + * Set the language property: The language to use. Possible values include: + * 'Armenian', 'Basque', 'Catalan', 'Danish', 'Dutch', 'English', + * 'Finnish', 'French', 'German', 'German2', 'Hungarian', 'Italian', 'Kp', + * 'Lovins', 'Norwegian', 'Porter', 'Portuguese', 'Romanian', 'Russian', + * 'Spanish', 'Swedish', 'Turkish'. + * + * @param language the language value to set. + * @return the SnowballTokenFilter object itself. + */ + public SnowballTokenFilter setLanguage(SnowballTokenFilterLanguage language) { + this.language = language; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SnowballTokenFilterLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SnowballTokenFilterLanguage.java new file mode 100644 index 000000000000..4738ccfa09d6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SnowballTokenFilterLanguage.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SnowballTokenFilterLanguage. + */ +public enum SnowballTokenFilterLanguage { + /** + * Enum value armenian. + */ + ARMENIAN("armenian"), + + /** + * Enum value basque. + */ + BASQUE("basque"), + + /** + * Enum value catalan. + */ + CATALAN("catalan"), + + /** + * Enum value danish. + */ + DANISH("danish"), + + /** + * Enum value dutch. + */ + DUTCH("dutch"), + + /** + * Enum value english. + */ + ENGLISH("english"), + + /** + * Enum value finnish. + */ + FINNISH("finnish"), + + /** + * Enum value french. + */ + FRENCH("french"), + + /** + * Enum value german. + */ + GERMAN("german"), + + /** + * Enum value german2. + */ + GERMAN2("german2"), + + /** + * Enum value hungarian. + */ + HUNGARIAN("hungarian"), + + /** + * Enum value italian. + */ + ITALIAN("italian"), + + /** + * Enum value kp. + */ + KP("kp"), + + /** + * Enum value lovins. + */ + LOVINS("lovins"), + + /** + * Enum value norwegian. + */ + NORWEGIAN("norwegian"), + + /** + * Enum value porter. + */ + PORTER("porter"), + + /** + * Enum value portuguese. + */ + PORTUGUESE("portuguese"), + + /** + * Enum value romanian. + */ + ROMANIAN("romanian"), + + /** + * Enum value russian. + */ + RUSSIAN("russian"), + + /** + * Enum value spanish. + */ + SPANISH("spanish"), + + /** + * Enum value swedish. + */ + SWEDISH("swedish"), + + /** + * Enum value turkish. + */ + TURKISH("turkish"); + + /** + * The actual serialized value for a SnowballTokenFilterLanguage instance. + */ + private final String value; + + SnowballTokenFilterLanguage(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SnowballTokenFilterLanguage instance. + * + * @param value the serialized value to parse. + * @return the parsed SnowballTokenFilterLanguage object, or null if unable to parse. + */ + @JsonCreator + public static SnowballTokenFilterLanguage fromString(String value) { + SnowballTokenFilterLanguage[] items = SnowballTokenFilterLanguage.values(); + for (SnowballTokenFilterLanguage item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SoftDeleteColumnDeletionDetectionPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SoftDeleteColumnDeletionDetectionPolicy.java new file mode 100644 index 000000000000..10cc6d272eed --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SoftDeleteColumnDeletionDetectionPolicy.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines a data deletion detection policy that implements a soft-deletion + * strategy. It determines whether an item should be deleted based on the value + * of a designated 'soft delete' column. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy") +@Fluent +public final class SoftDeleteColumnDeletionDetectionPolicy extends DataDeletionDetectionPolicy { + /* + * The name of the column to use for soft-deletion detection. + */ + @JsonProperty(value = "softDeleteColumnName") + private String softDeleteColumnName; + + /* + * The marker value that identifies an item as deleted. + */ + @JsonProperty(value = "softDeleteMarkerValue") + private String softDeleteMarkerValue; + + /** + * Get the softDeleteColumnName property: The name of the column to use for + * soft-deletion detection. + * + * @return the softDeleteColumnName value. + */ + public String getSoftDeleteColumnName() { + return this.softDeleteColumnName; + } + + /** + * Set the softDeleteColumnName property: The name of the column to use for + * soft-deletion detection. + * + * @param softDeleteColumnName the softDeleteColumnName value to set. + * @return the SoftDeleteColumnDeletionDetectionPolicy object itself. + */ + public SoftDeleteColumnDeletionDetectionPolicy setSoftDeleteColumnName(String softDeleteColumnName) { + this.softDeleteColumnName = softDeleteColumnName; + return this; + } + + /** + * Get the softDeleteMarkerValue property: The marker value that identifies + * an item as deleted. + * + * @return the softDeleteMarkerValue value. + */ + public String getSoftDeleteMarkerValue() { + return this.softDeleteMarkerValue; + } + + /** + * Set the softDeleteMarkerValue property: The marker value that identifies + * an item as deleted. + * + * @param softDeleteMarkerValue the softDeleteMarkerValue value to set. + * @return the SoftDeleteColumnDeletionDetectionPolicy object itself. + */ + public SoftDeleteColumnDeletionDetectionPolicy setSoftDeleteMarkerValue(String softDeleteMarkerValue) { + this.softDeleteMarkerValue = softDeleteMarkerValue; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SplitSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SplitSkill.java new file mode 100644 index 000000000000..92ec746daf0b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SplitSkill.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A skill to split a string into chunks of text. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Text.SplitSkill") +@Fluent +public final class SplitSkill extends SearchIndexerSkill { + /* + * A value indicating which language code to use. Default is en. Possible + * values include: 'da', 'de', 'en', 'es', 'fi', 'fr', 'it', 'ko', 'pt' + */ + @JsonProperty(value = "defaultLanguageCode") + private SplitSkillLanguage defaultLanguageCode; + + /* + * A value indicating which split mode to perform. Possible values include: + * 'Pages', 'Sentences' + */ + @JsonProperty(value = "textSplitMode") + private TextSplitMode textSplitMode; + + /* + * The desired maximum page length. Default is 10000. + */ + @JsonProperty(value = "maximumPageLength") + private Integer maximumPageLength; + + /** + * Get the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'da', 'de', 'en', + * 'es', 'fi', 'fr', 'it', 'ko', 'pt'. + * + * @return the defaultLanguageCode value. + */ + public SplitSkillLanguage getDefaultLanguageCode() { + return this.defaultLanguageCode; + } + + /** + * Set the defaultLanguageCode property: A value indicating which language + * code to use. Default is en. Possible values include: 'da', 'de', 'en', + * 'es', 'fi', 'fr', 'it', 'ko', 'pt'. + * + * @param defaultLanguageCode the defaultLanguageCode value to set. + * @return the SplitSkill object itself. + */ + public SplitSkill setDefaultLanguageCode(SplitSkillLanguage defaultLanguageCode) { + this.defaultLanguageCode = defaultLanguageCode; + return this; + } + + /** + * Get the textSplitMode property: A value indicating which split mode to + * perform. Possible values include: 'Pages', 'Sentences'. + * + * @return the textSplitMode value. + */ + public TextSplitMode getTextSplitMode() { + return this.textSplitMode; + } + + /** + * Set the textSplitMode property: A value indicating which split mode to + * perform. Possible values include: 'Pages', 'Sentences'. + * + * @param textSplitMode the textSplitMode value to set. + * @return the SplitSkill object itself. + */ + public SplitSkill setTextSplitMode(TextSplitMode textSplitMode) { + this.textSplitMode = textSplitMode; + return this; + } + + /** + * Get the maximumPageLength property: The desired maximum page length. + * Default is 10000. + * + * @return the maximumPageLength value. + */ + public Integer getMaximumPageLength() { + return this.maximumPageLength; + } + + /** + * Set the maximumPageLength property: The desired maximum page length. + * Default is 10000. + * + * @param maximumPageLength the maximumPageLength value to set. + * @return the SplitSkill object itself. + */ + public SplitSkill setMaximumPageLength(Integer maximumPageLength) { + this.maximumPageLength = maximumPageLength; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SplitSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SplitSkillLanguage.java new file mode 100644 index 000000000000..a8e78782693b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SplitSkillLanguage.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for SplitSkillLanguage. + */ +public final class SplitSkillLanguage extends ExpandableStringEnum { + /** + * Static value da for SplitSkillLanguage. + */ + public static final SplitSkillLanguage DA = fromString("da"); + + /** + * Static value de for SplitSkillLanguage. + */ + public static final SplitSkillLanguage DE = fromString("de"); + + /** + * Static value en for SplitSkillLanguage. + */ + public static final SplitSkillLanguage EN = fromString("en"); + + /** + * Static value es for SplitSkillLanguage. + */ + public static final SplitSkillLanguage ES = fromString("es"); + + /** + * Static value fi for SplitSkillLanguage. + */ + public static final SplitSkillLanguage FI = fromString("fi"); + + /** + * Static value fr for SplitSkillLanguage. + */ + public static final SplitSkillLanguage FR = fromString("fr"); + + /** + * Static value it for SplitSkillLanguage. + */ + public static final SplitSkillLanguage IT = fromString("it"); + + /** + * Static value ko for SplitSkillLanguage. + */ + public static final SplitSkillLanguage KO = fromString("ko"); + + /** + * Static value pt for SplitSkillLanguage. + */ + public static final SplitSkillLanguage PT = fromString("pt"); + + /** + * Creates or finds a SplitSkillLanguage from its string representation. + * + * @param name a name to look for. + * @return the corresponding SplitSkillLanguage. + */ + @JsonCreator + public static SplitSkillLanguage fromString(String name) { + return fromString(name, SplitSkillLanguage.class); + } + + /** + * @return known SplitSkillLanguage values. + */ + public static Collection values() { + return values(SplitSkillLanguage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SqlIntegratedChangeTrackingPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SqlIntegratedChangeTrackingPolicy.java new file mode 100644 index 000000000000..dabe2c6163f7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SqlIntegratedChangeTrackingPolicy.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines a data change detection policy that captures changes using the + * Integrated Change Tracking feature of Azure SQL Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy") +@Fluent +public final class SqlIntegratedChangeTrackingPolicy extends DataChangeDetectionPolicy { +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerOverrideTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerOverrideTokenFilter.java new file mode 100644 index 000000000000..de407d3180eb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerOverrideTokenFilter.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Provides the ability to override other stemming filters with custom + * dictionary-based stemming. Any dictionary-stemmed terms will be marked as + * keywords so that they will not be stemmed with stemmers down the chain. Must + * be placed before any stemming filters. This token filter is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.StemmerOverrideTokenFilter") +@Fluent +public final class StemmerOverrideTokenFilter extends TokenFilter { + /* + * A list of stemming rules in the following format: "word => stem", for + * example: "ran => run". + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the rules property: A list of stemming rules in the following + * format: "word => stem", for example: "ran => run". + * + * @return the rules value. + */ + public List getRules() { + return this.rules; + } + + /** + * Set the rules property: A list of stemming rules in the following + * format: "word => stem", for example: "ran => run". + * + * @param rules the rules value to set. + * @return the StemmerOverrideTokenFilter object itself. + */ + public StemmerOverrideTokenFilter setRules(List rules) { + this.rules = rules; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerTokenFilter.java new file mode 100644 index 000000000000..35a7b39e11f0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerTokenFilter.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Language specific stemming filter. This token filter is implemented using + * Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.StemmerTokenFilter") +@Fluent +public final class StemmerTokenFilter extends TokenFilter { + /* + * The language to use. Possible values include: 'Arabic', 'Armenian', + * 'Basque', 'Brazilian', 'Bulgarian', 'Catalan', 'Czech', 'Danish', + * 'Dutch', 'DutchKp', 'English', 'LightEnglish', 'MinimalEnglish', + * 'PossessiveEnglish', 'Porter2', 'Lovins', 'Finnish', 'LightFinnish', + * 'French', 'LightFrench', 'MinimalFrench', 'Galician', 'MinimalGalician', + * 'German', 'German2', 'LightGerman', 'MinimalGerman', 'Greek', 'Hindi', + * 'Hungarian', 'LightHungarian', 'Indonesian', 'Irish', 'Italian', + * 'LightItalian', 'Sorani', 'Latvian', 'Norwegian', 'LightNorwegian', + * 'MinimalNorwegian', 'LightNynorsk', 'MinimalNynorsk', 'Portuguese', + * 'LightPortuguese', 'MinimalPortuguese', 'PortugueseRslp', 'Romanian', + * 'Russian', 'LightRussian', 'Spanish', 'LightSpanish', 'Swedish', + * 'LightSwedish', 'Turkish' + */ + @JsonProperty(value = "language", required = true) + private StemmerTokenFilterLanguage language; + + /** + * Get the language property: The language to use. Possible values include: + * 'Arabic', 'Armenian', 'Basque', 'Brazilian', 'Bulgarian', 'Catalan', + * 'Czech', 'Danish', 'Dutch', 'DutchKp', 'English', 'LightEnglish', + * 'MinimalEnglish', 'PossessiveEnglish', 'Porter2', 'Lovins', 'Finnish', + * 'LightFinnish', 'French', 'LightFrench', 'MinimalFrench', 'Galician', + * 'MinimalGalician', 'German', 'German2', 'LightGerman', 'MinimalGerman', + * 'Greek', 'Hindi', 'Hungarian', 'LightHungarian', 'Indonesian', 'Irish', + * 'Italian', 'LightItalian', 'Sorani', 'Latvian', 'Norwegian', + * 'LightNorwegian', 'MinimalNorwegian', 'LightNynorsk', 'MinimalNynorsk', + * 'Portuguese', 'LightPortuguese', 'MinimalPortuguese', 'PortugueseRslp', + * 'Romanian', 'Russian', 'LightRussian', 'Spanish', 'LightSpanish', + * 'Swedish', 'LightSwedish', 'Turkish'. + * + * @return the language value. + */ + public StemmerTokenFilterLanguage getLanguage() { + return this.language; + } + + /** + * Set the language property: The language to use. Possible values include: + * 'Arabic', 'Armenian', 'Basque', 'Brazilian', 'Bulgarian', 'Catalan', + * 'Czech', 'Danish', 'Dutch', 'DutchKp', 'English', 'LightEnglish', + * 'MinimalEnglish', 'PossessiveEnglish', 'Porter2', 'Lovins', 'Finnish', + * 'LightFinnish', 'French', 'LightFrench', 'MinimalFrench', 'Galician', + * 'MinimalGalician', 'German', 'German2', 'LightGerman', 'MinimalGerman', + * 'Greek', 'Hindi', 'Hungarian', 'LightHungarian', 'Indonesian', 'Irish', + * 'Italian', 'LightItalian', 'Sorani', 'Latvian', 'Norwegian', + * 'LightNorwegian', 'MinimalNorwegian', 'LightNynorsk', 'MinimalNynorsk', + * 'Portuguese', 'LightPortuguese', 'MinimalPortuguese', 'PortugueseRslp', + * 'Romanian', 'Russian', 'LightRussian', 'Spanish', 'LightSpanish', + * 'Swedish', 'LightSwedish', 'Turkish'. + * + * @param language the language value to set. + * @return the StemmerTokenFilter object itself. + */ + public StemmerTokenFilter setLanguage(StemmerTokenFilterLanguage language) { + this.language = language; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerTokenFilterLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerTokenFilterLanguage.java new file mode 100644 index 000000000000..80a4477f7694 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StemmerTokenFilterLanguage.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StemmerTokenFilterLanguage. + */ +public enum StemmerTokenFilterLanguage { + /** + * Enum value arabic. + */ + ARABIC("arabic"), + + /** + * Enum value armenian. + */ + ARMENIAN("armenian"), + + /** + * Enum value basque. + */ + BASQUE("basque"), + + /** + * Enum value brazilian. + */ + BRAZILIAN("brazilian"), + + /** + * Enum value bulgarian. + */ + BULGARIAN("bulgarian"), + + /** + * Enum value catalan. + */ + CATALAN("catalan"), + + /** + * Enum value czech. + */ + CZECH("czech"), + + /** + * Enum value danish. + */ + DANISH("danish"), + + /** + * Enum value dutch. + */ + DUTCH("dutch"), + + /** + * Enum value dutchKp. + */ + DUTCH_KP("dutchKp"), + + /** + * Enum value english. + */ + ENGLISH("english"), + + /** + * Enum value lightEnglish. + */ + LIGHT_ENGLISH("lightEnglish"), + + /** + * Enum value minimalEnglish. + */ + MINIMAL_ENGLISH("minimalEnglish"), + + /** + * Enum value possessiveEnglish. + */ + POSSESSIVE_ENGLISH("possessiveEnglish"), + + /** + * Enum value porter2. + */ + PORTER2("porter2"), + + /** + * Enum value lovins. + */ + LOVINS("lovins"), + + /** + * Enum value finnish. + */ + FINNISH("finnish"), + + /** + * Enum value lightFinnish. + */ + LIGHT_FINNISH("lightFinnish"), + + /** + * Enum value french. + */ + FRENCH("french"), + + /** + * Enum value lightFrench. + */ + LIGHT_FRENCH("lightFrench"), + + /** + * Enum value minimalFrench. + */ + MINIMAL_FRENCH("minimalFrench"), + + /** + * Enum value galician. + */ + GALICIAN("galician"), + + /** + * Enum value minimalGalician. + */ + MINIMAL_GALICIAN("minimalGalician"), + + /** + * Enum value german. + */ + GERMAN("german"), + + /** + * Enum value german2. + */ + GERMAN2("german2"), + + /** + * Enum value lightGerman. + */ + LIGHT_GERMAN("lightGerman"), + + /** + * Enum value minimalGerman. + */ + MINIMAL_GERMAN("minimalGerman"), + + /** + * Enum value greek. + */ + GREEK("greek"), + + /** + * Enum value hindi. + */ + HINDI("hindi"), + + /** + * Enum value hungarian. + */ + HUNGARIAN("hungarian"), + + /** + * Enum value lightHungarian. + */ + LIGHT_HUNGARIAN("lightHungarian"), + + /** + * Enum value indonesian. + */ + INDONESIAN("indonesian"), + + /** + * Enum value irish. + */ + IRISH("irish"), + + /** + * Enum value italian. + */ + ITALIAN("italian"), + + /** + * Enum value lightItalian. + */ + LIGHT_ITALIAN("lightItalian"), + + /** + * Enum value sorani. + */ + SORANI("sorani"), + + /** + * Enum value latvian. + */ + LATVIAN("latvian"), + + /** + * Enum value norwegian. + */ + NORWEGIAN("norwegian"), + + /** + * Enum value lightNorwegian. + */ + LIGHT_NORWEGIAN("lightNorwegian"), + + /** + * Enum value minimalNorwegian. + */ + MINIMAL_NORWEGIAN("minimalNorwegian"), + + /** + * Enum value lightNynorsk. + */ + LIGHT_NYNORSK("lightNynorsk"), + + /** + * Enum value minimalNynorsk. + */ + MINIMAL_NYNORSK("minimalNynorsk"), + + /** + * Enum value portuguese. + */ + PORTUGUESE("portuguese"), + + /** + * Enum value lightPortuguese. + */ + LIGHT_PORTUGUESE("lightPortuguese"), + + /** + * Enum value minimalPortuguese. + */ + MINIMAL_PORTUGUESE("minimalPortuguese"), + + /** + * Enum value portugueseRslp. + */ + PORTUGUESE_RSLP("portugueseRslp"), + + /** + * Enum value romanian. + */ + ROMANIAN("romanian"), + + /** + * Enum value russian. + */ + RUSSIAN("russian"), + + /** + * Enum value lightRussian. + */ + LIGHT_RUSSIAN("lightRussian"), + + /** + * Enum value spanish. + */ + SPANISH("spanish"), + + /** + * Enum value lightSpanish. + */ + LIGHT_SPANISH("lightSpanish"), + + /** + * Enum value swedish. + */ + SWEDISH("swedish"), + + /** + * Enum value lightSwedish. + */ + LIGHT_SWEDISH("lightSwedish"), + + /** + * Enum value turkish. + */ + TURKISH("turkish"); + + /** + * The actual serialized value for a StemmerTokenFilterLanguage instance. + */ + private final String value; + + StemmerTokenFilterLanguage(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StemmerTokenFilterLanguage instance. + * + * @param value the serialized value to parse. + * @return the parsed StemmerTokenFilterLanguage object, or null if unable to parse. + */ + @JsonCreator + public static StemmerTokenFilterLanguage fromString(String value) { + StemmerTokenFilterLanguage[] items = StemmerTokenFilterLanguage.values(); + for (StemmerTokenFilterLanguage item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopAnalyzer.java new file mode 100644 index 000000000000..c80d9fe0a5e6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopAnalyzer.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Divides text at non-letters; Applies the lowercase and stopword token + * filters. This analyzer is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.StopAnalyzer") +@Fluent +public final class StopAnalyzer extends LexicalAnalyzer { + /* + * A list of stopwords. + */ + @JsonProperty(value = "stopwords") + private List stopwords; + + /** + * Get the stopwords property: A list of stopwords. + * + * @return the stopwords value. + */ + public List getStopwords() { + return this.stopwords; + } + + /** + * Set the stopwords property: A list of stopwords. + * + * @param stopwords the stopwords value to set. + * @return the StopAnalyzer object itself. + */ + public StopAnalyzer setStopwords(List stopwords) { + this.stopwords = stopwords; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopwordsList.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopwordsList.java new file mode 100644 index 000000000000..aa3bb67bfd60 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopwordsList.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StopwordsList. + */ +public enum StopwordsList { + /** + * Enum value arabic. + */ + ARABIC("arabic"), + + /** + * Enum value armenian. + */ + ARMENIAN("armenian"), + + /** + * Enum value basque. + */ + BASQUE("basque"), + + /** + * Enum value brazilian. + */ + BRAZILIAN("brazilian"), + + /** + * Enum value bulgarian. + */ + BULGARIAN("bulgarian"), + + /** + * Enum value catalan. + */ + CATALAN("catalan"), + + /** + * Enum value czech. + */ + CZECH("czech"), + + /** + * Enum value danish. + */ + DANISH("danish"), + + /** + * Enum value dutch. + */ + DUTCH("dutch"), + + /** + * Enum value english. + */ + ENGLISH("english"), + + /** + * Enum value finnish. + */ + FINNISH("finnish"), + + /** + * Enum value french. + */ + FRENCH("french"), + + /** + * Enum value galician. + */ + GALICIAN("galician"), + + /** + * Enum value german. + */ + GERMAN("german"), + + /** + * Enum value greek. + */ + GREEK("greek"), + + /** + * Enum value hindi. + */ + HINDI("hindi"), + + /** + * Enum value hungarian. + */ + HUNGARIAN("hungarian"), + + /** + * Enum value indonesian. + */ + INDONESIAN("indonesian"), + + /** + * Enum value irish. + */ + IRISH("irish"), + + /** + * Enum value italian. + */ + ITALIAN("italian"), + + /** + * Enum value latvian. + */ + LATVIAN("latvian"), + + /** + * Enum value norwegian. + */ + NORWEGIAN("norwegian"), + + /** + * Enum value persian. + */ + PERSIAN("persian"), + + /** + * Enum value portuguese. + */ + PORTUGUESE("portuguese"), + + /** + * Enum value romanian. + */ + ROMANIAN("romanian"), + + /** + * Enum value russian. + */ + RUSSIAN("russian"), + + /** + * Enum value sorani. + */ + SORANI("sorani"), + + /** + * Enum value spanish. + */ + SPANISH("spanish"), + + /** + * Enum value swedish. + */ + SWEDISH("swedish"), + + /** + * Enum value thai. + */ + THAI("thai"), + + /** + * Enum value turkish. + */ + TURKISH("turkish"); + + /** + * The actual serialized value for a StopwordsList instance. + */ + private final String value; + + StopwordsList(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StopwordsList instance. + * + * @param value the serialized value to parse. + * @return the parsed StopwordsList object, or null if unable to parse. + */ + @JsonCreator + public static StopwordsList fromString(String value) { + StopwordsList[] items = StopwordsList.values(); + for (StopwordsList item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopwordsTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopwordsTokenFilter.java new file mode 100644 index 000000000000..672f1adaae01 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/StopwordsTokenFilter.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Removes stop words from a token stream. This token filter is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.StopwordsTokenFilter") +@Fluent +public final class StopwordsTokenFilter extends TokenFilter { + /* + * The list of stopwords. This property and the stopwords list property + * cannot both be set. + */ + @JsonProperty(value = "stopwords") + private List stopwords; + + /* + * A predefined list of stopwords to use. This property and the stopwords + * property cannot both be set. Default is English. Possible values + * include: 'Arabic', 'Armenian', 'Basque', 'Brazilian', 'Bulgarian', + * 'Catalan', 'Czech', 'Danish', 'Dutch', 'English', 'Finnish', 'French', + * 'Galician', 'German', 'Greek', 'Hindi', 'Hungarian', 'Indonesian', + * 'Irish', 'Italian', 'Latvian', 'Norwegian', 'Persian', 'Portuguese', + * 'Romanian', 'Russian', 'Sorani', 'Spanish', 'Swedish', 'Thai', 'Turkish' + */ + @JsonProperty(value = "stopwordsList") + private StopwordsList stopwordsList; + + /* + * A value indicating whether to ignore case. If true, all words are + * converted to lower case first. Default is false. + */ + @JsonProperty(value = "ignoreCase") + private Boolean ignoreCase; + + /* + * A value indicating whether to ignore the last search term if it's a stop + * word. Default is true. + */ + @JsonProperty(value = "removeTrailing") + private Boolean removeTrailingStopWords; + + /** + * Get the stopwords property: The list of stopwords. This property and the + * stopwords list property cannot both be set. + * + * @return the stopwords value. + */ + public List getStopwords() { + return this.stopwords; + } + + /** + * Set the stopwords property: The list of stopwords. This property and the + * stopwords list property cannot both be set. + * + * @param stopwords the stopwords value to set. + * @return the StopwordsTokenFilter object itself. + */ + public StopwordsTokenFilter setStopwords(List stopwords) { + this.stopwords = stopwords; + return this; + } + + /** + * Get the stopwordsList property: A predefined list of stopwords to use. + * This property and the stopwords property cannot both be set. Default is + * English. Possible values include: 'Arabic', 'Armenian', 'Basque', + * 'Brazilian', 'Bulgarian', 'Catalan', 'Czech', 'Danish', 'Dutch', + * 'English', 'Finnish', 'French', 'Galician', 'German', 'Greek', 'Hindi', + * 'Hungarian', 'Indonesian', 'Irish', 'Italian', 'Latvian', 'Norwegian', + * 'Persian', 'Portuguese', 'Romanian', 'Russian', 'Sorani', 'Spanish', + * 'Swedish', 'Thai', 'Turkish'. + * + * @return the stopwordsList value. + */ + public StopwordsList getStopwordsList() { + return this.stopwordsList; + } + + /** + * Set the stopwordsList property: A predefined list of stopwords to use. + * This property and the stopwords property cannot both be set. Default is + * English. Possible values include: 'Arabic', 'Armenian', 'Basque', + * 'Brazilian', 'Bulgarian', 'Catalan', 'Czech', 'Danish', 'Dutch', + * 'English', 'Finnish', 'French', 'Galician', 'German', 'Greek', 'Hindi', + * 'Hungarian', 'Indonesian', 'Irish', 'Italian', 'Latvian', 'Norwegian', + * 'Persian', 'Portuguese', 'Romanian', 'Russian', 'Sorani', 'Spanish', + * 'Swedish', 'Thai', 'Turkish'. + * + * @param stopwordsList the stopwordsList value to set. + * @return the StopwordsTokenFilter object itself. + */ + public StopwordsTokenFilter setStopwordsList(StopwordsList stopwordsList) { + this.stopwordsList = stopwordsList; + return this; + } + + /** + * Get the ignoreCase property: A value indicating whether to ignore case. + * If true, all words are converted to lower case first. Default is false. + * + * @return the ignoreCase value. + */ + public Boolean isIgnoreCase() { + return this.ignoreCase; + } + + /** + * Set the ignoreCase property: A value indicating whether to ignore case. + * If true, all words are converted to lower case first. Default is false. + * + * @param ignoreCase the ignoreCase value to set. + * @return the StopwordsTokenFilter object itself. + */ + public StopwordsTokenFilter setIgnoreCase(Boolean ignoreCase) { + this.ignoreCase = ignoreCase; + return this; + } + + /** + * Get the removeTrailingStopWords property: A value indicating whether to + * ignore the last search term if it's a stop word. Default is true. + * + * @return the removeTrailingStopWords value. + */ + public Boolean isRemoveTrailingStopWords() { + return this.removeTrailingStopWords; + } + + /** + * Set the removeTrailingStopWords property: A value indicating whether to + * ignore the last search term if it's a stop word. Default is true. + * + * @param removeTrailingStopWords the removeTrailingStopWords value to set. + * @return the StopwordsTokenFilter object itself. + */ + public StopwordsTokenFilter setRemoveTrailingStopWords(Boolean removeTrailingStopWords) { + this.removeTrailingStopWords = removeTrailingStopWords; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestDocumentsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestDocumentsResult.java index affe36bc074e..e43c6c4bea10 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestDocumentsResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestDocumentsResult.java @@ -7,7 +7,6 @@ package com.azure.search.documents.implementation.models; import com.azure.core.annotation.Fluent; -import com.azure.search.documents.models.SuggestResult; 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/SuggestOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestOptions.java new file mode 100644 index 000000000000..6b22ee349eee --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestOptions.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Arrays; +import java.util.List; + +/** + * Additional parameters for suggestGet operation. + */ +@Fluent +public final class SuggestOptions { + /* + * An OData expression that filters the documents considered for + * suggestions. + */ + @JsonProperty(value = "") + private String filter; + + /* + * A value indicating whether to use fuzzy matching for the suggestions + * query. Default is false. When set to true, the query will find terms + * even if there's a substituted or missing character in the search text. + * While this provides a better experience in some scenarios, it comes at a + * performance cost as fuzzy suggestions queries are slower and consume + * more resources. + */ + @JsonProperty(value = "") + private Boolean useFuzzyMatching; + + /* + * A string tag that is appended to hit highlights. Must be set with + * highlightPreTag. If omitted, hit highlighting of suggestions is + * disabled. + */ + @JsonProperty(value = "") + private String highlightPostTag; + + /* + * A string tag that is prepended to hit highlights. Must be set with + * highlightPostTag. If omitted, hit highlighting of suggestions is + * disabled. + */ + @JsonProperty(value = "") + private String highlightPreTag; + + /* + * A number between 0 and 100 indicating the percentage of the index that + * must be covered by a suggestions query in order for the query to be + * reported as a success. This parameter can be useful for ensuring search + * availability even for services with only one replica. The default is 80. + */ + @JsonProperty(value = "") + private Double minimumCoverage; + + /* + * The list of OData $orderby expressions by which to sort the results. + * Each expression can be either a field name or a call to either the + * geo.distance() or the search.score() functions. Each expression can be + * followed by asc to indicate ascending, or desc to indicate descending. + * The default is ascending order. Ties will be broken by the match scores + * of documents. If no $orderby is specified, the default sort order is + * descending by document match score. There can be at most 32 $orderby + * clauses. + */ + @JsonProperty(value = "") + private List orderBy; + + /* + * The list of field names to search for the specified search text. Target + * fields must be included in the specified suggester. + */ + @JsonProperty(value = "") + private List searchFields; + + /* + * The list of fields to retrieve. If unspecified, only the key field will + * be included in the results. + */ + @JsonProperty(value = "") + private List select; + + /* + * The number of suggestions to retrieve. The value must be a number + * between 1 and 100. The default is 5. + */ + @JsonProperty(value = "") + private Integer top; + + /** + * Get the filter property: An OData expression that filters the documents + * considered for suggestions. + * + * @return the filter value. + */ + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData expression that filters the documents + * considered for suggestions. + * + * @param filter the filter value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the useFuzzyMatching property: A value indicating whether to use + * fuzzy matching for the suggestions query. Default is false. When set to + * true, the query will find terms even if there's a substituted or missing + * character in the search text. While this provides a better experience in + * some scenarios, it comes at a performance cost as fuzzy suggestions + * queries are slower and consume more resources. + * + * @return the useFuzzyMatching value. + */ + public Boolean isUseFuzzyMatching() { + return this.useFuzzyMatching; + } + + /** + * Set the useFuzzyMatching property: A value indicating whether to use + * fuzzy matching for the suggestions query. Default is false. When set to + * true, the query will find terms even if there's a substituted or missing + * character in the search text. While this provides a better experience in + * some scenarios, it comes at a performance cost as fuzzy suggestions + * queries are slower and consume more resources. + * + * @param useFuzzyMatching the useFuzzyMatching value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setUseFuzzyMatching(Boolean useFuzzyMatching) { + this.useFuzzyMatching = useFuzzyMatching; + return this; + } + + /** + * Get the highlightPostTag property: A string tag that is appended to hit + * highlights. Must be set with highlightPreTag. If omitted, hit + * highlighting of suggestions is disabled. + * + * @return the highlightPostTag value. + */ + public String getHighlightPostTag() { + return this.highlightPostTag; + } + + /** + * Set the highlightPostTag property: A string tag that is appended to hit + * highlights. Must be set with highlightPreTag. If omitted, hit + * highlighting of suggestions is disabled. + * + * @param highlightPostTag the highlightPostTag value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setHighlightPostTag(String highlightPostTag) { + this.highlightPostTag = highlightPostTag; + return this; + } + + /** + * Get the highlightPreTag property: A string tag that is prepended to hit + * highlights. Must be set with highlightPostTag. If omitted, hit + * highlighting of suggestions is disabled. + * + * @return the highlightPreTag value. + */ + public String getHighlightPreTag() { + return this.highlightPreTag; + } + + /** + * Set the highlightPreTag property: A string tag that is prepended to hit + * highlights. Must be set with highlightPostTag. If omitted, hit + * highlighting of suggestions is disabled. + * + * @param highlightPreTag the highlightPreTag value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setHighlightPreTag(String highlightPreTag) { + this.highlightPreTag = highlightPreTag; + return this; + } + + /** + * Get the minimumCoverage property: A number between 0 and 100 indicating + * the percentage of the index that must be covered by a suggestions query + * in order for the query to be reported as a success. This parameter can + * be useful for ensuring search availability even for services with only + * one replica. The default is 80. + * + * @return the minimumCoverage value. + */ + public Double getMinimumCoverage() { + return this.minimumCoverage; + } + + /** + * Set the minimumCoverage property: A number between 0 and 100 indicating + * the percentage of the index that must be covered by a suggestions query + * in order for the query to be reported as a success. This parameter can + * be useful for ensuring search availability even for services with only + * one replica. The default is 80. + * + * @param minimumCoverage the minimumCoverage value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setMinimumCoverage(Double minimumCoverage) { + this.minimumCoverage = minimumCoverage; + return this; + } + + /** + * Get the orderBy property: The list of OData $orderby expressions by + * which to sort the results. Each expression can be either a field name or + * a call to either the geo.distance() or the search.score() functions. + * Each expression can be followed by asc to indicate ascending, or desc to + * indicate descending. The default is ascending order. Ties will be broken + * by the match scores of documents. If no $orderby is specified, the + * default sort order is descending by document match score. There can be + * at most 32 $orderby clauses. + * + * @return the orderBy value. + */ + public List getOrderBy() { + return this.orderBy; + } + + /** + * Set the orderBy property: The list of OData $orderby expressions by + * which to sort the results. Each expression can be either a field name or + * a call to either the geo.distance() or the search.score() functions. + * Each expression can be followed by asc to indicate ascending, or desc to + * indicate descending. The default is ascending order. Ties will be broken + * by the match scores of documents. If no $orderby is specified, the + * default sort order is descending by document match score. There can be + * at most 32 $orderby clauses. + * + * @param orderBy the orderBy value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setOrderBy(String... orderBy) { + this.orderBy = Arrays.asList(orderBy); + return this; + } + + /** + * Get the searchFields property: The list of field names to search for the + * specified search text. Target fields must be included in the specified + * suggester. + * + * @return the searchFields value. + */ + public List getSearchFields() { + return this.searchFields; + } + + /** + * Set the searchFields property: The list of field names to search for the + * specified search text. Target fields must be included in the specified + * suggester. + * + * @param searchFields the searchFields value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setSearchFields(String... searchFields) { + this.searchFields = Arrays.asList(searchFields); + return this; + } + + /** + * Get the select property: The list of fields to retrieve. If unspecified, + * only the key field will be included in the results. + * + * @return the select value. + */ + public List getSelect() { + return this.select; + } + + /** + * Set the select property: The list of fields to retrieve. If unspecified, + * only the key field will be included in the results. + * + * @param select the select value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setSelect(String... select) { + this.select = Arrays.asList(select); + return this; + } + + /** + * Get the top property: The number of suggestions to retrieve. The value + * must be a number between 1 and 100. The default is 5. + * + * @return the top value. + */ + public Integer getTop() { + return this.top; + } + + /** + * Set the top property: The number of suggestions to retrieve. The value + * must be a number between 1 and 100. The default is 5. + * + * @param top the top value to set. + * @return the SuggestOptions object itself. + */ + public SuggestOptions setTop(Integer top) { + this.top = top; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestRequest.java index 8700337daf8e..72d38740a8ac 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestRequest.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestRequest.java @@ -138,7 +138,7 @@ public SuggestRequest 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/SuggestResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestResult.java new file mode 100644 index 000000000000..dbcb569c8103 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SuggestResult.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * A result containing a document found by a suggestion query, plus associated + * metadata. + */ +@Fluent +public final class SuggestResult { + /* + * Unmatched properties from the message are deserialized this collection + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /* + * The text of the suggestion result. + */ + @JsonProperty(value = "@search.text", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String text; + + /** + * Get the additionalProperties property: Unmatched properties from the + * message are deserialized this collection. + * + * @return the additionalProperties value. + */ + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Unmatched properties from the + * message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set. + * @return the SuggestResult object itself. + */ + public SuggestResult setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the text property: The text of the suggestion result. + * + * @return the text value. + */ + public String getText() { + return this.text; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/Suggester.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/Suggester.java new file mode 100644 index 000000000000..f80af6b95c6a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/Suggester.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Defines how the Suggest API should apply to a group of fields in the index. + */ +@Fluent +public final class Suggester { + /* + * The name of the suggester. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * A value indicating the capabilities of the suggester. + */ + @JsonProperty(value = "searchMode", required = true) + private String searchMode; + + /* + * The list of field names to which the suggester applies. Each field must + * be searchable. + */ + @JsonProperty(value = "sourceFields", required = true) + private List sourceFields; + + /** + * Creates an instance of Suggester class. + */ + public Suggester() { + searchMode = "analyzingInfixMatching"; + } + + /** + * Get the name property: The name of the suggester. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the suggester. + * + * @param name the name value to set. + * @return the Suggester object itself. + */ + public Suggester setName(String name) { + this.name = name; + return this; + } + + /** + * Get the searchMode property: A value indicating the capabilities of the + * suggester. + * + * @return the searchMode value. + */ + public String getSearchMode() { + return this.searchMode; + } + + /** + * Set the searchMode property: A value indicating the capabilities of the + * suggester. + * + * @param searchMode the searchMode value to set. + * @return the Suggester object itself. + */ + public Suggester setSearchMode(String searchMode) { + this.searchMode = searchMode; + return this; + } + + /** + * Get the sourceFields property: The list of field names to which the + * suggester applies. Each field must be searchable. + * + * @return the sourceFields value. + */ + public List getSourceFields() { + return this.sourceFields; + } + + /** + * Set the sourceFields property: The list of field names to which the + * suggester applies. Each field must be searchable. + * + * @param sourceFields the sourceFields value to set. + * @return the Suggester object itself. + */ + public Suggester setSourceFields(List sourceFields) { + this.sourceFields = sourceFields; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SynonymMap.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SynonymMap.java new file mode 100644 index 000000000000..ecbf4aafc58e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SynonymMap.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a synonym map definition. + */ +@Fluent +public final class SynonymMap { + /* + * The name of the synonym map. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The format of the synonym map. Only the 'solr' format is currently + * supported. + */ + @JsonProperty(value = "format", required = true) + private String format; + + /* + * A series of synonym rules in the specified synonym map format. The rules + * must be separated by newlines. + */ + @JsonProperty(value = "synonyms", required = true) + private String synonyms; + + /* + * A description of an encryption key that you create in Azure Key Vault. + * This key is used to provide an additional level of encryption-at-rest + * for your data when you want full assurance that no one, not even + * Microsoft, can decrypt your data in Azure Cognitive Search. Once you + * have encrypted your data, it will always remain encrypted. Azure + * Cognitive Search will ignore attempts to set this property to null. You + * can change this property as needed if you want to rotate your encryption + * key; Your data will be unaffected. Encryption with customer-managed keys + * is not available for free search services, and is only available for + * paid services created on or after January 1, 2019. + */ + @JsonProperty(value = "encryptionKey") + private SearchResourceEncryptionKey encryptionKey; + + /* + * The ETag of the synonym map. + */ + @JsonProperty(value = "@odata.etag") + private String eTag; + + /** + * Creates an instance of SynonymMap class. + */ + public SynonymMap() { + format = "solr"; + } + + /** + * Get the name property: The name of the synonym map. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the synonym map. + * + * @param name the name value to set. + * @return the SynonymMap object itself. + */ + public SynonymMap setName(String name) { + this.name = name; + return this; + } + + /** + * Get the format property: The format of the synonym map. Only the 'solr' + * format is currently supported. + * + * @return the format value. + */ + public String getFormat() { + return this.format; + } + + /** + * Set the format property: The format of the synonym map. Only the 'solr' + * format is currently supported. + * + * @param format the format value to set. + * @return the SynonymMap object itself. + */ + public SynonymMap setFormat(String format) { + this.format = format; + return this; + } + + /** + * Get the synonyms property: A series of synonym rules in the specified + * synonym map format. The rules must be separated by newlines. + * + * @return the synonyms value. + */ + public String getSynonyms() { + return this.synonyms; + } + + /** + * Set the synonyms property: A series of synonym rules in the specified + * synonym map format. The rules must be separated by newlines. + * + * @param synonyms the synonyms value to set. + * @return the SynonymMap object itself. + */ + public SynonymMap setSynonyms(String synonyms) { + this.synonyms = synonyms; + return this; + } + + /** + * Get the encryptionKey property: A description of an encryption key that + * you create in Azure Key Vault. This key is used to provide an additional + * level of encryption-at-rest for your data when you want full assurance + * that no one, not even Microsoft, can decrypt your data in Azure + * Cognitive Search. Once you have encrypted your data, it will always + * remain encrypted. Azure Cognitive Search will ignore attempts to set + * this property to null. You can change this property as needed if you + * want to rotate your encryption key; Your data will be unaffected. + * Encryption with customer-managed keys is not available for free search + * services, and is only available for paid services created on or after + * January 1, 2019. + * + * @return the encryptionKey value. + */ + public SearchResourceEncryptionKey getEncryptionKey() { + return this.encryptionKey; + } + + /** + * Set the encryptionKey property: A description of an encryption key that + * you create in Azure Key Vault. This key is used to provide an additional + * level of encryption-at-rest for your data when you want full assurance + * that no one, not even Microsoft, can decrypt your data in Azure + * Cognitive Search. Once you have encrypted your data, it will always + * remain encrypted. Azure Cognitive Search will ignore attempts to set + * this property to null. You can change this property as needed if you + * want to rotate your encryption key; Your data will be unaffected. + * Encryption with customer-managed keys is not available for free search + * services, and is only available for paid services created on or after + * January 1, 2019. + * + * @param encryptionKey the encryptionKey value to set. + * @return the SynonymMap object itself. + */ + public SynonymMap setEncryptionKey(SearchResourceEncryptionKey encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Get the eTag property: The ETag of the synonym map. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag of the synonym map. + * + * @param eTag the eTag value to set. + * @return the SynonymMap object itself. + */ + public SynonymMap setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SynonymTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SynonymTokenFilter.java new file mode 100644 index 000000000000..9f09ba946a3c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SynonymTokenFilter.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Matches single or multi-word synonyms in a token stream. This token filter + * is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.SynonymTokenFilter") +@Fluent +public final class SynonymTokenFilter extends TokenFilter { + /* + * A list of synonyms in following one of two formats: 1. incredible, + * unbelievable, fabulous => amazing - all terms on the left side of => + * symbol will be replaced with all terms on its right side; 2. incredible, + * unbelievable, fabulous, amazing - comma separated list of equivalent + * words. Set the expand option to change how this list is interpreted. + */ + @JsonProperty(value = "synonyms", required = true) + private List synonyms; + + /* + * A value indicating whether to case-fold input for matching. Default is + * false. + */ + @JsonProperty(value = "ignoreCase") + private Boolean ignoreCase; + + /* + * A value indicating whether all words in the list of synonyms (if => + * notation is not used) will map to one another. If true, all words in the + * list of synonyms (if => notation is not used) will map to one another. + * The following list: incredible, unbelievable, fabulous, amazing is + * equivalent to: incredible, unbelievable, fabulous, amazing => + * incredible, unbelievable, fabulous, amazing. If false, the following + * list: incredible, unbelievable, fabulous, amazing will be equivalent to: + * incredible, unbelievable, fabulous, amazing => incredible. Default is + * true. + */ + @JsonProperty(value = "expand") + private Boolean expand; + + /** + * Get the synonyms property: A list of synonyms in following one of two + * formats: 1. incredible, unbelievable, fabulous => amazing - all terms + * on the left side of => symbol will be replaced with all terms on its + * right side; 2. incredible, unbelievable, fabulous, amazing - comma + * separated list of equivalent words. Set the expand option to change how + * this list is interpreted. + * + * @return the synonyms value. + */ + public List getSynonyms() { + return this.synonyms; + } + + /** + * Set the synonyms property: A list of synonyms in following one of two + * formats: 1. incredible, unbelievable, fabulous => amazing - all terms + * on the left side of => symbol will be replaced with all terms on its + * right side; 2. incredible, unbelievable, fabulous, amazing - comma + * separated list of equivalent words. Set the expand option to change how + * this list is interpreted. + * + * @param synonyms the synonyms value to set. + * @return the SynonymTokenFilter object itself. + */ + public SynonymTokenFilter setSynonyms(List synonyms) { + this.synonyms = synonyms; + return this; + } + + /** + * Get the ignoreCase property: A value indicating whether to case-fold + * input for matching. Default is false. + * + * @return the ignoreCase value. + */ + public Boolean isIgnoreCase() { + return this.ignoreCase; + } + + /** + * Set the ignoreCase property: A value indicating whether to case-fold + * input for matching. Default is false. + * + * @param ignoreCase the ignoreCase value to set. + * @return the SynonymTokenFilter object itself. + */ + public SynonymTokenFilter setIgnoreCase(Boolean ignoreCase) { + this.ignoreCase = ignoreCase; + return this; + } + + /** + * Get the expand property: A value indicating whether all words in the + * list of synonyms (if => notation is not used) will map to one + * another. If true, all words in the list of synonyms (if => notation + * is not used) will map to one another. The following list: incredible, + * unbelievable, fabulous, amazing is equivalent to: incredible, + * unbelievable, fabulous, amazing => incredible, unbelievable, + * fabulous, amazing. If false, the following list: incredible, + * unbelievable, fabulous, amazing will be equivalent to: incredible, + * unbelievable, fabulous, amazing => incredible. Default is true. + * + * @return the expand value. + */ + public Boolean isExpand() { + return this.expand; + } + + /** + * Set the expand property: A value indicating whether all words in the + * list of synonyms (if => notation is not used) will map to one + * another. If true, all words in the list of synonyms (if => notation + * is not used) will map to one another. The following list: incredible, + * unbelievable, fabulous, amazing is equivalent to: incredible, + * unbelievable, fabulous, amazing => incredible, unbelievable, + * fabulous, amazing. If false, the following list: incredible, + * unbelievable, fabulous, amazing will be equivalent to: incredible, + * unbelievable, fabulous, amazing => incredible. Default is true. + * + * @param expand the expand value to set. + * @return the SynonymTokenFilter object itself. + */ + public SynonymTokenFilter setExpand(Boolean expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TagScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TagScoringFunction.java new file mode 100644 index 000000000000..34b45b8eed07 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TagScoringFunction.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines a function that boosts scores of documents with string values + * matching a given list of tags. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("tag") +@Fluent +public final class TagScoringFunction extends ScoringFunction { + /* + * Parameter values for the tag scoring function. + */ + @JsonProperty(value = "tag", required = true) + private TagScoringParameters parameters; + + /** + * Get the parameters property: Parameter values for the tag scoring + * function. + * + * @return the parameters value. + */ + public TagScoringParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameter values for the tag scoring + * function. + * + * @param parameters the parameters value to set. + * @return the TagScoringFunction object itself. + */ + public TagScoringFunction setParameters(TagScoringParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TagScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TagScoringParameters.java new file mode 100644 index 000000000000..0fcc654f5f7a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TagScoringParameters.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Provides parameter values to a tag scoring function. + */ +@Fluent +public final class TagScoringParameters { + /* + * The name of the parameter passed in search queries to specify the list + * of tags to compare against the target field. + */ + @JsonProperty(value = "tagsParameter", required = true) + private String tagsParameter; + + /** + * Get the tagsParameter property: The name of the parameter passed in + * search queries to specify the list of tags to compare against the target + * field. + * + * @return the tagsParameter value. + */ + public String getTagsParameter() { + return this.tagsParameter; + } + + /** + * Set the tagsParameter property: The name of the parameter passed in + * search queries to specify the list of tags to compare against the target + * field. + * + * @param tagsParameter the tagsParameter value to set. + * @return the TagScoringParameters object itself. + */ + public TagScoringParameters setTagsParameter(String tagsParameter) { + this.tagsParameter = tagsParameter; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextExtractionAlgorithm.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextExtractionAlgorithm.java new file mode 100644 index 000000000000..633a6353ea05 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextExtractionAlgorithm.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TextExtractionAlgorithm. + */ +public enum TextExtractionAlgorithm { + /** + * Enum value printed. + */ + PRINTED("printed"), + + /** + * Enum value handwritten. + */ + HANDWRITTEN("handwritten"); + + /** + * The actual serialized value for a TextExtractionAlgorithm instance. + */ + private final String value; + + TextExtractionAlgorithm(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TextExtractionAlgorithm instance. + * + * @param value the serialized value to parse. + * @return the parsed TextExtractionAlgorithm object, or null if unable to parse. + */ + @JsonCreator + public static TextExtractionAlgorithm fromString(String value) { + TextExtractionAlgorithm[] items = TextExtractionAlgorithm.values(); + for (TextExtractionAlgorithm item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextSplitMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextSplitMode.java new file mode 100644 index 000000000000..d6249e7e66e8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextSplitMode.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TextSplitMode. + */ +public enum TextSplitMode { + /** + * Enum value pages. + */ + PAGES("pages"), + + /** + * Enum value sentences. + */ + SENTENCES("sentences"); + + /** + * The actual serialized value for a TextSplitMode instance. + */ + private final String value; + + TextSplitMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TextSplitMode instance. + * + * @param value the serialized value to parse. + * @return the parsed TextSplitMode object, or null if unable to parse. + */ + @JsonCreator + public static TextSplitMode fromString(String value) { + TextSplitMode[] items = TextSplitMode.values(); + for (TextSplitMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextTranslationSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextTranslationSkill.java new file mode 100644 index 000000000000..19482fd7a285 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextTranslationSkill.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A skill to translate text from one language to another. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Text.TranslationSkill") +@Fluent +public final class TextTranslationSkill extends SearchIndexerSkill { + /* + * The language code to translate documents into for documents that don't + * specify the to language explicitly. Possible values include: 'af', 'ar', + * 'bn', 'bs', 'bg', 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', + * 'nl', 'en', 'et', 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', + * 'mww', 'hu', 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', + * 'mg', 'ms', 'mt', 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', + * 'sr-Cyrl', 'sr-Latn', 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', + * 'to', 'tr', 'uk', 'ur', 'vi', 'cy', 'yua' + */ + @JsonProperty(value = "defaultToLanguageCode", required = true) + private TextTranslationSkillLanguage defaultToLanguageCode; + + /* + * The language code to translate documents from for documents that don't + * specify the from language explicitly. Possible values include: 'af', + * 'ar', 'bn', 'bs', 'bg', 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', + * 'da', 'nl', 'en', 'et', 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', + * 'hi', 'mww', 'hu', 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', + * 'lt', 'mg', 'ms', 'mt', 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', + * 'sr-Cyrl', 'sr-Latn', 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', + * 'to', 'tr', 'uk', 'ur', 'vi', 'cy', 'yua' + */ + @JsonProperty(value = "defaultFromLanguageCode") + private TextTranslationSkillLanguage defaultFromLanguageCode; + + /* + * The language code to translate documents from when neither the + * fromLanguageCode input nor the defaultFromLanguageCode parameter are + * provided, and the automatic language detection is unsuccessful. Default + * is en. Possible values include: 'af', 'ar', 'bn', 'bs', 'bg', 'yue', + * 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', 'fj', + * 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', 'is', + * 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', 'nb', + * 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', 'sk', + * 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', 'vi', + * 'cy', 'yua' + */ + @JsonProperty(value = "suggestedFrom") + private TextTranslationSkillLanguage suggestedFrom; + + /** + * Get the defaultToLanguageCode property: The language code to translate + * documents into for documents that don't specify the to language + * explicitly. Possible values include: 'af', 'ar', 'bn', 'bs', 'bg', + * 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', + * 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', + * 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', + * 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', + * 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', + * 'vi', 'cy', 'yua'. + * + * @return the defaultToLanguageCode value. + */ + public TextTranslationSkillLanguage getDefaultToLanguageCode() { + return this.defaultToLanguageCode; + } + + /** + * Set the defaultToLanguageCode property: The language code to translate + * documents into for documents that don't specify the to language + * explicitly. Possible values include: 'af', 'ar', 'bn', 'bs', 'bg', + * 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', + * 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', + * 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', + * 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', + * 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', + * 'vi', 'cy', 'yua'. + * + * @param defaultToLanguageCode the defaultToLanguageCode value to set. + * @return the TextTranslationSkill object itself. + */ + public TextTranslationSkill setDefaultToLanguageCode(TextTranslationSkillLanguage defaultToLanguageCode) { + this.defaultToLanguageCode = defaultToLanguageCode; + return this; + } + + /** + * Get the defaultFromLanguageCode property: The language code to translate + * documents from for documents that don't specify the from language + * explicitly. Possible values include: 'af', 'ar', 'bn', 'bs', 'bg', + * 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', + * 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', + * 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', + * 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', + * 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', + * 'vi', 'cy', 'yua'. + * + * @return the defaultFromLanguageCode value. + */ + public TextTranslationSkillLanguage getDefaultFromLanguageCode() { + return this.defaultFromLanguageCode; + } + + /** + * Set the defaultFromLanguageCode property: The language code to translate + * documents from for documents that don't specify the from language + * explicitly. Possible values include: 'af', 'ar', 'bn', 'bs', 'bg', + * 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', + * 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', + * 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', + * 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', + * 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', + * 'vi', 'cy', 'yua'. + * + * @param defaultFromLanguageCode the defaultFromLanguageCode value to set. + * @return the TextTranslationSkill object itself. + */ + public TextTranslationSkill setDefaultFromLanguageCode(TextTranslationSkillLanguage defaultFromLanguageCode) { + this.defaultFromLanguageCode = defaultFromLanguageCode; + return this; + } + + /** + * Get the suggestedFrom property: The language code to translate documents + * from when neither the fromLanguageCode input nor the + * defaultFromLanguageCode parameter are provided, and the automatic + * language detection is unsuccessful. Default is en. Possible values + * include: 'af', 'ar', 'bn', 'bs', 'bg', 'yue', 'ca', 'zh-Hans', + * 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', 'fj', 'fil', 'fi', 'fr', + * 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', 'is', 'id', 'it', 'ja', 'sw', + * 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', 'nb', 'fa', 'pl', 'pt', + * 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', 'sk', 'sl', 'es', 'sv', + * 'ty', 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', 'vi', 'cy', 'yua'. + * + * @return the suggestedFrom value. + */ + public TextTranslationSkillLanguage getSuggestedFrom() { + return this.suggestedFrom; + } + + /** + * Set the suggestedFrom property: The language code to translate documents + * from when neither the fromLanguageCode input nor the + * defaultFromLanguageCode parameter are provided, and the automatic + * language detection is unsuccessful. Default is en. Possible values + * include: 'af', 'ar', 'bn', 'bs', 'bg', 'yue', 'ca', 'zh-Hans', + * 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', 'fj', 'fil', 'fi', 'fr', + * 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', 'is', 'id', 'it', 'ja', 'sw', + * 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', 'nb', 'fa', 'pl', 'pt', + * 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', 'sk', 'sl', 'es', 'sv', + * 'ty', 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', 'vi', 'cy', 'yua'. + * + * @param suggestedFrom the suggestedFrom value to set. + * @return the TextTranslationSkill object itself. + */ + public TextTranslationSkill setSuggestedFrom(TextTranslationSkillLanguage suggestedFrom) { + this.suggestedFrom = suggestedFrom; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextTranslationSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextTranslationSkillLanguage.java new file mode 100644 index 000000000000..140ff286ccdc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextTranslationSkillLanguage.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for TextTranslationSkillLanguage. + */ +public final class TextTranslationSkillLanguage extends ExpandableStringEnum { + /** + * Static value af for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage AF = fromString("af"); + + /** + * Static value ar for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage AR = fromString("ar"); + + /** + * Static value bn for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage BN = fromString("bn"); + + /** + * Static value bs for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage BS = fromString("bs"); + + /** + * Static value bg for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage BG = fromString("bg"); + + /** + * Static value yue for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage YUE = fromString("yue"); + + /** + * Static value ca for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage CA = fromString("ca"); + + /** + * Static value zh-Hans for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage ZH_HANS = fromString("zh-Hans"); + + /** + * Static value zh-Hant for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage ZH_HANT = fromString("zh-Hant"); + + /** + * Static value hr for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage HR = fromString("hr"); + + /** + * Static value cs for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage CS = fromString("cs"); + + /** + * Static value da for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage DA = fromString("da"); + + /** + * Static value nl for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage NL = fromString("nl"); + + /** + * Static value en for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage EN = fromString("en"); + + /** + * Static value et for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage ET = fromString("et"); + + /** + * Static value fj for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage FJ = fromString("fj"); + + /** + * Static value fil for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage FIL = fromString("fil"); + + /** + * Static value fi for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage FI = fromString("fi"); + + /** + * Static value fr for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage FR = fromString("fr"); + + /** + * Static value de for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage DE = fromString("de"); + + /** + * Static value el for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage EL = fromString("el"); + + /** + * Static value ht for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage HT = fromString("ht"); + + /** + * Static value he for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage HE = fromString("he"); + + /** + * Static value hi for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage HI = fromString("hi"); + + /** + * Static value mww for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage MWW = fromString("mww"); + + /** + * Static value hu for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage HU = fromString("hu"); + + /** + * Static value is for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage IS = fromString("is"); + + /** + * Static value id for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage ID = fromString("id"); + + /** + * Static value it for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage IT = fromString("it"); + + /** + * Static value ja for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage JA = fromString("ja"); + + /** + * Static value sw for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage SW = fromString("sw"); + + /** + * Static value tlh for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage TLH = fromString("tlh"); + + /** + * Static value ko for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage KO = fromString("ko"); + + /** + * Static value lv for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage LV = fromString("lv"); + + /** + * Static value lt for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage LT = fromString("lt"); + + /** + * Static value mg for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage MG = fromString("mg"); + + /** + * Static value ms for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage MS = fromString("ms"); + + /** + * Static value mt for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage MT = fromString("mt"); + + /** + * Static value nb for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage NB = fromString("nb"); + + /** + * Static value fa for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage FA = fromString("fa"); + + /** + * Static value pl for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage PL = fromString("pl"); + + /** + * Static value pt for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage PT = fromString("pt"); + + /** + * Static value otq for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage OTQ = fromString("otq"); + + /** + * Static value ro for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage RO = fromString("ro"); + + /** + * Static value ru for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage RU = fromString("ru"); + + /** + * Static value sm for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage SM = fromString("sm"); + + /** + * Static value sr-Cyrl for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage SR_CYRL = fromString("sr-Cyrl"); + + /** + * Static value sr-Latn for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage SR_LATN = fromString("sr-Latn"); + + /** + * Static value sk for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage SK = fromString("sk"); + + /** + * Static value sl for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage SL = fromString("sl"); + + /** + * Static value es for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage ES = fromString("es"); + + /** + * Static value sv for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage SV = fromString("sv"); + + /** + * Static value ty for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage TY = fromString("ty"); + + /** + * Static value ta for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage TA = fromString("ta"); + + /** + * Static value te for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage TE = fromString("te"); + + /** + * Static value th for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage TH = fromString("th"); + + /** + * Static value to for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage TO = fromString("to"); + + /** + * Static value tr for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage TR = fromString("tr"); + + /** + * Static value uk for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage UK = fromString("uk"); + + /** + * Static value ur for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage UR = fromString("ur"); + + /** + * Static value vi for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage VI = fromString("vi"); + + /** + * Static value cy for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage CY = fromString("cy"); + + /** + * Static value yua for TextTranslationSkillLanguage. + */ + public static final TextTranslationSkillLanguage YUA = fromString("yua"); + + /** + * Creates or finds a TextTranslationSkillLanguage from its string representation. + * + * @param name a name to look for. + * @return the corresponding TextTranslationSkillLanguage. + */ + @JsonCreator + public static TextTranslationSkillLanguage fromString(String name) { + return fromString(name, TextTranslationSkillLanguage.class); + } + + /** + * @return known TextTranslationSkillLanguage values. + */ + public static Collection values() { + return values(TextTranslationSkillLanguage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextWeights.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextWeights.java new file mode 100644 index 000000000000..0086b599f96b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TextWeights.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Defines weights on index fields for which matches should boost scoring in + * search queries. + */ +@Fluent +public final class TextWeights { + /* + * The dictionary of per-field weights to boost document scoring. The keys + * are field names and the values are the weights for each field. + */ + @JsonProperty(value = "weights", required = true) + private Map weights; + + /** + * Get the weights property: The dictionary of per-field weights to boost + * document scoring. The keys are field names and the values are the + * weights for each field. + * + * @return the weights value. + */ + public Map getWeights() { + return this.weights; + } + + /** + * Set the weights property: The dictionary of per-field weights to boost + * document scoring. The keys are field names and the values are the + * weights for each field. + * + * @param weights the weights value to set. + * @return the TextWeights object itself. + */ + public TextWeights setWeights(Map weights) { + this.weights = weights; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenCharacterKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenCharacterKind.java new file mode 100644 index 000000000000..44309c7e3621 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenCharacterKind.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TokenCharacterKind. + */ +public enum TokenCharacterKind { + /** + * Enum value letter. + */ + LETTER("letter"), + + /** + * Enum value digit. + */ + DIGIT("digit"), + + /** + * Enum value whitespace. + */ + WHITESPACE("whitespace"), + + /** + * Enum value punctuation. + */ + PUNCTUATION("punctuation"), + + /** + * Enum value symbol. + */ + SYMBOL("symbol"); + + /** + * The actual serialized value for a TokenCharacterKind instance. + */ + private final String value; + + TokenCharacterKind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TokenCharacterKind instance. + * + * @param value the serialized value to parse. + * @return the parsed TokenCharacterKind object, or null if unable to parse. + */ + @JsonCreator + public static TokenCharacterKind fromString(String value) { + TokenCharacterKind[] items = TokenCharacterKind.values(); + for (TokenCharacterKind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenFilter.java new file mode 100644 index 000000000000..ef1085b45467 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenFilter.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base type for token filters. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type", defaultImpl = TokenFilter.class) +@JsonTypeName("TokenFilter") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.AsciiFoldingTokenFilter", value = AsciiFoldingTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.CjkBigramTokenFilter", value = CjkBigramTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.CommonGramTokenFilter", value = CommonGramTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter", value = DictionaryDecompounderTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.EdgeNGramTokenFilter", value = EdgeNGramTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2", value = EdgeNGramTokenFilterV2.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.ElisionTokenFilter", value = ElisionTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.KeepTokenFilter", value = KeepTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.KeywordMarkerTokenFilter", value = KeywordMarkerTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.LengthTokenFilter", value = LengthTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.LimitTokenFilter", value = LimitTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.NGramTokenFilter", value = NGramTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.NGramTokenFilterV2", value = NGramTokenFilterV2.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.PatternCaptureTokenFilter", value = PatternCaptureTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.PatternReplaceTokenFilter", value = PatternReplaceTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.PhoneticTokenFilter", value = PhoneticTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.ShingleTokenFilter", value = ShingleTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.SnowballTokenFilter", value = SnowballTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StemmerTokenFilter", value = StemmerTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StemmerOverrideTokenFilter", value = StemmerOverrideTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StopwordsTokenFilter", value = StopwordsTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.SynonymTokenFilter", value = SynonymTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.TruncateTokenFilter", value = TruncateTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.UniqueTokenFilter", value = UniqueTokenFilter.class), + @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.WordDelimiterTokenFilter", value = WordDelimiterTokenFilter.class) +}) +@Fluent +public class TokenFilter { + /* + * The name of the token filter. It must only contain letters, digits, + * spaces, dashes or underscores, can only start and end with alphanumeric + * characters, and is limited to 128 characters. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: The name of the token filter. It must only + * contain letters, digits, spaces, dashes or underscores, can only start + * and end with alphanumeric characters, and is limited to 128 characters. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the token filter. It must only + * contain letters, digits, spaces, dashes or underscores, can only start + * and end with alphanumeric characters, and is limited to 128 characters. + * + * @param name the name value to set. + * @return the TokenFilter object itself. + */ + public TokenFilter setName(String name) { + this.name = name; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenFilterName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenFilterName.java new file mode 100644 index 000000000000..a29261b695b5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TokenFilterName.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for TokenFilterName. + */ +public final class TokenFilterName extends ExpandableStringEnum { + /** + * Static value arabic_normalization for TokenFilterName. + */ + public static final TokenFilterName ARABIC_NORMALIZATION = fromString("arabic_normalization"); + + /** + * Static value apostrophe for TokenFilterName. + */ + public static final TokenFilterName APOSTROPHE = fromString("apostrophe"); + + /** + * Static value asciifolding for TokenFilterName. + */ + public static final TokenFilterName ASCII_FOLDING = fromString("asciifolding"); + + /** + * Static value cjk_bigram for TokenFilterName. + */ + public static final TokenFilterName CJK_BIGRAM = fromString("cjk_bigram"); + + /** + * Static value cjk_width for TokenFilterName. + */ + public static final TokenFilterName CJK_WIDTH = fromString("cjk_width"); + + /** + * Static value classic for TokenFilterName. + */ + public static final TokenFilterName CLASSIC = fromString("classic"); + + /** + * Static value common_grams for TokenFilterName. + */ + public static final TokenFilterName COMMON_GRAM = fromString("common_grams"); + + /** + * Static value edgeNGram_v2 for TokenFilterName. + */ + public static final TokenFilterName EDGE_NGRAM = fromString("edgeNGram_v2"); + + /** + * Static value elision for TokenFilterName. + */ + public static final TokenFilterName ELISION = fromString("elision"); + + /** + * Static value german_normalization for TokenFilterName. + */ + public static final TokenFilterName GERMAN_NORMALIZATION = fromString("german_normalization"); + + /** + * Static value hindi_normalization for TokenFilterName. + */ + public static final TokenFilterName HINDI_NORMALIZATION = fromString("hindi_normalization"); + + /** + * Static value indic_normalization for TokenFilterName. + */ + public static final TokenFilterName INDIC_NORMALIZATION = fromString("indic_normalization"); + + /** + * Static value keyword_repeat for TokenFilterName. + */ + public static final TokenFilterName KEYWORD_REPEAT = fromString("keyword_repeat"); + + /** + * Static value kstem for TokenFilterName. + */ + public static final TokenFilterName KSTEM = fromString("kstem"); + + /** + * Static value length for TokenFilterName. + */ + public static final TokenFilterName LENGTH = fromString("length"); + + /** + * Static value limit for TokenFilterName. + */ + public static final TokenFilterName LIMIT = fromString("limit"); + + /** + * Static value lowercase for TokenFilterName. + */ + public static final TokenFilterName LOWERCASE = fromString("lowercase"); + + /** + * Static value nGram_v2 for TokenFilterName. + */ + public static final TokenFilterName NGRAM = fromString("nGram_v2"); + + /** + * Static value persian_normalization for TokenFilterName. + */ + public static final TokenFilterName PERSIAN_NORMALIZATION = fromString("persian_normalization"); + + /** + * Static value phonetic for TokenFilterName. + */ + public static final TokenFilterName PHONETIC = fromString("phonetic"); + + /** + * Static value porter_stem for TokenFilterName. + */ + public static final TokenFilterName PORTER_STEM = fromString("porter_stem"); + + /** + * Static value reverse for TokenFilterName. + */ + public static final TokenFilterName REVERSE = fromString("reverse"); + + /** + * Static value scandinavian_normalization for TokenFilterName. + */ + public static final TokenFilterName SCANDINAVIAN_NORMALIZATION = fromString("scandinavian_normalization"); + + /** + * Static value scandinavian_folding for TokenFilterName. + */ + public static final TokenFilterName SCANDINAVIAN_FOLDING_NORMALIZATION = fromString("scandinavian_folding"); + + /** + * Static value shingle for TokenFilterName. + */ + public static final TokenFilterName SHINGLE = fromString("shingle"); + + /** + * Static value snowball for TokenFilterName. + */ + public static final TokenFilterName SNOWBALL = fromString("snowball"); + + /** + * Static value sorani_normalization for TokenFilterName. + */ + public static final TokenFilterName SORANI_NORMALIZATION = fromString("sorani_normalization"); + + /** + * Static value stemmer for TokenFilterName. + */ + public static final TokenFilterName STEMMER = fromString("stemmer"); + + /** + * Static value stopwords for TokenFilterName. + */ + public static final TokenFilterName STOPWORDS = fromString("stopwords"); + + /** + * Static value trim for TokenFilterName. + */ + public static final TokenFilterName TRIM = fromString("trim"); + + /** + * Static value truncate for TokenFilterName. + */ + public static final TokenFilterName TRUNCATE = fromString("truncate"); + + /** + * Static value unique for TokenFilterName. + */ + public static final TokenFilterName UNIQUE = fromString("unique"); + + /** + * Static value uppercase for TokenFilterName. + */ + public static final TokenFilterName UPPERCASE = fromString("uppercase"); + + /** + * Static value word_delimiter for TokenFilterName. + */ + public static final TokenFilterName WORD_DELIMITER = fromString("word_delimiter"); + + /** + * Creates or finds a TokenFilterName from its string representation. + * + * @param name a name to look for. + * @return the corresponding TokenFilterName. + */ + @JsonCreator + public static TokenFilterName fromString(String name) { + return fromString(name, TokenFilterName.class); + } + + /** + * @return known TokenFilterName values. + */ + public static Collection values() { + return values(TokenFilterName.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TruncateTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TruncateTokenFilter.java new file mode 100644 index 000000000000..f450104fc796 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/TruncateTokenFilter.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Truncates the terms to a specific length. This token filter is implemented + * using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.TruncateTokenFilter") +@Fluent +public final class TruncateTokenFilter extends TokenFilter { + /* + * The length at which terms will be truncated. Default and maximum is 300. + */ + @JsonProperty(value = "length") + private Integer length; + + /** + * Get the length property: The length at which terms will be truncated. + * Default and maximum is 300. + * + * @return the length value. + */ + public Integer getLength() { + return this.length; + } + + /** + * Set the length property: The length at which terms will be truncated. + * Default and maximum is 300. + * + * @param length the length value to set. + * @return the TruncateTokenFilter object itself. + */ + public TruncateTokenFilter setLength(Integer length) { + this.length = length; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/UaxUrlEmailTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/UaxUrlEmailTokenizer.java new file mode 100644 index 000000000000..5f41e8840f41 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/UaxUrlEmailTokenizer.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Tokenizes urls and emails as one token. This tokenizer is implemented using + * Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.UaxUrlEmailTokenizer") +@Fluent +public final class UaxUrlEmailTokenizer extends LexicalTokenizer { + /* + * The maximum token length. Default is 255. Tokens longer than the maximum + * length are split. The maximum token length that can be used is 300 + * characters. + */ + @JsonProperty(value = "maxTokenLength") + private Integer maxTokenLength; + + /** + * Get the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @return the maxTokenLength value. + */ + public Integer getMaxTokenLength() { + return this.maxTokenLength; + } + + /** + * Set the maxTokenLength property: The maximum token length. Default is + * 255. Tokens longer than the maximum length are split. The maximum token + * length that can be used is 300 characters. + * + * @param maxTokenLength the maxTokenLength value to set. + * @return the UaxUrlEmailTokenizer object itself. + */ + public UaxUrlEmailTokenizer setMaxTokenLength(Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/UniqueTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/UniqueTokenFilter.java new file mode 100644 index 000000000000..c8b56425ed71 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/UniqueTokenFilter.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Filters out tokens with same text as the previous token. This token filter + * is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.UniqueTokenFilter") +@Fluent +public final class UniqueTokenFilter extends TokenFilter { + /* + * A value indicating whether to remove duplicates only at the same + * position. Default is false. + */ + @JsonProperty(value = "onlyOnSamePosition") + private Boolean onlyOnSamePosition; + + /** + * Get the onlyOnSamePosition property: A value indicating whether to + * remove duplicates only at the same position. Default is false. + * + * @return the onlyOnSamePosition value. + */ + public Boolean isOnlyOnSamePosition() { + return this.onlyOnSamePosition; + } + + /** + * Set the onlyOnSamePosition property: A value indicating whether to + * remove duplicates only at the same position. Default is false. + * + * @param onlyOnSamePosition the onlyOnSamePosition value to set. + * @return the UniqueTokenFilter object itself. + */ + public UniqueTokenFilter setOnlyOnSamePosition(Boolean onlyOnSamePosition) { + this.onlyOnSamePosition = onlyOnSamePosition; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/VisualFeature.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/VisualFeature.java new file mode 100644 index 000000000000..34f52538bb07 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/VisualFeature.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for VisualFeature. + */ +public enum VisualFeature { + /** + * Enum value adult. + */ + ADULT("adult"), + + /** + * Enum value brands. + */ + BRANDS("brands"), + + /** + * Enum value categories. + */ + CATEGORIES("categories"), + + /** + * Enum value description. + */ + DESCRIPTION("description"), + + /** + * Enum value faces. + */ + FACES("faces"), + + /** + * Enum value objects. + */ + OBJECTS("objects"), + + /** + * Enum value tags. + */ + TAGS("tags"); + + /** + * The actual serialized value for a VisualFeature instance. + */ + private final String value; + + VisualFeature(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a VisualFeature instance. + * + * @param value the serialized value to parse. + * @return the parsed VisualFeature object, or null if unable to parse. + */ + @JsonCreator + public static VisualFeature fromString(String value) { + VisualFeature[] items = VisualFeature.values(); + for (VisualFeature item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/WebApiSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/WebApiSkill.java new file mode 100644 index 000000000000..b486c41f3772 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/WebApiSkill.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.util.Map; + +/** + * A skill that can call a Web API endpoint, allowing you to extend a skillset + * by having it call your custom code. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Skills.Custom.WebApiSkill") +@Fluent +public final class WebApiSkill extends SearchIndexerSkill { + /* + * The url for the Web API. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * The headers required to make the http request. + */ + @JsonProperty(value = "httpHeaders") + private Map httpHeaders; + + /* + * The method for the http request. + */ + @JsonProperty(value = "httpMethod") + private String httpMethod; + + /* + * The desired timeout for the request. Default is 30 seconds. + */ + @JsonProperty(value = "timeout") + private Duration timeout; + + /* + * The desired batch size which indicates number of documents. + */ + @JsonProperty(value = "batchSize") + private Integer batchSize; + + /* + * If set, the number of parallel calls that can be made to the Web API. + */ + @JsonProperty(value = "degreeOfParallelism") + private Integer degreeOfParallelism; + + /** + * Get the uri property: The url for the Web API. + * + * @return the uri value. + */ + public String getUri() { + return this.uri; + } + + /** + * Set the uri property: The url for the Web API. + * + * @param uri the uri value to set. + * @return the WebApiSkill object itself. + */ + public WebApiSkill setUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the httpHeaders property: The headers required to make the http + * request. + * + * @return the httpHeaders value. + */ + public Map getHttpHeaders() { + return this.httpHeaders; + } + + /** + * Set the httpHeaders property: The headers required to make the http + * request. + * + * @param httpHeaders the httpHeaders value to set. + * @return the WebApiSkill object itself. + */ + public WebApiSkill setHttpHeaders(Map httpHeaders) { + this.httpHeaders = httpHeaders; + return this; + } + + /** + * Get the httpMethod property: The method for the http request. + * + * @return the httpMethod value. + */ + public String getHttpMethod() { + return this.httpMethod; + } + + /** + * Set the httpMethod property: The method for the http request. + * + * @param httpMethod the httpMethod value to set. + * @return the WebApiSkill object itself. + */ + public WebApiSkill setHttpMethod(String httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Get the timeout property: The desired timeout for the request. Default + * is 30 seconds. + * + * @return the timeout value. + */ + public Duration getTimeout() { + return this.timeout; + } + + /** + * Set the timeout property: The desired timeout for the request. Default + * is 30 seconds. + * + * @param timeout the timeout value to set. + * @return the WebApiSkill object itself. + */ + public WebApiSkill setTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the batchSize property: The desired batch size which indicates + * number of documents. + * + * @return the batchSize value. + */ + public Integer getBatchSize() { + return this.batchSize; + } + + /** + * Set the batchSize property: The desired batch size which indicates + * number of documents. + * + * @param batchSize the batchSize value to set. + * @return the WebApiSkill object itself. + */ + public WebApiSkill setBatchSize(Integer batchSize) { + this.batchSize = batchSize; + return this; + } + + /** + * Get the degreeOfParallelism property: If set, the number of parallel + * calls that can be made to the Web API. + * + * @return the degreeOfParallelism value. + */ + public Integer getDegreeOfParallelism() { + return this.degreeOfParallelism; + } + + /** + * Set the degreeOfParallelism property: If set, the number of parallel + * calls that can be made to the Web API. + * + * @param degreeOfParallelism the degreeOfParallelism value to set. + * @return the WebApiSkill object itself. + */ + public WebApiSkill setDegreeOfParallelism(Integer degreeOfParallelism) { + this.degreeOfParallelism = degreeOfParallelism; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/WordDelimiterTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/WordDelimiterTokenFilter.java new file mode 100644 index 000000000000..74b3b215f20d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/WordDelimiterTokenFilter.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Splits words into subwords and performs optional transformations on subword + * groups. This token filter is implemented using Apache Lucene. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Azure.Search.WordDelimiterTokenFilter") +@Fluent +public final class WordDelimiterTokenFilter extends TokenFilter { + /* + * A value indicating whether to generate part words. If set, causes parts + * of words to be generated; for example "AzureSearch" becomes "Azure" + * "Search". Default is true. + */ + @JsonProperty(value = "generateWordParts") + private Boolean generateWordParts; + + /* + * A value indicating whether to generate number subwords. Default is true. + */ + @JsonProperty(value = "generateNumberParts") + private Boolean generateNumberParts; + + /* + * A value indicating whether maximum runs of word parts will be catenated. + * For example, if this is set to true, "Azure-Search" becomes + * "AzureSearch". Default is false. + */ + @JsonProperty(value = "catenateWords") + private Boolean catenateWords; + + /* + * A value indicating whether maximum runs of number parts will be + * catenated. For example, if this is set to true, "1-2" becomes "12". + * Default is false. + */ + @JsonProperty(value = "catenateNumbers") + private Boolean catenateNumbers; + + /* + * A value indicating whether all subword parts will be catenated. For + * example, if this is set to true, "Azure-Search-1" becomes + * "AzureSearch1". Default is false. + */ + @JsonProperty(value = "catenateAll") + private Boolean catenateAll; + + /* + * A value indicating whether to split words on caseChange. For example, if + * this is set to true, "AzureSearch" becomes "Azure" "Search". Default is + * true. + */ + @JsonProperty(value = "splitOnCaseChange") + private Boolean splitOnCaseChange; + + /* + * A value indicating whether original words will be preserved and added to + * the subword list. Default is false. + */ + @JsonProperty(value = "preserveOriginal") + private Boolean preserveOriginal; + + /* + * A value indicating whether to split on numbers. For example, if this is + * set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is + * true. + */ + @JsonProperty(value = "splitOnNumerics") + private Boolean splitOnNumerics; + + /* + * A value indicating whether to remove trailing "'s" for each subword. + * Default is true. + */ + @JsonProperty(value = "stemEnglishPossessive") + private Boolean stemEnglishPossessive; + + /* + * A list of tokens to protect from being delimited. + */ + @JsonProperty(value = "protectedWords") + private List protectedWords; + + /** + * Get the generateWordParts property: A value indicating whether to + * generate part words. If set, causes parts of words to be generated; for + * example "AzureSearch" becomes "Azure" "Search". Default is true. + * + * @return the generateWordParts value. + */ + public Boolean isGenerateWordParts() { + return this.generateWordParts; + } + + /** + * Set the generateWordParts property: A value indicating whether to + * generate part words. If set, causes parts of words to be generated; for + * example "AzureSearch" becomes "Azure" "Search". Default is true. + * + * @param generateWordParts the generateWordParts value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setGenerateWordParts(Boolean generateWordParts) { + this.generateWordParts = generateWordParts; + return this; + } + + /** + * Get the generateNumberParts property: A value indicating whether to + * generate number subwords. Default is true. + * + * @return the generateNumberParts value. + */ + public Boolean isGenerateNumberParts() { + return this.generateNumberParts; + } + + /** + * Set the generateNumberParts property: A value indicating whether to + * generate number subwords. Default is true. + * + * @param generateNumberParts the generateNumberParts value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setGenerateNumberParts(Boolean generateNumberParts) { + this.generateNumberParts = generateNumberParts; + return this; + } + + /** + * Get the catenateWords property: A value indicating whether maximum runs + * of word parts will be catenated. For example, if this is set to true, + * "Azure-Search" becomes "AzureSearch". Default is false. + * + * @return the catenateWords value. + */ + public Boolean isCatenateWords() { + return this.catenateWords; + } + + /** + * Set the catenateWords property: A value indicating whether maximum runs + * of word parts will be catenated. For example, if this is set to true, + * "Azure-Search" becomes "AzureSearch". Default is false. + * + * @param catenateWords the catenateWords value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setCatenateWords(Boolean catenateWords) { + this.catenateWords = catenateWords; + return this; + } + + /** + * Get the catenateNumbers property: A value indicating whether maximum + * runs of number parts will be catenated. For example, if this is set to + * true, "1-2" becomes "12". Default is false. + * + * @return the catenateNumbers value. + */ + public Boolean isCatenateNumbers() { + return this.catenateNumbers; + } + + /** + * Set the catenateNumbers property: A value indicating whether maximum + * runs of number parts will be catenated. For example, if this is set to + * true, "1-2" becomes "12". Default is false. + * + * @param catenateNumbers the catenateNumbers value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setCatenateNumbers(Boolean catenateNumbers) { + this.catenateNumbers = catenateNumbers; + return this; + } + + /** + * Get the catenateAll property: A value indicating whether all subword + * parts will be catenated. For example, if this is set to true, + * "Azure-Search-1" becomes "AzureSearch1". Default is false. + * + * @return the catenateAll value. + */ + public Boolean isCatenateAll() { + return this.catenateAll; + } + + /** + * Set the catenateAll property: A value indicating whether all subword + * parts will be catenated. For example, if this is set to true, + * "Azure-Search-1" becomes "AzureSearch1". Default is false. + * + * @param catenateAll the catenateAll value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setCatenateAll(Boolean catenateAll) { + this.catenateAll = catenateAll; + return this; + } + + /** + * Get the splitOnCaseChange property: A value indicating whether to split + * words on caseChange. For example, if this is set to true, "AzureSearch" + * becomes "Azure" "Search". Default is true. + * + * @return the splitOnCaseChange value. + */ + public Boolean isSplitOnCaseChange() { + return this.splitOnCaseChange; + } + + /** + * Set the splitOnCaseChange property: A value indicating whether to split + * words on caseChange. For example, if this is set to true, "AzureSearch" + * becomes "Azure" "Search". Default is true. + * + * @param splitOnCaseChange the splitOnCaseChange value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setSplitOnCaseChange(Boolean splitOnCaseChange) { + this.splitOnCaseChange = splitOnCaseChange; + return this; + } + + /** + * Get the preserveOriginal property: A value indicating whether original + * words will be preserved and added to the subword list. Default is false. + * + * @return the preserveOriginal value. + */ + public Boolean isPreserveOriginal() { + return this.preserveOriginal; + } + + /** + * Set the preserveOriginal property: A value indicating whether original + * words will be preserved and added to the subword list. Default is false. + * + * @param preserveOriginal the preserveOriginal value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setPreserveOriginal(Boolean preserveOriginal) { + this.preserveOriginal = preserveOriginal; + return this; + } + + /** + * Get the splitOnNumerics property: A value indicating whether to split on + * numbers. For example, if this is set to true, "Azure1Search" becomes + * "Azure" "1" "Search". Default is true. + * + * @return the splitOnNumerics value. + */ + public Boolean isSplitOnNumerics() { + return this.splitOnNumerics; + } + + /** + * Set the splitOnNumerics property: A value indicating whether to split on + * numbers. For example, if this is set to true, "Azure1Search" becomes + * "Azure" "1" "Search". Default is true. + * + * @param splitOnNumerics the splitOnNumerics value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setSplitOnNumerics(Boolean splitOnNumerics) { + this.splitOnNumerics = splitOnNumerics; + return this; + } + + /** + * Get the stemEnglishPossessive property: A value indicating whether to + * remove trailing "'s" for each subword. Default is true. + * + * @return the stemEnglishPossessive value. + */ + public Boolean isStemEnglishPossessive() { + return this.stemEnglishPossessive; + } + + /** + * Set the stemEnglishPossessive property: A value indicating whether to + * remove trailing "'s" for each subword. Default is true. + * + * @param stemEnglishPossessive the stemEnglishPossessive value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setStemEnglishPossessive(Boolean stemEnglishPossessive) { + this.stemEnglishPossessive = stemEnglishPossessive; + return this; + } + + /** + * Get the protectedWords property: A list of tokens to protect from being + * delimited. + * + * @return the protectedWords value. + */ + public List getProtectedWords() { + return this.protectedWords; + } + + /** + * Set the protectedWords property: A list of tokens to protect from being + * delimited. + * + * @param protectedWords the protectedWords value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + public WordDelimiterTokenFilter setProtectedWords(List protectedWords) { + this.protectedWords = protectedWords; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/package-info.java index 95da21e328cc..edb6da61a976 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/package-info.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/package-info.java @@ -5,7 +5,7 @@ // regenerated. /** - * Package containing classes for SearchServiceRestClient. + * Package containing the data models for SearchServiceRestClient. * Client that can be used to manage and query indexes and documents, as well * as manage other resources, on a search service. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java new file mode 100644 index 000000000000..ad42957459d6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java @@ -0,0 +1,9 @@ +package com.azure.search.documents.implementation.util; + +public class Constants { + public static final String ENUM_INTERNAL_ERROR_MSG = "The enum does not exist in internal used model %s."; + public static final String ENUM_EXTERNAL_ERROR_MSG = "The enum does not exist in external used model %s."; + + public static final String ABSTRACT_INTERNAL_ERROR_MSG = "The subclass does not exist in internal used model %s."; + public static final String ABSTRACT_EXTERNAL_ERROR_MSG = "The subclass does not exist in external used model %s."; +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java index 9ed4388311c2..6e0ad0e0c6e6 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java @@ -6,6 +6,7 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceNotFoundException; import com.azure.search.documents.SearchDocument; +import com.azure.search.documents.implementation.models.SearchErrorException; /** * Utility class for Document Response conversions. @@ -30,9 +31,15 @@ public final class DocumentResponseConversions { * otherwise the passed {@link Throwable} unmodified. */ public static Throwable exceptionMapper(Throwable throwable) { - return (throwable instanceof HttpResponseException && EMPTY_BODY_404.equalsIgnoreCase(throwable.getMessage())) - ? new ResourceNotFoundException(DOCUMENT_NOT_FOUND, ((HttpResponseException) throwable).getResponse()) - : throwable; + if (!(throwable instanceof SearchErrorException)) { + return throwable; + } + + SearchErrorException exception = (SearchErrorException) throwable; + if (EMPTY_BODY_404.equalsIgnoreCase(throwable.getMessage())) { + return new ResourceNotFoundException(DOCUMENT_NOT_FOUND, exception.getResponse()); + } + return new HttpResponseException(exception.getMessage(), exception.getResponse()); } private DocumentResponseConversions() { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/MappingUtils.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/MappingUtils.java new file mode 100644 index 000000000000..10cffb4a13cd --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/MappingUtils.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents.implementation.util; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.search.documents.implementation.converters.AutocompleteResultConverter; +import com.azure.search.documents.implementation.converters.GetIndexStatisticsResultConverter; +import com.azure.search.documents.implementation.converters.IndexDocumentsResultConverter; +import com.azure.search.documents.implementation.converters.SearchIndexerStatusConverter; +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.ServiceStatisticsConverter; +import com.azure.search.documents.implementation.converters.SynonymMapConverter; +import com.azure.search.documents.implementation.converters.AnalyzedTokenInfoConverter; +import com.azure.search.documents.implementation.models.AnalyzeResult; +import com.azure.search.documents.implementation.models.AutocompleteResult; +import com.azure.search.documents.implementation.models.ListDataSourcesResult; +import com.azure.search.documents.implementation.models.ListIndexersResult; +import com.azure.search.documents.implementation.models.ListIndexesResult; +import com.azure.search.documents.implementation.models.ListSkillsetsResult; +import com.azure.search.documents.implementation.models.ListSynonymMapsResult; +import com.azure.search.documents.implementation.models.SearchErrorException; +import com.azure.search.documents.models.AnalyzedTokenInfo; +import com.azure.search.documents.models.GetIndexStatisticsResult; +import com.azure.search.documents.implementation.models.IndexDocumentsResult; +import com.azure.search.documents.models.SearchIndex; +import com.azure.search.documents.models.SearchIndexer; +import com.azure.search.documents.models.SearchIndexerDataSource; +import com.azure.search.documents.models.SearchIndexerSkillset; +import com.azure.search.documents.models.SearchIndexerStatus; +import com.azure.search.documents.models.ServiceStatistics; +import com.azure.search.documents.models.SynonymMap; +import com.azure.search.documents.util.AutocompletePagedResponse; + +import java.util.List; + +import static java.util.stream.Collectors.toList; + +public class MappingUtils { + + public static Response mappingExternalDataSource( + Response dataSourceResponse) { + return new SimpleResponse<>(dataSourceResponse, + SearchIndexerDataSourceConverter.map(dataSourceResponse.getValue())); + } + + public static PagedResponse mappingPagingDataSource( + Response dataSourceResponse) { + List dataSourceMaps = dataSourceResponse.getValue().getDataSources().stream() + .map(SearchIndexerDataSourceConverter::map).collect(toList()); + return new PagedResponseBase( + dataSourceResponse.getRequest(), dataSourceResponse.getStatusCode(), dataSourceResponse.getHeaders(), + dataSourceMaps, null, null); + } + + public static PagedResponse mappingPagingSearchIndex( + Response searchIndexResponse) { + List searchIndices = searchIndexResponse.getValue().getIndexes().stream() + .map(SearchIndexConverter::map).collect(toList()); + return new PagedResponseBase( + searchIndexResponse.getRequest(), searchIndexResponse.getStatusCode(), searchIndexResponse.getHeaders(), + searchIndices, null, null); + } + + public static Response mappingExternalSearchIndex( + Response indexResponse) { + return new SimpleResponse<>(indexResponse, SearchIndexConverter.map(indexResponse.getValue())); + } + + public static PagedResponse mappingPagingSearchIndexer( + Response searchIndexerResponse) { + List searchIndexers = searchIndexerResponse.getValue().getIndexers().stream() + .map(SearchIndexerConverter::map).collect(toList()); + return new PagedResponseBase( + searchIndexerResponse.getRequest(), searchIndexerResponse.getStatusCode(), searchIndexerResponse.getHeaders(), + searchIndexers, null, null); + } + + public static Response mappingExternalSearchIndexer( + Response indexerResponse) { + return new SimpleResponse<>(indexerResponse, SearchIndexerConverter.map(indexerResponse.getValue())); + } + + public static Response mappingExternalSkillset( + Response skillsetResponse) { + return new SimpleResponse<>(skillsetResponse, + SearchIndexerSkillsetConverter.map(skillsetResponse.getValue())); + } + + public static PagedResponse mappingPagingSkillset( + Response skillsetResponse) { + List synonymMaps = skillsetResponse.getValue().getSkillsets().stream() + .map(SearchIndexerSkillsetConverter::map).collect(toList()); + return new PagedResponseBase( + skillsetResponse.getRequest(), skillsetResponse.getStatusCode(), skillsetResponse.getHeaders(), + synonymMaps, null, null); + } + + public static Response mappingExternalSynonymMap( + Response synonymMapResponse) { + return new SimpleResponse<>(synonymMapResponse, SynonymMapConverter.map(synonymMapResponse.getValue())); + } + + public static PagedResponse mappingPagingSynonymMap( + Response synonymMapResponse) { + List synonymMaps = synonymMapResponse.getValue().getSynonymMaps().stream() + .map(SynonymMapConverter::map).collect(toList()); + return new PagedResponseBase( + synonymMapResponse.getRequest(), synonymMapResponse.getStatusCode(), synonymMapResponse.getHeaders(), + synonymMaps, null, null); + } + + public static Response mappingExternalServiceStatistics( + Response statisticsResponse) { + return new SimpleResponse<>(statisticsResponse, + ServiceStatisticsConverter.map(statisticsResponse.getValue())); + } + + public static PagedResponse mappingTokenInfo( + Response resultResponse) { + List tokenInfos = resultResponse.getValue().getTokens().stream().map(AnalyzedTokenInfoConverter::map).collect(toList()); + return new PagedResponseBase ( + resultResponse.getRequest(), + resultResponse.getStatusCode(), + resultResponse.getHeaders(), tokenInfos, + null, + null + ); + } + + public static Response mappingIndexerStatus( + Response indexerStatusResponse) { + return new SimpleResponse<>(indexerStatusResponse, SearchIndexerStatusConverter.map(indexerStatusResponse.getValue())); + } + + public static Response mappingGetIndexStatistics( + Response indexStatisticsResponse) { + return new SimpleResponse<>(indexStatisticsResponse.getRequest(), indexStatisticsResponse.getStatusCode(), + indexStatisticsResponse.getHeaders(), + GetIndexStatisticsResultConverter.map(indexStatisticsResponse.getValue())); + } + + public static AutocompletePagedResponse mappingAutocompleteResponse( + Response autocompleteResultResponse) { + return new AutocompletePagedResponse(new SimpleResponse<>(autocompleteResultResponse, + AutocompleteResultConverter.map(autocompleteResultResponse.getValue()))); + } + + public static Response mappingIndexDocumentResultResponse( + Response indexDocumentResponse) { + return new SimpleResponse<>(indexDocumentResponse, + IndexDocumentsResultConverter.map(indexDocumentResponse.getValue())); + } + + public static Throwable exceptionMapper(Throwable throwable) { + if (throwable instanceof SearchErrorException) { + SearchErrorException exception = (SearchErrorException) throwable; + return new HttpResponseException(exception.getMessage(), exception.getResponse()); + } + return throwable; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java new file mode 100644 index 000000000000..a2ca891d5741 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java @@ -0,0 +1,67 @@ +package com.azure.search.documents.implementation.util; + +import com.azure.core.util.logging.ClientLogger; + +import java.lang.reflect.Field; +import java.security.AccessController; +import java.security.PrivilegedAction; + +/** + * The helper class for getter only models converters. + */ +public class PrivateFieldAccessHelper { + private static final ClientLogger LOGGER = new ClientLogger(PrivateFieldAccessHelper.class); + + /** + * Set value to the model private properties. + * + * @param obj The instance which sets the value to. + * @param fieldName The fieldName to set. + * @param value The value sets to the instance + * @param Generic type of models. + */ + @SuppressWarnings("unchecked") + public static void set(T obj, String fieldName, Object value) { + try { + Field f1 = obj.getClass().getDeclaredField(fieldName); + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public T run() { + f1.setAccessible(true); + return null; + } + }); + f1.set(obj, value); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw LOGGER.logExceptionAsError(new RuntimeException(e)); + } + } + + /** + * Get values out from private private. + * + * @param obj The instance which gets the value from. + * @param fieldName The field name to get + * @param outputClass The field property class. + * @param Generic type of models. + * @param The type of the field properties. + * @return The values of instance property. + */ + @SuppressWarnings("unchecked") + public static I get(T obj, String fieldName, Class outputClass) { + + try { + Field f1 = obj.getClass().getDeclaredField(fieldName); + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public T run() { + f1.setAccessible(true); + return null; + } + }); + return (I) f1.get(obj); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw LOGGER.logExceptionAsError(new RuntimeException(e)); + } + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexSearchField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexField.java similarity index 80% rename from sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexSearchField.java rename to sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexField.java index 52115495b851..b61316af841e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexSearchField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexField.java @@ -9,22 +9,22 @@ * A helper Field model to build a complex field which uses {@code SearchFieldDataType.EDM_COMPLEX_TYPE} or collection of * {@code SearchFieldDataType.EDM_COMPLEX_TYPE}. */ -public class ComplexSearchField extends SearchFieldBase { +public class ComplexField extends SearchFieldBase { private List fields; /** - * Initializes a new instance of the {@link ComplexSearchField} class. + * Initializes a new instance of the {@link ComplexField} class. * * @param name The name of the field, which must be unique within the index or parent field. * @param collection Whether the field is a collection of strings. */ - public ComplexSearchField(String name, boolean collection) { + public ComplexField(String name, boolean collection) { super(name, collection ? SearchFieldDataType.collection(SearchFieldDataType.COMPLEX) : SearchFieldDataType.COMPLEX); } /** - * Gets a collection of {@link SimpleField} or {@link ComplexSearchField} child fields. + * Gets a collection of {@link SimpleField} or {@link ComplexField} child fields. * * @return The list of sub-fields. */ @@ -33,12 +33,12 @@ public List getFields() { } /** - * Sets a collection of {@link SimpleField} or {@link ComplexSearchField} child fields. + * Sets a collection of {@link SimpleField} or {@link ComplexField} child fields. * * @param fields The list of sub-fields. - * @return The {@link ComplexSearchField} object itself. + * @return The {@link ComplexField} object itself. */ - public ComplexSearchField setFields(List fields) { + public ComplexField setFields(List fields) { this.fields = fields; return this; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzer.java index d9317cd74cc1..bb370a297dde 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzer.java @@ -24,7 +24,7 @@ @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StopAnalyzer", value = StopAnalyzer.class) }) @Fluent -public class LexicalAnalyzer { +public abstract class LexicalAnalyzer { /* * The name of the analyzer. It must only contain letters, digits, spaces, * dashes or underscores, can only start and end with alphanumeric diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizer.java index dc3a7e1d29a7..5f5c08d501a8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizer.java @@ -32,7 +32,7 @@ @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.UaxUrlEmailTokenizer", value = UaxUrlEmailTokenizer.class) }) @Fluent -public class LexicalTokenizer { +public abstract class LexicalTokenizer { /* * The name of the tokenizer. It must only contain letters, digits, spaces, * dashes or underscores, can only start and end with alphanumeric diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringParameter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringParameter.java index 475714f7640d..f81b34ec6d2d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringParameter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringParameter.java @@ -26,6 +26,17 @@ public final class ScoringParameter { private static final String DASH = "-"; private static final String COMMA = ","; private static final String SINGLE_QUOTE = "'"; + + public ScoringParameter(String nameValuePair) { + Objects.requireNonNull(nameValuePair); + if (!nameValuePair.contains(DASH)) { + logger.logExceptionAsError(new IllegalArgumentException( + String.format("The name and value string: %s is invalid.", nameValuePair))); + } + this.name = nameValuePair.split(DASH)[0]; + this.values = Arrays.asList(nameValuePair.split(DASH)[1].split(COMMA)); + } + /** * Initializes a new instance of the ScoringParameter class with the given name and string values. * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchField.java index b9dffb5dd944..b1acd636602e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchField.java @@ -42,19 +42,6 @@ public final class SearchField { @JsonProperty(value = "key") private Boolean key; - /* - * A value indicating whether the field can be returned in a search result. - * You can disable this option if you want to use a field (for example, - * margin) as a filter, sorting, or scoring mechanism but do not want the - * field to be visible to the end user. This property must be true for key - * fields, and it must be null for complex fields. This property can be - * changed on existing fields. Enabling this property does not cause any - * increase in index storage requirements. Default is true for simple - * fields and null for complex fields. - */ - @JsonProperty(value = "retrievable") - private Boolean retrievable; - /* * A value indicating whether the field is full-text searchable. This means * it will undergo analysis such as word-breaking during indexing. If you @@ -312,40 +299,6 @@ public SearchField setKey(Boolean key) { return this; } - /** - * Get the retrievable property: A value indicating whether the field can - * be returned in a search result. You can disable this option if you want - * to use a field (for example, margin) as a filter, sorting, or scoring - * mechanism but do not want the field to be visible to the end user. This - * property must be true for key fields, and it must be null for complex - * fields. This property can be changed on existing fields. Enabling this - * property does not cause any increase in index storage requirements. - * Default is true for simple fields and null for complex fields. - * - * @return the retrievable value. - */ - private Boolean isRetrievable() { - return this.retrievable; - } - - /** - * Set the retrievable property: A value indicating whether the field can - * be returned in a search result. You can disable this option if you want - * to use a field (for example, margin) as a filter, sorting, or scoring - * mechanism but do not want the field to be visible to the end user. This - * property must be true for key fields, and it must be null for complex - * fields. This property can be changed on existing fields. Enabling this - * property does not cause any increase in index storage requirements. - * Default is true for simple fields and null for complex fields. - * - * @param retrievable the retrievable value to set. - * @return the SearchField object itself. - */ - private SearchField setRetrievable(Boolean retrievable) { - this.retrievable = retrievable; - return this; - } - /** * Get the searchable property: A value indicating whether the field is * full-text searchable. This means it will undergo analysis such as @@ -781,7 +734,7 @@ public SearchField setFields(List fields) { * @return the hidden value. */ public Boolean isHidden() { - return retrievable == null ? null : !retrievable; + return this.hidden; } /** @@ -797,7 +750,6 @@ public Boolean isHidden() { */ public SearchField setHidden(Boolean hidden) { this.hidden = hidden; - retrievable = this.hidden == null ? null : !this.hidden; return this; } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkill.java index ff474b39b14b..eae176e8b527 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkill.java @@ -33,7 +33,7 @@ @JsonSubTypes.Type(name = "#Microsoft.Skills.Custom.WebApiSkill", value = WebApiSkill.class) }) @Fluent -public class SearchIndexerSkill { +public abstract class SearchIndexerSkill { /* * The name of the skill which uniquely identifies it within the skillset. * A skill with no name defined will be given a default name of its 1-based diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/SearchPagedResponse.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/SearchPagedResponse.java index 27da7bd9f22a..55bfd1f2eb51 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/SearchPagedResponse.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/SearchPagedResponse.java @@ -8,13 +8,17 @@ import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.implementation.converters.FacetResultConverter; +import com.azure.search.documents.implementation.converters.SearchResultConverter; import com.azure.search.documents.implementation.models.SearchContinuationToken; import com.azure.search.documents.implementation.models.SearchDocumentsResult; import com.azure.search.documents.models.FacetResult; import com.azure.search.documents.models.SearchResult; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * Represents an HTTP response from the search API request that contains a list of items deserialized into a {@link @@ -41,13 +45,20 @@ public SearchPagedResponse(SimpleResponse documentSearchR super(documentSearchResponse.getRequest(), documentSearchResponse.getStatusCode(), documentSearchResponse.getHeaders(), - documentSearchResponse.getValue().getResults(), + documentSearchResponse.getValue().getResults().stream() + .map(SearchResultConverter::map).collect(Collectors.toList()), createContinuationToken(documentSearchResponse, serviceVersion), null); SearchDocumentsResult documentsResult = documentSearchResponse.getValue(); - this.value = documentsResult.getResults(); - this.facets = documentsResult.getFacets(); + this.value = documentsResult.getResults().stream().map(SearchResultConverter::map) + .collect(Collectors.toList()); + this.facets = documentsResult.getFacets() == null ? null : new HashMap<>(); + if (this.facets != null) { + documentsResult.getFacets().forEach((key, values) -> { + this.facets.put(key, values.stream().map(FacetResultConverter::map).collect(Collectors.toList())); + }); + } this.count = documentsResult.getCount(); this.coverage = documentsResult.getCoverage(); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/SuggestPagedResponse.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/SuggestPagedResponse.java index d5b7e34bb926..4d9a6bec4537 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/SuggestPagedResponse.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/SuggestPagedResponse.java @@ -7,9 +7,12 @@ import com.azure.core.http.rest.Page; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.SimpleResponse; +import com.azure.search.documents.implementation.converters.SuggestResultConverter; import com.azure.search.documents.implementation.models.SuggestDocumentsResult; import com.azure.search.documents.models.SuggestResult; +import java.util.stream.Collectors; + /** * Represents an HTTP response from the suggest API request that contains a list of items deserialized into a {@link * Page}. Each page contains additional information returned by the API request. In the Suggest API case the additional @@ -41,7 +44,8 @@ public SuggestPagedResponse(SimpleResponse documentSearc super(documentSearchResponse.getRequest(), documentSearchResponse.getStatusCode(), documentSearchResponse.getHeaders(), - documentSearchResponse.getValue().getResults(), + documentSearchResponse.getValue().getResults().stream().map(SuggestResultConverter::map) + .collect(Collectors.toList()), null, null); this.coverage = documentSearchResponse.getValue().getCoverage(); diff --git a/sdk/search/azure-search-documents/src/main/java/module-info.java b/sdk/search/azure-search-documents/src/main/java/module-info.java index e039c4f54ff8..6ec082aae98a 100644 --- a/sdk/search/azure-search-documents/src/main/java/module-info.java +++ b/sdk/search/azure-search-documents/src/main/java/module-info.java @@ -12,6 +12,7 @@ opens com.azure.search.documents.implementation.models to com.fasterxml.jackson.databind; exports com.azure.search.documents.implementation.util to com.fasterxml.jackson.databind; + exports com.azure.search.documents.implementation.models to com.azure.core; exports com.azure.search.documents; exports com.azure.search.documents.models; exports com.azure.search.documents.util; diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/HttpResponseExceptionExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/HttpResponseExceptionExample.java index fb26dcda9fa3..f87845c01b53 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/HttpResponseExceptionExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/HttpResponseExceptionExample.java @@ -8,7 +8,6 @@ import com.azure.core.http.HttpResponse; import com.azure.core.util.Configuration; import com.azure.core.util.Context; -import com.azure.search.documents.models.SearchErrorException; import com.azure.search.documents.models.SearchOptions; import com.azure.search.documents.models.SearchResult; import com.azure.search.documents.util.SearchPagedFlux; @@ -59,7 +58,7 @@ private static void handleErrorsWithSyncClient() { // normal results processing System.out.printf("Found hotel: %s%n", result.getDocument().get("HotelName")); } - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { // The exception contains the HTTP status code and the detailed message // returned from the search service HttpResponse response = ex.getResponse(); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/DataSourceSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/DataSourceSyncTests.java index e21923bf4735..84b5f1526eb0 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/DataSourceSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/DataSourceSyncTests.java @@ -11,7 +11,6 @@ import com.azure.search.documents.models.DataSourceCredentials; import com.azure.search.documents.models.HighWaterMarkChangeDetectionPolicy; import com.azure.search.documents.models.RequestOptions; -import com.azure.search.documents.models.SearchErrorException; import com.azure.search.documents.models.SearchIndexerDataContainer; import com.azure.search.documents.models.SearchIndexerDataSource; import com.azure.search.documents.models.SearchIndexerDataSourceType; @@ -180,7 +179,7 @@ public void deleteDataSourceIfExistsWorksOnlyWhenResourceExists() { try { client.deleteDataSourceWithResponse(response, true, null, Context.NONE); fail("Second call to delete with specified ETag should have failed due to non existent data source."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } } @@ -198,7 +197,7 @@ public void deleteDataSourceIfNotChangedWorksOnlyOnCurrentResource() { try { client.deleteDataSourceWithResponse(stale, true, null, Context.NONE); fail("Delete specifying a stale ETag should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } @@ -240,7 +239,7 @@ public void updateDataSourceIfNotChangedFailsWhenResourceChanged() { try { client.createOrUpdateDataSourceWithResponse(original, true, null, Context.NONE); fail("createOrUpdateDefinition should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FieldBuilderTest.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FieldBuilderTest.java index b95409cc3ec4..ca2dce98f45e 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FieldBuilderTest.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FieldBuilderTest.java @@ -3,7 +3,7 @@ package com.azure.search.documents; -import com.azure.search.documents.models.ComplexSearchField; +import com.azure.search.documents.models.ComplexField; import com.azure.search.documents.models.LexicalAnalyzerName; import com.azure.search.documents.models.SearchField; import com.azure.search.documents.models.SearchFieldDataType; @@ -94,13 +94,13 @@ private void assertExceptionMassageAndDataType(Exception exception, SearchFieldD } private List buildHotelCircularDependenciesModel() { - SearchField homeAddress = new ComplexSearchField("homeAddress", false).setFields(buildHotelInAddress()).build(); - SearchField billingAddress = new ComplexSearchField("billingAddress", false).setFields(buildHotelInAddress()).build(); + SearchField homeAddress = new ComplexField("homeAddress", false).setFields(buildHotelInAddress()).build(); + SearchField billingAddress = new ComplexField("billingAddress", false).setFields(buildHotelInAddress()).build(); return Arrays.asList(homeAddress, billingAddress); } private List buildHotelInAddress() { - SearchField hotel = new ComplexSearchField("hotel", false).build(); + SearchField hotel = new ComplexField("hotel", false).build(); return Collections.singletonList(hotel); } @@ -117,9 +117,9 @@ private List buildHotelFields() { SearchField lastRenovationDate = new SimpleField("lastRenovationDate", SearchFieldDataType.DATE_TIME_OFFSET, false).build(); SearchField rating = new SimpleField("rating", SearchFieldDataType.INT32, false).build(); SearchField location = new SimpleField("location", SearchFieldDataType.GEOGRAPHY_POINT, false).build(); - SearchField address = new ComplexSearchField("address", false) + SearchField address = new ComplexField("address", false) .setFields(buildHotelAddressField()).build(); - SearchField rooms = new ComplexSearchField("rooms", true).setFields(buildHotelRoomField()).build(); + SearchField rooms = new ComplexField("rooms", true).setFields(buildHotelRoomField()).build(); return Arrays.asList(hotelId, hotelName, description, category, tags, parkingIncluded, smokingAllowed, lastRenovationDate, rating, location, address, rooms); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexManagementSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexManagementSyncTests.java index cad31c09dfd7..b7c7d7cac820 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexManagementSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexManagementSyncTests.java @@ -2,6 +2,7 @@ // Licensed under the MIT License. package com.azure.search.documents; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -14,7 +15,6 @@ import com.azure.search.documents.models.ScoringFunctionAggregation; import com.azure.search.documents.models.ScoringFunctionInterpolation; import com.azure.search.documents.models.ScoringProfile; -import com.azure.search.documents.models.SearchErrorException; import com.azure.search.documents.models.SearchField; import com.azure.search.documents.models.SearchFieldDataType; import com.azure.search.documents.models.SearchIndex; @@ -134,8 +134,8 @@ public void createIndexFailsWithUsefulMessageOnUserError() { client.createIndex(index); fail("createOrUpdateIndex did not throw an expected Exception"); } catch (Exception ex) { - assertEquals(SearchErrorException.class, ex.getClass()); - assertEquals(HttpURLConnection.HTTP_BAD_REQUEST, ((SearchErrorException) ex).getResponse().getStatusCode()); + assertEquals(HttpResponseException.class, ex.getClass()); + assertEquals(HttpURLConnection.HTTP_BAD_REQUEST, ((HttpResponseException) ex).getResponse().getStatusCode()); assertTrue(ex.getMessage().contains(expectedMessage)); } } @@ -186,7 +186,7 @@ public void deleteIndexIfNotChangedWorksOnlyOnCurrentResource() { try { client.deleteIndexWithResponse(originalIndex, true, null, Context.NONE); fail("deleteFunc should have failed due to selected MatchConditions"); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } @@ -204,7 +204,7 @@ public void deleteIndexIfExistsWorksOnlyWhenResourceExists() { try { client.deleteIndexWithResponse(index, true, null, Context.NONE); fail("deleteFunc should have failed due to non existent resource."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } } @@ -239,7 +239,7 @@ public void canCreateAndDeleteIndex() { client.createIndex(index); client.deleteIndex(index.getName()); - assertThrows(SearchErrorException.class, () -> client.getIndex(index.getName())); + assertThrows(HttpResponseException.class, () -> client.getIndex(index.getName())); } @Test @@ -546,7 +546,7 @@ public void createOrUpdateIndexIfNotChangedFailsWhenResourceChanged() { try { client.createOrUpdateIndexWithResponse(original, false, true, null, Context.NONE); fail("createOrUpdateDefinition should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexersManagementSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexersManagementSyncTests.java index 1ae45bc1d2c0..7d77adf03bf2 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexersManagementSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexersManagementSyncTests.java @@ -17,7 +17,6 @@ import com.azure.search.documents.models.OcrSkill; import com.azure.search.documents.models.OutputFieldMappingEntry; import com.azure.search.documents.models.RequestOptions; -import com.azure.search.documents.models.SearchErrorException; import com.azure.search.documents.models.SearchField; import com.azure.search.documents.models.SearchFieldDataType; import com.azure.search.documents.models.SearchIndex; @@ -501,7 +500,7 @@ public void deleteIndexerIfExistsWorksOnlyWhenResourceExists() { try { client.deleteIndexerWithResponse(created, true, null, Context.NONE); fail("deleteFunc should have failed due to non existent resource."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } } @@ -518,7 +517,7 @@ public void deleteIndexerIfNotChangedWorksOnlyOnCurrentResource() { try { client.deleteIndexerWithResponse(stale, true, null, Context.NONE); fail("deleteFunc should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } @@ -560,7 +559,7 @@ public void updateIndexerIfNotChangedFailsWhenResourceChanged() { try { client.createOrUpdateIndexerWithResponse(original, true, null, Context.NONE); fail("createOrUpdateDefinition should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SkillsetManagementSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SkillsetManagementSyncTests.java index f438bc2dc09e..dc242fa04c7c 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SkillsetManagementSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SkillsetManagementSyncTests.java @@ -23,7 +23,6 @@ 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.SearchErrorException; import com.azure.search.documents.models.SearchIndexerSkill; import com.azure.search.documents.models.SearchIndexerSkillset; import com.azure.search.documents.models.SentimentSkill; @@ -558,7 +557,7 @@ public void createOrUpdateSkillsetIfNotChangedFailsWhenResourceChanged() { try { client.createOrUpdateSkillsetWithResponse(original, true, null, Context.NONE); fail("createOrUpdateDefinition should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } @@ -578,7 +577,7 @@ public void deleteSkillsetIfNotChangedWorksOnlyOnCurrentResource() { try { client.deleteSkillsetWithResponse(stale, true, null, Context.NONE); fail("deleteFunc should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } @@ -595,7 +594,7 @@ public void deleteSkillsetIfExistsWorksOnlyWhenResourceExists() { try { client.deleteSkillsetWithResponse(skillset, true, null, Context.NONE); fail("deleteFunc should have failed due to non existent resource."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SynonymMapManagementSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SynonymMapManagementSyncTests.java index 91c9e62cb51d..f71abdb7b22c 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SynonymMapManagementSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SynonymMapManagementSyncTests.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; -import com.azure.search.documents.models.SearchErrorException; import com.azure.search.documents.models.SynonymMap; import org.junit.jupiter.api.Test; @@ -250,7 +249,7 @@ public void createOrUpdateSynonymMapIfNotChangedFailsWhenResourceChanged() { try { client.createOrUpdateSynonymMapWithResponse(original, true, null, Context.NONE); fail("createOrUpdateDefinition should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } @@ -343,7 +342,7 @@ public void deleteSynonymMapIfNotChangedWorksOnlyOnCurrentResource() { try { client.deleteSynonymMapWithResponse(stale, true, null, Context.NONE); fail("deleteFunc should have failed due to precondition."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } @@ -361,7 +360,7 @@ public void deleteSynonymMapIfExistsWorksOnlyWhenResourceExists() { try { client.deleteSynonymMapWithResponse(updated, true, null, Context.NONE); fail("deleteFunc should have failed due to non existent resource."); - } catch (SearchErrorException ex) { + } catch (HttpResponseException ex) { assertEquals(HttpURLConnection.HTTP_PRECON_FAILED, ex.getResponse().getStatusCode()); } } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java index 27a0f617ea50..2dfbcbf13dd7 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java @@ -10,7 +10,6 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.search.documents.implementation.SerializationUtil; import com.azure.search.documents.models.RequestOptions; -import com.azure.search.documents.models.SearchErrorException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; @@ -165,7 +164,7 @@ public static void assertHttpResponseExceptionAsync(Publisher exceptionThrowe private static void verifyHttpResponseError(Throwable ex, int statusCode, String expectedMessage) { - assertEquals(SearchErrorException.class, ex.getClass()); + assertEquals(HttpResponseException.class, ex.getClass()); assertEquals(statusCode, ((HttpResponseException) ex).getResponse().getStatusCode()); diff --git a/sdk/search/azure-search-documents/swagger/readme.md b/sdk/search/azure-search-documents/swagger/readme.md index fa485fd38a43..05512c1d2589 100644 --- a/sdk/search/azure-search-documents/swagger/readme.md +++ b/sdk/search/azure-search-documents/swagger/readme.md @@ -50,8 +50,7 @@ java: true input-file: - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Azure.Search/preview/2019-05-06-preview/searchservice.json title: SearchServiceRestClient -custom-types-subpackage: implementation.models -custom-types: AnalyzeResult,ListDataSourcesResult,ListIndexersResult,ListIndexesResult,ListSkillsetsResult,ListSynonymMapsResult +models-subpackage: implementation.models ``` ### Tag: package-2019-05-searchindex-preview @@ -64,8 +63,6 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Azure.Search/preview/2019-05-06-preview/searchindex.json title: SearchIndexRestClient models-subpackage: implementation.models -custom-types: QueryType,AutocompleteResult,AutocompleteOptions,AutocompleteItem,IndexDocumentsResult,IndexingResult,SearchError,SearchErrorException,SearchResult,SearchOptions,RequestOptions,IndexBatchBase,IndexAction,FacetResult,SuggestOptions,SuggestResult -custom-types-subpackage: models ``` ### Tag: package-2019-05-searchservice @@ -140,21 +137,6 @@ directive: .replace(/(this\.client\.getApiVersion\(\)\,)/g, "$1 accept,") .replace(/(public Mono\<(.*)\) \{)/g, "$1\n\t\tfinal String accept \= \"application\/json\;odata\.metadata\=minimal\"\;\n") - # Use Document rather than Map - - from: - - SuggestResult.java - - SearchResult.java - where: $ - transform: >- - return $ - .replace(/(package com.azure.search.documents.models;)/g, "$1\nimport com.azure.search.documents.SearchDocument;") - .replace(/(Map)/g, "SearchDocument") - - # Rename IndexBatch to IndexBatchBase when processing the API spec - - rename-model: - from: IndexBatch - to: IndexBatchBase - # Enable configuration of RestProxy serializer - from: DocumentsImpl.java where: $ @@ -183,24 +165,6 @@ directive: .replace(/(public SearchIndexRestClientImpl\(HttpPipeline httpPipeline\) {)/g, "public SearchIndexRestClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializer) {") .replace(/(this.documents = new DocumentsImpl\(this\);)/g, "this.documents = new DocumentsImpl(this, serializer);") - # Enable serialization of both POJOs and Maps - - from: IndexAction.java - where: $ - transform: >- - return $ - .replace(/(import com.fasterxml.jackson.annotation.JsonProperty;)/g, "import com.fasterxml.jackson.annotation.JsonAnyGetter;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\n$1\nimport com.fasterxml.jackson.annotation.JsonUnwrapped;\n") - .replace(/(class IndexAction)/g, "$1") - .replace(/(Unmatched properties from the message are deserialized this collection)/g, "The document on which the action will be performed.") - .replace(/(@JsonProperty\(value = ""\))/g, "@JsonUnwrapped") - .replace(/(private Map additionalProperties);/g, "private T document;\n\n @JsonIgnore\n private Map properties;\n\n @JsonAnyGetter\n public Map getParamMap() {\n return properties;\n }") - .replace(/(Get the additionalProperties property: Unmatched properties from the\n\s+\* message are deserialized this collection.)/g, "Get the document on which the action will be performed; Fields other than the key are ignored for delete actions.") - .replace(/(@return the additionalProperties value.)/g, "@return the document value.") - .replace(/(public Map getAdditionalProperties\(\) {\s+return this.additionalProperties;\s+})/g, "public T getDocument() {\n return this.document;\n }") - .replace(/(Set the additionalProperties property: Unmatched properties from the\s+\* message are deserialized this collection.)/g, "Get the document on which the action will be performed; Fields other than the key are ignored for delete actions.") - .replace(/(@param additionalProperties the additionalProperties value to set.)/g, "@param document the document value to set.") - .replace(/(public IndexAction setAdditionalProperties\(Map additionalProperties\) {\s+this.additionalProperties = additionalProperties;\s+return this;\s+})/g, "@SuppressWarnings(\"unchecked\")\n public IndexAction setDocument(T document) {\n if (document instanceof Map) {\n this.properties = (Map) document;\n this.document = null;\n } else {\n this.document = document;\n this.properties = null;\n }\n return this;\n }") - .replace(/(public IndexAction setActionType\(IndexActionType actionType\) {)/g, "public IndexAction setActionType(IndexActionType actionType) {") - # Enable configuration of RestProxy serializer - from: SearchIndexRestClientBuilder.java where: $ @@ -210,75 +174,7 @@ directive: .replace(/(\* The HTTP pipeline to send requests through)/g, "\* The serializer to use for requests\n \*\/\n private SerializerAdapter serializer;\n\n \/\*\*\n \* Sets The serializer to use for requests.\n \*\n \* @param serializer the serializer value.\n \* @return the SearchIndexRestClientBuilder.\n \*\/\n public SearchIndexRestClientBuilder serializer\(SerializerAdapter serializer\) {\n this.serializer = serializer;\n return this;\n }\n\n \/\*\n $1") .replace(/(new SearchIndexRestClientImpl\(pipeline)/g, "$1, serializer") .replace(/(this.pipeline = RestProxy.createDefaultPipeline\(\);\s+})/g, "$1\n if \(serializer == null\) {\n this.serializer = JacksonAdapter.createDefaultSerializerAdapter\(\);\n }") - - # Enable IndexBatchBase to be used as a generic type - - from: IndexBatchBase.java - where: $ - transform: >- - return $ - .replace(/(public final class IndexBatchBase)/g, "public class IndexBatchBase") - .replace(/(private List actions;)/g, "private List> actions;") - .replace(/(public List getActions\(\) {)/g, "public List> getActions() {") - .replace(/(public IndexBatchBase setActions\(List actions\) {)/g, "protected IndexBatchBase setActions(List> actions) {") - - # Replace use of generated IndexBatchBase with custom IndexBatch class - - from: DocumentsImpl.java - where: $ - transform: >- - return $ - .replace(/(Mono indexAsync)/g, " $1") - .replace(/(Mono> index)/g, " $1") - .replace(/(IndexBatchBase)/g, "IndexBatchBase") - .replace(/(com\.azure\.search\.documents\.models\.IndexBatchBase\)/g, "com.azure.search.documents.models.IndexBatchBase") - - # Change get to is - - from: DocumentsImpl.java - where: $ - transform: >- - return $ - .replace(/(get(IncludeTotalResultCount))/g, "is$2") - .replace(/isUseFuzzyMatching/g, "useFuzzyMatching") - - # Mark IndexingResult as Serializable, for use in IndexBatchException - - from: IndexingResult.java - where: $ - transform: >- - return $ - .replace(/(import com.fasterxml.jackson.annotation.JsonProperty;)/g, "$1\n\nimport java.io.Serializable;") - .replace(/(class IndexingResult {)/g, "class IndexingResult implements Serializable {\n private static final long serialVersionUID = -8604424005271188140L;") - - - from: - - FacetResult.java - where: $ - transform: >- - return $.replace(/(public FacetResult setAdditionalProperties)/g, "FacetResult setAdditionalProperties") - - # Remove setter for addition properties field, and rename getter - - from: - - SearchResult.java - - SuggestResult.java - where: $ - transform: >- - return $ - .replace(/(getAdditionalProperties)/g, "getDocument") - .replace(/( \/\*\*\n \* Set the additionalProperties property\: Unmatched properties from the\n \* message are deserialized this collection\.\n \*\n \* \@param additionalProperties the additionalProperties value to set\.\n \* \@return the .*Result object itself\.\n \*\/\n public .*Result setAdditionalProperties\(SearchDocument additionalProperties\) \{\n this\.additionalProperties \= additionalProperties\;\n return this\;\n \}\n\n)/g, "") - reason: Provides a better description of the getter/setter for addtionalProperties - - - from: - - SearchResult.java - where: $ - transform: >- - return $ - .replace(/(package com.azure.search.documents.models;)/g, "$1\nimport com.fasterxml.jackson.annotation.JsonIgnore;") - .replace(/(public Document getDocument())/g, "@JsonIgnore\n$1") - - # Add static Collection method to SearchFieldDataType - - from: SearchFieldDataType.java - where: $ - transform: >- - return $ - .replace(/(public static final SearchFieldDataType COMPLEX = fromString\("Edm.ComplexType"\);)/g, "$1\n\n /**\n * Returns a collection of a specific SearchFieldDataType\n * @param dataType the corresponding SearchFieldDataType\n * @return a Collection of the corresponding SearchFieldDataType\n */\n @JsonCreator\n public static SearchFieldDataType collection(SearchFieldDataType dataType) {\n return fromString(String.format(\"Collection(%s)\", dataType.toString()));\n }") - + # Workaround to fix bad host path parameters - from: - SkillsetsImpl.java @@ -300,176 +196,4 @@ directive: where: $ transform: >- return $.replace(/(package com.azure.search.documents.implementation;)/g, "$1\nimport com.azure.core.http.rest.RestProxy;") - - # Rename COSMOS_DB to COSMOS in DataSourceType.java - - from: - - DataSourceType.java - where: $ - transform: >- - return $ - .replace(/(COSMOS_DB)/g, "COSMOS") - - # Remove field and its getter and setter for immutable static field in Suggester - - from: - - Suggester.java - where: $ - transform: >- - return $ - .replace(/ \/\*\*\n \* Get the searchMode property\: A value indicating the capabilities of the\n \* suggester\.\n \*\n \* \@return the searchMode value\.\n \*\/\n public String getSearchMode\(\) \{\n return this\.searchMode\;\n \}\n\n/g, "") - .replace(/ \/\*\*\n \* Set the searchMode property\: A value indicating the capabilities of the\n \* suggester\.\n \*\n \* \@param searchMode the searchMode value to set\.\n \* \@return the Suggester object itself\.\n \*\/\n public Suggester setSearchMode\(String searchMode\) \{\n this\.searchMode \= searchMode\;\n return this\;\n \}\n\n/g, "") - - # Remove field and its getter and setter for immutable static field in SynonymMap - - from: - - SynonymMap.java - where: $ - transform: >- - return $ - .replace(/ \/\*\*\n \* Get the format property\: The format of the synonym map\. Only the \'solr\'\n \* format is currently supported\.\n \*\n \* \@return the format value\.\n \*\/\n public String getFormat\(\) \{\n return this\.format\;\n \}\n\n/g, "") - .replace(/ \/\*\*\n \* Set the format property\: The format of the synonym map\. Only the \'solr\'\n \* format is currently supported\.\n \*\n \* \@param format the format value to set\.\n \* \@return the SynonymMap object itself\.\n \*\/\n public SynonymMap setFormat\(String format\) \{\n this\.format \= format\;\n return this\;\n \}\n\n/g, "") - - # Change base class to abstract - - from: - - Analyzer.java - - TokenFilter.java - - Tokenizer.java - - Skill.java - - CharFilter.java - - ScoringFunction.java - - CognitiveServicesAccount.java - - DataChangeDetectionPolicy.java - - DataDeletionDetectionPolicy.java - where: $ - transform: >- - return $.replace(/public class (.*) \{/, "public abstract class $1 {") - - # Changed RegexFlags to List of RegexFlags in PatternAnalyzer and PatterTokenizer - - from: swagger-document - where: $.definitions.PatternAnalyzer.properties.flags - transform: > - if ($['$ref']) { - delete $['$ref']; - $.type = 'array' - $.items = { - "$ref" : "#/definitions/RegexFlags" - } - } - - from: swagger-document - where: $.definitions.PatternTokenizer.properties.flags - transform: > - if ($['$ref']) { - delete $['$ref']; - $.type = 'array' - $.items = { - "$ref" : "#/definitions/RegexFlags" - } - } - - # Added custom serializer and deserializer for PatternAnalyzer and PatternTokenizer - - from: - - PatternTokenizer.java - where: $ - transform: >- - return $ - .replace(/(\@Fluent)/g, "$1\n\@JsonSerialize(using = CustomPatternTokenizerSerializer\.class)\n\@JsonDeserialize(using = CustomPatternTokenizerDeserializer\.class)") - .replace(/(import com\.azure\.core\.annotation\.Fluent\;)/g, "$1\nimport com.azure.search.documents.implementation.util.CustomPatternTokenizerDeserializer;\nimport com.azure.search.documents.implementation.util.CustomPatternTokenizerSerializer;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;") - - - from: - - PatternAnalyzer.java - where: $ - transform: >- - return $ - .replace(/(\@Fluent)/g, "$1\n\@JsonSerialize(using = CustomPatternAnalyzerSerializer\.class)\n\@JsonDeserialize(using = CustomPatternAnalyzerDeserializer\.class)") - .replace(/(import com\.azure\.core\.annotation\.Fluent\;)/g, "$1\nimport com.azure.search.documents.implementation.util.CustomPatternAnalyzerDeserializer;\nimport com.azure.search.documents.implementation.util.CustomPatternAnalyzerSerializer;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;") - - # Changed scoringParamters type from String to ScoringParamters - - from: - - SearchOptions.java - where: $ - transform: >- - return $ - .replace(/(private List\ scoringParameters\;)/g, "private List scoringParameters;") - .replace(/(public List\ getScoringParameters\(\) \{)/g, "public List getScoringParameters() {") - .replace(/(public SearchOptions setScoringParameters\(String\.\.\. scoringParameters\) \{)/g, "public SearchOptions setScoringParameters(ScoringParameter... scoringParameters) {") - - # Changed scoringParamters type from String to ScoringParamters in DocumentsImpl - - from: - - DocumentsImpl.java - where: $ - transform: >- - return $ - .replace(/(import com\.azure\.search\.documents\.models\.RequestOptions\;)/g, "$1\nimport com.azure.search.documents.models.ScoringParameter;") - .replace(/(List\ scoringParameters \= null\;)/g, "List scoringParameters = null;") - .replace() - - # Changed scoringParamters type from String to ScoringParamters in SearchRequest - - from: - - SearchRequest.java - where: $ - transform: >- - return $ - .replace(/(import com\.azure\.search\.documents\.models\.QueryType\;)/g, "$1\nimport com.azure.search.documents.models.ScoringParameter;") - .replace(/(private List\ scoringParameters\;)/g, "private List scoringParameters;") - .replace(/(public List\ getScoringParameters\(\) \{)/g, "public List getScoringParameters() {") - .replace(/(public SearchRequest setScoringParameters\(List\ scoringParameters\) \{)/g, "public SearchRequest setScoringParameters(List scoringParameters) {") - - # Changed the boolean field name - - from: - - MagnitudeScoringParameters.java - where: $ - transform: >- - return $ - .replace(/public Boolean isShouldBoostBeyondRangeByConstant\(\) \{/g, "public Boolean shouldBoostBeyondRangeByConstant() {") - - - from: - - SuggestOptions.java - - AutocompleteOptions.java - - AutocompleteRequest.java - - SuggestRequest.java - where: $ - transform: >- - return $ - .replace(/public Boolean isUseFuzzyMatching\(\) \{/g, "public Boolean useFuzzyMatching() {") - - - from: - - WordDelimiterTokenFilter.java - where: $ - transform: >- - return $ - .replace(/public Boolean isGenerate(.*)\(\) \{/g, "public Boolean generate$1() {") - - - from: - - OcrSkill.java - where: $ - transform: >- - return $ - .replace(/public Boolean isShouldDetectOrientation\(\) \{/g, "public Boolean shouldDetectOrientation() {") - - # Changed isRetrievable to isHidden - - from: swagger-document - where: $.definitions.SearchField.properties - transform: > - $.hidden = $.retrievable; - $.hidden = { - "type": "boolean", - "description": "A value indicating whether the field will be returned in a search result. This property must be false for key fields, and must be null for complex fields. You can hide a field from search results if you want to use it only as a filter, for sorting, or for scoring. This property can also be changed on existing fields and enabling it does not cause an increase in index storage requirements." - } - - - from: SearchField.java - where: $ - transform: >- - return $ - .replace(/(import com\.azure\.core\.annotation\.Fluent\;)/g, "$1\nimport com.fasterxml.jackson.annotation.JsonIgnore;") - .replace(/(public SearchField setRetrievable\(Boolean retrievable\))/g, "private SearchField setRetrievable(Boolean retrievable)") - .replace(/(public Boolean isRetrievable\(\))/g, "private Boolean isRetrievable()") - .replace(/( return this\.hidden\;)/g, " return retrievable == null ? null : !retrievable;") - .replace(/(this\.hidden \= hidden\;)/g, "$1\n retrievable = this.hidden == null ? null : !this.hidden;") - .replace(/( \@JsonProperty\(value \= \"hidden\"\))/g, " @JsonIgnore") - - - from: swagger-document - where: $.parameters - transform: >- - if ($.IfMatchParameter && $.IfNoneMatchParameter) { - delete $.IfMatchParameter["x-ms-parameter-grouping"]; - delete $.IfNoneMatchParameter["x-ms-parameter-grouping"]; - } ``` From b809930454d1fdd929a0cbceb11bfc9f9aca096d Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Tue, 19 May 2020 16:24:21 -0700 Subject: [PATCH 02/19] Make changes to swagger --- .../converters/CharFilterConverter.java | 9 +- .../CognitiveServicesAccountConverter.java | 9 +- .../DataChangeDetectionPolicyConverter.java | 9 +- .../DataDeletionDetectionPolicyConverter.java | 3 +- .../converters/IndexActionConverter.java | 2 +- .../converters/LexicalAnalyzerConverter.java | 19 +- .../converters/LexicalTokenizerConverter.java | 75 ++++---- .../converters/ScoringFunctionConverter.java | 15 +- .../converters/SearchFieldConverter.java | 3 +- .../SearchIndexerSkillConverter.java | 108 ++++++------ .../converters/SearchResultConverter.java | 3 +- .../converters/TokenFilterConverter.java | 165 +++++++++--------- 12 files changed, 212 insertions(+), 208 deletions(-) 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 index 60f4cc1aa079..8be9b90bb6a2 100644 --- 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 @@ -34,13 +34,12 @@ public static CharFilter map(com.azure.search.documents.implementation.models.Ch * {@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.MappingCharFilter) { - return MappingCharFilterConverter.map((com.azure.search.documents.models.MappingCharFilter) obj); - } if (obj instanceof com.azure.search.documents.models.PatternReplaceCharFilter) { return PatternReplaceCharFilterConverter.map((com.azure.search.documents.models.PatternReplaceCharFilter) obj); } - throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, - obj.getClass().getSimpleName()))); + 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/CognitiveServicesAccountConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountConverter.java index 975c94e59eba..d979da8fb5ab 100644 --- 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 @@ -20,12 +20,12 @@ public final class CognitiveServicesAccountConverter { * {@link CognitiveServicesAccount}. Dedicate works to sub class converter. */ public static CognitiveServicesAccount map(com.azure.search.documents.implementation.models.CognitiveServicesAccount obj) { - if (obj instanceof DefaultCognitiveServicesAccount) { - return DefaultCognitiveServicesAccountConverter.map((DefaultCognitiveServicesAccount) 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()))); } @@ -42,7 +42,6 @@ public static com.azure.search.documents.implementation.models.CognitiveServices 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()))); + 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/DataChangeDetectionPolicyConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataChangeDetectionPolicyConverter.java index 4e3c3106bba4..6dfec02ec2af 100644 --- 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 @@ -20,12 +20,12 @@ public final class DataChangeDetectionPolicyConverter { * {@link DataChangeDetectionPolicy}. Dedicate works to sub class converter. */ public static DataChangeDetectionPolicy map(com.azure.search.documents.implementation.models.DataChangeDetectionPolicy obj) { - if (obj instanceof SqlIntegratedChangeTrackingPolicy) { - return SqlIntegratedChangeTrackingPolicyConverter.map((SqlIntegratedChangeTrackingPolicy) 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()))); } @@ -42,7 +42,6 @@ public static com.azure.search.documents.implementation.models.DataChangeDetecti 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()))); + 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 index c71738df6ad0..e37c22cb2ccf 100644 --- 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 @@ -35,7 +35,6 @@ public static com.azure.search.documents.implementation.models.DataDeletionDetec 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()))); + 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/IndexActionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionConverter.java index 3841633cfbae..6578d475b4d5 100644 --- 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 @@ -54,7 +54,7 @@ public static com.azure.search.documents.implementation.models.IndexAction m T _document = obj.getDocument(); ObjectMapper jsonMapper = new ObjectMapper(); - Map additionalProperties = jsonMapper.convertValue(_document, Map.class); + Map additionalProperties = jsonMapper.convertValue(_document, Map.class); indexAction.setAdditionalProperties(additionalProperties); if (obj.getParamMap() != null) { 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 index 36faeb3e4385..f2d5050739da 100644 --- 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 @@ -22,18 +22,18 @@ public final class LexicalAnalyzerConverter { * {@link LexicalAnalyzer}. Dedicate works to sub class converter. */ public static LexicalAnalyzer map(com.azure.search.documents.implementation.models.LexicalAnalyzer obj) { - if (obj instanceof PatternAnalyzer) { - return PatternAnalyzerConverter.map((PatternAnalyzer) obj); - } if (obj instanceof LuceneStandardAnalyzer) { return LuceneStandardAnalyzerConverter.map((LuceneStandardAnalyzer) obj); } - if (obj instanceof StopAnalyzer) { - return StopAnalyzerConverter.map((StopAnalyzer) 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()))); } @@ -46,16 +46,15 @@ public static com.azure.search.documents.implementation.models.LexicalAnalyzer m 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); } - if (obj instanceof com.azure.search.documents.models.LuceneStandardAnalyzer) { - return LuceneStandardAnalyzerConverter.map((com.azure.search.documents.models.LuceneStandardAnalyzer) obj); - } - throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, - obj.getClass().getSimpleName()))); + 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/LexicalTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerConverter.java index b44f45b7045a..1121cc044132 100644 --- 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 @@ -30,41 +30,41 @@ public final class LexicalTokenizerConverter { * {@link LexicalTokenizer}. Dedicate works to sub class converter. */ public static LexicalTokenizer map(com.azure.search.documents.implementation.models.LexicalTokenizer obj) { - if (obj instanceof LuceneStandardTokenizerV2) { - return LuceneStandardTokenizerV2Converter.map((LuceneStandardTokenizerV2) obj); - } - if (obj instanceof MicrosoftLanguageTokenizer) { - return MicrosoftLanguageTokenizerConverter.map((MicrosoftLanguageTokenizer) obj); - } - if (obj instanceof KeywordTokenizer) { - return KeywordTokenizerConverter.map((KeywordTokenizer) obj); + if (obj instanceof PatternTokenizer) { + return PatternTokenizerConverter.map((PatternTokenizer) obj); } if (obj instanceof NGramTokenizer) { return NGramTokenizerConverter.map((NGramTokenizer) obj); } - if (obj instanceof ClassicTokenizer) { - return ClassicTokenizerConverter.map((ClassicTokenizer) obj); + if (obj instanceof LuceneStandardTokenizer) { + return LuceneStandardTokenizerConverter.map((LuceneStandardTokenizer) obj); } if (obj instanceof PathHierarchyTokenizerV2) { return PathHierarchyTokenizerV2Converter.map((PathHierarchyTokenizerV2) obj); } - if (obj instanceof UaxUrlEmailTokenizer) { - return UaxUrlEmailTokenizerConverter.map((UaxUrlEmailTokenizer) obj); + if (obj instanceof ClassicTokenizer) { + return ClassicTokenizerConverter.map((ClassicTokenizer) obj); } - if (obj instanceof PatternTokenizer) { - return PatternTokenizerConverter.map((PatternTokenizer) obj); + if (obj instanceof KeywordTokenizer) { + return KeywordTokenizerConverter.map((KeywordTokenizer) obj); } - if (obj instanceof MicrosoftLanguageStemmingTokenizer) { - return MicrosoftLanguageStemmingTokenizerConverter.map((MicrosoftLanguageStemmingTokenizer) 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 LuceneStandardTokenizer) { - return LuceneStandardTokenizerConverter.map((LuceneStandardTokenizer) obj); + if (obj instanceof MicrosoftLanguageStemmingTokenizer) { + return MicrosoftLanguageStemmingTokenizerConverter.map((MicrosoftLanguageStemmingTokenizer) obj); } throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG, obj.getClass().getSimpleName()))); @@ -75,43 +75,42 @@ public static LexicalTokenizer map(com.azure.search.documents.implementation.mod * {@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.MicrosoftLanguageStemmingTokenizer) { - return MicrosoftLanguageStemmingTokenizerConverter.map((com.azure.search.documents.models.MicrosoftLanguageStemmingTokenizer) 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.NGramTokenizer) { - return NGramTokenizerConverter.map((com.azure.search.documents.models.NGramTokenizer) 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.PatternTokenizer) { - return PatternTokenizerConverter.map((com.azure.search.documents.models.PatternTokenizer) 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.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.LuceneStandardTokenizerV2) { - return LuceneStandardTokenizerV2Converter.map((com.azure.search.documents.models.LuceneStandardTokenizerV2) 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.KeywordTokenizer) { - return KeywordTokenizerConverter.map((com.azure.search.documents.models.KeywordTokenizer) obj); - } if (obj instanceof com.azure.search.documents.models.PathHierarchyTokenizerV2) { return PathHierarchyTokenizerV2Converter.map((com.azure.search.documents.models.PathHierarchyTokenizerV2) obj); } - throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, - obj.getClass().getSimpleName()))); + 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/ScoringFunctionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionConverter.java index f469c67bb0ee..81280cae7102 100644 --- 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 @@ -22,12 +22,12 @@ public final class ScoringFunctionConverter { * {@link ScoringFunction}. Dedicate works to sub class converter. */ public static ScoringFunction map(com.azure.search.documents.implementation.models.ScoringFunction obj) { - if (obj instanceof MagnitudeScoringFunction) { - return MagnitudeScoringFunctionConverter.map((MagnitudeScoringFunction) 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); } @@ -49,13 +49,12 @@ public static com.azure.search.documents.implementation.models.ScoringFunction m 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.DistanceScoringFunction) { - return DistanceScoringFunctionConverter.map((com.azure.search.documents.models.DistanceScoringFunction) obj); - } if (obj instanceof com.azure.search.documents.models.FreshnessScoringFunction) { return FreshnessScoringFunctionConverter.map((com.azure.search.documents.models.FreshnessScoringFunction) obj); } - throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, - obj.getClass().getSimpleName()))); + 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/SearchFieldConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldConverter.java index 07d93a6af966..c5ad9d17ee5b 100644 --- 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 @@ -137,7 +137,8 @@ public static com.azure.search.documents.implementation.models.SearchField map(S } if (obj.getFields() != null) { - List _fields = obj.getFields().stream().map(com.azure.search.documents.implementation.converters.SearchFieldConverter::map).collect(Collectors.toList()); + List _fields = + obj.getFields().stream().map(com.azure.search.documents.implementation.converters.SearchFieldConverter::map).collect(Collectors.toList()); searchField.setFields(_fields); } 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 index 110ffcd9664d..cd71f7014706 100644 --- 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 @@ -4,12 +4,10 @@ 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.InputFieldMappingEntry; 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.OutputFieldMappingEntry; import com.azure.search.documents.implementation.models.SentimentSkill; import com.azure.search.documents.implementation.models.ShaperSkill; import com.azure.search.documents.implementation.models.SplitSkill; @@ -17,10 +15,8 @@ import com.azure.search.documents.implementation.models.WebApiSkill; import com.azure.search.documents.models.SearchIndexerSkill; -import java.util.List; -import java.util.stream.Collectors; - 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 @@ -34,77 +30,91 @@ public final class SearchIndexerSkillConverter { * {@link SearchIndexerSkill}. Dedicate works to sub class converter. */ public static SearchIndexerSkill map(com.azure.search.documents.implementation.models.SearchIndexerSkill obj) { - if (obj instanceof SplitSkill) { - return SplitSkillConverter.map((SplitSkill) 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 MergeSkill) { - return MergeSkillConverter.map((MergeSkill) 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 OcrSkill) { - return OcrSkillConverter.map((OcrSkill) obj); - } if (obj instanceof ShaperSkill) { return ShaperSkillConverter.map((ShaperSkill) obj); } - if (obj instanceof EntityRecognitionSkill) { - return EntityRecognitionSkillConverter.map((EntityRecognitionSkill) obj); + if (obj instanceof KeyPhraseExtractionSkill) { + return KeyPhraseExtractionSkillConverter.map((KeyPhraseExtractionSkill) obj); } - if (obj instanceof WebApiSkill) { - return WebApiSkillConverter.map((WebApiSkill) obj); + if (obj instanceof MergeSkill) { + return MergeSkillConverter.map((MergeSkill) obj); } - if (obj instanceof ConditionalSkill) { - return ConditionalSkillConverter.map((ConditionalSkill) obj); + if (obj instanceof SplitSkill) { + return SplitSkillConverter.map((SplitSkill) obj); } - if (obj instanceof KeyPhraseExtractionSkill) { - return KeyPhraseExtractionSkillConverter.map((KeyPhraseExtractionSkill) obj); + if (obj instanceof WebApiSkill) { + return WebApiSkillConverter.map((WebApiSkill) obj); } - if (obj instanceof TextTranslationSkill) { - return TextTranslationSkillConverter.map((TextTranslationSkill) 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 from {@link SearchIndexerSkill} to - * {@link com.azure.search.documents.implementation.models.SearchIndexerSkill}. + * 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 == null) { - return null; + if (obj instanceof com.azure.search.documents.models.LanguageDetectionSkill) { + return LanguageDetectionSkillConverter.map((com.azure.search.documents.models.LanguageDetectionSkill) obj); } - com.azure.search.documents.implementation.models.SearchIndexerSkill searchIndexerSkill = - new com.azure.search.documents.implementation.models.SearchIndexerSkill(); - - if (obj.getOutputs() != null) { - List _outputs = - obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - searchIndexerSkill.setOutputs(_outputs); + if (obj instanceof com.azure.search.documents.models.WebApiSkill) { + return WebApiSkillConverter.map((com.azure.search.documents.models.WebApiSkill) obj); } - - if (obj.getInputs() != null) { - List _inputs = - obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - searchIndexerSkill.setInputs(_inputs); + if (obj instanceof com.azure.search.documents.models.OcrSkill) { + return OcrSkillConverter.map((com.azure.search.documents.models.OcrSkill) obj); } - - String _name = obj.getName(); - searchIndexerSkill.setName(_name); - - String _context = obj.getContext(); - searchIndexerSkill.setContext(_context); - - String _description = obj.getDescription(); - searchIndexerSkill.setDescription(_description); - return searchIndexerSkill; + 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 SearchIndexerSkill) { + return SearchIndexerSkillConverter.map(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/SearchResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResultConverter.java index 7767f91ced67..bc062e85e63d 100644 --- 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 @@ -29,7 +29,8 @@ public static SearchResult map(com.azure.search.documents.implementation.models. if (obj.getHighlights() != null) { Map> _highlights = - obj.getHighlights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + obj.getHighlights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, + Map.Entry::getValue)); PrivateFieldAccessHelper.set(searchResult, "highlights", _highlights); } 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 index dc4232cda2c3..1e632ae5c039 100644 --- 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 @@ -42,74 +42,65 @@ public final class TokenFilterConverter { * {@link TokenFilter}. Dedicate works to sub class converter. */ public static TokenFilter map(com.azure.search.documents.implementation.models.TokenFilter obj) { - if (obj instanceof SnowballTokenFilter) { - return SnowballTokenFilterConverter.map((SnowballTokenFilter) obj); + if (obj instanceof CommonGramTokenFilter) { + return CommonGramTokenFilterConverter.map((CommonGramTokenFilter) obj); } - if (obj instanceof CjkBigramTokenFilter) { - return CjkBigramTokenFilterConverter.map((CjkBigramTokenFilter) 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 StemmerTokenFilter) { - return StemmerTokenFilterConverter.map((StemmerTokenFilter) obj); + if (obj instanceof UniqueTokenFilter) { + return UniqueTokenFilterConverter.map((UniqueTokenFilter) obj); } - if (obj instanceof StemmerOverrideTokenFilter) { - return StemmerOverrideTokenFilterConverter.map((StemmerOverrideTokenFilter) 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 PatternReplaceTokenFilter) { - return PatternReplaceTokenFilterConverter.map((PatternReplaceTokenFilter) obj); - } if (obj instanceof PatternCaptureTokenFilter) { return PatternCaptureTokenFilterConverter.map((PatternCaptureTokenFilter) obj); } - if (obj instanceof LimitTokenFilter) { - return LimitTokenFilterConverter.map((LimitTokenFilter) obj); - } - if (obj instanceof StopwordsTokenFilter) { - return StopwordsTokenFilterConverter.map((StopwordsTokenFilter) obj); - } if (obj instanceof NGramTokenFilterV2) { return NGramTokenFilterV2Converter.map((NGramTokenFilterV2) obj); } - if (obj instanceof KeywordMarkerTokenFilter) { - return KeywordMarkerTokenFilterConverter.map((KeywordMarkerTokenFilter) obj); - } - if (obj instanceof DictionaryDecompounderTokenFilter) { - return DictionaryDecompounderTokenFilterConverter.map((DictionaryDecompounderTokenFilter) obj); - } - if (obj instanceof TruncateTokenFilter) { - return TruncateTokenFilterConverter.map((TruncateTokenFilter) obj); - } - if (obj instanceof ElisionTokenFilter) { - return ElisionTokenFilterConverter.map((ElisionTokenFilter) obj); - } - if (obj instanceof KeepTokenFilter) { - return KeepTokenFilterConverter.map((KeepTokenFilter) obj); + if (obj instanceof PatternReplaceTokenFilter) { + return PatternReplaceTokenFilterConverter.map((PatternReplaceTokenFilter) obj); } - if (obj instanceof CommonGramTokenFilter) { - return CommonGramTokenFilterConverter.map((CommonGramTokenFilter) obj); + if (obj instanceof NGramTokenFilter) { + return NGramTokenFilterConverter.map((NGramTokenFilter) obj); } if (obj instanceof ShingleTokenFilter) { return ShingleTokenFilterConverter.map((ShingleTokenFilter) obj); } - if (obj instanceof WordDelimiterTokenFilter) { - return WordDelimiterTokenFilterConverter.map((WordDelimiterTokenFilter) obj); + if (obj instanceof LimitTokenFilter) { + return LimitTokenFilterConverter.map((LimitTokenFilter) obj); } if (obj instanceof PhoneticTokenFilter) { return PhoneticTokenFilterConverter.map((PhoneticTokenFilter) obj); } - if (obj instanceof NGramTokenFilter) { - return NGramTokenFilterConverter.map((NGramTokenFilter) obj); + if (obj instanceof StopwordsTokenFilter) { + return StopwordsTokenFilterConverter.map((StopwordsTokenFilter) obj); } - if (obj instanceof UniqueTokenFilter) { - return UniqueTokenFilterConverter.map((UniqueTokenFilter) obj); + if (obj instanceof WordDelimiterTokenFilter) { + return WordDelimiterTokenFilterConverter.map((WordDelimiterTokenFilter) obj); } - if (obj instanceof SynonymTokenFilter) { - return SynonymTokenFilterConverter.map((SynonymTokenFilter) obj); + if (obj instanceof SnowballTokenFilter) { + return SnowballTokenFilterConverter.map((SnowballTokenFilter) obj); } if (obj instanceof AsciiFoldingTokenFilter) { return AsciiFoldingTokenFilterConverter.map((AsciiFoldingTokenFilter) obj); @@ -117,6 +108,15 @@ public static TokenFilter map(com.azure.search.documents.implementation.models.T 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()))); } @@ -126,82 +126,81 @@ public static TokenFilter map(com.azure.search.documents.implementation.models.T * {@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.CommonGramTokenFilter) { - return CommonGramTokenFilterConverter.map((com.azure.search.documents.models.CommonGramTokenFilter) 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.NGramTokenFilterV2) { - return NGramTokenFilterV2Converter.map((com.azure.search.documents.models.NGramTokenFilterV2) 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.StemmerOverrideTokenFilter) { - return StemmerOverrideTokenFilterConverter.map((com.azure.search.documents.models.StemmerOverrideTokenFilter) 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.WordDelimiterTokenFilter) { - return WordDelimiterTokenFilterConverter.map((com.azure.search.documents.models.WordDelimiterTokenFilter) 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.SynonymTokenFilter) { - return SynonymTokenFilterConverter.map((com.azure.search.documents.models.SynonymTokenFilter) 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.SnowballTokenFilter) { - return SnowballTokenFilterConverter.map((com.azure.search.documents.models.SnowballTokenFilter) 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.LengthTokenFilter) { - return LengthTokenFilterConverter.map((com.azure.search.documents.models.LengthTokenFilter) 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.EdgeNGramTokenFilterV2) { - return EdgeNGramTokenFilterV2Converter.map((com.azure.search.documents.models.EdgeNGramTokenFilterV2) 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.TruncateTokenFilter) { - return TruncateTokenFilterConverter.map((com.azure.search.documents.models.TruncateTokenFilter) 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.ShingleTokenFilter) { - return ShingleTokenFilterConverter.map((com.azure.search.documents.models.ShingleTokenFilter) 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.UniqueTokenFilter) { - return UniqueTokenFilterConverter.map((com.azure.search.documents.models.UniqueTokenFilter) 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.CjkBigramTokenFilter) { - return CjkBigramTokenFilterConverter.map((com.azure.search.documents.models.CjkBigramTokenFilter) 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.WordDelimiterTokenFilter) { + return WordDelimiterTokenFilterConverter.map((com.azure.search.documents.models.WordDelimiterTokenFilter) 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.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.StemmerTokenFilter) { - return StemmerTokenFilterConverter.map((com.azure.search.documents.models.StemmerTokenFilter) 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.PhoneticTokenFilter) { - return PhoneticTokenFilterConverter.map((com.azure.search.documents.models.PhoneticTokenFilter) 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.DictionaryDecompounderTokenFilter) { - return DictionaryDecompounderTokenFilterConverter.map((com.azure.search.documents.models.DictionaryDecompounderTokenFilter) 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName()))); } } From 72a739d38b2b45d144c5d3299f1d8d92741334b0 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Tue, 19 May 2020 16:41:37 -0700 Subject: [PATCH 03/19] Remove extra ones --- .../implementation/converters/SearchIndexerSkillConverter.java | 3 --- 1 file changed, 3 deletions(-) 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 index cd71f7014706..70abf22e28b1 100644 --- 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 @@ -109,9 +109,6 @@ public static com.azure.search.documents.implementation.models.SearchIndexerSkil if (obj instanceof com.azure.search.documents.models.ShaperSkill) { return ShaperSkillConverter.map((com.azure.search.documents.models.ShaperSkill) obj); } - if (obj instanceof SearchIndexerSkill) { - return SearchIndexerSkillConverter.map(obj); - } if (obj instanceof com.azure.search.documents.models.MergeSkill) { return MergeSkillConverter.map((com.azure.search.documents.models.MergeSkill) obj); } From b49a1f6cf72b274fcace196bc520b7cdab3dd1e4 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Tue, 19 May 2020 17:02:38 -0700 Subject: [PATCH 04/19] Fixed the split dimiliter --- .../converters/PatternAnalyzerConverter.java | 7 +++---- .../converters/PatternTokenizerConverter.java | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) 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 index 0894661c7586..7837286a208a 100644 --- 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 @@ -15,7 +15,6 @@ */ public final class PatternAnalyzerConverter { private static final ClientLogger LOGGER = new ClientLogger(PatternAnalyzerConverter.class); - private static final String DELIMITER = "\\|"; /** * Maps from {@link com.azure.search.documents.implementation.models.PatternAnalyzer} to {@link PatternAnalyzer}. @@ -37,7 +36,7 @@ public static PatternAnalyzer map(com.azure.search.documents.implementation.mode if (obj.getFlags() != null) { List regexFlags = - Arrays.stream(obj.getFlags().toString().split(DELIMITER)).map(RegexFlags::fromString).collect(Collectors.toList()); + Arrays.stream(obj.getFlags().toString().split("\\|")).map(RegexFlags::fromString).collect(Collectors.toList()); patternAnalyzer.setFlags(regexFlags); } @@ -69,12 +68,12 @@ public static com.azure.search.documents.implementation.models.PatternAnalyzer m if (obj.getFlags() != null) { String flattenFlags = - obj.getFlags().stream().map(RegexFlags::toString).collect(Collectors.joining(DELIMITER)); + 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 = obj.getStopwords().stream().collect(Collectors.toList()); + 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/PatternTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java index 96cb375e08cc..4fe518a661ae 100644 --- 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 @@ -14,7 +14,6 @@ */ public final class PatternTokenizerConverter { private static final ClientLogger LOGGER = new ClientLogger(PatternTokenizerConverter.class); - private static final String DELIMITER = "\\|"; /** * Maps from {@link com.azure.search.documents.implementation.models.PatternTokenizer} to {@link PatternTokenizer}. @@ -33,7 +32,7 @@ public static PatternTokenizer map(com.azure.search.documents.implementation.mod if (obj.getFlags() != null) { List regexFlags = - Arrays.stream(obj.getFlags().toString().split(DELIMITER)).map(RegexFlags::fromString).collect(Collectors.toList()); + Arrays.stream(obj.getFlags().toString().split("\\|")).map(RegexFlags::fromString).collect(Collectors.toList()); patternTokenizer.setFlags(regexFlags); } @@ -60,7 +59,7 @@ public static com.azure.search.documents.implementation.models.PatternTokenizer if (obj.getFlags() != null) { String flattenFlags = - obj.getFlags().stream().map(RegexFlags::toString).collect(Collectors.joining(DELIMITER)); + obj.getFlags().stream().map(RegexFlags::toString).collect(Collectors.joining("|")); patternTokenizer.setFlags(com.azure.search.documents.implementation.models.RegexFlags.fromString(flattenFlags)); } From e7b157f7ce7de0d8e9e2a90590b6d9d4fb1df2c7 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Tue, 19 May 2020 18:56:39 -0700 Subject: [PATCH 05/19] Fixed for the Generic types --- .../implementation/converters/IndexActionConverter.java | 9 +++++++-- .../java/com/azure/search/documents/TestHelpers.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) 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 index 6578d475b4d5..529dc1e26407 100644 --- 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 @@ -1,6 +1,8 @@ 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; @@ -53,8 +55,11 @@ public static com.azure.search.documents.implementation.models.IndexAction m } T _document = obj.getDocument(); - ObjectMapper jsonMapper = new ObjectMapper(); - Map additionalProperties = jsonMapper.convertValue(_document, Map.class); + + ObjectMapper mapper = new JacksonAdapter().serializer(); + SerializationUtil.configureMapper(mapper); + Map additionalProperties = mapper.convertValue(_document, Map.class); + indexAction.setAdditionalProperties(additionalProperties); if (obj.getParamMap() != null) { diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java index 2dfbcbf13dd7..941f4592f359 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java @@ -179,7 +179,7 @@ public static RequestOptions generateRequestOptions() { public static void waitForIndexing() { // Wait 2 seconds to allow index request to finish. - sleepIfRunningAgainstService(2000); + sleepIfRunningAgainstService(3000); } public static void sleepIfRunningAgainstService(long millis) { From e378717abeaec1684c963e718779ac2c28c70307 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Wed, 20 May 2020 09:20:04 -0700 Subject: [PATCH 06/19] Fix JsonAnyGetter --- .../documents/implementation/models/IndexAction.java | 1 + sdk/search/azure-search-documents/swagger/readme.md | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java index 25047ed18f29..e851f0d12a3c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java @@ -34,6 +34,7 @@ public final class IndexAction { * * @return the additionalProperties value. */ + @JsonAnyGetter public Map getAdditionalProperties() { return this.additionalProperties; } diff --git a/sdk/search/azure-search-documents/swagger/readme.md b/sdk/search/azure-search-documents/swagger/readme.md index 05512c1d2589..49bfad65020b 100644 --- a/sdk/search/azure-search-documents/swagger/readme.md +++ b/sdk/search/azure-search-documents/swagger/readme.md @@ -196,4 +196,11 @@ directive: where: $ transform: >- return $.replace(/(package com.azure.search.documents.implementation;)/g, "$1\nimport com.azure.core.http.rest.RestProxy;") + + # Add @JsonAnyGetter for IndexAction.java + - from: IndexAction.java + where: $ + transform: >- + return $ + .replace(/( public Map\ getAdditionalProperties\(\) \{)/g, " @JsonAnyGetter\n$1") ``` From b4d8e5e19f2a2f66e711db4738018bee4e1491b6 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Wed, 20 May 2020 09:46:34 -0700 Subject: [PATCH 07/19] Added jsonanygetter imports --- .../converters/AutocompleteOptionsConverter.java | 5 +++-- .../converters/CommonGramTokenFilterConverter.java | 5 +++-- .../implementation/converters/CorsOptionsConverter.java | 5 +++-- .../DictionaryDecompounderTokenFilterConverter.java | 5 +++-- .../converters/ElisionTokenFilterConverter.java | 5 +++-- .../implementation/converters/FacetResultConverter.java | 8 ++++---- .../converters/FieldMappingFunctionConverter.java | 6 ++++-- .../converters/IndexingParametersConverter.java | 8 ++++---- .../converters/KeepTokenFilterConverter.java | 5 +++-- .../converters/KeywordMarkerTokenFilterConverter.java | 5 +++-- .../converters/LuceneStandardAnalyzerConverter.java | 5 +++-- .../converters/MappingCharFilterConverter.java | 5 +++-- .../converters/PatternCaptureTokenFilterConverter.java | 5 +++-- .../implementation/converters/SearchFieldConverter.java | 2 +- .../implementation/converters/SearchResultConverter.java | 3 ++- .../converters/StemmerOverrideTokenFilterConverter.java | 5 +++-- .../implementation/converters/StopAnalyzerConverter.java | 5 +++-- .../converters/StopwordsTokenFilterConverter.java | 5 +++-- .../converters/SynonymTokenFilterConverter.java | 5 +++-- .../implementation/converters/TextWeightsConverter.java | 6 ++++-- .../implementation/converters/WebApiSkillConverter.java | 5 +++-- .../documents/implementation/models/IndexAction.java | 1 + sdk/search/azure-search-documents/swagger/readme.md | 1 + 23 files changed, 66 insertions(+), 44 deletions(-) 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 index ca8f13a33ed2..7d26feb6ddd2 100644 --- 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 @@ -5,6 +5,7 @@ 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; @@ -46,7 +47,7 @@ public static AutocompleteOptions map(com.azure.search.documents.implementation. autocompleteOptions.setHighlightPostTag(_highlightPostTag); if (obj.getSearchFields() != null) { - List _searchFields = obj.getSearchFields().stream().collect(Collectors.toList()); + List _searchFields = new ArrayList<>(obj.getSearchFields()); PrivateFieldAccessHelper.set(autocompleteOptions, "searchFields", _searchFields); } @@ -88,7 +89,7 @@ public static com.azure.search.documents.implementation.models.AutocompleteOptio autocompleteOptions.setHighlightPostTag(_highlightPostTag); if (obj.getSearchFields() != null) { - List _searchFields = obj.getSearchFields().stream().collect(Collectors.toList()); + List _searchFields = new ArrayList<>(obj.getSearchFields()); PrivateFieldAccessHelper.set(autocompleteOptions, "searchFields", _searchFields); } 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 index 27635901c704..56bd1cb0fe36 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -33,7 +34,7 @@ public static CommonGramTokenFilter map(com.azure.search.documents.implementatio commonGramTokenFilter.setUseQueryMode(_useQueryMode); if (obj.getCommonWords() != null) { - List _commonWords = obj.getCommonWords().stream().collect(Collectors.toList()); + List _commonWords = new ArrayList<>(obj.getCommonWords()); commonGramTokenFilter.setCommonWords(_commonWords); } return commonGramTokenFilter; @@ -60,7 +61,7 @@ public static com.azure.search.documents.implementation.models.CommonGramTokenFi commonGramTokenFilter.setUseQueryMode(_useQueryMode); if (obj.getCommonWords() != null) { - List _commonWords = obj.getCommonWords().stream().collect(Collectors.toList()); + 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/CorsOptionsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CorsOptionsConverter.java index 0b206fe82210..7f34c30e1bec 100644 --- 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 @@ -4,6 +4,7 @@ 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; @@ -23,7 +24,7 @@ public static CorsOptions map(com.azure.search.documents.implementation.models.C CorsOptions corsOptions = new CorsOptions(); if (obj.getAllowedOrigins() != null) { - List _allowedOrigins = obj.getAllowedOrigins().stream().collect(Collectors.toList()); + List _allowedOrigins = new ArrayList<>(obj.getAllowedOrigins()); PrivateFieldAccessHelper.set(corsOptions, "allowedOrigins", _allowedOrigins); } @@ -43,7 +44,7 @@ public static com.azure.search.documents.implementation.models.CorsOptions map(C new com.azure.search.documents.implementation.models.CorsOptions(); if (obj.getAllowedOrigins() != null) { - List _allowedOrigins = obj.getAllowedOrigins().stream().collect(Collectors.toList()); + List _allowedOrigins = new ArrayList<>(obj.getAllowedOrigins()); PrivateFieldAccessHelper.set(corsOptions, "allowedOrigins", _allowedOrigins); } 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 index f3b0ee1fafa7..e8ea5ba9dabe 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -36,7 +37,7 @@ public static DictionaryDecompounderTokenFilter map(com.azure.search.documents.i dictionaryDecompounderTokenFilter.setMaxSubwordSize(_maxSubwordSize); if (obj.getWordList() != null) { - List _wordList = obj.getWordList().stream().collect(Collectors.toList()); + List _wordList = new ArrayList<>(obj.getWordList()); dictionaryDecompounderTokenFilter.setWordList(_wordList); } @@ -68,7 +69,7 @@ public static com.azure.search.documents.implementation.models.DictionaryDecompo dictionaryDecompounderTokenFilter.setMaxSubwordSize(_maxSubwordSize); if (obj.getWordList() != null) { - List _wordList = obj.getWordList().stream().collect(Collectors.toList()); + List _wordList = new ArrayList<>(obj.getWordList()); dictionaryDecompounderTokenFilter.setWordList(_wordList); } 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 index 4b8dea33f246..35e488f4569a 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -27,7 +28,7 @@ public static ElisionTokenFilter map(com.azure.search.documents.implementation.m elisionTokenFilter.setName(_name); if (obj.getArticles() != null) { - List _articles = obj.getArticles().stream().collect(Collectors.toList()); + List _articles = new ArrayList<>(obj.getArticles()); elisionTokenFilter.setArticles(_articles); } return elisionTokenFilter; @@ -48,7 +49,7 @@ public static com.azure.search.documents.implementation.models.ElisionTokenFilte elisionTokenFilter.setName(_name); if (obj.getArticles() != null) { - List _articles = obj.getArticles().stream().collect(Collectors.toList()); + 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/FacetResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FacetResultConverter.java index e4c9977c45fc..02e38e314277 100644 --- 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 @@ -27,8 +27,8 @@ public static FacetResult map(com.azure.search.documents.implementation.models.F if (obj.getAdditionalProperties() != null) { Map _additionalProperties = - obj.getAdditionalProperties().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), - e -> e.getValue())); + obj.getAdditionalProperties().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, + Map.Entry::getValue)); PrivateFieldAccessHelper.set(facetResult, "additionalProperties", _additionalProperties); } return facetResult; @@ -49,8 +49,8 @@ public static com.azure.search.documents.implementation.models.FacetResult map(F if (obj.getAdditionalProperties() != null) { Map _additionalProperties = - obj.getAdditionalProperties().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), - e -> e.getValue())); + 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/FieldMappingFunctionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingFunctionConverter.java index 6294d9aa0edd..e6e2220ad427 100644 --- 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 @@ -28,7 +28,8 @@ public static FieldMappingFunction map(com.azure.search.documents.implementation if (obj.getParameters() != null) { Map _parameters = - obj.getParameters().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); + obj.getParameters().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, + Map.Entry::getValue)); fieldMappingFunction.setParameters(_parameters); } return fieldMappingFunction; @@ -50,7 +51,8 @@ public static com.azure.search.documents.implementation.models.FieldMappingFunct if (obj.getParameters() != null) { Map _parameters = - obj.getParameters().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); + 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/IndexingParametersConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingParametersConverter.java index 35b7007e83fe..8155962a92be 100644 --- 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 @@ -31,8 +31,8 @@ public static IndexingParameters map(com.azure.search.documents.implementation.m if (obj.getConfiguration() != null) { Map _configuration = - obj.getConfiguration().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), - e -> e.getValue())); + obj.getConfiguration().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, + Map.Entry::getValue)); indexingParameters.setConfiguration(_configuration); } @@ -60,8 +60,8 @@ public static com.azure.search.documents.implementation.models.IndexingParameter if (obj.getConfiguration() != null) { Map _configuration = - obj.getConfiguration().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), - e -> e.getValue())); + obj.getConfiguration().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, + Map.Entry::getValue)); indexingParameters.setConfiguration(_configuration); } 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 index d181845cb10c..09ff3775c49f 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -26,7 +27,7 @@ public static KeepTokenFilter map(com.azure.search.documents.implementation.mode keepTokenFilter.setName(_name); if (obj.getKeepWords() != null) { - List _keepWords = obj.getKeepWords().stream().collect(Collectors.toList()); + List _keepWords = new ArrayList<>(obj.getKeepWords()); keepTokenFilter.setKeepWords(_keepWords); } @@ -49,7 +50,7 @@ public static com.azure.search.documents.implementation.models.KeepTokenFilter m keepTokenFilter.setName(_name); if (obj.getKeepWords() != null) { - List _keepWords = obj.getKeepWords().stream().collect(Collectors.toList()); + List _keepWords = new ArrayList<>(obj.getKeepWords()); keepTokenFilter.setKeepWords(_keepWords); } 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 index 79a5c40dc9b4..33620389fdfb 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -27,7 +28,7 @@ public static KeywordMarkerTokenFilter map(com.azure.search.documents.implementa keywordMarkerTokenFilter.setName(_name); if (obj.getKeywords() != null) { - List _keywords = obj.getKeywords().stream().collect(Collectors.toList()); + List _keywords = new ArrayList<>(obj.getKeywords()); keywordMarkerTokenFilter.setKeywords(_keywords); } @@ -51,7 +52,7 @@ public static com.azure.search.documents.implementation.models.KeywordMarkerToke keywordMarkerTokenFilter.setName(_name); if (obj.getKeywords() != null) { - List _keywords = obj.getKeywords().stream().collect(Collectors.toList()); + List _keywords = new ArrayList<>(obj.getKeywords()); keywordMarkerTokenFilter.setKeywords(_keywords); } 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 index cc23617c6fe5..8701aeae7edd 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -30,7 +31,7 @@ public static LuceneStandardAnalyzer map(com.azure.search.documents.implementati luceneStandardAnalyzer.setMaxTokenLength(_maxTokenLength); if (obj.getStopwords() != null) { - List _stopwords = obj.getStopwords().stream().collect(Collectors.toList()); + List _stopwords = new ArrayList<>(obj.getStopwords()); luceneStandardAnalyzer.setStopwords(_stopwords); } return luceneStandardAnalyzer; @@ -54,7 +55,7 @@ public static com.azure.search.documents.implementation.models.LuceneStandardAna luceneStandardAnalyzer.setMaxTokenLength(_maxTokenLength); if (obj.getStopwords() != null) { - List _stopwords = obj.getStopwords().stream().collect(Collectors.toList()); + 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/MappingCharFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MappingCharFilterConverter.java index 1813fea6ac0f..7f93173d6234 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -27,7 +28,7 @@ public static MappingCharFilter map(com.azure.search.documents.implementation.mo mappingCharFilter.setName(_name); if (obj.getMappings() != null) { - List _mappings = obj.getMappings().stream().collect(Collectors.toList()); + List _mappings = new ArrayList<>(obj.getMappings()); mappingCharFilter.setMappings(_mappings); } return mappingCharFilter; @@ -48,7 +49,7 @@ public static com.azure.search.documents.implementation.models.MappingCharFilter mappingCharFilter.setName(_name); if (obj.getMappings() != null) { - List _mappings = obj.getMappings().stream().collect(Collectors.toList()); + 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/PatternCaptureTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternCaptureTokenFilterConverter.java index 2be86ab7c20b..4ca861daff60 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -27,7 +28,7 @@ public static PatternCaptureTokenFilter map(com.azure.search.documents.implement patternCaptureTokenFilter.setName(_name); if (obj.getPatterns() != null) { - List _patterns = obj.getPatterns().stream().collect(Collectors.toList()); + List _patterns = new ArrayList<>(obj.getPatterns()); patternCaptureTokenFilter.setPatterns(_patterns); } @@ -51,7 +52,7 @@ public static com.azure.search.documents.implementation.models.PatternCaptureTok patternCaptureTokenFilter.setName(_name); if (obj.getPatterns() != null) { - List _patterns = obj.getPatterns().stream().collect(Collectors.toList()); + List _patterns = new ArrayList<>(obj.getPatterns()); patternCaptureTokenFilter.setPatterns(_patterns); } 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 index c5ad9d17ee5b..1cb69cfb85e5 100644 --- 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 @@ -64,7 +64,7 @@ public static SearchField map(com.azure.search.documents.implementation.models.S searchField.setFacetable(_facetable); if (obj.getSynonymMaps() != null) { - List _synonymMaps = obj.getSynonymMaps().stream().collect(Collectors.toList()); + List _synonymMaps = new ArrayList<>(obj.getSynonymMaps()); searchField.setSynonymMaps(_synonymMaps); } 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 index bc062e85e63d..6fa573accbb2 100644 --- 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 @@ -54,7 +54,8 @@ public static com.azure.search.documents.implementation.models.SearchResult map( if (obj.getHighlights() != null) { Map> _highlights = - obj.getHighlights().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); + obj.getHighlights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, + Map.Entry::getValue)); PrivateFieldAccessHelper.set(searchResult, "highlights", _highlights); } 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 index d5384c226e04..e14cfe8a461e 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -27,7 +28,7 @@ public static StemmerOverrideTokenFilter map(com.azure.search.documents.implemen stemmerOverrideTokenFilter.setName(_name); if (obj.getRules() != null) { - List _rules = obj.getRules().stream().collect(Collectors.toList()); + List _rules = new ArrayList<>(obj.getRules()); stemmerOverrideTokenFilter.setRules(_rules); } return stemmerOverrideTokenFilter; @@ -48,7 +49,7 @@ public static com.azure.search.documents.implementation.models.StemmerOverrideTo stemmerOverrideTokenFilter.setName(_name); if (obj.getRules() != null) { - List _rules = obj.getRules().stream().collect(Collectors.toList()); + 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/StopAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java index b3f960f4f792..6c9336b7e5fd 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -25,7 +26,7 @@ public static StopAnalyzer map(com.azure.search.documents.implementation.models. stopAnalyzer.setName(_name); if (obj.getStopwords() != null) { - List _stopwords = obj.getStopwords().stream().collect(Collectors.toList()); + List _stopwords = new ArrayList<>(obj.getStopwords()); stopAnalyzer.setStopwords(_stopwords); } return stopAnalyzer; @@ -45,7 +46,7 @@ public static com.azure.search.documents.implementation.models.StopAnalyzer map( stopAnalyzer.setName(_name); if (obj.getStopwords() != null) { - List _stopwords = obj.getStopwords().stream().collect(Collectors.toList()); + 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/StopwordsTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsTokenFilterConverter.java index 15d5eba45638..eca2a04c3c7e 100644 --- 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 @@ -4,6 +4,7 @@ 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; @@ -34,7 +35,7 @@ public static StopwordsTokenFilter map(com.azure.search.documents.implementation stopwordsTokenFilter.setIgnoreCase(_ignoreCase); if (obj.getStopwords() != null) { - List _stopwords = obj.getStopwords().stream().collect(Collectors.toList()); + List _stopwords = new ArrayList<>(obj.getStopwords()); stopwordsTokenFilter.setStopwords(_stopwords); } @@ -66,7 +67,7 @@ public static com.azure.search.documents.implementation.models.StopwordsTokenFil stopwordsTokenFilter.setIgnoreCase(_ignoreCase); if (obj.getStopwords() != null) { - List _stopwords = obj.getStopwords().stream().collect(Collectors.toList()); + List _stopwords = new ArrayList<>(obj.getStopwords()); stopwordsTokenFilter.setStopwords(_stopwords); } 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 index 9cd86d8fe762..34358ec82a8b 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -30,7 +31,7 @@ public static SynonymTokenFilter map(com.azure.search.documents.implementation.m synonymTokenFilter.setExpand(_expand); if (obj.getSynonyms() != null) { - List _synonyms = obj.getSynonyms().stream().collect(Collectors.toList()); + List _synonyms = new ArrayList<>(obj.getSynonyms()); synonymTokenFilter.setSynonyms(_synonyms); } @@ -57,7 +58,7 @@ public static com.azure.search.documents.implementation.models.SynonymTokenFilte synonymTokenFilter.setExpand(_expand); if (obj.getSynonyms() != null) { - List _synonyms = obj.getSynonyms().stream().collect(Collectors.toList()); + List _synonyms = new ArrayList<>(obj.getSynonyms()); synonymTokenFilter.setSynonyms(_synonyms); } 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 index 9e1cd2b06392..8bc15745f72b 100644 --- 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 @@ -23,7 +23,8 @@ public static TextWeights map(com.azure.search.documents.implementation.models.T if (obj.getWeights() != null) { Map _weights = - obj.getWeights().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); + obj.getWeights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, + Map.Entry::getValue)); textWeights.setWeights(_weights); } return textWeights; @@ -41,7 +42,8 @@ public static com.azure.search.documents.implementation.models.TextWeights map(T if (obj.getWeights() != null) { Map _weights = - obj.getWeights().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); + 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/WebApiSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WebApiSkillConverter.java index a7dfec1643c3..33a685404d60 100644 --- 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 @@ -48,7 +48,7 @@ public static WebApiSkill map(com.azure.search.documents.implementation.models.W if (obj.getHttpHeaders() != null) { Map _httpHeaders = - obj.getHttpHeaders().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); + obj.getHttpHeaders().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); webApiSkill.setHttpHeaders(_httpHeaders); } @@ -102,7 +102,8 @@ public static com.azure.search.documents.implementation.models.WebApiSkill map(W if (obj.getHttpHeaders() != null) { Map _httpHeaders = - obj.getHttpHeaders().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue())); + obj.getHttpHeaders().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, + Map.Entry::getValue)); webApiSkill.setHttpHeaders(_httpHeaders); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java index e851f0d12a3c..9eed1be8f80a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/IndexAction.java @@ -7,6 +7,7 @@ package com.azure.search.documents.implementation.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; diff --git a/sdk/search/azure-search-documents/swagger/readme.md b/sdk/search/azure-search-documents/swagger/readme.md index 49bfad65020b..3fae913f186b 100644 --- a/sdk/search/azure-search-documents/swagger/readme.md +++ b/sdk/search/azure-search-documents/swagger/readme.md @@ -202,5 +202,6 @@ directive: where: $ transform: >- return $ + .replace(/(import com\.azure\.core\.annotation\.Fluent\;)/g, "$1\nimport com.fasterxml.jackson.annotation.JsonAnyGetter;") .replace(/( public Map\ getAdditionalProperties\(\) \{)/g, " @JsonAnyGetter\n$1") ``` From 13e6e4dd20bad6f36ec9b880d9e239f8e5ff30a5 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Wed, 20 May 2020 10:49:19 -0700 Subject: [PATCH 08/19] Change exports to opens --- .../azure-search-documents/src/main/java/module-info.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/search/azure-search-documents/src/main/java/module-info.java b/sdk/search/azure-search-documents/src/main/java/module-info.java index 6ec082aae98a..05627fa2aa15 100644 --- a/sdk/search/azure-search-documents/src/main/java/module-info.java +++ b/sdk/search/azure-search-documents/src/main/java/module-info.java @@ -9,10 +9,9 @@ opens com.azure.search.documents to com.fasterxml.jackson.databind; opens com.azure.search.documents.models to com.fasterxml.jackson.databind; opens com.azure.search.documents.implementation to com.fasterxml.jackson.databind; - opens com.azure.search.documents.implementation.models to com.fasterxml.jackson.databind; + opens com.azure.search.documents.implementation.models to com.fasterxml.jackson.databind, com.azure.core; + opens com.azure.search.documents.implementation.util to com.fasterxml.jackson.databind; - exports com.azure.search.documents.implementation.util to com.fasterxml.jackson.databind; - exports com.azure.search.documents.implementation.models to com.azure.core; exports com.azure.search.documents; exports com.azure.search.documents.models; exports com.azure.search.documents.util; From c02fe1b33cca84c1bcc61e83acc992832017f279 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Wed, 20 May 2020 11:39:57 -0700 Subject: [PATCH 09/19] Added license headers --- .../checkstyle/checkstyle-suppressions.xml | 9 ++- .../Iso8601DateDeserializer.java | 1 + .../converters/AnalyzeRequestConverter.java | 3 + .../AsciiFoldingTokenFilterConverter.java | 3 + .../converters/AutocompleteItemConverter.java | 3 + .../converters/AutocompleteModeConverter.java | 3 + .../AutocompleteOptionsConverter.java | 3 + .../AutocompleteResultConverter.java | 3 + ...ectoryApplicationCredentialsConverter.java | 3 + .../converters/BM25SimilarityConverter.java | 3 + .../converters/CharFilterConverter.java | 3 + .../converters/CharFilterNameConverter.java | 3 + .../CjkBigramTokenFilterConverter.java | 3 + .../CjkBigramTokenFilterScriptsConverter.java | 3 + .../ClassicSimilarityConverter.java | 3 + .../converters/ClassicTokenizerConverter.java | 3 + .../CognitiveServicesAccountConverter.java | 3 + .../CognitiveServicesAccountKeyConverter.java | 3 + .../CommonGramTokenFilterConverter.java | 3 + .../converters/ConditionalSkillConverter.java | 3 + .../implementation/converters/Constants.java | 3 + .../converters/CorsOptionsConverter.java | 3 + .../converters/CustomAnalyzerConverter.java | 3 + .../DataChangeDetectionPolicyConverter.java | 3 + .../DataDeletionDetectionPolicyConverter.java | 3 + .../DataSourceCredentialsConverter.java | 3 + ...aultCognitiveServicesAccountConverter.java | 3 + ...onaryDecompounderTokenFilterConverter.java | 3 + .../DistanceScoringFunctionConverter.java | 3 + .../DistanceScoringParametersConverter.java | 3 + .../EdgeNGramTokenFilterConverter.java | 3 + .../EdgeNGramTokenFilterSideConverter.java | 3 + .../EdgeNGramTokenFilterV2Converter.java | 3 + .../EdgeNGramTokenizerConverter.java | 3 + .../ElisionTokenFilterConverter.java | 3 + .../converters/EntityCategoryConverter.java | 3 + .../EntityRecognitionSkillConverter.java | 3 + ...tityRecognitionSkillLanguageConverter.java | 3 + .../converters/FacetResultConverter.java | 3 + .../converters/FieldMappingConverter.java | 3 + .../FieldMappingFunctionConverter.java | 3 + .../FreshnessScoringFunctionConverter.java | 3 + .../FreshnessScoringParametersConverter.java | 3 + .../GetIndexStatisticsResultConverter.java | 3 + ...terMarkChangeDetectionPolicyConverter.java | 3 + .../ImageAnalysisSkillConverter.java | 3 + .../ImageAnalysisSkillLanguageConverter.java | 3 + .../converters/ImageDetailConverter.java | 3 + .../converters/IndexActionConverter.java | 3 + .../converters/IndexActionTypeConverter.java | 3 + .../converters/IndexBatchBaseConverter.java | 3 + .../IndexDocumentsResultConverter.java | 3 + .../IndexerExecutionResultConverter.java | 3 + .../IndexerExecutionStatusConverter.java | 3 + .../converters/IndexerStatusConverter.java | 3 + .../IndexingParametersConverter.java | 3 + .../converters/IndexingResultConverter.java | 3 + .../converters/IndexingScheduleConverter.java | 3 + .../InputFieldMappingEntryConverter.java | 3 + .../converters/KeepTokenFilterConverter.java | 3 + .../KeyPhraseExtractionSkillConverter.java | 3 + ...hraseExtractionSkillLanguageConverter.java | 3 + .../KeywordMarkerTokenFilterConverter.java | 3 + .../converters/KeywordTokenizerConverter.java | 3 + .../KeywordTokenizerV2Converter.java | 3 + .../LanguageDetectionSkillConverter.java | 3 + .../LengthTokenFilterConverter.java | 3 + .../converters/LexicalAnalyzerConverter.java | 3 + .../LexicalAnalyzerNameConverter.java | 3 + .../converters/LexicalTokenizerConverter.java | 3 + .../LexicalTokenizerNameConverter.java | 3 + .../converters/LimitTokenFilterConverter.java | 3 + .../LuceneStandardAnalyzerConverter.java | 3 + .../LuceneStandardTokenizerConverter.java | 3 + .../LuceneStandardTokenizerV2Converter.java | 3 + .../MagnitudeScoringFunctionConverter.java | 3 + .../MagnitudeScoringParametersConverter.java | 3 + .../MappingCharFilterConverter.java | 3 + .../converters/MergeSkillConverter.java | 3 + ...oftLanguageStemmingTokenizerConverter.java | 3 + .../MicrosoftLanguageTokenizerConverter.java | 3 + ...oftStemmingTokenizerLanguageConverter.java | 3 + .../MicrosoftTokenizerLanguageConverter.java | 3 + .../converters/NGramTokenFilterConverter.java | 3 + .../NGramTokenFilterV2Converter.java | 3 + .../converters/NGramTokenizerConverter.java | 3 + .../converters/OcrSkillConverter.java | 3 + .../converters/OcrSkillLanguageConverter.java | 3 + .../OutputFieldMappingEntryConverter.java | 3 + .../PathHierarchyTokenizerV2Converter.java | 3 + .../converters/PatternAnalyzerConverter.java | 3 + .../PatternCaptureTokenFilterConverter.java | 3 + .../PatternReplaceCharFilterConverter.java | 3 + .../PatternReplaceTokenFilterConverter.java | 3 + .../converters/PatternTokenizerConverter.java | 3 + .../converters/PhoneticEncoderConverter.java | 3 + .../PhoneticTokenFilterConverter.java | 3 + .../converters/QueryTypeConverter.java | 3 + .../converters/RegexFlagsConverter.java | 3 + .../converters/RequestOptionsConverter.java | 3 + .../converters/ResourceCounterConverter.java | 3 + .../ScoringFunctionAggregationConverter.java | 3 + .../converters/ScoringFunctionConverter.java | 3 + ...ScoringFunctionInterpolationConverter.java | 3 + .../converters/ScoringProfileConverter.java | 3 + .../converters/SearchFieldConverter.java | 3 + .../SearchFieldDataTypeConverter.java | 3 + .../converters/SearchIndexConverter.java | 3 + .../converters/SearchIndexerConverter.java | 3 + .../SearchIndexerDataContainerConverter.java | 3 + .../SearchIndexerDataSourceConverter.java | 3 + .../SearchIndexerDataSourceTypeConverter.java | 3 + .../SearchIndexerErrorConverter.java | 3 + .../SearchIndexerLimitsConverter.java | 3 + .../SearchIndexerSkillConverter.java | 3 + .../SearchIndexerSkillsetConverter.java | 3 + .../SearchIndexerStatusConverter.java | 3 + .../SearchIndexerWarningConverter.java | 3 + .../converters/SearchModeConverter.java | 3 + .../SearchResourceEncryptionKeyConverter.java | 3 + .../converters/SearchResultConverter.java | 3 + .../converters/SentimentSkillConverter.java | 3 + .../SentimentSkillLanguageConverter.java | 3 + .../converters/ServiceCountersConverter.java | 3 + .../converters/ServiceLimitsConverter.java | 3 + .../ServiceStatisticsConverter.java | 3 + .../converters/ShaperSkillConverter.java | 3 + .../ShingleTokenFilterConverter.java | 3 + .../converters/SimilarityConverter.java | 3 + .../SnowballTokenFilterConverter.java | 3 + .../SnowballTokenFilterLanguageConverter.java | 3 + ...olumnDeletionDetectionPolicyConverter.java | 3 + .../converters/SplitSkillConverter.java | 3 + .../SplitSkillLanguageConverter.java | 3 + ...tegratedChangeTrackingPolicyConverter.java | 3 + .../StemmerOverrideTokenFilterConverter.java | 3 + .../StemmerTokenFilterConverter.java | 3 + .../StemmerTokenFilterLanguageConverter.java | 3 + .../converters/StopAnalyzerConverter.java | 3 + .../converters/StopwordsListConverter.java | 3 + .../StopwordsTokenFilterConverter.java | 3 + .../converters/SuggestOptionsConverter.java | 3 + .../converters/SuggestResultConverter.java | 3 + .../converters/SuggesterConverter.java | 3 + .../converters/SynonymMapConverter.java | 3 + .../SynonymTokenFilterConverter.java | 3 + .../TagScoringFunctionConverter.java | 3 + .../TagScoringParametersConverter.java | 3 + .../TextExtractionAlgorithmConverter.java | 3 + .../converters/TextSplitModeConverter.java | 3 + .../TextTranslationSkillConverter.java | 3 + ...TextTranslationSkillLanguageConverter.java | 3 + .../converters/TextWeightsConverter.java | 3 + .../TokenCharacterKindConverter.java | 3 + .../converters/TokenFilterConverter.java | 3 + .../converters/TokenFilterNameConverter.java | 3 + .../TruncateTokenFilterConverter.java | 3 + .../UaxUrlEmailTokenizerConverter.java | 3 + .../UniqueTokenFilterConverter.java | 3 + .../converters/VisualFeatureConverter.java | 3 + .../converters/WebApiSkillConverter.java | 3 + .../WordDelimiterTokenFilterConverter.java | 3 + .../implementation/util/Constants.java | 3 + .../CustomPatternAnalyzerDeserializer.java | 60 --------------- .../util/CustomPatternAnalyzerSerializer.java | 75 ------------------- .../CustomPatternTokenizerDeserializer.java | 53 ------------- .../CustomPatternTokenizerSerializer.java | 67 ----------------- .../util/DocumentResponseConversions.java | 4 +- .../implementation/util/MappingUtils.java | 19 ++--- .../util/PrivateFieldAccessHelper.java | 3 + .../documents/models/AnalyzeRequest.java | 3 - .../documents/models/AnalyzedTokenInfo.java | 3 - .../models/AsciiFoldingTokenFilter.java | 3 - .../documents/models/AutocompleteItem.java | 3 - .../documents/models/AutocompleteMode.java | 3 - .../documents/models/AutocompleteOptions.java | 3 - .../documents/models/AutocompleteResult.java | 3 - ...ActiveDirectoryApplicationCredentials.java | 3 - .../documents/models/BM25Similarity.java | 3 - .../search/documents/models/CharFilter.java | 3 - .../documents/models/CharFilterName.java | 3 - .../models/CjkBigramTokenFilter.java | 3 - .../models/CjkBigramTokenFilterScripts.java | 3 - .../documents/models/ClassicSimilarity.java | 3 - .../documents/models/ClassicTokenizer.java | 3 - .../models/CognitiveServicesAccount.java | 3 - .../models/CognitiveServicesAccountKey.java | 3 - .../models/CommonGramTokenFilter.java | 3 - .../search/documents/models/ComplexField.java | 8 +- .../documents/models/ConditionalSkill.java | 3 - .../search/documents/models/CorsOptions.java | 3 - .../documents/models/CustomAnalyzer.java | 3 - .../models/DataChangeDetectionPolicy.java | 3 - .../models/DataDeletionDetectionPolicy.java | 3 - .../models/DataSourceCredentials.java | 3 - .../DefaultCognitiveServicesAccount.java | 3 - .../DictionaryDecompounderTokenFilter.java | 3 - .../models/DistanceScoringFunction.java | 3 - .../models/DistanceScoringParameters.java | 3 - .../models/EdgeNGramTokenFilter.java | 3 - .../models/EdgeNGramTokenFilterSide.java | 3 - .../models/EdgeNGramTokenFilterV2.java | 3 - .../documents/models/EdgeNGramTokenizer.java | 3 - .../documents/models/ElisionTokenFilter.java | 3 - .../documents/models/EntityCategory.java | 3 - .../models/EntityRecognitionSkill.java | 3 - .../EntityRecognitionSkillLanguage.java | 3 - .../search/documents/models/FacetResult.java | 3 - .../search/documents/models/FieldMapping.java | 3 - .../models/FieldMappingFunction.java | 3 - .../models/FreshnessScoringFunction.java | 3 - .../models/FreshnessScoringParameters.java | 3 - .../models/GetIndexStatisticsResult.java | 3 - .../HighWaterMarkChangeDetectionPolicy.java | 3 - .../documents/models/ImageAnalysisSkill.java | 3 - .../models/ImageAnalysisSkillLanguage.java | 3 - .../search/documents/models/ImageDetail.java | 3 - .../search/documents/models/IndexAction.java | 3 - .../documents/models/IndexActionType.java | 3 - .../documents/models/IndexBatchBase.java | 3 - .../models/IndexDocumentsResult.java | 3 - .../models/IndexerExecutionResult.java | 3 - .../models/IndexerExecutionStatus.java | 3 - .../documents/models/IndexerStatus.java | 3 - .../documents/models/IndexingParameters.java | 3 - .../documents/models/IndexingResult.java | 3 - .../documents/models/IndexingSchedule.java | 3 - .../models/InputFieldMappingEntry.java | 3 - .../documents/models/KeepTokenFilter.java | 3 - .../models/KeyPhraseExtractionSkill.java | 3 - .../KeyPhraseExtractionSkillLanguage.java | 3 - .../models/KeywordMarkerTokenFilter.java | 3 - .../documents/models/KeywordTokenizer.java | 3 - .../documents/models/KeywordTokenizerV2.java | 3 - .../models/LanguageDetectionSkill.java | 3 - .../documents/models/LengthTokenFilter.java | 3 - .../documents/models/LexicalAnalyzer.java | 3 - .../documents/models/LexicalAnalyzerName.java | 3 - .../documents/models/LexicalTokenizer.java | 3 - .../models/LexicalTokenizerName.java | 3 - .../documents/models/LimitTokenFilter.java | 3 - .../models/LuceneStandardAnalyzer.java | 3 - .../models/LuceneStandardTokenizer.java | 3 - .../models/LuceneStandardTokenizerV2.java | 3 - .../models/MagnitudeScoringFunction.java | 3 - .../models/MagnitudeScoringParameters.java | 3 - .../documents/models/MappingCharFilter.java | 3 - .../search/documents/models/MergeSkill.java | 3 - .../MicrosoftLanguageStemmingTokenizer.java | 3 - .../models/MicrosoftLanguageTokenizer.java | 3 - .../MicrosoftStemmingTokenizerLanguage.java | 3 - .../models/MicrosoftTokenizerLanguage.java | 3 - .../documents/models/NGramTokenFilter.java | 3 - .../documents/models/NGramTokenFilterV2.java | 3 - .../documents/models/NGramTokenizer.java | 3 - .../search/documents/models/OcrSkill.java | 3 - .../documents/models/OcrSkillLanguage.java | 3 - .../models/OutputFieldMappingEntry.java | 3 - .../models/PathHierarchyTokenizerV2.java | 3 - .../documents/models/PatternAnalyzer.java | 10 +-- .../models/PatternCaptureTokenFilter.java | 3 - .../models/PatternReplaceCharFilter.java | 3 - .../models/PatternReplaceTokenFilter.java | 3 - .../documents/models/PatternTokenizer.java | 10 +-- .../documents/models/PhoneticEncoder.java | 3 - .../documents/models/PhoneticTokenFilter.java | 3 - .../search/documents/models/QueryType.java | 3 - .../search/documents/models/RegexFlags.java | 3 - .../documents/models/RequestOptions.java | 3 - .../documents/models/ResourceCounter.java | 3 - .../documents/models/ScoringFunction.java | 3 - .../models/ScoringFunctionAggregation.java | 3 - .../models/ScoringFunctionInterpolation.java | 3 - .../documents/models/ScoringParameter.java | 8 +- .../documents/models/ScoringProfile.java | 3 - .../search/documents/models/SearchField.java | 3 - .../documents/models/SearchFieldDataType.java | 3 - .../search/documents/models/SearchIndex.java | 3 - .../documents/models/SearchIndexer.java | 3 - .../models/SearchIndexerDataContainer.java | 3 - .../models/SearchIndexerDataSource.java | 3 - .../models/SearchIndexerDataSourceType.java | 3 - .../documents/models/SearchIndexerError.java | 3 - .../documents/models/SearchIndexerLimits.java | 3 - .../documents/models/SearchIndexerSkill.java | 3 - .../models/SearchIndexerSkillset.java | 3 - .../documents/models/SearchIndexerStatus.java | 3 - .../models/SearchIndexerWarning.java | 3 - .../search/documents/models/SearchMode.java | 3 - .../documents/models/SearchOptions.java | 3 - .../models/SearchResourceEncryptionKey.java | 3 - .../search/documents/models/SearchResult.java | 3 - .../documents/models/SentimentSkill.java | 3 - .../models/SentimentSkillLanguage.java | 3 - .../documents/models/ServiceCounters.java | 3 - .../documents/models/ServiceLimits.java | 3 - .../documents/models/ServiceStatistics.java | 3 - .../search/documents/models/ShaperSkill.java | 3 - .../documents/models/ShingleTokenFilter.java | 3 - .../search/documents/models/Similarity.java | 3 - .../search/documents/models/SimpleField.java | 4 +- .../documents/models/SnowballTokenFilter.java | 3 - .../models/SnowballTokenFilterLanguage.java | 3 - ...ftDeleteColumnDeletionDetectionPolicy.java | 3 - .../search/documents/models/SplitSkill.java | 3 - .../documents/models/SplitSkillLanguage.java | 3 - .../SqlIntegratedChangeTrackingPolicy.java | 3 - .../models/StemmerOverrideTokenFilter.java | 3 - .../documents/models/StemmerTokenFilter.java | 3 - .../models/StemmerTokenFilterLanguage.java | 3 - .../search/documents/models/StopAnalyzer.java | 3 - .../documents/models/StopwordsList.java | 3 - .../models/StopwordsTokenFilter.java | 3 - .../documents/models/SuggestOptions.java | 3 - .../documents/models/SuggestResult.java | 3 - .../search/documents/models/Suggester.java | 3 - .../search/documents/models/SynonymMap.java | 3 - .../documents/models/SynonymTokenFilter.java | 3 - .../documents/models/TagScoringFunction.java | 3 - .../models/TagScoringParameters.java | 3 - .../models/TextExtractionAlgorithm.java | 3 - .../documents/models/TextSplitMode.java | 3 - .../models/TextTranslationSkill.java | 3 - .../models/TextTranslationSkillLanguage.java | 3 - .../search/documents/models/TextWeights.java | 3 - .../documents/models/TokenCharacterKind.java | 3 - .../search/documents/models/TokenFilter.java | 3 - .../documents/models/TokenFilterName.java | 3 - .../documents/models/TruncateTokenFilter.java | 3 - .../models/UaxUrlEmailTokenizer.java | 3 - .../documents/models/UniqueTokenFilter.java | 3 - .../documents/models/VisualFeature.java | 3 - .../search/documents/models/WebApiSkill.java | 3 - .../models/WordDelimiterTokenFilter.java | 3 - .../search/documents/models/package-info.java | 3 - .../models/ScoringParameterTests.java | 2 +- 336 files changed, 523 insertions(+), 773 deletions(-) delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternAnalyzerDeserializer.java delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternAnalyzerSerializer.java delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternTokenizerDeserializer.java delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternTokenizerSerializer.java 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[/\\]"/> + + + { - private static final String DELIMITER = "\\|"; - - /** - * {@inheritDoc} - */ - @Override - public PatternAnalyzer deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException { - ObjectMapper mapper = new ObjectMapper(); - ObjectNode root = mapper.readTree(p); - - Iterator> fields = root.fields(); - PatternAnalyzer analyzer = new PatternAnalyzer(); - while (fields.hasNext()) { - Map.Entry field = fields.next(); - if ("name".equals(field.getKey())) { - analyzer.setName(field.getValue().asText()); - } else if ("pattern".equals(field.getKey())) { - analyzer.setPattern(field.getValue().asText()); - } else if ("flags".equals(field.getKey()) && !"null".equals(field.getValue().asText())) { - List regexFlags = Arrays.stream(field.getValue().asText().split(DELIMITER)) - .map(RegexFlags::fromString).collect(Collectors.toList()); - analyzer.setFlags(regexFlags); - } else if ("lowercase".equals(field.getKey())){ - analyzer.setLowerCaseTerms(field.getValue().asBoolean()); - } else if ("stopwords".equals(field.getKey())) { - List stopWords = new ArrayList<>(); - field.getValue().forEach( - jsonNode -> stopWords.add(jsonNode.asText()) - ); - analyzer.setStopwords(stopWords); - } - } - return analyzer; - } -} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternAnalyzerSerializer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternAnalyzerSerializer.java deleted file mode 100644 index f96a5a8b9923..000000000000 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternAnalyzerSerializer.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.search.documents.implementation.util; - -import com.azure.search.documents.models.PatternAnalyzer; -import com.azure.search.documents.models.RegexFlags; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import java.io.IOException; -import java.util.stream.Collectors; - -/** - * Custom serializer for {@link PatternAnalyzer}, which flatten the list of {@link RegexFlags}. - */ -public class CustomPatternAnalyzerSerializer extends JsonSerializer { - private static final String DELIMITER = "|"; - - /** - * {@inheritDoc} - * - * @param analyzer The {@link PatternAnalyzer} needs to serialize - * @param gen Generator used to output resulting Json content - * @param serializers Provider that can be used to get serializers for - * serializing Objects value contains, if any. - * @param typeSer Type serializer to use for including type information - * @throws IOException If IO operation error occurs. - */ - @Override - public void serializeWithType(PatternAnalyzer analyzer, JsonGenerator gen, SerializerProvider serializers, - TypeSerializer typeSer) throws IOException { - gen.writeStartObject(); - gen.writeStringField(typeSer.getPropertyName(), typeSer.getTypeIdResolver().idFromValue(analyzer)); - serialize(analyzer, gen, serializers); - gen.writeEndObject(); - } - - /** - * {@inheritDoc} - * - * @param analyzer The {@link PatternAnalyzer} needs to serialize - * @param jsonGenerator Generator used to output resulting Json content - * @param serializerProvider Provider that can be used to get serializers for - * serializing Objects value contains, if any. - * @throws IOException If IO operation error occurs. - */ - @Override - public void serialize(final PatternAnalyzer analyzer, final JsonGenerator jsonGenerator, - final SerializerProvider serializerProvider) throws IOException { - if(analyzer.getName() != null) { - jsonGenerator.writeStringField("name", analyzer.getName()); - } - if (analyzer.isLowerCaseTerms() != null) { - jsonGenerator.writeBooleanField("lowercase", analyzer.isLowerCaseTerms()); - } - if (analyzer.getPattern() != null) { - jsonGenerator.writeStringField("pattern", analyzer.getPattern()); - } - if (analyzer.getFlags() != null) { - String flattenFlags = analyzer.getFlags().stream().map(RegexFlags::toString) - .collect(Collectors.joining(DELIMITER)); - jsonGenerator.writeStringField("flags", flattenFlags); - } - if (analyzer.getStopwords() != null) { - jsonGenerator.writeFieldName("stopwords"); - jsonGenerator.writeStartArray(); - for (String arg: analyzer.getStopwords()) { - jsonGenerator.writeString(arg); - } - jsonGenerator.writeEndArray(); - } - } -} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternTokenizerDeserializer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternTokenizerDeserializer.java deleted file mode 100644 index 3fa658811bc3..000000000000 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternTokenizerDeserializer.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.search.documents.implementation.util; - -import com.azure.search.documents.models.PatternTokenizer; -import com.azure.search.documents.models.RegexFlags; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import java.io.IOException; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Custom deserializer for {@link PatternTokenizer}, which convert flatten string to the list of {@link RegexFlags}. - */ -public class CustomPatternTokenizerDeserializer extends JsonDeserializer { - private static final String DELIMITER = "\\|"; - - /** - * {@inheritDoc} - */ - @Override - public PatternTokenizer deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException { - ObjectMapper mapper = new ObjectMapper(); - ObjectNode root = mapper.readTree(p); - Iterator> fields = root.fields(); - PatternTokenizer tokenizer = new PatternTokenizer(); - while (fields.hasNext()) { - Map.Entry field = fields.next(); - if ("name".equals(field.getKey())) { - tokenizer.setName(field.getValue().asText()); - } else if ("pattern".equals(field.getKey())) { - tokenizer.setPattern(field.getValue().asText()); - } else if ("flags".equals(field.getKey()) && !"null".equals(field.getValue().asText())) { - List regexFlags = Arrays.stream(field.getValue().asText().split(DELIMITER)) - .map(RegexFlags::fromString).collect(Collectors.toList()); - tokenizer.setFlags(regexFlags); - } else if ("group".equals(field.getKey())){ - tokenizer.setGroup(field.getValue().asInt()); - } - } - return tokenizer; - - } -} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternTokenizerSerializer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternTokenizerSerializer.java deleted file mode 100644 index d52c010092c9..000000000000 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/CustomPatternTokenizerSerializer.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.search.documents.implementation.util; - -import com.azure.search.documents.models.PatternTokenizer; -import com.azure.search.documents.models.RegexFlags; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import java.io.IOException; -import java.util.stream.Collectors; - -/** - * Custom serializer for {@link PatternTokenizer}, which flatten the list of {@link RegexFlags}. - */ -public class CustomPatternTokenizerSerializer extends JsonSerializer { - private static final String DELIMITER = "|"; - - /** - * {@inheritDoc} - * - * @param tokenizer The {@link PatternTokenizer} needs to serialize. - * @param gen Generator used to output resulting Json content - * @param serializers Provider that can be used to get serializers for - * serializing Objects value contains, if any. - * @param typeSer Type serializer to use for including type information - * @throws IOException if IO operation error occurs. - */ - @Override - public void serializeWithType(PatternTokenizer tokenizer, JsonGenerator gen, SerializerProvider serializers, - TypeSerializer typeSer) throws IOException { - gen.writeStartObject(); - gen.writeStringField(typeSer.getPropertyName(), typeSer.getTypeIdResolver().idFromValue(tokenizer)); - serialize(tokenizer, gen, serializers); - gen.writeEndObject(); - } - - /** - * {@inheritDoc} - * - * @param tokenizer The {@link PatternTokenizer} needs to serialize. - * @param jsonGenerator Generator used to output resulting Json content - * @param serializerProvider Provider that can be used to get serializers for - * serializing Objects value contains, if any. - * @throws IOException if IO operation error occurs. - */ - @Override - public void serialize(final PatternTokenizer tokenizer, final JsonGenerator jsonGenerator, - final SerializerProvider serializerProvider) throws IOException { - if (tokenizer.getName() != null) { - jsonGenerator.writeStringField("name", tokenizer.getName()); - } - if (tokenizer.getPattern() != null) { - jsonGenerator.writeStringField("pattern", tokenizer.getPattern()); - } - if (tokenizer.getFlags() != null) { - String flattenFlags = tokenizer.getFlags().stream().map(RegexFlags::toString) - .collect(Collectors.joining(DELIMITER)); - jsonGenerator.writeStringField("flags", flattenFlags); - } - if (tokenizer.getGroup() != null) { - jsonGenerator.writeNumberField("group", tokenizer.getGroup()); - } - } -} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java index 6e0ad0e0c6e6..727f51beb53e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java @@ -27,8 +27,8 @@ public final class DocumentResponseConversions { * Converts the {@link Throwable} into a more descriptive exception type if the {@link SearchDocument} isn't found. * * @param throwable Throwable thrown during a API call. - * @return The {@link Throwable} mapped to a more descriptive exception type if the {@link SearchDocument} isn't found, - * otherwise the passed {@link Throwable} unmodified. + * @return The {@link Throwable} mapped to a more descriptive exception type if the {@link SearchDocument} + * isn't found, otherwise the passed {@link Throwable} unmodified. */ public static Throwable exceptionMapper(Throwable throwable) { if (!(throwable instanceof SearchErrorException)) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/MappingUtils.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/MappingUtils.java index 10cffb4a13cd..a8f5f8d66e0f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/MappingUtils.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/MappingUtils.java @@ -5,24 +5,24 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; +import com.azure.search.documents.implementation.converters.AnalyzedTokenInfoConverter; import com.azure.search.documents.implementation.converters.AutocompleteResultConverter; import com.azure.search.documents.implementation.converters.GetIndexStatisticsResultConverter; import com.azure.search.documents.implementation.converters.IndexDocumentsResultConverter; -import com.azure.search.documents.implementation.converters.SearchIndexerStatusConverter; 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.SearchIndexerStatusConverter; import com.azure.search.documents.implementation.converters.ServiceStatisticsConverter; import com.azure.search.documents.implementation.converters.SynonymMapConverter; -import com.azure.search.documents.implementation.converters.AnalyzedTokenInfoConverter; import com.azure.search.documents.implementation.models.AnalyzeResult; import com.azure.search.documents.implementation.models.AutocompleteResult; +import com.azure.search.documents.implementation.models.IndexDocumentsResult; import com.azure.search.documents.implementation.models.ListDataSourcesResult; import com.azure.search.documents.implementation.models.ListIndexersResult; import com.azure.search.documents.implementation.models.ListIndexesResult; @@ -31,7 +31,6 @@ import com.azure.search.documents.implementation.models.SearchErrorException; import com.azure.search.documents.models.AnalyzedTokenInfo; import com.azure.search.documents.models.GetIndexStatisticsResult; -import com.azure.search.documents.implementation.models.IndexDocumentsResult; import com.azure.search.documents.models.SearchIndex; import com.azure.search.documents.models.SearchIndexer; import com.azure.search.documents.models.SearchIndexerDataSource; @@ -81,8 +80,8 @@ public static PagedResponse mappingPagingSearchIndexer( List searchIndexers = searchIndexerResponse.getValue().getIndexers().stream() .map(SearchIndexerConverter::map).collect(toList()); return new PagedResponseBase( - searchIndexerResponse.getRequest(), searchIndexerResponse.getStatusCode(), searchIndexerResponse.getHeaders(), - searchIndexers, null, null); + searchIndexerResponse.getRequest(), searchIndexerResponse.getStatusCode(), + searchIndexerResponse.getHeaders(), searchIndexers, null, null); } public static Response mappingExternalSearchIndexer( @@ -127,8 +126,9 @@ public static Response mappingExternalServiceStatistics( public static PagedResponse mappingTokenInfo( Response resultResponse) { - List tokenInfos = resultResponse.getValue().getTokens().stream().map(AnalyzedTokenInfoConverter::map).collect(toList()); - return new PagedResponseBase ( + List tokenInfos = resultResponse.getValue().getTokens().stream() + .map(AnalyzedTokenInfoConverter::map).collect(toList()); + return new PagedResponseBase( resultResponse.getRequest(), resultResponse.getStatusCode(), resultResponse.getHeaders(), tokenInfos, @@ -139,7 +139,8 @@ public static PagedResponse mappingTokenInfo( public static Response mappingIndexerStatus( Response indexerStatusResponse) { - return new SimpleResponse<>(indexerStatusResponse, SearchIndexerStatusConverter.map(indexerStatusResponse.getValue())); + return new SimpleResponse<>(indexerStatusResponse, SearchIndexerStatusConverter.map( + indexerStatusResponse.getValue())); } public static Response mappingGetIndexStatistics( diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java index a2ca891d5741..de2261b392c7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.azure.search.documents.implementation.util; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AnalyzeRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AnalyzeRequest.java index 389760003461..c3ee8e495d8d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AnalyzeRequest.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AnalyzeRequest.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AnalyzedTokenInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AnalyzedTokenInfo.java index 66b6343923f1..d9d27d39001c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AnalyzedTokenInfo.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AnalyzedTokenInfo.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AsciiFoldingTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AsciiFoldingTokenFilter.java index 0896b94ce6b9..358cac70db16 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AsciiFoldingTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AsciiFoldingTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteItem.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteItem.java index 23454a35d775..90435f420ee3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteItem.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteItem.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteMode.java index 18c9d1223b7e..bc7441f781dc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteMode.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteMode.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteOptions.java index 553e8ccfdf36..47c3e4c0ee0e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteOptions.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteResult.java index f20b4748748f..047f7ee2d11f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteResult.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AzureActiveDirectoryApplicationCredentials.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AzureActiveDirectoryApplicationCredentials.java index 50128c323d86..7bb822ba6d80 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AzureActiveDirectoryApplicationCredentials.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AzureActiveDirectoryApplicationCredentials.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/BM25Similarity.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/BM25Similarity.java index 0a56d3b4626d..de298b2b3d05 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/BM25Similarity.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/BM25Similarity.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CharFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CharFilter.java index 236f89ff38aa..38f04b252fd2 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CharFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CharFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CharFilterName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CharFilterName.java index caceee51fe44..f317f517ce9c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CharFilterName.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CharFilterName.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CjkBigramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CjkBigramTokenFilter.java index 6bc03a81f7a4..f9db05aaa419 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CjkBigramTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CjkBigramTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CjkBigramTokenFilterScripts.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CjkBigramTokenFilterScripts.java index e6f8b87bb150..dce89e11c7d3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CjkBigramTokenFilterScripts.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CjkBigramTokenFilterScripts.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ClassicSimilarity.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ClassicSimilarity.java index d9766ac67883..6b73b14d4b1e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ClassicSimilarity.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ClassicSimilarity.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ClassicTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ClassicTokenizer.java index 16e2e6122de3..75664671757b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ClassicTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ClassicTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CognitiveServicesAccount.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CognitiveServicesAccount.java index 7ccd17c7f4b9..853e09be3992 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CognitiveServicesAccount.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CognitiveServicesAccount.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CognitiveServicesAccountKey.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CognitiveServicesAccountKey.java index bc9590174b5f..a604114eb07d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CognitiveServicesAccountKey.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CognitiveServicesAccountKey.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CommonGramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CommonGramTokenFilter.java index e7d81c8bae18..e0950d570425 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CommonGramTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CommonGramTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexField.java index b61316af841e..554feb8443b7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ComplexField.java @@ -6,8 +6,8 @@ import java.util.List; /** - * A helper Field model to build a complex field which uses {@code SearchFieldDataType.EDM_COMPLEX_TYPE} or collection of - * {@code SearchFieldDataType.EDM_COMPLEX_TYPE}. + * A helper Field model to build a complex field which uses {@code SearchFieldDataType.EDM_COMPLEX_TYPE} or + * collection of {@code SearchFieldDataType.EDM_COMPLEX_TYPE}. */ public class ComplexField extends SearchFieldBase { private List fields; @@ -19,8 +19,8 @@ public class ComplexField extends SearchFieldBase { * @param collection Whether the field is a collection of strings. */ public ComplexField(String name, boolean collection) { - super(name, collection ? SearchFieldDataType.collection(SearchFieldDataType.COMPLEX) : - SearchFieldDataType.COMPLEX); + super(name, collection ? SearchFieldDataType.collection(SearchFieldDataType.COMPLEX) + : SearchFieldDataType.COMPLEX); } /** diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ConditionalSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ConditionalSkill.java index 626f5db67744..860a741cad6e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ConditionalSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ConditionalSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CorsOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CorsOptions.java index b53ae1fe12d5..9a3305573893 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CorsOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CorsOptions.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CustomAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CustomAnalyzer.java index 306b99b27b31..7a16a05d3d06 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CustomAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/CustomAnalyzer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataChangeDetectionPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataChangeDetectionPolicy.java index 2c9c54a01b7d..135f2f5b9b9b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataChangeDetectionPolicy.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataChangeDetectionPolicy.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataDeletionDetectionPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataDeletionDetectionPolicy.java index dd93b9d6776b..9062a5b4cd89 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataDeletionDetectionPolicy.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataDeletionDetectionPolicy.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataSourceCredentials.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataSourceCredentials.java index 59d1e4a1349b..d96f11da6d2f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataSourceCredentials.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DataSourceCredentials.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DefaultCognitiveServicesAccount.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DefaultCognitiveServicesAccount.java index 4d02a5bbad16..cb3f9dd32a56 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DefaultCognitiveServicesAccount.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DefaultCognitiveServicesAccount.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DictionaryDecompounderTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DictionaryDecompounderTokenFilter.java index 3e77b36a0478..7c016377b96a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DictionaryDecompounderTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DictionaryDecompounderTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DistanceScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DistanceScoringFunction.java index 905127ef8561..61154b156fef 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DistanceScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DistanceScoringFunction.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DistanceScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DistanceScoringParameters.java index 56d191f5647d..a880e294b5d4 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DistanceScoringParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DistanceScoringParameters.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilter.java index 4d95601707ea..57bfe05f529b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilterSide.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilterSide.java index b9f31bf69b9f..dd4ff23cf9bb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilterSide.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilterSide.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilterV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilterV2.java index 9e851770f264..593429bcb656 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilterV2.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenFilterV2.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenizer.java index ed7a07a02142..d33b66cfb834 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EdgeNGramTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ElisionTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ElisionTokenFilter.java index db6c3a818d78..b376d0879bbc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ElisionTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ElisionTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityCategory.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityCategory.java index ccc4a96a3135..445d2b3a7aac 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityCategory.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityCategory.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityRecognitionSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityRecognitionSkill.java index 524a6818bc08..0273c22f98af 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityRecognitionSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityRecognitionSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityRecognitionSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityRecognitionSkillLanguage.java index 62bc235bd86d..606aebe35950 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityRecognitionSkillLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/EntityRecognitionSkillLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FacetResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FacetResult.java index 7dfe283f70fa..fc283dfb5da8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FacetResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FacetResult.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FieldMapping.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FieldMapping.java index 4e8971601320..523ed0276c5a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FieldMapping.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FieldMapping.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FieldMappingFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FieldMappingFunction.java index 0ffc102f5577..82972b4c47dc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FieldMappingFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FieldMappingFunction.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FreshnessScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FreshnessScoringFunction.java index 13d736386ac4..a678cdf95e5b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FreshnessScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FreshnessScoringFunction.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FreshnessScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FreshnessScoringParameters.java index a8c1c57b94c3..37affce0f078 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FreshnessScoringParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FreshnessScoringParameters.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GetIndexStatisticsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GetIndexStatisticsResult.java index 108c65f51428..03e6760fb448 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GetIndexStatisticsResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GetIndexStatisticsResult.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HighWaterMarkChangeDetectionPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HighWaterMarkChangeDetectionPolicy.java index 6ac82adee385..06d7e7890556 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HighWaterMarkChangeDetectionPolicy.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HighWaterMarkChangeDetectionPolicy.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageAnalysisSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageAnalysisSkill.java index 40efce99380b..90ed07a7b30a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageAnalysisSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageAnalysisSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageAnalysisSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageAnalysisSkillLanguage.java index 4fa21bacb756..1da5688b291c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageAnalysisSkillLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageAnalysisSkillLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageDetail.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageDetail.java index e6284a6fccd6..12d71ffd7bb4 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageDetail.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ImageDetail.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexAction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexAction.java index 92ab65aafb13..8a1fbd4b1e35 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexAction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexAction.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexActionType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexActionType.java index 8ecaba56ebbb..f743e48b24d2 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexActionType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexActionType.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexBatchBase.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexBatchBase.java index 28c68142c95d..1bcf83c0e60d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexBatchBase.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexBatchBase.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexDocumentsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexDocumentsResult.java index 6dfab1c16fe5..fa9a197bd1e3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexDocumentsResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexDocumentsResult.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerExecutionResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerExecutionResult.java index 2091822bfcaf..fcec5ce6b5ad 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerExecutionResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerExecutionResult.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerExecutionStatus.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerExecutionStatus.java index 82ed8477cf89..b5bfec0dc868 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerExecutionStatus.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerExecutionStatus.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerStatus.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerStatus.java index 7d4c35468b28..cc353481210c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerStatus.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexerStatus.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingParameters.java index 8365b79e9c78..1bbe3dba8e22 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingParameters.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingResult.java index 2da8665c444d..c3658c18c493 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingResult.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingSchedule.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingSchedule.java index 069a28eacc4a..4aba3991efa7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingSchedule.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/IndexingSchedule.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/InputFieldMappingEntry.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/InputFieldMappingEntry.java index 8eb85425a878..0223e75b5596 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/InputFieldMappingEntry.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/InputFieldMappingEntry.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeepTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeepTokenFilter.java index 89fd0c5f9bab..3be0aa6cd47f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeepTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeepTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeyPhraseExtractionSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeyPhraseExtractionSkill.java index 282e7720cecd..c57bbfd7d783 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeyPhraseExtractionSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeyPhraseExtractionSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeyPhraseExtractionSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeyPhraseExtractionSkillLanguage.java index 0bc023999668..a4c02955a561 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeyPhraseExtractionSkillLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeyPhraseExtractionSkillLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordMarkerTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordMarkerTokenFilter.java index ce0450d20a4a..d1b4022f1ac0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordMarkerTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordMarkerTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordTokenizer.java index 6fc939f54759..dca4015d0bf3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordTokenizerV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordTokenizerV2.java index e0f3c1c4dd68..889c398887f7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordTokenizerV2.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/KeywordTokenizerV2.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LanguageDetectionSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LanguageDetectionSkill.java index 3ae754b54a95..79abdcbb4029 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LanguageDetectionSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LanguageDetectionSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LengthTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LengthTokenFilter.java index 4af9c781e2ab..1f629b71f8d1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LengthTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LengthTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzer.java index bb370a297dde..5020202b2439 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzerName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzerName.java index eda2a1cb386a..371ecac62204 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzerName.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalAnalyzerName.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizer.java index 5f5c08d501a8..d51afd721704 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizerName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizerName.java index a8c1b3051ab7..1ea100e3c368 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizerName.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LexicalTokenizerName.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LimitTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LimitTokenFilter.java index 64e3303b975b..2db5357b3303 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LimitTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LimitTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardAnalyzer.java index 8dbefea4078e..89d77f2fd55b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardAnalyzer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardTokenizer.java index 262ea362f23a..f00e7ac6240b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardTokenizerV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardTokenizerV2.java index c6fb7f111f1b..4a2a3ff1b051 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardTokenizerV2.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/LuceneStandardTokenizerV2.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MagnitudeScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MagnitudeScoringFunction.java index 7478815faeb4..4738c82a97cb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MagnitudeScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MagnitudeScoringFunction.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MagnitudeScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MagnitudeScoringParameters.java index bdc8bd8fca1b..b35b7c223d61 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MagnitudeScoringParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MagnitudeScoringParameters.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MappingCharFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MappingCharFilter.java index 6f624a6a666b..b04a8bf696f0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MappingCharFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MappingCharFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MergeSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MergeSkill.java index 4739fe50fe1a..686eab5a8428 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MergeSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MergeSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftLanguageStemmingTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftLanguageStemmingTokenizer.java index 16cd0e17219d..4099b52c9c74 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftLanguageStemmingTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftLanguageStemmingTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftLanguageTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftLanguageTokenizer.java index 07d69c7a12db..9995fd48d03d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftLanguageTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftLanguageTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftStemmingTokenizerLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftStemmingTokenizerLanguage.java index 6fb5910bb854..3a027c10af95 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftStemmingTokenizerLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftStemmingTokenizerLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftTokenizerLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftTokenizerLanguage.java index f42f0a339a25..95687811d9b1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftTokenizerLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/MicrosoftTokenizerLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenFilter.java index f9fbe681b866..07a70bde6101 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenFilterV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenFilterV2.java index 5aa3c3717eec..3f8f13dcf510 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenFilterV2.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenFilterV2.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenizer.java index 20247e739b4f..56ed2e94ce3e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NGramTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OcrSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OcrSkill.java index a15a5a51a24b..60bbd6f1bcb0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OcrSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OcrSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OcrSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OcrSkillLanguage.java index fd00b93fb066..368dda5ffbd7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OcrSkillLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OcrSkillLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OutputFieldMappingEntry.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OutputFieldMappingEntry.java index bba4b21b0e0a..81d79af75e3d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OutputFieldMappingEntry.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OutputFieldMappingEntry.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PathHierarchyTokenizerV2.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PathHierarchyTokenizerV2.java index c3f00bd4c403..9631f0ca3642 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PathHierarchyTokenizerV2.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PathHierarchyTokenizerV2.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternAnalyzer.java index 9b3c37dd7dfc..a827c706fa76 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternAnalyzer.java @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; import com.azure.core.annotation.Fluent; -import com.azure.search.documents.implementation.util.CustomPatternAnalyzerDeserializer; -import com.azure.search.documents.implementation.util.CustomPatternAnalyzerSerializer; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + import java.util.List; /** @@ -23,8 +17,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") @JsonTypeName("#Microsoft.Azure.Search.PatternAnalyzer") @Fluent -@JsonSerialize(using = CustomPatternAnalyzerSerializer.class) -@JsonDeserialize(using = CustomPatternAnalyzerDeserializer.class) public final class PatternAnalyzer extends LexicalAnalyzer { /* * A value indicating whether terms should be lower-cased. Default is true. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternCaptureTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternCaptureTokenFilter.java index df2141ac4b61..5e3a6680012b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternCaptureTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternCaptureTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternReplaceCharFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternReplaceCharFilter.java index a5fb532f1083..acfae5f4b4fb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternReplaceCharFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternReplaceCharFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternReplaceTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternReplaceTokenFilter.java index 94f6bb57f18e..83b3eec36eb7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternReplaceTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternReplaceTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternTokenizer.java index 95519c9c04d7..60da0eef9deb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PatternTokenizer.java @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; import com.azure.core.annotation.Fluent; -import com.azure.search.documents.implementation.util.CustomPatternTokenizerDeserializer; -import com.azure.search.documents.implementation.util.CustomPatternTokenizerSerializer; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + import java.util.List; /** @@ -23,8 +17,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") @JsonTypeName("#Microsoft.Azure.Search.PatternTokenizer") @Fluent -@JsonSerialize(using = CustomPatternTokenizerSerializer.class) -@JsonDeserialize(using = CustomPatternTokenizerDeserializer.class) public final class PatternTokenizer extends LexicalTokenizer { /* * A regular expression pattern to match token separators. Default is an diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PhoneticEncoder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PhoneticEncoder.java index 25f17076fa39..38708d631af0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PhoneticEncoder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PhoneticEncoder.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PhoneticTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PhoneticTokenFilter.java index 8edba4a93eed..4a522b460301 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PhoneticTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/PhoneticTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryType.java index cb33896e2fa6..d58e9204f91c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryType.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/RegexFlags.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/RegexFlags.java index d8f63311d7c7..8de51b5a295d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/RegexFlags.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/RegexFlags.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/RequestOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/RequestOptions.java index 09395a74e3df..c7aa120cf5b9 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/RequestOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/RequestOptions.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ResourceCounter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ResourceCounter.java index 2cae665483de..c7e0dd09e38d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ResourceCounter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ResourceCounter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunction.java index ca2112094b96..a2f94f15611b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunction.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunctionAggregation.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunctionAggregation.java index e9172d86b9e2..59e09d6dc7cf 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunctionAggregation.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunctionAggregation.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunctionInterpolation.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunctionInterpolation.java index caf439637299..d6b17458eb3b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunctionInterpolation.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringFunctionInterpolation.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringParameter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringParameter.java index f81b34ec6d2d..f87aaab9e964 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringParameter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringParameter.java @@ -27,10 +27,16 @@ public final class ScoringParameter { private static final String COMMA = ","; private static final String SINGLE_QUOTE = "'"; + /** + * Constructor to take name value pair string of ScoringParameter. Name and values are separated by dash, and + * values are separared by comma. + * + * @param nameValuePair The dash separated name value pairs. + */ public ScoringParameter(String nameValuePair) { Objects.requireNonNull(nameValuePair); if (!nameValuePair.contains(DASH)) { - logger.logExceptionAsError(new IllegalArgumentException( + throw logger.logExceptionAsError(new IllegalArgumentException( String.format("The name and value string: %s is invalid.", nameValuePair))); } this.name = nameValuePair.split(DASH)[0]; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringProfile.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringProfile.java index 2c8891d53371..bb7a93713180 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringProfile.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ScoringProfile.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchField.java index b1acd636602e..b93fb78688dd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchField.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchFieldDataType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchFieldDataType.java index 3de6ca774d4b..18d973cd62ba 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchFieldDataType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchFieldDataType.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndex.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndex.java index c48afeef091a..7cf8da2b1275 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndex.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndex.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexer.java index 3195dd410100..c770945e9b4a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataContainer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataContainer.java index 7820c15491e2..dfc2552639c3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataContainer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataContainer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataSource.java index 5e4f3452fe88..77cfbdd3ca70 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataSource.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataSourceType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataSourceType.java index 18d054d973fe..f7554b953718 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataSourceType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerDataSourceType.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerError.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerError.java index c9a0691d3444..0ececf09d4d0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerError.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerError.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerLimits.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerLimits.java index 108d2f23ab78..69e17a9f4766 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerLimits.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerLimits.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkill.java index eae176e8b527..0b09496c9bd1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkillset.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkillset.java index 1d690457c6bc..6c00ca67e8a8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkillset.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerSkillset.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerStatus.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerStatus.java index 953fe6cc936c..5f22c5d779b8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerStatus.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerStatus.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerWarning.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerWarning.java index 8bc3466e6687..9c7deeadebed 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerWarning.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchIndexerWarning.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchMode.java index fb9a9154f43a..54be2d1696eb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchMode.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchMode.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java index e42dac78575f..fbee06507db1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchResourceEncryptionKey.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchResourceEncryptionKey.java index 24c3e51531d9..d17b2aeaa75b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchResourceEncryptionKey.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchResourceEncryptionKey.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchResult.java index f2bd66350281..022ff2a6f804 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchResult.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SentimentSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SentimentSkill.java index d8c1b9aa444f..5108a0326bf2 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SentimentSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SentimentSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SentimentSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SentimentSkillLanguage.java index 795e6c8161a6..8ef425f0989b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SentimentSkillLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SentimentSkillLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceCounters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceCounters.java index 42eb1a1728c2..1d3985e661cd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceCounters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceCounters.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceLimits.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceLimits.java index e1988aadb171..4fbee84c1696 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceLimits.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceLimits.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceStatistics.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceStatistics.java index aca84201ac84..d1ac0ab0ee17 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceStatistics.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ServiceStatistics.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ShaperSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ShaperSkill.java index 191e074ed91e..645a5808f4bf 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ShaperSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ShaperSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ShingleTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ShingleTokenFilter.java index 5fb014f928c4..dc7d5b1a16f1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ShingleTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/ShingleTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/Similarity.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/Similarity.java index 2cc9a0d15960..e197c2511553 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/Similarity.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/Similarity.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SimpleField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SimpleField.java index 212ff0b08fa1..70b8c3ccf3cd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SimpleField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SimpleField.java @@ -80,7 +80,9 @@ public boolean isFilterable() { } /** - * Gets or sets a value indicating whether the field can be referenced in {@code $filter} queries. The default is false. + * Gets or sets a value indicating whether the field can be referenced in {@code $filter} queries. + * The default is false. + * * @param filterable The boolean to indicate whether the field is filterable or not. * @return The SimpleField object itself. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SnowballTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SnowballTokenFilter.java index 4cb02456e0f2..c9267b65dfe7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SnowballTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SnowballTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SnowballTokenFilterLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SnowballTokenFilterLanguage.java index b0927fa53947..b46c26d70907 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SnowballTokenFilterLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SnowballTokenFilterLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SoftDeleteColumnDeletionDetectionPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SoftDeleteColumnDeletionDetectionPolicy.java index 6c6cda8f510a..81112263fa85 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SoftDeleteColumnDeletionDetectionPolicy.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SoftDeleteColumnDeletionDetectionPolicy.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SplitSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SplitSkill.java index b3ab43547245..0ce279aa7d90 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SplitSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SplitSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SplitSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SplitSkillLanguage.java index b9fe4d4495ad..f95877451f43 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SplitSkillLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SplitSkillLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SqlIntegratedChangeTrackingPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SqlIntegratedChangeTrackingPolicy.java index 57e6502d8924..653d07103c84 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SqlIntegratedChangeTrackingPolicy.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SqlIntegratedChangeTrackingPolicy.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerOverrideTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerOverrideTokenFilter.java index 8256c7aaca3b..ee94237309dc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerOverrideTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerOverrideTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerTokenFilter.java index 985e41090c12..ce94f0ec489e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerTokenFilterLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerTokenFilterLanguage.java index 1828b53f7db6..f2f0a4499e64 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerTokenFilterLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StemmerTokenFilterLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopAnalyzer.java index d54976974ff2..4bc07f11bbd5 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopAnalyzer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopwordsList.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopwordsList.java index 126e93c430da..15aa70e540c4 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopwordsList.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopwordsList.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopwordsTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopwordsTokenFilter.java index ecef04ebd1ed..05124186fa46 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopwordsTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/StopwordsTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestOptions.java index 12a3134c66b0..4707580e2eb7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestOptions.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestResult.java index 21380dd911cd..5b7863f80df7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestResult.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; import com.azure.search.documents.SearchDocument; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/Suggester.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/Suggester.java index e8746233f120..e40d28564d3d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/Suggester.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/Suggester.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SynonymMap.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SynonymMap.java index 673fb1a1fcba..995938836258 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SynonymMap.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SynonymMap.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SynonymTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SynonymTokenFilter.java index 8b6e2413967c..1525f5cf3b15 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SynonymTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SynonymTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TagScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TagScoringFunction.java index 61d528399135..9e3cb20945cf 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TagScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TagScoringFunction.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TagScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TagScoringParameters.java index b6be4b72cff2..d3af098a540a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TagScoringParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TagScoringParameters.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextExtractionAlgorithm.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextExtractionAlgorithm.java index 014cb57c4f41..236f2dce7ebc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextExtractionAlgorithm.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextExtractionAlgorithm.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextSplitMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextSplitMode.java index e39e5f12b3ea..06c68bab786f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextSplitMode.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextSplitMode.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextTranslationSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextTranslationSkill.java index 96ca4e5b8b28..decdfff23533 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextTranslationSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextTranslationSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextTranslationSkillLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextTranslationSkillLanguage.java index e98b1fe29ecb..90c8bb1b80b0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextTranslationSkillLanguage.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextTranslationSkillLanguage.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextWeights.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextWeights.java index 8c6b466f6569..931d0e3f7edb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextWeights.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TextWeights.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenCharacterKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenCharacterKind.java index 61dea9d6599d..71993de316dc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenCharacterKind.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenCharacterKind.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenFilter.java index 30f7acd9cbdf..e417f5818b47 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenFilterName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenFilterName.java index ca912dd62e91..ed370ae52fc3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenFilterName.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TokenFilterName.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TruncateTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TruncateTokenFilter.java index 79eef6759266..dc67a562b4eb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TruncateTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/TruncateTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/UaxUrlEmailTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/UaxUrlEmailTokenizer.java index 7c12a902dadf..2d2e94f7dbdd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/UaxUrlEmailTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/UaxUrlEmailTokenizer.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/UniqueTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/UniqueTokenFilter.java index a51a85c7f88f..f9b928b06f52 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/UniqueTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/UniqueTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VisualFeature.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VisualFeature.java index 3abb63c69747..b5ea79564ecf 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VisualFeature.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VisualFeature.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/WebApiSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/WebApiSkill.java index f9494bc55e5a..c40bf22ae6b1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/WebApiSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/WebApiSkill.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/WordDelimiterTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/WordDelimiterTokenFilter.java index 90aa262b28d6..4227d1604db4 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/WordDelimiterTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/WordDelimiterTokenFilter.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java index 4ba697efc88f..560da1c58132 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. /** * Package containing the data models for SearchServiceRestClient. diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/models/ScoringParameterTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/models/ScoringParameterTests.java index 024d077404e4..6cc6d210ad7f 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/models/ScoringParameterTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/models/ScoringParameterTests.java @@ -22,7 +22,7 @@ public void testConstructorWithMap() { List parameters = new ArrayList<>(Arrays.asList("hello", "tests")); ScoringParameter scoringParameter = new ScoringParameter("test", parameters); List scoringParameterValues = scoringParameter.getValues(); - for (int i = 0; i< parameters.size(); i++) { + for (int i = 0; i < parameters.size(); i++) { assertEquals(parameters.get(i), scoringParameterValues.get(i)); } parameters.add("test clone"); From 6d3728b7c7edbd6edf4c41b152deac08ecbdf7da Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Thu, 21 May 2020 08:54:43 -0700 Subject: [PATCH 10/19] Revert to autorestv3 --- .../swagger/autorest-custom-directives.md | 22 ------------------- .../azure-search-documents/swagger/readme.md | 2 -- 2 files changed, 24 deletions(-) delete mode 100644 sdk/search/azure-search-documents/swagger/autorest-custom-directives.md diff --git a/sdk/search/azure-search-documents/swagger/autorest-custom-directives.md b/sdk/search/azure-search-documents/swagger/autorest-custom-directives.md deleted file mode 100644 index 50764c40939a..000000000000 --- a/sdk/search/azure-search-documents/swagger/autorest-custom-directives.md +++ /dev/null @@ -1,22 +0,0 @@ -# Azure Search Documents for Java - -```yaml -# Declare a directive that can be invoked in the pipeline -declare-directive: - - # Renames a property in the given path - rename-custom-property: >- - { - from: 'swagger-document', - where: $.path, - transform: `$.name = $.name === "${$.from}" ? "${$.to}" : $.name` - } - - # Change from object reference to string - change-object-ref-to-string: >- - { - from: 'swagger-document', - where: $.path, - transform: `delete $['$ref']; $['type'] = "string"` - } -``` diff --git a/sdk/search/azure-search-documents/swagger/readme.md b/sdk/search/azure-search-documents/swagger/readme.md index 3fae913f186b..859bce60a869 100644 --- a/sdk/search/azure-search-documents/swagger/readme.md +++ b/sdk/search/azure-search-documents/swagger/readme.md @@ -105,8 +105,6 @@ license-header: |- Code generated by Microsoft (R) AutoRest Code Generator. Changes may cause incorrect behavior and will be lost if the code is regenerated. -require: ./autorest-custom-directives.md - vararg-properties: >- AutocompleteOptions.searchFields, SearchOptions.facets, SearchOptions.highlightFields, SearchOptions.orderBy, SearchOptions.scoringParameters, SearchOptions.searchFields, SearchOptions.select, From 98b526c272a613efdcdd407f33179764d4a7ef98 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Thu, 21 May 2020 14:34:11 -0700 Subject: [PATCH 11/19] Make converter changes --- .../converters/AnalyzeRequestConverter.java | 46 ++++---- .../AnalyzedTokenInfoConverter.java | 38 +++--- .../AsciiFoldingTokenFilterConverter.java | 22 ++-- .../converters/AutocompleteItemConverter.java | 22 ++-- .../converters/AutocompleteModeConverter.java | 4 + .../AutocompleteOptionsConverter.java | 71 ++++++------ .../AutocompleteResultConverter.java | 22 ++-- ...ectoryApplicationCredentialsConverter.java | 23 ++-- .../converters/BM25SimilarityConverter.java | 22 ++-- .../converters/CharFilterConverter.java | 6 +- .../converters/CharFilterNameConverter.java | 6 +- .../CjkBigramTokenFilterConverter.java | 30 ++--- .../CjkBigramTokenFilterScriptsConverter.java | 3 + .../ClassicSimilarityConverter.java | 6 +- .../converters/ClassicTokenizerConverter.java | 22 ++-- .../CognitiveServicesAccountConverter.java | 6 +- .../CognitiveServicesAccountKeyConverter.java | 22 ++-- .../CommonGramTokenFilterConverter.java | 38 +++--- .../converters/ConditionalSkillConverter.java | 45 ++++---- .../converters/CorsOptionsConverter.java | 22 ++-- .../converters/CustomAnalyzerConverter.java | 40 ++++--- .../DataChangeDetectionPolicyConverter.java | 6 +- .../DataDeletionDetectionPolicyConverter.java | 6 +- .../DataSourceCredentialsConverter.java | 13 ++- ...aultCognitiveServicesAccountConverter.java | 13 ++- ...onaryDecompounderTokenFilterConverter.java | 54 ++++----- .../DistanceScoringFunctionConverter.java | 37 +++--- .../DistanceScoringParametersConverter.java | 21 ++-- .../EdgeNGramTokenFilterConverter.java | 37 +++--- .../EdgeNGramTokenFilterSideConverter.java | 3 + .../EdgeNGramTokenFilterV2Converter.java | 37 +++--- .../EdgeNGramTokenizerConverter.java | 37 +++--- .../ElisionTokenFilterConverter.java | 22 ++-- .../converters/EntityCategoryConverter.java | 3 + .../EntityRecognitionSkillConverter.java | 77 +++++++------ ...tityRecognitionSkillLanguageConverter.java | 5 +- .../converters/FacetResultConverter.java | 21 ++-- .../converters/FieldMappingConverter.java | 29 ++--- .../FieldMappingFunctionConverter.java | 21 ++-- .../FreshnessScoringFunctionConverter.java | 37 +++--- .../FreshnessScoringParametersConverter.java | 13 ++- .../GetIndexStatisticsResultConverter.java | 21 ++-- ...terMarkChangeDetectionPolicyConverter.java | 13 ++- .../ImageAnalysisSkillConverter.java | 69 +++++------ .../ImageAnalysisSkillLanguageConverter.java | 5 +- .../converters/ImageDetailConverter.java | 3 + .../converters/IndexActionConverter.java | 25 ++-- .../converters/IndexActionTypeConverter.java | 3 + .../converters/IndexBatchBaseConverter.java | 13 ++- .../IndexDocumentsResultConverter.java | 13 ++- .../IndexerExecutionResultConverter.java | 86 +++++++------- .../IndexerExecutionStatusConverter.java | 3 + .../converters/IndexerStatusConverter.java | 3 + .../IndexingParametersConverter.java | 37 +++--- .../converters/IndexingResultConverter.java | 37 +++--- .../converters/IndexingScheduleConverter.java | 21 ++-- .../InputFieldMappingEntryConverter.java | 37 +++--- .../converters/KeepTokenFilterConverter.java | 30 ++--- .../KeyPhraseExtractionSkillConverter.java | 61 +++++----- ...hraseExtractionSkillLanguageConverter.java | 5 +- .../KeywordMarkerTokenFilterConverter.java | 30 ++--- .../converters/KeywordTokenizerConverter.java | 21 ++-- .../KeywordTokenizerV2Converter.java | 21 ++-- .../LanguageDetectionSkillConverter.java | 45 ++++---- .../LengthTokenFilterConverter.java | 29 ++--- .../converters/LexicalAnalyzerConverter.java | 6 +- .../LexicalAnalyzerNameConverter.java | 5 +- .../converters/LexicalTokenizerConverter.java | 6 +- .../LexicalTokenizerNameConverter.java | 5 +- .../converters/LimitTokenFilterConverter.java | 29 ++--- .../LuceneStandardAnalyzerConverter.java | 30 ++--- .../LuceneStandardTokenizerConverter.java | 21 ++-- .../LuceneStandardTokenizerV2Converter.java | 21 ++-- .../MagnitudeScoringFunctionConverter.java | 37 +++--- .../MagnitudeScoringParametersConverter.java | 29 ++--- .../MappingCharFilterConverter.java | 22 ++-- .../converters/MergeSkillConverter.java | 61 +++++----- ...oftLanguageStemmingTokenizerConverter.java | 37 +++--- .../MicrosoftLanguageTokenizerConverter.java | 37 +++--- ...oftStemmingTokenizerLanguageConverter.java | 3 + .../MicrosoftTokenizerLanguageConverter.java | 3 + .../converters/NGramTokenFilterConverter.java | 29 ++--- .../NGramTokenFilterV2Converter.java | 29 ++--- .../converters/NGramTokenizerConverter.java | 37 +++--- .../converters/OcrSkillConverter.java | 69 +++++------ .../converters/OcrSkillLanguageConverter.java | 5 +- .../OutputFieldMappingEntryConverter.java | 21 ++-- .../PathHierarchyTokenizerV2Converter.java | 53 +++++---- .../converters/PatternAnalyzerConverter.java | 40 ++++--- .../PatternCaptureTokenFilterConverter.java | 30 ++--- .../PatternReplaceCharFilterConverter.java | 29 ++--- .../PatternReplaceTokenFilterConverter.java | 29 ++--- .../converters/PatternTokenizerConverter.java | 32 ++--- .../converters/PhoneticEncoderConverter.java | 3 + .../PhoneticTokenFilterConverter.java | 29 ++--- .../converters/QueryTypeConverter.java | 3 + .../converters/RegexFlagsConverter.java | 5 +- .../converters/RequestOptionsConverter.java | 13 ++- .../converters/ResourceCounterConverter.java | 21 ++-- .../ScoringFunctionAggregationConverter.java | 3 + .../converters/ScoringFunctionConverter.java | 6 +- ...ScoringFunctionInterpolationConverter.java | 3 + .../converters/ScoringProfileConverter.java | 37 +++--- .../converters/SearchFieldConverter.java | 107 ++++++++--------- .../SearchFieldDataTypeConverter.java | 5 +- .../converters/SearchIndexConverter.java | 109 +++++++++--------- .../converters/SearchIndexerConverter.java | 93 +++++++-------- .../SearchIndexerDataContainerConverter.java | 21 ++-- .../SearchIndexerDataSourceConverter.java | 70 +++++------ .../SearchIndexerDataSourceTypeConverter.java | 5 +- .../SearchIndexerErrorConverter.java | 53 +++++---- .../SearchIndexerLimitsConverter.java | 29 ++--- .../SearchIndexerSkillConverter.java | 6 +- .../SearchIndexerSkillsetConverter.java | 45 ++++---- .../SearchIndexerStatusConverter.java | 37 +++--- .../SearchIndexerWarningConverter.java | 45 ++++---- .../converters/SearchModeConverter.java | 3 + .../SearchResourceEncryptionKeyConverter.java | 37 +++--- .../converters/SearchResultConverter.java | 29 ++--- .../converters/SentimentSkillConverter.java | 53 +++++---- .../SentimentSkillLanguageConverter.java | 6 +- .../converters/ServiceCountersConverter.java | 61 +++++----- .../converters/ServiceLimitsConverter.java | 37 +++--- .../ServiceStatisticsConverter.java | 21 ++-- .../converters/ShaperSkillConverter.java | 45 ++++---- .../ShingleTokenFilterConverter.java | 61 +++++----- .../converters/SimilarityConverter.java | 5 +- .../SnowballTokenFilterConverter.java | 21 ++-- .../SnowballTokenFilterLanguageConverter.java | 3 + ...olumnDeletionDetectionPolicyConverter.java | 21 ++-- .../converters/SplitSkillConverter.java | 69 +++++------ .../SplitSkillLanguageConverter.java | 5 +- ...tegratedChangeTrackingPolicyConverter.java | 5 +- .../StemmerOverrideTokenFilterConverter.java | 22 ++-- .../StemmerTokenFilterConverter.java | 21 ++-- .../StemmerTokenFilterLanguageConverter.java | 3 + .../converters/StopAnalyzerConverter.java | 22 ++-- .../converters/StopwordsListConverter.java | 15 +-- .../StopwordsTokenFilterConverter.java | 46 ++++---- .../converters/SuggestOptionsConverter.java | 77 +++++++------ .../converters/SuggestResultConverter.java | 21 ++-- .../converters/SuggesterConverter.java | 25 ++-- .../converters/SynonymMapConverter.java | 41 ++++--- .../SynonymTokenFilterConverter.java | 38 +++--- .../TagScoringFunctionConverter.java | 37 +++--- .../TagScoringParametersConverter.java | 13 ++- .../TextExtractionAlgorithmConverter.java | 3 + .../converters/TextSplitModeConverter.java | 3 + .../TextTranslationSkillConverter.java | 69 +++++------ ...TextTranslationSkillLanguageConverter.java | 5 +- .../converters/TextWeightsConverter.java | 19 +-- .../TokenCharacterKindConverter.java | 3 + .../converters/TokenFilterConverter.java | 6 +- .../converters/TokenFilterNameConverter.java | 5 +- .../TruncateTokenFilterConverter.java | 21 ++-- .../UaxUrlEmailTokenizerConverter.java | 21 ++-- .../UniqueTokenFilterConverter.java | 21 ++-- .../converters/VisualFeatureConverter.java | 3 + .../converters/WebApiSkillConverter.java | 97 ++++++++-------- .../WordDelimiterTokenFilterConverter.java | 94 +++++++-------- .../azure-search-documents/swagger/readme.md | 2 + 161 files changed, 2396 insertions(+), 1981 deletions(-) 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 index a7eb0684b508..57d1bcbf0f76 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -18,8 +17,6 @@ * {@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}. */ @@ -30,28 +27,28 @@ public static AnalyzeRequest map(com.azure.search.documents.implementation.model AnalyzeRequest analyzeRequest = new AnalyzeRequest(); if (obj.getCharFilters() != null) { - List _charFilters = + List charFilters = obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList()); - analyzeRequest.setCharFilters(_charFilters); + analyzeRequest.setCharFilters(charFilters); } if (obj.getAnalyzer() != null) { - LexicalAnalyzerName _analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); - analyzeRequest.setAnalyzer(_analyzer); + LexicalAnalyzerName analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); + analyzeRequest.setAnalyzer(analyzer); } if (obj.getTokenFilters() != null) { - List _tokenFilters = + List tokenFilters = obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList()); - analyzeRequest.setTokenFilters(_tokenFilters); + analyzeRequest.setTokenFilters(tokenFilters); } - String _text = obj.getText(); - analyzeRequest.setText(_text); + String text = obj.getText(); + analyzeRequest.setText(text); if (obj.getTokenizer() != null) { - LexicalTokenizerName _tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); - analyzeRequest.setTokenizer(_tokenizer); + LexicalTokenizerName tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); + analyzeRequest.setTokenizer(tokenizer); } return analyzeRequest; } @@ -67,31 +64,34 @@ public static com.azure.search.documents.implementation.models.AnalyzeRequest ma new com.azure.search.documents.implementation.models.AnalyzeRequest(); if (obj.getCharFilters() != null) { - List _charFilters = + List charFilters = obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList()); - analyzeRequest.setCharFilters(_charFilters); + analyzeRequest.setCharFilters(charFilters); } if (obj.getAnalyzer() != null) { - com.azure.search.documents.implementation.models.LexicalAnalyzerName _analyzer = + com.azure.search.documents.implementation.models.LexicalAnalyzerName analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); - analyzeRequest.setAnalyzer(_analyzer); + analyzeRequest.setAnalyzer(analyzer); } if (obj.getTokenFilters() != null) { - List _tokenFilters = + List tokenFilters = obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList()); - analyzeRequest.setTokenFilters(_tokenFilters); + analyzeRequest.setTokenFilters(tokenFilters); } - String _text = obj.getText(); - analyzeRequest.setText(_text); + String text = obj.getText(); + analyzeRequest.setText(text); if (obj.getTokenizer() != null) { - com.azure.search.documents.implementation.models.LexicalTokenizerName _tokenizer = + com.azure.search.documents.implementation.models.LexicalTokenizerName tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); - analyzeRequest.setTokenizer(_tokenizer); + analyzeRequest.setTokenizer(tokenizer); } return analyzeRequest; } + + private AnalyzeRequestConverter() { + } } 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 index 6ba570ac41f2..8aa34851d4d0 100644 --- 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 @@ -1,6 +1,5 @@ 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; @@ -9,8 +8,6 @@ * {@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}. @@ -21,17 +18,17 @@ public static AnalyzedTokenInfo map(com.azure.search.documents.implementation.mo } AnalyzedTokenInfo analyzedTokenInfo = new AnalyzedTokenInfo(); - int _endOffset = obj.getEndOffset(); - PrivateFieldAccessHelper.set(analyzedTokenInfo, "endOffset", _endOffset); + int endOffset = obj.getEndOffset(); + PrivateFieldAccessHelper.set(analyzedTokenInfo, "endOffset", endOffset); - int _startOffset = obj.getStartOffset(); - PrivateFieldAccessHelper.set(analyzedTokenInfo, "startOffset", _startOffset); + int startOffset = obj.getStartOffset(); + PrivateFieldAccessHelper.set(analyzedTokenInfo, "startOffset", startOffset); - int _position = obj.getPosition(); - PrivateFieldAccessHelper.set(analyzedTokenInfo, "position", _position); + int position = obj.getPosition(); + PrivateFieldAccessHelper.set(analyzedTokenInfo, "position", position); - String _token = obj.getToken(); - PrivateFieldAccessHelper.set(analyzedTokenInfo, "token", _token); + String token = obj.getToken(); + PrivateFieldAccessHelper.set(analyzedTokenInfo, "token", token); return analyzedTokenInfo; } @@ -46,17 +43,20 @@ public static com.azure.search.documents.implementation.models.AnalyzedTokenInfo 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 endOffset = obj.getEndOffset(); + PrivateFieldAccessHelper.set(analyzedTokenInfo, "endOffset", endOffset); - int _startOffset = obj.getStartOffset(); - PrivateFieldAccessHelper.set(analyzedTokenInfo, "startOffset", _startOffset); + int startOffset = obj.getStartOffset(); + PrivateFieldAccessHelper.set(analyzedTokenInfo, "startOffset", startOffset); - int _position = obj.getPosition(); - PrivateFieldAccessHelper.set(analyzedTokenInfo, "position", _position); + int position = obj.getPosition(); + PrivateFieldAccessHelper.set(analyzedTokenInfo, "position", position); - String _token = obj.getToken(); - PrivateFieldAccessHelper.set(analyzedTokenInfo, "token", _token); + String token = obj.getToken(); + PrivateFieldAccessHelper.set(analyzedTokenInfo, "token", token); return analyzedTokenInfo; } + + private AnalyzedTokenInfoConverter() { + } } 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 index 9c4fc1f29fea..3fdb57247b92 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.AsciiFoldingTokenFilter; /** @@ -11,8 +10,6 @@ * {@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}. @@ -23,11 +20,11 @@ public static AsciiFoldingTokenFilter map(com.azure.search.documents.implementat } AsciiFoldingTokenFilter asciiFoldingTokenFilter = new AsciiFoldingTokenFilter(); - String _name = obj.getName(); - asciiFoldingTokenFilter.setName(_name); + String name = obj.getName(); + asciiFoldingTokenFilter.setName(name); - Boolean _preserveOriginal = obj.isPreserveOriginal(); - asciiFoldingTokenFilter.setPreserveOriginal(_preserveOriginal); + Boolean preserveOriginal = obj.isPreserveOriginal(); + asciiFoldingTokenFilter.setPreserveOriginal(preserveOriginal); return asciiFoldingTokenFilter; } @@ -42,11 +39,14 @@ public static com.azure.search.documents.implementation.models.AsciiFoldingToken com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter asciiFoldingTokenFilter = new com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter(); - String _name = obj.getName(); - asciiFoldingTokenFilter.setName(_name); + String name = obj.getName(); + asciiFoldingTokenFilter.setName(name); - Boolean _preserveOriginal = obj.isPreserveOriginal(); - asciiFoldingTokenFilter.setPreserveOriginal(_preserveOriginal); + Boolean preserveOriginal = obj.isPreserveOriginal(); + asciiFoldingTokenFilter.setPreserveOriginal(preserveOriginal); return asciiFoldingTokenFilter; } + + private AsciiFoldingTokenFilterConverter() { + } } 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 index 61aca3f4c2ff..9c1cb6be3512 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -12,8 +11,6 @@ * {@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}. */ @@ -23,11 +20,11 @@ public static AutocompleteItem map(com.azure.search.documents.implementation.mod } AutocompleteItem autocompleteItem = new AutocompleteItem(); - String _text = obj.getText(); - PrivateFieldAccessHelper.set(autocompleteItem, "text", _text); + String text = obj.getText(); + PrivateFieldAccessHelper.set(autocompleteItem, "text", text); - String _queryPlusText = obj.getQueryPlusText(); - PrivateFieldAccessHelper.set(autocompleteItem, "queryPlusText", _queryPlusText); + String queryPlusText = obj.getQueryPlusText(); + PrivateFieldAccessHelper.set(autocompleteItem, "queryPlusText", queryPlusText); return autocompleteItem; } @@ -41,11 +38,14 @@ public static com.azure.search.documents.implementation.models.AutocompleteItem 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 text = obj.getText(); + PrivateFieldAccessHelper.set(autocompleteItem, "text", text); - String _queryPlusText = obj.getQueryPlusText(); - PrivateFieldAccessHelper.set(autocompleteItem, "queryPlusText", _queryPlusText); + String queryPlusText = obj.getQueryPlusText(); + PrivateFieldAccessHelper.set(autocompleteItem, "queryPlusText", queryPlusText); return autocompleteItem; } + + private AutocompleteItemConverter() { + } } 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 index a9f5a14b629e..ca412273ea49 100644 --- 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 @@ -55,4 +55,8 @@ public static com.azure.search.documents.implementation.models.AutocompleteMode throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private AutocompleteModeConverter() { + } + } 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 index 3534cdf097e5..a75f5efbbe83 100644 --- 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 @@ -3,22 +3,18 @@ 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}. @@ -29,33 +25,33 @@ public static AutocompleteOptions map(com.azure.search.documents.implementation. } AutocompleteOptions autocompleteOptions = new AutocompleteOptions(); - String _filter = obj.getFilter(); - autocompleteOptions.setFilter(_filter); + String filter = obj.getFilter(); + autocompleteOptions.setFilter(filter); - Boolean _useFuzzyMatching = obj.isUseFuzzyMatching(); - autocompleteOptions.setUseFuzzyMatching(_useFuzzyMatching); + Boolean useFuzzyMatching = obj.isUseFuzzyMatching(); + autocompleteOptions.setUseFuzzyMatching(useFuzzyMatching); - Double _minimumCoverage = obj.getMinimumCoverage(); - autocompleteOptions.setMinimumCoverage(_minimumCoverage); + Double minimumCoverage = obj.getMinimumCoverage(); + autocompleteOptions.setMinimumCoverage(minimumCoverage); if (obj.getAutocompleteMode() != null) { - AutocompleteMode _autocompleteMode = AutocompleteModeConverter.map(obj.getAutocompleteMode()); - autocompleteOptions.setAutocompleteMode(_autocompleteMode); + AutocompleteMode autocompleteMode = AutocompleteModeConverter.map(obj.getAutocompleteMode()); + autocompleteOptions.setAutocompleteMode(autocompleteMode); } - Integer _top = obj.getTop(); - autocompleteOptions.setTop(_top); + Integer top = obj.getTop(); + autocompleteOptions.setTop(top); - String _highlightPostTag = obj.getHighlightPostTag(); - autocompleteOptions.setHighlightPostTag(_highlightPostTag); + String highlightPostTag = obj.getHighlightPostTag(); + autocompleteOptions.setHighlightPostTag(highlightPostTag); if (obj.getSearchFields() != null) { - List _searchFields = new ArrayList<>(obj.getSearchFields()); - PrivateFieldAccessHelper.set(autocompleteOptions, "searchFields", _searchFields); + List searchFields = new ArrayList<>(obj.getSearchFields()); + PrivateFieldAccessHelper.set(autocompleteOptions, "searchFields", searchFields); } - String _highlightPreTag = obj.getHighlightPreTag(); - autocompleteOptions.setHighlightPreTag(_highlightPreTag); + String highlightPreTag = obj.getHighlightPreTag(); + autocompleteOptions.setHighlightPreTag(highlightPreTag); return autocompleteOptions; } @@ -70,34 +66,37 @@ public static com.azure.search.documents.implementation.models.AutocompleteOptio com.azure.search.documents.implementation.models.AutocompleteOptions autocompleteOptions = new com.azure.search.documents.implementation.models.AutocompleteOptions(); - String _filter = obj.getFilter(); - autocompleteOptions.setFilter(_filter); + String filter = obj.getFilter(); + autocompleteOptions.setFilter(filter); - Boolean _useFuzzyMatching = obj.useFuzzyMatching(); - autocompleteOptions.setUseFuzzyMatching(_useFuzzyMatching); + Boolean useFuzzyMatching = obj.useFuzzyMatching(); + autocompleteOptions.setUseFuzzyMatching(useFuzzyMatching); - Double _minimumCoverage = obj.getMinimumCoverage(); - autocompleteOptions.setMinimumCoverage(_minimumCoverage); + Double minimumCoverage = obj.getMinimumCoverage(); + autocompleteOptions.setMinimumCoverage(minimumCoverage); if (obj.getAutocompleteMode() != null) { - com.azure.search.documents.implementation.models.AutocompleteMode _autocompleteMode = + com.azure.search.documents.implementation.models.AutocompleteMode autocompleteMode = AutocompleteModeConverter.map(obj.getAutocompleteMode()); - autocompleteOptions.setAutocompleteMode(_autocompleteMode); + autocompleteOptions.setAutocompleteMode(autocompleteMode); } - Integer _top = obj.getTop(); - autocompleteOptions.setTop(_top); + Integer top = obj.getTop(); + autocompleteOptions.setTop(top); - String _highlightPostTag = obj.getHighlightPostTag(); - autocompleteOptions.setHighlightPostTag(_highlightPostTag); + String highlightPostTag = obj.getHighlightPostTag(); + autocompleteOptions.setHighlightPostTag(highlightPostTag); if (obj.getSearchFields() != null) { - List _searchFields = new ArrayList<>(obj.getSearchFields()); - PrivateFieldAccessHelper.set(autocompleteOptions, "searchFields", _searchFields); + List searchFields = new ArrayList<>(obj.getSearchFields()); + PrivateFieldAccessHelper.set(autocompleteOptions, "searchFields", searchFields); } - String _highlightPreTag = obj.getHighlightPreTag(); - autocompleteOptions.setHighlightPreTag(_highlightPreTag); + String highlightPreTag = obj.getHighlightPreTag(); + autocompleteOptions.setHighlightPreTag(highlightPreTag); return autocompleteOptions; } + + private AutocompleteOptionsConverter() { + } } 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 index f1ac3e181a29..5a792a9289b5 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -16,8 +15,6 @@ * {@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}. @@ -28,13 +25,13 @@ public static AutocompleteResult map(com.azure.search.documents.implementation.m } AutocompleteResult autocompleteResult = new AutocompleteResult(); - Double _coverage = obj.getCoverage(); - PrivateFieldAccessHelper.set(autocompleteResult, "coverage", _coverage); + Double coverage = obj.getCoverage(); + PrivateFieldAccessHelper.set(autocompleteResult, "coverage", coverage); if (obj.getResults() != null) { - List _results = + List results = obj.getResults().stream().map(AutocompleteItemConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(autocompleteResult, "results", _results); + PrivateFieldAccessHelper.set(autocompleteResult, "results", results); } return autocompleteResult; } @@ -50,14 +47,17 @@ public static com.azure.search.documents.implementation.models.AutocompleteResul 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); + Double coverage = obj.getCoverage(); + PrivateFieldAccessHelper.set(autocompleteResult, "coverage", coverage); if (obj.getResults() != null) { - List _results = + List results = obj.getResults().stream().map(AutocompleteItemConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(autocompleteResult, "results", _results); + PrivateFieldAccessHelper.set(autocompleteResult, "results", results); } return autocompleteResult; } + + private AutocompleteResultConverter() { + } } 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 index 2fb6d19c2d54..fffbec633908 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.AzureActiveDirectoryApplicationCredentials; /** @@ -12,9 +11,6 @@ * {@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}. @@ -26,11 +22,11 @@ public static AzureActiveDirectoryApplicationCredentials map(com.azure.search.do AzureActiveDirectoryApplicationCredentials azureActiveDirectoryApplicationCredentials = new AzureActiveDirectoryApplicationCredentials(); - String _applicationId = obj.getApplicationId(); - azureActiveDirectoryApplicationCredentials.setApplicationId(_applicationId); + String applicationId = obj.getApplicationId(); + azureActiveDirectoryApplicationCredentials.setApplicationId(applicationId); - String _applicationSecret = obj.getApplicationSecret(); - azureActiveDirectoryApplicationCredentials.setApplicationSecret(_applicationSecret); + String applicationSecret = obj.getApplicationSecret(); + azureActiveDirectoryApplicationCredentials.setApplicationSecret(applicationSecret); return azureActiveDirectoryApplicationCredentials; } @@ -44,11 +40,14 @@ public static com.azure.search.documents.implementation.models.AzureActiveDirect } com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials azureActiveDirectoryApplicationCredentials = new com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials(); - String _applicationId = obj.getApplicationId(); - azureActiveDirectoryApplicationCredentials.setApplicationId(_applicationId); + String applicationId = obj.getApplicationId(); + azureActiveDirectoryApplicationCredentials.setApplicationId(applicationId); - String _applicationSecret = obj.getApplicationSecret(); - azureActiveDirectoryApplicationCredentials.setApplicationSecret(_applicationSecret); + String applicationSecret = obj.getApplicationSecret(); + azureActiveDirectoryApplicationCredentials.setApplicationSecret(applicationSecret); return azureActiveDirectoryApplicationCredentials; } + + private AzureActiveDirectoryApplicationCredentialsConverter() { + } } 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 index ab7d43a83d6d..a142427789e0 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.BM25Similarity; /** @@ -11,8 +10,6 @@ * {@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}. */ @@ -22,11 +19,11 @@ public static BM25Similarity map(com.azure.search.documents.implementation.model } BM25Similarity bM25Similarity = new BM25Similarity(); - Double _b = obj.getB(); - bM25Similarity.setB(_b); + Double b = obj.getB(); + bM25Similarity.setB(b); - Double _k1 = obj.getK1(); - bM25Similarity.setK1(_k1); + Double k1 = obj.getK1(); + bM25Similarity.setK1(k1); return bM25Similarity; } @@ -40,11 +37,14 @@ public static com.azure.search.documents.implementation.models.BM25Similarity ma com.azure.search.documents.implementation.models.BM25Similarity bM25Similarity = new com.azure.search.documents.implementation.models.BM25Similarity(); - Double _b = obj.getB(); - bM25Similarity.setB(_b); + Double b = obj.getB(); + bM25Similarity.setB(b); - Double _k1 = obj.getK1(); - bM25Similarity.setK1(_k1); + Double k1 = obj.getK1(); + bM25Similarity.setK1(k1); return bM25Similarity; } + + private BM25SimilarityConverter() { + } } 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 index e70cd7aa58b0..45f89b9bbc8d 100644 --- 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 @@ -43,6 +43,10 @@ public static com.azure.search.documents.implementation.models.CharFilter map(Ch 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private CharFilterConverter() { } } 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 index b645a39163f3..ebd4a4c51cd4 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.CharFilterName; /** @@ -11,8 +10,6 @@ * {@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}. @@ -34,4 +31,7 @@ public static com.azure.search.documents.implementation.models.CharFilterName ma } return com.azure.search.documents.implementation.models.CharFilterName.fromString(obj.toString()); } + + private CharFilterNameConverter() { + } } 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 index c35daa826b15..05950297e2e7 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -15,8 +14,6 @@ * {@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}. @@ -27,16 +24,16 @@ public static CjkBigramTokenFilter map(com.azure.search.documents.implementation } CjkBigramTokenFilter cjkBigramTokenFilter = new CjkBigramTokenFilter(); - String _name = obj.getName(); - cjkBigramTokenFilter.setName(_name); + String name = obj.getName(); + cjkBigramTokenFilter.setName(name); - Boolean _outputUnigrams = obj.isOutputUnigrams(); - cjkBigramTokenFilter.setOutputUnigrams(_outputUnigrams); + Boolean outputUnigrams = obj.isOutputUnigrams(); + cjkBigramTokenFilter.setOutputUnigrams(outputUnigrams); if (obj.getIgnoreScripts() != null) { - List _ignoreScripts = + List ignoreScripts = obj.getIgnoreScripts().stream().map(CjkBigramTokenFilterScriptsConverter::map).collect(Collectors.toList()); - cjkBigramTokenFilter.setIgnoreScripts(_ignoreScripts); + cjkBigramTokenFilter.setIgnoreScripts(ignoreScripts); } return cjkBigramTokenFilter; } @@ -52,17 +49,20 @@ public static com.azure.search.documents.implementation.models.CjkBigramTokenFil com.azure.search.documents.implementation.models.CjkBigramTokenFilter cjkBigramTokenFilter = new com.azure.search.documents.implementation.models.CjkBigramTokenFilter(); - String _name = obj.getName(); - cjkBigramTokenFilter.setName(_name); + String name = obj.getName(); + cjkBigramTokenFilter.setName(name); - Boolean _outputUnigrams = obj.isOutputUnigrams(); - cjkBigramTokenFilter.setOutputUnigrams(_outputUnigrams); + Boolean outputUnigrams = obj.isOutputUnigrams(); + cjkBigramTokenFilter.setOutputUnigrams(outputUnigrams); if (obj.getIgnoreScripts() != null) { - List _ignoreScripts = + List ignoreScripts = obj.getIgnoreScripts().stream().map(CjkBigramTokenFilterScriptsConverter::map).collect(Collectors.toList()); - cjkBigramTokenFilter.setIgnoreScripts(_ignoreScripts); + cjkBigramTokenFilter.setIgnoreScripts(ignoreScripts); } return cjkBigramTokenFilter; } + + private CjkBigramTokenFilterConverter() { + } } 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 index 536ad9d2f6f4..8794dd331243 100644 --- 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 @@ -59,4 +59,7 @@ public static com.azure.search.documents.implementation.models.CjkBigramTokenFil throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private CjkBigramTokenFilterScriptsConverter() { + } } 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 index 67fbc60bd6b0..0e87378869aa 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.ClassicSimilarity; /** @@ -11,8 +10,6 @@ * {@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}. @@ -37,4 +34,7 @@ public static com.azure.search.documents.implementation.models.ClassicSimilarity new com.azure.search.documents.implementation.models.ClassicSimilarity(); return classicSimilarity; } + + private ClassicSimilarityConverter() { + } } 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 index 6ca49b83f07a..b6a13f4797c5 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.ClassicTokenizer; /** @@ -11,8 +10,6 @@ * {@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}. */ @@ -22,11 +19,11 @@ public static ClassicTokenizer map(com.azure.search.documents.implementation.mod } ClassicTokenizer classicTokenizer = new ClassicTokenizer(); - String _name = obj.getName(); - classicTokenizer.setName(_name); + String name = obj.getName(); + classicTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - classicTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + classicTokenizer.setMaxTokenLength(maxTokenLength); return classicTokenizer; } @@ -40,11 +37,14 @@ public static com.azure.search.documents.implementation.models.ClassicTokenizer com.azure.search.documents.implementation.models.ClassicTokenizer classicTokenizer = new com.azure.search.documents.implementation.models.ClassicTokenizer(); - String _name = obj.getName(); - classicTokenizer.setName(_name); + String name = obj.getName(); + classicTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - classicTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + classicTokenizer.setMaxTokenLength(maxTokenLength); return classicTokenizer; } + + private ClassicTokenizerConverter() { + } } 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 index ab9c7238b28f..da5594a75733 100644 --- 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 @@ -45,6 +45,10 @@ public static com.azure.search.documents.implementation.models.CognitiveServices 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private CognitiveServicesAccountConverter() { } } 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 index e621fa142ae7..e145539e9d9a 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.CognitiveServicesAccountKey; /** @@ -11,8 +10,6 @@ * {@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}. @@ -23,11 +20,11 @@ public static CognitiveServicesAccountKey map(com.azure.search.documents.impleme } CognitiveServicesAccountKey cognitiveServicesAccountKey = new CognitiveServicesAccountKey(); - String _description = obj.getDescription(); - cognitiveServicesAccountKey.setDescription(_description); + String description = obj.getDescription(); + cognitiveServicesAccountKey.setDescription(description); - String _key = obj.getKey(); - cognitiveServicesAccountKey.setKey(_key); + String key = obj.getKey(); + cognitiveServicesAccountKey.setKey(key); return cognitiveServicesAccountKey; } @@ -42,11 +39,14 @@ public static com.azure.search.documents.implementation.models.CognitiveServices com.azure.search.documents.implementation.models.CognitiveServicesAccountKey cognitiveServicesAccountKey = new com.azure.search.documents.implementation.models.CognitiveServicesAccountKey(); - String _description = obj.getDescription(); - cognitiveServicesAccountKey.setDescription(_description); + String description = obj.getDescription(); + cognitiveServicesAccountKey.setDescription(description); - String _key = obj.getKey(); - cognitiveServicesAccountKey.setKey(_key); + String key = obj.getKey(); + cognitiveServicesAccountKey.setKey(key); return cognitiveServicesAccountKey; } + + private CognitiveServicesAccountKeyConverter() { + } } 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 index 7d5787bdab34..695de314ad42 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,18 +26,18 @@ public static CommonGramTokenFilter map(com.azure.search.documents.implementatio } CommonGramTokenFilter commonGramTokenFilter = new CommonGramTokenFilter(); - String _name = obj.getName(); - commonGramTokenFilter.setName(_name); + String name = obj.getName(); + commonGramTokenFilter.setName(name); - Boolean _ignoreCase = obj.isIgnoreCase(); - commonGramTokenFilter.setIgnoreCase(_ignoreCase); + Boolean ignoreCase = obj.isIgnoreCase(); + commonGramTokenFilter.setIgnoreCase(ignoreCase); - Boolean _useQueryMode = obj.isUseQueryMode(); - commonGramTokenFilter.setUseQueryMode(_useQueryMode); + Boolean useQueryMode = obj.isUseQueryMode(); + commonGramTokenFilter.setUseQueryMode(useQueryMode); if (obj.getCommonWords() != null) { - List _commonWords = new ArrayList<>(obj.getCommonWords()); - commonGramTokenFilter.setCommonWords(_commonWords); + List commonWords = new ArrayList<>(obj.getCommonWords()); + commonGramTokenFilter.setCommonWords(commonWords); } return commonGramTokenFilter; } @@ -54,19 +53,22 @@ public static com.azure.search.documents.implementation.models.CommonGramTokenFi com.azure.search.documents.implementation.models.CommonGramTokenFilter commonGramTokenFilter = new com.azure.search.documents.implementation.models.CommonGramTokenFilter(); - String _name = obj.getName(); - commonGramTokenFilter.setName(_name); + String name = obj.getName(); + commonGramTokenFilter.setName(name); - Boolean _ignoreCase = obj.isIgnoreCase(); - commonGramTokenFilter.setIgnoreCase(_ignoreCase); + Boolean ignoreCase = obj.isIgnoreCase(); + commonGramTokenFilter.setIgnoreCase(ignoreCase); - Boolean _useQueryMode = obj.isUseQueryMode(); - commonGramTokenFilter.setUseQueryMode(_useQueryMode); + Boolean useQueryMode = obj.isUseQueryMode(); + commonGramTokenFilter.setUseQueryMode(useQueryMode); if (obj.getCommonWords() != null) { - List _commonWords = new ArrayList<>(obj.getCommonWords()); - commonGramTokenFilter.setCommonWords(_commonWords); + List commonWords = new ArrayList<>(obj.getCommonWords()); + commonGramTokenFilter.setCommonWords(commonWords); } return commonGramTokenFilter; } + + private CommonGramTokenFilterConverter() { + } } 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 index dc3ea8a2b2f4..effd24d39a4a 100644 --- 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 @@ -16,7 +16,7 @@ * {@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}. @@ -28,25 +28,25 @@ public static ConditionalSkill map(com.azure.search.documents.implementation.mod ConditionalSkill conditionalSkill = new ConditionalSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - conditionalSkill.setOutputs(_outputs); + conditionalSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - conditionalSkill.setInputs(_inputs); + conditionalSkill.setInputs(inputs); } - String _name = obj.getName(); - conditionalSkill.setName(_name); + String name = obj.getName(); + conditionalSkill.setName(name); - String _context = obj.getContext(); - conditionalSkill.setContext(_context); + String context = obj.getContext(); + conditionalSkill.setContext(context); - String _description = obj.getDescription(); - conditionalSkill.setDescription(_description); + String description = obj.getDescription(); + conditionalSkill.setDescription(description); return conditionalSkill; } @@ -61,25 +61,28 @@ public static com.azure.search.documents.implementation.models.ConditionalSkill new com.azure.search.documents.implementation.models.ConditionalSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - conditionalSkill.setOutputs(_outputs); + conditionalSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - conditionalSkill.setInputs(_inputs); + conditionalSkill.setInputs(inputs); } - String _name = obj.getName(); - conditionalSkill.setName(_name); + String name = obj.getName(); + conditionalSkill.setName(name); - String _context = obj.getContext(); - conditionalSkill.setContext(_context); + String context = obj.getContext(); + conditionalSkill.setContext(context); - String _description = obj.getDescription(); - conditionalSkill.setDescription(_description); + String description = obj.getDescription(); + conditionalSkill.setDescription(description); return conditionalSkill; } + + private ConditionalSkillConverter() { + } } 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 index fec428b613bb..0fbb9d5ce9d1 100644 --- 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 @@ -9,13 +9,12 @@ 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}. @@ -27,12 +26,12 @@ public static CorsOptions map(com.azure.search.documents.implementation.models.C CorsOptions corsOptions = new CorsOptions(); if (obj.getAllowedOrigins() != null) { - List _allowedOrigins = new ArrayList<>(obj.getAllowedOrigins()); - PrivateFieldAccessHelper.set(corsOptions, "allowedOrigins", _allowedOrigins); + List allowedOrigins = new ArrayList<>(obj.getAllowedOrigins()); + PrivateFieldAccessHelper.set(corsOptions, "allowedOrigins", allowedOrigins); } - Long _maxAgeInSeconds = obj.getMaxAgeInSeconds(); - corsOptions.setMaxAgeInSeconds(_maxAgeInSeconds); + Long maxAgeInSeconds = obj.getMaxAgeInSeconds(); + corsOptions.setMaxAgeInSeconds(maxAgeInSeconds); return corsOptions; } @@ -47,12 +46,15 @@ public static com.azure.search.documents.implementation.models.CorsOptions map(C new com.azure.search.documents.implementation.models.CorsOptions(); if (obj.getAllowedOrigins() != null) { - List _allowedOrigins = new ArrayList<>(obj.getAllowedOrigins()); - PrivateFieldAccessHelper.set(corsOptions, "allowedOrigins", _allowedOrigins); + List allowedOrigins = new ArrayList<>(obj.getAllowedOrigins()); + PrivateFieldAccessHelper.set(corsOptions, "allowedOrigins", allowedOrigins); } - Long _maxAgeInSeconds = obj.getMaxAgeInSeconds(); - corsOptions.setMaxAgeInSeconds(_maxAgeInSeconds); + Long maxAgeInSeconds = obj.getMaxAgeInSeconds(); + corsOptions.setMaxAgeInSeconds(maxAgeInSeconds); return corsOptions; } + + private CorsOptionsConverter() { + } } 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 index e6ca219cd55b..ddba77a6e8d1 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -17,7 +16,6 @@ * {@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}. @@ -28,30 +26,31 @@ public static CustomAnalyzer map(com.azure.search.documents.implementation.model } CustomAnalyzer customAnalyzer = new CustomAnalyzer(); - String _name = obj.getName(); - customAnalyzer.setName(_name); + String name = obj.getName(); + customAnalyzer.setName(name); if (obj.getCharFilters() != null) { - List _charFilters = + List charFilters = obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList()); - customAnalyzer.setCharFilters(_charFilters); + customAnalyzer.setCharFilters(charFilters); } if (obj.getTokenFilters() != null) { - List _tokenFilters = + List tokenFilters = obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList()); - customAnalyzer.setTokenFilters(_tokenFilters); + customAnalyzer.setTokenFilters(tokenFilters); } if (obj.getTokenizer() != null) { - LexicalTokenizerName _tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); - customAnalyzer.setTokenizer(_tokenizer); + LexicalTokenizerName tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); + customAnalyzer.setTokenizer(tokenizer); } return customAnalyzer; } /** - * Maps from {@link CustomAnalyzer} to {@link com.azure.search.documents.implementation.models.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) { @@ -60,26 +59,29 @@ public static com.azure.search.documents.implementation.models.CustomAnalyzer ma com.azure.search.documents.implementation.models.CustomAnalyzer customAnalyzer = new com.azure.search.documents.implementation.models.CustomAnalyzer(); - String _name = obj.getName(); - customAnalyzer.setName(_name); + String name = obj.getName(); + customAnalyzer.setName(name); if (obj.getCharFilters() != null) { - List _charFilters = + List charFilters = obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList()); - customAnalyzer.setCharFilters(_charFilters); + customAnalyzer.setCharFilters(charFilters); } if (obj.getTokenFilters() != null) { - List _tokenFilters = + List tokenFilters = obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList()); - customAnalyzer.setTokenFilters(_tokenFilters); + customAnalyzer.setTokenFilters(tokenFilters); } if (obj.getTokenizer() != null) { - com.azure.search.documents.implementation.models.LexicalTokenizerName _tokenizer = + com.azure.search.documents.implementation.models.LexicalTokenizerName tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); - customAnalyzer.setTokenizer(_tokenizer); + customAnalyzer.setTokenizer(tokenizer); } return customAnalyzer; } + + private CustomAnalyzerConverter() { + } } 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 index dfc6dde79860..319c6c17fa27 100644 --- 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 @@ -45,6 +45,10 @@ public static com.azure.search.documents.implementation.models.DataChangeDetecti 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private DataChangeDetectionPolicyConverter() { } } 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 index 4fec8829cb71..6da70597cc74 100644 --- 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 @@ -38,6 +38,10 @@ public static com.azure.search.documents.implementation.models.DataDeletionDetec 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private DataDeletionDetectionPolicyConverter() { } } 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 index 18a984393d43..02095ec19514 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,8 +23,8 @@ public static DataSourceCredentials map(com.azure.search.documents.implementatio } DataSourceCredentials dataSourceCredentials = new DataSourceCredentials(); - String _connectionString = obj.getConnectionString(); - dataSourceCredentials.setConnectionString(_connectionString); + String connectionString = obj.getConnectionString(); + dataSourceCredentials.setConnectionString(connectionString); return dataSourceCredentials; } @@ -39,8 +39,11 @@ public static com.azure.search.documents.implementation.models.DataSourceCredent com.azure.search.documents.implementation.models.DataSourceCredentials dataSourceCredentials = new com.azure.search.documents.implementation.models.DataSourceCredentials(); - String _connectionString = obj.getConnectionString(); - dataSourceCredentials.setConnectionString(_connectionString); + String connectionString = obj.getConnectionString(); + dataSourceCredentials.setConnectionString(connectionString); return dataSourceCredentials; } + + private DataSourceCredentialsConverter() { + } } 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 index a20ce974edda..e74bb87a7c45 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,8 +23,8 @@ public static DefaultCognitiveServicesAccount map(com.azure.search.documents.imp } DefaultCognitiveServicesAccount defaultCognitiveServicesAccount = new DefaultCognitiveServicesAccount(); - String _description = obj.getDescription(); - defaultCognitiveServicesAccount.setDescription(_description); + String description = obj.getDescription(); + defaultCognitiveServicesAccount.setDescription(description); return defaultCognitiveServicesAccount; } @@ -38,8 +38,11 @@ public static com.azure.search.documents.implementation.models.DefaultCognitiveS } com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount defaultCognitiveServicesAccount = new com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount(); - String _description = obj.getDescription(); - defaultCognitiveServicesAccount.setDescription(_description); + String description = obj.getDescription(); + defaultCognitiveServicesAccount.setDescription(description); return defaultCognitiveServicesAccount; } + + private DefaultCognitiveServicesAccountConverter() { + } } 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 index 0de398e7cc6d..52e009536c4c 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,25 +26,25 @@ public static DictionaryDecompounderTokenFilter map(com.azure.search.documents.i } DictionaryDecompounderTokenFilter dictionaryDecompounderTokenFilter = new DictionaryDecompounderTokenFilter(); - String _name = obj.getName(); - dictionaryDecompounderTokenFilter.setName(_name); + String name = obj.getName(); + dictionaryDecompounderTokenFilter.setName(name); - Integer _minSubwordSize = obj.getMinSubwordSize(); - dictionaryDecompounderTokenFilter.setMinSubwordSize(_minSubwordSize); + Integer minSubwordSize = obj.getMinSubwordSize(); + dictionaryDecompounderTokenFilter.setMinSubwordSize(minSubwordSize); - Boolean _onlyLongestMatch = obj.isOnlyLongestMatch(); - dictionaryDecompounderTokenFilter.setOnlyLongestMatch(_onlyLongestMatch); + Boolean onlyLongestMatch = obj.isOnlyLongestMatch(); + dictionaryDecompounderTokenFilter.setOnlyLongestMatch(onlyLongestMatch); - Integer _maxSubwordSize = obj.getMaxSubwordSize(); - dictionaryDecompounderTokenFilter.setMaxSubwordSize(_maxSubwordSize); + Integer maxSubwordSize = obj.getMaxSubwordSize(); + dictionaryDecompounderTokenFilter.setMaxSubwordSize(maxSubwordSize); if (obj.getWordList() != null) { - List _wordList = new ArrayList<>(obj.getWordList()); - dictionaryDecompounderTokenFilter.setWordList(_wordList); + List wordList = new ArrayList<>(obj.getWordList()); + dictionaryDecompounderTokenFilter.setWordList(wordList); } - Integer _minWordSize = obj.getMinWordSize(); - dictionaryDecompounderTokenFilter.setMinWordSize(_minWordSize); + Integer minWordSize = obj.getMinWordSize(); + dictionaryDecompounderTokenFilter.setMinWordSize(minWordSize); return dictionaryDecompounderTokenFilter; } @@ -59,25 +58,28 @@ public static com.azure.search.documents.implementation.models.DictionaryDecompo } com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter dictionaryDecompounderTokenFilter = new com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter(); - String _name = obj.getName(); - dictionaryDecompounderTokenFilter.setName(_name); + String name = obj.getName(); + dictionaryDecompounderTokenFilter.setName(name); - Integer _minSubwordSize = obj.getMinSubwordSize(); - dictionaryDecompounderTokenFilter.setMinSubwordSize(_minSubwordSize); + Integer minSubwordSize = obj.getMinSubwordSize(); + dictionaryDecompounderTokenFilter.setMinSubwordSize(minSubwordSize); - Boolean _onlyLongestMatch = obj.isOnlyLongestMatch(); - dictionaryDecompounderTokenFilter.setOnlyLongestMatch(_onlyLongestMatch); + Boolean onlyLongestMatch = obj.isOnlyLongestMatch(); + dictionaryDecompounderTokenFilter.setOnlyLongestMatch(onlyLongestMatch); - Integer _maxSubwordSize = obj.getMaxSubwordSize(); - dictionaryDecompounderTokenFilter.setMaxSubwordSize(_maxSubwordSize); + Integer maxSubwordSize = obj.getMaxSubwordSize(); + dictionaryDecompounderTokenFilter.setMaxSubwordSize(maxSubwordSize); if (obj.getWordList() != null) { - List _wordList = new ArrayList<>(obj.getWordList()); - dictionaryDecompounderTokenFilter.setWordList(_wordList); + List wordList = new ArrayList<>(obj.getWordList()); + dictionaryDecompounderTokenFilter.setWordList(wordList); } - Integer _minWordSize = obj.getMinWordSize(); - dictionaryDecompounderTokenFilter.setMinWordSize(_minWordSize); + Integer minWordSize = obj.getMinWordSize(); + dictionaryDecompounderTokenFilter.setMinWordSize(minWordSize); return dictionaryDecompounderTokenFilter; } + + private DictionaryDecompounderTokenFilterConverter() { + } } 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 index 09fec805f2ec..1cb9816229f7 100644 --- 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 @@ -13,7 +13,7 @@ * {@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 @@ -26,20 +26,20 @@ public static DistanceScoringFunction map(com.azure.search.documents.implementat DistanceScoringFunction distanceScoringFunction = new DistanceScoringFunction(); if (obj.getInterpolation() != null) { - ScoringFunctionInterpolation _interpolation = + ScoringFunctionInterpolation interpolation = ScoringFunctionInterpolationConverter.map(obj.getInterpolation()); - distanceScoringFunction.setInterpolation(_interpolation); + distanceScoringFunction.setInterpolation(interpolation); } - String _fieldName = obj.getFieldName(); - distanceScoringFunction.setFieldName(_fieldName); + String fieldName = obj.getFieldName(); + distanceScoringFunction.setFieldName(fieldName); - double _boost = obj.getBoost(); - distanceScoringFunction.setBoost(_boost); + double boost = obj.getBoost(); + distanceScoringFunction.setBoost(boost); if (obj.getParameters() != null) { - DistanceScoringParameters _parameters = DistanceScoringParametersConverter.map(obj.getParameters()); - distanceScoringFunction.setParameters(_parameters); + DistanceScoringParameters parameters = DistanceScoringParametersConverter.map(obj.getParameters()); + distanceScoringFunction.setParameters(parameters); } return distanceScoringFunction; } @@ -56,22 +56,25 @@ public static com.azure.search.documents.implementation.models.DistanceScoringFu new com.azure.search.documents.implementation.models.DistanceScoringFunction(); if (obj.getInterpolation() != null) { - com.azure.search.documents.implementation.models.ScoringFunctionInterpolation _interpolation = + com.azure.search.documents.implementation.models.ScoringFunctionInterpolation interpolation = ScoringFunctionInterpolationConverter.map(obj.getInterpolation()); - distanceScoringFunction.setInterpolation(_interpolation); + distanceScoringFunction.setInterpolation(interpolation); } - String _fieldName = obj.getFieldName(); - distanceScoringFunction.setFieldName(_fieldName); + String fieldName = obj.getFieldName(); + distanceScoringFunction.setFieldName(fieldName); - double _boost = obj.getBoost(); - distanceScoringFunction.setBoost(_boost); + double boost = obj.getBoost(); + distanceScoringFunction.setBoost(boost); if (obj.getParameters() != null) { - com.azure.search.documents.implementation.models.DistanceScoringParameters _parameters = + com.azure.search.documents.implementation.models.DistanceScoringParameters parameters = DistanceScoringParametersConverter.map(obj.getParameters()); - distanceScoringFunction.setParameters(_parameters); + distanceScoringFunction.setParameters(parameters); } return distanceScoringFunction; } + + private DistanceScoringFunctionConverter() { + } } 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 index b75a32961656..b411ef26a665 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static DistanceScoringParameters map(com.azure.search.documents.implement } DistanceScoringParameters distanceScoringParameters = new DistanceScoringParameters(); - String _referencePointParameter = obj.getReferencePointParameter(); - distanceScoringParameters.setReferencePointParameter(_referencePointParameter); + String referencePointParameter = obj.getReferencePointParameter(); + distanceScoringParameters.setReferencePointParameter(referencePointParameter); - double _boostingDistance = obj.getBoostingDistance(); - distanceScoringParameters.setBoostingDistance(_boostingDistance); + double boostingDistance = obj.getBoostingDistance(); + distanceScoringParameters.setBoostingDistance(boostingDistance); return distanceScoringParameters; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.DistanceScoringPa com.azure.search.documents.implementation.models.DistanceScoringParameters distanceScoringParameters = new com.azure.search.documents.implementation.models.DistanceScoringParameters(); - String _referencePointParameter = obj.getReferencePointParameter(); - distanceScoringParameters.setReferencePointParameter(_referencePointParameter); + String referencePointParameter = obj.getReferencePointParameter(); + distanceScoringParameters.setReferencePointParameter(referencePointParameter); - double _boostingDistance = obj.getBoostingDistance(); - distanceScoringParameters.setBoostingDistance(_boostingDistance); + double boostingDistance = obj.getBoostingDistance(); + distanceScoringParameters.setBoostingDistance(boostingDistance); return distanceScoringParameters; } + + private DistanceScoringParametersConverter() { + } } 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 index dccce1b42158..eac3fa26ac82 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,19 +24,19 @@ public static EdgeNGramTokenFilter map(com.azure.search.documents.implementation } EdgeNGramTokenFilter edgeNGramTokenFilter = new EdgeNGramTokenFilter(); - String _name = obj.getName(); - edgeNGramTokenFilter.setName(_name); + String name = obj.getName(); + edgeNGramTokenFilter.setName(name); - Integer _maxGram = obj.getMaxGram(); - edgeNGramTokenFilter.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + edgeNGramTokenFilter.setMaxGram(maxGram); if (obj.getSide() != null) { - EdgeNGramTokenFilterSide _side = EdgeNGramTokenFilterSideConverter.map(obj.getSide()); - edgeNGramTokenFilter.setSide(_side); + EdgeNGramTokenFilterSide side = EdgeNGramTokenFilterSideConverter.map(obj.getSide()); + edgeNGramTokenFilter.setSide(side); } - Integer _minGram = obj.getMinGram(); - edgeNGramTokenFilter.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + edgeNGramTokenFilter.setMinGram(minGram); return edgeNGramTokenFilter; } @@ -51,20 +51,23 @@ public static com.azure.search.documents.implementation.models.EdgeNGramTokenFil com.azure.search.documents.implementation.models.EdgeNGramTokenFilter edgeNGramTokenFilter = new com.azure.search.documents.implementation.models.EdgeNGramTokenFilter(); - String _name = obj.getName(); - edgeNGramTokenFilter.setName(_name); + String name = obj.getName(); + edgeNGramTokenFilter.setName(name); - Integer _maxGram = obj.getMaxGram(); - edgeNGramTokenFilter.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + edgeNGramTokenFilter.setMaxGram(maxGram); if (obj.getSide() != null) { - com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide _side = + com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide side = EdgeNGramTokenFilterSideConverter.map(obj.getSide()); - edgeNGramTokenFilter.setSide(_side); + edgeNGramTokenFilter.setSide(side); } - Integer _minGram = obj.getMinGram(); - edgeNGramTokenFilter.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + edgeNGramTokenFilter.setMinGram(minGram); return edgeNGramTokenFilter; } + + private EdgeNGramTokenFilterConverter() { + } } 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 index a20c13cda181..6145589c466a 100644 --- 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 @@ -51,4 +51,7 @@ public static com.azure.search.documents.implementation.models.EdgeNGramTokenFil throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private EdgeNGramTokenFilterSideConverter() { + } } 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 index 8c31e8107532..9b05070e4d33 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,19 +24,19 @@ public static EdgeNGramTokenFilterV2 map(com.azure.search.documents.implementati } EdgeNGramTokenFilterV2 edgeNGramTokenFilterV2 = new EdgeNGramTokenFilterV2(); - String _name = obj.getName(); - edgeNGramTokenFilterV2.setName(_name); + String name = obj.getName(); + edgeNGramTokenFilterV2.setName(name); - Integer _maxGram = obj.getMaxGram(); - edgeNGramTokenFilterV2.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + edgeNGramTokenFilterV2.setMaxGram(maxGram); if (obj.getSide() != null) { - EdgeNGramTokenFilterSide _side = EdgeNGramTokenFilterSideConverter.map(obj.getSide()); - edgeNGramTokenFilterV2.setSide(_side); + EdgeNGramTokenFilterSide side = EdgeNGramTokenFilterSideConverter.map(obj.getSide()); + edgeNGramTokenFilterV2.setSide(side); } - Integer _minGram = obj.getMinGram(); - edgeNGramTokenFilterV2.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + edgeNGramTokenFilterV2.setMinGram(minGram); return edgeNGramTokenFilterV2; } @@ -51,20 +51,23 @@ public static com.azure.search.documents.implementation.models.EdgeNGramTokenFil com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2 edgeNGramTokenFilterV2 = new com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2(); - String _name = obj.getName(); - edgeNGramTokenFilterV2.setName(_name); + String name = obj.getName(); + edgeNGramTokenFilterV2.setName(name); - Integer _maxGram = obj.getMaxGram(); - edgeNGramTokenFilterV2.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + edgeNGramTokenFilterV2.setMaxGram(maxGram); if (obj.getSide() != null) { - com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide _side = + com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide side = EdgeNGramTokenFilterSideConverter.map(obj.getSide()); - edgeNGramTokenFilterV2.setSide(_side); + edgeNGramTokenFilterV2.setSide(side); } - Integer _minGram = obj.getMinGram(); - edgeNGramTokenFilterV2.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + edgeNGramTokenFilterV2.setMinGram(minGram); return edgeNGramTokenFilterV2; } + + private EdgeNGramTokenFilterV2Converter() { + } } 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 index 2fd9b715cdc8..076fd2d809cb 100644 --- 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 @@ -15,7 +15,7 @@ * {@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 @@ -27,20 +27,20 @@ public static EdgeNGramTokenizer map(com.azure.search.documents.implementation.m } EdgeNGramTokenizer edgeNGramTokenizer = new EdgeNGramTokenizer(); - String _name = obj.getName(); - edgeNGramTokenizer.setName(_name); + String name = obj.getName(); + edgeNGramTokenizer.setName(name); - Integer _maxGram = obj.getMaxGram(); - edgeNGramTokenizer.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + edgeNGramTokenizer.setMaxGram(maxGram); if (obj.getTokenChars() != null) { - List _tokenChars = + List tokenChars = obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList()); - edgeNGramTokenizer.setTokenChars(_tokenChars); + edgeNGramTokenizer.setTokenChars(tokenChars); } - Integer _minGram = obj.getMinGram(); - edgeNGramTokenizer.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + edgeNGramTokenizer.setMinGram(minGram); return edgeNGramTokenizer; } @@ -55,20 +55,23 @@ public static com.azure.search.documents.implementation.models.EdgeNGramTokenize com.azure.search.documents.implementation.models.EdgeNGramTokenizer edgeNGramTokenizer = new com.azure.search.documents.implementation.models.EdgeNGramTokenizer(); - String _name = obj.getName(); - edgeNGramTokenizer.setName(_name); + String name = obj.getName(); + edgeNGramTokenizer.setName(name); - Integer _maxGram = obj.getMaxGram(); - edgeNGramTokenizer.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + edgeNGramTokenizer.setMaxGram(maxGram); if (obj.getTokenChars() != null) { - List _tokenChars = + List tokenChars = obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList()); - edgeNGramTokenizer.setTokenChars(_tokenChars); + edgeNGramTokenizer.setTokenChars(tokenChars); } - Integer _minGram = obj.getMinGram(); - edgeNGramTokenizer.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + edgeNGramTokenizer.setMinGram(minGram); return edgeNGramTokenizer; } + + private EdgeNGramTokenizerConverter() { + } } 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 index 3ca5954b0328..9ab533beaa42 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,12 +26,12 @@ public static ElisionTokenFilter map(com.azure.search.documents.implementation.m } ElisionTokenFilter elisionTokenFilter = new ElisionTokenFilter(); - String _name = obj.getName(); - elisionTokenFilter.setName(_name); + String name = obj.getName(); + elisionTokenFilter.setName(name); if (obj.getArticles() != null) { - List _articles = new ArrayList<>(obj.getArticles()); - elisionTokenFilter.setArticles(_articles); + List articles = new ArrayList<>(obj.getArticles()); + elisionTokenFilter.setArticles(articles); } return elisionTokenFilter; } @@ -48,13 +47,16 @@ public static com.azure.search.documents.implementation.models.ElisionTokenFilte com.azure.search.documents.implementation.models.ElisionTokenFilter elisionTokenFilter = new com.azure.search.documents.implementation.models.ElisionTokenFilter(); - String _name = obj.getName(); - elisionTokenFilter.setName(_name); + String name = obj.getName(); + elisionTokenFilter.setName(name); if (obj.getArticles() != null) { - List _articles = new ArrayList<>(obj.getArticles()); - elisionTokenFilter.setArticles(_articles); + List articles = new ArrayList<>(obj.getArticles()); + elisionTokenFilter.setArticles(articles); } return elisionTokenFilter; } + + private ElisionTokenFilterConverter() { + } } 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 index f07380552907..872d1692a4f3 100644 --- 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 @@ -71,4 +71,7 @@ public static com.azure.search.documents.implementation.models.EntityCategory ma throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private EntityCategoryConverter() { + } } 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 index 944f8bf33091..4200a13578d5 100644 --- 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 @@ -18,7 +18,7 @@ * {@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 @@ -31,43 +31,43 @@ public static EntityRecognitionSkill map(com.azure.search.documents.implementati EntityRecognitionSkill entityRecognitionSkill = new EntityRecognitionSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - entityRecognitionSkill.setOutputs(_outputs); + entityRecognitionSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - entityRecognitionSkill.setInputs(_inputs); + entityRecognitionSkill.setInputs(inputs); } - String _name = obj.getName(); - entityRecognitionSkill.setName(_name); + String name = obj.getName(); + entityRecognitionSkill.setName(name); - String _context = obj.getContext(); - entityRecognitionSkill.setContext(_context); + String context = obj.getContext(); + entityRecognitionSkill.setContext(context); - String _description = obj.getDescription(); - entityRecognitionSkill.setDescription(_description); + String description = obj.getDescription(); + entityRecognitionSkill.setDescription(description); - Boolean _includeTypelessEntities = obj.isIncludeTypelessEntities(); - entityRecognitionSkill.setIncludeTypelessEntities(_includeTypelessEntities); + Boolean includeTypelessEntities = obj.isIncludeTypelessEntities(); + entityRecognitionSkill.setIncludeTypelessEntities(includeTypelessEntities); if (obj.getDefaultLanguageCode() != null) { - EntityRecognitionSkillLanguage _defaultLanguageCode = + EntityRecognitionSkillLanguage defaultLanguageCode = EntityRecognitionSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - entityRecognitionSkill.setDefaultLanguageCode(_defaultLanguageCode); + entityRecognitionSkill.setDefaultLanguageCode(defaultLanguageCode); } if (obj.getCategories() != null) { - List _categories = + List categories = obj.getCategories().stream().map(EntityCategoryConverter::map).collect(Collectors.toList()); - entityRecognitionSkill.setCategories(_categories); + entityRecognitionSkill.setCategories(categories); } - Double _minimumPrecision = obj.getMinimumPrecision(); - entityRecognitionSkill.setMinimumPrecision(_minimumPrecision); + Double minimumPrecision = obj.getMinimumPrecision(); + entityRecognitionSkill.setMinimumPrecision(minimumPrecision); return entityRecognitionSkill; } @@ -83,43 +83,46 @@ public static com.azure.search.documents.implementation.models.EntityRecognition new com.azure.search.documents.implementation.models.EntityRecognitionSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - entityRecognitionSkill.setOutputs(_outputs); + entityRecognitionSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - entityRecognitionSkill.setInputs(_inputs); + entityRecognitionSkill.setInputs(inputs); } - String _name = obj.getName(); - entityRecognitionSkill.setName(_name); + String name = obj.getName(); + entityRecognitionSkill.setName(name); - String _context = obj.getContext(); - entityRecognitionSkill.setContext(_context); + String context = obj.getContext(); + entityRecognitionSkill.setContext(context); - String _description = obj.getDescription(); - entityRecognitionSkill.setDescription(_description); + String description = obj.getDescription(); + entityRecognitionSkill.setDescription(description); - Boolean _includeTypelessEntities = obj.isIncludeTypelessEntities(); - entityRecognitionSkill.setIncludeTypelessEntities(_includeTypelessEntities); + Boolean includeTypelessEntities = obj.isIncludeTypelessEntities(); + entityRecognitionSkill.setIncludeTypelessEntities(includeTypelessEntities); if (obj.getDefaultLanguageCode() != null) { - com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage _defaultLanguageCode = + com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage defaultLanguageCode = EntityRecognitionSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - entityRecognitionSkill.setDefaultLanguageCode(_defaultLanguageCode); + entityRecognitionSkill.setDefaultLanguageCode(defaultLanguageCode); } if (obj.getCategories() != null) { - List _categories = + List categories = obj.getCategories().stream().map(EntityCategoryConverter::map).collect(Collectors.toList()); - entityRecognitionSkill.setCategories(_categories); + entityRecognitionSkill.setCategories(categories); } - Double _minimumPrecision = obj.getMinimumPrecision(); - entityRecognitionSkill.setMinimumPrecision(_minimumPrecision); + Double minimumPrecision = obj.getMinimumPrecision(); + entityRecognitionSkill.setMinimumPrecision(minimumPrecision); return entityRecognitionSkill; } + + private EntityRecognitionSkillConverter() { + } } 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 index 86ed5c43f13d..46f5ed0eda2b 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.EntityRecognition } return com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage.fromString(obj.toString()); } + + private EntityRecognitionSkillLanguageConverter() { + } } 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 index df8b200df3dd..57f505aeb5a4 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,7 +13,6 @@ * 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}. @@ -25,14 +23,14 @@ public static FacetResult map(com.azure.search.documents.implementation.models.F } FacetResult facetResult = new FacetResult(); - Long _count = obj.getCount(); - PrivateFieldAccessHelper.set(facetResult, "count", _count); + Long count = obj.getCount(); + PrivateFieldAccessHelper.set(facetResult, "count", count); if (obj.getAdditionalProperties() != null) { - Map _additionalProperties = + Map additionalProperties = obj.getAdditionalProperties().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - PrivateFieldAccessHelper.set(facetResult, "additionalProperties", _additionalProperties); + PrivateFieldAccessHelper.set(facetResult, "additionalProperties", additionalProperties); } return facetResult; } @@ -47,15 +45,18 @@ public static com.azure.search.documents.implementation.models.FacetResult map(F 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); + Long count = obj.getCount(); + PrivateFieldAccessHelper.set(facetResult, "count", count); if (obj.getAdditionalProperties() != null) { - Map _additionalProperties = + Map additionalProperties = obj.getAdditionalProperties().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - PrivateFieldAccessHelper.set(facetResult, "additionalProperties", _additionalProperties); + PrivateFieldAccessHelper.set(facetResult, "additionalProperties", additionalProperties); } return facetResult; } + + private FacetResultConverter() { + } } 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 index ab2b71b328a1..142873d9efb4 100644 --- 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 @@ -11,7 +11,7 @@ * 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}. @@ -22,15 +22,15 @@ public static FieldMapping map(com.azure.search.documents.implementation.models. } FieldMapping fieldMapping = new FieldMapping(); - String _sourceFieldName = obj.getSourceFieldName(); - fieldMapping.setSourceFieldName(_sourceFieldName); + String sourceFieldName = obj.getSourceFieldName(); + fieldMapping.setSourceFieldName(sourceFieldName); - String _targetFieldName = obj.getTargetFieldName(); - fieldMapping.setTargetFieldName(_targetFieldName); + String targetFieldName = obj.getTargetFieldName(); + fieldMapping.setTargetFieldName(targetFieldName); if (obj.getMappingFunction() != null) { - FieldMappingFunction _mappingFunction = FieldMappingFunctionConverter.map(obj.getMappingFunction()); - fieldMapping.setMappingFunction(_mappingFunction); + FieldMappingFunction mappingFunction = FieldMappingFunctionConverter.map(obj.getMappingFunction()); + fieldMapping.setMappingFunction(mappingFunction); } return fieldMapping; } @@ -45,17 +45,20 @@ public static com.azure.search.documents.implementation.models.FieldMapping map( com.azure.search.documents.implementation.models.FieldMapping fieldMapping = new com.azure.search.documents.implementation.models.FieldMapping(); - String _sourceFieldName = obj.getSourceFieldName(); - fieldMapping.setSourceFieldName(_sourceFieldName); + String sourceFieldName = obj.getSourceFieldName(); + fieldMapping.setSourceFieldName(sourceFieldName); - String _targetFieldName = obj.getTargetFieldName(); - fieldMapping.setTargetFieldName(_targetFieldName); + String targetFieldName = obj.getTargetFieldName(); + fieldMapping.setTargetFieldName(targetFieldName); if (obj.getMappingFunction() != null) { - com.azure.search.documents.implementation.models.FieldMappingFunction _mappingFunction = + com.azure.search.documents.implementation.models.FieldMappingFunction mappingFunction = FieldMappingFunctionConverter.map(obj.getMappingFunction()); - fieldMapping.setMappingFunction(_mappingFunction); + fieldMapping.setMappingFunction(mappingFunction); } return fieldMapping; } + + private FieldMappingConverter() { + } } 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 index 0aeb3f0477fa..20771d1916f0 100644 --- 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 @@ -14,7 +14,7 @@ * {@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 @@ -26,14 +26,14 @@ public static FieldMappingFunction map(com.azure.search.documents.implementation } FieldMappingFunction fieldMappingFunction = new FieldMappingFunction(); - String _name = obj.getName(); - fieldMappingFunction.setName(_name); + String name = obj.getName(); + fieldMappingFunction.setName(name); if (obj.getParameters() != null) { - Map _parameters = + Map parameters = obj.getParameters().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - fieldMappingFunction.setParameters(_parameters); + fieldMappingFunction.setParameters(parameters); } return fieldMappingFunction; } @@ -49,15 +49,18 @@ public static com.azure.search.documents.implementation.models.FieldMappingFunct com.azure.search.documents.implementation.models.FieldMappingFunction fieldMappingFunction = new com.azure.search.documents.implementation.models.FieldMappingFunction(); - String _name = obj.getName(); - fieldMappingFunction.setName(_name); + String name = obj.getName(); + fieldMappingFunction.setName(name); if (obj.getParameters() != null) { - Map _parameters = + Map parameters = obj.getParameters().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - fieldMappingFunction.setParameters(_parameters); + fieldMappingFunction.setParameters(parameters); } return fieldMappingFunction; } + + private FieldMappingFunctionConverter() { + } } 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 index 14d51ad24165..4c8885e125fd 100644 --- 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 @@ -13,7 +13,7 @@ * {@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 @@ -26,20 +26,20 @@ public static FreshnessScoringFunction map(com.azure.search.documents.implementa FreshnessScoringFunction freshnessScoringFunction = new FreshnessScoringFunction(); if (obj.getInterpolation() != null) { - ScoringFunctionInterpolation _interpolation = + ScoringFunctionInterpolation interpolation = ScoringFunctionInterpolationConverter.map(obj.getInterpolation()); - freshnessScoringFunction.setInterpolation(_interpolation); + freshnessScoringFunction.setInterpolation(interpolation); } - String _fieldName = obj.getFieldName(); - freshnessScoringFunction.setFieldName(_fieldName); + String fieldName = obj.getFieldName(); + freshnessScoringFunction.setFieldName(fieldName); - double _boost = obj.getBoost(); - freshnessScoringFunction.setBoost(_boost); + double boost = obj.getBoost(); + freshnessScoringFunction.setBoost(boost); if (obj.getParameters() != null) { - FreshnessScoringParameters _parameters = FreshnessScoringParametersConverter.map(obj.getParameters()); - freshnessScoringFunction.setParameters(_parameters); + FreshnessScoringParameters parameters = FreshnessScoringParametersConverter.map(obj.getParameters()); + freshnessScoringFunction.setParameters(parameters); } return freshnessScoringFunction; } @@ -56,22 +56,25 @@ public static com.azure.search.documents.implementation.models.FreshnessScoringF new com.azure.search.documents.implementation.models.FreshnessScoringFunction(); if (obj.getInterpolation() != null) { - com.azure.search.documents.implementation.models.ScoringFunctionInterpolation _interpolation = + com.azure.search.documents.implementation.models.ScoringFunctionInterpolation interpolation = ScoringFunctionInterpolationConverter.map(obj.getInterpolation()); - freshnessScoringFunction.setInterpolation(_interpolation); + freshnessScoringFunction.setInterpolation(interpolation); } - String _fieldName = obj.getFieldName(); - freshnessScoringFunction.setFieldName(_fieldName); + String fieldName = obj.getFieldName(); + freshnessScoringFunction.setFieldName(fieldName); - double _boost = obj.getBoost(); - freshnessScoringFunction.setBoost(_boost); + double boost = obj.getBoost(); + freshnessScoringFunction.setBoost(boost); if (obj.getParameters() != null) { - com.azure.search.documents.implementation.models.FreshnessScoringParameters _parameters = + com.azure.search.documents.implementation.models.FreshnessScoringParameters parameters = FreshnessScoringParametersConverter.map(obj.getParameters()); - freshnessScoringFunction.setParameters(_parameters); + freshnessScoringFunction.setParameters(parameters); } return freshnessScoringFunction; } + + private FreshnessScoringFunctionConverter() { + } } 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 index de977c59e259..ea747db39625 100644 --- 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 @@ -13,7 +13,7 @@ * {@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 @@ -25,8 +25,8 @@ public static FreshnessScoringParameters map(com.azure.search.documents.implemen } FreshnessScoringParameters freshnessScoringParameters = new FreshnessScoringParameters(); - Duration _boostingDuration = obj.getBoostingDuration(); - freshnessScoringParameters.setBoostingDuration(_boostingDuration); + Duration boostingDuration = obj.getBoostingDuration(); + freshnessScoringParameters.setBoostingDuration(boostingDuration); return freshnessScoringParameters; } @@ -41,8 +41,11 @@ public static com.azure.search.documents.implementation.models.FreshnessScoringP com.azure.search.documents.implementation.models.FreshnessScoringParameters freshnessScoringParameters = new com.azure.search.documents.implementation.models.FreshnessScoringParameters(); - Duration _boostingDuration = obj.getBoostingDuration(); - freshnessScoringParameters.setBoostingDuration(_boostingDuration); + Duration boostingDuration = obj.getBoostingDuration(); + freshnessScoringParameters.setBoostingDuration(boostingDuration); return freshnessScoringParameters; } + + private FreshnessScoringParametersConverter() { + } } 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 index 41651e64819c..9119cae74df8 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,11 +24,11 @@ public static GetIndexStatisticsResult map(com.azure.search.documents.implementa } GetIndexStatisticsResult getIndexStatisticsResult = new GetIndexStatisticsResult(); - long _documentCount = obj.getDocumentCount(); - PrivateFieldAccessHelper.set(getIndexStatisticsResult, "documentCount", _documentCount); + long documentCount = obj.getDocumentCount(); + PrivateFieldAccessHelper.set(getIndexStatisticsResult, "documentCount", documentCount); - long _storageSize = obj.getStorageSize(); - PrivateFieldAccessHelper.set(getIndexStatisticsResult, "storageSize", _storageSize); + long storageSize = obj.getStorageSize(); + PrivateFieldAccessHelper.set(getIndexStatisticsResult, "storageSize", storageSize); return getIndexStatisticsResult; } @@ -43,11 +43,14 @@ public static com.azure.search.documents.implementation.models.GetIndexStatistic 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 documentCount = obj.getDocumentCount(); + PrivateFieldAccessHelper.set(getIndexStatisticsResult, "documentCount", documentCount); - long _storageSize = obj.getStorageSize(); - PrivateFieldAccessHelper.set(getIndexStatisticsResult, "storageSize", _storageSize); + long storageSize = obj.getStorageSize(); + PrivateFieldAccessHelper.set(getIndexStatisticsResult, "storageSize", storageSize); return getIndexStatisticsResult; } + + private GetIndexStatisticsResultConverter() { + } } 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 index 86fbf2418ef9..4d8405676dda 100644 --- 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 @@ -11,7 +11,7 @@ * 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 @@ -24,8 +24,8 @@ public static HighWaterMarkChangeDetectionPolicy map(com.azure.search.documents. HighWaterMarkChangeDetectionPolicy highWaterMarkChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy(); - String _highWaterMarkColumnName = obj.getHighWaterMarkColumnName(); - highWaterMarkChangeDetectionPolicy.setHighWaterMarkColumnName(_highWaterMarkColumnName); + String highWaterMarkColumnName = obj.getHighWaterMarkColumnName(); + highWaterMarkChangeDetectionPolicy.setHighWaterMarkColumnName(highWaterMarkColumnName); return highWaterMarkChangeDetectionPolicy; } @@ -39,8 +39,11 @@ public static com.azure.search.documents.implementation.models.HighWaterMarkChan } com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy highWaterMarkChangeDetectionPolicy = new com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy(); - String _highWaterMarkColumnName = obj.getHighWaterMarkColumnName(); - highWaterMarkChangeDetectionPolicy.setHighWaterMarkColumnName(_highWaterMarkColumnName); + String highWaterMarkColumnName = obj.getHighWaterMarkColumnName(); + highWaterMarkChangeDetectionPolicy.setHighWaterMarkColumnName(highWaterMarkColumnName); return highWaterMarkChangeDetectionPolicy; } + + private HighWaterMarkChangeDetectionPolicyConverter() { + } } 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 index 6858949f8b96..c3a713d652c0 100644 --- 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 @@ -19,7 +19,7 @@ * {@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 @@ -32,42 +32,42 @@ public static ImageAnalysisSkill map(com.azure.search.documents.implementation.m ImageAnalysisSkill imageAnalysisSkill = new ImageAnalysisSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setOutputs(_outputs); + imageAnalysisSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setInputs(_inputs); + imageAnalysisSkill.setInputs(inputs); } - String _name = obj.getName(); - imageAnalysisSkill.setName(_name); + String name = obj.getName(); + imageAnalysisSkill.setName(name); - String _context = obj.getContext(); - imageAnalysisSkill.setContext(_context); + String context = obj.getContext(); + imageAnalysisSkill.setContext(context); - String _description = obj.getDescription(); - imageAnalysisSkill.setDescription(_description); + String description = obj.getDescription(); + imageAnalysisSkill.setDescription(description); if (obj.getVisualFeatures() != null) { - List _visualFeatures = + List visualFeatures = obj.getVisualFeatures().stream().map(VisualFeatureConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setVisualFeatures(_visualFeatures); + imageAnalysisSkill.setVisualFeatures(visualFeatures); } if (obj.getDefaultLanguageCode() != null) { - ImageAnalysisSkillLanguage _defaultLanguageCode = + ImageAnalysisSkillLanguage defaultLanguageCode = ImageAnalysisSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - imageAnalysisSkill.setDefaultLanguageCode(_defaultLanguageCode); + imageAnalysisSkill.setDefaultLanguageCode(defaultLanguageCode); } if (obj.getDetails() != null) { - List _details = + List details = obj.getDetails().stream().map(ImageDetailConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setDetails(_details); + imageAnalysisSkill.setDetails(details); } return imageAnalysisSkill; } @@ -84,43 +84,46 @@ public static com.azure.search.documents.implementation.models.ImageAnalysisSkil new com.azure.search.documents.implementation.models.ImageAnalysisSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setOutputs(_outputs); + imageAnalysisSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setInputs(_inputs); + imageAnalysisSkill.setInputs(inputs); } - String _name = obj.getName(); - imageAnalysisSkill.setName(_name); + String name = obj.getName(); + imageAnalysisSkill.setName(name); - String _context = obj.getContext(); - imageAnalysisSkill.setContext(_context); + String context = obj.getContext(); + imageAnalysisSkill.setContext(context); - String _description = obj.getDescription(); - imageAnalysisSkill.setDescription(_description); + String description = obj.getDescription(); + imageAnalysisSkill.setDescription(description); if (obj.getVisualFeatures() != null) { - List _visualFeatures = + List visualFeatures = obj.getVisualFeatures().stream().map(VisualFeatureConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setVisualFeatures(_visualFeatures); + imageAnalysisSkill.setVisualFeatures(visualFeatures); } if (obj.getDefaultLanguageCode() != null) { - com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage _defaultLanguageCode = + com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage defaultLanguageCode = ImageAnalysisSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - imageAnalysisSkill.setDefaultLanguageCode(_defaultLanguageCode); + imageAnalysisSkill.setDefaultLanguageCode(defaultLanguageCode); } if (obj.getDetails() != null) { - List _details = + List details = obj.getDetails().stream().map(ImageDetailConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setDetails(_details); + imageAnalysisSkill.setDetails(details); } return imageAnalysisSkill; } + + private ImageAnalysisSkillConverter() { + } } 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 index d9268282aad5..c7c789e311b6 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.ImageAnalysisSkil } return com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage.fromString(obj.toString()); } + + private ImageAnalysisSkillLanguageConverter() { + } } 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 index 4dd1c004d7ce..4a149e300d86 100644 --- 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 @@ -48,4 +48,7 @@ public static com.azure.search.documents.implementation.models.ImageDetail map(I throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private ImageDetailConverter() { + } } 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 index 173616d2288d..6691c6e55116 100644 --- 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 @@ -17,7 +17,7 @@ * 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}. @@ -29,13 +29,13 @@ public static IndexAction map(com.azure.search.documents.implementation.m IndexAction indexAction = new IndexAction(); if (obj.getActionType() != null) { - IndexActionType _actionType = IndexActionTypeConverter.map(obj.getActionType()); - indexAction.setActionType(_actionType); + IndexActionType actionType = IndexActionTypeConverter.map(obj.getActionType()); + indexAction.setActionType(actionType); } if (obj.getAdditionalProperties() != null) { - Map _properties = obj.getAdditionalProperties(); - PrivateFieldAccessHelper.set(indexAction, "properties", _properties); + Map properties = obj.getAdditionalProperties(); + PrivateFieldAccessHelper.set(indexAction, "properties", properties); } return indexAction; } @@ -52,23 +52,26 @@ public static com.azure.search.documents.implementation.models.IndexAction m new com.azure.search.documents.implementation.models.IndexAction(); if (obj.getActionType() != null) { - com.azure.search.documents.implementation.models.IndexActionType _actionType = + com.azure.search.documents.implementation.models.IndexActionType actionType = IndexActionTypeConverter.map(obj.getActionType()); - indexAction.setActionType(_actionType); + indexAction.setActionType(actionType); } - T _document = obj.getDocument(); + T document = obj.getDocument(); ObjectMapper mapper = new JacksonAdapter().serializer(); SerializationUtil.configureMapper(mapper); - Map additionalProperties = mapper.convertValue(_document, Map.class); + Map additionalProperties = mapper.convertValue(document, Map.class); indexAction.setAdditionalProperties(additionalProperties); if (obj.getParamMap() != null) { - Map _properties = obj.getParamMap(); - PrivateFieldAccessHelper.set(indexAction, "additionalProperties", _properties); + Map properties = obj.getParamMap(); + PrivateFieldAccessHelper.set(indexAction, "additionalProperties", properties); } return indexAction; } + + private IndexActionConverter() { + } } 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 index bdb419e385bb..41efbb91b74f 100644 --- 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 @@ -59,4 +59,7 @@ public static com.azure.search.documents.implementation.models.IndexActionType m throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private IndexActionTypeConverter() { + } } 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 index abeb187c9452..8bd716f1b13b 100644 --- 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 @@ -16,7 +16,7 @@ * {@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}. @@ -28,9 +28,9 @@ public static IndexBatchBase map(com.azure.search.documents.implementatio IndexBatchBase indexBatchBase = new IndexBatchBase(); if (obj.getActions() != null) { - List> _actions = + List> actions = obj.getActions().stream().map(IndexActionConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(indexBatchBase, "actions", _actions); + PrivateFieldAccessHelper.set(indexBatchBase, "actions", actions); } return indexBatchBase; } @@ -46,10 +46,13 @@ public static com.azure.search.documents.implementation.models.IndexBatch ma new com.azure.search.documents.implementation.models.IndexBatch(); if (obj.getActions() != null) { - List _actions = + List actions = obj.getActions().stream().map(IndexActionConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(indexBatch, "actions", _actions); + PrivateFieldAccessHelper.set(indexBatch, "actions", actions); } return indexBatch; } + + private IndexBatchBaseConverter() { + } } 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 index 8e61f568bd49..f78c1187697f 100644 --- 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 @@ -16,7 +16,7 @@ * {@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 @@ -29,9 +29,9 @@ public static IndexDocumentsResult map(com.azure.search.documents.implementation IndexDocumentsResult indexDocumentsResult = new IndexDocumentsResult(); if (obj.getResults() != null) { - List _results = + List results = obj.getResults().stream().map(IndexingResultConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(indexDocumentsResult, "results", _results); + PrivateFieldAccessHelper.set(indexDocumentsResult, "results", results); } return indexDocumentsResult; } @@ -48,10 +48,13 @@ public static com.azure.search.documents.implementation.models.IndexDocumentsRes new com.azure.search.documents.implementation.models.IndexDocumentsResult(); if (obj.getResults() != null) { - List _results = + List results = obj.getResults().stream().map(IndexingResultConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(indexDocumentsResult, "results", _results); + PrivateFieldAccessHelper.set(indexDocumentsResult, "results", results); } return indexDocumentsResult; } + + private IndexDocumentsResultConverter() { + } } 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 index 0dd658785f20..fb65af906e75 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -19,8 +18,6 @@ * {@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}. @@ -31,43 +28,43 @@ public static IndexerExecutionResult map(com.azure.search.documents.implementati } IndexerExecutionResult indexerExecutionResult = new IndexerExecutionResult(); - String _finalTrackingState = obj.getFinalTrackingState(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "finalTrackingState", _finalTrackingState); + String finalTrackingState = obj.getFinalTrackingState(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "finalTrackingState", finalTrackingState); - String _initialTrackingState = obj.getInitialTrackingState(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "initialTrackingState", _initialTrackingState); + String initialTrackingState = obj.getInitialTrackingState(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "initialTrackingState", initialTrackingState); if (obj.getWarnings() != null) { - List _warnings = + List warnings = obj.getWarnings().stream().map(SearchIndexerWarningConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(indexerExecutionResult, "warnings", _warnings); + PrivateFieldAccessHelper.set(indexerExecutionResult, "warnings", warnings); } - String _errorMessage = obj.getErrorMessage(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "errorMessage", _errorMessage); + String errorMessage = obj.getErrorMessage(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "errorMessage", errorMessage); - OffsetDateTime _startTime = obj.getStartTime(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "startTime", _startTime); + OffsetDateTime startTime = obj.getStartTime(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "startTime", startTime); - int _failedItemCount = obj.getFailedItemCount(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "failedItemCount", _failedItemCount); + int failedItemCount = obj.getFailedItemCount(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "failedItemCount", failedItemCount); - OffsetDateTime _endTime = obj.getEndTime(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "endTime", _endTime); + OffsetDateTime endTime = obj.getEndTime(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "endTime", endTime); if (obj.getErrors() != null) { - List _errors = + List errors = obj.getErrors().stream().map(SearchIndexerErrorConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(indexerExecutionResult, "errors", _errors); + PrivateFieldAccessHelper.set(indexerExecutionResult, "errors", errors); } if (obj.getStatus() != null) { - IndexerExecutionStatus _status = IndexerExecutionStatusConverter.map(obj.getStatus()); - PrivateFieldAccessHelper.set(indexerExecutionResult, "status", _status); + IndexerExecutionStatus status = IndexerExecutionStatusConverter.map(obj.getStatus()); + PrivateFieldAccessHelper.set(indexerExecutionResult, "status", status); } - int _itemCount = obj.getItemCount(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "itemCount", _itemCount); + int itemCount = obj.getItemCount(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "itemCount", itemCount); return indexerExecutionResult; } @@ -82,44 +79,47 @@ public static com.azure.search.documents.implementation.models.IndexerExecutionR 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 finalTrackingState = obj.getFinalTrackingState(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "finalTrackingState", finalTrackingState); - String _initialTrackingState = obj.getInitialTrackingState(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "initialTrackingState", _initialTrackingState); + String initialTrackingState = obj.getInitialTrackingState(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "initialTrackingState", initialTrackingState); if (obj.getWarnings() != null) { - List _warnings = + List warnings = obj.getWarnings().stream().map(SearchIndexerWarningConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(indexerExecutionResult, "warnings", _warnings); + PrivateFieldAccessHelper.set(indexerExecutionResult, "warnings", warnings); } - String _errorMessage = obj.getErrorMessage(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "errorMessage", _errorMessage); + String errorMessage = obj.getErrorMessage(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "errorMessage", errorMessage); - OffsetDateTime _startTime = obj.getStartTime(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "startTime", _startTime); + OffsetDateTime startTime = obj.getStartTime(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "startTime", startTime); - int _failedItemCount = obj.getFailedItemCount(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "failedItemCount", _failedItemCount); + int failedItemCount = obj.getFailedItemCount(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "failedItemCount", failedItemCount); - OffsetDateTime _endTime = obj.getEndTime(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "endTime", _endTime); + OffsetDateTime endTime = obj.getEndTime(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "endTime", endTime); if (obj.getErrors() != null) { - List _errors = + List errors = obj.getErrors().stream().map(SearchIndexerErrorConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(indexerExecutionResult, "errors", _errors); + PrivateFieldAccessHelper.set(indexerExecutionResult, "errors", errors); } if (obj.getStatus() != null) { - com.azure.search.documents.implementation.models.IndexerExecutionStatus _status = + com.azure.search.documents.implementation.models.IndexerExecutionStatus status = IndexerExecutionStatusConverter.map(obj.getStatus()); - PrivateFieldAccessHelper.set(indexerExecutionResult, "status", _status); + PrivateFieldAccessHelper.set(indexerExecutionResult, "status", status); } - int _itemCount = obj.getItemCount(); - PrivateFieldAccessHelper.set(indexerExecutionResult, "itemCount", _itemCount); + int itemCount = obj.getItemCount(); + PrivateFieldAccessHelper.set(indexerExecutionResult, "itemCount", itemCount); return indexerExecutionResult; } + + private IndexerExecutionResultConverter() { + } } 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 index 93c29a799cb6..0779c853fa48 100644 --- 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 @@ -59,4 +59,7 @@ public static com.azure.search.documents.implementation.models.IndexerExecutionS throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private IndexerExecutionStatusConverter() { + } } 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 index 4755de82e8ff..ca42894d91fe 100644 --- 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 @@ -54,4 +54,7 @@ public static com.azure.search.documents.implementation.models.IndexerStatus map throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private IndexerStatusConverter() { + } } 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 index 74acefed82eb..1e7ceeaa4022 100644 --- 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 @@ -14,7 +14,7 @@ * {@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 @@ -26,21 +26,21 @@ public static IndexingParameters map(com.azure.search.documents.implementation.m } IndexingParameters indexingParameters = new IndexingParameters(); - Integer _maxFailedItemsPerBatch = obj.getMaxFailedItemsPerBatch(); - indexingParameters.setMaxFailedItemsPerBatch(_maxFailedItemsPerBatch); + Integer maxFailedItemsPerBatch = obj.getMaxFailedItemsPerBatch(); + indexingParameters.setMaxFailedItemsPerBatch(maxFailedItemsPerBatch); - Integer _maxFailedItems = obj.getMaxFailedItems(); - indexingParameters.setMaxFailedItems(_maxFailedItems); + Integer maxFailedItems = obj.getMaxFailedItems(); + indexingParameters.setMaxFailedItems(maxFailedItems); if (obj.getConfiguration() != null) { - Map _configuration = + Map configuration = obj.getConfiguration().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - indexingParameters.setConfiguration(_configuration); + indexingParameters.setConfiguration(configuration); } - Integer _batchSize = obj.getBatchSize(); - indexingParameters.setBatchSize(_batchSize); + Integer batchSize = obj.getBatchSize(); + indexingParameters.setBatchSize(batchSize); return indexingParameters; } @@ -55,21 +55,24 @@ public static com.azure.search.documents.implementation.models.IndexingParameter com.azure.search.documents.implementation.models.IndexingParameters indexingParameters = new com.azure.search.documents.implementation.models.IndexingParameters(); - Integer _maxFailedItemsPerBatch = obj.getMaxFailedItemsPerBatch(); - indexingParameters.setMaxFailedItemsPerBatch(_maxFailedItemsPerBatch); + Integer maxFailedItemsPerBatch = obj.getMaxFailedItemsPerBatch(); + indexingParameters.setMaxFailedItemsPerBatch(maxFailedItemsPerBatch); - Integer _maxFailedItems = obj.getMaxFailedItems(); - indexingParameters.setMaxFailedItems(_maxFailedItems); + Integer maxFailedItems = obj.getMaxFailedItems(); + indexingParameters.setMaxFailedItems(maxFailedItems); if (obj.getConfiguration() != null) { - Map _configuration = + Map configuration = obj.getConfiguration().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - indexingParameters.setConfiguration(_configuration); + indexingParameters.setConfiguration(configuration); } - Integer _batchSize = obj.getBatchSize(); - indexingParameters.setBatchSize(_batchSize); + Integer batchSize = obj.getBatchSize(); + indexingParameters.setBatchSize(batchSize); return indexingParameters; } + + private IndexingParametersConverter() { + } } 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 index ba215af1d717..eb121430736e 100644 --- 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 @@ -12,7 +12,7 @@ * {@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}. @@ -23,17 +23,17 @@ public static IndexingResult map(com.azure.search.documents.implementation.model } IndexingResult indexingResult = new IndexingResult(); - String _errorMessage = obj.getErrorMessage(); - PrivateFieldAccessHelper.set(indexingResult, "errorMessage", _errorMessage); + String errorMessage = obj.getErrorMessage(); + PrivateFieldAccessHelper.set(indexingResult, "errorMessage", errorMessage); - String _key = obj.getKey(); - PrivateFieldAccessHelper.set(indexingResult, "key", _key); + String key = obj.getKey(); + PrivateFieldAccessHelper.set(indexingResult, "key", key); - boolean _succeeded = obj.isSucceeded(); - PrivateFieldAccessHelper.set(indexingResult, "succeeded", _succeeded); + boolean succeeded = obj.isSucceeded(); + PrivateFieldAccessHelper.set(indexingResult, "succeeded", succeeded); - int _statusCode = obj.getStatusCode(); - PrivateFieldAccessHelper.set(indexingResult, "statusCode", _statusCode); + int statusCode = obj.getStatusCode(); + PrivateFieldAccessHelper.set(indexingResult, "statusCode", statusCode); return indexingResult; } @@ -47,17 +47,20 @@ public static com.azure.search.documents.implementation.models.IndexingResult ma 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 errorMessage = obj.getErrorMessage(); + PrivateFieldAccessHelper.set(indexingResult, "errorMessage", errorMessage); - String _key = obj.getKey(); - PrivateFieldAccessHelper.set(indexingResult, "key", _key); + String key = obj.getKey(); + PrivateFieldAccessHelper.set(indexingResult, "key", key); - boolean _succeeded = obj.isSucceeded(); - PrivateFieldAccessHelper.set(indexingResult, "succeeded", _succeeded); + boolean succeeded = obj.isSucceeded(); + PrivateFieldAccessHelper.set(indexingResult, "succeeded", succeeded); - int _statusCode = obj.getStatusCode(); - PrivateFieldAccessHelper.set(indexingResult, "statusCode", _statusCode); + int statusCode = obj.getStatusCode(); + PrivateFieldAccessHelper.set(indexingResult, "statusCode", statusCode); return indexingResult; } + + private IndexingResultConverter() { + } } 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 index de411619f653..c17d45755b2b 100644 --- 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 @@ -14,7 +14,7 @@ * {@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}. @@ -25,11 +25,11 @@ public static IndexingSchedule map(com.azure.search.documents.implementation.mod } IndexingSchedule indexingSchedule = new IndexingSchedule(); - Duration _interval = obj.getInterval(); - indexingSchedule.setInterval(_interval); + Duration interval = obj.getInterval(); + indexingSchedule.setInterval(interval); - OffsetDateTime _startTime = obj.getStartTime(); - indexingSchedule.setStartTime(_startTime); + OffsetDateTime startTime = obj.getStartTime(); + indexingSchedule.setStartTime(startTime); return indexingSchedule; } @@ -43,11 +43,14 @@ public static com.azure.search.documents.implementation.models.IndexingSchedule com.azure.search.documents.implementation.models.IndexingSchedule indexingSchedule = new com.azure.search.documents.implementation.models.IndexingSchedule(); - Duration _interval = obj.getInterval(); - indexingSchedule.setInterval(_interval); + Duration interval = obj.getInterval(); + indexingSchedule.setInterval(interval); - OffsetDateTime _startTime = obj.getStartTime(); - indexingSchedule.setStartTime(_startTime); + OffsetDateTime startTime = obj.getStartTime(); + indexingSchedule.setStartTime(startTime); return indexingSchedule; } + + private IndexingScheduleConverter() { + } } 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 index ac96783cadfa..0119acff5e64 100644 --- 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 @@ -14,7 +14,7 @@ * {@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 @@ -27,19 +27,19 @@ public static InputFieldMappingEntry map(com.azure.search.documents.implementati InputFieldMappingEntry inputFieldMappingEntry = new InputFieldMappingEntry(); if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - inputFieldMappingEntry.setInputs(_inputs); + inputFieldMappingEntry.setInputs(inputs); } - String _name = obj.getName(); - inputFieldMappingEntry.setName(_name); + String name = obj.getName(); + inputFieldMappingEntry.setName(name); - String _source = obj.getSource(); - inputFieldMappingEntry.setSource(_source); + String source = obj.getSource(); + inputFieldMappingEntry.setSource(source); - String _sourceContext = obj.getSourceContext(); - inputFieldMappingEntry.setSourceContext(_sourceContext); + String sourceContext = obj.getSourceContext(); + inputFieldMappingEntry.setSourceContext(sourceContext); return inputFieldMappingEntry; } @@ -55,19 +55,22 @@ public static com.azure.search.documents.implementation.models.InputFieldMapping new com.azure.search.documents.implementation.models.InputFieldMappingEntry(); if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - inputFieldMappingEntry.setInputs(_inputs); + inputFieldMappingEntry.setInputs(inputs); } - String _name = obj.getName(); - inputFieldMappingEntry.setName(_name); + String name = obj.getName(); + inputFieldMappingEntry.setName(name); - String _source = obj.getSource(); - inputFieldMappingEntry.setSource(_source); + String source = obj.getSource(); + inputFieldMappingEntry.setSource(source); - String _sourceContext = obj.getSourceContext(); - inputFieldMappingEntry.setSourceContext(_sourceContext); + String sourceContext = obj.getSourceContext(); + inputFieldMappingEntry.setSourceContext(sourceContext); return inputFieldMappingEntry; } + + private InputFieldMappingEntryConverter() { + } } 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 index f5da8b2e36ce..16f1b439322d 100644 --- 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 @@ -8,14 +8,13 @@ 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}. @@ -26,16 +25,16 @@ public static KeepTokenFilter map(com.azure.search.documents.implementation.mode } KeepTokenFilter keepTokenFilter = new KeepTokenFilter(); - String _name = obj.getName(); - keepTokenFilter.setName(_name); + String name = obj.getName(); + keepTokenFilter.setName(name); if (obj.getKeepWords() != null) { - List _keepWords = new ArrayList<>(obj.getKeepWords()); - keepTokenFilter.setKeepWords(_keepWords); + List keepWords = new ArrayList<>(obj.getKeepWords()); + keepTokenFilter.setKeepWords(keepWords); } - Boolean _lowerCaseKeepWords = obj.isLowerCaseKeepWords(); - keepTokenFilter.setLowerCaseKeepWords(_lowerCaseKeepWords); + Boolean lowerCaseKeepWords = obj.isLowerCaseKeepWords(); + keepTokenFilter.setLowerCaseKeepWords(lowerCaseKeepWords); return keepTokenFilter; } @@ -49,16 +48,19 @@ public static com.azure.search.documents.implementation.models.KeepTokenFilter m com.azure.search.documents.implementation.models.KeepTokenFilter keepTokenFilter = new com.azure.search.documents.implementation.models.KeepTokenFilter(); - String _name = obj.getName(); - keepTokenFilter.setName(_name); + String name = obj.getName(); + keepTokenFilter.setName(name); if (obj.getKeepWords() != null) { - List _keepWords = new ArrayList<>(obj.getKeepWords()); - keepTokenFilter.setKeepWords(_keepWords); + List keepWords = new ArrayList<>(obj.getKeepWords()); + keepTokenFilter.setKeepWords(keepWords); } - Boolean _lowerCaseKeepWords = obj.isLowerCaseKeepWords(); - keepTokenFilter.setLowerCaseKeepWords(_lowerCaseKeepWords); + Boolean lowerCaseKeepWords = obj.isLowerCaseKeepWords(); + keepTokenFilter.setLowerCaseKeepWords(lowerCaseKeepWords); return keepTokenFilter; } + + private KeepTokenFilterConverter() { + } } 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 index 15f9a8f6913d..03263490531b 100644 --- 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 @@ -17,7 +17,7 @@ * {@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 @@ -30,33 +30,33 @@ public static KeyPhraseExtractionSkill map(com.azure.search.documents.implementa KeyPhraseExtractionSkill keyPhraseExtractionSkill = new KeyPhraseExtractionSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - keyPhraseExtractionSkill.setOutputs(_outputs); + keyPhraseExtractionSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - keyPhraseExtractionSkill.setInputs(_inputs); + keyPhraseExtractionSkill.setInputs(inputs); } - String _name = obj.getName(); - keyPhraseExtractionSkill.setName(_name); + String name = obj.getName(); + keyPhraseExtractionSkill.setName(name); - String _context = obj.getContext(); - keyPhraseExtractionSkill.setContext(_context); + String context = obj.getContext(); + keyPhraseExtractionSkill.setContext(context); - String _description = obj.getDescription(); - keyPhraseExtractionSkill.setDescription(_description); + String description = obj.getDescription(); + keyPhraseExtractionSkill.setDescription(description); - Integer _maxKeyPhraseCount = obj.getMaxKeyPhraseCount(); - keyPhraseExtractionSkill.setMaxKeyPhraseCount(_maxKeyPhraseCount); + Integer maxKeyPhraseCount = obj.getMaxKeyPhraseCount(); + keyPhraseExtractionSkill.setMaxKeyPhraseCount(maxKeyPhraseCount); if (obj.getDefaultLanguageCode() != null) { - KeyPhraseExtractionSkillLanguage _defaultLanguageCode = + KeyPhraseExtractionSkillLanguage defaultLanguageCode = KeyPhraseExtractionSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - keyPhraseExtractionSkill.setDefaultLanguageCode(_defaultLanguageCode); + keyPhraseExtractionSkill.setDefaultLanguageCode(defaultLanguageCode); } return keyPhraseExtractionSkill; } @@ -73,34 +73,37 @@ public static com.azure.search.documents.implementation.models.KeyPhraseExtracti new com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - keyPhraseExtractionSkill.setOutputs(_outputs); + keyPhraseExtractionSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - keyPhraseExtractionSkill.setInputs(_inputs); + keyPhraseExtractionSkill.setInputs(inputs); } - String _name = obj.getName(); - keyPhraseExtractionSkill.setName(_name); + String name = obj.getName(); + keyPhraseExtractionSkill.setName(name); - String _context = obj.getContext(); - keyPhraseExtractionSkill.setContext(_context); + String context = obj.getContext(); + keyPhraseExtractionSkill.setContext(context); - String _description = obj.getDescription(); - keyPhraseExtractionSkill.setDescription(_description); + String description = obj.getDescription(); + keyPhraseExtractionSkill.setDescription(description); - Integer _maxKeyPhraseCount = obj.getMaxKeyPhraseCount(); - keyPhraseExtractionSkill.setMaxKeyPhraseCount(_maxKeyPhraseCount); + Integer maxKeyPhraseCount = obj.getMaxKeyPhraseCount(); + keyPhraseExtractionSkill.setMaxKeyPhraseCount(maxKeyPhraseCount); if (obj.getDefaultLanguageCode() != null) { - com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage _defaultLanguageCode = + com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage defaultLanguageCode = KeyPhraseExtractionSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - keyPhraseExtractionSkill.setDefaultLanguageCode(_defaultLanguageCode); + keyPhraseExtractionSkill.setDefaultLanguageCode(defaultLanguageCode); } return keyPhraseExtractionSkill; } + + private KeyPhraseExtractionSkillConverter() { + } } 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 index 0cb4dcf6a04f..6bb808e0247a 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.KeyPhraseExtracti } return com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage.fromString(obj.toString()); } + + private KeyPhraseExtractionSkillLanguageConverter() { + } } 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 index 3ecaf240e6d4..31585d5258ef 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,16 +26,16 @@ public static KeywordMarkerTokenFilter map(com.azure.search.documents.implementa } KeywordMarkerTokenFilter keywordMarkerTokenFilter = new KeywordMarkerTokenFilter(); - String _name = obj.getName(); - keywordMarkerTokenFilter.setName(_name); + String name = obj.getName(); + keywordMarkerTokenFilter.setName(name); if (obj.getKeywords() != null) { - List _keywords = new ArrayList<>(obj.getKeywords()); - keywordMarkerTokenFilter.setKeywords(_keywords); + List keywords = new ArrayList<>(obj.getKeywords()); + keywordMarkerTokenFilter.setKeywords(keywords); } - Boolean _ignoreCase = obj.isIgnoreCase(); - keywordMarkerTokenFilter.setIgnoreCase(_ignoreCase); + Boolean ignoreCase = obj.isIgnoreCase(); + keywordMarkerTokenFilter.setIgnoreCase(ignoreCase); return keywordMarkerTokenFilter; } @@ -51,16 +50,19 @@ public static com.azure.search.documents.implementation.models.KeywordMarkerToke com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter keywordMarkerTokenFilter = new com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter(); - String _name = obj.getName(); - keywordMarkerTokenFilter.setName(_name); + String name = obj.getName(); + keywordMarkerTokenFilter.setName(name); if (obj.getKeywords() != null) { - List _keywords = new ArrayList<>(obj.getKeywords()); - keywordMarkerTokenFilter.setKeywords(_keywords); + List keywords = new ArrayList<>(obj.getKeywords()); + keywordMarkerTokenFilter.setKeywords(keywords); } - Boolean _ignoreCase = obj.isIgnoreCase(); - keywordMarkerTokenFilter.setIgnoreCase(_ignoreCase); + Boolean ignoreCase = obj.isIgnoreCase(); + keywordMarkerTokenFilter.setIgnoreCase(ignoreCase); return keywordMarkerTokenFilter; } + + private KeywordMarkerTokenFilterConverter() { + } } 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 index ec74e484936d..66f927083bb9 100644 --- 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 @@ -11,7 +11,7 @@ * {@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}. @@ -22,11 +22,11 @@ public static KeywordTokenizer map(com.azure.search.documents.implementation.mod } KeywordTokenizer keywordTokenizer = new KeywordTokenizer(); - String _name = obj.getName(); - keywordTokenizer.setName(_name); + String name = obj.getName(); + keywordTokenizer.setName(name); - Integer _bufferSize = obj.getBufferSize(); - keywordTokenizer.setBufferSize(_bufferSize); + Integer bufferSize = obj.getBufferSize(); + keywordTokenizer.setBufferSize(bufferSize); return keywordTokenizer; } @@ -40,11 +40,14 @@ public static com.azure.search.documents.implementation.models.KeywordTokenizer com.azure.search.documents.implementation.models.KeywordTokenizer keywordTokenizer = new com.azure.search.documents.implementation.models.KeywordTokenizer(); - String _name = obj.getName(); - keywordTokenizer.setName(_name); + String name = obj.getName(); + keywordTokenizer.setName(name); - Integer _bufferSize = obj.getBufferSize(); - keywordTokenizer.setBufferSize(_bufferSize); + Integer bufferSize = obj.getBufferSize(); + keywordTokenizer.setBufferSize(bufferSize); return keywordTokenizer; } + + private KeywordTokenizerConverter() { + } } 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 index 47e06c048a11..69eddec4dc49 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static KeywordTokenizerV2 map(com.azure.search.documents.implementation.m } KeywordTokenizerV2 keywordTokenizerV2 = new KeywordTokenizerV2(); - String _name = obj.getName(); - keywordTokenizerV2.setName(_name); + String name = obj.getName(); + keywordTokenizerV2.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - keywordTokenizerV2.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + keywordTokenizerV2.setMaxTokenLength(maxTokenLength); return keywordTokenizerV2; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.KeywordTokenizerV com.azure.search.documents.implementation.models.KeywordTokenizerV2 keywordTokenizerV2 = new com.azure.search.documents.implementation.models.KeywordTokenizerV2(); - String _name = obj.getName(); - keywordTokenizerV2.setName(_name); + String name = obj.getName(); + keywordTokenizerV2.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - keywordTokenizerV2.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + keywordTokenizerV2.setMaxTokenLength(maxTokenLength); return keywordTokenizerV2; } + + private KeywordTokenizerV2Converter() { + } } 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 index d8e6a7fd91f5..4f3bb26ef766 100644 --- 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 @@ -16,7 +16,7 @@ * {@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 @@ -29,25 +29,25 @@ public static LanguageDetectionSkill map(com.azure.search.documents.implementati LanguageDetectionSkill languageDetectionSkill = new LanguageDetectionSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - languageDetectionSkill.setOutputs(_outputs); + languageDetectionSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - languageDetectionSkill.setInputs(_inputs); + languageDetectionSkill.setInputs(inputs); } - String _name = obj.getName(); - languageDetectionSkill.setName(_name); + String name = obj.getName(); + languageDetectionSkill.setName(name); - String _context = obj.getContext(); - languageDetectionSkill.setContext(_context); + String context = obj.getContext(); + languageDetectionSkill.setContext(context); - String _description = obj.getDescription(); - languageDetectionSkill.setDescription(_description); + String description = obj.getDescription(); + languageDetectionSkill.setDescription(description); return languageDetectionSkill; } @@ -63,25 +63,28 @@ public static com.azure.search.documents.implementation.models.LanguageDetection new com.azure.search.documents.implementation.models.LanguageDetectionSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - languageDetectionSkill.setOutputs(_outputs); + languageDetectionSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - languageDetectionSkill.setInputs(_inputs); + languageDetectionSkill.setInputs(inputs); } - String _name = obj.getName(); - languageDetectionSkill.setName(_name); + String name = obj.getName(); + languageDetectionSkill.setName(name); - String _context = obj.getContext(); - languageDetectionSkill.setContext(_context); + String context = obj.getContext(); + languageDetectionSkill.setContext(context); - String _description = obj.getDescription(); - languageDetectionSkill.setDescription(_description); + String description = obj.getDescription(); + languageDetectionSkill.setDescription(description); return languageDetectionSkill; } + + private LanguageDetectionSkillConverter() { + } } 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 index 67455e0ceee8..d711e38b2be7 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,14 +23,14 @@ public static LengthTokenFilter map(com.azure.search.documents.implementation.mo } LengthTokenFilter lengthTokenFilter = new LengthTokenFilter(); - String _name = obj.getName(); - lengthTokenFilter.setName(_name); + String name = obj.getName(); + lengthTokenFilter.setName(name); - Integer _minLength = obj.getMinLength(); - lengthTokenFilter.setMinLength(_minLength); + Integer minLength = obj.getMinLength(); + lengthTokenFilter.setMinLength(minLength); - Integer _maxLength = obj.getMaxLength(); - lengthTokenFilter.setMaxLength(_maxLength); + Integer maxLength = obj.getMaxLength(); + lengthTokenFilter.setMaxLength(maxLength); return lengthTokenFilter; } @@ -45,14 +45,17 @@ public static com.azure.search.documents.implementation.models.LengthTokenFilter com.azure.search.documents.implementation.models.LengthTokenFilter lengthTokenFilter = new com.azure.search.documents.implementation.models.LengthTokenFilter(); - String _name = obj.getName(); - lengthTokenFilter.setName(_name); + String name = obj.getName(); + lengthTokenFilter.setName(name); - Integer _minLength = obj.getMinLength(); - lengthTokenFilter.setMinLength(_minLength); + Integer minLength = obj.getMinLength(); + lengthTokenFilter.setMinLength(minLength); - Integer _maxLength = obj.getMaxLength(); - lengthTokenFilter.setMaxLength(_maxLength); + Integer maxLength = obj.getMaxLength(); + lengthTokenFilter.setMaxLength(maxLength); return lengthTokenFilter; } + + private LengthTokenFilterConverter() { + } } 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 index 51755d794f4b..2cc632cd06e8 100644 --- 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 @@ -58,6 +58,10 @@ public static com.azure.search.documents.implementation.models.LexicalAnalyzer m 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private LexicalAnalyzerConverter() { } } 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 index d664d0bf5d17..fad92c53e26d 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.LexicalAnalyzerNa } return com.azure.search.documents.implementation.models.LexicalAnalyzerName.fromString(obj.toString()); } + + private LexicalAnalyzerNameConverter() { + } } 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 index e7ba8cc47e7c..07b093047c14 100644 --- 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 @@ -114,6 +114,10 @@ public static com.azure.search.documents.implementation.models.LexicalTokenizer 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private LexicalTokenizerConverter() { } } 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 index 5e98bd313568..c0cdbcf23db9 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.LexicalTokenizerN } return com.azure.search.documents.implementation.models.LexicalTokenizerName.fromString(obj.toString()); } + + private LexicalTokenizerNameConverter() { + } } 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 index 18a86232da36..f9bad49a3521 100644 --- 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 @@ -11,7 +11,7 @@ * {@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}. @@ -22,14 +22,14 @@ public static LimitTokenFilter map(com.azure.search.documents.implementation.mod } LimitTokenFilter limitTokenFilter = new LimitTokenFilter(); - String _name = obj.getName(); - limitTokenFilter.setName(_name); + String name = obj.getName(); + limitTokenFilter.setName(name); - Integer _maxTokenCount = obj.getMaxTokenCount(); - limitTokenFilter.setMaxTokenCount(_maxTokenCount); + Integer maxTokenCount = obj.getMaxTokenCount(); + limitTokenFilter.setMaxTokenCount(maxTokenCount); - Boolean _consumeAllTokens = obj.isConsumeAllTokens(); - limitTokenFilter.setConsumeAllTokens(_consumeAllTokens); + Boolean consumeAllTokens = obj.isConsumeAllTokens(); + limitTokenFilter.setConsumeAllTokens(consumeAllTokens); return limitTokenFilter; } @@ -43,14 +43,17 @@ public static com.azure.search.documents.implementation.models.LimitTokenFilter com.azure.search.documents.implementation.models.LimitTokenFilter limitTokenFilter = new com.azure.search.documents.implementation.models.LimitTokenFilter(); - String _name = obj.getName(); - limitTokenFilter.setName(_name); + String name = obj.getName(); + limitTokenFilter.setName(name); - Integer _maxTokenCount = obj.getMaxTokenCount(); - limitTokenFilter.setMaxTokenCount(_maxTokenCount); + Integer maxTokenCount = obj.getMaxTokenCount(); + limitTokenFilter.setMaxTokenCount(maxTokenCount); - Boolean _consumeAllTokens = obj.isConsumeAllTokens(); - limitTokenFilter.setConsumeAllTokens(_consumeAllTokens); + Boolean consumeAllTokens = obj.isConsumeAllTokens(); + limitTokenFilter.setConsumeAllTokens(consumeAllTokens); return limitTokenFilter; } + + private LimitTokenFilterConverter() { + } } 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 index 35b75cafb7e3..99aff7225f1d 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,15 +26,15 @@ public static LuceneStandardAnalyzer map(com.azure.search.documents.implementati } LuceneStandardAnalyzer luceneStandardAnalyzer = new LuceneStandardAnalyzer(); - String _name = obj.getName(); - luceneStandardAnalyzer.setName(_name); + String name = obj.getName(); + luceneStandardAnalyzer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - luceneStandardAnalyzer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + luceneStandardAnalyzer.setMaxTokenLength(maxTokenLength); if (obj.getStopwords() != null) { - List _stopwords = new ArrayList<>(obj.getStopwords()); - luceneStandardAnalyzer.setStopwords(_stopwords); + List stopwords = new ArrayList<>(obj.getStopwords()); + luceneStandardAnalyzer.setStopwords(stopwords); } return luceneStandardAnalyzer; } @@ -51,16 +50,19 @@ public static com.azure.search.documents.implementation.models.LuceneStandardAna com.azure.search.documents.implementation.models.LuceneStandardAnalyzer luceneStandardAnalyzer = new com.azure.search.documents.implementation.models.LuceneStandardAnalyzer(); - String _name = obj.getName(); - luceneStandardAnalyzer.setName(_name); + String name = obj.getName(); + luceneStandardAnalyzer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - luceneStandardAnalyzer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + luceneStandardAnalyzer.setMaxTokenLength(maxTokenLength); if (obj.getStopwords() != null) { - List _stopwords = new ArrayList<>(obj.getStopwords()); - luceneStandardAnalyzer.setStopwords(_stopwords); + List stopwords = new ArrayList<>(obj.getStopwords()); + luceneStandardAnalyzer.setStopwords(stopwords); } return luceneStandardAnalyzer; } + + private LuceneStandardAnalyzerConverter() { + } } 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 index ba0838831014..67cd616588c7 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static LuceneStandardTokenizer map(com.azure.search.documents.implementat } LuceneStandardTokenizer luceneStandardTokenizer = new LuceneStandardTokenizer(); - String _name = obj.getName(); - luceneStandardTokenizer.setName(_name); + String name = obj.getName(); + luceneStandardTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - luceneStandardTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + luceneStandardTokenizer.setMaxTokenLength(maxTokenLength); return luceneStandardTokenizer; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.LuceneStandardTok com.azure.search.documents.implementation.models.LuceneStandardTokenizer luceneStandardTokenizer = new com.azure.search.documents.implementation.models.LuceneStandardTokenizer(); - String _name = obj.getName(); - luceneStandardTokenizer.setName(_name); + String name = obj.getName(); + luceneStandardTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - luceneStandardTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + luceneStandardTokenizer.setMaxTokenLength(maxTokenLength); return luceneStandardTokenizer; } + + private LuceneStandardTokenizerConverter() { + } } 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 index 1ff0923217e5..24163cff2b37 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static LuceneStandardTokenizerV2 map(com.azure.search.documents.implement } LuceneStandardTokenizerV2 luceneStandardTokenizerV2 = new LuceneStandardTokenizerV2(); - String _name = obj.getName(); - luceneStandardTokenizerV2.setName(_name); + String name = obj.getName(); + luceneStandardTokenizerV2.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - luceneStandardTokenizerV2.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + luceneStandardTokenizerV2.setMaxTokenLength(maxTokenLength); return luceneStandardTokenizerV2; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.LuceneStandardTok com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2 luceneStandardTokenizerV2 = new com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2(); - String _name = obj.getName(); - luceneStandardTokenizerV2.setName(_name); + String name = obj.getName(); + luceneStandardTokenizerV2.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - luceneStandardTokenizerV2.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + luceneStandardTokenizerV2.setMaxTokenLength(maxTokenLength); return luceneStandardTokenizerV2; } + + private LuceneStandardTokenizerV2Converter() { + } } 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 index abd4150025c4..f9b43eba3446 100644 --- 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 @@ -13,7 +13,7 @@ * {@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 @@ -26,20 +26,20 @@ public static MagnitudeScoringFunction map(com.azure.search.documents.implementa MagnitudeScoringFunction magnitudeScoringFunction = new MagnitudeScoringFunction(); if (obj.getInterpolation() != null) { - ScoringFunctionInterpolation _interpolation = + ScoringFunctionInterpolation interpolation = ScoringFunctionInterpolationConverter.map(obj.getInterpolation()); - magnitudeScoringFunction.setInterpolation(_interpolation); + magnitudeScoringFunction.setInterpolation(interpolation); } - String _fieldName = obj.getFieldName(); - magnitudeScoringFunction.setFieldName(_fieldName); + String fieldName = obj.getFieldName(); + magnitudeScoringFunction.setFieldName(fieldName); - double _boost = obj.getBoost(); - magnitudeScoringFunction.setBoost(_boost); + double boost = obj.getBoost(); + magnitudeScoringFunction.setBoost(boost); if (obj.getParameters() != null) { - MagnitudeScoringParameters _parameters = MagnitudeScoringParametersConverter.map(obj.getParameters()); - magnitudeScoringFunction.setParameters(_parameters); + MagnitudeScoringParameters parameters = MagnitudeScoringParametersConverter.map(obj.getParameters()); + magnitudeScoringFunction.setParameters(parameters); } return magnitudeScoringFunction; } @@ -56,22 +56,25 @@ public static com.azure.search.documents.implementation.models.MagnitudeScoringF new com.azure.search.documents.implementation.models.MagnitudeScoringFunction(); if (obj.getInterpolation() != null) { - com.azure.search.documents.implementation.models.ScoringFunctionInterpolation _interpolation = + com.azure.search.documents.implementation.models.ScoringFunctionInterpolation interpolation = ScoringFunctionInterpolationConverter.map(obj.getInterpolation()); - magnitudeScoringFunction.setInterpolation(_interpolation); + magnitudeScoringFunction.setInterpolation(interpolation); } - String _fieldName = obj.getFieldName(); - magnitudeScoringFunction.setFieldName(_fieldName); + String fieldName = obj.getFieldName(); + magnitudeScoringFunction.setFieldName(fieldName); - double _boost = obj.getBoost(); - magnitudeScoringFunction.setBoost(_boost); + double boost = obj.getBoost(); + magnitudeScoringFunction.setBoost(boost); if (obj.getParameters() != null) { - com.azure.search.documents.implementation.models.MagnitudeScoringParameters _parameters = + com.azure.search.documents.implementation.models.MagnitudeScoringParameters parameters = MagnitudeScoringParametersConverter.map(obj.getParameters()); - magnitudeScoringFunction.setParameters(_parameters); + magnitudeScoringFunction.setParameters(parameters); } return magnitudeScoringFunction; } + + private MagnitudeScoringFunctionConverter() { + } } 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 index e3a9246b3c4b..4e341c52dc79 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,14 +23,14 @@ public static MagnitudeScoringParameters map(com.azure.search.documents.implemen } MagnitudeScoringParameters magnitudeScoringParameters = new MagnitudeScoringParameters(); - double _boostingRangeStart = obj.getBoostingRangeStart(); - magnitudeScoringParameters.setBoostingRangeStart(_boostingRangeStart); + double boostingRangeStart = obj.getBoostingRangeStart(); + magnitudeScoringParameters.setBoostingRangeStart(boostingRangeStart); - double _boostingRangeEnd = obj.getBoostingRangeEnd(); - magnitudeScoringParameters.setBoostingRangeEnd(_boostingRangeEnd); + double boostingRangeEnd = obj.getBoostingRangeEnd(); + magnitudeScoringParameters.setBoostingRangeEnd(boostingRangeEnd); - Boolean _shouldBoostBeyondRangeByConstant = obj.isShouldBoostBeyondRangeByConstant(); - magnitudeScoringParameters.setShouldBoostBeyondRangeByConstant(_shouldBoostBeyondRangeByConstant); + Boolean shouldBoostBeyondRangeByConstant = obj.isShouldBoostBeyondRangeByConstant(); + magnitudeScoringParameters.setShouldBoostBeyondRangeByConstant(shouldBoostBeyondRangeByConstant); return magnitudeScoringParameters; } @@ -45,14 +45,17 @@ public static com.azure.search.documents.implementation.models.MagnitudeScoringP com.azure.search.documents.implementation.models.MagnitudeScoringParameters magnitudeScoringParameters = new com.azure.search.documents.implementation.models.MagnitudeScoringParameters(); - double _boostingRangeStart = obj.getBoostingRangeStart(); - magnitudeScoringParameters.setBoostingRangeStart(_boostingRangeStart); + double boostingRangeStart = obj.getBoostingRangeStart(); + magnitudeScoringParameters.setBoostingRangeStart(boostingRangeStart); - double _boostingRangeEnd = obj.getBoostingRangeEnd(); - magnitudeScoringParameters.setBoostingRangeEnd(_boostingRangeEnd); + double boostingRangeEnd = obj.getBoostingRangeEnd(); + magnitudeScoringParameters.setBoostingRangeEnd(boostingRangeEnd); - Boolean _shouldBoostBeyondRangeByConstant = obj.shouldBoostBeyondRangeByConstant(); - magnitudeScoringParameters.setShouldBoostBeyondRangeByConstant(_shouldBoostBeyondRangeByConstant); + Boolean shouldBoostBeyondRangeByConstant = obj.shouldBoostBeyondRangeByConstant(); + magnitudeScoringParameters.setShouldBoostBeyondRangeByConstant(shouldBoostBeyondRangeByConstant); return magnitudeScoringParameters; } + + private MagnitudeScoringParametersConverter() { + } } 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 index e8c1d45b48bf..677620712346 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,12 +26,12 @@ public static MappingCharFilter map(com.azure.search.documents.implementation.mo } MappingCharFilter mappingCharFilter = new MappingCharFilter(); - String _name = obj.getName(); - mappingCharFilter.setName(_name); + String name = obj.getName(); + mappingCharFilter.setName(name); if (obj.getMappings() != null) { - List _mappings = new ArrayList<>(obj.getMappings()); - mappingCharFilter.setMappings(_mappings); + List mappings = new ArrayList<>(obj.getMappings()); + mappingCharFilter.setMappings(mappings); } return mappingCharFilter; } @@ -48,13 +47,16 @@ public static com.azure.search.documents.implementation.models.MappingCharFilter com.azure.search.documents.implementation.models.MappingCharFilter mappingCharFilter = new com.azure.search.documents.implementation.models.MappingCharFilter(); - String _name = obj.getName(); - mappingCharFilter.setName(_name); + String name = obj.getName(); + mappingCharFilter.setName(name); if (obj.getMappings() != null) { - List _mappings = new ArrayList<>(obj.getMappings()); - mappingCharFilter.setMappings(_mappings); + List mappings = new ArrayList<>(obj.getMappings()); + mappingCharFilter.setMappings(mappings); } return mappingCharFilter; } + + private MappingCharFilterConverter() { + } } 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 index fa365d1dd254..e253081dd0aa 100644 --- 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 @@ -15,7 +15,7 @@ * 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}. @@ -27,31 +27,31 @@ public static MergeSkill map(com.azure.search.documents.implementation.models.Me MergeSkill mergeSkill = new MergeSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - mergeSkill.setOutputs(_outputs); + mergeSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - mergeSkill.setInputs(_inputs); + mergeSkill.setInputs(inputs); } - String _name = obj.getName(); - mergeSkill.setName(_name); + String name = obj.getName(); + mergeSkill.setName(name); - String _context = obj.getContext(); - mergeSkill.setContext(_context); + String context = obj.getContext(); + mergeSkill.setContext(context); - String _description = obj.getDescription(); - mergeSkill.setDescription(_description); + String description = obj.getDescription(); + mergeSkill.setDescription(description); - String _insertPostTag = obj.getInsertPostTag(); - mergeSkill.setInsertPostTag(_insertPostTag); + String insertPostTag = obj.getInsertPostTag(); + mergeSkill.setInsertPostTag(insertPostTag); - String _insertPreTag = obj.getInsertPreTag(); - mergeSkill.setInsertPreTag(_insertPreTag); + String insertPreTag = obj.getInsertPreTag(); + mergeSkill.setInsertPreTag(insertPreTag); return mergeSkill; } @@ -66,31 +66,34 @@ public static com.azure.search.documents.implementation.models.MergeSkill map(Me new com.azure.search.documents.implementation.models.MergeSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - mergeSkill.setOutputs(_outputs); + mergeSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - mergeSkill.setInputs(_inputs); + mergeSkill.setInputs(inputs); } - String _name = obj.getName(); - mergeSkill.setName(_name); + String name = obj.getName(); + mergeSkill.setName(name); - String _context = obj.getContext(); - mergeSkill.setContext(_context); + String context = obj.getContext(); + mergeSkill.setContext(context); - String _description = obj.getDescription(); - mergeSkill.setDescription(_description); + String description = obj.getDescription(); + mergeSkill.setDescription(description); - String _insertPostTag = obj.getInsertPostTag(); - mergeSkill.setInsertPostTag(_insertPostTag); + String insertPostTag = obj.getInsertPostTag(); + mergeSkill.setInsertPostTag(insertPostTag); - String _insertPreTag = obj.getInsertPreTag(); - mergeSkill.setInsertPreTag(_insertPreTag); + String insertPreTag = obj.getInsertPreTag(); + mergeSkill.setInsertPreTag(insertPreTag); return mergeSkill; } + + private MergeSkillConverter() { + } } 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 index b6f198d9ee3e..c920c17de420 100644 --- 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 @@ -12,7 +12,7 @@ * 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 @@ -25,20 +25,20 @@ public static MicrosoftLanguageStemmingTokenizer map(com.azure.search.documents. MicrosoftLanguageStemmingTokenizer microsoftLanguageStemmingTokenizer = new MicrosoftLanguageStemmingTokenizer(); - String _name = obj.getName(); - microsoftLanguageStemmingTokenizer.setName(_name); + String name = obj.getName(); + microsoftLanguageStemmingTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - microsoftLanguageStemmingTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + microsoftLanguageStemmingTokenizer.setMaxTokenLength(maxTokenLength); if (obj.getLanguage() != null) { - MicrosoftStemmingTokenizerLanguage _language = + MicrosoftStemmingTokenizerLanguage language = MicrosoftStemmingTokenizerLanguageConverter.map(obj.getLanguage()); - microsoftLanguageStemmingTokenizer.setLanguage(_language); + microsoftLanguageStemmingTokenizer.setLanguage(language); } - Boolean _isSearchTokenizer = obj.isSearchTokenizer(); - microsoftLanguageStemmingTokenizer.setIsSearchTokenizer(_isSearchTokenizer); + Boolean isSearchTokenizer = obj.isSearchTokenizer(); + microsoftLanguageStemmingTokenizer.setIsSearchTokenizer(isSearchTokenizer); return microsoftLanguageStemmingTokenizer; } @@ -52,20 +52,23 @@ public static com.azure.search.documents.implementation.models.MicrosoftLanguage } com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer microsoftLanguageStemmingTokenizer = new com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer(); - String _name = obj.getName(); - microsoftLanguageStemmingTokenizer.setName(_name); + String name = obj.getName(); + microsoftLanguageStemmingTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - microsoftLanguageStemmingTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + microsoftLanguageStemmingTokenizer.setMaxTokenLength(maxTokenLength); if (obj.getLanguage() != null) { - com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage _language = + com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage language = MicrosoftStemmingTokenizerLanguageConverter.map(obj.getLanguage()); - microsoftLanguageStemmingTokenizer.setLanguage(_language); + microsoftLanguageStemmingTokenizer.setLanguage(language); } - Boolean _isSearchTokenizer = obj.isSearchTokenizer(); - microsoftLanguageStemmingTokenizer.setIsSearchTokenizer(_isSearchTokenizer); + Boolean isSearchTokenizer = obj.isSearchTokenizer(); + microsoftLanguageStemmingTokenizer.setIsSearchTokenizer(isSearchTokenizer); return microsoftLanguageStemmingTokenizer; } + + private MicrosoftLanguageStemmingTokenizerConverter() { + } } 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 index 3fea9015f293..cf00509686f5 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,19 +24,19 @@ public static MicrosoftLanguageTokenizer map(com.azure.search.documents.implemen } MicrosoftLanguageTokenizer microsoftLanguageTokenizer = new MicrosoftLanguageTokenizer(); - String _name = obj.getName(); - microsoftLanguageTokenizer.setName(_name); + String name = obj.getName(); + microsoftLanguageTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - microsoftLanguageTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + microsoftLanguageTokenizer.setMaxTokenLength(maxTokenLength); if (obj.getLanguage() != null) { - MicrosoftTokenizerLanguage _language = MicrosoftTokenizerLanguageConverter.map(obj.getLanguage()); - microsoftLanguageTokenizer.setLanguage(_language); + MicrosoftTokenizerLanguage language = MicrosoftTokenizerLanguageConverter.map(obj.getLanguage()); + microsoftLanguageTokenizer.setLanguage(language); } - Boolean _isSearchTokenizer = obj.isSearchTokenizer(); - microsoftLanguageTokenizer.setIsSearchTokenizer(_isSearchTokenizer); + Boolean isSearchTokenizer = obj.isSearchTokenizer(); + microsoftLanguageTokenizer.setIsSearchTokenizer(isSearchTokenizer); return microsoftLanguageTokenizer; } @@ -51,20 +51,23 @@ public static com.azure.search.documents.implementation.models.MicrosoftLanguage com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer microsoftLanguageTokenizer = new com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer(); - String _name = obj.getName(); - microsoftLanguageTokenizer.setName(_name); + String name = obj.getName(); + microsoftLanguageTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - microsoftLanguageTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + microsoftLanguageTokenizer.setMaxTokenLength(maxTokenLength); if (obj.getLanguage() != null) { - com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage _language = + com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage language = MicrosoftTokenizerLanguageConverter.map(obj.getLanguage()); - microsoftLanguageTokenizer.setLanguage(_language); + microsoftLanguageTokenizer.setLanguage(language); } - Boolean _isSearchTokenizer = obj.isSearchTokenizer(); - microsoftLanguageTokenizer.setIsSearchTokenizer(_isSearchTokenizer); + Boolean isSearchTokenizer = obj.isSearchTokenizer(); + microsoftLanguageTokenizer.setIsSearchTokenizer(isSearchTokenizer); return microsoftLanguageTokenizer; } + + private MicrosoftLanguageTokenizerConverter() { + } } 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 index b716a7c83679..1cbe1f7e7633 100644 --- 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 @@ -223,4 +223,7 @@ public static com.azure.search.documents.implementation.models.MicrosoftStemming throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private MicrosoftStemmingTokenizerLanguageConverter() { + } } 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 index 4924ae396f1d..4855f9f5b242 100644 --- 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 @@ -211,4 +211,7 @@ public static com.azure.search.documents.implementation.models.MicrosoftTokenize throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private MicrosoftTokenizerLanguageConverter() { + } } 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 index bfb4a0954095..7dfbfecd7910 100644 --- 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 @@ -11,7 +11,7 @@ * {@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}. @@ -22,14 +22,14 @@ public static NGramTokenFilter map(com.azure.search.documents.implementation.mod } NGramTokenFilter nGramTokenFilter = new NGramTokenFilter(); - String _name = obj.getName(); - nGramTokenFilter.setName(_name); + String name = obj.getName(); + nGramTokenFilter.setName(name); - Integer _maxGram = obj.getMaxGram(); - nGramTokenFilter.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + nGramTokenFilter.setMaxGram(maxGram); - Integer _minGram = obj.getMinGram(); - nGramTokenFilter.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + nGramTokenFilter.setMinGram(minGram); return nGramTokenFilter; } @@ -43,14 +43,17 @@ public static com.azure.search.documents.implementation.models.NGramTokenFilter com.azure.search.documents.implementation.models.NGramTokenFilter nGramTokenFilter = new com.azure.search.documents.implementation.models.NGramTokenFilter(); - String _name = obj.getName(); - nGramTokenFilter.setName(_name); + String name = obj.getName(); + nGramTokenFilter.setName(name); - Integer _maxGram = obj.getMaxGram(); - nGramTokenFilter.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + nGramTokenFilter.setMaxGram(maxGram); - Integer _minGram = obj.getMinGram(); - nGramTokenFilter.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + nGramTokenFilter.setMinGram(minGram); return nGramTokenFilter; } + + private NGramTokenFilterConverter() { + } } 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 index 19c6df051ec8..17ae363dd4eb 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,14 +23,14 @@ public static NGramTokenFilterV2 map(com.azure.search.documents.implementation.m } NGramTokenFilterV2 nGramTokenFilterV2 = new NGramTokenFilterV2(); - String _name = obj.getName(); - nGramTokenFilterV2.setName(_name); + String name = obj.getName(); + nGramTokenFilterV2.setName(name); - Integer _maxGram = obj.getMaxGram(); - nGramTokenFilterV2.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + nGramTokenFilterV2.setMaxGram(maxGram); - Integer _minGram = obj.getMinGram(); - nGramTokenFilterV2.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + nGramTokenFilterV2.setMinGram(minGram); return nGramTokenFilterV2; } @@ -45,14 +45,17 @@ public static com.azure.search.documents.implementation.models.NGramTokenFilterV com.azure.search.documents.implementation.models.NGramTokenFilterV2 nGramTokenFilterV2 = new com.azure.search.documents.implementation.models.NGramTokenFilterV2(); - String _name = obj.getName(); - nGramTokenFilterV2.setName(_name); + String name = obj.getName(); + nGramTokenFilterV2.setName(name); - Integer _maxGram = obj.getMaxGram(); - nGramTokenFilterV2.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + nGramTokenFilterV2.setMaxGram(maxGram); - Integer _minGram = obj.getMinGram(); - nGramTokenFilterV2.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + nGramTokenFilterV2.setMinGram(minGram); return nGramTokenFilterV2; } + + private NGramTokenFilterV2Converter() { + } } 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 index e3ca25f257a9..6281e8473e2c 100644 --- 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 @@ -15,7 +15,7 @@ * {@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}. @@ -26,20 +26,20 @@ public static NGramTokenizer map(com.azure.search.documents.implementation.model } NGramTokenizer nGramTokenizer = new NGramTokenizer(); - String _name = obj.getName(); - nGramTokenizer.setName(_name); + String name = obj.getName(); + nGramTokenizer.setName(name); - Integer _maxGram = obj.getMaxGram(); - nGramTokenizer.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + nGramTokenizer.setMaxGram(maxGram); if (obj.getTokenChars() != null) { - List _tokenChars = + List tokenChars = obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList()); - nGramTokenizer.setTokenChars(_tokenChars); + nGramTokenizer.setTokenChars(tokenChars); } - Integer _minGram = obj.getMinGram(); - nGramTokenizer.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + nGramTokenizer.setMinGram(minGram); return nGramTokenizer; } @@ -53,20 +53,23 @@ public static com.azure.search.documents.implementation.models.NGramTokenizer ma com.azure.search.documents.implementation.models.NGramTokenizer nGramTokenizer = new com.azure.search.documents.implementation.models.NGramTokenizer(); - String _name = obj.getName(); - nGramTokenizer.setName(_name); + String name = obj.getName(); + nGramTokenizer.setName(name); - Integer _maxGram = obj.getMaxGram(); - nGramTokenizer.setMaxGram(_maxGram); + Integer maxGram = obj.getMaxGram(); + nGramTokenizer.setMaxGram(maxGram); if (obj.getTokenChars() != null) { - List _tokenChars = + List tokenChars = obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList()); - nGramTokenizer.setTokenChars(_tokenChars); + nGramTokenizer.setTokenChars(tokenChars); } - Integer _minGram = obj.getMinGram(); - nGramTokenizer.setMinGram(_minGram); + Integer minGram = obj.getMinGram(); + nGramTokenizer.setMinGram(minGram); return nGramTokenizer; } + + private NGramTokenizerConverter() { + } } 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 index 60c04e6c6de2..d1b020011aab 100644 --- 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 @@ -17,7 +17,7 @@ * 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}. @@ -29,39 +29,39 @@ public static OcrSkill map(com.azure.search.documents.implementation.models.OcrS OcrSkill ocrSkill = new OcrSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - ocrSkill.setOutputs(_outputs); + ocrSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - ocrSkill.setInputs(_inputs); + ocrSkill.setInputs(inputs); } - String _name = obj.getName(); - ocrSkill.setName(_name); + String name = obj.getName(); + ocrSkill.setName(name); - String _context = obj.getContext(); - ocrSkill.setContext(_context); + String context = obj.getContext(); + ocrSkill.setContext(context); - String _description = obj.getDescription(); - ocrSkill.setDescription(_description); + String description = obj.getDescription(); + ocrSkill.setDescription(description); if (obj.getTextExtractionAlgorithm() != null) { - TextExtractionAlgorithm _textExtractionAlgorithm = + TextExtractionAlgorithm textExtractionAlgorithm = TextExtractionAlgorithmConverter.map(obj.getTextExtractionAlgorithm()); - ocrSkill.setTextExtractionAlgorithm(_textExtractionAlgorithm); + ocrSkill.setTextExtractionAlgorithm(textExtractionAlgorithm); } if (obj.getDefaultLanguageCode() != null) { - OcrSkillLanguage _defaultLanguageCode = OcrSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - ocrSkill.setDefaultLanguageCode(_defaultLanguageCode); + OcrSkillLanguage defaultLanguageCode = OcrSkillLanguageConverter.map(obj.getDefaultLanguageCode()); + ocrSkill.setDefaultLanguageCode(defaultLanguageCode); } - Boolean _shouldDetectOrientation = obj.isShouldDetectOrientation(); - ocrSkill.setShouldDetectOrientation(_shouldDetectOrientation); + Boolean shouldDetectOrientation = obj.isShouldDetectOrientation(); + ocrSkill.setShouldDetectOrientation(shouldDetectOrientation); return ocrSkill; } @@ -76,40 +76,43 @@ public static com.azure.search.documents.implementation.models.OcrSkill map(OcrS new com.azure.search.documents.implementation.models.OcrSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - ocrSkill.setOutputs(_outputs); + ocrSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - ocrSkill.setInputs(_inputs); + ocrSkill.setInputs(inputs); } - String _name = obj.getName(); - ocrSkill.setName(_name); + String name = obj.getName(); + ocrSkill.setName(name); - String _context = obj.getContext(); - ocrSkill.setContext(_context); + String context = obj.getContext(); + ocrSkill.setContext(context); - String _description = obj.getDescription(); - ocrSkill.setDescription(_description); + String description = obj.getDescription(); + ocrSkill.setDescription(description); if (obj.getTextExtractionAlgorithm() != null) { - com.azure.search.documents.implementation.models.TextExtractionAlgorithm _textExtractionAlgorithm = + com.azure.search.documents.implementation.models.TextExtractionAlgorithm textExtractionAlgorithm = TextExtractionAlgorithmConverter.map(obj.getTextExtractionAlgorithm()); - ocrSkill.setTextExtractionAlgorithm(_textExtractionAlgorithm); + ocrSkill.setTextExtractionAlgorithm(textExtractionAlgorithm); } if (obj.getDefaultLanguageCode() != null) { - com.azure.search.documents.implementation.models.OcrSkillLanguage _defaultLanguageCode = + com.azure.search.documents.implementation.models.OcrSkillLanguage defaultLanguageCode = OcrSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - ocrSkill.setDefaultLanguageCode(_defaultLanguageCode); + ocrSkill.setDefaultLanguageCode(defaultLanguageCode); } - Boolean _shouldDetectOrientation = obj.shouldDetectOrientation(); - ocrSkill.setShouldDetectOrientation(_shouldDetectOrientation); + Boolean shouldDetectOrientation = obj.shouldDetectOrientation(); + ocrSkill.setShouldDetectOrientation(shouldDetectOrientation); return ocrSkill; } + + private OcrSkillConverter() { + } } 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 index ec5e61a1ec13..fab6e3b99f71 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.OcrSkillLanguage } return com.azure.search.documents.implementation.models.OcrSkillLanguage.fromString(obj.toString()); } + + private OcrSkillLanguageConverter() { + } } 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 index 1322b385c402..75aa7afc4b07 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static OutputFieldMappingEntry map(com.azure.search.documents.implementat } OutputFieldMappingEntry outputFieldMappingEntry = new OutputFieldMappingEntry(); - String _targetName = obj.getTargetName(); - outputFieldMappingEntry.setTargetName(_targetName); + String targetName = obj.getTargetName(); + outputFieldMappingEntry.setTargetName(targetName); - String _name = obj.getName(); - outputFieldMappingEntry.setName(_name); + String name = obj.getName(); + outputFieldMappingEntry.setName(name); return outputFieldMappingEntry; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.OutputFieldMappin com.azure.search.documents.implementation.models.OutputFieldMappingEntry outputFieldMappingEntry = new com.azure.search.documents.implementation.models.OutputFieldMappingEntry(); - String _targetName = obj.getTargetName(); - outputFieldMappingEntry.setTargetName(_targetName); + String targetName = obj.getTargetName(); + outputFieldMappingEntry.setTargetName(targetName); - String _name = obj.getName(); - outputFieldMappingEntry.setName(_name); + String name = obj.getName(); + outputFieldMappingEntry.setName(name); return outputFieldMappingEntry; } + + private OutputFieldMappingEntryConverter() { + } } 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 index 6e4b0bc9ddcd..5e4b13118931 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,23 +23,23 @@ public static PathHierarchyTokenizerV2 map(com.azure.search.documents.implementa } PathHierarchyTokenizerV2 pathHierarchyTokenizerV2 = new PathHierarchyTokenizerV2(); - String _name = obj.getName(); - pathHierarchyTokenizerV2.setName(_name); + String name = obj.getName(); + pathHierarchyTokenizerV2.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - pathHierarchyTokenizerV2.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + pathHierarchyTokenizerV2.setMaxTokenLength(maxTokenLength); - String _delimiter = obj.getDelimiter(); - pathHierarchyTokenizerV2.setDelimiter(_delimiter); + String delimiter = obj.getDelimiter(); + pathHierarchyTokenizerV2.setDelimiter(delimiter); - Boolean _reverseTokenOrder = obj.isReverseTokenOrder(); - pathHierarchyTokenizerV2.setReverseTokenOrder(_reverseTokenOrder); + Boolean reverseTokenOrder = obj.isReverseTokenOrder(); + pathHierarchyTokenizerV2.setReverseTokenOrder(reverseTokenOrder); - Integer _numberOfTokensToSkip = obj.getNumberOfTokensToSkip(); - pathHierarchyTokenizerV2.setNumberOfTokensToSkip(_numberOfTokensToSkip); + Integer numberOfTokensToSkip = obj.getNumberOfTokensToSkip(); + pathHierarchyTokenizerV2.setNumberOfTokensToSkip(numberOfTokensToSkip); - String _replacement = obj.getReplacement(); - pathHierarchyTokenizerV2.setReplacement(_replacement); + String replacement = obj.getReplacement(); + pathHierarchyTokenizerV2.setReplacement(replacement); return pathHierarchyTokenizerV2; } @@ -54,23 +54,26 @@ public static com.azure.search.documents.implementation.models.PathHierarchyToke com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2 pathHierarchyTokenizerV2 = new com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2(); - String _name = obj.getName(); - pathHierarchyTokenizerV2.setName(_name); + String name = obj.getName(); + pathHierarchyTokenizerV2.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - pathHierarchyTokenizerV2.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + pathHierarchyTokenizerV2.setMaxTokenLength(maxTokenLength); - String _delimiter = obj.getDelimiter(); - pathHierarchyTokenizerV2.setDelimiter(_delimiter); + String delimiter = obj.getDelimiter(); + pathHierarchyTokenizerV2.setDelimiter(delimiter); - Boolean _reverseTokenOrder = obj.isReverseTokenOrder(); - pathHierarchyTokenizerV2.setReverseTokenOrder(_reverseTokenOrder); + Boolean reverseTokenOrder = obj.isReverseTokenOrder(); + pathHierarchyTokenizerV2.setReverseTokenOrder(reverseTokenOrder); - Integer _numberOfTokensToSkip = obj.getNumberOfTokensToSkip(); - pathHierarchyTokenizerV2.setNumberOfTokensToSkip(_numberOfTokensToSkip); + Integer numberOfTokensToSkip = obj.getNumberOfTokensToSkip(); + pathHierarchyTokenizerV2.setNumberOfTokensToSkip(numberOfTokensToSkip); - String _replacement = obj.getReplacement(); - pathHierarchyTokenizerV2.setReplacement(_replacement); + String replacement = obj.getReplacement(); + pathHierarchyTokenizerV2.setReplacement(replacement); return pathHierarchyTokenizerV2; } + + private PathHierarchyTokenizerV2Converter() { + } } 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 index e0cf8141e798..8152bfa9e234 100644 --- 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 @@ -17,7 +17,7 @@ * {@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}. @@ -28,14 +28,14 @@ public static PatternAnalyzer map(com.azure.search.documents.implementation.mode } PatternAnalyzer patternAnalyzer = new PatternAnalyzer(); - String _name = obj.getName(); - patternAnalyzer.setName(_name); + String name = obj.getName(); + patternAnalyzer.setName(name); - Boolean _lowerCaseTerms = obj.isLowerCaseTerms(); - patternAnalyzer.setLowerCaseTerms(_lowerCaseTerms); + Boolean lowerCaseTerms = obj.isLowerCaseTerms(); + patternAnalyzer.setLowerCaseTerms(lowerCaseTerms); - String _pattern = obj.getPattern(); - patternAnalyzer.setPattern(_pattern); + String pattern = obj.getPattern(); + patternAnalyzer.setPattern(pattern); if (obj.getFlags() != null) { List regexFlags = @@ -44,8 +44,8 @@ public static PatternAnalyzer map(com.azure.search.documents.implementation.mode } if (obj.getStopwords() != null) { - List _stopwords = new ArrayList<>(obj.getStopwords()); - patternAnalyzer.setStopwords(_stopwords); + List stopwords = new ArrayList<>(obj.getStopwords()); + patternAnalyzer.setStopwords(stopwords); } return patternAnalyzer; } @@ -60,25 +60,27 @@ public static com.azure.search.documents.implementation.models.PatternAnalyzer m com.azure.search.documents.implementation.models.PatternAnalyzer patternAnalyzer = new com.azure.search.documents.implementation.models.PatternAnalyzer(); - String _name = obj.getName(); - patternAnalyzer.setName(_name); + String name = obj.getName(); + patternAnalyzer.setName(name); - Boolean _lowerCaseTerms = obj.isLowerCaseTerms(); - patternAnalyzer.setLowerCaseTerms(_lowerCaseTerms); + Boolean lowerCaseTerms = obj.isLowerCaseTerms(); + patternAnalyzer.setLowerCaseTerms(lowerCaseTerms); - String _pattern = obj.getPattern(); - patternAnalyzer.setPattern(_pattern); + String pattern = obj.getPattern(); + patternAnalyzer.setPattern(pattern); if (obj.getFlags() != null) { - String flattenFlags = - obj.getFlags().stream().map(RegexFlags::toString).collect(Collectors.joining("|")); + 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); + List stopwords = new ArrayList<>(obj.getStopwords()); + patternAnalyzer.setStopwords(stopwords); } return patternAnalyzer; } + + private PatternAnalyzerConverter() { + } } 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 index db666473664c..1457fb1fad5e 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,16 +26,16 @@ public static PatternCaptureTokenFilter map(com.azure.search.documents.implement } PatternCaptureTokenFilter patternCaptureTokenFilter = new PatternCaptureTokenFilter(); - String _name = obj.getName(); - patternCaptureTokenFilter.setName(_name); + String name = obj.getName(); + patternCaptureTokenFilter.setName(name); if (obj.getPatterns() != null) { - List _patterns = new ArrayList<>(obj.getPatterns()); - patternCaptureTokenFilter.setPatterns(_patterns); + List patterns = new ArrayList<>(obj.getPatterns()); + patternCaptureTokenFilter.setPatterns(patterns); } - Boolean _preserveOriginal = obj.isPreserveOriginal(); - patternCaptureTokenFilter.setPreserveOriginal(_preserveOriginal); + Boolean preserveOriginal = obj.isPreserveOriginal(); + patternCaptureTokenFilter.setPreserveOriginal(preserveOriginal); return patternCaptureTokenFilter; } @@ -51,16 +50,19 @@ public static com.azure.search.documents.implementation.models.PatternCaptureTok com.azure.search.documents.implementation.models.PatternCaptureTokenFilter patternCaptureTokenFilter = new com.azure.search.documents.implementation.models.PatternCaptureTokenFilter(); - String _name = obj.getName(); - patternCaptureTokenFilter.setName(_name); + String name = obj.getName(); + patternCaptureTokenFilter.setName(name); if (obj.getPatterns() != null) { - List _patterns = new ArrayList<>(obj.getPatterns()); - patternCaptureTokenFilter.setPatterns(_patterns); + List patterns = new ArrayList<>(obj.getPatterns()); + patternCaptureTokenFilter.setPatterns(patterns); } - Boolean _preserveOriginal = obj.isPreserveOriginal(); - patternCaptureTokenFilter.setPreserveOriginal(_preserveOriginal); + Boolean preserveOriginal = obj.isPreserveOriginal(); + patternCaptureTokenFilter.setPreserveOriginal(preserveOriginal); return patternCaptureTokenFilter; } + + private PatternCaptureTokenFilterConverter() { + } } 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 index 6a2bf957c402..9903853399d8 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,14 +23,14 @@ public static PatternReplaceCharFilter map(com.azure.search.documents.implementa } PatternReplaceCharFilter patternReplaceCharFilter = new PatternReplaceCharFilter(); - String _name = obj.getName(); - patternReplaceCharFilter.setName(_name); + String name = obj.getName(); + patternReplaceCharFilter.setName(name); - String _pattern = obj.getPattern(); - patternReplaceCharFilter.setPattern(_pattern); + String pattern = obj.getPattern(); + patternReplaceCharFilter.setPattern(pattern); - String _replacement = obj.getReplacement(); - patternReplaceCharFilter.setReplacement(_replacement); + String replacement = obj.getReplacement(); + patternReplaceCharFilter.setReplacement(replacement); return patternReplaceCharFilter; } @@ -45,14 +45,17 @@ public static com.azure.search.documents.implementation.models.PatternReplaceCha com.azure.search.documents.implementation.models.PatternReplaceCharFilter patternReplaceCharFilter = new com.azure.search.documents.implementation.models.PatternReplaceCharFilter(); - String _name = obj.getName(); - patternReplaceCharFilter.setName(_name); + String name = obj.getName(); + patternReplaceCharFilter.setName(name); - String _pattern = obj.getPattern(); - patternReplaceCharFilter.setPattern(_pattern); + String pattern = obj.getPattern(); + patternReplaceCharFilter.setPattern(pattern); - String _replacement = obj.getReplacement(); - patternReplaceCharFilter.setReplacement(_replacement); + String replacement = obj.getReplacement(); + patternReplaceCharFilter.setReplacement(replacement); return patternReplaceCharFilter; } + + private PatternReplaceCharFilterConverter() { + } } 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 index 43d21498b07e..49b79ae5569b 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,14 +23,14 @@ public static PatternReplaceTokenFilter map(com.azure.search.documents.implement } PatternReplaceTokenFilter patternReplaceTokenFilter = new PatternReplaceTokenFilter(); - String _name = obj.getName(); - patternReplaceTokenFilter.setName(_name); + String name = obj.getName(); + patternReplaceTokenFilter.setName(name); - String _pattern = obj.getPattern(); - patternReplaceTokenFilter.setPattern(_pattern); + String pattern = obj.getPattern(); + patternReplaceTokenFilter.setPattern(pattern); - String _replacement = obj.getReplacement(); - patternReplaceTokenFilter.setReplacement(_replacement); + String replacement = obj.getReplacement(); + patternReplaceTokenFilter.setReplacement(replacement); return patternReplaceTokenFilter; } @@ -45,14 +45,17 @@ public static com.azure.search.documents.implementation.models.PatternReplaceTok com.azure.search.documents.implementation.models.PatternReplaceTokenFilter patternReplaceTokenFilter = new com.azure.search.documents.implementation.models.PatternReplaceTokenFilter(); - String _name = obj.getName(); - patternReplaceTokenFilter.setName(_name); + String name = obj.getName(); + patternReplaceTokenFilter.setName(name); - String _pattern = obj.getPattern(); - patternReplaceTokenFilter.setPattern(_pattern); + String pattern = obj.getPattern(); + patternReplaceTokenFilter.setPattern(pattern); - String _replacement = obj.getReplacement(); - patternReplaceTokenFilter.setReplacement(_replacement); + String replacement = obj.getReplacement(); + patternReplaceTokenFilter.setReplacement(replacement); return patternReplaceTokenFilter; } + + private PatternReplaceTokenFilterConverter() { + } } 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 index 6c1805cb9323..107c2906aa32 100644 --- 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 @@ -16,7 +16,7 @@ * {@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}. @@ -27,11 +27,11 @@ public static PatternTokenizer map(com.azure.search.documents.implementation.mod } PatternTokenizer patternTokenizer = new PatternTokenizer(); - String _name = obj.getName(); - patternTokenizer.setName(_name); + String name = obj.getName(); + patternTokenizer.setName(name); - String _pattern = obj.getPattern(); - patternTokenizer.setPattern(_pattern); + String pattern = obj.getPattern(); + patternTokenizer.setPattern(pattern); if (obj.getFlags() != null) { List regexFlags = @@ -39,8 +39,8 @@ public static PatternTokenizer map(com.azure.search.documents.implementation.mod patternTokenizer.setFlags(regexFlags); } - Integer _group = obj.getGroup(); - patternTokenizer.setGroup(_group); + Integer group = obj.getGroup(); + patternTokenizer.setGroup(group); return patternTokenizer; } @@ -54,20 +54,22 @@ public static com.azure.search.documents.implementation.models.PatternTokenizer com.azure.search.documents.implementation.models.PatternTokenizer patternTokenizer = new com.azure.search.documents.implementation.models.PatternTokenizer(); - String _name = obj.getName(); - patternTokenizer.setName(_name); + String name = obj.getName(); + patternTokenizer.setName(name); - String _pattern = obj.getPattern(); - patternTokenizer.setPattern(_pattern); + String pattern = obj.getPattern(); + patternTokenizer.setPattern(pattern); if (obj.getFlags() != null) { - String flattenFlags = - obj.getFlags().stream().map(RegexFlags::toString).collect(Collectors.joining("|")); + 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); + Integer group = obj.getGroup(); + patternTokenizer.setGroup(group); return patternTokenizer; } + + private PatternTokenizerConverter() { + } } 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 index 004cfae9283e..246ea4641308 100644 --- 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 @@ -87,4 +87,7 @@ public static com.azure.search.documents.implementation.models.PhoneticEncoder m throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private PhoneticEncoderConverter() { + } } 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 index 19e2b53a48c0..8894e33bc0fb 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,15 +24,15 @@ public static PhoneticTokenFilter map(com.azure.search.documents.implementation. } PhoneticTokenFilter phoneticTokenFilter = new PhoneticTokenFilter(); - String _name = obj.getName(); - phoneticTokenFilter.setName(_name); + String name = obj.getName(); + phoneticTokenFilter.setName(name); - Boolean _replaceOriginalTokens = obj.isReplaceOriginalTokens(); - phoneticTokenFilter.setReplaceOriginalTokens(_replaceOriginalTokens); + Boolean replaceOriginalTokens = obj.isReplaceOriginalTokens(); + phoneticTokenFilter.setReplaceOriginalTokens(replaceOriginalTokens); if (obj.getEncoder() != null) { - PhoneticEncoder _encoder = PhoneticEncoderConverter.map(obj.getEncoder()); - phoneticTokenFilter.setEncoder(_encoder); + PhoneticEncoder encoder = PhoneticEncoderConverter.map(obj.getEncoder()); + phoneticTokenFilter.setEncoder(encoder); } return phoneticTokenFilter; } @@ -48,17 +48,20 @@ public static com.azure.search.documents.implementation.models.PhoneticTokenFilt com.azure.search.documents.implementation.models.PhoneticTokenFilter phoneticTokenFilter = new com.azure.search.documents.implementation.models.PhoneticTokenFilter(); - String _name = obj.getName(); - phoneticTokenFilter.setName(_name); + String name = obj.getName(); + phoneticTokenFilter.setName(name); - Boolean _replaceOriginalTokens = obj.isReplaceOriginalTokens(); - phoneticTokenFilter.setReplaceOriginalTokens(_replaceOriginalTokens); + Boolean replaceOriginalTokens = obj.isReplaceOriginalTokens(); + phoneticTokenFilter.setReplaceOriginalTokens(replaceOriginalTokens); if (obj.getEncoder() != null) { - com.azure.search.documents.implementation.models.PhoneticEncoder _encoder = + com.azure.search.documents.implementation.models.PhoneticEncoder encoder = PhoneticEncoderConverter.map(obj.getEncoder()); - phoneticTokenFilter.setEncoder(_encoder); + phoneticTokenFilter.setEncoder(encoder); } return phoneticTokenFilter; } + + private PhoneticTokenFilterConverter() { + } } 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 index ac6a2bb515c9..6c9ead10fae1 100644 --- 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 @@ -48,4 +48,7 @@ public static com.azure.search.documents.implementation.models.QueryType map(Que throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private QueryTypeConverter() { + } } 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 index 0b625128d51b..cac485cf2c48 100644 --- 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 @@ -10,7 +10,7 @@ * 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}. @@ -31,4 +31,7 @@ public static com.azure.search.documents.implementation.models.RegexFlags map(Re } return com.azure.search.documents.implementation.models.RegexFlags.fromString(obj.toString()); } + + private RegexFlagsConverter() { + } } 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 index d77b9fbacfb1..4950b26595e5 100644 --- 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 @@ -13,7 +13,7 @@ * {@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}. @@ -24,8 +24,8 @@ public static RequestOptions map(com.azure.search.documents.implementation.model } RequestOptions requestOptions = new RequestOptions(); - UUID _xMsClientRequestId = obj.getXMsClientRequestId(); - requestOptions.setXMsClientRequestId(_xMsClientRequestId); + UUID xMsClientRequestId = obj.getXMsClientRequestId(); + requestOptions.setXMsClientRequestId(xMsClientRequestId); return requestOptions; } @@ -39,8 +39,11 @@ public static com.azure.search.documents.implementation.models.RequestOptions ma com.azure.search.documents.implementation.models.RequestOptions requestOptions = new com.azure.search.documents.implementation.models.RequestOptions(); - UUID _xMsClientRequestId = obj.getXMsClientRequestId(); - requestOptions.setXMsClientRequestId(_xMsClientRequestId); + UUID xMsClientRequestId = obj.getXMsClientRequestId(); + requestOptions.setXMsClientRequestId(xMsClientRequestId); return requestOptions; } + + private RequestOptionsConverter() { + } } 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 index cf239f5f83ff..3348fcbc05e4 100644 --- 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 @@ -11,7 +11,7 @@ * {@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}. @@ -22,11 +22,11 @@ public static ResourceCounter map(com.azure.search.documents.implementation.mode } ResourceCounter resourceCounter = new ResourceCounter(); - long _usage = obj.getUsage(); - resourceCounter.setUsage(_usage); + long usage = obj.getUsage(); + resourceCounter.setUsage(usage); - Long _quota = obj.getQuota(); - resourceCounter.setQuota(_quota); + Long quota = obj.getQuota(); + resourceCounter.setQuota(quota); return resourceCounter; } @@ -40,11 +40,14 @@ public static com.azure.search.documents.implementation.models.ResourceCounter m com.azure.search.documents.implementation.models.ResourceCounter resourceCounter = new com.azure.search.documents.implementation.models.ResourceCounter(); - long _usage = obj.getUsage(); - resourceCounter.setUsage(_usage); + long usage = obj.getUsage(); + resourceCounter.setUsage(usage); - Long _quota = obj.getQuota(); - resourceCounter.setQuota(_quota); + Long quota = obj.getQuota(); + resourceCounter.setQuota(quota); return resourceCounter; } + + private ResourceCounterConverter() { + } } 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 index 27e90f8427d0..729df647bafb 100644 --- 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 @@ -63,4 +63,7 @@ public static com.azure.search.documents.implementation.models.ScoringFunctionAg throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private ScoringFunctionAggregationConverter() { + } } 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 index d2f75f81caba..b6b2d5607587 100644 --- 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 @@ -58,6 +58,10 @@ public static com.azure.search.documents.implementation.models.ScoringFunction m 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private ScoringFunctionConverter() { } } 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 index ebed46cc87f8..21bd94753934 100644 --- 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 @@ -59,4 +59,7 @@ public static com.azure.search.documents.implementation.models.ScoringFunctionIn throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private ScoringFunctionInterpolationConverter() { + } } 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 index 303dbc7d6d6f..d7f8e3a654e2 100644 --- 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 @@ -17,7 +17,7 @@ * {@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}. @@ -29,23 +29,23 @@ public static ScoringProfile map(com.azure.search.documents.implementation.model ScoringProfile scoringProfile = new ScoringProfile(); if (obj.getFunctions() != null) { - List _functions = + List functions = obj.getFunctions().stream().map(ScoringFunctionConverter::map).collect(Collectors.toList()); - scoringProfile.setFunctions(_functions); + scoringProfile.setFunctions(functions); } - String _name = obj.getName(); - scoringProfile.setName(_name); + String name = obj.getName(); + scoringProfile.setName(name); if (obj.getTextWeights() != null) { - TextWeights _textWeights = TextWeightsConverter.map(obj.getTextWeights()); - scoringProfile.setTextWeights(_textWeights); + TextWeights textWeights = TextWeightsConverter.map(obj.getTextWeights()); + scoringProfile.setTextWeights(textWeights); } if (obj.getFunctionAggregation() != null) { - ScoringFunctionAggregation _functionAggregation = + ScoringFunctionAggregation functionAggregation = ScoringFunctionAggregationConverter.map(obj.getFunctionAggregation()); - scoringProfile.setFunctionAggregation(_functionAggregation); + scoringProfile.setFunctionAggregation(functionAggregation); } return scoringProfile; } @@ -61,25 +61,28 @@ public static com.azure.search.documents.implementation.models.ScoringProfile ma new com.azure.search.documents.implementation.models.ScoringProfile(); if (obj.getFunctions() != null) { - List _functions = + List functions = obj.getFunctions().stream().map(ScoringFunctionConverter::map).collect(Collectors.toList()); - scoringProfile.setFunctions(_functions); + scoringProfile.setFunctions(functions); } - String _name = obj.getName(); - scoringProfile.setName(_name); + String name = obj.getName(); + scoringProfile.setName(name); if (obj.getTextWeights() != null) { - com.azure.search.documents.implementation.models.TextWeights _textWeights = + com.azure.search.documents.implementation.models.TextWeights textWeights = TextWeightsConverter.map(obj.getTextWeights()); - scoringProfile.setTextWeights(_textWeights); + scoringProfile.setTextWeights(textWeights); } if (obj.getFunctionAggregation() != null) { - com.azure.search.documents.implementation.models.ScoringFunctionAggregation _functionAggregation = + com.azure.search.documents.implementation.models.ScoringFunctionAggregation functionAggregation = ScoringFunctionAggregationConverter.map(obj.getFunctionAggregation()); - scoringProfile.setFunctionAggregation(_functionAggregation); + scoringProfile.setFunctionAggregation(functionAggregation); } return scoringProfile; } + + private ScoringProfileConverter() { + } } 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 index 7e5208acffcf..9923b92bf0c0 100644 --- 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 @@ -28,57 +28,57 @@ public static SearchField map(com.azure.search.documents.implementation.models.S } SearchField searchField = new SearchField(); - Boolean _filterable = obj.isFilterable(); - searchField.setFilterable(_filterable); + Boolean filterable = obj.isFilterable(); + searchField.setFilterable(filterable); - Boolean _hidden = obj.isRetrievable() == null ? null : !obj.isRetrievable(); - searchField.setHidden(_hidden); + Boolean hidden = obj.isRetrievable() == null ? null : !obj.isRetrievable(); + searchField.setHidden(hidden); - Boolean _sortable = obj.isSortable(); - searchField.setSortable(_sortable); + Boolean sortable = obj.isSortable(); + searchField.setSortable(sortable); if (obj.getType() != null) { - SearchFieldDataType _type = SearchFieldDataTypeConverter.map(obj.getType()); - searchField.setType(_type); + SearchFieldDataType type = SearchFieldDataTypeConverter.map(obj.getType()); + searchField.setType(type); } - Boolean _searchable = obj.isSearchable(); - searchField.setSearchable(_searchable); + Boolean searchable = obj.isSearchable(); + searchField.setSearchable(searchable); if (obj.getAnalyzer() != null) { - LexicalAnalyzerName _analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); - searchField.setAnalyzer(_analyzer); + LexicalAnalyzerName analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); + searchField.setAnalyzer(analyzer); } if (obj.getSearchAnalyzer() != null) { - LexicalAnalyzerName _searchAnalyzer = LexicalAnalyzerNameConverter.map(obj.getSearchAnalyzer()); - searchField.setSearchAnalyzer(_searchAnalyzer); + LexicalAnalyzerName searchAnalyzer = LexicalAnalyzerNameConverter.map(obj.getSearchAnalyzer()); + searchField.setSearchAnalyzer(searchAnalyzer); } - String _name = obj.getName(); - searchField.setName(_name); + String name = obj.getName(); + searchField.setName(name); if (obj.getIndexAnalyzer() != null) { - LexicalAnalyzerName _indexAnalyzer = LexicalAnalyzerNameConverter.map(obj.getIndexAnalyzer()); - searchField.setIndexAnalyzer(_indexAnalyzer); + LexicalAnalyzerName indexAnalyzer = LexicalAnalyzerNameConverter.map(obj.getIndexAnalyzer()); + searchField.setIndexAnalyzer(indexAnalyzer); } - Boolean _facetable = obj.isFacetable(); - searchField.setFacetable(_facetable); + Boolean facetable = obj.isFacetable(); + searchField.setFacetable(facetable); if (obj.getSynonymMaps() != null) { - List _synonymMaps = new ArrayList<>(obj.getSynonymMaps()); - searchField.setSynonymMaps(_synonymMaps); + List synonymMaps = new ArrayList<>(obj.getSynonymMaps()); + searchField.setSynonymMaps(synonymMaps); } if (obj.getFields() != null) { - List _fields = + List fields = obj.getFields().stream().map(com.azure.search.documents.implementation.converters.SearchFieldConverter::map).collect(Collectors.toList()); - searchField.setFields(_fields); + searchField.setFields(fields); } - Boolean _key = obj.isKey(); - searchField.setKey(_key); + Boolean key = obj.isKey(); + searchField.setKey(key); return searchField; } @@ -92,61 +92,64 @@ public static com.azure.search.documents.implementation.models.SearchField map(S com.azure.search.documents.implementation.models.SearchField searchField = new com.azure.search.documents.implementation.models.SearchField(); - Boolean _filterable = obj.isFilterable(); - searchField.setFilterable(_filterable); + Boolean filterable = obj.isFilterable(); + searchField.setFilterable(filterable); - Boolean _hidden = obj.isHidden() == null ? null : !obj.isHidden(); - searchField.setRetrievable(_hidden); + Boolean hidden = obj.isHidden() == null ? null : !obj.isHidden(); + searchField.setRetrievable(hidden); - Boolean _sortable = obj.isSortable(); - searchField.setSortable(_sortable); + Boolean sortable = obj.isSortable(); + searchField.setSortable(sortable); if (obj.getType() != null) { - com.azure.search.documents.implementation.models.SearchFieldDataType _type = + com.azure.search.documents.implementation.models.SearchFieldDataType type = SearchFieldDataTypeConverter.map(obj.getType()); - searchField.setType(_type); + searchField.setType(type); } - Boolean _searchable = obj.isSearchable(); - searchField.setSearchable(_searchable); + Boolean searchable = obj.isSearchable(); + searchField.setSearchable(searchable); if (obj.getAnalyzer() != null) { - com.azure.search.documents.implementation.models.LexicalAnalyzerName _analyzer = + com.azure.search.documents.implementation.models.LexicalAnalyzerName analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); - searchField.setAnalyzer(_analyzer); + searchField.setAnalyzer(analyzer); } if (obj.getSearchAnalyzer() != null) { - com.azure.search.documents.implementation.models.LexicalAnalyzerName _searchAnalyzer = + com.azure.search.documents.implementation.models.LexicalAnalyzerName searchAnalyzer = LexicalAnalyzerNameConverter.map(obj.getSearchAnalyzer()); - searchField.setSearchAnalyzer(_searchAnalyzer); + searchField.setSearchAnalyzer(searchAnalyzer); } - String _name = obj.getName(); - searchField.setName(_name); + String name = obj.getName(); + searchField.setName(name); if (obj.getIndexAnalyzer() != null) { - com.azure.search.documents.implementation.models.LexicalAnalyzerName _indexAnalyzer = + com.azure.search.documents.implementation.models.LexicalAnalyzerName indexAnalyzer = LexicalAnalyzerNameConverter.map(obj.getIndexAnalyzer()); - searchField.setIndexAnalyzer(_indexAnalyzer); + searchField.setIndexAnalyzer(indexAnalyzer); } - Boolean _facetable = obj.isFacetable(); - searchField.setFacetable(_facetable); + Boolean facetable = obj.isFacetable(); + searchField.setFacetable(facetable); if (obj.getSynonymMaps() != null) { - List _synonymMaps = new ArrayList<>(obj.getSynonymMaps()); - searchField.setSynonymMaps(_synonymMaps); + List synonymMaps = new ArrayList<>(obj.getSynonymMaps()); + searchField.setSynonymMaps(synonymMaps); } if (obj.getFields() != null) { - List _fields = + List fields = obj.getFields().stream().map(com.azure.search.documents.implementation.converters.SearchFieldConverter::map).collect(Collectors.toList()); - searchField.setFields(_fields); + searchField.setFields(fields); } - Boolean _key = obj.isKey(); - searchField.setKey(_key); + Boolean key = obj.isKey(); + searchField.setKey(key); return searchField; } + + private SearchFieldConverter() { + } } 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 index a0c470912450..d679f15b1257 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.SearchFieldDataTy } return com.azure.search.documents.implementation.models.SearchFieldDataType.fromString(obj.toString()); } + + private SearchFieldDataTypeConverter() { + } } 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 index ff72541a0bfa..d8cf2ec1882b 100644 --- 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 @@ -23,7 +23,7 @@ * 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}. @@ -35,70 +35,70 @@ public static SearchIndex map(com.azure.search.documents.implementation.models.S SearchIndex searchIndex = new SearchIndex(); if (obj.getTokenizers() != null) { - List _tokenizers = + List tokenizers = obj.getTokenizers().stream().map(LexicalTokenizerConverter::map).collect(Collectors.toList()); - searchIndex.setTokenizers(_tokenizers); + searchIndex.setTokenizers(tokenizers); } if (obj.getSuggesters() != null) { - List _suggesters = + List suggesters = obj.getSuggesters().stream().map(SuggesterConverter::map).collect(Collectors.toList()); - searchIndex.setSuggesters(_suggesters); + searchIndex.setSuggesters(suggesters); } if (obj.getCharFilters() != null) { - List _charFilters = + List charFilters = obj.getCharFilters().stream().map(CharFilterConverter::map).collect(Collectors.toList()); - searchIndex.setCharFilters(_charFilters); + searchIndex.setCharFilters(charFilters); } if (obj.getTokenFilters() != null) { - List _tokenFilters = + List tokenFilters = obj.getTokenFilters().stream().map(TokenFilterConverter::map).collect(Collectors.toList()); - searchIndex.setTokenFilters(_tokenFilters); + searchIndex.setTokenFilters(tokenFilters); } if (obj.getEncryptionKey() != null) { - SearchResourceEncryptionKey _encryptionKey = + SearchResourceEncryptionKey encryptionKey = SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey()); - searchIndex.setEncryptionKey(_encryptionKey); + searchIndex.setEncryptionKey(encryptionKey); } - String _defaultScoringProfile = obj.getDefaultScoringProfile(); - searchIndex.setDefaultScoringProfile(_defaultScoringProfile); + String defaultScoringProfile = obj.getDefaultScoringProfile(); + searchIndex.setDefaultScoringProfile(defaultScoringProfile); if (obj.getAnalyzers() != null) { - List _analyzers = + List analyzers = obj.getAnalyzers().stream().map(LexicalAnalyzerConverter::map).collect(Collectors.toList()); - searchIndex.setAnalyzers(_analyzers); + searchIndex.setAnalyzers(analyzers); } if (obj.getSimilarity() != null) { - Similarity _similarity = SimilarityConverter.map(obj.getSimilarity()); - searchIndex.setSimilarity(_similarity); + Similarity similarity = SimilarityConverter.map(obj.getSimilarity()); + searchIndex.setSimilarity(similarity); } - String _name = obj.getName(); - searchIndex.setName(_name); + String name = obj.getName(); + searchIndex.setName(name); if (obj.getCorsOptions() != null) { - CorsOptions _corsOptions = CorsOptionsConverter.map(obj.getCorsOptions()); - searchIndex.setCorsOptions(_corsOptions); + CorsOptions corsOptions = CorsOptionsConverter.map(obj.getCorsOptions()); + searchIndex.setCorsOptions(corsOptions); } - String _eTag = obj.getETag(); - searchIndex.setETag(_eTag); + String eTag = obj.getETag(); + searchIndex.setETag(eTag); if (obj.getScoringProfiles() != null) { - List _scoringProfiles = + List scoringProfiles = obj.getScoringProfiles().stream().map(ScoringProfileConverter::map).collect(Collectors.toList()); - searchIndex.setScoringProfiles(_scoringProfiles); + searchIndex.setScoringProfiles(scoringProfiles); } if (obj.getFields() != null) { - List _fields = + List fields = obj.getFields().stream().map(SearchFieldConverter::map).collect(Collectors.toList()); - searchIndex.setFields(_fields); + searchIndex.setFields(fields); } return searchIndex; } @@ -114,73 +114,76 @@ public static com.azure.search.documents.implementation.models.SearchIndex map(S new com.azure.search.documents.implementation.models.SearchIndex(); if (obj.getTokenizers() != null) { - List _tokenizers = + List tokenizers = obj.getTokenizers().stream().map(LexicalTokenizerConverter::map).collect(Collectors.toList()); - searchIndex.setTokenizers(_tokenizers); + searchIndex.setTokenizers(tokenizers); } if (obj.getSuggesters() != null) { - List _suggesters = + List suggesters = obj.getSuggesters().stream().map(SuggesterConverter::map).collect(Collectors.toList()); - searchIndex.setSuggesters(_suggesters); + searchIndex.setSuggesters(suggesters); } if (obj.getCharFilters() != null) { - List _charFilters = + List charFilters = obj.getCharFilters().stream().map(CharFilterConverter::map).collect(Collectors.toList()); - searchIndex.setCharFilters(_charFilters); + searchIndex.setCharFilters(charFilters); } if (obj.getTokenFilters() != null) { - List _tokenFilters = + List tokenFilters = obj.getTokenFilters().stream().map(TokenFilterConverter::map).collect(Collectors.toList()); - searchIndex.setTokenFilters(_tokenFilters); + searchIndex.setTokenFilters(tokenFilters); } if (obj.getEncryptionKey() != null) { - com.azure.search.documents.implementation.models.SearchResourceEncryptionKey _encryptionKey = + com.azure.search.documents.implementation.models.SearchResourceEncryptionKey encryptionKey = SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey()); - searchIndex.setEncryptionKey(_encryptionKey); + searchIndex.setEncryptionKey(encryptionKey); } - String _defaultScoringProfile = obj.getDefaultScoringProfile(); - searchIndex.setDefaultScoringProfile(_defaultScoringProfile); + String defaultScoringProfile = obj.getDefaultScoringProfile(); + searchIndex.setDefaultScoringProfile(defaultScoringProfile); if (obj.getAnalyzers() != null) { - List _analyzers = + List analyzers = obj.getAnalyzers().stream().map(LexicalAnalyzerConverter::map).collect(Collectors.toList()); - searchIndex.setAnalyzers(_analyzers); + searchIndex.setAnalyzers(analyzers); } if (obj.getSimilarity() != null) { - com.azure.search.documents.implementation.models.Similarity _similarity = + com.azure.search.documents.implementation.models.Similarity similarity = SimilarityConverter.map(obj.getSimilarity()); - searchIndex.setSimilarity(_similarity); + searchIndex.setSimilarity(similarity); } - String _name = obj.getName(); - searchIndex.setName(_name); + String name = obj.getName(); + searchIndex.setName(name); if (obj.getCorsOptions() != null) { - com.azure.search.documents.implementation.models.CorsOptions _corsOptions = + com.azure.search.documents.implementation.models.CorsOptions corsOptions = CorsOptionsConverter.map(obj.getCorsOptions()); - searchIndex.setCorsOptions(_corsOptions); + searchIndex.setCorsOptions(corsOptions); } - String _eTag = obj.getETag(); - searchIndex.setETag(_eTag); + String eTag = obj.getETag(); + searchIndex.setETag(eTag); if (obj.getScoringProfiles() != null) { - List _scoringProfiles = + List scoringProfiles = obj.getScoringProfiles().stream().map(ScoringProfileConverter::map).collect(Collectors.toList()); - searchIndex.setScoringProfiles(_scoringProfiles); + searchIndex.setScoringProfiles(scoringProfiles); } if (obj.getFields() != null) { - List _fields = + List fields = obj.getFields().stream().map(SearchFieldConverter::map).collect(Collectors.toList()); - searchIndex.setFields(_fields); + searchIndex.setFields(fields); } return searchIndex; } + + private SearchIndexConverter() { + } } 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 index c16f94ad2837..0e1834455e3e 100644 --- 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 @@ -16,7 +16,7 @@ * 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}. @@ -28,46 +28,46 @@ public static SearchIndexer map(com.azure.search.documents.implementation.models SearchIndexer searchIndexer = new SearchIndexer(); if (obj.getSchedule() != null) { - IndexingSchedule _schedule = IndexingScheduleConverter.map(obj.getSchedule()); - searchIndexer.setSchedule(_schedule); + IndexingSchedule schedule = IndexingScheduleConverter.map(obj.getSchedule()); + searchIndexer.setSchedule(schedule); } - String _skillsetName = obj.getSkillsetName(); - searchIndexer.setSkillsetName(_skillsetName); + String skillsetName = obj.getSkillsetName(); + searchIndexer.setSkillsetName(skillsetName); - String _name = obj.getName(); - searchIndexer.setName(_name); + String name = obj.getName(); + searchIndexer.setName(name); - String _description = obj.getDescription(); - searchIndexer.setDescription(_description); + String description = obj.getDescription(); + searchIndexer.setDescription(description); - String _eTag = obj.getETag(); - searchIndexer.setETag(_eTag); + String eTag = obj.getETag(); + searchIndexer.setETag(eTag); - String _targetIndexName = obj.getTargetIndexName(); - searchIndexer.setTargetIndexName(_targetIndexName); + String targetIndexName = obj.getTargetIndexName(); + searchIndexer.setTargetIndexName(targetIndexName); if (obj.getFieldMappings() != null) { - List _fieldMappings = + List fieldMappings = obj.getFieldMappings().stream().map(FieldMappingConverter::map).collect(Collectors.toList()); - searchIndexer.setFieldMappings(_fieldMappings); + searchIndexer.setFieldMappings(fieldMappings); } - Boolean _isDisabled = obj.isDisabled(); - searchIndexer.setIsDisabled(_isDisabled); + Boolean isDisabled = obj.isDisabled(); + searchIndexer.setIsDisabled(isDisabled); if (obj.getParameters() != null) { - IndexingParameters _parameters = IndexingParametersConverter.map(obj.getParameters()); - searchIndexer.setParameters(_parameters); + IndexingParameters parameters = IndexingParametersConverter.map(obj.getParameters()); + searchIndexer.setParameters(parameters); } - String _dataSourceName = obj.getDataSourceName(); - searchIndexer.setDataSourceName(_dataSourceName); + String dataSourceName = obj.getDataSourceName(); + searchIndexer.setDataSourceName(dataSourceName); if (obj.getOutputFieldMappings() != null) { - List _outputFieldMappings = + List outputFieldMappings = obj.getOutputFieldMappings().stream().map(FieldMappingConverter::map).collect(Collectors.toList()); - searchIndexer.setOutputFieldMappings(_outputFieldMappings); + searchIndexer.setOutputFieldMappings(outputFieldMappings); } return searchIndexer; } @@ -83,49 +83,52 @@ public static com.azure.search.documents.implementation.models.SearchIndexer map new com.azure.search.documents.implementation.models.SearchIndexer(); if (obj.getSchedule() != null) { - com.azure.search.documents.implementation.models.IndexingSchedule _schedule = + com.azure.search.documents.implementation.models.IndexingSchedule schedule = IndexingScheduleConverter.map(obj.getSchedule()); - searchIndexer.setSchedule(_schedule); + searchIndexer.setSchedule(schedule); } - String _skillsetName = obj.getSkillsetName(); - searchIndexer.setSkillsetName(_skillsetName); + String skillsetName = obj.getSkillsetName(); + searchIndexer.setSkillsetName(skillsetName); - String _name = obj.getName(); - searchIndexer.setName(_name); + String name = obj.getName(); + searchIndexer.setName(name); - String _description = obj.getDescription(); - searchIndexer.setDescription(_description); + String description = obj.getDescription(); + searchIndexer.setDescription(description); - String _eTag = obj.getETag(); - searchIndexer.setETag(_eTag); + String eTag = obj.getETag(); + searchIndexer.setETag(eTag); - String _targetIndexName = obj.getTargetIndexName(); - searchIndexer.setTargetIndexName(_targetIndexName); + String targetIndexName = obj.getTargetIndexName(); + searchIndexer.setTargetIndexName(targetIndexName); if (obj.getFieldMappings() != null) { - List _fieldMappings = + List fieldMappings = obj.getFieldMappings().stream().map(FieldMappingConverter::map).collect(Collectors.toList()); - searchIndexer.setFieldMappings(_fieldMappings); + searchIndexer.setFieldMappings(fieldMappings); } - Boolean _isDisabled = obj.isDisabled(); - searchIndexer.setIsDisabled(_isDisabled); + Boolean isDisabled = obj.isDisabled(); + searchIndexer.setIsDisabled(isDisabled); if (obj.getParameters() != null) { - com.azure.search.documents.implementation.models.IndexingParameters _parameters = + com.azure.search.documents.implementation.models.IndexingParameters parameters = IndexingParametersConverter.map(obj.getParameters()); - searchIndexer.setParameters(_parameters); + searchIndexer.setParameters(parameters); } - String _dataSourceName = obj.getDataSourceName(); - searchIndexer.setDataSourceName(_dataSourceName); + String dataSourceName = obj.getDataSourceName(); + searchIndexer.setDataSourceName(dataSourceName); if (obj.getOutputFieldMappings() != null) { - List _outputFieldMappings = + List outputFieldMappings = obj.getOutputFieldMappings().stream().map(FieldMappingConverter::map).collect(Collectors.toList()); - searchIndexer.setOutputFieldMappings(_outputFieldMappings); + searchIndexer.setOutputFieldMappings(outputFieldMappings); } return searchIndexer; } + + private SearchIndexerConverter() { + } } 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 index acf947c0d605..85669dbc86cf 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static SearchIndexerDataContainer map(com.azure.search.documents.implemen } SearchIndexerDataContainer searchIndexerDataContainer = new SearchIndexerDataContainer(); - String _query = obj.getQuery(); - searchIndexerDataContainer.setQuery(_query); + String query = obj.getQuery(); + searchIndexerDataContainer.setQuery(query); - String _name = obj.getName(); - searchIndexerDataContainer.setName(_name); + String name = obj.getName(); + searchIndexerDataContainer.setName(name); return searchIndexerDataContainer; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.SearchIndexerData com.azure.search.documents.implementation.models.SearchIndexerDataContainer searchIndexerDataContainer = new com.azure.search.documents.implementation.models.SearchIndexerDataContainer(); - String _query = obj.getQuery(); - searchIndexerDataContainer.setQuery(_query); + String query = obj.getQuery(); + searchIndexerDataContainer.setQuery(query); - String _name = obj.getName(); - searchIndexerDataContainer.setName(_name); + String name = obj.getName(); + searchIndexerDataContainer.setName(name); return searchIndexerDataContainer; } + + private SearchIndexerDataContainerConverter() { + } } 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 index 0b9949ea71db..36f43bc83227 100644 --- 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 @@ -16,7 +16,7 @@ * {@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 @@ -29,39 +29,39 @@ public static SearchIndexerDataSource map(com.azure.search.documents.implementat SearchIndexerDataSource searchIndexerDataSource = new SearchIndexerDataSource(); if (obj.getContainer() != null) { - SearchIndexerDataContainer _container = SearchIndexerDataContainerConverter.map(obj.getContainer()); - searchIndexerDataSource.setContainer(_container); + SearchIndexerDataContainer container = SearchIndexerDataContainerConverter.map(obj.getContainer()); + searchIndexerDataSource.setContainer(container); } if (obj.getDataChangeDetectionPolicy() != null) { - DataChangeDetectionPolicy _dataChangeDetectionPolicy = + DataChangeDetectionPolicy dataChangeDetectionPolicy = DataChangeDetectionPolicyConverter.map(obj.getDataChangeDetectionPolicy()); - searchIndexerDataSource.setDataChangeDetectionPolicy(_dataChangeDetectionPolicy); + searchIndexerDataSource.setDataChangeDetectionPolicy(dataChangeDetectionPolicy); } if (obj.getCredentials() != null) { - DataSourceCredentials _credentials = DataSourceCredentialsConverter.map(obj.getCredentials()); - searchIndexerDataSource.setCredentials(_credentials); + DataSourceCredentials credentials = DataSourceCredentialsConverter.map(obj.getCredentials()); + searchIndexerDataSource.setCredentials(credentials); } - String _name = obj.getName(); - searchIndexerDataSource.setName(_name); + String name = obj.getName(); + searchIndexerDataSource.setName(name); - String _description = obj.getDescription(); - searchIndexerDataSource.setDescription(_description); + String description = obj.getDescription(); + searchIndexerDataSource.setDescription(description); if (obj.getDataDeletionDetectionPolicy() != null) { - DataDeletionDetectionPolicy _dataDeletionDetectionPolicy = + DataDeletionDetectionPolicy dataDeletionDetectionPolicy = DataDeletionDetectionPolicyConverter.map(obj.getDataDeletionDetectionPolicy()); - searchIndexerDataSource.setDataDeletionDetectionPolicy(_dataDeletionDetectionPolicy); + searchIndexerDataSource.setDataDeletionDetectionPolicy(dataDeletionDetectionPolicy); } - String _eTag = obj.getETag(); - searchIndexerDataSource.setETag(_eTag); + String eTag = obj.getETag(); + searchIndexerDataSource.setETag(eTag); if (obj.getType() != null) { - SearchIndexerDataSourceType _type = SearchIndexerDataSourceTypeConverter.map(obj.getType()); - searchIndexerDataSource.setType(_type); + SearchIndexerDataSourceType type = SearchIndexerDataSourceTypeConverter.map(obj.getType()); + searchIndexerDataSource.setType(type); } return searchIndexerDataSource; } @@ -78,42 +78,46 @@ public static com.azure.search.documents.implementation.models.SearchIndexerData new com.azure.search.documents.implementation.models.SearchIndexerDataSource(); if (obj.getContainer() != null) { - com.azure.search.documents.implementation.models.SearchIndexerDataContainer _container = + com.azure.search.documents.implementation.models.SearchIndexerDataContainer container = SearchIndexerDataContainerConverter.map(obj.getContainer()); - searchIndexerDataSource.setContainer(_container); + searchIndexerDataSource.setContainer(container); } if (obj.getDataChangeDetectionPolicy() != null) { - com.azure.search.documents.implementation.models.DataChangeDetectionPolicy _dataChangeDetectionPolicy = + com.azure.search.documents.implementation.models.DataChangeDetectionPolicy dataChangeDetectionPolicy = DataChangeDetectionPolicyConverter.map(obj.getDataChangeDetectionPolicy()); - searchIndexerDataSource.setDataChangeDetectionPolicy(_dataChangeDetectionPolicy); + searchIndexerDataSource.setDataChangeDetectionPolicy(dataChangeDetectionPolicy); } if (obj.getCredentials() != null) { - com.azure.search.documents.implementation.models.DataSourceCredentials _credentials = + com.azure.search.documents.implementation.models.DataSourceCredentials credentials = DataSourceCredentialsConverter.map(obj.getCredentials()); - searchIndexerDataSource.setCredentials(_credentials); + searchIndexerDataSource.setCredentials(credentials); } - String _name = obj.getName(); - searchIndexerDataSource.setName(_name); + String name = obj.getName(); + searchIndexerDataSource.setName(name); - String _description = obj.getDescription(); - searchIndexerDataSource.setDescription(_description); + 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); + com.azure.search.documents.implementation.models.DataDeletionDetectionPolicy dataDeletionDetectionPolicy + = DataDeletionDetectionPolicyConverter.map(obj.getDataDeletionDetectionPolicy()); + searchIndexerDataSource.setDataDeletionDetectionPolicy(dataDeletionDetectionPolicy); } - String _eTag = obj.getETag(); - searchIndexerDataSource.setETag(_eTag); + String eTag = obj.getETag(); + searchIndexerDataSource.setETag(eTag); if (obj.getType() != null) { - com.azure.search.documents.implementation.models.SearchIndexerDataSourceType _type = + com.azure.search.documents.implementation.models.SearchIndexerDataSourceType type = SearchIndexerDataSourceTypeConverter.map(obj.getType()); - searchIndexerDataSource.setType(_type); + searchIndexerDataSource.setType(type); } return searchIndexerDataSource; } + + private SearchIndexerDataSourceConverter() { + } } 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 index 737c1e5eaf08..bca135db9758 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.SearchIndexerData } return com.azure.search.documents.implementation.models.SearchIndexerDataSourceType.fromString(obj.toString()); } + + private SearchIndexerDataSourceTypeConverter() { + } } 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 index 482976f0d916..df5dc223fb61 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,23 +24,23 @@ public static SearchIndexerError map(com.azure.search.documents.implementation.m } SearchIndexerError searchIndexerError = new SearchIndexerError(); - String _errorMessage = obj.getErrorMessage(); - PrivateFieldAccessHelper.set(searchIndexerError, "errorMessage", _errorMessage); + String errorMessage = obj.getErrorMessage(); + PrivateFieldAccessHelper.set(searchIndexerError, "errorMessage", errorMessage); - String _name = obj.getName(); - PrivateFieldAccessHelper.set(searchIndexerError, "name", _name); + String name = obj.getName(); + PrivateFieldAccessHelper.set(searchIndexerError, "name", name); - String _details = obj.getDetails(); - PrivateFieldAccessHelper.set(searchIndexerError, "details", _details); + String details = obj.getDetails(); + PrivateFieldAccessHelper.set(searchIndexerError, "details", details); - String _documentationLink = obj.getDocumentationLink(); - PrivateFieldAccessHelper.set(searchIndexerError, "documentationLink", _documentationLink); + String documentationLink = obj.getDocumentationLink(); + PrivateFieldAccessHelper.set(searchIndexerError, "documentationLink", documentationLink); - String _key = obj.getKey(); - PrivateFieldAccessHelper.set(searchIndexerError, "key", _key); + String key = obj.getKey(); + PrivateFieldAccessHelper.set(searchIndexerError, "key", key); - int _statusCode = obj.getStatusCode(); - PrivateFieldAccessHelper.set(searchIndexerError, "statusCode", _statusCode); + int statusCode = obj.getStatusCode(); + PrivateFieldAccessHelper.set(searchIndexerError, "statusCode", statusCode); return searchIndexerError; } @@ -55,23 +55,26 @@ public static com.azure.search.documents.implementation.models.SearchIndexerErro 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 errorMessage = obj.getErrorMessage(); + PrivateFieldAccessHelper.set(searchIndexerError, "errorMessage", errorMessage); - String _name = obj.getName(); - PrivateFieldAccessHelper.set(searchIndexerError, "name", _name); + String name = obj.getName(); + PrivateFieldAccessHelper.set(searchIndexerError, "name", name); - String _details = obj.getDetails(); - PrivateFieldAccessHelper.set(searchIndexerError, "details", _details); + String details = obj.getDetails(); + PrivateFieldAccessHelper.set(searchIndexerError, "details", details); - String _documentationLink = obj.getDocumentationLink(); - PrivateFieldAccessHelper.set(searchIndexerError, "documentationLink", _documentationLink); + String documentationLink = obj.getDocumentationLink(); + PrivateFieldAccessHelper.set(searchIndexerError, "documentationLink", documentationLink); - String _key = obj.getKey(); - PrivateFieldAccessHelper.set(searchIndexerError, "key", _key); + String key = obj.getKey(); + PrivateFieldAccessHelper.set(searchIndexerError, "key", key); - int _statusCode = obj.getStatusCode(); - PrivateFieldAccessHelper.set(searchIndexerError, "statusCode", _statusCode); + int statusCode = obj.getStatusCode(); + PrivateFieldAccessHelper.set(searchIndexerError, "statusCode", statusCode); return searchIndexerError; } + + private SearchIndexerErrorConverter() { + } } 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 index a82b82e45de3..8f38445f6ceb 100644 --- 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 @@ -14,7 +14,7 @@ * {@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 @@ -26,15 +26,15 @@ public static SearchIndexerLimits map(com.azure.search.documents.implementation. } SearchIndexerLimits searchIndexerLimits = new SearchIndexerLimits(); - Duration _maxRunTime = obj.getMaxRunTime(); - PrivateFieldAccessHelper.set(searchIndexerLimits, "maxRunTime", _maxRunTime); + Duration maxRunTime = obj.getMaxRunTime(); + PrivateFieldAccessHelper.set(searchIndexerLimits, "maxRunTime", maxRunTime); - Double _maxDocumentContentCharactersToExtract = obj.getMaxDocumentContentCharactersToExtract(); + Double maxDocumentContentCharactersToExtract = obj.getMaxDocumentContentCharactersToExtract(); PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentContentCharactersToExtract", - _maxDocumentContentCharactersToExtract); + maxDocumentContentCharactersToExtract); - Double _maxDocumentExtractionSize = obj.getMaxDocumentExtractionSize(); - PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentExtractionSize", _maxDocumentExtractionSize); + Double maxDocumentExtractionSize = obj.getMaxDocumentExtractionSize(); + PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentExtractionSize", maxDocumentExtractionSize); return searchIndexerLimits; } @@ -49,15 +49,18 @@ public static com.azure.search.documents.implementation.models.SearchIndexerLimi 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); + Duration maxRunTime = obj.getMaxRunTime(); + PrivateFieldAccessHelper.set(searchIndexerLimits, "maxRunTime", maxRunTime); - Double _maxDocumentContentCharactersToExtract = obj.getMaxDocumentContentCharactersToExtract(); + Double maxDocumentContentCharactersToExtract = obj.getMaxDocumentContentCharactersToExtract(); PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentContentCharactersToExtract", - _maxDocumentContentCharactersToExtract); + maxDocumentContentCharactersToExtract); - Double _maxDocumentExtractionSize = obj.getMaxDocumentExtractionSize(); - PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentExtractionSize", _maxDocumentExtractionSize); + Double maxDocumentExtractionSize = obj.getMaxDocumentExtractionSize(); + PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentExtractionSize", maxDocumentExtractionSize); return searchIndexerLimits; } + + private SearchIndexerLimitsConverter() { + } } 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 index 7155e6f856b6..0e7d19d40c96 100644 --- 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 @@ -115,6 +115,10 @@ public static com.azure.search.documents.implementation.models.SearchIndexerSkil 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private SearchIndexerSkillConverter() { } } 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 index 91ef45fb1fdb..edcaf7d91779 100644 --- 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 @@ -16,7 +16,7 @@ * {@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 @@ -29,25 +29,25 @@ public static SearchIndexerSkillset map(com.azure.search.documents.implementatio SearchIndexerSkillset searchIndexerSkillset = new SearchIndexerSkillset(); if (obj.getSkills() != null) { - List _skills = + List skills = obj.getSkills().stream().map(SearchIndexerSkillConverter::map).collect(Collectors.toList()); - searchIndexerSkillset.setSkills(_skills); + searchIndexerSkillset.setSkills(skills); } - String _name = obj.getName(); - searchIndexerSkillset.setName(_name); + String name = obj.getName(); + searchIndexerSkillset.setName(name); if (obj.getCognitiveServicesAccount() != null) { - CognitiveServicesAccount _cognitiveServicesAccount = + CognitiveServicesAccount cognitiveServicesAccount = CognitiveServicesAccountConverter.map(obj.getCognitiveServicesAccount()); - searchIndexerSkillset.setCognitiveServicesAccount(_cognitiveServicesAccount); + searchIndexerSkillset.setCognitiveServicesAccount(cognitiveServicesAccount); } - String _description = obj.getDescription(); - searchIndexerSkillset.setDescription(_description); + String description = obj.getDescription(); + searchIndexerSkillset.setDescription(description); - String _eTag = obj.getETag(); - searchIndexerSkillset.setETag(_eTag); + String eTag = obj.getETag(); + searchIndexerSkillset.setETag(eTag); return searchIndexerSkillset; } @@ -63,25 +63,28 @@ public static com.azure.search.documents.implementation.models.SearchIndexerSkil new com.azure.search.documents.implementation.models.SearchIndexerSkillset(); if (obj.getSkills() != null) { - List _skills = + List skills = obj.getSkills().stream().map(SearchIndexerSkillConverter::map).collect(Collectors.toList()); - searchIndexerSkillset.setSkills(_skills); + searchIndexerSkillset.setSkills(skills); } - String _name = obj.getName(); - searchIndexerSkillset.setName(_name); + String name = obj.getName(); + searchIndexerSkillset.setName(name); if (obj.getCognitiveServicesAccount() != null) { - com.azure.search.documents.implementation.models.CognitiveServicesAccount _cognitiveServicesAccount = + com.azure.search.documents.implementation.models.CognitiveServicesAccount cognitiveServicesAccount = CognitiveServicesAccountConverter.map(obj.getCognitiveServicesAccount()); - searchIndexerSkillset.setCognitiveServicesAccount(_cognitiveServicesAccount); + searchIndexerSkillset.setCognitiveServicesAccount(cognitiveServicesAccount); } - String _description = obj.getDescription(); - searchIndexerSkillset.setDescription(_description); + String description = obj.getDescription(); + searchIndexerSkillset.setDescription(description); - String _eTag = obj.getETag(); - searchIndexerSkillset.setETag(_eTag); + String eTag = obj.getETag(); + searchIndexerSkillset.setETag(eTag); return searchIndexerSkillset; } + + private SearchIndexerSkillsetConverter() { + } } 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 index 30f45ab89d0e..fd1c08b9bab1 100644 --- 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 @@ -18,7 +18,7 @@ * {@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 @@ -31,24 +31,24 @@ public static SearchIndexerStatus map(com.azure.search.documents.implementation. SearchIndexerStatus searchIndexerStatus = new SearchIndexerStatus(); if (obj.getLastResult() != null) { - IndexerExecutionResult _lastResult = IndexerExecutionResultConverter.map(obj.getLastResult()); - PrivateFieldAccessHelper.set(searchIndexerStatus, "lastResult", _lastResult); + IndexerExecutionResult lastResult = IndexerExecutionResultConverter.map(obj.getLastResult()); + PrivateFieldAccessHelper.set(searchIndexerStatus, "lastResult", lastResult); } if (obj.getExecutionHistory() != null) { - List _executionHistory = + List executionHistory = obj.getExecutionHistory().stream().map(IndexerExecutionResultConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(searchIndexerStatus, "executionHistory", _executionHistory); + PrivateFieldAccessHelper.set(searchIndexerStatus, "executionHistory", executionHistory); } if (obj.getLimits() != null) { - SearchIndexerLimits _limits = SearchIndexerLimitsConverter.map(obj.getLimits()); - PrivateFieldAccessHelper.set(searchIndexerStatus, "limits", _limits); + 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); + IndexerStatus status = IndexerStatusConverter.map(obj.getStatus()); + PrivateFieldAccessHelper.set(searchIndexerStatus, "status", status); } return searchIndexerStatus; } @@ -65,28 +65,31 @@ public static com.azure.search.documents.implementation.models.SearchIndexerStat new com.azure.search.documents.implementation.models.SearchIndexerStatus(); if (obj.getLastResult() != null) { - com.azure.search.documents.implementation.models.IndexerExecutionResult _lastResult = + com.azure.search.documents.implementation.models.IndexerExecutionResult lastResult = IndexerExecutionResultConverter.map(obj.getLastResult()); - PrivateFieldAccessHelper.set(searchIndexerStatus, "lastResult", _lastResult); + PrivateFieldAccessHelper.set(searchIndexerStatus, "lastResult", lastResult); } if (obj.getExecutionHistory() != null) { - List _executionHistory = + List executionHistory = obj.getExecutionHistory().stream().map(IndexerExecutionResultConverter::map).collect(Collectors.toList()); - PrivateFieldAccessHelper.set(searchIndexerStatus, "executionHistory", _executionHistory); + PrivateFieldAccessHelper.set(searchIndexerStatus, "executionHistory", executionHistory); } if (obj.getLimits() != null) { - com.azure.search.documents.implementation.models.SearchIndexerLimits _limits = + com.azure.search.documents.implementation.models.SearchIndexerLimits limits = SearchIndexerLimitsConverter.map(obj.getLimits()); - PrivateFieldAccessHelper.set(searchIndexerStatus, "limits", _limits); + PrivateFieldAccessHelper.set(searchIndexerStatus, "limits", limits); } if (obj.getStatus() != null) { - com.azure.search.documents.implementation.models.IndexerStatus _status = + com.azure.search.documents.implementation.models.IndexerStatus status = IndexerStatusConverter.map(obj.getStatus()); - PrivateFieldAccessHelper.set(searchIndexerStatus, "status", _status); + PrivateFieldAccessHelper.set(searchIndexerStatus, "status", status); } return searchIndexerStatus; } + + private SearchIndexerStatusConverter() { + } } 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 index 051e9ff69343..541fed16ad2c 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,20 +24,20 @@ public static SearchIndexerWarning map(com.azure.search.documents.implementation } SearchIndexerWarning searchIndexerWarning = new SearchIndexerWarning(); - String _name = obj.getName(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "name", _name); + String name = obj.getName(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "name", name); - String _details = obj.getDetails(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "details", _details); + String details = obj.getDetails(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "details", details); - String _documentationLink = obj.getDocumentationLink(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "documentationLink", _documentationLink); + String documentationLink = obj.getDocumentationLink(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "documentationLink", documentationLink); - String _message = obj.getMessage(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "message", _message); + String message = obj.getMessage(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "message", message); - String _key = obj.getKey(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "key", _key); + String key = obj.getKey(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "key", key); return searchIndexerWarning; } @@ -52,20 +52,23 @@ public static com.azure.search.documents.implementation.models.SearchIndexerWarn 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 name = obj.getName(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "name", name); - String _details = obj.getDetails(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "details", _details); + String details = obj.getDetails(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "details", details); - String _documentationLink = obj.getDocumentationLink(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "documentationLink", _documentationLink); + String documentationLink = obj.getDocumentationLink(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "documentationLink", documentationLink); - String _message = obj.getMessage(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "message", _message); + String message = obj.getMessage(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "message", message); - String _key = obj.getKey(); - PrivateFieldAccessHelper.set(searchIndexerWarning, "key", _key); + String key = obj.getKey(); + PrivateFieldAccessHelper.set(searchIndexerWarning, "key", key); return searchIndexerWarning; } + + private SearchIndexerWarningConverter() { + } } 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 index 3dc99a425680..b052dd2d194c 100644 --- 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 @@ -48,4 +48,7 @@ public static com.azure.search.documents.implementation.models.SearchMode map(Se throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private SearchModeConverter() { + } } 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 index 465342c2acb3..fda1f0cc378c 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,20 +24,20 @@ public static SearchResourceEncryptionKey map(com.azure.search.documents.impleme } SearchResourceEncryptionKey searchResourceEncryptionKey = new SearchResourceEncryptionKey(); - String _keyVersion = obj.getKeyVersion(); - searchResourceEncryptionKey.setKeyVersion(_keyVersion); + String keyVersion = obj.getKeyVersion(); + searchResourceEncryptionKey.setKeyVersion(keyVersion); if (obj.getAccessCredentials() != null) { - AzureActiveDirectoryApplicationCredentials _accessCredentials = + AzureActiveDirectoryApplicationCredentials accessCredentials = AzureActiveDirectoryApplicationCredentialsConverter.map(obj.getAccessCredentials()); - searchResourceEncryptionKey.setAccessCredentials(_accessCredentials); + searchResourceEncryptionKey.setAccessCredentials(accessCredentials); } - String _keyName = obj.getKeyName(); - searchResourceEncryptionKey.setKeyName(_keyName); + String keyName = obj.getKeyName(); + searchResourceEncryptionKey.setKeyName(keyName); - String _vaultUri = obj.getVaultUri(); - searchResourceEncryptionKey.setVaultUri(_vaultUri); + String vaultUri = obj.getVaultUri(); + searchResourceEncryptionKey.setVaultUri(vaultUri); return searchResourceEncryptionKey; } @@ -52,19 +52,22 @@ public static com.azure.search.documents.implementation.models.SearchResourceEnc com.azure.search.documents.implementation.models.SearchResourceEncryptionKey searchResourceEncryptionKey = new com.azure.search.documents.implementation.models.SearchResourceEncryptionKey(); - String _keyVersion = obj.getKeyVersion(); - searchResourceEncryptionKey.setKeyVersion(_keyVersion); + 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); + com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials accessCredentials = AzureActiveDirectoryApplicationCredentialsConverter.map(obj.getAccessCredentials()); + searchResourceEncryptionKey.setAccessCredentials(accessCredentials); } - String _keyName = obj.getKeyName(); - searchResourceEncryptionKey.setKeyName(_keyName); + String keyName = obj.getKeyName(); + searchResourceEncryptionKey.setKeyName(keyName); - String _vaultUri = obj.getVaultUri(); - searchResourceEncryptionKey.setVaultUri(_vaultUri); + String vaultUri = obj.getVaultUri(); + searchResourceEncryptionKey.setVaultUri(vaultUri); return searchResourceEncryptionKey; } + + private SearchResourceEncryptionKeyConverter() { + } } 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 index 92230e8653ac..d4ae28d39b3d 100644 --- 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 @@ -16,7 +16,7 @@ * 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}. @@ -27,18 +27,18 @@ public static SearchResult map(com.azure.search.documents.implementation.models. } SearchResult searchResult = new SearchResult(); - double _score = obj.getScore(); - PrivateFieldAccessHelper.set(searchResult, "score", _score); + double score = obj.getScore(); + PrivateFieldAccessHelper.set(searchResult, "score", score); if (obj.getHighlights() != null) { - Map> _highlights = + Map> highlights = obj.getHighlights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - PrivateFieldAccessHelper.set(searchResult, "highlights", _highlights); + PrivateFieldAccessHelper.set(searchResult, "highlights", highlights); } - SearchDocument _additionalProperties = new SearchDocument(obj.getAdditionalProperties()); - PrivateFieldAccessHelper.set(searchResult, "additionalProperties", _additionalProperties); + SearchDocument additionalProperties = new SearchDocument(obj.getAdditionalProperties()); + PrivateFieldAccessHelper.set(searchResult, "additionalProperties", additionalProperties); return searchResult; } @@ -52,18 +52,21 @@ public static com.azure.search.documents.implementation.models.SearchResult map( 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); + double score = obj.getScore(); + PrivateFieldAccessHelper.set(searchResult, "score", score); if (obj.getHighlights() != null) { - Map> _highlights = + Map> highlights = obj.getHighlights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - PrivateFieldAccessHelper.set(searchResult, "highlights", _highlights); + PrivateFieldAccessHelper.set(searchResult, "highlights", highlights); } - SearchDocument _additionalProperties = obj.getDocument(); - PrivateFieldAccessHelper.set(searchResult, "additionalProperties", _additionalProperties); + SearchDocument additionalProperties = obj.getDocument(); + PrivateFieldAccessHelper.set(searchResult, "additionalProperties", additionalProperties); return searchResult; } + + private SearchResultConverter() { + } } 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 index f74c00580d61..5fcb0d6f557b 100644 --- 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 @@ -17,7 +17,7 @@ * {@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}. @@ -29,30 +29,30 @@ public static SentimentSkill map(com.azure.search.documents.implementation.model SentimentSkill sentimentSkill = new SentimentSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - sentimentSkill.setOutputs(_outputs); + sentimentSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - sentimentSkill.setInputs(_inputs); + sentimentSkill.setInputs(inputs); } - String _name = obj.getName(); - sentimentSkill.setName(_name); + String name = obj.getName(); + sentimentSkill.setName(name); - String _context = obj.getContext(); - sentimentSkill.setContext(_context); + String context = obj.getContext(); + sentimentSkill.setContext(context); - String _description = obj.getDescription(); - sentimentSkill.setDescription(_description); + String description = obj.getDescription(); + sentimentSkill.setDescription(description); if (obj.getDefaultLanguageCode() != null) { - SentimentSkillLanguage _defaultLanguageCode = + SentimentSkillLanguage defaultLanguageCode = SentimentSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - sentimentSkill.setDefaultLanguageCode(_defaultLanguageCode); + sentimentSkill.setDefaultLanguageCode(defaultLanguageCode); } return sentimentSkill; } @@ -68,31 +68,34 @@ public static com.azure.search.documents.implementation.models.SentimentSkill ma new com.azure.search.documents.implementation.models.SentimentSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - sentimentSkill.setOutputs(_outputs); + sentimentSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - sentimentSkill.setInputs(_inputs); + sentimentSkill.setInputs(inputs); } - String _name = obj.getName(); - sentimentSkill.setName(_name); + String name = obj.getName(); + sentimentSkill.setName(name); - String _context = obj.getContext(); - sentimentSkill.setContext(_context); + String context = obj.getContext(); + sentimentSkill.setContext(context); - String _description = obj.getDescription(); - sentimentSkill.setDescription(_description); + String description = obj.getDescription(); + sentimentSkill.setDescription(description); if (obj.getDefaultLanguageCode() != null) { - com.azure.search.documents.implementation.models.SentimentSkillLanguage _defaultLanguageCode = + com.azure.search.documents.implementation.models.SentimentSkillLanguage defaultLanguageCode = SentimentSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - sentimentSkill.setDefaultLanguageCode(_defaultLanguageCode); + sentimentSkill.setDefaultLanguageCode(defaultLanguageCode); } return sentimentSkill; } + + private SentimentSkillConverter() { + } } 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 index a261e268112d..581b24cdf010 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.SentimentSkillLanguage; /** @@ -11,8 +10,6 @@ * {@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}. @@ -34,4 +31,7 @@ public static com.azure.search.documents.implementation.models.SentimentSkillLan } return com.azure.search.documents.implementation.models.SentimentSkillLanguage.fromString(obj.toString()); } + + private SentimentSkillLanguageConverter() { + } } 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 index f337ebe2feea..41684dc9eedb 100644 --- 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 @@ -12,7 +12,7 @@ * {@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}. @@ -24,38 +24,38 @@ public static ServiceCounters map(com.azure.search.documents.implementation.mode ServiceCounters serviceCounters = new ServiceCounters(); if (obj.getDocumentCounter() != null) { - ResourceCounter _documentCounter = ResourceCounterConverter.map(obj.getDocumentCounter()); - serviceCounters.setDocumentCounter(_documentCounter); + ResourceCounter documentCounter = ResourceCounterConverter.map(obj.getDocumentCounter()); + serviceCounters.setDocumentCounter(documentCounter); } if (obj.getIndexCounter() != null) { - ResourceCounter _indexCounter = ResourceCounterConverter.map(obj.getIndexCounter()); - serviceCounters.setIndexCounter(_indexCounter); + ResourceCounter indexCounter = ResourceCounterConverter.map(obj.getIndexCounter()); + serviceCounters.setIndexCounter(indexCounter); } if (obj.getSynonymMapCounter() != null) { - ResourceCounter _synonymMapCounter = ResourceCounterConverter.map(obj.getSynonymMapCounter()); - serviceCounters.setSynonymMapCounter(_synonymMapCounter); + ResourceCounter synonymMapCounter = ResourceCounterConverter.map(obj.getSynonymMapCounter()); + serviceCounters.setSynonymMapCounter(synonymMapCounter); } if (obj.getStorageSizeCounter() != null) { - ResourceCounter _storageSizeCounter = ResourceCounterConverter.map(obj.getStorageSizeCounter()); - serviceCounters.setStorageSizeCounter(_storageSizeCounter); + ResourceCounter storageSizeCounter = ResourceCounterConverter.map(obj.getStorageSizeCounter()); + serviceCounters.setStorageSizeCounter(storageSizeCounter); } if (obj.getDataSourceCounter() != null) { - ResourceCounter _dataSourceCounter = ResourceCounterConverter.map(obj.getDataSourceCounter()); - serviceCounters.setDataSourceCounter(_dataSourceCounter); + ResourceCounter dataSourceCounter = ResourceCounterConverter.map(obj.getDataSourceCounter()); + serviceCounters.setDataSourceCounter(dataSourceCounter); } if (obj.getIndexerCounter() != null) { - ResourceCounter _indexerCounter = ResourceCounterConverter.map(obj.getIndexerCounter()); - serviceCounters.setIndexerCounter(_indexerCounter); + ResourceCounter indexerCounter = ResourceCounterConverter.map(obj.getIndexerCounter()); + serviceCounters.setIndexerCounter(indexerCounter); } if (obj.getSkillsetCounter() != null) { - ResourceCounter _skillsetCounter = ResourceCounterConverter.map(obj.getSkillsetCounter()); - serviceCounters.setSkillsetCounter(_skillsetCounter); + ResourceCounter skillsetCounter = ResourceCounterConverter.map(obj.getSkillsetCounter()); + serviceCounters.setSkillsetCounter(skillsetCounter); } return serviceCounters; } @@ -71,46 +71,49 @@ public static com.azure.search.documents.implementation.models.ServiceCounters m new com.azure.search.documents.implementation.models.ServiceCounters(); if (obj.getDocumentCounter() != null) { - com.azure.search.documents.implementation.models.ResourceCounter _documentCounter = + com.azure.search.documents.implementation.models.ResourceCounter documentCounter = ResourceCounterConverter.map(obj.getDocumentCounter()); - serviceCounters.setDocumentCounter(_documentCounter); + serviceCounters.setDocumentCounter(documentCounter); } if (obj.getIndexCounter() != null) { - com.azure.search.documents.implementation.models.ResourceCounter _indexCounter = + com.azure.search.documents.implementation.models.ResourceCounter indexCounter = ResourceCounterConverter.map(obj.getIndexCounter()); - serviceCounters.setIndexCounter(_indexCounter); + serviceCounters.setIndexCounter(indexCounter); } if (obj.getSynonymMapCounter() != null) { - com.azure.search.documents.implementation.models.ResourceCounter _synonymMapCounter = + com.azure.search.documents.implementation.models.ResourceCounter synonymMapCounter = ResourceCounterConverter.map(obj.getSynonymMapCounter()); - serviceCounters.setSynonymMapCounter(_synonymMapCounter); + serviceCounters.setSynonymMapCounter(synonymMapCounter); } if (obj.getStorageSizeCounter() != null) { - com.azure.search.documents.implementation.models.ResourceCounter _storageSizeCounter = + com.azure.search.documents.implementation.models.ResourceCounter storageSizeCounter = ResourceCounterConverter.map(obj.getStorageSizeCounter()); - serviceCounters.setStorageSizeCounter(_storageSizeCounter); + serviceCounters.setStorageSizeCounter(storageSizeCounter); } if (obj.getDataSourceCounter() != null) { - com.azure.search.documents.implementation.models.ResourceCounter _dataSourceCounter = + com.azure.search.documents.implementation.models.ResourceCounter dataSourceCounter = ResourceCounterConverter.map(obj.getDataSourceCounter()); - serviceCounters.setDataSourceCounter(_dataSourceCounter); + serviceCounters.setDataSourceCounter(dataSourceCounter); } if (obj.getIndexerCounter() != null) { - com.azure.search.documents.implementation.models.ResourceCounter _indexerCounter = + com.azure.search.documents.implementation.models.ResourceCounter indexerCounter = ResourceCounterConverter.map(obj.getIndexerCounter()); - serviceCounters.setIndexerCounter(_indexerCounter); + serviceCounters.setIndexerCounter(indexerCounter); } if (obj.getSkillsetCounter() != null) { - com.azure.search.documents.implementation.models.ResourceCounter _skillsetCounter = + com.azure.search.documents.implementation.models.ResourceCounter skillsetCounter = ResourceCounterConverter.map(obj.getSkillsetCounter()); - serviceCounters.setSkillsetCounter(_skillsetCounter); + serviceCounters.setSkillsetCounter(skillsetCounter); } return serviceCounters; } + + private ServiceCountersConverter() { + } } 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 index 35d7d1af232f..738a59117383 100644 --- 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 @@ -10,7 +10,7 @@ * 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}. @@ -21,17 +21,17 @@ public static ServiceLimits map(com.azure.search.documents.implementation.models } ServiceLimits serviceLimits = new ServiceLimits(); - Integer _maxFieldNestingDepthPerIndex = obj.getMaxFieldNestingDepthPerIndex(); - serviceLimits.setMaxFieldNestingDepthPerIndex(_maxFieldNestingDepthPerIndex); + Integer maxFieldNestingDepthPerIndex = obj.getMaxFieldNestingDepthPerIndex(); + serviceLimits.setMaxFieldNestingDepthPerIndex(maxFieldNestingDepthPerIndex); - Integer _maxFieldsPerIndex = obj.getMaxFieldsPerIndex(); - serviceLimits.setMaxFieldsPerIndex(_maxFieldsPerIndex); + Integer maxFieldsPerIndex = obj.getMaxFieldsPerIndex(); + serviceLimits.setMaxFieldsPerIndex(maxFieldsPerIndex); - Integer _maxComplexObjectsInCollectionsPerDocument = obj.getMaxComplexObjectsInCollectionsPerDocument(); - serviceLimits.setMaxComplexObjectsInCollectionsPerDocument(_maxComplexObjectsInCollectionsPerDocument); + Integer maxComplexObjectsInCollectionsPerDocument = obj.getMaxComplexObjectsInCollectionsPerDocument(); + serviceLimits.setMaxComplexObjectsInCollectionsPerDocument(maxComplexObjectsInCollectionsPerDocument); - Integer _maxComplexCollectionFieldsPerIndex = obj.getMaxComplexCollectionFieldsPerIndex(); - serviceLimits.setMaxComplexCollectionFieldsPerIndex(_maxComplexCollectionFieldsPerIndex); + Integer maxComplexCollectionFieldsPerIndex = obj.getMaxComplexCollectionFieldsPerIndex(); + serviceLimits.setMaxComplexCollectionFieldsPerIndex(maxComplexCollectionFieldsPerIndex); return serviceLimits; } @@ -45,17 +45,20 @@ public static com.azure.search.documents.implementation.models.ServiceLimits map com.azure.search.documents.implementation.models.ServiceLimits serviceLimits = new com.azure.search.documents.implementation.models.ServiceLimits(); - Integer _maxFieldNestingDepthPerIndex = obj.getMaxFieldNestingDepthPerIndex(); - serviceLimits.setMaxFieldNestingDepthPerIndex(_maxFieldNestingDepthPerIndex); + Integer maxFieldNestingDepthPerIndex = obj.getMaxFieldNestingDepthPerIndex(); + serviceLimits.setMaxFieldNestingDepthPerIndex(maxFieldNestingDepthPerIndex); - Integer _maxFieldsPerIndex = obj.getMaxFieldsPerIndex(); - serviceLimits.setMaxFieldsPerIndex(_maxFieldsPerIndex); + Integer maxFieldsPerIndex = obj.getMaxFieldsPerIndex(); + serviceLimits.setMaxFieldsPerIndex(maxFieldsPerIndex); - Integer _maxComplexObjectsInCollectionsPerDocument = obj.getMaxComplexObjectsInCollectionsPerDocument(); - serviceLimits.setMaxComplexObjectsInCollectionsPerDocument(_maxComplexObjectsInCollectionsPerDocument); + Integer maxComplexObjectsInCollectionsPerDocument = obj.getMaxComplexObjectsInCollectionsPerDocument(); + serviceLimits.setMaxComplexObjectsInCollectionsPerDocument(maxComplexObjectsInCollectionsPerDocument); - Integer _maxComplexCollectionFieldsPerIndex = obj.getMaxComplexCollectionFieldsPerIndex(); - serviceLimits.setMaxComplexCollectionFieldsPerIndex(_maxComplexCollectionFieldsPerIndex); + Integer maxComplexCollectionFieldsPerIndex = obj.getMaxComplexCollectionFieldsPerIndex(); + serviceLimits.setMaxComplexCollectionFieldsPerIndex(maxComplexCollectionFieldsPerIndex); return serviceLimits; } + + private ServiceLimitsConverter() { + } } 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 index 86afd19b669b..3848103f9f22 100644 --- 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 @@ -13,7 +13,7 @@ * {@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 @@ -26,13 +26,13 @@ public static ServiceStatistics map(com.azure.search.documents.implementation.mo ServiceStatistics serviceStatistics = new ServiceStatistics(); if (obj.getCounters() != null) { - ServiceCounters _counters = ServiceCountersConverter.map(obj.getCounters()); - serviceStatistics.setCounters(_counters); + ServiceCounters counters = ServiceCountersConverter.map(obj.getCounters()); + serviceStatistics.setCounters(counters); } if (obj.getLimits() != null) { - ServiceLimits _limits = ServiceLimitsConverter.map(obj.getLimits()); - serviceStatistics.setLimits(_limits); + ServiceLimits limits = ServiceLimitsConverter.map(obj.getLimits()); + serviceStatistics.setLimits(limits); } return serviceStatistics; } @@ -49,16 +49,19 @@ public static com.azure.search.documents.implementation.models.ServiceStatistics new com.azure.search.documents.implementation.models.ServiceStatistics(); if (obj.getCounters() != null) { - com.azure.search.documents.implementation.models.ServiceCounters _counters = + com.azure.search.documents.implementation.models.ServiceCounters counters = ServiceCountersConverter.map(obj.getCounters()); - serviceStatistics.setCounters(_counters); + serviceStatistics.setCounters(counters); } if (obj.getLimits() != null) { - com.azure.search.documents.implementation.models.ServiceLimits _limits = + com.azure.search.documents.implementation.models.ServiceLimits limits = ServiceLimitsConverter.map(obj.getLimits()); - serviceStatistics.setLimits(_limits); + serviceStatistics.setLimits(limits); } return serviceStatistics; } + + private ServiceStatisticsConverter() { + } } 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 index 15bf2a5145d7..b9347eb1d0f2 100644 --- 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 @@ -15,7 +15,7 @@ * 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}. @@ -27,25 +27,25 @@ public static ShaperSkill map(com.azure.search.documents.implementation.models.S ShaperSkill shaperSkill = new ShaperSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - shaperSkill.setOutputs(_outputs); + shaperSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - shaperSkill.setInputs(_inputs); + shaperSkill.setInputs(inputs); } - String _name = obj.getName(); - shaperSkill.setName(_name); + String name = obj.getName(); + shaperSkill.setName(name); - String _context = obj.getContext(); - shaperSkill.setContext(_context); + String context = obj.getContext(); + shaperSkill.setContext(context); - String _description = obj.getDescription(); - shaperSkill.setDescription(_description); + String description = obj.getDescription(); + shaperSkill.setDescription(description); return shaperSkill; } @@ -60,25 +60,28 @@ public static com.azure.search.documents.implementation.models.ShaperSkill map(S new com.azure.search.documents.implementation.models.ShaperSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - shaperSkill.setOutputs(_outputs); + shaperSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - shaperSkill.setInputs(_inputs); + shaperSkill.setInputs(inputs); } - String _name = obj.getName(); - shaperSkill.setName(_name); + String name = obj.getName(); + shaperSkill.setName(name); - String _context = obj.getContext(); - shaperSkill.setContext(_context); + String context = obj.getContext(); + shaperSkill.setContext(context); - String _description = obj.getDescription(); - shaperSkill.setDescription(_description); + String description = obj.getDescription(); + shaperSkill.setDescription(description); return shaperSkill; } + + private ShaperSkillConverter() { + } } 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 index 11d2bdf55763..2bebc7b5bd64 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,26 +23,26 @@ public static ShingleTokenFilter map(com.azure.search.documents.implementation.m } ShingleTokenFilter shingleTokenFilter = new ShingleTokenFilter(); - String _name = obj.getName(); - shingleTokenFilter.setName(_name); + String name = obj.getName(); + shingleTokenFilter.setName(name); - Integer _minShingleSize = obj.getMinShingleSize(); - shingleTokenFilter.setMinShingleSize(_minShingleSize); + Integer minShingleSize = obj.getMinShingleSize(); + shingleTokenFilter.setMinShingleSize(minShingleSize); - Boolean _outputUnigrams = obj.isOutputUnigrams(); - shingleTokenFilter.setOutputUnigrams(_outputUnigrams); + Boolean outputUnigrams = obj.isOutputUnigrams(); + shingleTokenFilter.setOutputUnigrams(outputUnigrams); - String _filterToken = obj.getFilterToken(); - shingleTokenFilter.setFilterToken(_filterToken); + String filterToken = obj.getFilterToken(); + shingleTokenFilter.setFilterToken(filterToken); - Boolean _outputUnigramsIfNoShingles = obj.isOutputUnigramsIfNoShingles(); - shingleTokenFilter.setOutputUnigramsIfNoShingles(_outputUnigramsIfNoShingles); + Boolean outputUnigramsIfNoShingles = obj.isOutputUnigramsIfNoShingles(); + shingleTokenFilter.setOutputUnigramsIfNoShingles(outputUnigramsIfNoShingles); - Integer _maxShingleSize = obj.getMaxShingleSize(); - shingleTokenFilter.setMaxShingleSize(_maxShingleSize); + Integer maxShingleSize = obj.getMaxShingleSize(); + shingleTokenFilter.setMaxShingleSize(maxShingleSize); - String _tokenSeparator = obj.getTokenSeparator(); - shingleTokenFilter.setTokenSeparator(_tokenSeparator); + String tokenSeparator = obj.getTokenSeparator(); + shingleTokenFilter.setTokenSeparator(tokenSeparator); return shingleTokenFilter; } @@ -57,26 +57,29 @@ public static com.azure.search.documents.implementation.models.ShingleTokenFilte com.azure.search.documents.implementation.models.ShingleTokenFilter shingleTokenFilter = new com.azure.search.documents.implementation.models.ShingleTokenFilter(); - String _name = obj.getName(); - shingleTokenFilter.setName(_name); + String name = obj.getName(); + shingleTokenFilter.setName(name); - Integer _minShingleSize = obj.getMinShingleSize(); - shingleTokenFilter.setMinShingleSize(_minShingleSize); + Integer minShingleSize = obj.getMinShingleSize(); + shingleTokenFilter.setMinShingleSize(minShingleSize); - Boolean _outputUnigrams = obj.isOutputUnigrams(); - shingleTokenFilter.setOutputUnigrams(_outputUnigrams); + Boolean outputUnigrams = obj.isOutputUnigrams(); + shingleTokenFilter.setOutputUnigrams(outputUnigrams); - String _filterToken = obj.getFilterToken(); - shingleTokenFilter.setFilterToken(_filterToken); + String filterToken = obj.getFilterToken(); + shingleTokenFilter.setFilterToken(filterToken); - Boolean _outputUnigramsIfNoShingles = obj.isOutputUnigramsIfNoShingles(); - shingleTokenFilter.setOutputUnigramsIfNoShingles(_outputUnigramsIfNoShingles); + Boolean outputUnigramsIfNoShingles = obj.isOutputUnigramsIfNoShingles(); + shingleTokenFilter.setOutputUnigramsIfNoShingles(outputUnigramsIfNoShingles); - Integer _maxShingleSize = obj.getMaxShingleSize(); - shingleTokenFilter.setMaxShingleSize(_maxShingleSize); + Integer maxShingleSize = obj.getMaxShingleSize(); + shingleTokenFilter.setMaxShingleSize(maxShingleSize); - String _tokenSeparator = obj.getTokenSeparator(); - shingleTokenFilter.setTokenSeparator(_tokenSeparator); + String tokenSeparator = obj.getTokenSeparator(); + shingleTokenFilter.setTokenSeparator(tokenSeparator); return shingleTokenFilter; } + + private ShingleTokenFilterConverter() { + } } 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 index 7aafd4719a30..f12bd960088d 100644 --- 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 @@ -10,7 +10,7 @@ * 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}. @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.Similarity map(Si new com.azure.search.documents.implementation.models.Similarity(); return similarity; } + + private SimilarityConverter() { + } } 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 index 385d181a20bf..1ff3a28af5fb 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,12 +24,12 @@ public static SnowballTokenFilter map(com.azure.search.documents.implementation. } SnowballTokenFilter snowballTokenFilter = new SnowballTokenFilter(); - String _name = obj.getName(); - snowballTokenFilter.setName(_name); + String name = obj.getName(); + snowballTokenFilter.setName(name); if (obj.getLanguage() != null) { - SnowballTokenFilterLanguage _language = SnowballTokenFilterLanguageConverter.map(obj.getLanguage()); - snowballTokenFilter.setLanguage(_language); + SnowballTokenFilterLanguage language = SnowballTokenFilterLanguageConverter.map(obj.getLanguage()); + snowballTokenFilter.setLanguage(language); } return snowballTokenFilter; } @@ -45,14 +45,17 @@ public static com.azure.search.documents.implementation.models.SnowballTokenFilt com.azure.search.documents.implementation.models.SnowballTokenFilter snowballTokenFilter = new com.azure.search.documents.implementation.models.SnowballTokenFilter(); - String _name = obj.getName(); - snowballTokenFilter.setName(_name); + String name = obj.getName(); + snowballTokenFilter.setName(name); if (obj.getLanguage() != null) { - com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage _language = + com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage language = SnowballTokenFilterLanguageConverter.map(obj.getLanguage()); - snowballTokenFilter.setLanguage(_language); + snowballTokenFilter.setLanguage(language); } return snowballTokenFilter; } + + private SnowballTokenFilterConverter() { + } } 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 index 82791d1f3bc4..417c9abf05f2 100644 --- 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 @@ -131,4 +131,7 @@ public static com.azure.search.documents.implementation.models.SnowballTokenFilt throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private SnowballTokenFilterLanguageConverter() { + } } 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 index c871b3fdcff6..0e3c79f3b22e 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -25,11 +25,11 @@ public static SoftDeleteColumnDeletionDetectionPolicy map(com.azure.search.docum SoftDeleteColumnDeletionDetectionPolicy softDeleteColumnDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy(); - String _softDeleteColumnName = obj.getSoftDeleteColumnName(); - softDeleteColumnDeletionDetectionPolicy.setSoftDeleteColumnName(_softDeleteColumnName); + String softDeleteColumnName = obj.getSoftDeleteColumnName(); + softDeleteColumnDeletionDetectionPolicy.setSoftDeleteColumnName(softDeleteColumnName); - String _softDeleteMarkerValue = obj.getSoftDeleteMarkerValue(); - softDeleteColumnDeletionDetectionPolicy.setSoftDeleteMarkerValue(_softDeleteMarkerValue); + String softDeleteMarkerValue = obj.getSoftDeleteMarkerValue(); + softDeleteColumnDeletionDetectionPolicy.setSoftDeleteMarkerValue(softDeleteMarkerValue); return softDeleteColumnDeletionDetectionPolicy; } @@ -43,11 +43,14 @@ public static com.azure.search.documents.implementation.models.SoftDeleteColumnD } com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy softDeleteColumnDeletionDetectionPolicy = new com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy(); - String _softDeleteColumnName = obj.getSoftDeleteColumnName(); - softDeleteColumnDeletionDetectionPolicy.setSoftDeleteColumnName(_softDeleteColumnName); + String softDeleteColumnName = obj.getSoftDeleteColumnName(); + softDeleteColumnDeletionDetectionPolicy.setSoftDeleteColumnName(softDeleteColumnName); - String _softDeleteMarkerValue = obj.getSoftDeleteMarkerValue(); - softDeleteColumnDeletionDetectionPolicy.setSoftDeleteMarkerValue(_softDeleteMarkerValue); + String softDeleteMarkerValue = obj.getSoftDeleteMarkerValue(); + softDeleteColumnDeletionDetectionPolicy.setSoftDeleteMarkerValue(softDeleteMarkerValue); return softDeleteColumnDeletionDetectionPolicy; } + + private SoftDeleteColumnDeletionDetectionPolicyConverter() { + } } 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 index 254b4e7ce038..5a5cc5008706 100644 --- 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 @@ -17,7 +17,7 @@ * 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}. @@ -29,37 +29,37 @@ public static SplitSkill map(com.azure.search.documents.implementation.models.Sp SplitSkill splitSkill = new SplitSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - splitSkill.setOutputs(_outputs); + splitSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - splitSkill.setInputs(_inputs); + splitSkill.setInputs(inputs); } - String _name = obj.getName(); - splitSkill.setName(_name); + String name = obj.getName(); + splitSkill.setName(name); - String _context = obj.getContext(); - splitSkill.setContext(_context); + String context = obj.getContext(); + splitSkill.setContext(context); - String _description = obj.getDescription(); - splitSkill.setDescription(_description); + String description = obj.getDescription(); + splitSkill.setDescription(description); - Integer _maximumPageLength = obj.getMaximumPageLength(); - splitSkill.setMaximumPageLength(_maximumPageLength); + Integer maximumPageLength = obj.getMaximumPageLength(); + splitSkill.setMaximumPageLength(maximumPageLength); if (obj.getTextSplitMode() != null) { - TextSplitMode _textSplitMode = TextSplitModeConverter.map(obj.getTextSplitMode()); - splitSkill.setTextSplitMode(_textSplitMode); + TextSplitMode textSplitMode = TextSplitModeConverter.map(obj.getTextSplitMode()); + splitSkill.setTextSplitMode(textSplitMode); } if (obj.getDefaultLanguageCode() != null) { - SplitSkillLanguage _defaultLanguageCode = SplitSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - splitSkill.setDefaultLanguageCode(_defaultLanguageCode); + SplitSkillLanguage defaultLanguageCode = SplitSkillLanguageConverter.map(obj.getDefaultLanguageCode()); + splitSkill.setDefaultLanguageCode(defaultLanguageCode); } return splitSkill; } @@ -75,40 +75,43 @@ public static com.azure.search.documents.implementation.models.SplitSkill map(Sp new com.azure.search.documents.implementation.models.SplitSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - splitSkill.setOutputs(_outputs); + splitSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - splitSkill.setInputs(_inputs); + splitSkill.setInputs(inputs); } - String _name = obj.getName(); - splitSkill.setName(_name); + String name = obj.getName(); + splitSkill.setName(name); - String _context = obj.getContext(); - splitSkill.setContext(_context); + String context = obj.getContext(); + splitSkill.setContext(context); - String _description = obj.getDescription(); - splitSkill.setDescription(_description); + String description = obj.getDescription(); + splitSkill.setDescription(description); - Integer _maximumPageLength = obj.getMaximumPageLength(); - splitSkill.setMaximumPageLength(_maximumPageLength); + Integer maximumPageLength = obj.getMaximumPageLength(); + splitSkill.setMaximumPageLength(maximumPageLength); if (obj.getTextSplitMode() != null) { - com.azure.search.documents.implementation.models.TextSplitMode _textSplitMode = + com.azure.search.documents.implementation.models.TextSplitMode textSplitMode = TextSplitModeConverter.map(obj.getTextSplitMode()); - splitSkill.setTextSplitMode(_textSplitMode); + splitSkill.setTextSplitMode(textSplitMode); } if (obj.getDefaultLanguageCode() != null) { - com.azure.search.documents.implementation.models.SplitSkillLanguage _defaultLanguageCode = + com.azure.search.documents.implementation.models.SplitSkillLanguage defaultLanguageCode = SplitSkillLanguageConverter.map(obj.getDefaultLanguageCode()); - splitSkill.setDefaultLanguageCode(_defaultLanguageCode); + splitSkill.setDefaultLanguageCode(defaultLanguageCode); } return splitSkill; } + + private SplitSkillConverter() { + } } 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 index 15b960e30709..1cf68b9fc1d6 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.SplitSkillLanguag } return com.azure.search.documents.implementation.models.SplitSkillLanguage.fromString(obj.toString()); } + + private SplitSkillLanguageConverter() { + } } 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 index 9550d7384c7d..c477a4ac6776 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -36,4 +36,7 @@ public static com.azure.search.documents.implementation.models.SqlIntegratedChan com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy sqlIntegratedChangeTrackingPolicy = new com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy(); return sqlIntegratedChangeTrackingPolicy; } + + private SqlIntegratedChangeTrackingPolicyConverter() { + } } 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 index 4b1322b519e3..31f8e65a8587 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,12 +26,12 @@ public static StemmerOverrideTokenFilter map(com.azure.search.documents.implemen } StemmerOverrideTokenFilter stemmerOverrideTokenFilter = new StemmerOverrideTokenFilter(); - String _name = obj.getName(); - stemmerOverrideTokenFilter.setName(_name); + String name = obj.getName(); + stemmerOverrideTokenFilter.setName(name); if (obj.getRules() != null) { - List _rules = new ArrayList<>(obj.getRules()); - stemmerOverrideTokenFilter.setRules(_rules); + List rules = new ArrayList<>(obj.getRules()); + stemmerOverrideTokenFilter.setRules(rules); } return stemmerOverrideTokenFilter; } @@ -48,13 +47,16 @@ public static com.azure.search.documents.implementation.models.StemmerOverrideTo com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter stemmerOverrideTokenFilter = new com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter(); - String _name = obj.getName(); - stemmerOverrideTokenFilter.setName(_name); + String name = obj.getName(); + stemmerOverrideTokenFilter.setName(name); if (obj.getRules() != null) { - List _rules = new ArrayList<>(obj.getRules()); - stemmerOverrideTokenFilter.setRules(_rules); + List rules = new ArrayList<>(obj.getRules()); + stemmerOverrideTokenFilter.setRules(rules); } return stemmerOverrideTokenFilter; } + + private StemmerOverrideTokenFilterConverter() { + } } 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 index 7e803cbf2ea5..c25eb98282b3 100644 --- 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 @@ -12,7 +12,7 @@ * {@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 @@ -24,12 +24,12 @@ public static StemmerTokenFilter map(com.azure.search.documents.implementation.m } StemmerTokenFilter stemmerTokenFilter = new StemmerTokenFilter(); - String _name = obj.getName(); - stemmerTokenFilter.setName(_name); + String name = obj.getName(); + stemmerTokenFilter.setName(name); if (obj.getLanguage() != null) { - StemmerTokenFilterLanguage _language = StemmerTokenFilterLanguageConverter.map(obj.getLanguage()); - stemmerTokenFilter.setLanguage(_language); + StemmerTokenFilterLanguage language = StemmerTokenFilterLanguageConverter.map(obj.getLanguage()); + stemmerTokenFilter.setLanguage(language); } return stemmerTokenFilter; } @@ -45,14 +45,17 @@ public static com.azure.search.documents.implementation.models.StemmerTokenFilte com.azure.search.documents.implementation.models.StemmerTokenFilter stemmerTokenFilter = new com.azure.search.documents.implementation.models.StemmerTokenFilter(); - String _name = obj.getName(); - stemmerTokenFilter.setName(_name); + String name = obj.getName(); + stemmerTokenFilter.setName(name); if (obj.getLanguage() != null) { - com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage _language = + com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage language = StemmerTokenFilterLanguageConverter.map(obj.getLanguage()); - stemmerTokenFilter.setLanguage(_language); + stemmerTokenFilter.setLanguage(language); } return stemmerTokenFilter; } + + private StemmerTokenFilterConverter() { + } } 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 index 0d271c18149d..e3a5bfe1a203 100644 --- 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 @@ -259,4 +259,7 @@ public static com.azure.search.documents.implementation.models.StemmerTokenFilte throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private StemmerTokenFilterLanguageConverter() { + } } 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 index 41d4c4353d02..83e9f68040d2 100644 --- 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 @@ -8,13 +8,12 @@ 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}. @@ -25,12 +24,12 @@ public static StopAnalyzer map(com.azure.search.documents.implementation.models. } StopAnalyzer stopAnalyzer = new StopAnalyzer(); - String _name = obj.getName(); - stopAnalyzer.setName(_name); + String name = obj.getName(); + stopAnalyzer.setName(name); if (obj.getStopwords() != null) { - List _stopwords = new ArrayList<>(obj.getStopwords()); - stopAnalyzer.setStopwords(_stopwords); + List stopwords = new ArrayList<>(obj.getStopwords()); + stopAnalyzer.setStopwords(stopwords); } return stopAnalyzer; } @@ -45,13 +44,16 @@ public static com.azure.search.documents.implementation.models.StopAnalyzer map( com.azure.search.documents.implementation.models.StopAnalyzer stopAnalyzer = new com.azure.search.documents.implementation.models.StopAnalyzer(); - String _name = obj.getName(); - stopAnalyzer.setName(_name); + String name = obj.getName(); + stopAnalyzer.setName(name); if (obj.getStopwords() != null) { - List _stopwords = new ArrayList<>(obj.getStopwords()); - stopAnalyzer.setStopwords(_stopwords); + List stopwords = new ArrayList<>(obj.getStopwords()); + stopAnalyzer.setStopwords(stopwords); } return stopAnalyzer; } + + private StopAnalyzerConverter() { + } } 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 index bda0c891a8c5..86817e9dc53b 100644 --- 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 @@ -1,6 +1,3 @@ -// 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; @@ -16,10 +13,10 @@ 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}. + * 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) { + public static StopwordsList map( + com.azure.search.documents.implementation.models.StopwordsList obj) { if (obj == null) { return null; } @@ -92,10 +89,10 @@ public static StopwordsList map(com.azure.search.documents.implementation.models } /** - * Maps from enum {@link StopwordsList} to enum - * {@link com.azure.search.documents.implementation.models.StopwordsList}. + * 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) { + public static com.azure.search.documents.implementation.models.StopwordsList map( + StopwordsList obj) { if (obj == null) { return null; } 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 index eca40ba9cd7b..3c51df76340e 100644 --- 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 @@ -9,14 +9,13 @@ 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 @@ -28,23 +27,23 @@ public static StopwordsTokenFilter map(com.azure.search.documents.implementation } StopwordsTokenFilter stopwordsTokenFilter = new StopwordsTokenFilter(); - String _name = obj.getName(); - stopwordsTokenFilter.setName(_name); + String name = obj.getName(); + stopwordsTokenFilter.setName(name); - Boolean _removeTrailingStopWords = obj.isRemoveTrailingStopWords(); - stopwordsTokenFilter.setRemoveTrailingStopWords(_removeTrailingStopWords); + Boolean removeTrailingStopWords = obj.isRemoveTrailingStopWords(); + stopwordsTokenFilter.setRemoveTrailingStopWords(removeTrailingStopWords); - Boolean _ignoreCase = obj.isIgnoreCase(); - stopwordsTokenFilter.setIgnoreCase(_ignoreCase); + Boolean ignoreCase = obj.isIgnoreCase(); + stopwordsTokenFilter.setIgnoreCase(ignoreCase); if (obj.getStopwords() != null) { - List _stopwords = new ArrayList<>(obj.getStopwords()); - stopwordsTokenFilter.setStopwords(_stopwords); + List stopwords = new ArrayList<>(obj.getStopwords()); + stopwordsTokenFilter.setStopwords(stopwords); } if (obj.getStopwordsList() != null) { - StopwordsList _stopwordsList = StopwordsListConverter.map(obj.getStopwordsList()); - stopwordsTokenFilter.setStopwordsList(_stopwordsList); + StopwordsList stopwordsList = StopwordsListConverter.map(obj.getStopwordsList()); + stopwordsTokenFilter.setStopwordsList(stopwordsList); } return stopwordsTokenFilter; } @@ -60,25 +59,28 @@ public static com.azure.search.documents.implementation.models.StopwordsTokenFil com.azure.search.documents.implementation.models.StopwordsTokenFilter stopwordsTokenFilter = new com.azure.search.documents.implementation.models.StopwordsTokenFilter(); - String _name = obj.getName(); - stopwordsTokenFilter.setName(_name); + String name = obj.getName(); + stopwordsTokenFilter.setName(name); - Boolean _removeTrailingStopWords = obj.isRemoveTrailingStopWords(); - stopwordsTokenFilter.setRemoveTrailingStopWords(_removeTrailingStopWords); + Boolean removeTrailingStopWords = obj.isRemoveTrailingStopWords(); + stopwordsTokenFilter.setRemoveTrailingStopWords(removeTrailingStopWords); - Boolean _ignoreCase = obj.isIgnoreCase(); - stopwordsTokenFilter.setIgnoreCase(_ignoreCase); + Boolean ignoreCase = obj.isIgnoreCase(); + stopwordsTokenFilter.setIgnoreCase(ignoreCase); if (obj.getStopwords() != null) { - List _stopwords = new ArrayList<>(obj.getStopwords()); - stopwordsTokenFilter.setStopwords(_stopwords); + List stopwords = new ArrayList<>(obj.getStopwords()); + stopwordsTokenFilter.setStopwords(stopwords); } if (obj.getStopwordsList() != null) { - com.azure.search.documents.implementation.models.StopwordsList _stopwordsList = + com.azure.search.documents.implementation.models.StopwordsList stopwordsList = StopwordsListConverter.map(obj.getStopwordsList()); - stopwordsTokenFilter.setStopwordsList(_stopwordsList); + stopwordsTokenFilter.setStopwordsList(stopwordsList); } return stopwordsTokenFilter; } + + private StopwordsTokenFilterConverter() { + } } 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 index b7494f87b272..e4838cebe83e 100644 --- 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 @@ -15,7 +15,7 @@ * {@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}. @@ -26,38 +26,38 @@ public static SuggestOptions map(com.azure.search.documents.implementation.model } SuggestOptions suggestOptions = new SuggestOptions(); - String _filter = obj.getFilter(); - suggestOptions.setFilter(_filter); + String filter = obj.getFilter(); + suggestOptions.setFilter(filter); - Boolean _useFuzzyMatching = obj.isUseFuzzyMatching(); - suggestOptions.setUseFuzzyMatching(_useFuzzyMatching); + Boolean useFuzzyMatching = obj.isUseFuzzyMatching(); + suggestOptions.setUseFuzzyMatching(useFuzzyMatching); - Double _minimumCoverage = obj.getMinimumCoverage(); - suggestOptions.setMinimumCoverage(_minimumCoverage); + Double minimumCoverage = obj.getMinimumCoverage(); + suggestOptions.setMinimumCoverage(minimumCoverage); if (obj.getSelect() != null) { - List _select = new ArrayList<>(obj.getSelect()); - PrivateFieldAccessHelper.set(suggestOptions, "select", _select); + List select = new ArrayList<>(obj.getSelect()); + PrivateFieldAccessHelper.set(suggestOptions, "select", select); } - Integer _top = obj.getTop(); - suggestOptions.setTop(_top); + Integer top = obj.getTop(); + suggestOptions.setTop(top); - String _highlightPostTag = obj.getHighlightPostTag(); - suggestOptions.setHighlightPostTag(_highlightPostTag); + String highlightPostTag = obj.getHighlightPostTag(); + suggestOptions.setHighlightPostTag(highlightPostTag); if (obj.getOrderBy() != null) { - List _orderBy = new ArrayList<>(obj.getOrderBy()); - PrivateFieldAccessHelper.set(suggestOptions, "orderBy", _orderBy); + 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); + List searchFields = new ArrayList<>(obj.getSearchFields()); + PrivateFieldAccessHelper.set(suggestOptions, "searchFields", searchFields); } - String _highlightPreTag = obj.getHighlightPreTag(); - suggestOptions.setHighlightPreTag(_highlightPreTag); + String highlightPreTag = obj.getHighlightPreTag(); + suggestOptions.setHighlightPreTag(highlightPreTag); return suggestOptions; } @@ -71,38 +71,41 @@ public static com.azure.search.documents.implementation.models.SuggestOptions ma com.azure.search.documents.implementation.models.SuggestOptions suggestOptions = new com.azure.search.documents.implementation.models.SuggestOptions(); - String _filter = obj.getFilter(); - suggestOptions.setFilter(_filter); + String filter = obj.getFilter(); + suggestOptions.setFilter(filter); - Boolean _useFuzzyMatching = obj.useFuzzyMatching(); - suggestOptions.setUseFuzzyMatching(_useFuzzyMatching); + Boolean useFuzzyMatching = obj.useFuzzyMatching(); + suggestOptions.setUseFuzzyMatching(useFuzzyMatching); - Double _minimumCoverage = obj.getMinimumCoverage(); - suggestOptions.setMinimumCoverage(_minimumCoverage); + Double minimumCoverage = obj.getMinimumCoverage(); + suggestOptions.setMinimumCoverage(minimumCoverage); if (obj.getSelect() != null) { - List _select = new ArrayList<>(obj.getSelect()); - PrivateFieldAccessHelper.set(suggestOptions, "select", _select); + List select = new ArrayList<>(obj.getSelect()); + PrivateFieldAccessHelper.set(suggestOptions, "select", select); } - Integer _top = obj.getTop(); - suggestOptions.setTop(_top); + Integer top = obj.getTop(); + suggestOptions.setTop(top); - String _highlightPostTag = obj.getHighlightPostTag(); - suggestOptions.setHighlightPostTag(_highlightPostTag); + String highlightPostTag = obj.getHighlightPostTag(); + suggestOptions.setHighlightPostTag(highlightPostTag); if (obj.getOrderBy() != null) { - List _orderBy = new ArrayList<>(obj.getOrderBy()); - PrivateFieldAccessHelper.set(suggestOptions, "orderBy", _orderBy); + 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); + List searchFields = new ArrayList<>(obj.getSearchFields()); + PrivateFieldAccessHelper.set(suggestOptions, "searchFields", searchFields); } - String _highlightPreTag = obj.getHighlightPreTag(); - suggestOptions.setHighlightPreTag(_highlightPreTag); + String highlightPreTag = obj.getHighlightPreTag(); + suggestOptions.setHighlightPreTag(highlightPreTag); return suggestOptions; } + + private SuggestOptionsConverter() { + } } 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 index 1356df7c8a8a..8bb92c6e9fa1 100644 --- 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 @@ -14,7 +14,7 @@ * 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}. @@ -25,11 +25,11 @@ public static SuggestResult map(com.azure.search.documents.implementation.models } SuggestResult suggestResult = new SuggestResult(); - SearchDocument _additionalProperties = new SearchDocument(obj.getAdditionalProperties()); - PrivateFieldAccessHelper.set(suggestResult, "additionalProperties", _additionalProperties); + SearchDocument additionalProperties = new SearchDocument(obj.getAdditionalProperties()); + PrivateFieldAccessHelper.set(suggestResult, "additionalProperties", additionalProperties); - String _text = obj.getText(); - PrivateFieldAccessHelper.set(suggestResult, "text", _text); + String text = obj.getText(); + PrivateFieldAccessHelper.set(suggestResult, "text", text); return suggestResult; } @@ -43,11 +43,14 @@ public static com.azure.search.documents.implementation.models.SuggestResult map 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); + Map additionalProperties = obj.getDocument(); + PrivateFieldAccessHelper.set(suggestResult, "additionalProperties", additionalProperties); - String _text = obj.getText(); - PrivateFieldAccessHelper.set(suggestResult, "text", _text); + String text = obj.getText(); + PrivateFieldAccessHelper.set(suggestResult, "text", text); return suggestResult; } + + private SuggestResultConverter() { + } } 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 index 93b79e5218e9..a845d8dec58b 100644 --- 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 @@ -14,7 +14,7 @@ * 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}. @@ -26,15 +26,15 @@ public static Suggester map(com.azure.search.documents.implementation.models.Sug Suggester suggester = new Suggester(); if (obj.getSourceFields() != null) { - List _sourceFields = new ArrayList<>(obj.getSourceFields()); - suggester.setSourceFields(_sourceFields); + List sourceFields = new ArrayList<>(obj.getSourceFields()); + suggester.setSourceFields(sourceFields); } - String _name = obj.getName(); - suggester.setName(_name); + String name = obj.getName(); + suggester.setName(name); - String _searchMode = obj.getSearchMode(); - PrivateFieldAccessHelper.set(suggester, "searchMode", _searchMode); + String searchMode = obj.getSearchMode(); + PrivateFieldAccessHelper.set(suggester, "searchMode", searchMode); return suggester; } @@ -49,14 +49,17 @@ public static com.azure.search.documents.implementation.models.Suggester map(Sug new com.azure.search.documents.implementation.models.Suggester(); if (obj.getSourceFields() != null) { - List _sourceFields = new ArrayList<>(obj.getSourceFields()); - suggester.setSourceFields(_sourceFields); + List sourceFields = new ArrayList<>(obj.getSourceFields()); + suggester.setSourceFields(sourceFields); } - String _name = obj.getName(); - suggester.setName(_name); + String name = obj.getName(); + suggester.setName(name); suggester.setSearchMode("analyzingInfixMatching"); return suggester; } + + private SuggesterConverter() { + } } 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 index 7daf8c9b7be6..cfb5028f51ce 100644 --- 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 @@ -12,7 +12,7 @@ * 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}. @@ -23,22 +23,22 @@ public static SynonymMap map(com.azure.search.documents.implementation.models.Sy } SynonymMap synonymMap = new SynonymMap(); - String _synonyms = obj.getSynonyms(); - synonymMap.setSynonyms(_synonyms); + String synonyms = obj.getSynonyms(); + synonymMap.setSynonyms(synonyms); - String _name = obj.getName(); - synonymMap.setName(_name); + String name = obj.getName(); + synonymMap.setName(name); - String _format = obj.getFormat(); - PrivateFieldAccessHelper.set(synonymMap, "format", _format); + String format = obj.getFormat(); + PrivateFieldAccessHelper.set(synonymMap, "format", format); - String _eTag = obj.getETag(); - synonymMap.setETag(_eTag); + String eTag = obj.getETag(); + synonymMap.setETag(eTag); if (obj.getEncryptionKey() != null) { - SearchResourceEncryptionKey _encryptionKey = + SearchResourceEncryptionKey encryptionKey = SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey()); - synonymMap.setEncryptionKey(_encryptionKey); + synonymMap.setEncryptionKey(encryptionKey); } return synonymMap; } @@ -53,22 +53,25 @@ public static com.azure.search.documents.implementation.models.SynonymMap map(Sy com.azure.search.documents.implementation.models.SynonymMap synonymMap = new com.azure.search.documents.implementation.models.SynonymMap(); - String _synonyms = obj.getSynonyms(); - synonymMap.setSynonyms(_synonyms); + String synonyms = obj.getSynonyms(); + synonymMap.setSynonyms(synonyms); - String _name = obj.getName(); - synonymMap.setName(_name); + String name = obj.getName(); + synonymMap.setName(name); synonymMap.setFormat("solr"); - String _eTag = obj.getETag(); - synonymMap.setETag(_eTag); + String eTag = obj.getETag(); + synonymMap.setETag(eTag); if (obj.getEncryptionKey() != null) { - com.azure.search.documents.implementation.models.SearchResourceEncryptionKey _encryptionKey = + com.azure.search.documents.implementation.models.SearchResourceEncryptionKey encryptionKey = SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey()); - synonymMap.setEncryptionKey(_encryptionKey); + synonymMap.setEncryptionKey(encryptionKey); } return synonymMap; } + + private SynonymMapConverter() { + } } 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 index 46ca483a29ec..ea689c578307 100644 --- 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 @@ -8,14 +8,13 @@ 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 @@ -27,19 +26,19 @@ public static SynonymTokenFilter map(com.azure.search.documents.implementation.m } SynonymTokenFilter synonymTokenFilter = new SynonymTokenFilter(); - String _name = obj.getName(); - synonymTokenFilter.setName(_name); + String name = obj.getName(); + synonymTokenFilter.setName(name); - Boolean _expand = obj.isExpand(); - synonymTokenFilter.setExpand(_expand); + Boolean expand = obj.isExpand(); + synonymTokenFilter.setExpand(expand); if (obj.getSynonyms() != null) { - List _synonyms = new ArrayList<>(obj.getSynonyms()); - synonymTokenFilter.setSynonyms(_synonyms); + List synonyms = new ArrayList<>(obj.getSynonyms()); + synonymTokenFilter.setSynonyms(synonyms); } - Boolean _ignoreCase = obj.isIgnoreCase(); - synonymTokenFilter.setIgnoreCase(_ignoreCase); + Boolean ignoreCase = obj.isIgnoreCase(); + synonymTokenFilter.setIgnoreCase(ignoreCase); return synonymTokenFilter; } @@ -54,19 +53,22 @@ public static com.azure.search.documents.implementation.models.SynonymTokenFilte com.azure.search.documents.implementation.models.SynonymTokenFilter synonymTokenFilter = new com.azure.search.documents.implementation.models.SynonymTokenFilter(); - String _name = obj.getName(); - synonymTokenFilter.setName(_name); + String name = obj.getName(); + synonymTokenFilter.setName(name); - Boolean _expand = obj.isExpand(); - synonymTokenFilter.setExpand(_expand); + Boolean expand = obj.isExpand(); + synonymTokenFilter.setExpand(expand); if (obj.getSynonyms() != null) { - List _synonyms = new ArrayList<>(obj.getSynonyms()); - synonymTokenFilter.setSynonyms(_synonyms); + List synonyms = new ArrayList<>(obj.getSynonyms()); + synonymTokenFilter.setSynonyms(synonyms); } - Boolean _ignoreCase = obj.isIgnoreCase(); - synonymTokenFilter.setIgnoreCase(_ignoreCase); + Boolean ignoreCase = obj.isIgnoreCase(); + synonymTokenFilter.setIgnoreCase(ignoreCase); return synonymTokenFilter; } + + private SynonymTokenFilterConverter() { + } } 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 index 2a1971abc41b..5023c7c6ece7 100644 --- 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 @@ -13,7 +13,7 @@ * {@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 @@ -26,20 +26,20 @@ public static TagScoringFunction map(com.azure.search.documents.implementation.m TagScoringFunction tagScoringFunction = new TagScoringFunction(); if (obj.getInterpolation() != null) { - ScoringFunctionInterpolation _interpolation = + ScoringFunctionInterpolation interpolation = ScoringFunctionInterpolationConverter.map(obj.getInterpolation()); - tagScoringFunction.setInterpolation(_interpolation); + tagScoringFunction.setInterpolation(interpolation); } - String _fieldName = obj.getFieldName(); - tagScoringFunction.setFieldName(_fieldName); + String fieldName = obj.getFieldName(); + tagScoringFunction.setFieldName(fieldName); - double _boost = obj.getBoost(); - tagScoringFunction.setBoost(_boost); + double boost = obj.getBoost(); + tagScoringFunction.setBoost(boost); if (obj.getParameters() != null) { - TagScoringParameters _parameters = TagScoringParametersConverter.map(obj.getParameters()); - tagScoringFunction.setParameters(_parameters); + TagScoringParameters parameters = TagScoringParametersConverter.map(obj.getParameters()); + tagScoringFunction.setParameters(parameters); } return tagScoringFunction; } @@ -56,22 +56,25 @@ public static com.azure.search.documents.implementation.models.TagScoringFunctio new com.azure.search.documents.implementation.models.TagScoringFunction(); if (obj.getInterpolation() != null) { - com.azure.search.documents.implementation.models.ScoringFunctionInterpolation _interpolation = + com.azure.search.documents.implementation.models.ScoringFunctionInterpolation interpolation = ScoringFunctionInterpolationConverter.map(obj.getInterpolation()); - tagScoringFunction.setInterpolation(_interpolation); + tagScoringFunction.setInterpolation(interpolation); } - String _fieldName = obj.getFieldName(); - tagScoringFunction.setFieldName(_fieldName); + String fieldName = obj.getFieldName(); + tagScoringFunction.setFieldName(fieldName); - double _boost = obj.getBoost(); - tagScoringFunction.setBoost(_boost); + double boost = obj.getBoost(); + tagScoringFunction.setBoost(boost); if (obj.getParameters() != null) { - com.azure.search.documents.implementation.models.TagScoringParameters _parameters = + com.azure.search.documents.implementation.models.TagScoringParameters parameters = TagScoringParametersConverter.map(obj.getParameters()); - tagScoringFunction.setParameters(_parameters); + tagScoringFunction.setParameters(parameters); } return tagScoringFunction; } + + private TagScoringFunctionConverter() { + } } 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 index a9acafbee300..c17e3598b54e 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,8 +23,8 @@ public static TagScoringParameters map(com.azure.search.documents.implementation } TagScoringParameters tagScoringParameters = new TagScoringParameters(); - String _tagsParameter = obj.getTagsParameter(); - tagScoringParameters.setTagsParameter(_tagsParameter); + String tagsParameter = obj.getTagsParameter(); + tagScoringParameters.setTagsParameter(tagsParameter); return tagScoringParameters; } @@ -39,8 +39,11 @@ public static com.azure.search.documents.implementation.models.TagScoringParamet com.azure.search.documents.implementation.models.TagScoringParameters tagScoringParameters = new com.azure.search.documents.implementation.models.TagScoringParameters(); - String _tagsParameter = obj.getTagsParameter(); - tagScoringParameters.setTagsParameter(_tagsParameter); + String tagsParameter = obj.getTagsParameter(); + tagScoringParameters.setTagsParameter(tagsParameter); return tagScoringParameters; } + + private TagScoringParametersConverter() { + } } 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 index a6f3ee218cef..ee718e0110ff 100644 --- 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 @@ -51,4 +51,7 @@ public static com.azure.search.documents.implementation.models.TextExtractionAlg throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private TextExtractionAlgorithmConverter() { + } } 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 index f8fe213eac08..3a5aa7881440 100644 --- 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 @@ -50,4 +50,7 @@ public static com.azure.search.documents.implementation.models.TextSplitMode map throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private TextSplitModeConverter() { + } } 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 index ed735ced79e2..695e6bb72f4c 100644 --- 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 @@ -17,7 +17,7 @@ * {@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 @@ -30,42 +30,42 @@ public static TextTranslationSkill map(com.azure.search.documents.implementation TextTranslationSkill textTranslationSkill = new TextTranslationSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - textTranslationSkill.setOutputs(_outputs); + textTranslationSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - textTranslationSkill.setInputs(_inputs); + textTranslationSkill.setInputs(inputs); } - String _name = obj.getName(); - textTranslationSkill.setName(_name); + String name = obj.getName(); + textTranslationSkill.setName(name); - String _context = obj.getContext(); - textTranslationSkill.setContext(_context); + String context = obj.getContext(); + textTranslationSkill.setContext(context); - String _description = obj.getDescription(); - textTranslationSkill.setDescription(_description); + String description = obj.getDescription(); + textTranslationSkill.setDescription(description); if (obj.getDefaultToLanguageCode() != null) { - TextTranslationSkillLanguage _defaultToLanguageCode = + TextTranslationSkillLanguage defaultToLanguageCode = TextTranslationSkillLanguageConverter.map(obj.getDefaultToLanguageCode()); - textTranslationSkill.setDefaultToLanguageCode(_defaultToLanguageCode); + textTranslationSkill.setDefaultToLanguageCode(defaultToLanguageCode); } if (obj.getDefaultFromLanguageCode() != null) { - TextTranslationSkillLanguage _defaultFromLanguageCode = + TextTranslationSkillLanguage defaultFromLanguageCode = TextTranslationSkillLanguageConverter.map(obj.getDefaultFromLanguageCode()); - textTranslationSkill.setDefaultFromLanguageCode(_defaultFromLanguageCode); + textTranslationSkill.setDefaultFromLanguageCode(defaultFromLanguageCode); } if (obj.getSuggestedFrom() != null) { - TextTranslationSkillLanguage _suggestedFrom = + TextTranslationSkillLanguage suggestedFrom = TextTranslationSkillLanguageConverter.map(obj.getSuggestedFrom()); - textTranslationSkill.setSuggestedFrom(_suggestedFrom); + textTranslationSkill.setSuggestedFrom(suggestedFrom); } return textTranslationSkill; } @@ -82,43 +82,46 @@ public static com.azure.search.documents.implementation.models.TextTranslationSk new com.azure.search.documents.implementation.models.TextTranslationSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - textTranslationSkill.setOutputs(_outputs); + textTranslationSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - textTranslationSkill.setInputs(_inputs); + textTranslationSkill.setInputs(inputs); } - String _name = obj.getName(); - textTranslationSkill.setName(_name); + String name = obj.getName(); + textTranslationSkill.setName(name); - String _context = obj.getContext(); - textTranslationSkill.setContext(_context); + String context = obj.getContext(); + textTranslationSkill.setContext(context); - String _description = obj.getDescription(); - textTranslationSkill.setDescription(_description); + String description = obj.getDescription(); + textTranslationSkill.setDescription(description); if (obj.getDefaultToLanguageCode() != null) { - com.azure.search.documents.implementation.models.TextTranslationSkillLanguage _defaultToLanguageCode = + com.azure.search.documents.implementation.models.TextTranslationSkillLanguage defaultToLanguageCode = TextTranslationSkillLanguageConverter.map(obj.getDefaultToLanguageCode()); - textTranslationSkill.setDefaultToLanguageCode(_defaultToLanguageCode); + textTranslationSkill.setDefaultToLanguageCode(defaultToLanguageCode); } if (obj.getDefaultFromLanguageCode() != null) { - com.azure.search.documents.implementation.models.TextTranslationSkillLanguage _defaultFromLanguageCode = + com.azure.search.documents.implementation.models.TextTranslationSkillLanguage defaultFromLanguageCode = TextTranslationSkillLanguageConverter.map(obj.getDefaultFromLanguageCode()); - textTranslationSkill.setDefaultFromLanguageCode(_defaultFromLanguageCode); + textTranslationSkill.setDefaultFromLanguageCode(defaultFromLanguageCode); } if (obj.getSuggestedFrom() != null) { - com.azure.search.documents.implementation.models.TextTranslationSkillLanguage _suggestedFrom = + com.azure.search.documents.implementation.models.TextTranslationSkillLanguage suggestedFrom = TextTranslationSkillLanguageConverter.map(obj.getSuggestedFrom()); - textTranslationSkill.setSuggestedFrom(_suggestedFrom); + textTranslationSkill.setSuggestedFrom(suggestedFrom); } return textTranslationSkill; } + + private TextTranslationSkillConverter() { + } } 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 index d0b14a09bf85..04df83648e49 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.TextTranslationSk } return com.azure.search.documents.implementation.models.TextTranslationSkillLanguage.fromString(obj.toString()); } + + private TextTranslationSkillLanguageConverter() { + } } 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 index a2a42ba613aa..62fafce48f2e 100644 --- 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 @@ -13,7 +13,7 @@ * 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}. @@ -25,10 +25,9 @@ public static TextWeights map(com.azure.search.documents.implementation.models.T 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); + Map weights = + obj.getWeights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + textWeights.setWeights(weights); } return textWeights; } @@ -44,11 +43,13 @@ public static com.azure.search.documents.implementation.models.TextWeights map(T 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); + Map weights = + obj.getWeights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + textWeights.setWeights(weights); } return textWeights; } + + private TextWeightsConverter() { + } } 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 index 36af5f78bc34..45798109fae0 100644 --- 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 @@ -63,4 +63,7 @@ public static com.azure.search.documents.implementation.models.TokenCharacterKin throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private TokenCharacterKindConverter() { + } } 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 index 7965f2ef76f0..2d918527041c 100644 --- 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 @@ -204,6 +204,10 @@ public static com.azure.search.documents.implementation.models.TokenFilter map(T 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()))); + throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, + obj.getClass().getSimpleName()))); + } + + private TokenFilterConverter() { } } 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 index 3a0bf28abc4c..5e6c7d7372d7 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -34,4 +34,7 @@ public static com.azure.search.documents.implementation.models.TokenFilterName m } return com.azure.search.documents.implementation.models.TokenFilterName.fromString(obj.toString()); } + + private TokenFilterNameConverter() { + } } 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 index 3ef79423e0b9..4bd03a1445f9 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static TruncateTokenFilter map(com.azure.search.documents.implementation. } TruncateTokenFilter truncateTokenFilter = new TruncateTokenFilter(); - String _name = obj.getName(); - truncateTokenFilter.setName(_name); + String name = obj.getName(); + truncateTokenFilter.setName(name); - Integer _length = obj.getLength(); - truncateTokenFilter.setLength(_length); + Integer length = obj.getLength(); + truncateTokenFilter.setLength(length); return truncateTokenFilter; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.TruncateTokenFilt com.azure.search.documents.implementation.models.TruncateTokenFilter truncateTokenFilter = new com.azure.search.documents.implementation.models.TruncateTokenFilter(); - String _name = obj.getName(); - truncateTokenFilter.setName(_name); + String name = obj.getName(); + truncateTokenFilter.setName(name); - Integer _length = obj.getLength(); - truncateTokenFilter.setLength(_length); + Integer length = obj.getLength(); + truncateTokenFilter.setLength(length); return truncateTokenFilter; } + + private TruncateTokenFilterConverter() { + } } 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 index e89d32cccf07..cc2065d62bec 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static UaxUrlEmailTokenizer map(com.azure.search.documents.implementation } UaxUrlEmailTokenizer uaxUrlEmailTokenizer = new UaxUrlEmailTokenizer(); - String _name = obj.getName(); - uaxUrlEmailTokenizer.setName(_name); + String name = obj.getName(); + uaxUrlEmailTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - uaxUrlEmailTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + uaxUrlEmailTokenizer.setMaxTokenLength(maxTokenLength); return uaxUrlEmailTokenizer; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.UaxUrlEmailTokeni com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer uaxUrlEmailTokenizer = new com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer(); - String _name = obj.getName(); - uaxUrlEmailTokenizer.setName(_name); + String name = obj.getName(); + uaxUrlEmailTokenizer.setName(name); - Integer _maxTokenLength = obj.getMaxTokenLength(); - uaxUrlEmailTokenizer.setMaxTokenLength(_maxTokenLength); + Integer maxTokenLength = obj.getMaxTokenLength(); + uaxUrlEmailTokenizer.setMaxTokenLength(maxTokenLength); return uaxUrlEmailTokenizer; } + + private UaxUrlEmailTokenizerConverter() { + } } 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 index 19896d7dfcf7..c7c8417bda4c 100644 --- 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 @@ -11,7 +11,7 @@ * {@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 @@ -23,11 +23,11 @@ public static UniqueTokenFilter map(com.azure.search.documents.implementation.mo } UniqueTokenFilter uniqueTokenFilter = new UniqueTokenFilter(); - String _name = obj.getName(); - uniqueTokenFilter.setName(_name); + String name = obj.getName(); + uniqueTokenFilter.setName(name); - Boolean _onlyOnSamePosition = obj.isOnlyOnSamePosition(); - uniqueTokenFilter.setOnlyOnSamePosition(_onlyOnSamePosition); + Boolean onlyOnSamePosition = obj.isOnlyOnSamePosition(); + uniqueTokenFilter.setOnlyOnSamePosition(onlyOnSamePosition); return uniqueTokenFilter; } @@ -42,11 +42,14 @@ public static com.azure.search.documents.implementation.models.UniqueTokenFilter com.azure.search.documents.implementation.models.UniqueTokenFilter uniqueTokenFilter = new com.azure.search.documents.implementation.models.UniqueTokenFilter(); - String _name = obj.getName(); - uniqueTokenFilter.setName(_name); + String name = obj.getName(); + uniqueTokenFilter.setName(name); - Boolean _onlyOnSamePosition = obj.isOnlyOnSamePosition(); - uniqueTokenFilter.setOnlyOnSamePosition(_onlyOnSamePosition); + Boolean onlyOnSamePosition = obj.isOnlyOnSamePosition(); + uniqueTokenFilter.setOnlyOnSamePosition(onlyOnSamePosition); return uniqueTokenFilter; } + + private UniqueTokenFilterConverter() { + } } 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 index 01848f164cda..adda882f9bc1 100644 --- 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 @@ -70,4 +70,7 @@ public static com.azure.search.documents.implementation.models.VisualFeature map throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj))); } } + + private VisualFeatureConverter() { + } } 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 index 41a7cb55f9e4..9e069e394732 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -17,8 +16,6 @@ * 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}. */ @@ -29,46 +26,47 @@ public static WebApiSkill map(com.azure.search.documents.implementation.models.W WebApiSkill webApiSkill = new WebApiSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - webApiSkill.setOutputs(_outputs); + webApiSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - webApiSkill.setInputs(_inputs); + webApiSkill.setInputs(inputs); } - String _name = obj.getName(); - webApiSkill.setName(_name); + String name = obj.getName(); + webApiSkill.setName(name); - String _context = obj.getContext(); - webApiSkill.setContext(_context); + String context = obj.getContext(); + webApiSkill.setContext(context); - String _description = obj.getDescription(); - webApiSkill.setDescription(_description); + 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); + 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); + String httpMethod = obj.getHttpMethod(); + webApiSkill.setHttpMethod(httpMethod); - Integer _batchSize = obj.getBatchSize(); - webApiSkill.setBatchSize(_batchSize); + Integer batchSize = obj.getBatchSize(); + webApiSkill.setBatchSize(batchSize); - String _uri = obj.getUri(); - webApiSkill.setUri(_uri); + String uri = obj.getUri(); + webApiSkill.setUri(uri); - Duration _timeout = obj.getTimeout(); - webApiSkill.setTimeout(_timeout); + Duration timeout = obj.getTimeout(); + webApiSkill.setTimeout(timeout); - Integer _degreeOfParallelism = obj.getDegreeOfParallelism(); - webApiSkill.setDegreeOfParallelism(_degreeOfParallelism); + Integer degreeOfParallelism = obj.getDegreeOfParallelism(); + webApiSkill.setDegreeOfParallelism(degreeOfParallelism); return webApiSkill; } @@ -83,47 +81,50 @@ public static com.azure.search.documents.implementation.models.WebApiSkill map(W new com.azure.search.documents.implementation.models.WebApiSkill(); if (obj.getOutputs() != null) { - List _outputs = + List outputs = obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList()); - webApiSkill.setOutputs(_outputs); + webApiSkill.setOutputs(outputs); } if (obj.getInputs() != null) { - List _inputs = + List inputs = obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList()); - webApiSkill.setInputs(_inputs); + webApiSkill.setInputs(inputs); } - String _name = obj.getName(); - webApiSkill.setName(_name); + String name = obj.getName(); + webApiSkill.setName(name); - String _context = obj.getContext(); - webApiSkill.setContext(_context); + String context = obj.getContext(); + webApiSkill.setContext(context); - String _description = obj.getDescription(); - webApiSkill.setDescription(_description); + String description = obj.getDescription(); + webApiSkill.setDescription(description); if (obj.getHttpHeaders() != null) { - Map _httpHeaders = + Map httpHeaders = obj.getHttpHeaders().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - webApiSkill.setHttpHeaders(_httpHeaders); + webApiSkill.setHttpHeaders(httpHeaders); } - String _httpMethod = obj.getHttpMethod(); - webApiSkill.setHttpMethod(_httpMethod); + String httpMethod = obj.getHttpMethod(); + webApiSkill.setHttpMethod(httpMethod); - Integer _batchSize = obj.getBatchSize(); - webApiSkill.setBatchSize(_batchSize); + Integer batchSize = obj.getBatchSize(); + webApiSkill.setBatchSize(batchSize); - String _uri = obj.getUri(); - webApiSkill.setUri(_uri); + String uri = obj.getUri(); + webApiSkill.setUri(uri); - Duration _timeout = obj.getTimeout(); - webApiSkill.setTimeout(_timeout); + Duration timeout = obj.getTimeout(); + webApiSkill.setTimeout(timeout); - Integer _degreeOfParallelism = obj.getDegreeOfParallelism(); - webApiSkill.setDegreeOfParallelism(_degreeOfParallelism); + Integer degreeOfParallelism = obj.getDegreeOfParallelism(); + webApiSkill.setDegreeOfParallelism(degreeOfParallelism); return webApiSkill; } + + private WebApiSkillConverter() { + } } 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 index f650983400b9..c966b76b3506 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@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}. @@ -26,40 +23,40 @@ public static WordDelimiterTokenFilter map(com.azure.search.documents.implementa } WordDelimiterTokenFilter wordDelimiterTokenFilter = new WordDelimiterTokenFilter(); - String _name = obj.getName(); - wordDelimiterTokenFilter.setName(_name); + String name = obj.getName(); + wordDelimiterTokenFilter.setName(name); - Boolean _catenateNumbers = obj.isCatenateNumbers(); - wordDelimiterTokenFilter.setCatenateNumbers(_catenateNumbers); + Boolean catenateNumbers = obj.isCatenateNumbers(); + wordDelimiterTokenFilter.setCatenateNumbers(catenateNumbers); if (obj.getProtectedWords() != null) { - List _protectedWords = new ArrayList<>(obj.getProtectedWords()); - wordDelimiterTokenFilter.setProtectedWords(_protectedWords); + List protectedWords = new ArrayList<>(obj.getProtectedWords()); + wordDelimiterTokenFilter.setProtectedWords(protectedWords); } - Boolean _generateNumberParts = obj.isGenerateNumberParts(); - wordDelimiterTokenFilter.setGenerateNumberParts(_generateNumberParts); + Boolean generateNumberParts = obj.isGenerateNumberParts(); + wordDelimiterTokenFilter.setGenerateNumberParts(generateNumberParts); - Boolean _stemEnglishPossessive = obj.isStemEnglishPossessive(); - wordDelimiterTokenFilter.setStemEnglishPossessive(_stemEnglishPossessive); + Boolean stemEnglishPossessive = obj.isStemEnglishPossessive(); + wordDelimiterTokenFilter.setStemEnglishPossessive(stemEnglishPossessive); - Boolean _splitOnCaseChange = obj.isSplitOnCaseChange(); - wordDelimiterTokenFilter.setSplitOnCaseChange(_splitOnCaseChange); + Boolean splitOnCaseChange = obj.isSplitOnCaseChange(); + wordDelimiterTokenFilter.setSplitOnCaseChange(splitOnCaseChange); - Boolean _generateWordParts = obj.isGenerateWordParts(); - wordDelimiterTokenFilter.setGenerateWordParts(_generateWordParts); + Boolean generateWordParts = obj.isGenerateWordParts(); + wordDelimiterTokenFilter.setGenerateWordParts(generateWordParts); - Boolean _splitOnNumerics = obj.isSplitOnNumerics(); - wordDelimiterTokenFilter.setSplitOnNumerics(_splitOnNumerics); + Boolean splitOnNumerics = obj.isSplitOnNumerics(); + wordDelimiterTokenFilter.setSplitOnNumerics(splitOnNumerics); - Boolean _preserveOriginal = obj.isPreserveOriginal(); - wordDelimiterTokenFilter.setPreserveOriginal(_preserveOriginal); + Boolean preserveOriginal = obj.isPreserveOriginal(); + wordDelimiterTokenFilter.setPreserveOriginal(preserveOriginal); - Boolean _catenateAll = obj.isCatenateAll(); - wordDelimiterTokenFilter.setCatenateAll(_catenateAll); + Boolean catenateAll = obj.isCatenateAll(); + wordDelimiterTokenFilter.setCatenateAll(catenateAll); - Boolean _catenateWords = obj.isCatenateWords(); - wordDelimiterTokenFilter.setCatenateWords(_catenateWords); + Boolean catenateWords = obj.isCatenateWords(); + wordDelimiterTokenFilter.setCatenateWords(catenateWords); return wordDelimiterTokenFilter; } @@ -74,40 +71,43 @@ public static com.azure.search.documents.implementation.models.WordDelimiterToke com.azure.search.documents.implementation.models.WordDelimiterTokenFilter wordDelimiterTokenFilter = new com.azure.search.documents.implementation.models.WordDelimiterTokenFilter(); - String _name = obj.getName(); - wordDelimiterTokenFilter.setName(_name); + String name = obj.getName(); + wordDelimiterTokenFilter.setName(name); - Boolean _catenateNumbers = obj.isCatenateNumbers(); - wordDelimiterTokenFilter.setCatenateNumbers(_catenateNumbers); + Boolean catenateNumbers = obj.isCatenateNumbers(); + wordDelimiterTokenFilter.setCatenateNumbers(catenateNumbers); if (obj.getProtectedWords() != null) { - List _protectedWords = new ArrayList<>(obj.getProtectedWords()); - wordDelimiterTokenFilter.setProtectedWords(_protectedWords); + List protectedWords = new ArrayList<>(obj.getProtectedWords()); + wordDelimiterTokenFilter.setProtectedWords(protectedWords); } - Boolean _generateNumberParts = obj.generateNumberParts(); - wordDelimiterTokenFilter.setGenerateNumberParts(_generateNumberParts); + Boolean generateNumberParts = obj.generateNumberParts(); + wordDelimiterTokenFilter.setGenerateNumberParts(generateNumberParts); - Boolean _stemEnglishPossessive = obj.isStemEnglishPossessive(); - wordDelimiterTokenFilter.setStemEnglishPossessive(_stemEnglishPossessive); + Boolean stemEnglishPossessive = obj.isStemEnglishPossessive(); + wordDelimiterTokenFilter.setStemEnglishPossessive(stemEnglishPossessive); - Boolean _splitOnCaseChange = obj.isSplitOnCaseChange(); - wordDelimiterTokenFilter.setSplitOnCaseChange(_splitOnCaseChange); + Boolean splitOnCaseChange = obj.isSplitOnCaseChange(); + wordDelimiterTokenFilter.setSplitOnCaseChange(splitOnCaseChange); - Boolean _generateWordParts = obj.generateWordParts(); - wordDelimiterTokenFilter.setGenerateWordParts(_generateWordParts); + Boolean generateWordParts = obj.generateWordParts(); + wordDelimiterTokenFilter.setGenerateWordParts(generateWordParts); - Boolean _splitOnNumerics = obj.isSplitOnNumerics(); - wordDelimiterTokenFilter.setSplitOnNumerics(_splitOnNumerics); + Boolean splitOnNumerics = obj.isSplitOnNumerics(); + wordDelimiterTokenFilter.setSplitOnNumerics(splitOnNumerics); - Boolean _preserveOriginal = obj.isPreserveOriginal(); - wordDelimiterTokenFilter.setPreserveOriginal(_preserveOriginal); + Boolean preserveOriginal = obj.isPreserveOriginal(); + wordDelimiterTokenFilter.setPreserveOriginal(preserveOriginal); - Boolean _catenateAll = obj.isCatenateAll(); - wordDelimiterTokenFilter.setCatenateAll(_catenateAll); + Boolean catenateAll = obj.isCatenateAll(); + wordDelimiterTokenFilter.setCatenateAll(catenateAll); - Boolean _catenateWords = obj.isCatenateWords(); - wordDelimiterTokenFilter.setCatenateWords(_catenateWords); + Boolean catenateWords = obj.isCatenateWords(); + wordDelimiterTokenFilter.setCatenateWords(catenateWords); return wordDelimiterTokenFilter; } + + private WordDelimiterTokenFilterConverter() { + } } diff --git a/sdk/search/azure-search-documents/swagger/readme.md b/sdk/search/azure-search-documents/swagger/readme.md index 859bce60a869..4d1d4a4f9c61 100644 --- a/sdk/search/azure-search-documents/swagger/readme.md +++ b/sdk/search/azure-search-documents/swagger/readme.md @@ -51,6 +51,8 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Azure.Search/preview/2019-05-06-preview/searchservice.json title: SearchServiceRestClient models-subpackage: implementation.models +custom-types: StopwordsList, +custom-types-subpackage: models ``` ### Tag: package-2019-05-searchindex-preview From 6331349fb015df459c3b16aba63497359f67a6cd Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Thu, 21 May 2020 14:37:40 -0700 Subject: [PATCH 12/19] swagger readme changes. --- sdk/search/azure-search-documents/swagger/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/search/azure-search-documents/swagger/readme.md b/sdk/search/azure-search-documents/swagger/readme.md index 4d1d4a4f9c61..f5940ee2ef98 100644 --- a/sdk/search/azure-search-documents/swagger/readme.md +++ b/sdk/search/azure-search-documents/swagger/readme.md @@ -51,7 +51,6 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Azure.Search/preview/2019-05-06-preview/searchservice.json title: SearchServiceRestClient models-subpackage: implementation.models -custom-types: StopwordsList, custom-types-subpackage: models ``` From b33ffb28c06e3eb5546a3e894b8d0a8bd22424db Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Thu, 21 May 2020 14:39:32 -0700 Subject: [PATCH 13/19] delte constants in converters --- .../implementation/converters/Constants.java | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/Constants.java 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 deleted file mode 100644 index 989784f790e7..000000000000 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/Constants.java +++ /dev/null @@ -1,12 +0,0 @@ -// 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 = ""; -} From 2f2f4ff834bd7b47a0f50054b065262d40c4a7e7 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Thu, 21 May 2020 15:50:56 -0700 Subject: [PATCH 14/19] Added back copyright --- .../implementation/converters/AnalyzedTokenInfoConverter.java | 3 +++ 1 file changed, 3 insertions(+) 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 index 8aa34851d4d0..a802cd78d60f 100644 --- 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 @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.azure.search.documents.implementation.converters; import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper; From 18ccc2833433ac7cfcb803c0e143b525a436d06f Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Tue, 26 May 2020 09:48:47 -0700 Subject: [PATCH 15/19] Update sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java Co-authored-by: Srikanta <51379715+srnagar@users.noreply.github.com> --- .../azure/search/documents/implementation/util/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java index 43a1ed40ec14..cd1d20ae13ae 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java @@ -5,7 +5,7 @@ public class Constants { public static final String ENUM_INTERNAL_ERROR_MSG = "The enum does not exist in internal used model %s."; - public static final String ENUM_EXTERNAL_ERROR_MSG = "The enum does not exist in external used model %s."; + public static final String ENUM_EXTERNAL_ERROR_MSG = "The enum does not exist in externally used model %s."; public static final String ABSTRACT_INTERNAL_ERROR_MSG = "The subclass does not exist in internal used model %s."; public static final String ABSTRACT_EXTERNAL_ERROR_MSG = "The subclass does not exist in external used model %s."; From 715cab180147a1c4634677bdbfdec4bea8ceb337 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Tue, 26 May 2020 09:49:08 -0700 Subject: [PATCH 16/19] Update sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java Co-authored-by: Srikanta <51379715+srnagar@users.noreply.github.com> --- .../azure/search/documents/implementation/util/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java index cd1d20ae13ae..bcd471065eb3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/Constants.java @@ -4,7 +4,7 @@ package com.azure.search.documents.implementation.util; public class Constants { - public static final String ENUM_INTERNAL_ERROR_MSG = "The enum does not exist in internal used model %s."; + public static final String ENUM_INTERNAL_ERROR_MSG = "The enum does not exist in internally used model %s."; public static final String ENUM_EXTERNAL_ERROR_MSG = "The enum does not exist in externally used model %s."; public static final String ABSTRACT_INTERNAL_ERROR_MSG = "The subclass does not exist in internal used model %s."; From 13dbc30119f4196c0321398c7a329abf3001877c Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Tue, 26 May 2020 10:02:41 -0700 Subject: [PATCH 17/19] Addressed feedback --- .../CommonGramTokenFilterConverter.java | 3 -- .../converters/ConditionalSkillConverter.java | 3 -- .../converters/CorsOptionsConverter.java | 3 -- .../converters/CustomAnalyzerConverter.java | 1 - .../DataSourceCredentialsConverter.java | 3 -- ...aultCognitiveServicesAccountConverter.java | 3 -- ...onaryDecompounderTokenFilterConverter.java | 3 -- .../DistanceScoringFunctionConverter.java | 3 -- .../DistanceScoringParametersConverter.java | 3 -- .../EdgeNGramTokenFilterConverter.java | 3 -- .../EdgeNGramTokenFilterV2Converter.java | 3 -- .../EdgeNGramTokenizerConverter.java | 3 -- .../ElisionTokenFilterConverter.java | 3 -- .../EntityRecognitionSkillConverter.java | 3 -- ...tityRecognitionSkillLanguageConverter.java | 3 -- .../converters/FacetResultConverter.java | 1 - .../converters/FieldMappingConverter.java | 3 -- .../FieldMappingFunctionConverter.java | 3 -- .../FreshnessScoringFunctionConverter.java | 3 -- .../FreshnessScoringParametersConverter.java | 3 -- .../GetIndexStatisticsResultConverter.java | 3 -- ...terMarkChangeDetectionPolicyConverter.java | 3 -- .../ImageAnalysisSkillConverter.java | 3 -- .../ImageAnalysisSkillLanguageConverter.java | 3 -- .../converters/IndexActionConverter.java | 3 -- .../converters/IndexBatchBaseConverter.java | 3 -- .../IndexDocumentsResultConverter.java | 3 -- .../IndexingParametersConverter.java | 3 -- .../converters/IndexingResultConverter.java | 3 -- .../converters/IndexingScheduleConverter.java | 3 -- .../InputFieldMappingEntryConverter.java | 3 -- .../converters/KeepTokenFilterConverter.java | 3 -- .../KeyPhraseExtractionSkillConverter.java | 3 -- ...hraseExtractionSkillLanguageConverter.java | 3 -- .../KeywordMarkerTokenFilterConverter.java | 3 -- .../converters/KeywordTokenizerConverter.java | 2 -- .../KeywordTokenizerV2Converter.java | 2 -- .../LanguageDetectionSkillConverter.java | 2 -- .../LengthTokenFilterConverter.java | 2 -- .../LexicalAnalyzerNameConverter.java | 2 -- .../LexicalTokenizerNameConverter.java | 2 -- .../converters/LimitTokenFilterConverter.java | 2 -- .../LuceneStandardAnalyzerConverter.java | 2 -- .../LuceneStandardTokenizerConverter.java | 2 -- .../LuceneStandardTokenizerV2Converter.java | 2 -- .../MagnitudeScoringFunctionConverter.java | 2 -- .../MagnitudeScoringParametersConverter.java | 2 -- .../MappingCharFilterConverter.java | 2 -- .../converters/MergeSkillConverter.java | 2 -- ...oftLanguageStemmingTokenizerConverter.java | 2 -- .../MicrosoftLanguageTokenizerConverter.java | 2 -- .../converters/NGramTokenFilterConverter.java | 2 -- .../NGramTokenFilterV2Converter.java | 2 -- .../converters/NGramTokenizerConverter.java | 2 -- .../converters/OcrSkillConverter.java | 2 -- .../converters/OcrSkillLanguageConverter.java | 2 -- .../OutputFieldMappingEntryConverter.java | 2 -- .../PathHierarchyTokenizerV2Converter.java | 2 -- .../converters/PatternAnalyzerConverter.java | 2 -- .../PatternCaptureTokenFilterConverter.java | 2 -- .../PatternReplaceCharFilterConverter.java | 2 -- .../PatternReplaceTokenFilterConverter.java | 2 -- .../converters/PatternTokenizerConverter.java | 2 -- .../PhoneticTokenFilterConverter.java | 2 -- .../converters/RegexFlagsConverter.java | 2 -- .../converters/RequestOptionsConverter.java | 2 -- .../converters/ResourceCounterConverter.java | 2 -- .../converters/ScoringProfileConverter.java | 2 -- .../SearchFieldDataTypeConverter.java | 2 -- .../converters/SearchIndexConverter.java | 2 -- .../converters/SearchIndexerConverter.java | 2 -- .../SearchIndexerDataContainerConverter.java | 2 -- .../SearchIndexerDataSourceConverter.java | 2 -- .../SearchIndexerDataSourceTypeConverter.java | 2 -- .../SearchIndexerErrorConverter.java | 2 -- .../SearchIndexerLimitsConverter.java | 2 -- .../SearchIndexerSkillsetConverter.java | 2 -- .../SearchIndexerStatusConverter.java | 2 -- .../SearchIndexerWarningConverter.java | 2 -- .../SearchResourceEncryptionKeyConverter.java | 2 -- .../converters/SearchResultConverter.java | 2 -- .../converters/SentimentSkillConverter.java | 2 -- .../converters/ServiceCountersConverter.java | 2 -- .../converters/ServiceLimitsConverter.java | 2 -- .../ServiceStatisticsConverter.java | 2 -- .../converters/ShaperSkillConverter.java | 2 -- .../ShingleTokenFilterConverter.java | 2 -- .../converters/SimilarityConverter.java | 2 -- .../SnowballTokenFilterConverter.java | 2 -- ...olumnDeletionDetectionPolicyConverter.java | 2 -- .../converters/SplitSkillConverter.java | 2 -- .../SplitSkillLanguageConverter.java | 2 -- ...tegratedChangeTrackingPolicyConverter.java | 2 -- .../StemmerOverrideTokenFilterConverter.java | 2 -- .../StemmerTokenFilterConverter.java | 2 -- .../converters/StopAnalyzerConverter.java | 2 -- .../StopwordsTokenFilterConverter.java | 2 -- .../converters/SuggestOptionsConverter.java | 2 -- .../converters/SuggestResultConverter.java | 2 -- .../converters/SuggesterConverter.java | 2 -- .../converters/SynonymMapConverter.java | 2 -- .../SynonymTokenFilterConverter.java | 2 -- .../TagScoringFunctionConverter.java | 2 -- .../TagScoringParametersConverter.java | 2 -- .../TextTranslationSkillConverter.java | 2 -- ...TextTranslationSkillLanguageConverter.java | 2 -- .../converters/TextWeightsConverter.java | 2 -- .../converters/TokenFilterNameConverter.java | 2 -- .../TruncateTokenFilterConverter.java | 2 -- .../UaxUrlEmailTokenizerConverter.java | 2 -- .../UniqueTokenFilterConverter.java | 2 -- .../util/PrivateFieldAccessHelper.java | 36 +++++++++++-------- 112 files changed, 22 insertions(+), 267 deletions(-) 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 index 695de314ad42..60c62817fb91 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link CommonGramTokenFilter}. */ public final class CommonGramTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.CommonGramTokenFilter} to * {@link 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 index effd24d39a4a..7098a6dc9682 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -16,8 +15,6 @@ * {@link ConditionalSkill}. */ public final class ConditionalSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ConditionalSkill} to {@link ConditionalSkill}. */ 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 index 0fbb9d5ce9d1..192c6f09fda5 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.CorsOptions} and {@link CorsOptions}. */ public final class CorsOptionsConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.CorsOptions} to {@link 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 index ddba77a6e8d1..f5b3576100b0 100644 --- 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 @@ -16,7 +16,6 @@ * {@link CustomAnalyzer}. */ public final class CustomAnalyzerConverter { - /** * Maps from {@link com.azure.search.documents.implementation.models.CustomAnalyzer} to {@link CustomAnalyzer}. */ 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 index 02095ec19514..178632807c02 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.DataSourceCredentials; /** @@ -11,8 +10,6 @@ * {@link DataSourceCredentials}. */ public final class DataSourceCredentialsConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.DataSourceCredentials} to * {@link 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 index e74bb87a7c45..e30d02c41531 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.DefaultCognitiveServicesAccount; /** @@ -11,8 +10,6 @@ * {@link DefaultCognitiveServicesAccount}. */ public final class DefaultCognitiveServicesAccountConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount} to * {@link 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 index 52e009536c4c..c97c68bf9328 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link DictionaryDecompounderTokenFilter}. */ public final class DictionaryDecompounderTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter} to * {@link 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 index 1cb9816229f7..5408769df04b 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -13,8 +12,6 @@ * {@link DistanceScoringFunction}. */ public final class DistanceScoringFunctionConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.DistanceScoringFunction} to * {@link 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 index b411ef26a665..03c258253340 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.DistanceScoringParameters; /** @@ -11,8 +10,6 @@ * {@link DistanceScoringParameters}. */ public final class DistanceScoringParametersConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.DistanceScoringParameters} to * {@link 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 index eac3fa26ac82..85a75dec8b71 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -12,8 +11,6 @@ * {@link EdgeNGramTokenFilter}. */ public final class EdgeNGramTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilter} to * {@link EdgeNGramTokenFilter}. 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 index 9b05070e4d33..f0e2c4af6f35 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -12,8 +11,6 @@ * {@link EdgeNGramTokenFilterV2}. */ public final class EdgeNGramTokenFilterV2Converter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2} to * {@link 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 index 076fd2d809cb..a18ec028c820 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -15,8 +14,6 @@ * {@link EdgeNGramTokenizer}. */ public final class EdgeNGramTokenizerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.EdgeNGramTokenizer} to * {@link 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 index 9ab533beaa42..f38fb3a47221 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link ElisionTokenFilter}. */ public final class ElisionTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ElisionTokenFilter} to * {@link ElisionTokenFilter}. 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 index 4200a13578d5..68e59e1e8a15 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -18,8 +17,6 @@ * {@link EntityRecognitionSkill}. */ public final class EntityRecognitionSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.EntityRecognitionSkill} to * {@link 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 index 46f5ed0eda2b..17787d2cb9bd 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.EntityRecognitionSkillLanguage; /** @@ -11,8 +10,6 @@ * {@link EntityRecognitionSkillLanguage}. */ public final class EntityRecognitionSkillLanguageConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage} to enum * {@link EntityRecognitionSkillLanguage}. 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 index 57f505aeb5a4..1d7731bb9e2d 100644 --- 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 @@ -13,7 +13,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.FacetResult} and {@link FacetResult}. */ public final class FacetResultConverter { - /** * Maps from {@link com.azure.search.documents.implementation.models.FacetResult} to {@link 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 index 142873d9efb4..a381b513ceec 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -11,8 +10,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.FieldMapping} and {@link FieldMapping}. */ public final class FieldMappingConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.FieldMapping} to {@link 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 index 20771d1916f0..3549a4556ebf 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link FieldMappingFunction}. */ public final class FieldMappingFunctionConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.FieldMappingFunction} to * {@link 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 index 4c8885e125fd..81a1e3bde2a3 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -13,8 +12,6 @@ * {@link FreshnessScoringFunction}. */ public final class FreshnessScoringFunctionConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.FreshnessScoringFunction} to * {@link 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 index ea747db39625..9a8aec27dd04 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -13,8 +12,6 @@ * {@link FreshnessScoringParameters}. */ public final class FreshnessScoringParametersConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.FreshnessScoringParameters} to * {@link 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 index 9119cae74df8..9886444522f7 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -12,8 +11,6 @@ * {@link GetIndexStatisticsResult}. */ public final class GetIndexStatisticsResultConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.GetIndexStatisticsResult} to * {@link 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 index 4d8405676dda..bb21700c3cee 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.HighWaterMarkChangeDetectionPolicy; /** @@ -11,8 +10,6 @@ * and {@link HighWaterMarkChangeDetectionPolicy}. */ public final class HighWaterMarkChangeDetectionPolicyConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy} to * {@link 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 index c3a713d652c0..381cf015ece3 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -19,8 +18,6 @@ * {@link ImageAnalysisSkill}. */ public final class ImageAnalysisSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ImageAnalysisSkill} to * {@link 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 index c7c789e311b6..76d7045bb38d 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.ImageAnalysisSkillLanguage; /** @@ -11,8 +10,6 @@ * {@link ImageAnalysisSkillLanguage}. */ public final class ImageAnalysisSkillLanguageConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage} to enum * {@link ImageAnalysisSkillLanguage}. 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 index 6691c6e55116..7d3d47abc128 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -17,8 +16,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.IndexAction} and {@link IndexAction}. */ public final class IndexActionConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.IndexAction} to {@link IndexAction}. */ 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 index 8bd716f1b13b..f0729181b99f 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -16,8 +15,6 @@ * {@link IndexBatchBase}. */ public final class IndexBatchBaseConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.IndexBatch} to {@link IndexBatchBase}. */ 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 index f78c1187697f..0642d5e5351a 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -16,8 +15,6 @@ * {@link IndexDocumentsResult}. */ public final class IndexDocumentsResultConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.IndexDocumentsResult} to * {@link IndexDocumentsResult}. 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 index 1e7ceeaa4022..8030b8d6be23 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link IndexingParameters}. */ public final class IndexingParametersConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.IndexingParameters} to * {@link 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 index eb121430736e..092a8cdb29b7 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -12,8 +11,6 @@ * {@link IndexingResult}. */ public final class IndexingResultConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.IndexingResult} to {@link 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 index c17d45755b2b..6b3f04d109cd 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link IndexingSchedule}. */ public final class IndexingScheduleConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.IndexingSchedule} to {@link 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 index 0119acff5e64..cbc86ac55a9d 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link InputFieldMappingEntry}. */ public final class InputFieldMappingEntryConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.InputFieldMappingEntry} to * {@link 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 index 16f1b439322d..97f6759e9a29 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link KeepTokenFilter}. */ public final class KeepTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.KeepTokenFilter} to {@link 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 index 03263490531b..c57391543b79 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -17,8 +16,6 @@ * {@link KeyPhraseExtractionSkill}. */ public final class KeyPhraseExtractionSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill} to * {@link 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 index 6bb808e0247a..fffd0ab15d38 100644 --- 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 @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.core.util.logging.ClientLogger; import com.azure.search.documents.models.KeyPhraseExtractionSkillLanguage; /** @@ -11,8 +10,6 @@ * {@link KeyPhraseExtractionSkillLanguage}. */ public final class KeyPhraseExtractionSkillLanguageConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage} to enum * {@link KeyPhraseExtractionSkillLanguage}. 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 index 31585d5258ef..28a93042bb60 100644 --- 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 @@ -3,7 +3,6 @@ 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; @@ -14,8 +13,6 @@ * {@link KeywordMarkerTokenFilter}. */ public final class KeywordMarkerTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter} to * {@link 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 index 66f927083bb9..f088e1cda027 100644 --- 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 @@ -11,8 +11,6 @@ * {@link KeywordTokenizer}. */ public final class KeywordTokenizerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.KeywordTokenizer} to {@link 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 index 69eddec4dc49..5728245afa94 100644 --- 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 @@ -11,8 +11,6 @@ * {@link KeywordTokenizerV2}. */ public final class KeywordTokenizerV2Converter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.KeywordTokenizerV2} to * {@link 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 index 4f3bb26ef766..2ab166456d48 100644 --- 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 @@ -16,8 +16,6 @@ * {@link LanguageDetectionSkill}. */ public final class LanguageDetectionSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.LanguageDetectionSkill} to * {@link 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 index d711e38b2be7..98d36f6c065f 100644 --- 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 @@ -11,8 +11,6 @@ * {@link LengthTokenFilter}. */ public final class LengthTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.LengthTokenFilter} to * {@link LengthTokenFilter}. 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 index fad92c53e26d..537ee87d5caa 100644 --- 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 @@ -11,8 +11,6 @@ * {@link LexicalAnalyzerName}. */ public final class LexicalAnalyzerNameConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.LexicalAnalyzerName} to enum * {@link LexicalAnalyzerName}. 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 index c0cdbcf23db9..39f3c8e7458f 100644 --- 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 @@ -11,8 +11,6 @@ * {@link LexicalTokenizerName}. */ public final class LexicalTokenizerNameConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.LexicalTokenizerName} to enum * {@link LexicalTokenizerName}. 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 index f9bad49a3521..bb0663992ef1 100644 --- 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 @@ -11,8 +11,6 @@ * {@link LimitTokenFilter}. */ public final class LimitTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.LimitTokenFilter} to {@link 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 index 99aff7225f1d..72d18bb9313c 100644 --- 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 @@ -14,8 +14,6 @@ * {@link LuceneStandardAnalyzer}. */ public final class LuceneStandardAnalyzerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.LuceneStandardAnalyzer} to * {@link 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 index 67cd616588c7..6c722e6eac6d 100644 --- 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 @@ -11,8 +11,6 @@ * {@link LuceneStandardTokenizer}. */ public final class LuceneStandardTokenizerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.LuceneStandardTokenizer} to * {@link 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 index 24163cff2b37..6eff54846bd9 100644 --- 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 @@ -11,8 +11,6 @@ * {@link LuceneStandardTokenizerV2}. */ public final class LuceneStandardTokenizerV2Converter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2} to * {@link 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 index f9b43eba3446..9b498ecd7761 100644 --- 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 @@ -13,8 +13,6 @@ * {@link MagnitudeScoringFunction}. */ public final class MagnitudeScoringFunctionConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.MagnitudeScoringFunction} to * {@link 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 index 4e341c52dc79..aa1c4e1c69c9 100644 --- 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 @@ -11,8 +11,6 @@ * {@link MagnitudeScoringParameters}. */ public final class MagnitudeScoringParametersConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.MagnitudeScoringParameters} to * {@link 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 index 677620712346..155ead789085 100644 --- 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 @@ -14,8 +14,6 @@ * {@link MappingCharFilter}. */ public final class MappingCharFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.MappingCharFilter} to * {@link 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 index e253081dd0aa..ab04445fcc35 100644 --- 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 @@ -15,8 +15,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.MergeSkill} and {@link MergeSkill}. */ public final class MergeSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.MergeSkill} to {@link 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 index c920c17de420..15c356ca95da 100644 --- 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 @@ -12,8 +12,6 @@ * and {@link MicrosoftLanguageStemmingTokenizer}. */ public final class MicrosoftLanguageStemmingTokenizerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer} to * {@link 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 index cf00509686f5..fb3d0bbd731a 100644 --- 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 @@ -12,8 +12,6 @@ * {@link MicrosoftLanguageTokenizer}. */ public final class MicrosoftLanguageTokenizerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer} to * {@link MicrosoftLanguageTokenizer}. 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 index 7dfbfecd7910..17568d73d119 100644 --- 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 @@ -11,8 +11,6 @@ * {@link NGramTokenFilter}. */ public final class NGramTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.NGramTokenFilter} to {@link 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 index 17ae363dd4eb..dc02cb37121d 100644 --- 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 @@ -11,8 +11,6 @@ * {@link NGramTokenFilterV2}. */ public final class NGramTokenFilterV2Converter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.NGramTokenFilterV2} to * {@link 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 index 6281e8473e2c..2c1d25e0b776 100644 --- 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 @@ -15,8 +15,6 @@ * {@link NGramTokenizer}. */ public final class NGramTokenizerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.NGramTokenizer} to {@link 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 index d1b020011aab..69ddbe4e479d 100644 --- 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 @@ -17,8 +17,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.OcrSkill} and {@link OcrSkill}. */ public final class OcrSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.OcrSkill} to {@link 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 index fab6e3b99f71..808c8ac08ed7 100644 --- 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 @@ -11,8 +11,6 @@ * {@link OcrSkillLanguage}. */ public final class OcrSkillLanguageConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.OcrSkillLanguage} to enum * {@link OcrSkillLanguage}. 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 index 75aa7afc4b07..87bf52c09ce9 100644 --- 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 @@ -11,8 +11,6 @@ * {@link OutputFieldMappingEntry}. */ public final class OutputFieldMappingEntryConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.OutputFieldMappingEntry} to * {@link 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 index 5e4b13118931..99f42725d39e 100644 --- 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 @@ -11,8 +11,6 @@ * {@link PathHierarchyTokenizerV2}. */ public final class PathHierarchyTokenizerV2Converter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2} to * {@link 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 index 8152bfa9e234..fc03fe5e3664 100644 --- 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 @@ -17,8 +17,6 @@ * {@link PatternAnalyzer}. */ public final class PatternAnalyzerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.PatternAnalyzer} to {@link 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 index 1457fb1fad5e..78697d638d1b 100644 --- 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 @@ -14,8 +14,6 @@ * {@link PatternCaptureTokenFilter}. */ public final class PatternCaptureTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.PatternCaptureTokenFilter} to * {@link 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 index 9903853399d8..7fdd5ddbd08c 100644 --- 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 @@ -11,8 +11,6 @@ * {@link PatternReplaceCharFilter}. */ public final class PatternReplaceCharFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.PatternReplaceCharFilter} to * {@link 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 index 49b79ae5569b..23d5af09d573 100644 --- 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 @@ -11,8 +11,6 @@ * {@link PatternReplaceTokenFilter}. */ public final class PatternReplaceTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.PatternReplaceTokenFilter} to * {@link 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 index 107c2906aa32..f03ac0a3adae 100644 --- 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 @@ -16,8 +16,6 @@ * {@link PatternTokenizer}. */ public final class PatternTokenizerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.PatternTokenizer} to {@link PatternTokenizer}. */ 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 index 8894e33bc0fb..bec939e0beed 100644 --- 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 @@ -12,8 +12,6 @@ * {@link PhoneticTokenFilter}. */ public final class PhoneticTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.PhoneticTokenFilter} to * {@link PhoneticTokenFilter}. 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 index cac485cf2c48..37709a3fef73 100644 --- 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 @@ -10,8 +10,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.RegexFlags} and {@link RegexFlags}. */ public final class RegexFlagsConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.RegexFlags} to enum {@link RegexFlags}. */ 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 index 4950b26595e5..0cd32ed15b77 100644 --- 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 @@ -13,8 +13,6 @@ * {@link RequestOptions}. */ public final class RequestOptionsConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.RequestOptions} to {@link 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 index 3348fcbc05e4..c425a9369745 100644 --- 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 @@ -11,8 +11,6 @@ * {@link ResourceCounter}. */ public final class ResourceCounterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ResourceCounter} to {@link ResourceCounter}. */ 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 index d7f8e3a654e2..cdf5491aaec3 100644 --- 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 @@ -17,8 +17,6 @@ * {@link ScoringProfile}. */ public final class ScoringProfileConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ScoringProfile} to {@link ScoringProfile}. */ 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 index d679f15b1257..55c705cbdd7a 100644 --- 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 @@ -11,8 +11,6 @@ * {@link SearchFieldDataType}. */ public final class SearchFieldDataTypeConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.SearchFieldDataType} to enum * {@link SearchFieldDataType}. 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 index d8cf2ec1882b..5b90fb9934e7 100644 --- 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 @@ -23,8 +23,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndex} and {@link SearchIndex}. */ public final class SearchIndexConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndex} to {@link 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 index 0e1834455e3e..cd4bf1d89da1 100644 --- 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 @@ -16,8 +16,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexer} and {@link SearchIndexer}. */ public final class SearchIndexerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexer} to {@link 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 index 85669dbc86cf..67df90dbbeab 100644 --- 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 @@ -11,8 +11,6 @@ * {@link SearchIndexerDataContainer}. */ public final class SearchIndexerDataContainerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerDataContainer} to * {@link 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 index 36f43bc83227..3fa40ec10080 100644 --- 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 @@ -16,8 +16,6 @@ * {@link SearchIndexerDataSource}. */ public final class SearchIndexerDataSourceConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerDataSource} to * {@link 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 index bca135db9758..d3952d56d6ad 100644 --- 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 @@ -11,8 +11,6 @@ * {@link SearchIndexerDataSourceType}. */ public final class SearchIndexerDataSourceTypeConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.SearchIndexerDataSourceType} to enum * {@link SearchIndexerDataSourceType}. 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 index df5dc223fb61..24feba3c214e 100644 --- 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 @@ -12,8 +12,6 @@ * {@link SearchIndexerError}. */ public final class SearchIndexerErrorConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerError} to * {@link 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 index 8f38445f6ceb..ff7a615dffdd 100644 --- 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 @@ -14,8 +14,6 @@ * {@link SearchIndexerLimits}. */ public final class SearchIndexerLimitsConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerLimits} to * {@link SearchIndexerLimits}. 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 index edcaf7d91779..b9ac69480300 100644 --- 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 @@ -16,8 +16,6 @@ * {@link SearchIndexerSkillset}. */ public final class SearchIndexerSkillsetConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerSkillset} to * {@link 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 index fd1c08b9bab1..fe22ba56909a 100644 --- 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 @@ -18,8 +18,6 @@ * {@link SearchIndexerStatus}. */ public final class SearchIndexerStatusConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerStatus} to * {@link 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 index 541fed16ad2c..6cda82db8db7 100644 --- 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 @@ -12,8 +12,6 @@ * {@link SearchIndexerWarning}. */ public final class SearchIndexerWarningConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerWarning} to * {@link SearchIndexerWarning}. 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 index fda1f0cc378c..b430069f93de 100644 --- 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 @@ -12,8 +12,6 @@ * {@link SearchResourceEncryptionKey}. */ public final class SearchResourceEncryptionKeyConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchResourceEncryptionKey} to * {@link 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 index d4ae28d39b3d..d7cf5e3aea30 100644 --- 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 @@ -16,8 +16,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.SearchResult} and {@link SearchResult}. */ public final class SearchResultConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SearchResult} to {@link 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 index 5fcb0d6f557b..9c89afa3ecc9 100644 --- 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 @@ -17,8 +17,6 @@ * {@link SentimentSkill}. */ public final class SentimentSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SentimentSkill} to {@link SentimentSkill}. */ 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 index 41684dc9eedb..439b99d15c64 100644 --- 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 @@ -12,8 +12,6 @@ * {@link ServiceCounters}. */ public final class ServiceCountersConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ServiceCounters} to {@link 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 index 738a59117383..3da4f01d97a2 100644 --- 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 @@ -10,8 +10,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.ServiceLimits} and {@link ServiceLimits}. */ public final class ServiceLimitsConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ServiceLimits} to {@link 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 index 3848103f9f22..1008cacaecf3 100644 --- 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 @@ -13,8 +13,6 @@ * {@link ServiceStatistics}. */ public final class ServiceStatisticsConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ServiceStatistics} to * {@link 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 index b9347eb1d0f2..e123f4a70a04 100644 --- 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 @@ -15,8 +15,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.ShaperSkill} and {@link ShaperSkill}. */ public final class ShaperSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ShaperSkill} to {@link 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 index 2bebc7b5bd64..ee5465f9a1d9 100644 --- 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 @@ -11,8 +11,6 @@ * {@link ShingleTokenFilter}. */ public final class ShingleTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.ShingleTokenFilter} to * {@link 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 index f12bd960088d..aae96ea06637 100644 --- 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 @@ -10,8 +10,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.Similarity} and {@link Similarity}. */ public final class SimilarityConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.Similarity} to {@link 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 index 1ff3a28af5fb..2eb7d6a8e86c 100644 --- 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 @@ -12,8 +12,6 @@ * {@link SnowballTokenFilter}. */ public final class SnowballTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SnowballTokenFilter} to * {@link SnowballTokenFilter}. 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 index 0e3c79f3b22e..7d63c488a645 100644 --- 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 @@ -12,8 +12,6 @@ * {@link SoftDeleteColumnDeletionDetectionPolicy}. */ public final class SoftDeleteColumnDeletionDetectionPolicyConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy} to * {@link 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 index 5a5cc5008706..fa7d685f2cb5 100644 --- 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 @@ -17,8 +17,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.SplitSkill} and {@link SplitSkill}. */ public final class SplitSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SplitSkill} to {@link 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 index 1cf68b9fc1d6..b9d51bbab624 100644 --- 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 @@ -11,8 +11,6 @@ * {@link SplitSkillLanguage}. */ public final class SplitSkillLanguageConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.SplitSkillLanguage} to enum * {@link SplitSkillLanguage}. 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 index c477a4ac6776..ea54416489f8 100644 --- 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 @@ -11,8 +11,6 @@ * {@link SqlIntegratedChangeTrackingPolicy}. */ public final class SqlIntegratedChangeTrackingPolicyConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy} to * {@link 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 index 31f8e65a8587..7bbd06f6a1cb 100644 --- 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 @@ -14,8 +14,6 @@ * {@link StemmerOverrideTokenFilter}. */ public final class StemmerOverrideTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter} to * {@link 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 index c25eb98282b3..732c8365fd6a 100644 --- 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 @@ -12,8 +12,6 @@ * {@link StemmerTokenFilter}. */ public final class StemmerTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.StemmerTokenFilter} to * {@link StemmerTokenFilter}. 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 index 83e9f68040d2..1b123e2e4976 100644 --- 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 @@ -13,8 +13,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.StopAnalyzer} and {@link StopAnalyzer}. */ public final class StopAnalyzerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.StopAnalyzer} to {@link StopAnalyzer}. */ 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 index 3c51df76340e..1bc45571d59e 100644 --- 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 @@ -15,8 +15,6 @@ * {@link StopwordsTokenFilter}. */ public final class StopwordsTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.StopwordsTokenFilter} to * {@link 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 index e4838cebe83e..fb7133309164 100644 --- 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 @@ -15,8 +15,6 @@ * {@link SuggestOptions}. */ public final class SuggestOptionsConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SuggestOptions} to {@link 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 index 8bb92c6e9fa1..14634694c73a 100644 --- 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 @@ -14,8 +14,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.SuggestResult} and {@link SuggestResult}. */ public final class SuggestResultConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SuggestResult} to {@link 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 index a845d8dec58b..996723a807fb 100644 --- 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 @@ -14,8 +14,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.Suggester} and {@link Suggester}. */ public final class SuggesterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.Suggester} to {@link 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 index cfb5028f51ce..7de75903f26e 100644 --- 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 @@ -12,8 +12,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.SynonymMap} and {@link SynonymMap}. */ public final class SynonymMapConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SynonymMap} to {@link 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 index ea689c578307..dc0a2f343061 100644 --- 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 @@ -14,8 +14,6 @@ * {@link SynonymTokenFilter}. */ public final class SynonymTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.SynonymTokenFilter} to * {@link 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 index 5023c7c6ece7..2a31c0145c63 100644 --- 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 @@ -13,8 +13,6 @@ * {@link TagScoringFunction}. */ public final class TagScoringFunctionConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.TagScoringFunction} to * {@link 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 index c17e3598b54e..6087505ffa39 100644 --- 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 @@ -11,8 +11,6 @@ * {@link TagScoringParameters}. */ public final class TagScoringParametersConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.TagScoringParameters} to * {@link TagScoringParameters}. 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 index 695e6bb72f4c..9e3493d51df6 100644 --- 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 @@ -17,8 +17,6 @@ * {@link TextTranslationSkill}. */ public final class TextTranslationSkillConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.TextTranslationSkill} to * {@link 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 index 04df83648e49..16cf0706adf0 100644 --- 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 @@ -11,8 +11,6 @@ * {@link TextTranslationSkillLanguage}. */ public final class TextTranslationSkillLanguageConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.TextTranslationSkillLanguage} to enum * {@link TextTranslationSkillLanguage}. 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 index 62fafce48f2e..e88cd2ee044a 100644 --- 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 @@ -13,8 +13,6 @@ * A converter between {@link com.azure.search.documents.implementation.models.TextWeights} and {@link TextWeights}. */ public final class TextWeightsConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.TextWeights} to {@link TextWeights}. */ 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 index 5e6c7d7372d7..22d6d50e098e 100644 --- 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 @@ -11,8 +11,6 @@ * {@link TokenFilterName}. */ public final class TokenFilterNameConverter { - - /** * Maps from enum {@link com.azure.search.documents.implementation.models.TokenFilterName} to enum * {@link TokenFilterName}. 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 index 4bd03a1445f9..036f0f1963f9 100644 --- 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 @@ -11,8 +11,6 @@ * {@link TruncateTokenFilter}. */ public final class TruncateTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.TruncateTokenFilter} to * {@link 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 index cc2065d62bec..bd64b6349f6e 100644 --- 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 @@ -11,8 +11,6 @@ * {@link UaxUrlEmailTokenizer}. */ public final class UaxUrlEmailTokenizerConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer} to * {@link 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 index c7c8417bda4c..4630d17ed310 100644 --- 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 @@ -11,8 +11,6 @@ * {@link UniqueTokenFilter}. */ public final class UniqueTokenFilterConverter { - - /** * Maps from {@link com.azure.search.documents.implementation.models.UniqueTokenFilter} to * {@link UniqueTokenFilter}. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java index de2261b392c7..8bd6fafa46f1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java @@ -27,13 +27,17 @@ public class PrivateFieldAccessHelper { public static void set(T obj, String fieldName, Object value) { try { Field f1 = obj.getClass().getDeclaredField(fieldName); - AccessController.doPrivileged(new PrivilegedAction() { - @Override - public T run() { - f1.setAccessible(true); - return null; - } - }); + if (f1.canAccess(obj)) { + f1.setAccessible(true); + } else { + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public T run() { + f1.setAccessible(true); + return null; + } + }); + } f1.set(obj, value); } catch (NoSuchFieldException | IllegalAccessException e) { throw LOGGER.logExceptionAsError(new RuntimeException(e)); @@ -55,13 +59,17 @@ public static I get(T obj, String fieldName, Class outputClass) { try { Field f1 = obj.getClass().getDeclaredField(fieldName); - AccessController.doPrivileged(new PrivilegedAction() { - @Override - public T run() { - f1.setAccessible(true); - return null; - } - }); + if (f1.canAccess(obj)) { + f1.setAccessible(true); + } else { + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public T run() { + f1.setAccessible(true); + return null; + } + }); + } return (I) f1.get(obj); } catch (NoSuchFieldException | IllegalAccessException e) { throw LOGGER.logExceptionAsError(new RuntimeException(e)); From 2642c0b00b83b0efcd0310f00a015087b6edb5fe Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Tue, 26 May 2020 10:09:43 -0700 Subject: [PATCH 18/19] remove message check and check on status code. --- .../implementation/util/DocumentResponseConversions.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java index 727f51beb53e..b1718bf7f32e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/DocumentResponseConversions.java @@ -12,12 +12,6 @@ * Utility class for Document Response conversions. */ public final class DocumentResponseConversions { - - /* - * Exception message to check for before mapping to document not found. - */ - private static final String EMPTY_BODY_404 = "Status code 404, (empty body)"; - /* * Exception message to use if the document isn't found. */ @@ -36,7 +30,7 @@ public static Throwable exceptionMapper(Throwable throwable) { } SearchErrorException exception = (SearchErrorException) throwable; - if (EMPTY_BODY_404.equalsIgnoreCase(throwable.getMessage())) { + if (exception.getResponse().getStatusCode() == 404) { return new ResourceNotFoundException(DOCUMENT_NOT_FOUND, exception.getResponse()); } return new HttpResponseException(exception.getMessage(), exception.getResponse()); From a28a9156ea849bf9a02432af4ee2e4a1981be31e Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Tue, 26 May 2020 10:49:06 -0700 Subject: [PATCH 19/19] change java 8 compitable isAccessible --- .../util/PrivateFieldAccessHelper.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java index 8bd6fafa46f1..5a215655fb13 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/PrivateFieldAccessHelper.java @@ -26,19 +26,17 @@ public class PrivateFieldAccessHelper { @SuppressWarnings("unchecked") public static void set(T obj, String fieldName, Object value) { try { - Field f1 = obj.getClass().getDeclaredField(fieldName); - if (f1.canAccess(obj)) { - f1.setAccessible(true); - } else { + Field field = obj.getClass().getDeclaredField(fieldName); + if (!field.isAccessible()) { AccessController.doPrivileged(new PrivilegedAction() { @Override public T run() { - f1.setAccessible(true); + field.setAccessible(true); return null; } }); } - f1.set(obj, value); + field.set(obj, value); } catch (NoSuchFieldException | IllegalAccessException e) { throw LOGGER.logExceptionAsError(new RuntimeException(e)); } @@ -58,19 +56,17 @@ public T run() { public static I get(T obj, String fieldName, Class outputClass) { try { - Field f1 = obj.getClass().getDeclaredField(fieldName); - if (f1.canAccess(obj)) { - f1.setAccessible(true); - } else { + Field field = obj.getClass().getDeclaredField(fieldName); + if (!field.isAccessible()) { AccessController.doPrivileged(new PrivilegedAction() { @Override public T run() { - f1.setAccessible(true); + field.setAccessible(true); return null; } }); } - return (I) f1.get(obj); + return (I) field.get(obj); } catch (NoSuchFieldException | IllegalAccessException e) { throw LOGGER.logExceptionAsError(new RuntimeException(e)); }