From 9c641bf69f6d97eae3c7008435417dd22b29a464 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Fri, 16 Feb 2018 17:19:23 -0800 Subject: [PATCH 1/6] [Azure Search] Upgrade data plane to the latest version of AutoRest --- .../DocumentsProxyOperations.cs | 20 +- .../IDocumentsProxyOperations.cs | 8 +- .../ISearchIndexClient.cs | 12 +- .../Models/DocumentIndexResult.cs | 18 +- .../Models/IndexActionType.cs | 46 +++- .../Models/IndexingResult.cs | 24 +- .../GeneratedSearchIndex/Models/QueryType.cs | 38 ++- .../GeneratedSearchIndex/Models/SearchMode.cs | 38 ++- .../Models/SearchParametersPayload.cs | 16 +- .../Models/SuggestParametersPayload.cs | 16 +- .../SdkInfo_SearchIndexClient.cs | 18 ++ .../GeneratedSearchIndex/SearchIndexClient.cs | 30 +-- .../DataSourcesOperations.cs | 84 +++--- .../DataSourcesOperationsExtensions.cs | 10 +- .../IDataSourcesOperations.cs | 8 +- .../IIndexersOperations.cs | 8 +- .../IIndexesOperations.cs | 8 +- .../ISearchServiceClient.cs | 12 +- .../ISynonymMapsOperations.cs | 8 +- .../IndexersOperations.cs | 148 +++++++---- .../IndexersOperationsExtensions.cs | 14 +- .../IndexesOperations.cs | 110 ++++---- .../IndexesOperationsExtensions.cs | 10 +- .../Models/AccessCondition.cs | 20 +- .../Models/AnalyzeRequest.cs | 18 +- .../Models/AnalyzeResult.cs | 16 +- .../GeneratedSearchService/Models/Analyzer.cs | 18 +- .../Models/AsciiFoldingTokenFilter.cs | 20 +- .../Models/CharFilter.cs | 22 +- .../Models/CjkBigramTokenFilter.cs | 20 +- .../Models/CjkBigramTokenFilterScripts.cs | 46 +++- .../Models/ClassicTokenizer.cs | 22 +- .../Models/CommonGramTokenFilter.cs | 22 +- .../Models/CorsOptions.cs | 22 +- .../Models/CustomAnalyzer.cs | 18 +- .../Models/DataChangeDetectionPolicy.cs | 15 +- .../Models/DataContainer.cs | 18 +- .../Models/DataDeletionDetectionPolicy.cs | 15 +- .../Models/DataSource.cs | 18 +- .../Models/DataSourceCredentials.cs | 18 +- .../Models/DataSourceListResult.cs | 18 +- .../DictionaryDecompounderTokenFilter.cs | 22 +- .../Models/DistanceScoringFunction.cs | 22 +- .../Models/DistanceScoringParameters.cs | 18 +- .../Models/EdgeNGramTokenFilterSide.cs | 38 ++- .../Models/EdgeNGramTokenFilterV2.cs | 22 +- .../Models/EdgeNGramTokenizer.cs | 22 +- .../Models/ElisionTokenFilter.cs | 20 +- .../Models/FieldMapping.cs | 22 +- .../Models/FieldMappingFunction.cs | 22 +- .../Models/FreshnessScoringFunction.cs | 22 +- .../Models/FreshnessScoringParameters.cs | 16 +- .../HighWaterMarkChangeDetectionPolicy.cs | 18 +- .../GeneratedSearchService/Models/Index.cs | 18 +- .../Models/IndexGetStatisticsResult.cs | 20 +- .../Models/IndexListResult.cs | 18 +- .../GeneratedSearchService/Models/Indexer.cs | 22 +- .../Models/IndexerExecutionInfo.cs | 22 +- .../Models/IndexerExecutionResult.cs | 34 ++- .../Models/IndexerExecutionStatus.cs | 46 +++- .../Models/IndexerListResult.cs | 18 +- .../Models/IndexerStatus.cs | 42 ++- .../Models/IndexingSchedule.cs | 16 +- .../Models/ItemError.cs | 20 +- .../Models/KeepTokenFilter.cs | 22 +- .../Models/KeywordMarkerTokenFilter.cs | 22 +- .../Models/KeywordTokenizerV2.cs | 22 +- .../Models/LengthTokenFilter.cs | 22 +- .../Models/LimitTokenFilter.cs | 20 +- .../Models/MagnitudeScoringFunction.cs | 22 +- .../Models/MagnitudeScoringParameters.cs | 16 +- .../Models/MappingCharFilter.cs | 22 +- .../MicrosoftLanguageStemmingTokenizer.cs | 18 +- .../Models/MicrosoftLanguageTokenizer.cs | 18 +- .../MicrosoftStemmingTokenizerLanguage.cs | 210 ++++++++++++++- .../Models/MicrosoftTokenizerLanguage.cs | 198 +++++++++++++- .../Models/NGramTokenFilterV2.cs | 22 +- .../Models/NGramTokenizer.cs | 22 +- .../Models/PathHierarchyTokenizerV2.cs | 22 +- .../Models/PatternAnalyzer.cs | 20 +- .../Models/PatternCaptureTokenFilter.cs | 22 +- .../Models/PatternReplaceCharFilter.cs | 22 +- .../Models/PatternReplaceTokenFilter.cs | 22 +- .../Models/PatternTokenizer.cs | 20 +- .../Models/PhoneticEncoder.cs | 74 +++++- .../Models/PhoneticTokenFilter.cs | 20 +- .../Models/ScoringFunction.cs | 22 +- .../Models/ScoringFunctionAggregation.cs | 50 +++- .../Models/ScoringFunctionInterpolation.cs | 46 +++- .../Models/ScoringProfile.cs | 22 +- .../Models/SearchRequestOptions.cs | 18 +- .../Models/ShingleTokenFilter.cs | 22 +- .../Models/SnowballTokenFilter.cs | 20 +- .../Models/SnowballTokenFilterLanguage.cs | 118 ++++++++- ...SoftDeleteColumnDeletionDetectionPolicy.cs | 16 +- .../SqlIntegratedChangeTrackingPolicy.cs | 15 +- .../Models/StandardAnalyzer.cs | 22 +- .../Models/StandardTokenizerV2.cs | 22 +- .../Models/StemmerOverrideTokenFilter.cs | 22 +- .../Models/StemmerTokenFilter.cs | 20 +- .../Models/StemmerTokenFilterLanguage.cs | 246 +++++++++++++++++- .../Models/StopAnalyzer.cs | 20 +- .../Models/StopwordsList.cs | 154 ++++++++++- .../Models/StopwordsTokenFilter.cs | 20 +- .../Models/Suggester.cs | 18 +- .../Models/SynonymMap.cs | 18 +- .../Models/SynonymMapListResult.cs | 18 +- .../Models/SynonymTokenFilter.cs | 22 +- .../Models/TagScoringFunction.cs | 22 +- .../Models/TagScoringParameters.cs | 18 +- .../Models/TextWeights.cs | 18 +- .../Models/TokenCharacterKind.cs | 50 +++- .../Models/TokenFilter.cs | 22 +- .../Models/TokenInfo.cs | 24 +- .../Models/Tokenizer.cs | 22 +- .../Models/TruncateTokenFilter.cs | 22 +- .../Models/UaxUrlEmailTokenizer.cs | 22 +- .../Models/UniqueTokenFilter.cs | 20 +- .../Models/WordDelimiterTokenFilter.cs | 20 +- .../SdkInfo_SearchServiceClient.cs | 21 ++ .../SearchServiceClient.cs | 30 +-- .../SynonymMapsOperations.cs | 84 +++--- .../SynonymMapsOperationsExtensions.cs | 10 +- ...te-searchindexclient-from-private-spec.cmd | 13 + .../generate-searchindexclient.cmd | 9 +- ...-searchserviceclient-from-private-spec.cmd | 13 + .../generate-searchserviceclient.cmd | 9 +- ...ata-plane_Microsoft.Azure.Search.Index.txt | 10 + ...a-plane_Microsoft.Azure.Search.Service.txt | 10 + 129 files changed, 3091 insertions(+), 817 deletions(-) create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SdkInfo_SearchIndexClient.cs create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SdkInfo_SearchServiceClient.cs create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient-from-private-spec.cmd create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient-from-private-spec.cmd create mode 100644 src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Index.txt create mode 100644 src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/DocumentsProxyOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/DocumentsProxyOperations.cs index 93dfd8b43d85..b4e0e1889df0 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/DocumentsProxyOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/DocumentsProxyOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -127,9 +128,9 @@ internal DocumentsProxyOperations(SearchIndexClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -152,6 +153,8 @@ internal DocumentsProxyOperations(SearchIndexClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -199,7 +202,7 @@ internal DocumentsProxyOperations(SearchIndexClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -236,7 +239,7 @@ internal DocumentsProxyOperations(SearchIndexClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -255,4 +258,3 @@ internal DocumentsProxyOperations(SearchIndexClient client) } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/IDocumentsProxyOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/IDocumentsProxyOperations.cs index 5c7b154af7d6..273e7a40a616 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/IDocumentsProxyOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/IDocumentsProxyOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -47,4 +48,3 @@ internal partial interface IDocumentsProxyOperations Task> CountWithHttpMessagesAsync(SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/ISearchIndexClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/ISearchIndexClient.cs index 91c45a36d3fa..afa30c9600eb 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/ISearchIndexClient.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/ISearchIndexClient.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; @@ -27,12 +28,12 @@ public partial interface ISearchIndexClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. @@ -85,4 +86,3 @@ public partial interface ISearchIndexClient : System.IDisposable } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/DocumentIndexResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/DocumentIndexResult.cs index c4a680aafb7e..23c8aff8fce6 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/DocumentIndexResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/DocumentIndexResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +24,10 @@ public partial class DocumentIndexResult /// /// Initializes a new instance of the DocumentIndexResult class. /// - public DocumentIndexResult() { } + public DocumentIndexResult() + { + CustomInit(); + } /// /// Initializes a new instance of the DocumentIndexResult class. @@ -34,15 +37,20 @@ public DocumentIndexResult() { } public DocumentIndexResult(IList results = default(IList)) { Results = results; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the list of status information for each document in the /// indexing request. /// [JsonProperty(PropertyName = "value")] - public IList Results { get; protected set; } + public IList Results { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexActionType.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexActionType.cs index 33cf1ac9750c..751c20b73b7f 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexActionType.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexActionType.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for IndexActionType. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum IndexActionType { [EnumMember(Value = "upload")] @@ -30,5 +30,43 @@ public enum IndexActionType [EnumMember(Value = "delete")] Delete } -} + internal static class IndexActionTypeEnumExtension + { + internal static string ToSerializedValue(this IndexActionType? value) + { + return value == null ? null : ((IndexActionType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this IndexActionType value) + { + switch( value ) + { + case IndexActionType.Upload: + return "upload"; + case IndexActionType.Merge: + return "merge"; + case IndexActionType.MergeOrUpload: + return "mergeOrUpload"; + case IndexActionType.Delete: + return "delete"; + } + return null; + } + internal static IndexActionType? ParseIndexActionType(this string value) + { + switch( value ) + { + case "upload": + return IndexActionType.Upload; + case "merge": + return IndexActionType.Merge; + case "mergeOrUpload": + return IndexActionType.MergeOrUpload; + case "delete": + return IndexActionType.Delete; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexingResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexingResult.cs index a2cad7a806ed..983ecd37ce16 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexingResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexingResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,10 @@ public partial class IndexingResult /// /// Initializes a new instance of the IndexingResult class. /// - public IndexingResult() { } + public IndexingResult() + { + CustomInit(); + } /// /// Initializes a new instance of the IndexingResult class. @@ -45,27 +48,33 @@ public IndexingResult() { } ErrorMessage = errorMessage; Succeeded = succeeded; StatusCode = statusCode; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the key of a document that was in the indexing request. /// [JsonProperty(PropertyName = "key")] - public string Key { get; protected set; } + public string Key { get; private set; } /// /// Gets the error message explaining why the indexing operation failed /// for the document identified by the key; null if indexing succeeded. /// [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; protected set; } + public string ErrorMessage { get; private set; } /// /// Gets a value indicating whether the indexing operation succeeded /// for the document identified by the key. /// [JsonProperty(PropertyName = "status")] - public bool Succeeded { get; protected set; } + public bool Succeeded { get; private set; } /// /// Gets the status code of the indexing operation. Possible values @@ -76,8 +85,7 @@ public IndexingResult() { } /// busy. /// [JsonProperty(PropertyName = "statusCode")] - public int StatusCode { get; protected set; } + public int StatusCode { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/QueryType.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/QueryType.cs index 70df74dab4af..1de6c81bed3b 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/QueryType.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/QueryType.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for QueryType. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum QueryType { [EnumMember(Value = "simple")] @@ -26,5 +26,35 @@ public enum QueryType [EnumMember(Value = "full")] Full } -} + internal static class QueryTypeEnumExtension + { + internal static string ToSerializedValue(this QueryType? value) + { + return value == null ? null : ((QueryType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this QueryType value) + { + switch( value ) + { + case QueryType.Simple: + return "simple"; + case QueryType.Full: + return "full"; + } + return null; + } + internal static QueryType? ParseQueryType(this string value) + { + switch( value ) + { + case "simple": + return QueryType.Simple; + case "full": + return QueryType.Full; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchMode.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchMode.cs index adec5823e4f3..687abd3b7049 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchMode.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchMode.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for SearchMode. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum SearchMode { [EnumMember(Value = "any")] @@ -26,5 +26,35 @@ public enum SearchMode [EnumMember(Value = "all")] All } -} + internal static class SearchModeEnumExtension + { + internal static string ToSerializedValue(this SearchMode? value) + { + return value == null ? null : ((SearchMode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SearchMode value) + { + switch( value ) + { + case SearchMode.Any: + return "any"; + case SearchMode.All: + return "all"; + } + return null; + } + internal static SearchMode? ParseSearchMode(this string value) + { + switch( value ) + { + case "any": + return SearchMode.Any; + case "all": + return SearchMode.All; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchParametersPayload.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchParametersPayload.cs index 0e440fc532e4..26f9ae740ec4 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchParametersPayload.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchParametersPayload.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +24,10 @@ public partial class SearchParametersPayload /// /// Initializes a new instance of the SearchParametersPayload class. /// - public SearchParametersPayload() { } + public SearchParametersPayload() + { + CustomInit(); + } /// /// Initializes a new instance of the SearchParametersPayload class. @@ -115,8 +118,14 @@ public SearchParametersPayload() { } Select = select; Skip = skip; Top = top; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a value that specifies whether to fetch the total /// count of results. Default is false. Setting this value to true may @@ -266,4 +275,3 @@ public SearchParametersPayload() { } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SuggestParametersPayload.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SuggestParametersPayload.cs index 4ebeb44ba172..f755658f3d5e 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SuggestParametersPayload.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SuggestParametersPayload.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -22,7 +22,10 @@ public partial class SuggestParametersPayload /// /// Initializes a new instance of the SuggestParametersPayload class. /// - public SuggestParametersPayload() { } + public SuggestParametersPayload() + { + CustomInit(); + } /// /// Initializes a new instance of the SuggestParametersPayload class. @@ -80,8 +83,14 @@ public SuggestParametersPayload() { } Select = select; SuggesterName = suggesterName; Top = top; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the OData $filter expression to apply to the /// suggestions query. @@ -176,4 +185,3 @@ public SuggestParametersPayload() { } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SdkInfo_SearchIndexClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SdkInfo_SearchIndexClient.cs new file mode 100644 index 000000000000..6d3d395d495a --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SdkInfo_SearchIndexClient.cs @@ -0,0 +1,18 @@ + +using System; +using System.Collections.Generic; +using System.Linq; + +internal static partial class SdkInfo +{ + public static IEnumerable> ApiInfo_SearchIndexClient + { + get + { + return new Tuple[] + { + new Tuple("SearchIndexClient", "DocumentsProxy", "2016-09-01-Preview"), + }.AsEnumerable(); + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SearchIndexClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SearchIndexClient.cs index e4202b3fdc14..206d9289518d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SearchIndexClient.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SearchIndexClient.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,13 +6,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; using Models; using Newtonsoft.Json; using System.Collections; @@ -34,12 +35,12 @@ public partial class SearchIndexClient : ServiceClient, ISear /// /// Gets or sets json serialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + public JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + public JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. @@ -95,7 +96,7 @@ public partial class SearchIndexClient : ServiceClient, ISear /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SearchIndexClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + protected SearchIndexClient(params DelegatingHandler[] handlers) : base(handlers) { Initialize(); } @@ -109,7 +110,7 @@ protected SearchIndexClient(params System.Net.Http.DelegatingHandler[] handlers) /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SearchIndexClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected SearchIndexClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { Initialize(); } @@ -126,7 +127,7 @@ protected SearchIndexClient(System.Net.Http.HttpClientHandler rootHandler, param /// /// Thrown when a required parameter is null /// - public SearchIndexClient(ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public SearchIndexClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { @@ -154,7 +155,7 @@ public SearchIndexClient(ServiceClientCredentials credentials, params System.Net /// /// Thrown when a required parameter is null /// - public SearchIndexClient(ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public SearchIndexClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { @@ -183,7 +184,7 @@ private void Initialize() AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; - SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, @@ -191,19 +192,19 @@ private void Initialize() NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + Converters = new List { new Iso8601TimeSpanConverter() } }; - DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + Converters = new List { new Iso8601TimeSpanConverter() } @@ -213,4 +214,3 @@ private void Initialize() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperations.cs index 75e42078fe1c..696761b76091 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -161,9 +162,9 @@ internal DataSourcesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -210,6 +211,8 @@ internal DataSourcesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -227,7 +230,7 @@ internal DataSourcesOperations(SearchServiceClient client) if(dataSource != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dataSource, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -263,7 +266,7 @@ internal DataSourcesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -300,7 +303,7 @@ internal DataSourcesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -318,7 +321,7 @@ internal DataSourcesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -429,9 +432,9 @@ internal DataSourcesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -470,6 +473,8 @@ internal DataSourcesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -507,11 +512,19 @@ internal DataSourcesOperations(SearchServiceClient client) if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -627,9 +640,9 @@ internal DataSourcesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -652,6 +665,8 @@ internal DataSourcesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -699,7 +714,7 @@ internal DataSourcesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -736,7 +751,7 @@ internal DataSourcesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -826,9 +841,9 @@ internal DataSourcesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -851,6 +866,8 @@ internal DataSourcesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -898,7 +915,7 @@ internal DataSourcesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -935,7 +952,7 @@ internal DataSourcesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1037,9 +1054,9 @@ internal DataSourcesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1062,6 +1079,8 @@ internal DataSourcesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1079,7 +1098,7 @@ internal DataSourcesOperations(SearchServiceClient client) if(dataSource != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dataSource, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -1115,7 +1134,7 @@ internal DataSourcesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1152,7 +1171,7 @@ internal DataSourcesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1171,4 +1190,3 @@ internal DataSourcesOperations(SearchServiceClient client) } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperationsExtensions.cs index bcc7d8c110f2..fd51e771d6c2 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperationsExtensions.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperationsExtensions.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -118,7 +119,7 @@ public static partial class DataSourcesOperationsExtensions /// public static async Task DeleteAsync(this IDataSourcesOperations operations, string dataSourceName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(dataSourceName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(dataSourceName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -243,4 +244,3 @@ public static partial class DataSourcesOperationsExtensions } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IDataSourcesOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IDataSourcesOperations.cs index 51b5acc7881a..dcbb5f70bdfa 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IDataSourcesOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IDataSourcesOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -158,4 +159,3 @@ public partial interface IDataSourcesOperations Task> CreateWithHttpMessagesAsync(DataSource dataSource, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexersOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexersOperations.cs index a26817770cb5..6fb052dfca20 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexersOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexersOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -231,4 +232,3 @@ public partial interface IIndexersOperations Task> GetStatusWithHttpMessagesAsync(string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexesOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexesOperations.cs index 4e1b2aca2723..c53398d91ad5 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexesOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexesOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -227,4 +228,3 @@ public partial interface IIndexesOperations Task> AnalyzeWithHttpMessagesAsync(string indexName, AnalyzeRequest request, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISearchServiceClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISearchServiceClient.cs index 630d974c241e..a9f857b6aca0 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISearchServiceClient.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISearchServiceClient.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; @@ -27,12 +28,12 @@ public partial interface ISearchServiceClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. @@ -95,4 +96,3 @@ public partial interface ISearchServiceClient : System.IDisposable } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISynonymMapsOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISynonymMapsOperations.cs index ce38ec82bdf7..fdecff5bd526 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISynonymMapsOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISynonymMapsOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -158,4 +159,3 @@ public partial interface ISynonymMapsOperations Task> CreateWithHttpMessagesAsync(SynonymMap synonymMap, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperations.cs index c5071ff2a1ff..b0fc0dc6b6f5 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -128,9 +129,9 @@ internal IndexersOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -153,6 +154,8 @@ internal IndexersOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -190,11 +193,19 @@ internal IndexersOperations(SearchServiceClient client) if ((int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -307,9 +318,9 @@ internal IndexersOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -332,6 +343,8 @@ internal IndexersOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -369,11 +382,19 @@ internal IndexersOperations(SearchServiceClient client) if ((int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -519,9 +540,9 @@ internal IndexersOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -568,6 +589,8 @@ internal IndexersOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -585,7 +608,7 @@ internal IndexersOperations(SearchServiceClient client) if(indexer != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(indexer, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -608,7 +631,7 @@ internal IndexersOperations(SearchServiceClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -621,7 +644,7 @@ internal IndexersOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -651,14 +674,14 @@ internal IndexersOperations(SearchServiceClient client) _result.RequestId = _httpResponse.Headers.GetValues("request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -669,14 +692,14 @@ internal IndexersOperations(SearchServiceClient client) } } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -787,9 +810,9 @@ internal IndexersOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -828,6 +851,8 @@ internal IndexersOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -862,14 +887,22 @@ internal IndexersOperations(SearchServiceClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 404 && (int)_statusCode != 204) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -985,9 +1018,9 @@ internal IndexersOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1010,6 +1043,8 @@ internal IndexersOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1057,7 +1092,7 @@ internal IndexersOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1094,7 +1129,7 @@ internal IndexersOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1184,9 +1219,9 @@ internal IndexersOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1209,6 +1244,8 @@ internal IndexersOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1256,7 +1293,7 @@ internal IndexersOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1293,7 +1330,7 @@ internal IndexersOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1395,9 +1432,9 @@ internal IndexersOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1420,6 +1457,8 @@ internal IndexersOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1437,7 +1476,7 @@ internal IndexersOperations(SearchServiceClient client) if(indexer != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(indexer, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -1473,7 +1512,7 @@ internal IndexersOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1510,7 +1549,7 @@ internal IndexersOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1609,9 +1648,9 @@ internal IndexersOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1634,6 +1673,8 @@ internal IndexersOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1681,7 +1722,7 @@ internal IndexersOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1718,7 +1759,7 @@ internal IndexersOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1737,4 +1778,3 @@ internal IndexersOperations(SearchServiceClient client) } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperationsExtensions.cs index 52e8c807efc8..d6e2f42307c7 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperationsExtensions.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperationsExtensions.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -56,7 +57,7 @@ public static partial class IndexersOperationsExtensions /// public static async Task ResetAsync(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.ResetWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken).ConfigureAwait(false); + (await operations.ResetWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -95,7 +96,7 @@ public static partial class IndexersOperationsExtensions /// public static async Task RunAsync(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.RunWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken).ConfigureAwait(false); + (await operations.RunWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -196,7 +197,7 @@ public static partial class IndexersOperationsExtensions /// public static async Task DeleteAsync(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(indexerName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(indexerName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -363,4 +364,3 @@ public static partial class IndexersOperationsExtensions } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperations.cs index 46cf6717a43c..ff05854f3c42 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -134,9 +135,9 @@ internal IndexesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -159,6 +160,8 @@ internal IndexesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,7 +179,7 @@ internal IndexesOperations(SearchServiceClient client) if(index != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(index, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -212,7 +215,7 @@ internal IndexesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -249,7 +252,7 @@ internal IndexesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -349,9 +352,9 @@ internal IndexesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -374,6 +377,8 @@ internal IndexesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -421,7 +426,7 @@ internal IndexesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -458,7 +463,7 @@ internal IndexesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -598,9 +603,9 @@ internal IndexesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -647,6 +652,8 @@ internal IndexesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -664,7 +671,7 @@ internal IndexesOperations(SearchServiceClient client) if(index != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(index, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -700,7 +707,7 @@ internal IndexesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -737,7 +744,7 @@ internal IndexesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -755,7 +762,7 @@ internal IndexesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -866,9 +873,9 @@ internal IndexesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -907,6 +914,8 @@ internal IndexesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -944,11 +953,19 @@ internal IndexesOperations(SearchServiceClient client) if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -1064,9 +1081,9 @@ internal IndexesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1089,6 +1106,8 @@ internal IndexesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1136,7 +1155,7 @@ internal IndexesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1173,7 +1192,7 @@ internal IndexesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1273,9 +1292,9 @@ internal IndexesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1298,6 +1317,8 @@ internal IndexesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1345,7 +1366,7 @@ internal IndexesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1382,7 +1403,7 @@ internal IndexesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1493,9 +1514,9 @@ internal IndexesOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1518,6 +1539,8 @@ internal IndexesOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1535,7 +1558,7 @@ internal IndexesOperations(SearchServiceClient client) if(request != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -1571,7 +1594,7 @@ internal IndexesOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1608,7 +1631,7 @@ internal IndexesOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1627,4 +1650,3 @@ internal IndexesOperations(SearchServiceClient client) } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperationsExtensions.cs index 2f3e60ffc208..8ff586cbee89 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperationsExtensions.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperationsExtensions.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -218,7 +219,7 @@ public static partial class IndexesOperationsExtensions /// public static async Task DeleteAsync(this IIndexesOperations operations, string indexName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(indexName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(indexName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -357,4 +358,3 @@ public static partial class IndexesOperationsExtensions } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AccessCondition.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AccessCondition.cs index 5ca47f9a44e3..11f01568fdcd 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AccessCondition.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AccessCondition.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,10 @@ public partial class AccessCondition /// /// Initializes a new instance of the AccessCondition class. /// - public AccessCondition() { } + public AccessCondition() + { + CustomInit(); + } /// /// Initializes a new instance of the AccessCondition class. @@ -36,13 +39,19 @@ public AccessCondition() { } { IfMatch = ifMatch; IfNoneMatch = ifNoneMatch; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets defines the If-Match condition. The operation will be /// performed only if the ETag on the server matches this value. /// - [JsonProperty(PropertyName = "")] + [Newtonsoft.Json.JsonIgnore] public string IfMatch { get; set; } /// @@ -50,9 +59,8 @@ public AccessCondition() { } /// will be performed only if the ETag on the server does not match /// this value. /// - [JsonProperty(PropertyName = "")] + [Newtonsoft.Json.JsonIgnore] public string IfNoneMatch { get; set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeRequest.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeRequest.cs index 638aa422f4c7..61f74e45bc65 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeRequest.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeRequest.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +25,10 @@ public partial class AnalyzeRequest /// /// Initializes a new instance of the AnalyzeRequest class. /// - public AnalyzeRequest() { } + public AnalyzeRequest() + { + CustomInit(); + } /// /// Initializes a new instance of the AnalyzeRequest class. @@ -52,8 +55,14 @@ public AnalyzeRequest() { } Tokenizer = tokenizer; TokenFilters = tokenFilters; CharFilters = charFilters; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the text to break into tokens. /// @@ -109,4 +118,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeResult.cs index 91de71153f6f..4a4e953af160 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +23,10 @@ public partial class AnalyzeResult /// /// Initializes a new instance of the AnalyzeResult class. /// - public AnalyzeResult() { } + public AnalyzeResult() + { + CustomInit(); + } /// /// Initializes a new instance of the AnalyzeResult class. @@ -33,8 +36,14 @@ public AnalyzeResult() { } public AnalyzeResult(IList tokens = default(IList)) { Tokens = tokens; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the list of tokens returned by the analyzer specified /// in the request. @@ -44,4 +53,3 @@ public AnalyzeResult() { } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Analyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Analyzer.cs index 6f5a7aae141d..f398721d4c1d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Analyzer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Analyzer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +22,10 @@ public partial class Analyzer /// /// Initializes a new instance of the Analyzer class. /// - public Analyzer() { } + public Analyzer() + { + CustomInit(); + } /// /// Initializes a new instance of the Analyzer class. @@ -34,8 +37,14 @@ public Analyzer() { } public Analyzer(string name) { Name = name; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the analyzer. It must only contain /// letters, digits, spaces, dashes or underscores, can only start and @@ -59,4 +68,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AsciiFoldingTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AsciiFoldingTokenFilter.cs index 72c21863933f..9159249e3c64 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AsciiFoldingTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AsciiFoldingTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Search.Models /// 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. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.AsciiFoldingTokenFilter")] public partial class AsciiFoldingTokenFilter : TokenFilter @@ -26,7 +28,10 @@ public partial class AsciiFoldingTokenFilter : TokenFilter /// /// Initializes a new instance of the AsciiFoldingTokenFilter class. /// - public AsciiFoldingTokenFilter() { } + public AsciiFoldingTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the AsciiFoldingTokenFilter class. @@ -41,8 +46,14 @@ public AsciiFoldingTokenFilter() { } : base(name) { PreserveOriginal = preserveOriginal; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a value indicating whether the original token will be /// kept. Default is false. @@ -62,4 +73,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CharFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CharFilter.cs index b80da2f488cf..cd36d7c58d94 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CharFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CharFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,25 +6,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Abstract base class for character filters. - /// + /// /// public partial class CharFilter { /// /// Initializes a new instance of the CharFilter class. /// - public CharFilter() { } + public CharFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the CharFilter class. @@ -35,8 +40,14 @@ public CharFilter() { } public CharFilter(string name) { Name = name; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the char filter. It must only contain /// letters, digits, spaces, dashes or underscores, can only start and @@ -60,4 +71,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilter.cs index dbdb183ccd1e..31a302ea9465 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Search.Models /// /// Forms bigrams of CJK terms that are generated from StandardTokenizer. /// This token filter is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.CjkBigramTokenFilter")] public partial class CjkBigramTokenFilter : TokenFilter @@ -26,7 +28,10 @@ public partial class CjkBigramTokenFilter : TokenFilter /// /// Initializes a new instance of the CjkBigramTokenFilter class. /// - public CjkBigramTokenFilter() { } + public CjkBigramTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the CjkBigramTokenFilter class. @@ -44,8 +49,14 @@ public CjkBigramTokenFilter() { } { IgnoreScripts = ignoreScripts; OutputUnigrams = outputUnigrams; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the scripts to ignore. /// @@ -71,4 +82,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilterScripts.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilterScripts.cs index 27c1fcb2b208..c4ae4d6c3d28 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilterScripts.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilterScripts.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for CjkBigramTokenFilterScripts. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum CjkBigramTokenFilterScripts { [EnumMember(Value = "han")] @@ -30,5 +30,43 @@ public enum CjkBigramTokenFilterScripts [EnumMember(Value = "hangul")] Hangul } -} + internal static class CjkBigramTokenFilterScriptsEnumExtension + { + internal static string ToSerializedValue(this CjkBigramTokenFilterScripts? value) + { + return value == null ? null : ((CjkBigramTokenFilterScripts)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CjkBigramTokenFilterScripts value) + { + switch( value ) + { + case CjkBigramTokenFilterScripts.Han: + return "han"; + case CjkBigramTokenFilterScripts.Hiragana: + return "hiragana"; + case CjkBigramTokenFilterScripts.Katakana: + return "katakana"; + case CjkBigramTokenFilterScripts.Hangul: + return "hangul"; + } + return null; + } + internal static CjkBigramTokenFilterScripts? ParseCjkBigramTokenFilterScripts(this string value) + { + switch( value ) + { + case "han": + return CjkBigramTokenFilterScripts.Han; + case "hiragana": + return CjkBigramTokenFilterScripts.Hiragana; + case "katakana": + return CjkBigramTokenFilterScripts.Katakana; + case "hangul": + return CjkBigramTokenFilterScripts.Hangul; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ClassicTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ClassicTokenizer.cs index 6e8aa9ecf596..96d8fd193105 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ClassicTokenizer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ClassicTokenizer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Search.Models /// Grammar-based tokenizer that is suitable for processing most /// European-language documents. This tokenizer is implemented using Apache /// Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.ClassicTokenizer")] public partial class ClassicTokenizer : Tokenizer @@ -26,7 +28,10 @@ public partial class ClassicTokenizer : Tokenizer /// /// Initializes a new instance of the ClassicTokenizer class. /// - public ClassicTokenizer() { } + public ClassicTokenizer() + { + CustomInit(); + } /// /// Initializes a new instance of the ClassicTokenizer class. @@ -42,8 +47,14 @@ public ClassicTokenizer() { } : base(name) { MaxTokenLength = maxTokenLength; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum token length. Default is 255. Tokens /// longer than the maximum length are split. The maximum token length @@ -68,4 +79,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CommonGramTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CommonGramTokenFilter.cs index 2353747b4f1f..d4ef6bb4eba8 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CommonGramTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CommonGramTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -20,7 +20,9 @@ namespace Microsoft.Azure.Search.Models /// 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. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.CommonGramTokenFilter")] public partial class CommonGramTokenFilter : TokenFilter @@ -28,7 +30,10 @@ public partial class CommonGramTokenFilter : TokenFilter /// /// Initializes a new instance of the CommonGramTokenFilter class. /// - public CommonGramTokenFilter() { } + public CommonGramTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the CommonGramTokenFilter class. @@ -50,8 +55,14 @@ public CommonGramTokenFilter() { } CommonWords = commonWords; IgnoreCase = ignoreCase; UseQueryMode = useQueryMode; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the set of common words. /// @@ -90,4 +101,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CorsOptions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CorsOptions.cs index 9b0e378e221f..02d2dc1f3bf1 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CorsOptions.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CorsOptions.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,14 +19,19 @@ namespace Microsoft.Azure.Search.Models /// /// Defines options to control Cross-Origin Resource Sharing (CORS) for an /// index. - /// + /// /// public partial class CorsOptions { /// /// Initializes a new instance of the CorsOptions class. /// - public CorsOptions() { } + public CorsOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the CorsOptions class. @@ -43,8 +48,14 @@ public CorsOptions() { } { AllowedOrigins = allowedOrigins; MaxAgeInSeconds = maxAgeInSeconds; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the list of origins from which JavaScript code will be /// granted access to your index. Can contain a list of hosts of the @@ -76,4 +87,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CustomAnalyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CustomAnalyzer.cs index 9e68a6340a99..ebede0d82775 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CustomAnalyzer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CustomAnalyzer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -29,7 +29,10 @@ public partial class CustomAnalyzer : Analyzer /// /// Initializes a new instance of the CustomAnalyzer class. /// - public CustomAnalyzer() { } + public CustomAnalyzer() + { + CustomInit(); + } /// /// Initializes a new instance of the CustomAnalyzer class. @@ -56,8 +59,14 @@ public CustomAnalyzer() { } Tokenizer = tokenizer; TokenFilters = tokenFilters; CharFilters = charFilters; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the tokenizer to use to divide continuous /// text into a sequence of tokens, such as breaking a sentence into @@ -100,4 +109,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataChangeDetectionPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataChangeDetectionPolicy.cs index 869d9439be52..eebd7ac66d91 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataChangeDetectionPolicy.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataChangeDetectionPolicy.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using System.Linq; /// @@ -20,9 +20,16 @@ public partial class DataChangeDetectionPolicy /// /// Initializes a new instance of the DataChangeDetectionPolicy class. /// - public DataChangeDetectionPolicy() { } + public DataChangeDetectionPolicy() + { + CustomInit(); + } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataContainer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataContainer.cs index 987f626f2af8..bea97fe9a358 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataContainer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataContainer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +23,10 @@ public partial class DataContainer /// /// Initializes a new instance of the DataContainer class. /// - public DataContainer() { } + public DataContainer() + { + CustomInit(); + } /// /// Initializes a new instance of the DataContainer class. @@ -38,8 +41,14 @@ public DataContainer() { } { Name = name; Query = query; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the table or view (for Azure SQL data /// source) or collection (for DocumentDB data source) that will be @@ -71,4 +80,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataDeletionDetectionPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataDeletionDetectionPolicy.cs index b73239da26b5..c94cedfb77e4 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataDeletionDetectionPolicy.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataDeletionDetectionPolicy.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using System.Linq; /// @@ -21,9 +21,16 @@ public partial class DataDeletionDetectionPolicy /// Initializes a new instance of the DataDeletionDetectionPolicy /// class. /// - public DataDeletionDetectionPolicy() { } + public DataDeletionDetectionPolicy() + { + CustomInit(); + } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSource.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSource.cs index 23c1548d6e06..bc64e327ee68 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSource.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSource.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +23,10 @@ public partial class DataSource /// /// Initializes a new instance of the DataSource class. /// - public DataSource() { } + public DataSource() + { + CustomInit(); + } /// /// Initializes a new instance of the DataSource class. @@ -50,8 +53,14 @@ public DataSource() { } DataChangeDetectionPolicy = dataChangeDetectionPolicy; DataDeletionDetectionPolicy = dataDeletionDetectionPolicy; ETag = eTag; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the datasource. /// @@ -135,4 +144,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceCredentials.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceCredentials.cs index 4dd49aa36d12..063cf514aa6e 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceCredentials.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceCredentials.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +22,10 @@ public partial class DataSourceCredentials /// /// Initializes a new instance of the DataSourceCredentials class. /// - public DataSourceCredentials() { } + public DataSourceCredentials() + { + CustomInit(); + } /// /// Initializes a new instance of the DataSourceCredentials class. @@ -32,8 +35,14 @@ public DataSourceCredentials() { } public DataSourceCredentials(string connectionString) { ConnectionString = connectionString; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the connection string for the datasource. /// @@ -55,4 +64,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceListResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceListResult.cs index 7d0a2920618e..a1842b78c7fa 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceListResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceListResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +24,10 @@ public partial class DataSourceListResult /// /// Initializes a new instance of the DataSourceListResult class. /// - public DataSourceListResult() { } + public DataSourceListResult() + { + CustomInit(); + } /// /// Initializes a new instance of the DataSourceListResult class. @@ -34,14 +37,19 @@ public DataSourceListResult() { } public DataSourceListResult(IList dataSources = default(IList)) { DataSources = dataSources; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the datasources in the Search service. /// [JsonProperty(PropertyName = "value")] - public IList DataSources { get; protected set; } + public IList DataSources { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DictionaryDecompounderTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DictionaryDecompounderTokenFilter.cs index 7adb96432aa0..6aefe7acd899 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DictionaryDecompounderTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DictionaryDecompounderTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,7 +19,9 @@ namespace Microsoft.Azure.Search.Models /// /// Decomposes compound words found in many Germanic languages. This token /// filter is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter")] public partial class DictionaryDecompounderTokenFilter : TokenFilter @@ -28,7 +30,10 @@ public partial class DictionaryDecompounderTokenFilter : TokenFilter /// Initializes a new instance of the DictionaryDecompounderTokenFilter /// class. /// - public DictionaryDecompounderTokenFilter() { } + public DictionaryDecompounderTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the DictionaryDecompounderTokenFilter @@ -58,8 +63,14 @@ public DictionaryDecompounderTokenFilter() { } MinSubwordSize = minSubwordSize; MaxSubwordSize = maxSubwordSize; OnlyLongestMatch = onlyLongestMatch; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the list of words to match against. /// @@ -122,4 +133,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringFunction.cs index 2cd744e64adb..3cbb7846f156 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringFunction.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringFunction.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Defines a function that boosts scores based on distance from a /// geographic location. - /// + /// /// [Newtonsoft.Json.JsonObject("distance")] public partial class DistanceScoringFunction : ScoringFunction @@ -25,7 +27,10 @@ public partial class DistanceScoringFunction : ScoringFunction /// /// Initializes a new instance of the DistanceScoringFunction class. /// - public DistanceScoringFunction() { } + public DistanceScoringFunction() + { + CustomInit(); + } /// /// Initializes a new instance of the DistanceScoringFunction class. @@ -44,8 +49,14 @@ public DistanceScoringFunction() { } : base(fieldName, boost, interpolation) { Parameters = parameters; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets parameter values for the distance scoring function. /// @@ -72,4 +83,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringParameters.cs index 323accb2a309..6af3bab2e53a 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringParameters.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringParameters.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +22,10 @@ public partial class DistanceScoringParameters /// /// Initializes a new instance of the DistanceScoringParameters class. /// - public DistanceScoringParameters() { } + public DistanceScoringParameters() + { + CustomInit(); + } /// /// Initializes a new instance of the DistanceScoringParameters class. @@ -35,8 +38,14 @@ public DistanceScoringParameters(string referencePointParameter, double boosting { ReferencePointParameter = referencePointParameter; BoostingDistance = boostingDistance; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the parameter passed in search queries to /// specify the reference location. @@ -66,4 +75,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterSide.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterSide.cs index 35b6c0ac5852..59163838e633 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterSide.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterSide.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for EdgeNGramTokenFilterSide. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum EdgeNGramTokenFilterSide { [EnumMember(Value = "front")] @@ -26,5 +26,35 @@ public enum EdgeNGramTokenFilterSide [EnumMember(Value = "back")] Back } -} + internal static class EdgeNGramTokenFilterSideEnumExtension + { + internal static string ToSerializedValue(this EdgeNGramTokenFilterSide? value) + { + return value == null ? null : ((EdgeNGramTokenFilterSide)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this EdgeNGramTokenFilterSide value) + { + switch( value ) + { + case EdgeNGramTokenFilterSide.Front: + return "front"; + case EdgeNGramTokenFilterSide.Back: + return "back"; + } + return null; + } + internal static EdgeNGramTokenFilterSide? ParseEdgeNGramTokenFilterSide(this string value) + { + switch( value ) + { + case "front": + return EdgeNGramTokenFilterSide.Front; + case "back": + return EdgeNGramTokenFilterSide.Back; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterV2.cs index 057d1dda73f7..c25567aa96ac 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterV2.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterV2.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Search.Models /// 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. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.EdgeNGramTokenFilterV2")] public partial class EdgeNGramTokenFilterV2 : TokenFilter @@ -26,7 +28,10 @@ public partial class EdgeNGramTokenFilterV2 : TokenFilter /// /// Initializes a new instance of the EdgeNGramTokenFilterV2 class. /// - public EdgeNGramTokenFilterV2() { } + public EdgeNGramTokenFilterV2() + { + CustomInit(); + } /// /// Initializes a new instance of the EdgeNGramTokenFilterV2 class. @@ -48,8 +53,14 @@ public EdgeNGramTokenFilterV2() { } MinGram = minGram; MaxGram = maxGram; Side = side; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the minimum n-gram length. Default is 1. Maximum is /// 300. Must be less than the value of maxGram. @@ -92,4 +103,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenizer.cs index 655dbd840527..62108d6b50e0 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenizer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenizer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,7 +19,9 @@ namespace Microsoft.Azure.Search.Models /// /// Tokenizes the input from an edge into n-grams of the given size(s). /// This tokenizer is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.EdgeNGramTokenizer")] public partial class EdgeNGramTokenizer : Tokenizer @@ -27,7 +29,10 @@ public partial class EdgeNGramTokenizer : Tokenizer /// /// Initializes a new instance of the EdgeNGramTokenizer class. /// - public EdgeNGramTokenizer() { } + public EdgeNGramTokenizer() + { + CustomInit(); + } /// /// Initializes a new instance of the EdgeNGramTokenizer class. @@ -48,8 +53,14 @@ public EdgeNGramTokenizer() { } MinGram = minGram; MaxGram = maxGram; TokenChars = tokenChars; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the minimum n-gram length. Default is 1. Maximum is /// 300. Must be less than the value of maxGram. @@ -90,4 +101,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ElisionTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ElisionTokenFilter.cs index 8295dbc1595b..94f58b4fb8ee 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ElisionTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ElisionTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,7 +19,9 @@ namespace Microsoft.Azure.Search.Models /// Removes elisions. For example, "l'avion" (the plane) will be converted /// to "avion" (plane). This token filter is implemented using Apache /// Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.ElisionTokenFilter")] public partial class ElisionTokenFilter : TokenFilter @@ -27,7 +29,10 @@ public partial class ElisionTokenFilter : TokenFilter /// /// Initializes a new instance of the ElisionTokenFilter class. /// - public ElisionTokenFilter() { } + public ElisionTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the ElisionTokenFilter class. @@ -41,8 +46,14 @@ public ElisionTokenFilter() { } : base(name) { Articles = articles; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the set of articles to remove. /// @@ -61,4 +72,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMapping.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMapping.cs index 5a769610047f..4ab639299ce4 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMapping.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMapping.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,26 +6,30 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Defines a mapping between a field in a data source and a target field /// in an index. - /// + /// /// public partial class FieldMapping { /// /// Initializes a new instance of the FieldMapping class. /// - public FieldMapping() { } + public FieldMapping() + { + CustomInit(); + } /// /// Initializes a new instance of the FieldMapping class. @@ -40,8 +45,14 @@ public FieldMapping() { } SourceFieldName = sourceFieldName; TargetFieldName = targetFieldName; MappingFunction = mappingFunction; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the field in the data source. /// @@ -81,4 +92,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMappingFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMappingFunction.cs index 15efb53512af..b107146979e1 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMappingFunction.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMappingFunction.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,14 +19,19 @@ namespace Microsoft.Azure.Search.Models /// /// Represents a function that transforms a value from a data source before /// indexing. - /// + /// /// public partial class FieldMappingFunction { /// /// Initializes a new instance of the FieldMappingFunction class. /// - public FieldMappingFunction() { } + public FieldMappingFunction() + { + CustomInit(); + } /// /// Initializes a new instance of the FieldMappingFunction class. @@ -39,8 +44,14 @@ public FieldMappingFunction() { } { Name = name; Parameters = parameters; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the field mapping function. /// @@ -69,4 +80,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringFunction.cs index 727ab793e0d0..6ca8da1ce2a9 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringFunction.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringFunction.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Defines a function that boosts scores based on the value of a date-time /// field. - /// + /// /// [Newtonsoft.Json.JsonObject("freshness")] public partial class FreshnessScoringFunction : ScoringFunction @@ -25,7 +27,10 @@ public partial class FreshnessScoringFunction : ScoringFunction /// /// Initializes a new instance of the FreshnessScoringFunction class. /// - public FreshnessScoringFunction() { } + public FreshnessScoringFunction() + { + CustomInit(); + } /// /// Initializes a new instance of the FreshnessScoringFunction class. @@ -44,8 +49,14 @@ public FreshnessScoringFunction() { } : base(fieldName, boost, interpolation) { Parameters = parameters; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets parameter values for the freshness scoring function. /// @@ -72,4 +83,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringParameters.cs index d7a72e759fd8..7b28fba7d3e7 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringParameters.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringParameters.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,10 @@ public partial class FreshnessScoringParameters /// /// Initializes a new instance of the FreshnessScoringParameters class. /// - public FreshnessScoringParameters() { } + public FreshnessScoringParameters() + { + CustomInit(); + } /// /// Initializes a new instance of the FreshnessScoringParameters class. @@ -31,8 +34,14 @@ public FreshnessScoringParameters() { } public FreshnessScoringParameters(System.TimeSpan boostingDuration) { BoostingDuration = boostingDuration; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the expiration period after which boosting will stop /// for a particular document. @@ -52,4 +61,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/HighWaterMarkChangeDetectionPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/HighWaterMarkChangeDetectionPolicy.cs index 57299a67bacf..9d78b61886d3 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/HighWaterMarkChangeDetectionPolicy.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/HighWaterMarkChangeDetectionPolicy.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -25,7 +25,10 @@ public partial class HighWaterMarkChangeDetectionPolicy : DataChangeDetectionPol /// Initializes a new instance of the /// HighWaterMarkChangeDetectionPolicy class. /// - public HighWaterMarkChangeDetectionPolicy() { } + public HighWaterMarkChangeDetectionPolicy() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -36,8 +39,14 @@ public HighWaterMarkChangeDetectionPolicy() { } public HighWaterMarkChangeDetectionPolicy(string highWaterMarkColumnName) { HighWaterMarkColumnName = highWaterMarkColumnName; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the high water mark column. /// @@ -59,4 +68,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Index.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Index.cs index 2ef93d572705..92539addf94d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Index.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Index.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +25,10 @@ public partial class Index /// /// Initializes a new instance of the Index class. /// - public Index() { } + public Index() + { + CustomInit(); + } /// /// Initializes a new instance of the Index class. @@ -60,8 +63,14 @@ public Index() { } TokenFilters = tokenFilters; CharFilters = charFilters; ETag = eTag; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the index. /// @@ -225,4 +234,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexGetStatisticsResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexGetStatisticsResult.cs index dc3a99a8154d..2c2426be0271 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexGetStatisticsResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexGetStatisticsResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -22,7 +22,10 @@ public partial class IndexGetStatisticsResult /// /// Initializes a new instance of the IndexGetStatisticsResult class. /// - public IndexGetStatisticsResult() { } + public IndexGetStatisticsResult() + { + CustomInit(); + } /// /// Initializes a new instance of the IndexGetStatisticsResult class. @@ -35,20 +38,25 @@ public IndexGetStatisticsResult() { } { DocumentCount = documentCount; StorageSize = storageSize; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the number of documents in the index. /// [JsonProperty(PropertyName = "documentCount")] - public long DocumentCount { get; protected set; } + public long DocumentCount { get; private set; } /// /// Gets the amount of storage in bytes consumed by the index. /// [JsonProperty(PropertyName = "storageSize")] - public long StorageSize { get; protected set; } + public long StorageSize { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexListResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexListResult.cs index 875a98924e2a..bcc129f3283a 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexListResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexListResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +24,10 @@ public partial class IndexListResult /// /// Initializes a new instance of the IndexListResult class. /// - public IndexListResult() { } + public IndexListResult() + { + CustomInit(); + } /// /// Initializes a new instance of the IndexListResult class. @@ -33,14 +36,19 @@ public IndexListResult() { } public IndexListResult(IList indexes = default(IList)) { Indexes = indexes; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the indexes in the Search service. /// [JsonProperty(PropertyName = "value")] - public IList Indexes { get; protected set; } + public IList Indexes { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Indexer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Indexer.cs index 152762cee181..cf600c505f91 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Indexer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Indexer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -18,14 +18,19 @@ namespace Microsoft.Azure.Search.Models /// /// Represents an Azure Search indexer. - /// + /// /// public partial class Indexer { /// /// Initializes a new instance of the Indexer class. /// - public Indexer() { } + public Indexer() + { + CustomInit(); + } /// /// Initializes a new instance of the Indexer class. @@ -54,8 +59,14 @@ public Indexer() { } FieldMappings = fieldMappings; IsDisabled = isDisabled; ETag = eTag; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the indexer. /// @@ -151,4 +162,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionInfo.cs index 6bac129536bb..b921e8812840 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionInfo.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +23,10 @@ public partial class IndexerExecutionInfo /// /// Initializes a new instance of the IndexerExecutionInfo class. /// - public IndexerExecutionInfo() { } + public IndexerExecutionInfo() + { + CustomInit(); + } /// /// Initializes a new instance of the IndexerExecutionInfo class. @@ -39,29 +42,34 @@ public IndexerExecutionInfo() { } Status = status; LastResult = lastResult; ExecutionHistory = executionHistory; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets overall indexer status. Possible values include: 'unknown', /// 'error', 'running' /// [JsonProperty(PropertyName = "status")] - public IndexerStatus Status { get; protected set; } + public IndexerStatus Status { get; private set; } /// /// Gets the result of the most recent or an in-progress indexer /// execution. /// [JsonProperty(PropertyName = "lastResult")] - public IndexerExecutionResult LastResult { get; protected set; } + public IndexerExecutionResult LastResult { get; private set; } /// /// Gets history of the recent indexer executions, sorted in reverse /// chronological order. /// [JsonProperty(PropertyName = "executionHistory")] - public IList ExecutionHistory { get; protected set; } + public IList ExecutionHistory { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionResult.cs index 916a1e7116f5..a78195f65608 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +23,10 @@ public partial class IndexerExecutionResult /// /// Initializes a new instance of the IndexerExecutionResult class. /// - public IndexerExecutionResult() { } + public IndexerExecutionResult() + { + CustomInit(); + } /// /// Initializes a new instance of the IndexerExecutionResult class. @@ -59,39 +62,45 @@ public IndexerExecutionResult() { } FailedItemCount = failedItemCount; InitialTrackingState = initialTrackingState; FinalTrackingState = finalTrackingState; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the outcome of this indexer execution. Possible values /// include: 'transientFailure', 'success', 'inProgress', 'reset' /// [JsonProperty(PropertyName = "status")] - public IndexerExecutionStatus Status { get; protected set; } + public IndexerExecutionStatus Status { get; private set; } /// /// Gets the error message indicating the top-level error, if any. /// [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; protected set; } + public string ErrorMessage { get; private set; } /// /// Gets the start time of this indexer execution. /// [JsonProperty(PropertyName = "startTime")] - public System.DateTimeOffset? StartTime { get; protected set; } + public System.DateTimeOffset? StartTime { get; private set; } /// /// Gets the end time of this indexer execution, if the execution has /// already completed. /// [JsonProperty(PropertyName = "endTime")] - public System.DateTimeOffset? EndTime { get; protected set; } + public System.DateTimeOffset? EndTime { get; private set; } /// /// Gets the item-level indexing errors. /// [JsonProperty(PropertyName = "errors")] - public IList Errors { get; protected set; } + public IList Errors { get; private set; } /// /// Gets the number of items that were processed during this indexer @@ -99,28 +108,27 @@ public IndexerExecutionResult() { } /// items where indexing was attempted but failed. /// [JsonProperty(PropertyName = "itemsProcessed")] - public int ItemCount { get; protected set; } + public int ItemCount { get; private set; } /// /// Gets the number of items that failed to be indexed during this /// indexer execution. /// [JsonProperty(PropertyName = "itemsFailed")] - public int FailedItemCount { get; protected set; } + public int FailedItemCount { get; private set; } /// /// Gets change tracking state with which an indexer execution started. /// [JsonProperty(PropertyName = "initialTrackingState")] - public string InitialTrackingState { get; protected set; } + public string InitialTrackingState { get; private set; } /// /// Gets change tracking state with which an indexer execution /// finished. /// [JsonProperty(PropertyName = "finalTrackingState")] - public string FinalTrackingState { get; protected set; } + public string FinalTrackingState { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionStatus.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionStatus.cs index 0b42a305afa5..8db476c860d6 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionStatus.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionStatus.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for IndexerExecutionStatus. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum IndexerExecutionStatus { [EnumMember(Value = "transientFailure")] @@ -30,5 +30,43 @@ public enum IndexerExecutionStatus [EnumMember(Value = "reset")] Reset } -} + internal static class IndexerExecutionStatusEnumExtension + { + internal static string ToSerializedValue(this IndexerExecutionStatus? value) + { + return value == null ? null : ((IndexerExecutionStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this IndexerExecutionStatus value) + { + switch( value ) + { + case IndexerExecutionStatus.TransientFailure: + return "transientFailure"; + case IndexerExecutionStatus.Success: + return "success"; + case IndexerExecutionStatus.InProgress: + return "inProgress"; + case IndexerExecutionStatus.Reset: + return "reset"; + } + return null; + } + internal static IndexerExecutionStatus? ParseIndexerExecutionStatus(this string value) + { + switch( value ) + { + case "transientFailure": + return IndexerExecutionStatus.TransientFailure; + case "success": + return IndexerExecutionStatus.Success; + case "inProgress": + return IndexerExecutionStatus.InProgress; + case "reset": + return IndexerExecutionStatus.Reset; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerListResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerListResult.cs index 16ff417bb3e6..42fdf643ea57 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerListResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerListResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +24,10 @@ public partial class IndexerListResult /// /// Initializes a new instance of the IndexerListResult class. /// - public IndexerListResult() { } + public IndexerListResult() + { + CustomInit(); + } /// /// Initializes a new instance of the IndexerListResult class. @@ -33,14 +36,19 @@ public IndexerListResult() { } public IndexerListResult(IList indexers = default(IList)) { Indexers = indexers; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the indexers in the Search service. /// [JsonProperty(PropertyName = "value")] - public IList Indexers { get; protected set; } + public IList Indexers { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerStatus.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerStatus.cs index 545e49fe28db..ba4d3e2a8b80 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerStatus.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerStatus.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for IndexerStatus. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum IndexerStatus { [EnumMember(Value = "unknown")] @@ -28,5 +28,39 @@ public enum IndexerStatus [EnumMember(Value = "running")] Running } -} + internal static class IndexerStatusEnumExtension + { + internal static string ToSerializedValue(this IndexerStatus? value) + { + return value == null ? null : ((IndexerStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this IndexerStatus value) + { + switch( value ) + { + case IndexerStatus.Unknown: + return "unknown"; + case IndexerStatus.Error: + return "error"; + case IndexerStatus.Running: + return "running"; + } + return null; + } + internal static IndexerStatus? ParseIndexerStatus(this string value) + { + switch( value ) + { + case "unknown": + return IndexerStatus.Unknown; + case "error": + return IndexerStatus.Error; + case "running": + return IndexerStatus.Running; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexingSchedule.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexingSchedule.cs index e0eea24e6408..6e9332f2d85f 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexingSchedule.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexingSchedule.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,10 @@ public partial class IndexingSchedule /// /// Initializes a new instance of the IndexingSchedule class. /// - public IndexingSchedule() { } + public IndexingSchedule() + { + CustomInit(); + } /// /// Initializes a new instance of the IndexingSchedule class. @@ -34,8 +37,14 @@ public IndexingSchedule() { } { Interval = interval; StartTime = startTime; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the interval of time between indexer executions. /// @@ -60,4 +69,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ItemError.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ItemError.cs index f6019b3ccfa3..7c7cb0ceed32 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ItemError.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ItemError.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,10 @@ public partial class ItemError /// /// Initializes a new instance of the ItemError class. /// - public ItemError() { } + public ItemError() + { + CustomInit(); + } /// /// Initializes a new instance of the ItemError class. @@ -34,21 +37,26 @@ public ItemError() { } { Key = key; ErrorMessage = errorMessage; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the key of the item for which indexing failed. /// [JsonProperty(PropertyName = "key")] - public string Key { get; protected set; } + public string Key { get; private set; } /// /// Gets the message describing the error that occurred while /// attempting to index the item. /// [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; protected set; } + public string ErrorMessage { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeepTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeepTokenFilter.cs index 52d02b4cb165..9613c8120fdd 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeepTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeepTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -20,7 +20,9 @@ namespace Microsoft.Azure.Search.Models /// A token filter that only keeps tokens with text contained in a /// specified list of words. This token filter is implemented using Apache /// Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.KeepTokenFilter")] public partial class KeepTokenFilter : TokenFilter @@ -28,7 +30,10 @@ public partial class KeepTokenFilter : TokenFilter /// /// Initializes a new instance of the KeepTokenFilter class. /// - public KeepTokenFilter() { } + public KeepTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the KeepTokenFilter class. @@ -45,8 +50,14 @@ public KeepTokenFilter() { } { KeepWords = keepWords; LowerCaseKeepWords = lowerCaseKeepWords; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the list of words to keep. /// @@ -76,4 +87,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordMarkerTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordMarkerTokenFilter.cs index 352bd04ddbc8..4cdbef1489aa 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordMarkerTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordMarkerTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,7 +19,9 @@ namespace Microsoft.Azure.Search.Models /// /// Marks terms as keywords. This token filter is implemented using Apache /// Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.KeywordMarkerTokenFilter")] public partial class KeywordMarkerTokenFilter : TokenFilter @@ -27,7 +29,10 @@ public partial class KeywordMarkerTokenFilter : TokenFilter /// /// Initializes a new instance of the KeywordMarkerTokenFilter class. /// - public KeywordMarkerTokenFilter() { } + public KeywordMarkerTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the KeywordMarkerTokenFilter class. @@ -45,8 +50,14 @@ public KeywordMarkerTokenFilter() { } { Keywords = keywords; IgnoreCase = ignoreCase; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a list of words to mark as keywords. /// @@ -76,4 +87,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordTokenizerV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordTokenizerV2.cs index bf65eb560fed..0948744ab96f 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordTokenizerV2.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordTokenizerV2.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Emits the entire input as a single token. This tokenizer is implemented /// using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.KeywordTokenizerV2")] public partial class KeywordTokenizerV2 : Tokenizer @@ -25,7 +27,10 @@ public partial class KeywordTokenizerV2 : Tokenizer /// /// Initializes a new instance of the KeywordTokenizerV2 class. /// - public KeywordTokenizerV2() { } + public KeywordTokenizerV2() + { + CustomInit(); + } /// /// Initializes a new instance of the KeywordTokenizerV2 class. @@ -41,8 +46,14 @@ public KeywordTokenizerV2() { } : base(name) { MaxTokenLength = maxTokenLength; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum token length. Default is 256. Tokens /// longer than the maximum length are split. The maximum token length @@ -67,4 +78,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LengthTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LengthTokenFilter.cs index 2957dc7fcdc6..fb907bb6562b 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LengthTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LengthTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Removes words that are too long or too short. This token filter is /// implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.LengthTokenFilter")] public partial class LengthTokenFilter : TokenFilter @@ -25,7 +27,10 @@ public partial class LengthTokenFilter : TokenFilter /// /// Initializes a new instance of the LengthTokenFilter class. /// - public LengthTokenFilter() { } + public LengthTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the LengthTokenFilter class. @@ -43,8 +48,14 @@ public LengthTokenFilter() { } { Min = min; Max = max; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the minimum length in characters. Default is 0. /// Maximum is 300. Must be less than the value of max. @@ -79,4 +90,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LimitTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LimitTokenFilter.cs index c8e31778a151..f4d0bc649342 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LimitTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LimitTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,18 +6,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; /// /// Limits the number of tokens while indexing. This token filter is /// implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.LimitTokenFilter")] public partial class LimitTokenFilter : TokenFilter @@ -24,7 +26,10 @@ public partial class LimitTokenFilter : TokenFilter /// /// Initializes a new instance of the LimitTokenFilter class. /// - public LimitTokenFilter() { } + public LimitTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the LimitTokenFilter class. @@ -43,8 +48,14 @@ public LimitTokenFilter() { } { MaxTokenCount = maxTokenCount; ConsumeAllTokens = consumeAllTokens; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum number of tokens to produce. Default is 1. /// @@ -71,4 +82,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringFunction.cs index c5adef6c93da..5d39a8ae877d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringFunction.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringFunction.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Defines a function that boosts scores based on the magnitude of a /// numeric field. - /// + /// /// [Newtonsoft.Json.JsonObject("magnitude")] public partial class MagnitudeScoringFunction : ScoringFunction @@ -25,7 +27,10 @@ public partial class MagnitudeScoringFunction : ScoringFunction /// /// Initializes a new instance of the MagnitudeScoringFunction class. /// - public MagnitudeScoringFunction() { } + public MagnitudeScoringFunction() + { + CustomInit(); + } /// /// Initializes a new instance of the MagnitudeScoringFunction class. @@ -44,8 +49,14 @@ public MagnitudeScoringFunction() { } : base(fieldName, boost, interpolation) { Parameters = parameters; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets parameter values for the magnitude scoring function. /// @@ -72,4 +83,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringParameters.cs index e454a1b26683..a3899bd24283 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringParameters.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringParameters.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,10 @@ public partial class MagnitudeScoringParameters /// /// Initializes a new instance of the MagnitudeScoringParameters class. /// - public MagnitudeScoringParameters() { } + public MagnitudeScoringParameters() + { + CustomInit(); + } /// /// Initializes a new instance of the MagnitudeScoringParameters class. @@ -38,8 +41,14 @@ public MagnitudeScoringParameters() { } BoostingRangeStart = boostingRangeStart; BoostingRangeEnd = boostingRangeEnd; ShouldBoostBeyondRangeByConstant = shouldBoostBeyondRangeByConstant; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the field value at which boosting starts. /// @@ -71,4 +80,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MappingCharFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MappingCharFilter.cs index 1e972669c57b..a1cf56d97b9e 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MappingCharFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MappingCharFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,7 +21,9 @@ namespace Microsoft.Azure.Search.Models /// 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. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.MappingCharFilter")] public partial class MappingCharFilter : CharFilter @@ -29,7 +31,10 @@ public partial class MappingCharFilter : CharFilter /// /// Initializes a new instance of the MappingCharFilter class. /// - public MappingCharFilter() { } + public MappingCharFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the MappingCharFilter class. @@ -45,8 +50,14 @@ public MappingCharFilter(string name, IList mappings) : base(name) { Mappings = mappings; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a list of mappings of the following format: /// "a=>b" (all occurrences of the character "a" will be @@ -71,4 +82,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageStemmingTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageStemmingTokenizer.cs index bbacc988c384..8cfa8818b25b 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageStemmingTokenizer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageStemmingTokenizer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -25,7 +25,10 @@ public partial class MicrosoftLanguageStemmingTokenizer : Tokenizer /// Initializes a new instance of the /// MicrosoftLanguageStemmingTokenizer class. /// - public MicrosoftLanguageStemmingTokenizer() { } + public MicrosoftLanguageStemmingTokenizer() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -62,8 +65,14 @@ public MicrosoftLanguageStemmingTokenizer() { } MaxTokenLength = maxTokenLength; IsSearchTokenizer = isSearchTokenizer; Language = language; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum token length. Tokens longer than the /// maximum length are split. Maximum token length that can be used is @@ -114,4 +123,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageTokenizer.cs index 61b052e7ad6a..b1f31ade3c17 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageTokenizer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageTokenizer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +23,10 @@ public partial class MicrosoftLanguageTokenizer : Tokenizer /// /// Initializes a new instance of the MicrosoftLanguageTokenizer class. /// - public MicrosoftLanguageTokenizer() { } + public MicrosoftLanguageTokenizer() + { + CustomInit(); + } /// /// Initializes a new instance of the MicrosoftLanguageTokenizer class. @@ -58,8 +61,14 @@ public MicrosoftLanguageTokenizer() { } MaxTokenLength = maxTokenLength; IsSearchTokenizer = isSearchTokenizer; Language = language; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum token length. Tokens longer than the /// maximum length are split. Maximum token length that can be used is @@ -109,4 +118,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftStemmingTokenizerLanguage.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftStemmingTokenizerLanguage.cs index efb7e5f7ae42..1a71b84e286d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftStemmingTokenizerLanguage.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftStemmingTokenizerLanguage.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for MicrosoftStemmingTokenizerLanguage. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum MicrosoftStemmingTokenizerLanguage { [EnumMember(Value = "arabic")] @@ -112,5 +112,207 @@ public enum MicrosoftStemmingTokenizerLanguage [EnumMember(Value = "urdu")] Urdu } -} + internal static class MicrosoftStemmingTokenizerLanguageEnumExtension + { + internal static string ToSerializedValue(this MicrosoftStemmingTokenizerLanguage? value) + { + return value == null ? null : ((MicrosoftStemmingTokenizerLanguage)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this MicrosoftStemmingTokenizerLanguage value) + { + switch( value ) + { + case MicrosoftStemmingTokenizerLanguage.Arabic: + return "arabic"; + case MicrosoftStemmingTokenizerLanguage.Bangla: + return "bangla"; + case MicrosoftStemmingTokenizerLanguage.Bulgarian: + return "bulgarian"; + case MicrosoftStemmingTokenizerLanguage.Catalan: + return "catalan"; + case MicrosoftStemmingTokenizerLanguage.Croatian: + return "croatian"; + case MicrosoftStemmingTokenizerLanguage.Czech: + return "czech"; + case MicrosoftStemmingTokenizerLanguage.Danish: + return "danish"; + case MicrosoftStemmingTokenizerLanguage.Dutch: + return "dutch"; + case MicrosoftStemmingTokenizerLanguage.English: + return "english"; + case MicrosoftStemmingTokenizerLanguage.Estonian: + return "estonian"; + case MicrosoftStemmingTokenizerLanguage.Finnish: + return "finnish"; + case MicrosoftStemmingTokenizerLanguage.French: + return "french"; + case MicrosoftStemmingTokenizerLanguage.German: + return "german"; + case MicrosoftStemmingTokenizerLanguage.Greek: + return "greek"; + case MicrosoftStemmingTokenizerLanguage.Gujarati: + return "gujarati"; + case MicrosoftStemmingTokenizerLanguage.Hebrew: + return "hebrew"; + case MicrosoftStemmingTokenizerLanguage.Hindi: + return "hindi"; + case MicrosoftStemmingTokenizerLanguage.Hungarian: + return "hungarian"; + case MicrosoftStemmingTokenizerLanguage.Icelandic: + return "icelandic"; + case MicrosoftStemmingTokenizerLanguage.Indonesian: + return "indonesian"; + case MicrosoftStemmingTokenizerLanguage.Italian: + return "italian"; + case MicrosoftStemmingTokenizerLanguage.Kannada: + return "kannada"; + case MicrosoftStemmingTokenizerLanguage.Latvian: + return "latvian"; + case MicrosoftStemmingTokenizerLanguage.Lithuanian: + return "lithuanian"; + case MicrosoftStemmingTokenizerLanguage.Malay: + return "malay"; + case MicrosoftStemmingTokenizerLanguage.Malayalam: + return "malayalam"; + case MicrosoftStemmingTokenizerLanguage.Marathi: + return "marathi"; + case MicrosoftStemmingTokenizerLanguage.NorwegianBokmaal: + return "norwegianBokmaal"; + case MicrosoftStemmingTokenizerLanguage.Polish: + return "polish"; + case MicrosoftStemmingTokenizerLanguage.Portuguese: + return "portuguese"; + case MicrosoftStemmingTokenizerLanguage.PortugueseBrazilian: + return "portugueseBrazilian"; + case MicrosoftStemmingTokenizerLanguage.Punjabi: + return "punjabi"; + case MicrosoftStemmingTokenizerLanguage.Romanian: + return "romanian"; + case MicrosoftStemmingTokenizerLanguage.Russian: + return "russian"; + case MicrosoftStemmingTokenizerLanguage.SerbianCyrillic: + return "serbianCyrillic"; + case MicrosoftStemmingTokenizerLanguage.SerbianLatin: + return "serbianLatin"; + case MicrosoftStemmingTokenizerLanguage.Slovak: + return "slovak"; + case MicrosoftStemmingTokenizerLanguage.Slovenian: + return "slovenian"; + case MicrosoftStemmingTokenizerLanguage.Spanish: + return "spanish"; + case MicrosoftStemmingTokenizerLanguage.Swedish: + return "swedish"; + case MicrosoftStemmingTokenizerLanguage.Tamil: + return "tamil"; + case MicrosoftStemmingTokenizerLanguage.Telugu: + return "telugu"; + case MicrosoftStemmingTokenizerLanguage.Turkish: + return "turkish"; + case MicrosoftStemmingTokenizerLanguage.Ukrainian: + return "ukrainian"; + case MicrosoftStemmingTokenizerLanguage.Urdu: + return "urdu"; + } + return null; + } + internal static MicrosoftStemmingTokenizerLanguage? ParseMicrosoftStemmingTokenizerLanguage(this string value) + { + switch( value ) + { + 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 "norwegianBokmaal": + return MicrosoftStemmingTokenizerLanguage.NorwegianBokmaal; + case "polish": + return MicrosoftStemmingTokenizerLanguage.Polish; + case "portuguese": + return MicrosoftStemmingTokenizerLanguage.Portuguese; + case "portugueseBrazilian": + return MicrosoftStemmingTokenizerLanguage.PortugueseBrazilian; + case "punjabi": + return MicrosoftStemmingTokenizerLanguage.Punjabi; + case "romanian": + return MicrosoftStemmingTokenizerLanguage.Romanian; + case "russian": + return MicrosoftStemmingTokenizerLanguage.Russian; + case "serbianCyrillic": + return MicrosoftStemmingTokenizerLanguage.SerbianCyrillic; + case "serbianLatin": + return MicrosoftStemmingTokenizerLanguage.SerbianLatin; + 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; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftTokenizerLanguage.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftTokenizerLanguage.cs index 3def5a800ab1..953f9d2c3b86 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftTokenizerLanguage.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftTokenizerLanguage.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for MicrosoftTokenizerLanguage. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum MicrosoftTokenizerLanguage { [EnumMember(Value = "bangla")] @@ -106,5 +106,195 @@ public enum MicrosoftTokenizerLanguage [EnumMember(Value = "vietnamese")] Vietnamese } -} + internal static class MicrosoftTokenizerLanguageEnumExtension + { + internal static string ToSerializedValue(this MicrosoftTokenizerLanguage? value) + { + return value == null ? null : ((MicrosoftTokenizerLanguage)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this MicrosoftTokenizerLanguage value) + { + switch( value ) + { + case MicrosoftTokenizerLanguage.Bangla: + return "bangla"; + case MicrosoftTokenizerLanguage.Bulgarian: + return "bulgarian"; + case MicrosoftTokenizerLanguage.Catalan: + return "catalan"; + case MicrosoftTokenizerLanguage.ChineseSimplified: + return "chineseSimplified"; + case MicrosoftTokenizerLanguage.ChineseTraditional: + return "chineseTraditional"; + case MicrosoftTokenizerLanguage.Croatian: + return "croatian"; + case MicrosoftTokenizerLanguage.Czech: + return "czech"; + case MicrosoftTokenizerLanguage.Danish: + return "danish"; + case MicrosoftTokenizerLanguage.Dutch: + return "dutch"; + case MicrosoftTokenizerLanguage.English: + return "english"; + case MicrosoftTokenizerLanguage.French: + return "french"; + case MicrosoftTokenizerLanguage.German: + return "german"; + case MicrosoftTokenizerLanguage.Greek: + return "greek"; + case MicrosoftTokenizerLanguage.Gujarati: + return "gujarati"; + case MicrosoftTokenizerLanguage.Hindi: + return "hindi"; + case MicrosoftTokenizerLanguage.Icelandic: + return "icelandic"; + case MicrosoftTokenizerLanguage.Indonesian: + return "indonesian"; + case MicrosoftTokenizerLanguage.Italian: + return "italian"; + case MicrosoftTokenizerLanguage.Japanese: + return "japanese"; + case MicrosoftTokenizerLanguage.Kannada: + return "kannada"; + case MicrosoftTokenizerLanguage.Korean: + return "korean"; + case MicrosoftTokenizerLanguage.Malay: + return "malay"; + case MicrosoftTokenizerLanguage.Malayalam: + return "malayalam"; + case MicrosoftTokenizerLanguage.Marathi: + return "marathi"; + case MicrosoftTokenizerLanguage.NorwegianBokmaal: + return "norwegianBokmaal"; + case MicrosoftTokenizerLanguage.Polish: + return "polish"; + case MicrosoftTokenizerLanguage.Portuguese: + return "portuguese"; + case MicrosoftTokenizerLanguage.PortugueseBrazilian: + return "portugueseBrazilian"; + case MicrosoftTokenizerLanguage.Punjabi: + return "punjabi"; + case MicrosoftTokenizerLanguage.Romanian: + return "romanian"; + case MicrosoftTokenizerLanguage.Russian: + return "russian"; + case MicrosoftTokenizerLanguage.SerbianCyrillic: + return "serbianCyrillic"; + case MicrosoftTokenizerLanguage.SerbianLatin: + return "serbianLatin"; + case MicrosoftTokenizerLanguage.Slovenian: + return "slovenian"; + case MicrosoftTokenizerLanguage.Spanish: + return "spanish"; + case MicrosoftTokenizerLanguage.Swedish: + return "swedish"; + case MicrosoftTokenizerLanguage.Tamil: + return "tamil"; + case MicrosoftTokenizerLanguage.Telugu: + return "telugu"; + case MicrosoftTokenizerLanguage.Thai: + return "thai"; + case MicrosoftTokenizerLanguage.Ukrainian: + return "ukrainian"; + case MicrosoftTokenizerLanguage.Urdu: + return "urdu"; + case MicrosoftTokenizerLanguage.Vietnamese: + return "vietnamese"; + } + return null; + } + internal static MicrosoftTokenizerLanguage? ParseMicrosoftTokenizerLanguage(this string value) + { + switch( value ) + { + case "bangla": + return MicrosoftTokenizerLanguage.Bangla; + case "bulgarian": + return MicrosoftTokenizerLanguage.Bulgarian; + case "catalan": + return MicrosoftTokenizerLanguage.Catalan; + case "chineseSimplified": + return MicrosoftTokenizerLanguage.ChineseSimplified; + case "chineseTraditional": + return MicrosoftTokenizerLanguage.ChineseTraditional; + 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 "norwegianBokmaal": + return MicrosoftTokenizerLanguage.NorwegianBokmaal; + case "polish": + return MicrosoftTokenizerLanguage.Polish; + case "portuguese": + return MicrosoftTokenizerLanguage.Portuguese; + case "portugueseBrazilian": + return MicrosoftTokenizerLanguage.PortugueseBrazilian; + case "punjabi": + return MicrosoftTokenizerLanguage.Punjabi; + case "romanian": + return MicrosoftTokenizerLanguage.Romanian; + case "russian": + return MicrosoftTokenizerLanguage.Russian; + case "serbianCyrillic": + return MicrosoftTokenizerLanguage.SerbianCyrillic; + case "serbianLatin": + return MicrosoftTokenizerLanguage.SerbianLatin; + 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; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenFilterV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenFilterV2.cs index 62e09dc8168f..3586d75c345a 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenFilterV2.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenFilterV2.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Generates n-grams of the given size(s). This token filter is /// implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.NGramTokenFilterV2")] public partial class NGramTokenFilterV2 : TokenFilter @@ -25,7 +27,10 @@ public partial class NGramTokenFilterV2 : TokenFilter /// /// Initializes a new instance of the NGramTokenFilterV2 class. /// - public NGramTokenFilterV2() { } + public NGramTokenFilterV2() + { + CustomInit(); + } /// /// Initializes a new instance of the NGramTokenFilterV2 class. @@ -43,8 +48,14 @@ public NGramTokenFilterV2() { } { MinGram = minGram; MaxGram = maxGram; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the minimum n-gram length. Default is 1. Maximum is /// 300. Must be less than the value of maxGram. @@ -79,4 +90,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenizer.cs index 2e2e02c0826c..0415d6694ffa 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenizer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenizer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,7 +19,9 @@ namespace Microsoft.Azure.Search.Models /// /// Tokenizes the input into n-grams of the given size(s). This tokenizer /// is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.NGramTokenizer")] public partial class NGramTokenizer : Tokenizer @@ -27,7 +29,10 @@ public partial class NGramTokenizer : Tokenizer /// /// Initializes a new instance of the NGramTokenizer class. /// - public NGramTokenizer() { } + public NGramTokenizer() + { + CustomInit(); + } /// /// Initializes a new instance of the NGramTokenizer class. @@ -48,8 +53,14 @@ public NGramTokenizer() { } MinGram = minGram; MaxGram = maxGram; TokenChars = tokenChars; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the minimum n-gram length. Default is 1. Maximum is /// 300. Must be less than the value of maxGram. @@ -90,4 +101,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PathHierarchyTokenizerV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PathHierarchyTokenizerV2.cs index 1be656bb6771..bacb24191429 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PathHierarchyTokenizerV2.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PathHierarchyTokenizerV2.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Tokenizer for path-like hierarchies. This tokenizer is implemented /// using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.PathHierarchyTokenizerV2")] public partial class PathHierarchyTokenizerV2 : Tokenizer @@ -25,7 +27,10 @@ public partial class PathHierarchyTokenizerV2 : Tokenizer /// /// Initializes a new instance of the PathHierarchyTokenizerV2 class. /// - public PathHierarchyTokenizerV2() { } + public PathHierarchyTokenizerV2() + { + CustomInit(); + } /// /// Initializes a new instance of the PathHierarchyTokenizerV2 class. @@ -52,8 +57,14 @@ public PathHierarchyTokenizerV2() { } MaxTokenLength = maxTokenLength; ReverseTokenOrder = reverseTokenOrder; NumberOfTokensToSkip = numberOfTokensToSkip; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the delimiter character to use. Default is "/". /// @@ -102,4 +113,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternAnalyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternAnalyzer.cs index dee3273f97b1..b052129cbee5 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternAnalyzer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternAnalyzer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Search.Models /// /// Flexibly separates text into terms via a regular expression pattern. /// This analyzer is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.PatternAnalyzer")] public partial class PatternAnalyzer : Analyzer @@ -26,7 +28,10 @@ public partial class PatternAnalyzer : Analyzer /// /// Initializes a new instance of the PatternAnalyzer class. /// - public PatternAnalyzer() { } + public PatternAnalyzer() + { + CustomInit(); + } /// /// Initializes a new instance of the PatternAnalyzer class. @@ -49,8 +54,14 @@ public PatternAnalyzer() { } Pattern = pattern; Flags = flags; Stopwords = stopwords; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a value indicating whether terms should be /// lower-cased. Default is true. @@ -90,4 +101,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternCaptureTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternCaptureTokenFilter.cs index 9bd46c8d3317..83cefdea0a75 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternCaptureTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternCaptureTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -20,7 +20,9 @@ namespace Microsoft.Azure.Search.Models /// 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. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.PatternCaptureTokenFilter")] public partial class PatternCaptureTokenFilter : TokenFilter @@ -28,7 +30,10 @@ public partial class PatternCaptureTokenFilter : TokenFilter /// /// Initializes a new instance of the PatternCaptureTokenFilter class. /// - public PatternCaptureTokenFilter() { } + public PatternCaptureTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the PatternCaptureTokenFilter class. @@ -47,8 +52,14 @@ public PatternCaptureTokenFilter() { } { Patterns = patterns; PreserveOriginal = preserveOriginal; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a list of patterns to match against each token. /// @@ -78,4 +89,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceCharFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceCharFilter.cs index bc27bf69926a..43825aa32bba 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceCharFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceCharFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,9 @@ namespace Microsoft.Azure.Search.Models /// 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. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.PatternReplaceCharFilter")] public partial class PatternReplaceCharFilter : CharFilter @@ -29,7 +31,10 @@ public partial class PatternReplaceCharFilter : CharFilter /// /// Initializes a new instance of the PatternReplaceCharFilter class. /// - public PatternReplaceCharFilter() { } + public PatternReplaceCharFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the PatternReplaceCharFilter class. @@ -45,8 +50,14 @@ public PatternReplaceCharFilter(string name, string pattern, string replacement) { Pattern = pattern; Replacement = replacement; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a regular expression pattern. /// @@ -79,4 +90,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceTokenFilter.cs index 3b60886355ef..2e6c33a12a81 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,9 @@ namespace Microsoft.Azure.Search.Models /// 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. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.PatternReplaceTokenFilter")] public partial class PatternReplaceTokenFilter : TokenFilter @@ -29,7 +31,10 @@ public partial class PatternReplaceTokenFilter : TokenFilter /// /// Initializes a new instance of the PatternReplaceTokenFilter class. /// - public PatternReplaceTokenFilter() { } + public PatternReplaceTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the PatternReplaceTokenFilter class. @@ -45,8 +50,14 @@ public PatternReplaceTokenFilter(string name, string pattern, string replacement { Pattern = pattern; Replacement = replacement; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a regular expression pattern. /// @@ -79,4 +90,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternTokenizer.cs index 2844e904807d..2ec4e0286530 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternTokenizer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternTokenizer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,18 +6,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; /// /// Tokenizer that uses regex pattern matching to construct distinct /// tokens. This tokenizer is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.PatternTokenizer")] public partial class PatternTokenizer : Tokenizer @@ -24,7 +26,10 @@ public partial class PatternTokenizer : Tokenizer /// /// Initializes a new instance of the PatternTokenizer class. /// - public PatternTokenizer() { } + public PatternTokenizer() + { + CustomInit(); + } /// /// Initializes a new instance of the PatternTokenizer class. @@ -47,8 +52,14 @@ public PatternTokenizer() { } Pattern = pattern; Flags = flags; Group = group; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a regular expression pattern to match token /// separators. Default is an expression that matches one or more @@ -84,4 +95,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticEncoder.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticEncoder.cs index 8f714c7c81a1..42920360a520 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticEncoder.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticEncoder.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for PhoneticEncoder. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum PhoneticEncoder { [EnumMember(Value = "metaphone")] @@ -44,5 +44,71 @@ public enum PhoneticEncoder [EnumMember(Value = "beiderMorse")] BeiderMorse } -} + internal static class PhoneticEncoderEnumExtension + { + internal static string ToSerializedValue(this PhoneticEncoder? value) + { + return value == null ? null : ((PhoneticEncoder)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this PhoneticEncoder value) + { + switch( value ) + { + case PhoneticEncoder.Metaphone: + return "metaphone"; + case PhoneticEncoder.DoubleMetaphone: + return "doubleMetaphone"; + case PhoneticEncoder.Soundex: + return "soundex"; + case PhoneticEncoder.RefinedSoundex: + return "refinedSoundex"; + case PhoneticEncoder.Caverphone1: + return "caverphone1"; + case PhoneticEncoder.Caverphone2: + return "caverphone2"; + case PhoneticEncoder.Cologne: + return "cologne"; + case PhoneticEncoder.Nysiis: + return "nysiis"; + case PhoneticEncoder.KoelnerPhonetik: + return "koelnerPhonetik"; + case PhoneticEncoder.HaasePhonetik: + return "haasePhonetik"; + case PhoneticEncoder.BeiderMorse: + return "beiderMorse"; + } + return null; + } + internal static PhoneticEncoder? ParsePhoneticEncoder(this string value) + { + switch( value ) + { + case "metaphone": + return PhoneticEncoder.Metaphone; + case "doubleMetaphone": + return PhoneticEncoder.DoubleMetaphone; + case "soundex": + return PhoneticEncoder.Soundex; + case "refinedSoundex": + return PhoneticEncoder.RefinedSoundex; + case "caverphone1": + return PhoneticEncoder.Caverphone1; + case "caverphone2": + return PhoneticEncoder.Caverphone2; + case "cologne": + return PhoneticEncoder.Cologne; + case "nysiis": + return PhoneticEncoder.Nysiis; + case "koelnerPhonetik": + return PhoneticEncoder.KoelnerPhonetik; + case "haasePhonetik": + return PhoneticEncoder.HaasePhonetik; + case "beiderMorse": + return PhoneticEncoder.BeiderMorse; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticTokenFilter.cs index 989ae837ceb7..2f95a0530c09 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,18 +6,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; /// /// Create tokens for phonetic matches. This token filter is implemented /// using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.PhoneticTokenFilter")] public partial class PhoneticTokenFilter : TokenFilter @@ -24,7 +26,10 @@ public partial class PhoneticTokenFilter : TokenFilter /// /// Initializes a new instance of the PhoneticTokenFilter class. /// - public PhoneticTokenFilter() { } + public PhoneticTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the PhoneticTokenFilter class. @@ -46,8 +51,14 @@ public PhoneticTokenFilter() { } { Encoder = encoder; ReplaceOriginalTokens = replaceOriginalTokens; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the phonetic encoder to use. Default is "metaphone". /// Possible values include: 'metaphone', 'doubleMetaphone', 'soundex', @@ -77,4 +88,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunction.cs index c875bfcaaa19..543e7d70f6a9 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunction.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunction.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,26 +6,30 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Abstract base class for functions that can modify document scores /// during ranking. - /// + /// /// public partial class ScoringFunction { /// /// Initializes a new instance of the ScoringFunction class. /// - public ScoringFunction() { } + public ScoringFunction() + { + CustomInit(); + } /// /// Initializes a new instance of the ScoringFunction class. @@ -42,8 +47,14 @@ public ScoringFunction() { } FieldName = fieldName; Boost = boost; Interpolation = interpolation; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the field used as input to the scoring /// function. @@ -81,4 +92,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionAggregation.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionAggregation.cs index d1a43039d561..6eca1d6b1a19 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionAggregation.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionAggregation.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for ScoringFunctionAggregation. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ScoringFunctionAggregation { [EnumMember(Value = "sum")] @@ -32,5 +32,47 @@ public enum ScoringFunctionAggregation [EnumMember(Value = "firstMatching")] FirstMatching } -} + internal static class ScoringFunctionAggregationEnumExtension + { + internal static string ToSerializedValue(this ScoringFunctionAggregation? value) + { + return value == null ? null : ((ScoringFunctionAggregation)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ScoringFunctionAggregation value) + { + switch( value ) + { + case ScoringFunctionAggregation.Sum: + return "sum"; + case ScoringFunctionAggregation.Average: + return "average"; + case ScoringFunctionAggregation.Minimum: + return "minimum"; + case ScoringFunctionAggregation.Maximum: + return "maximum"; + case ScoringFunctionAggregation.FirstMatching: + return "firstMatching"; + } + return null; + } + internal static ScoringFunctionAggregation? ParseScoringFunctionAggregation(this string value) + { + switch( value ) + { + case "sum": + return ScoringFunctionAggregation.Sum; + case "average": + return ScoringFunctionAggregation.Average; + case "minimum": + return ScoringFunctionAggregation.Minimum; + case "maximum": + return ScoringFunctionAggregation.Maximum; + case "firstMatching": + return ScoringFunctionAggregation.FirstMatching; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionInterpolation.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionInterpolation.cs index 72964a6a60ff..e7c6c50f4310 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionInterpolation.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionInterpolation.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for ScoringFunctionInterpolation. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ScoringFunctionInterpolation { [EnumMember(Value = "linear")] @@ -30,5 +30,43 @@ public enum ScoringFunctionInterpolation [EnumMember(Value = "logarithmic")] Logarithmic } -} + internal static class ScoringFunctionInterpolationEnumExtension + { + internal static string ToSerializedValue(this ScoringFunctionInterpolation? value) + { + return value == null ? null : ((ScoringFunctionInterpolation)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ScoringFunctionInterpolation value) + { + switch( value ) + { + case ScoringFunctionInterpolation.Linear: + return "linear"; + case ScoringFunctionInterpolation.Constant: + return "constant"; + case ScoringFunctionInterpolation.Quadratic: + return "quadratic"; + case ScoringFunctionInterpolation.Logarithmic: + return "logarithmic"; + } + return null; + } + internal static ScoringFunctionInterpolation? ParseScoringFunctionInterpolation(this string value) + { + switch( value ) + { + case "linear": + return ScoringFunctionInterpolation.Linear; + case "constant": + return ScoringFunctionInterpolation.Constant; + case "quadratic": + return ScoringFunctionInterpolation.Quadratic; + case "logarithmic": + return ScoringFunctionInterpolation.Logarithmic; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringProfile.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringProfile.cs index 5cfc85658087..dc87b38e580b 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringProfile.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringProfile.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,14 +19,19 @@ namespace Microsoft.Azure.Search.Models /// /// Defines parameters for an Azure Search index that influence scoring in /// search queries. - /// + /// /// public partial class ScoringProfile { /// /// Initializes a new instance of the ScoringProfile class. /// - public ScoringProfile() { } + public ScoringProfile() + { + CustomInit(); + } /// /// Initializes a new instance of the ScoringProfile class. @@ -47,8 +52,14 @@ public ScoringProfile() { } TextWeights = textWeights; Functions = functions; FunctionAggregation = functionAggregation; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the scoring profile. /// @@ -107,4 +118,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SearchRequestOptions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SearchRequestOptions.cs index 264c2ebd7018..833247b16fbf 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SearchRequestOptions.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SearchRequestOptions.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,10 @@ public partial class SearchRequestOptions /// /// Initializes a new instance of the SearchRequestOptions class. /// - public SearchRequestOptions() { } + public SearchRequestOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the SearchRequestOptions class. @@ -31,15 +34,20 @@ public SearchRequestOptions() { } public SearchRequestOptions(System.Guid? clientRequestId = default(System.Guid?)) { ClientRequestId = clientRequestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the tracking ID sent with the request to help with /// debugging. /// - [JsonProperty(PropertyName = "")] + [Newtonsoft.Json.JsonIgnore] public System.Guid? ClientRequestId { get; set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ShingleTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ShingleTokenFilter.cs index 727aae7c32cc..4ab7584302a4 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ShingleTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ShingleTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Creates combinations of tokens as a single token. This token filter is /// implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.ShingleTokenFilter")] public partial class ShingleTokenFilter : TokenFilter @@ -25,7 +27,10 @@ public partial class ShingleTokenFilter : TokenFilter /// /// Initializes a new instance of the ShingleTokenFilter class. /// - public ShingleTokenFilter() { } + public ShingleTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the ShingleTokenFilter class. @@ -60,8 +65,14 @@ public ShingleTokenFilter() { } OutputUnigramsIfNoShingles = outputUnigramsIfNoShingles; TokenSeparator = tokenSeparator; FilterToken = filterToken; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum shingle size. Default and minimum value is /// 2. @@ -126,4 +137,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilter.cs index 9816fef26e25..7837de01cb6e 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,18 +6,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; /// /// A filter that stems words using a Snowball-generated stemmer. This /// token filter is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.SnowballTokenFilter")] public partial class SnowballTokenFilter : TokenFilter @@ -24,7 +26,10 @@ public partial class SnowballTokenFilter : TokenFilter /// /// Initializes a new instance of the SnowballTokenFilter class. /// - public SnowballTokenFilter() { } + public SnowballTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the SnowballTokenFilter class. @@ -42,8 +47,14 @@ public SnowballTokenFilter(string name, SnowballTokenFilterLanguage language) : base(name) { Language = language; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the language to use. Possible values include: /// 'armenian', 'basque', 'catalan', 'danish', 'dutch', 'english', @@ -66,4 +77,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilterLanguage.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilterLanguage.cs index 53cd92f47d14..bd26cec60edb 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilterLanguage.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilterLanguage.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for SnowballTokenFilterLanguage. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum SnowballTokenFilterLanguage { [EnumMember(Value = "armenian")] @@ -66,5 +66,115 @@ public enum SnowballTokenFilterLanguage [EnumMember(Value = "turkish")] Turkish } -} + internal static class SnowballTokenFilterLanguageEnumExtension + { + internal static string ToSerializedValue(this SnowballTokenFilterLanguage? value) + { + return value == null ? null : ((SnowballTokenFilterLanguage)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SnowballTokenFilterLanguage value) + { + switch( value ) + { + case SnowballTokenFilterLanguage.Armenian: + return "armenian"; + case SnowballTokenFilterLanguage.Basque: + return "basque"; + case SnowballTokenFilterLanguage.Catalan: + return "catalan"; + case SnowballTokenFilterLanguage.Danish: + return "danish"; + case SnowballTokenFilterLanguage.Dutch: + return "dutch"; + case SnowballTokenFilterLanguage.English: + return "english"; + case SnowballTokenFilterLanguage.Finnish: + return "finnish"; + case SnowballTokenFilterLanguage.French: + return "french"; + case SnowballTokenFilterLanguage.German: + return "german"; + case SnowballTokenFilterLanguage.German2: + return "german2"; + case SnowballTokenFilterLanguage.Hungarian: + return "hungarian"; + case SnowballTokenFilterLanguage.Italian: + return "italian"; + case SnowballTokenFilterLanguage.Kp: + return "kp"; + case SnowballTokenFilterLanguage.Lovins: + return "lovins"; + case SnowballTokenFilterLanguage.Norwegian: + return "norwegian"; + case SnowballTokenFilterLanguage.Porter: + return "porter"; + case SnowballTokenFilterLanguage.Portuguese: + return "portuguese"; + case SnowballTokenFilterLanguage.Romanian: + return "romanian"; + case SnowballTokenFilterLanguage.Russian: + return "russian"; + case SnowballTokenFilterLanguage.Spanish: + return "spanish"; + case SnowballTokenFilterLanguage.Swedish: + return "swedish"; + case SnowballTokenFilterLanguage.Turkish: + return "turkish"; + } + return null; + } + internal static SnowballTokenFilterLanguage? ParseSnowballTokenFilterLanguage(this string value) + { + switch( value ) + { + 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; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SoftDeleteColumnDeletionDetectionPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SoftDeleteColumnDeletionDetectionPolicy.cs index ad06acb6b685..5d980464fb56 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SoftDeleteColumnDeletionDetectionPolicy.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SoftDeleteColumnDeletionDetectionPolicy.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -25,7 +25,10 @@ public partial class SoftDeleteColumnDeletionDetectionPolicy : DataDeletionDetec /// Initializes a new instance of the /// SoftDeleteColumnDeletionDetectionPolicy class. /// - public SoftDeleteColumnDeletionDetectionPolicy() { } + public SoftDeleteColumnDeletionDetectionPolicy() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -39,8 +42,14 @@ public SoftDeleteColumnDeletionDetectionPolicy() { } { SoftDeleteColumnName = softDeleteColumnName; SoftDeleteMarkerValue = softDeleteMarkerValue; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the column to use for soft-deletion /// detection. @@ -56,4 +65,3 @@ public SoftDeleteColumnDeletionDetectionPolicy() { } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SqlIntegratedChangeTrackingPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SqlIntegratedChangeTrackingPolicy.cs index 8964f62273d1..3528a99a8cbd 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SqlIntegratedChangeTrackingPolicy.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SqlIntegratedChangeTrackingPolicy.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -24,9 +24,16 @@ public partial class SqlIntegratedChangeTrackingPolicy : DataChangeDetectionPoli /// Initializes a new instance of the SqlIntegratedChangeTrackingPolicy /// class. /// - public SqlIntegratedChangeTrackingPolicy() { } + public SqlIntegratedChangeTrackingPolicy() + { + CustomInit(); + } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardAnalyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardAnalyzer.cs index 31bc1d72fb04..7b2874eb7260 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardAnalyzer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardAnalyzer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,7 +19,9 @@ namespace Microsoft.Azure.Search.Models /// /// Standard Apache Lucene analyzer; Composed of the standard tokenizer, /// lowercase filter and stop filter. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StandardAnalyzer")] public partial class StandardAnalyzer : Analyzer @@ -27,7 +29,10 @@ public partial class StandardAnalyzer : Analyzer /// /// Initializes a new instance of the StandardAnalyzer class. /// - public StandardAnalyzer() { } + public StandardAnalyzer() + { + CustomInit(); + } /// /// Initializes a new instance of the StandardAnalyzer class. @@ -45,8 +50,14 @@ public StandardAnalyzer() { } { MaxTokenLength = maxTokenLength; Stopwords = stopwords; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum token length. Default is 255. Tokens /// longer than the maximum length are split. The maximum token length @@ -77,4 +88,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardTokenizerV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardTokenizerV2.cs index ef9464de1260..08a185e07724 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardTokenizerV2.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardTokenizerV2.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Breaks text following the Unicode Text Segmentation rules. This /// tokenizer is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StandardTokenizerV2")] public partial class StandardTokenizerV2 : Tokenizer @@ -25,7 +27,10 @@ public partial class StandardTokenizerV2 : Tokenizer /// /// Initializes a new instance of the StandardTokenizerV2 class. /// - public StandardTokenizerV2() { } + public StandardTokenizerV2() + { + CustomInit(); + } /// /// Initializes a new instance of the StandardTokenizerV2 class. @@ -41,8 +46,14 @@ public StandardTokenizerV2() { } : base(name) { MaxTokenLength = maxTokenLength; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum token length. Default is 255. Tokens /// longer than the maximum length are split. The maximum token length @@ -67,4 +78,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerOverrideTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerOverrideTokenFilter.cs index adb26f3c2b8c..0ab7272c209e 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerOverrideTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerOverrideTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -22,7 +22,9 @@ namespace Microsoft.Azure.Search.Models /// 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. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StemmerOverrideTokenFilter")] public partial class StemmerOverrideTokenFilter : TokenFilter @@ -30,7 +32,10 @@ public partial class StemmerOverrideTokenFilter : TokenFilter /// /// Initializes a new instance of the StemmerOverrideTokenFilter class. /// - public StemmerOverrideTokenFilter() { } + public StemmerOverrideTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the StemmerOverrideTokenFilter class. @@ -45,8 +50,14 @@ public StemmerOverrideTokenFilter(string name, IList rules) : base(name) { Rules = rules; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a list of stemming rules in the following format: /// "word => stem", for example: "ran => run". @@ -70,4 +81,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilter.cs index 8732f7423b15..83539dd1d243 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,18 +6,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; /// /// Language specific stemming filter. This token filter is implemented /// using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StemmerTokenFilter")] public partial class StemmerTokenFilter : TokenFilter @@ -24,7 +26,10 @@ public partial class StemmerTokenFilter : TokenFilter /// /// Initializes a new instance of the StemmerTokenFilter class. /// - public StemmerTokenFilter() { } + public StemmerTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the StemmerTokenFilter class. @@ -50,8 +55,14 @@ public StemmerTokenFilter(string name, StemmerTokenFilterLanguage language) : base(name) { Language = language; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the language to use. Possible values include: /// 'arabic', 'armenian', 'basque', 'brazilian', 'bulgarian', @@ -82,4 +93,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilterLanguage.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilterLanguage.cs index e8a232fd32e4..0d5285e74fa4 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilterLanguage.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilterLanguage.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for StemmerTokenFilterLanguage. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum StemmerTokenFilterLanguage { [EnumMember(Value = "arabic")] @@ -130,5 +130,243 @@ public enum StemmerTokenFilterLanguage [EnumMember(Value = "turkish")] Turkish } -} + internal static class StemmerTokenFilterLanguageEnumExtension + { + internal static string ToSerializedValue(this StemmerTokenFilterLanguage? value) + { + return value == null ? null : ((StemmerTokenFilterLanguage)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this StemmerTokenFilterLanguage value) + { + switch( value ) + { + case StemmerTokenFilterLanguage.Arabic: + return "arabic"; + case StemmerTokenFilterLanguage.Armenian: + return "armenian"; + case StemmerTokenFilterLanguage.Basque: + return "basque"; + case StemmerTokenFilterLanguage.Brazilian: + return "brazilian"; + case StemmerTokenFilterLanguage.Bulgarian: + return "bulgarian"; + case StemmerTokenFilterLanguage.Catalan: + return "catalan"; + case StemmerTokenFilterLanguage.Czech: + return "czech"; + case StemmerTokenFilterLanguage.Danish: + return "danish"; + case StemmerTokenFilterLanguage.Dutch: + return "dutch"; + case StemmerTokenFilterLanguage.DutchKp: + return "dutchKp"; + case StemmerTokenFilterLanguage.English: + return "english"; + case StemmerTokenFilterLanguage.LightEnglish: + return "lightEnglish"; + case StemmerTokenFilterLanguage.MinimalEnglish: + return "minimalEnglish"; + case StemmerTokenFilterLanguage.PossessiveEnglish: + return "possessiveEnglish"; + case StemmerTokenFilterLanguage.Porter2: + return "porter2"; + case StemmerTokenFilterLanguage.Lovins: + return "lovins"; + case StemmerTokenFilterLanguage.Finnish: + return "finnish"; + case StemmerTokenFilterLanguage.LightFinnish: + return "lightFinnish"; + case StemmerTokenFilterLanguage.French: + return "french"; + case StemmerTokenFilterLanguage.LightFrench: + return "lightFrench"; + case StemmerTokenFilterLanguage.MinimalFrench: + return "minimalFrench"; + case StemmerTokenFilterLanguage.Galician: + return "galician"; + case StemmerTokenFilterLanguage.MinimalGalician: + return "minimalGalician"; + case StemmerTokenFilterLanguage.German: + return "german"; + case StemmerTokenFilterLanguage.German2: + return "german2"; + case StemmerTokenFilterLanguage.LightGerman: + return "lightGerman"; + case StemmerTokenFilterLanguage.MinimalGerman: + return "minimalGerman"; + case StemmerTokenFilterLanguage.Greek: + return "greek"; + case StemmerTokenFilterLanguage.Hindi: + return "hindi"; + case StemmerTokenFilterLanguage.Hungarian: + return "hungarian"; + case StemmerTokenFilterLanguage.LightHungarian: + return "lightHungarian"; + case StemmerTokenFilterLanguage.Indonesian: + return "indonesian"; + case StemmerTokenFilterLanguage.Irish: + return "irish"; + case StemmerTokenFilterLanguage.Italian: + return "italian"; + case StemmerTokenFilterLanguage.LightItalian: + return "lightItalian"; + case StemmerTokenFilterLanguage.Sorani: + return "sorani"; + case StemmerTokenFilterLanguage.Latvian: + return "latvian"; + case StemmerTokenFilterLanguage.Norwegian: + return "norwegian"; + case StemmerTokenFilterLanguage.LightNorwegian: + return "lightNorwegian"; + case StemmerTokenFilterLanguage.MinimalNorwegian: + return "minimalNorwegian"; + case StemmerTokenFilterLanguage.LightNynorsk: + return "lightNynorsk"; + case StemmerTokenFilterLanguage.MinimalNynorsk: + return "minimalNynorsk"; + case StemmerTokenFilterLanguage.Portuguese: + return "portuguese"; + case StemmerTokenFilterLanguage.LightPortuguese: + return "lightPortuguese"; + case StemmerTokenFilterLanguage.MinimalPortuguese: + return "minimalPortuguese"; + case StemmerTokenFilterLanguage.PortugueseRslp: + return "portugueseRslp"; + case StemmerTokenFilterLanguage.Romanian: + return "romanian"; + case StemmerTokenFilterLanguage.Russian: + return "russian"; + case StemmerTokenFilterLanguage.LightRussian: + return "lightRussian"; + case StemmerTokenFilterLanguage.Spanish: + return "spanish"; + case StemmerTokenFilterLanguage.LightSpanish: + return "lightSpanish"; + case StemmerTokenFilterLanguage.Swedish: + return "swedish"; + case StemmerTokenFilterLanguage.LightSwedish: + return "lightSwedish"; + case StemmerTokenFilterLanguage.Turkish: + return "turkish"; + } + return null; + } + internal static StemmerTokenFilterLanguage? ParseStemmerTokenFilterLanguage(this string value) + { + switch( value ) + { + 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 "dutchKp": + return StemmerTokenFilterLanguage.DutchKp; + case "english": + return StemmerTokenFilterLanguage.English; + case "lightEnglish": + return StemmerTokenFilterLanguage.LightEnglish; + case "minimalEnglish": + return StemmerTokenFilterLanguage.MinimalEnglish; + case "possessiveEnglish": + return StemmerTokenFilterLanguage.PossessiveEnglish; + case "porter2": + return StemmerTokenFilterLanguage.Porter2; + case "lovins": + return StemmerTokenFilterLanguage.Lovins; + case "finnish": + return StemmerTokenFilterLanguage.Finnish; + case "lightFinnish": + return StemmerTokenFilterLanguage.LightFinnish; + case "french": + return StemmerTokenFilterLanguage.French; + case "lightFrench": + return StemmerTokenFilterLanguage.LightFrench; + case "minimalFrench": + return StemmerTokenFilterLanguage.MinimalFrench; + case "galician": + return StemmerTokenFilterLanguage.Galician; + case "minimalGalician": + return StemmerTokenFilterLanguage.MinimalGalician; + case "german": + return StemmerTokenFilterLanguage.German; + case "german2": + return StemmerTokenFilterLanguage.German2; + case "lightGerman": + return StemmerTokenFilterLanguage.LightGerman; + case "minimalGerman": + return StemmerTokenFilterLanguage.MinimalGerman; + case "greek": + return StemmerTokenFilterLanguage.Greek; + case "hindi": + return StemmerTokenFilterLanguage.Hindi; + case "hungarian": + return StemmerTokenFilterLanguage.Hungarian; + case "lightHungarian": + return StemmerTokenFilterLanguage.LightHungarian; + case "indonesian": + return StemmerTokenFilterLanguage.Indonesian; + case "irish": + return StemmerTokenFilterLanguage.Irish; + case "italian": + return StemmerTokenFilterLanguage.Italian; + case "lightItalian": + return StemmerTokenFilterLanguage.LightItalian; + case "sorani": + return StemmerTokenFilterLanguage.Sorani; + case "latvian": + return StemmerTokenFilterLanguage.Latvian; + case "norwegian": + return StemmerTokenFilterLanguage.Norwegian; + case "lightNorwegian": + return StemmerTokenFilterLanguage.LightNorwegian; + case "minimalNorwegian": + return StemmerTokenFilterLanguage.MinimalNorwegian; + case "lightNynorsk": + return StemmerTokenFilterLanguage.LightNynorsk; + case "minimalNynorsk": + return StemmerTokenFilterLanguage.MinimalNynorsk; + case "portuguese": + return StemmerTokenFilterLanguage.Portuguese; + case "lightPortuguese": + return StemmerTokenFilterLanguage.LightPortuguese; + case "minimalPortuguese": + return StemmerTokenFilterLanguage.MinimalPortuguese; + case "portugueseRslp": + return StemmerTokenFilterLanguage.PortugueseRslp; + case "romanian": + return StemmerTokenFilterLanguage.Romanian; + case "russian": + return StemmerTokenFilterLanguage.Russian; + case "lightRussian": + return StemmerTokenFilterLanguage.LightRussian; + case "spanish": + return StemmerTokenFilterLanguage.Spanish; + case "lightSpanish": + return StemmerTokenFilterLanguage.LightSpanish; + case "swedish": + return StemmerTokenFilterLanguage.Swedish; + case "lightSwedish": + return StemmerTokenFilterLanguage.LightSwedish; + case "turkish": + return StemmerTokenFilterLanguage.Turkish; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopAnalyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopAnalyzer.cs index 714f1d22c121..fb15a22e0a32 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopAnalyzer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopAnalyzer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Search.Models /// /// Divides text at non-letters; Applies the lowercase and stopword token /// filters. This analyzer is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StopAnalyzer")] public partial class StopAnalyzer : Analyzer @@ -26,7 +28,10 @@ public partial class StopAnalyzer : Analyzer /// /// Initializes a new instance of the StopAnalyzer class. /// - public StopAnalyzer() { } + public StopAnalyzer() + { + CustomInit(); + } /// /// Initializes a new instance of the StopAnalyzer class. @@ -40,8 +45,14 @@ public StopAnalyzer() { } : base(name) { Stopwords = stopwords; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a list of stopwords. /// @@ -60,4 +71,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsList.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsList.cs index 8712c398890a..e5b458f2f271 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsList.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsList.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for StopwordsList. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum StopwordsList { [EnumMember(Value = "arabic")] @@ -84,5 +84,151 @@ public enum StopwordsList [EnumMember(Value = "turkish")] Turkish } -} + internal static class StopwordsListEnumExtension + { + internal static string ToSerializedValue(this StopwordsList? value) + { + return value == null ? null : ((StopwordsList)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this StopwordsList value) + { + switch( value ) + { + case StopwordsList.Arabic: + return "arabic"; + case StopwordsList.Armenian: + return "armenian"; + case StopwordsList.Basque: + return "basque"; + case StopwordsList.Brazilian: + return "brazilian"; + case StopwordsList.Bulgarian: + return "bulgarian"; + case StopwordsList.Catalan: + return "catalan"; + case StopwordsList.Czech: + return "czech"; + case StopwordsList.Danish: + return "danish"; + case StopwordsList.Dutch: + return "dutch"; + case StopwordsList.English: + return "english"; + case StopwordsList.Finnish: + return "finnish"; + case StopwordsList.French: + return "french"; + case StopwordsList.Galician: + return "galician"; + case StopwordsList.German: + return "german"; + case StopwordsList.Greek: + return "greek"; + case StopwordsList.Hindi: + return "hindi"; + case StopwordsList.Hungarian: + return "hungarian"; + case StopwordsList.Indonesian: + return "indonesian"; + case StopwordsList.Irish: + return "irish"; + case StopwordsList.Italian: + return "italian"; + case StopwordsList.Latvian: + return "latvian"; + case StopwordsList.Norwegian: + return "norwegian"; + case StopwordsList.Persian: + return "persian"; + case StopwordsList.Portuguese: + return "portuguese"; + case StopwordsList.Romanian: + return "romanian"; + case StopwordsList.Russian: + return "russian"; + case StopwordsList.Sorani: + return "sorani"; + case StopwordsList.Spanish: + return "spanish"; + case StopwordsList.Swedish: + return "swedish"; + case StopwordsList.Thai: + return "thai"; + case StopwordsList.Turkish: + return "turkish"; + } + return null; + } + internal static StopwordsList? ParseStopwordsList(this string value) + { + switch( value ) + { + 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; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsTokenFilter.cs index f02ab818a555..4ac5ac95a487 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Search.Models /// /// Removes stop words from a token stream. This token filter is /// implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StopwordsTokenFilter")] public partial class StopwordsTokenFilter : TokenFilter @@ -26,7 +28,10 @@ public partial class StopwordsTokenFilter : TokenFilter /// /// Initializes a new instance of the StopwordsTokenFilter class. /// - public StopwordsTokenFilter() { } + public StopwordsTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the StopwordsTokenFilter class. @@ -59,8 +64,14 @@ public StopwordsTokenFilter() { } StopwordsList = stopwordsList; IgnoreCase = ignoreCase; RemoveTrailingStopWords = removeTrailingStopWords; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the list of stopwords. This property and the stopwords /// list property cannot both be set. @@ -107,4 +118,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Suggester.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Suggester.cs index 24ee1d1184c0..7354249e3ec4 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Suggester.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Suggester.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +25,10 @@ public partial class Suggester /// /// Initializes a new instance of the Suggester class. /// - public Suggester() { } + public Suggester() + { + CustomInit(); + } /// /// Initializes a new instance of the Suggester class. @@ -37,6 +40,7 @@ public Suggester(string name, IList sourceFields) { Name = name; SourceFields = sourceFields; + CustomInit(); } /// /// Static constructor for Suggester class. @@ -46,6 +50,11 @@ static Suggester() SearchMode = "analyzingInfixMatching"; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the suggester. /// @@ -84,4 +93,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMap.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMap.cs index 7d98eaf7ac99..a190b0a2dd2f 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMap.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMap.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +22,10 @@ public partial class SynonymMap /// /// Initializes a new instance of the SynonymMap class. /// - public SynonymMap() { } + public SynonymMap() + { + CustomInit(); + } /// /// Initializes a new instance of the SynonymMap class. @@ -40,8 +43,14 @@ public SynonymMap() { } Format = format; Synonyms = synonyms; ETag = eTag; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the synonym map. /// @@ -91,4 +100,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMapListResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMapListResult.cs index a18b7768ef93..5acac71afda1 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMapListResult.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMapListResult.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +24,10 @@ public partial class SynonymMapListResult /// /// Initializes a new instance of the SynonymMapListResult class. /// - public SynonymMapListResult() { } + public SynonymMapListResult() + { + CustomInit(); + } /// /// Initializes a new instance of the SynonymMapListResult class. @@ -34,14 +37,19 @@ public SynonymMapListResult() { } public SynonymMapListResult(IList synonymMaps = default(IList)) { SynonymMaps = synonymMaps; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the synonym maps in the Search service. /// [JsonProperty(PropertyName = "value")] - public IList SynonymMaps { get; protected set; } + public IList SynonymMaps { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymTokenFilter.cs index 57a8c8aa73dd..adba26173475 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,7 +19,9 @@ namespace Microsoft.Azure.Search.Models /// /// Matches single or multi-word synonyms in a token stream. This token /// filter is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.SynonymTokenFilter")] public partial class SynonymTokenFilter : TokenFilter @@ -27,7 +29,10 @@ public partial class SynonymTokenFilter : TokenFilter /// /// Initializes a new instance of the SynonymTokenFilter class. /// - public SynonymTokenFilter() { } + public SynonymTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the SynonymTokenFilter class. @@ -60,8 +65,14 @@ public SynonymTokenFilter() { } Synonyms = synonyms; IgnoreCase = ignoreCase; Expand = expand; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a list of synonyms in following one of two formats: 1. /// incredible, unbelievable, fabulous => amazing - all terms on @@ -111,4 +122,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringFunction.cs index 0edbb9d7cf4e..9137cb124366 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringFunction.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringFunction.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Defines a function that boosts scores of documents with string values /// matching a given list of tags. - /// + /// /// [Newtonsoft.Json.JsonObject("tag")] public partial class TagScoringFunction : ScoringFunction @@ -25,7 +27,10 @@ public partial class TagScoringFunction : ScoringFunction /// /// Initializes a new instance of the TagScoringFunction class. /// - public TagScoringFunction() { } + public TagScoringFunction() + { + CustomInit(); + } /// /// Initializes a new instance of the TagScoringFunction class. @@ -44,8 +49,14 @@ public TagScoringFunction() { } : base(fieldName, boost, interpolation) { Parameters = parameters; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets parameter values for the tag scoring function. /// @@ -72,4 +83,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringParameters.cs index 21336cb4d8a0..707dfe77e708 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringParameters.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringParameters.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +22,10 @@ public partial class TagScoringParameters /// /// Initializes a new instance of the TagScoringParameters class. /// - public TagScoringParameters() { } + public TagScoringParameters() + { + CustomInit(); + } /// /// Initializes a new instance of the TagScoringParameters class. @@ -33,8 +36,14 @@ public TagScoringParameters() { } public TagScoringParameters(string tagsParameter) { TagsParameter = tagsParameter; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the parameter passed in search queries to /// specify the list of tags to compare against the target field. @@ -57,4 +66,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TextWeights.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TextWeights.cs index 1d6ca04d35f0..eab31e5365b2 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TextWeights.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TextWeights.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +25,10 @@ public partial class TextWeights /// /// Initializes a new instance of the TextWeights class. /// - public TextWeights() { } + public TextWeights() + { + CustomInit(); + } /// /// Initializes a new instance of the TextWeights class. @@ -36,8 +39,14 @@ public TextWeights() { } public TextWeights(IDictionary weights) { Weights = weights; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the dictionary of per-field weights to boost document /// scoring. The keys are field names and the values are the weights @@ -61,4 +70,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenCharacterKind.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenCharacterKind.cs index 5506cc80886a..84e6a5b24af2 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenCharacterKind.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenCharacterKind.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Search.Models /// /// Defines values for TokenCharacterKind. /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum TokenCharacterKind { [EnumMember(Value = "letter")] @@ -32,5 +32,47 @@ public enum TokenCharacterKind [EnumMember(Value = "symbol")] Symbol } -} + internal static class TokenCharacterKindEnumExtension + { + internal static string ToSerializedValue(this TokenCharacterKind? value) + { + return value == null ? null : ((TokenCharacterKind)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this TokenCharacterKind value) + { + switch( value ) + { + case TokenCharacterKind.Letter: + return "letter"; + case TokenCharacterKind.Digit: + return "digit"; + case TokenCharacterKind.Whitespace: + return "whitespace"; + case TokenCharacterKind.Punctuation: + return "punctuation"; + case TokenCharacterKind.Symbol: + return "symbol"; + } + return null; + } + internal static TokenCharacterKind? ParseTokenCharacterKind(this string value) + { + switch( value ) + { + 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; + } + return null; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenFilter.cs index 7e5543911999..0da28dd2feaa 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,25 +6,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Abstract base class for token filters. - /// + /// /// public partial class TokenFilter { /// /// Initializes a new instance of the TokenFilter class. /// - public TokenFilter() { } + public TokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the TokenFilter class. @@ -35,8 +40,14 @@ public TokenFilter() { } public TokenFilter(string name) { Name = name; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the token filter. It must only contain /// letters, digits, spaces, dashes or underscores, can only start and @@ -60,4 +71,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenInfo.cs index 84b860fa2125..8fd4edc6efd4 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenInfo.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; @@ -21,7 +21,10 @@ public partial class TokenInfo /// /// Initializes a new instance of the TokenInfo class. /// - public TokenInfo() { } + public TokenInfo() + { + CustomInit(); + } /// /// Initializes a new instance of the TokenInfo class. @@ -42,27 +45,33 @@ public TokenInfo() { } StartOffset = startOffset; EndOffset = endOffset; Position = position; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the token returned by the analyzer. /// [JsonProperty(PropertyName = "token")] - public string Token { get; protected set; } + public string Token { get; private set; } /// /// Gets the index of the first character of the token in the input /// text. /// [JsonProperty(PropertyName = "startOffset")] - public int? StartOffset { get; protected set; } + public int? StartOffset { get; private set; } /// /// Gets the index of the last character of the token in the input /// text. /// [JsonProperty(PropertyName = "endOffset")] - public int? EndOffset { get; protected set; } + public int? EndOffset { get; private set; } /// /// Gets the position of the token in the input text relative to other @@ -72,8 +81,7 @@ public TokenInfo() { } /// synonyms of each other. /// [JsonProperty(PropertyName = "position")] - public int? Position { get; protected set; } + public int? Position { get; private set; } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Tokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Tokenizer.cs index 1d62215a2771..4ff08b2622a1 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Tokenizer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Tokenizer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,25 +6,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Abstract base class for tokenizers. - /// + /// /// public partial class Tokenizer { /// /// Initializes a new instance of the Tokenizer class. /// - public Tokenizer() { } + public Tokenizer() + { + CustomInit(); + } /// /// Initializes a new instance of the Tokenizer class. @@ -35,8 +40,14 @@ public Tokenizer() { } public Tokenizer(string name) { Name = name; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the tokenizer. It must only contain /// letters, digits, spaces, dashes or underscores, can only start and @@ -60,4 +71,3 @@ public virtual void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TruncateTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TruncateTokenFilter.cs index 173e560cf72f..0e35bac6682d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TruncateTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TruncateTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Truncates the terms to a specific length. This token filter is /// implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.TruncateTokenFilter")] public partial class TruncateTokenFilter : TokenFilter @@ -25,7 +27,10 @@ public partial class TruncateTokenFilter : TokenFilter /// /// Initializes a new instance of the TruncateTokenFilter class. /// - public TruncateTokenFilter() { } + public TruncateTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the TruncateTokenFilter class. @@ -40,8 +45,14 @@ public TruncateTokenFilter() { } : base(name) { Length = length; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the length at which terms will be truncated. Default /// and maximum is 300. @@ -65,4 +76,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UaxUrlEmailTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UaxUrlEmailTokenizer.cs index 5f47dfcc3433..379ffaaf8d2c 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UaxUrlEmailTokenizer.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UaxUrlEmailTokenizer.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,19 +6,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// Tokenizes urls and emails as one token. This tokenizer is implemented /// using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.UaxUrlEmailTokenizer")] public partial class UaxUrlEmailTokenizer : Tokenizer @@ -25,7 +27,10 @@ public partial class UaxUrlEmailTokenizer : Tokenizer /// /// Initializes a new instance of the UaxUrlEmailTokenizer class. /// - public UaxUrlEmailTokenizer() { } + public UaxUrlEmailTokenizer() + { + CustomInit(); + } /// /// Initializes a new instance of the UaxUrlEmailTokenizer class. @@ -41,8 +46,14 @@ public UaxUrlEmailTokenizer() { } : base(name) { MaxTokenLength = maxTokenLength; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum token length. Default is 255. Tokens /// longer than the maximum length are split. The maximum token length @@ -67,4 +78,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UniqueTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UniqueTokenFilter.cs index 6ace8e020fa4..f50012c26903 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UniqueTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UniqueTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,18 +6,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Linq; /// /// Filters out tokens with same text as the previous token. This token /// filter is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.UniqueTokenFilter")] public partial class UniqueTokenFilter : TokenFilter @@ -24,7 +26,10 @@ public partial class UniqueTokenFilter : TokenFilter /// /// Initializes a new instance of the UniqueTokenFilter class. /// - public UniqueTokenFilter() { } + public UniqueTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the UniqueTokenFilter class. @@ -40,8 +45,14 @@ public UniqueTokenFilter() { } : base(name) { OnlyOnSamePosition = onlyOnSamePosition; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a value indicating whether to remove duplicates only /// at the same position. Default is false. @@ -61,4 +72,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/WordDelimiterTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/WordDelimiterTokenFilter.cs index 30d341fa38a9..1cddc13b8aba 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/WordDelimiterTokenFilter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/WordDelimiterTokenFilter.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search.Models { - using Azure; - using Search; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Search.Models /// /// Splits words into subwords and performs optional transformations on /// subword groups. This token filter is implemented using Apache Lucene. - /// + /// /// [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.WordDelimiterTokenFilter")] public partial class WordDelimiterTokenFilter : TokenFilter @@ -26,7 +28,10 @@ public partial class WordDelimiterTokenFilter : TokenFilter /// /// Initializes a new instance of the WordDelimiterTokenFilter class. /// - public WordDelimiterTokenFilter() { } + public WordDelimiterTokenFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the WordDelimiterTokenFilter class. @@ -77,8 +82,14 @@ public WordDelimiterTokenFilter() { } SplitOnNumerics = splitOnNumerics; StemEnglishPossessive = stemEnglishPossessive; ProtectedWords = protectedWords; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a value indicating whether to generate part words. If /// set, causes parts of words to be generated; for example @@ -166,4 +177,3 @@ public override void Validate() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SdkInfo_SearchServiceClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SdkInfo_SearchServiceClient.cs new file mode 100644 index 000000000000..fabf67bc3ad8 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SdkInfo_SearchServiceClient.cs @@ -0,0 +1,21 @@ + +using System; +using System.Collections.Generic; +using System.Linq; + +internal static partial class SdkInfo +{ + public static IEnumerable> ApiInfo_SearchServiceClient + { + get + { + return new Tuple[] + { + new Tuple("SearchServiceClient", "DataSources", "2016-09-01-Preview"), + new Tuple("SearchServiceClient", "Indexers", "2016-09-01-Preview"), + new Tuple("SearchServiceClient", "Indexes", "2016-09-01-Preview"), + new Tuple("SearchServiceClient", "SynonymMaps", "2016-09-01-Preview"), + }.AsEnumerable(); + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SearchServiceClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SearchServiceClient.cs index 32e3a5c440f3..39d9c87352d5 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SearchServiceClient.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SearchServiceClient.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,13 +6,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; using Models; using Newtonsoft.Json; using System.Collections; @@ -34,12 +35,12 @@ public partial class SearchServiceClient : ServiceClient, I /// /// Gets or sets json serialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + public JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + public JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. @@ -105,7 +106,7 @@ public partial class SearchServiceClient : ServiceClient, I /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SearchServiceClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + protected SearchServiceClient(params DelegatingHandler[] handlers) : base(handlers) { Initialize(); } @@ -119,7 +120,7 @@ protected SearchServiceClient(params System.Net.Http.DelegatingHandler[] handler /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SearchServiceClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected SearchServiceClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { Initialize(); } @@ -136,7 +137,7 @@ protected SearchServiceClient(System.Net.Http.HttpClientHandler rootHandler, par /// /// Thrown when a required parameter is null /// - public SearchServiceClient(ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public SearchServiceClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { @@ -164,7 +165,7 @@ public SearchServiceClient(ServiceClientCredentials credentials, params System.N /// /// Thrown when a required parameter is null /// - public SearchServiceClient(ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public SearchServiceClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { @@ -196,7 +197,7 @@ private void Initialize() AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; - SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, @@ -204,19 +205,19 @@ private void Initialize() NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + Converters = new List { new Iso8601TimeSpanConverter() } }; - DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + Converters = new List { new Iso8601TimeSpanConverter() } @@ -240,4 +241,3 @@ private void Initialize() } } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperations.cs index 32eab4171351..2c09197facf1 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperations.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -161,9 +162,9 @@ internal SynonymMapsOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -210,6 +211,8 @@ internal SynonymMapsOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -227,7 +230,7 @@ internal SynonymMapsOperations(SearchServiceClient client) if(synonymMap != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(synonymMap, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -263,7 +266,7 @@ internal SynonymMapsOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -300,7 +303,7 @@ internal SynonymMapsOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -318,7 +321,7 @@ internal SynonymMapsOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -429,9 +432,9 @@ internal SynonymMapsOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -470,6 +473,8 @@ internal SynonymMapsOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -507,11 +512,19 @@ internal SynonymMapsOperations(SearchServiceClient client) if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -627,9 +640,9 @@ internal SynonymMapsOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -652,6 +665,8 @@ internal SynonymMapsOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -699,7 +714,7 @@ internal SynonymMapsOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -736,7 +751,7 @@ internal SynonymMapsOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -826,9 +841,9 @@ internal SynonymMapsOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -851,6 +866,8 @@ internal SynonymMapsOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -898,7 +915,7 @@ internal SynonymMapsOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -935,7 +952,7 @@ internal SynonymMapsOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1037,9 +1054,9 @@ internal SynonymMapsOperations(SearchServiceClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1062,6 +1079,8 @@ internal SynonymMapsOperations(SearchServiceClient client) } _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1079,7 +1098,7 @@ internal SynonymMapsOperations(SearchServiceClient client) if(synonymMap != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(synonymMap, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -1115,7 +1134,7 @@ internal SynonymMapsOperations(SearchServiceClient client) ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } @@ -1152,7 +1171,7 @@ internal SynonymMapsOperations(SearchServiceClient client) { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1171,4 +1190,3 @@ internal SynonymMapsOperations(SearchServiceClient client) } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperationsExtensions.cs index 9ee5e8bcbe98..744efe16a918 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperationsExtensions.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperationsExtensions.cs @@ -1,3 +1,4 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -5,12 +6,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Search { - using Azure; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -118,7 +119,7 @@ public static partial class SynonymMapsOperationsExtensions /// public static async Task DeleteAsync(this ISynonymMapsOperations operations, string synonymMapName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(synonymMapName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(synonymMapName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -243,4 +244,3 @@ public static partial class SynonymMapsOperationsExtensions } } - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient-from-private-spec.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient-from-private-spec.cmd new file mode 100644 index 000000000000..2bed28855a1c --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient-from-private-spec.cmd @@ -0,0 +1,13 @@ +:: +:: Microsoft Azure SDK for Net - Generate library code +:: Copyright (C) Microsoft Corporation. All Rights Reserved. +:: +:: This generates the SDK code from a private Swagger spec +:: hosted in your private fork of Azure/azure-rest-api-specs +:: +:: Paramters: +:: 1. Your GitHub user name +:: 2. Your remote branch name + +@echo off +call .\generate-searchindexclient.cmd latest %1 %2 diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient.cmd index 85b504c0f901..26b9c1d77379 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient.cmd +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient.cmd @@ -4,18 +4,11 @@ :: @echo off -set autoRestVersion=1.0.0-Nightly20170110 -if "%1" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs-pr/search-service/search/2016-09-01-Preview/swagger/searchindex.json" -) else ( - set specFile="%1" -) set repoRoot=%~dp0..\..\..\..\.. set generateFolder=%~dp0GeneratedSearchIndex -set header=MICROSOFT_MIT_NO_VERSION if exist %generateFolder% rd /S /Q %generateFolder% -call "%repoRoot%\tools\autorest.gen.cmd" %specFile% Microsoft.Azure.Search %autoRestVersion% %generateFolder% %header% +call %repoRoot%\tools\generate.cmd search/data-plane/Microsoft.Azure.Search.Index %* :: Delete any extra files generated for types that are shared between SearchServiceClient and SearchIndexClient. del "%generateFolder%\Models\SearchRequestOptions.cs" diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient-from-private-spec.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient-from-private-spec.cmd new file mode 100644 index 000000000000..809de7754d17 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient-from-private-spec.cmd @@ -0,0 +1,13 @@ +:: +:: Microsoft Azure SDK for Net - Generate library code +:: Copyright (C) Microsoft Corporation. All Rights Reserved. +:: +:: This generates the SDK code from a private Swagger spec +:: hosted in your private fork of Azure/azure-rest-api-specs +:: +:: Paramters: +:: 1. Your GitHub user name +:: 2. Your remote branch name + +@echo off +call .\generate-searchserviceclient.cmd latest %1 %2 diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient.cmd index 26175808e624..450074721a91 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient.cmd +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient.cmd @@ -4,15 +4,8 @@ :: @echo off -set autoRestVersion=1.0.0-Nightly20170110 -if "%1" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs-pr/search-service/search/2016-09-01-Preview/swagger/searchservice.json" -) else ( - set specFile="%1" -) set repoRoot=%~dp0..\..\..\..\.. set generateFolder=%~dp0GeneratedSearchService -set header=MICROSOFT_MIT_NO_VERSION if exist %generateFolder% rd /S /Q %generateFolder% -call "%repoRoot%\tools\autorest.gen.cmd" %specFile% Microsoft.Azure.Search %autoRestVersion% %generateFolder% %header% +call %repoRoot%\tools\generate.cmd search/data-plane/Microsoft.Azure.Search.Service %* diff --git a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Index.txt b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Index.txt new file mode 100644 index 000000000000..a917bde74757 --- /dev/null +++ b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Index.txt @@ -0,0 +1,10 @@ +2018-02-23 01:55:45 UTC + +1) azure-rest-api-specs repository information +GitHub user: Azure +Branch: master + +2) AutoRest information +Requested version: latest +Bootstrapper version: C:\Users\brjohnst\AppData\Roaming\npm `-- autorest@2.0.4245 +Latest installed version: diff --git a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt new file mode 100644 index 000000000000..820f2aa19f58 --- /dev/null +++ b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt @@ -0,0 +1,10 @@ +2018-02-23 01:56:42 UTC + +1) azure-rest-api-specs repository information +GitHub user: Azure +Branch: master + +2) AutoRest information +Requested version: latest +Bootstrapper version: C:\Users\brjohnst\AppData\Roaming\npm `-- autorest@2.0.4245 +Latest installed version: From 503e14f511b99e94d71fcd79636adee0c72b81b5 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Thu, 22 Feb 2018 23:22:10 -0800 Subject: [PATCH 2/6] [Azure Search] Splitting the data plane into four packages What's motivating this change is a recognition that the data plane SDK is really fulfilling three scenarios: 1. Actually implementing search features in applications (full-text search, paging, faceted navigation, etc.) 2. Indexing data via the push API 3. Automating the management of indexes, synonyms, indexers, data sources, and other service-level resources. Scenarios 1 and 2 are what you'd normally think of as "data plane". Scenario 3 is closer to "control plane" or management plane, or even "metadata plane" since managing index schemas in particular is still pretty close to the data. The split goes something like this: - Microsoft.Azure.Search.Data: Fulfills scenarios 1 and 2 above. This covers everything under the /docs resource. Currently most of this is custom code. - Microsoft.Azure.Search.Service: Fulfills scenario 3 above. This covers all top-level resources of the Azure Search Service REST API. This is mostly generated code, and our eventual goal is for nearly all of it to be generated. - Microsoft.Azure.Search.Common: Utilities common to Data and Service. - Microsoft.Azure.Search: A stub package that depends on all the others, plus defines the Indexes.GetClient() method that acts as a bridge from SearchServiceClient to SearchIndexClient. This package provides a convenient upgrade path for existing SDK users. Eventually we're thinking of using Microsoft.Azure.Search.Service in conjunction with Microsoft.Azure.Management.Search to implement a rich set of PowerShell CmdLets that can manage indexes, data sources, indexers, etc. in addition to the ARM-level resources. --- .../Rest}/CloudExceptionExtensions.cs | 6 +- .../Search/Common/EnumerableExtensions.cs | 34 ++++++ .../Customizations/Search/Common/Throw.cs | 85 +++++++++++++++ .../Search}/Models/ExtensibleEnum.cs | 1 + ...ializePropertyNamesAsCamelCaseAttribute.cs | 13 ++- .../Search}/SearchCredentials.cs | 7 +- .../Search}/Serialization/ConverterBase.cs | 0 .../Serialization/ExtensibleEnumConverter.cs | 1 + .../Generated}/SearchRequestOptions.cs | 0 .../Microsoft.Azure.Search.Common.csproj | 16 +++ .../Properties/AssemblyInfo.cs | 20 ++++ .../Documents/DocumentsOperations.cs | 8 +- .../DocumentsOperationsExtensions.cs | 0 .../Documents/IDocumentsOperations.cs | 0 .../Documents/Models/Document.cs | 0 .../Documents/Models/DocumentSearchResult.cs | 0 .../Models/DocumentSearchResultBase.cs | 0 .../Models/DocumentSearchResultOfT.cs | 0 .../Documents/Models/DocumentSuggestResult.cs | 0 .../Models/DocumentSuggestResultBase.cs | 0 .../Models/DocumentSuggestResultOfT.cs | 0 .../Documents/Models/FacetResult.cs | 0 .../Documents/Models/FacetResults.cs | 0 .../Documents/Models/FacetType.cs | 0 .../Documents/Models/HitHighlights.cs | 0 .../Documents/Models/IndexAction.cs | 2 +- .../Documents/Models/IndexActionBase.cs | 0 .../Documents/Models/IndexActionOfT.cs | 0 .../Documents/Models/IndexBatch.cs | 2 +- .../Documents/Models/IndexBatchBase.cs | 2 +- .../Documents/Models/IndexBatchOfT.cs | 0 .../Documents/Models/QueryOption.cs | 29 +++++ .../Documents/Models/RangeFacetResult.cs | 0 .../Documents/Models/ScoringParameter.cs | 24 ++--- .../Models/SearchContinuationToken.cs | 2 +- .../Models/SearchContinuationTokenPayload.cs | 0 .../Documents/Models/SearchParameters.cs | 100 +++++++++--------- .../Documents/Models/SearchResult.cs | 0 .../Documents/Models/SearchResultBase.cs | 0 .../Documents/Models/SearchResultOfT.cs | 0 .../Documents/Models/SuggestParameters.cs | 70 ++++++------ .../Documents/Models/SuggestResult.cs | 0 .../Documents/Models/SuggestResultBase.cs | 0 .../Documents/Models/SuggestResultOfT.cs | 0 .../Documents/Models/ValueFacetResult.cs | 0 .../ISearchIndexClient.Customization.cs | 1 + .../Customizations/IndexBatchException.cs | 5 +- .../SearchIndexClient.Customization.cs | 37 +++++-- .../Serialization}/DateTimeConverter.cs | 0 .../Serialization}/DocumentConverter.cs | 0 .../Serialization}/DoubleConverter.cs | 0 .../Serialization}/GeographyPointConverter.cs | 0 .../Serialization}/IndexActionConverter.cs | 0 .../Serialization}/InjectingJsonWriter.cs | 0 .../Serialization}/JsonUtility.cs | 8 +- .../SearchContinuationTokenConverter.cs | 0 .../Serialization}/SearchResultConverter.cs | 0 .../Serialization}/SuggestResultConverter.cs | 0 .../Fix-GeneratedCode.ps1 | 2 +- .../Generated}/DocumentsProxyOperations.cs | 0 .../Generated}/IDocumentsProxyOperations.cs | 0 .../Generated}/ISearchIndexClient.cs | 0 .../Generated}/Models/DocumentIndexResult.cs | 0 .../Generated}/Models/IndexActionType.cs | 0 .../Generated}/Models/IndexingResult.cs | 0 .../Generated}/Models/QueryType.cs | 0 .../Generated}/Models/SearchMode.cs | 0 .../Models/SearchParametersPayload.cs | 0 .../Models/SuggestParametersPayload.cs | 0 .../Generated}/SdkInfo_SearchIndexClient.cs | 0 .../Generated}/SearchIndexClient.cs | 0 .../Microsoft.Azure.Search.Data.csproj | 22 ++++ .../Properties/AssemblyInfo.cs | 31 ++++++ .../generate-from-private-spec.cmd} | 2 +- .../generate.cmd} | 4 +- .../DataSourceOperations.Customization.cs | 0 ...urcesOperationsExtensions.Customization.cs | 0 .../IDataSourcesOperations.Customization.cs | 0 .../Models/DataSource.Customization.cs | 2 + .../DataSources/Models/DataSourceType.cs | 0 ...mnDeletionDetectionPolicy.Customization.cs | 2 + .../ISearchServiceClient.Customization.cs | 0 .../IIndexersOperations.Customization.cs | 0 .../IndexersOperations.Customization.cs | 0 ...exersOperationsExtensions.Customization.cs | 0 .../Indexers/Models/BlobExtractionMode.cs | 0 .../Models/FieldMapping.Customization.cs | 0 .../FieldMappingFunction.Customization.cs | 0 .../Indexers/Models/Indexer.Customization.cs | 0 .../Indexers/Models/IndexingParameters.cs | 0 .../Models/IndexingParametersExtensions.cs | 31 ++---- .../Indexes/FieldBuilder/AnalyzerAttribute.cs | 0 .../Indexes/FieldBuilder/FieldBuilder.cs | 10 +- .../FieldBuilder/IndexAnalyzerAttribute.cs | 0 .../FieldBuilder/IsFacetableAttribute.cs | 0 .../FieldBuilder/IsFilterableAttribute.cs | 0 .../FieldBuilder/IsRetrievableAttribute.cs | 0 .../FieldBuilder/IsSearchableAttribute.cs | 0 .../FieldBuilder/IsSortableAttribute.cs | 0 .../FieldBuilder/SearchAnalyzerAttribute.cs | 0 .../IIndexesOperations.Customization.cs | 17 +-- .../IndexesOperations.Customization.cs | 18 ---- ...dexesOperationsExtensions.Customization.cs | 0 .../Indexes/Models/AnalyzerName.cs | 0 .../Indexes/Models/CharFilterName.cs | 0 .../Customizations/Indexes/Models/DataType.cs | 1 + .../DistanceScoringFunction.Customization.cs | 0 .../Indexes/Models/EdgeNGramTokenFilter.cs | 0 .../Customizations/Indexes/Models/Field.cs | 0 .../FreshnessScoringFunction.Customization.cs | 0 .../Indexes/Models/Index.Customization.cs | 0 .../Indexes/Models/KeywordTokenizer.cs | 0 .../MagnitudeScoringFunction.Customization.cs | 0 .../Indexes/Models/NGramTokenFilter.cs | 0 .../Indexes/Models/PathHierarchyTokenizer.cs | 0 .../Indexes/Models/RegexFlags.cs | 0 .../Indexes/Models/StandardTokenizer.cs | 0 .../Indexes/Models/Suggester.Customization.cs | 0 .../TagScoringFunction.Customization.cs | 0 .../Indexes/Models/TokenFilterName.cs | 0 .../Indexes/Models/TokenizerName.cs | 0 .../Models/AccessCondition.Customization.cs | 2 + .../Models/IResourceWithETag.cs | 0 .../SearchServiceClient.Customization.cs | 23 +++- .../ISynonymMapsOperations.Customization.cs | 0 .../Models/SynonymMap.Customization.cs | 0 .../SynonymMaps/Models/SynonymMapFormat.cs | 0 .../SynonymMapsOperations.Customization.cs | 0 ...mMapsOperationsExtensions.Customization.cs | 0 .../Customizations/Utilities/ExistsHelper.cs | 0 .../Generated}/DataSourcesOperations.cs | 0 .../DataSourcesOperationsExtensions.cs | 0 .../Generated}/IDataSourcesOperations.cs | 0 .../Generated}/IIndexersOperations.cs | 0 .../Generated}/IIndexesOperations.cs | 0 .../Generated}/ISearchServiceClient.cs | 0 .../Generated}/ISynonymMapsOperations.cs | 0 .../Generated}/IndexersOperations.cs | 0 .../IndexersOperationsExtensions.cs | 0 .../Generated}/IndexesOperations.cs | 0 .../Generated}/IndexesOperationsExtensions.cs | 0 .../Generated}/Models/AccessCondition.cs | 0 .../Generated}/Models/AnalyzeRequest.cs | 0 .../Generated}/Models/AnalyzeResult.cs | 0 .../Generated}/Models/Analyzer.cs | 0 .../Models/AsciiFoldingTokenFilter.cs | 0 .../Generated}/Models/CharFilter.cs | 0 .../Generated}/Models/CjkBigramTokenFilter.cs | 0 .../Models/CjkBigramTokenFilterScripts.cs | 0 .../Generated}/Models/ClassicTokenizer.cs | 0 .../Models/CommonGramTokenFilter.cs | 0 .../Generated}/Models/CorsOptions.cs | 0 .../Generated}/Models/CustomAnalyzer.cs | 0 .../Models/DataChangeDetectionPolicy.cs | 0 .../Generated}/Models/DataContainer.cs | 0 .../Models/DataDeletionDetectionPolicy.cs | 0 .../Generated}/Models/DataSource.cs | 0 .../Models/DataSourceCredentials.cs | 0 .../Generated}/Models/DataSourceListResult.cs | 0 .../DictionaryDecompounderTokenFilter.cs | 0 .../Models/DistanceScoringFunction.cs | 0 .../Models/DistanceScoringParameters.cs | 0 .../Models/EdgeNGramTokenFilterSide.cs | 0 .../Models/EdgeNGramTokenFilterV2.cs | 0 .../Generated}/Models/EdgeNGramTokenizer.cs | 0 .../Generated}/Models/ElisionTokenFilter.cs | 0 .../Generated}/Models/FieldMapping.cs | 0 .../Generated}/Models/FieldMappingFunction.cs | 0 .../Models/FreshnessScoringFunction.cs | 0 .../Models/FreshnessScoringParameters.cs | 0 .../HighWaterMarkChangeDetectionPolicy.cs | 0 .../Generated}/Models/Index.cs | 0 .../Models/IndexGetStatisticsResult.cs | 0 .../Generated}/Models/IndexListResult.cs | 0 .../Generated}/Models/Indexer.cs | 0 .../Generated}/Models/IndexerExecutionInfo.cs | 0 .../Models/IndexerExecutionResult.cs | 0 .../Models/IndexerExecutionStatus.cs | 0 .../Generated}/Models/IndexerListResult.cs | 0 .../Generated}/Models/IndexerStatus.cs | 0 .../Generated}/Models/IndexingSchedule.cs | 0 .../Generated}/Models/ItemError.cs | 0 .../Generated}/Models/KeepTokenFilter.cs | 0 .../Models/KeywordMarkerTokenFilter.cs | 0 .../Generated}/Models/KeywordTokenizerV2.cs | 0 .../Generated}/Models/LengthTokenFilter.cs | 0 .../Generated}/Models/LimitTokenFilter.cs | 0 .../Models/MagnitudeScoringFunction.cs | 0 .../Models/MagnitudeScoringParameters.cs | 0 .../Generated}/Models/MappingCharFilter.cs | 0 .../MicrosoftLanguageStemmingTokenizer.cs | 0 .../Models/MicrosoftLanguageTokenizer.cs | 0 .../MicrosoftStemmingTokenizerLanguage.cs | 0 .../Models/MicrosoftTokenizerLanguage.cs | 0 .../Generated}/Models/NGramTokenFilterV2.cs | 0 .../Generated}/Models/NGramTokenizer.cs | 0 .../Models/PathHierarchyTokenizerV2.cs | 0 .../Generated}/Models/PatternAnalyzer.cs | 0 .../Models/PatternCaptureTokenFilter.cs | 0 .../Models/PatternReplaceCharFilter.cs | 0 .../Models/PatternReplaceTokenFilter.cs | 0 .../Generated}/Models/PatternTokenizer.cs | 0 .../Generated}/Models/PhoneticEncoder.cs | 0 .../Generated}/Models/PhoneticTokenFilter.cs | 0 .../Generated}/Models/ScoringFunction.cs | 0 .../Models/ScoringFunctionAggregation.cs | 0 .../Models/ScoringFunctionInterpolation.cs | 0 .../Generated}/Models/ScoringProfile.cs | 0 .../Generated}/Models/ShingleTokenFilter.cs | 0 .../Generated}/Models/SnowballTokenFilter.cs | 0 .../Models/SnowballTokenFilterLanguage.cs | 0 ...SoftDeleteColumnDeletionDetectionPolicy.cs | 0 .../SqlIntegratedChangeTrackingPolicy.cs | 0 .../Generated}/Models/StandardAnalyzer.cs | 0 .../Generated}/Models/StandardTokenizerV2.cs | 0 .../Models/StemmerOverrideTokenFilter.cs | 0 .../Generated}/Models/StemmerTokenFilter.cs | 0 .../Models/StemmerTokenFilterLanguage.cs | 0 .../Generated}/Models/StopAnalyzer.cs | 0 .../Generated}/Models/StopwordsList.cs | 0 .../Generated}/Models/StopwordsTokenFilter.cs | 0 .../Generated}/Models/Suggester.cs | 0 .../Generated}/Models/SynonymMap.cs | 0 .../Generated}/Models/SynonymMapListResult.cs | 0 .../Generated}/Models/SynonymTokenFilter.cs | 0 .../Generated}/Models/TagScoringFunction.cs | 0 .../Generated}/Models/TagScoringParameters.cs | 0 .../Generated}/Models/TextWeights.cs | 0 .../Generated}/Models/TokenCharacterKind.cs | 0 .../Generated}/Models/TokenFilter.cs | 0 .../Generated}/Models/TokenInfo.cs | 0 .../Generated}/Models/Tokenizer.cs | 0 .../Generated}/Models/TruncateTokenFilter.cs | 0 .../Generated}/Models/UaxUrlEmailTokenizer.cs | 0 .../Generated}/Models/UniqueTokenFilter.cs | 0 .../Models/WordDelimiterTokenFilter.cs | 0 .../Generated}/SdkInfo_SearchServiceClient.cs | 0 .../Generated}/SearchServiceClient.cs | 0 .../Generated}/SynonymMapsOperations.cs | 0 .../SynonymMapsOperationsExtensions.cs | 0 .../Microsoft.Azure.Search.Service.csproj | 22 ++++ .../Properties/AssemblyInfo.cs | 20 ++++ .../generate-from-private-spec.cmd} | 2 +- .../generate.cmd | 17 +++ .../Documents/Models/QueryOption.cs | 34 ------ .../Utilities/EnumerableExtensions.cs | 21 ---- .../Customizations/Utilities/IndexName.cs | 29 ----- .../Customizations/Utilities/Name.cs | 19 ---- .../Utilities/SearchServiceName.cs | 59 ----------- .../Customizations/Utilities/Throw.cs | 43 -------- .../IndexesGetClientExtensions.cs | 42 ++++++++ .../Microsoft.Azure.Search.csproj | 3 +- .../Properties/AssemblyInfo.cs | 11 -- .../generate-searchserviceclient.cmd | 11 -- .../Search.Tests/Tests/Models/Hotel.cs | 94 +++++++--------- .../Search.Tests/Tests/Models/LoudHotel.cs | 68 ++++-------- .../Serialization/SearchParametersTests.cs | 6 +- .../Serialization/SuggestParametersTests.cs | 4 +- src/SDKs/Search/Search.sln | 26 ++++- ...ata-plane_Microsoft.Azure.Search.Data.txt} | 2 +- ...a-plane_Microsoft.Azure.Search.Service.txt | 2 +- 261 files changed, 633 insertions(+), 542 deletions(-) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations => Microsoft.Azure.Search.Common/Customizations/Rest}/CloudExceptionExtensions.cs (86%) create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/EnumerableExtensions.cs create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/Throw.cs rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations => Microsoft.Azure.Search.Common/Customizations/Search}/Models/ExtensibleEnum.cs (99%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Documents => Microsoft.Azure.Search.Common/Customizations/Search}/Models/SerializePropertyNamesAsCamelCaseAttribute.cs (71%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations => Microsoft.Azure.Search.Common/Customizations/Search}/SearchCredentials.cs (95%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations => Microsoft.Azure.Search.Common/Customizations/Search}/Serialization/ConverterBase.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations => Microsoft.Azure.Search.Common/Customizations/Search}/Serialization/ExtensibleEnumConverter.cs (99%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService/Models => Microsoft.Azure.Search.Common/Generated}/SearchRequestOptions.cs (100%) create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/DocumentsOperations.cs (99%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/DocumentsOperationsExtensions.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/IDocumentsOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/Document.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/DocumentSearchResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/DocumentSearchResultBase.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/DocumentSearchResultOfT.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/DocumentSuggestResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/DocumentSuggestResultBase.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/DocumentSuggestResultOfT.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/FacetResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/FacetResults.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/FacetType.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/HitHighlights.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/IndexAction.cs (99%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/IndexActionBase.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/IndexActionOfT.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/IndexBatch.cs (99%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/IndexBatchBase.cs (98%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/IndexBatchOfT.cs (100%) create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/QueryOption.cs rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/RangeFacetResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/ScoringParameter.cs (79%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SearchContinuationToken.cs (98%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SearchContinuationTokenPayload.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SearchParameters.cs (72%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SearchResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SearchResultBase.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SearchResultOfT.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SuggestParameters.cs (72%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SuggestResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SuggestResultBase.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/SuggestResultOfT.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/Documents/Models/ValueFacetResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/ISearchIndexClient.Customization.cs (93%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/IndexBatchException.cs (98%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Customizations/SearchIndexClient.Customization.cs (70%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/DateTimeConverter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/DocumentConverter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/DoubleConverter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/GeographyPointConverter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/IndexActionConverter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/InjectingJsonWriter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/JsonUtility.cs (94%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/SearchContinuationTokenConverter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/SearchResultConverter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/Customizations/Serialization/Private => Microsoft.Azure.Search.Data/Customizations/Serialization}/SuggestResultConverter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Data}/Fix-GeneratedCode.ps1 (94%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/DocumentsProxyOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/IDocumentsProxyOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/ISearchIndexClient.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/Models/DocumentIndexResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/Models/IndexActionType.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/Models/IndexingResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/Models/QueryType.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/Models/SearchMode.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/Models/SearchParametersPayload.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/Models/SuggestParametersPayload.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/SdkInfo_SearchIndexClient.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchIndex => Microsoft.Azure.Search.Data/Generated}/SearchIndexClient.cs (100%) create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/generate-searchindexclient-from-private-spec.cmd => Microsoft.Azure.Search.Data/generate-from-private-spec.cmd} (86%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/generate-searchindexclient.cmd => Microsoft.Azure.Search.Data/generate.cmd} (90%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/DataSources/DataSourceOperations.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/DataSources/DataSourcesOperationsExtensions.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/DataSources/IDataSourcesOperations.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/DataSources/Models/DataSource.Customization.cs (99%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/DataSources/Models/DataSourceType.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/DataSources/Models/SoftDeleteColumnDeletionDetectionPolicy.Customization.cs (98%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/ISearchServiceClient.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/IIndexersOperations.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/IndexersOperations.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/IndexersOperationsExtensions.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/Models/BlobExtractionMode.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/Models/FieldMapping.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/Models/FieldMappingFunction.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/Models/Indexer.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/Models/IndexingParameters.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexers/Models/IndexingParametersExtensions.cs (94%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/AnalyzerAttribute.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/FieldBuilder.cs (95%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/IndexAnalyzerAttribute.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/IsFacetableAttribute.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/IsFilterableAttribute.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/IsRetrievableAttribute.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/IsSearchableAttribute.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/IsSortableAttribute.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/FieldBuilder/SearchAnalyzerAttribute.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/IIndexesOperations.Customization.cs (81%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/IndexesOperations.Customization.cs (66%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/IndexesOperationsExtensions.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/AnalyzerName.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/CharFilterName.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/DataType.cs (99%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/DistanceScoringFunction.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/EdgeNGramTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/Field.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/FreshnessScoringFunction.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/Index.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/KeywordTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/MagnitudeScoringFunction.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/NGramTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/PathHierarchyTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/RegexFlags.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/StandardTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/Suggester.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/TagScoringFunction.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/TokenFilterName.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Indexes/Models/TokenizerName.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Models/AccessCondition.Customization.cs (99%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Models/IResourceWithETag.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/SearchServiceClient.Customization.cs (76%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/SynonymMaps/ISynonymMapsOperations.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/SynonymMaps/Models/SynonymMap.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/SynonymMaps/Models/SynonymMapFormat.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/SynonymMaps/SynonymMapsOperations.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/SynonymMaps/SynonymMapsOperationsExtensions.Customization.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search => Microsoft.Azure.Search.Service}/Customizations/Utilities/ExistsHelper.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/DataSourcesOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/DataSourcesOperationsExtensions.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/IDataSourcesOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/IIndexersOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/IIndexesOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/ISearchServiceClient.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/ISynonymMapsOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/IndexersOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/IndexersOperationsExtensions.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/IndexesOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/IndexesOperationsExtensions.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/AccessCondition.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/AnalyzeRequest.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/AnalyzeResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/Analyzer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/AsciiFoldingTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/CharFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/CjkBigramTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/CjkBigramTokenFilterScripts.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/ClassicTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/CommonGramTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/CorsOptions.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/CustomAnalyzer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DataChangeDetectionPolicy.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DataContainer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DataDeletionDetectionPolicy.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DataSource.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DataSourceCredentials.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DataSourceListResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DictionaryDecompounderTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DistanceScoringFunction.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/DistanceScoringParameters.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/EdgeNGramTokenFilterSide.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/EdgeNGramTokenFilterV2.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/EdgeNGramTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/ElisionTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/FieldMapping.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/FieldMappingFunction.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/FreshnessScoringFunction.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/FreshnessScoringParameters.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/HighWaterMarkChangeDetectionPolicy.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/Index.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/IndexGetStatisticsResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/IndexListResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/Indexer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/IndexerExecutionInfo.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/IndexerExecutionResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/IndexerExecutionStatus.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/IndexerListResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/IndexerStatus.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/IndexingSchedule.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/ItemError.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/KeepTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/KeywordMarkerTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/KeywordTokenizerV2.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/LengthTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/LimitTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/MagnitudeScoringFunction.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/MagnitudeScoringParameters.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/MappingCharFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/MicrosoftLanguageStemmingTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/MicrosoftLanguageTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/MicrosoftStemmingTokenizerLanguage.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/MicrosoftTokenizerLanguage.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/NGramTokenFilterV2.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/NGramTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/PathHierarchyTokenizerV2.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/PatternAnalyzer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/PatternCaptureTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/PatternReplaceCharFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/PatternReplaceTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/PatternTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/PhoneticEncoder.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/PhoneticTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/ScoringFunction.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/ScoringFunctionAggregation.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/ScoringFunctionInterpolation.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/ScoringProfile.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/ShingleTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/SnowballTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/SnowballTokenFilterLanguage.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/SoftDeleteColumnDeletionDetectionPolicy.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/SqlIntegratedChangeTrackingPolicy.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/StandardAnalyzer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/StandardTokenizerV2.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/StemmerOverrideTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/StemmerTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/StemmerTokenFilterLanguage.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/StopAnalyzer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/StopwordsList.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/StopwordsTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/Suggester.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/SynonymMap.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/SynonymMapListResult.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/SynonymTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/TagScoringFunction.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/TagScoringParameters.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/TextWeights.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/TokenCharacterKind.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/TokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/TokenInfo.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/Tokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/TruncateTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/UaxUrlEmailTokenizer.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/UniqueTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/Models/WordDelimiterTokenFilter.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/SdkInfo_SearchServiceClient.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/SearchServiceClient.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/SynonymMapsOperations.cs (100%) rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/GeneratedSearchService => Microsoft.Azure.Search.Service/Generated}/SynonymMapsOperationsExtensions.cs (100%) create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs rename src/SDKs/Search/DataPlane/{Microsoft.Azure.Search/generate-searchserviceclient-from-private-spec.cmd => Microsoft.Azure.Search.Service/generate-from-private-spec.cmd} (86%) create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.cmd delete mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/QueryOption.cs delete mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/EnumerableExtensions.cs delete mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/IndexName.cs delete mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/Name.cs delete mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/SearchServiceName.cs delete mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/Throw.cs create mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/IndexesGetClientExtensions.cs delete mode 100644 src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient.cmd rename src/SDKs/_metadata/{search_data-plane_Microsoft.Azure.Search.Index.txt => search_data-plane_Microsoft.Azure.Search.Data.txt} (91%) diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/CloudExceptionExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Rest/CloudExceptionExtensions.cs similarity index 86% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/CloudExceptionExtensions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Rest/CloudExceptionExtensions.cs index 8925b5aea46c..5549931c2b94 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/CloudExceptionExtensions.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Rest/CloudExceptionExtensions.cs @@ -16,9 +16,7 @@ public static class CloudExceptionExtensions /// /// The exception to check. /// true if the exception is a failed access condition (HTTP 412 Precondition Failed), false otherwise. - public static bool IsAccessConditionFailed(this CloudException exception) - { - return exception?.Response?.StatusCode == HttpStatusCode.PreconditionFailed; - } + public static bool IsAccessConditionFailed(this CloudException exception) => + exception?.Response?.StatusCode == HttpStatusCode.PreconditionFailed; } } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/EnumerableExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/EnumerableExtensions.cs new file mode 100644 index 000000000000..4ab4a0223c91 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/EnumerableExtensions.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +namespace Microsoft.Azure.Search.Common +{ + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines extension methods for IEnumerable that are used in the implementation of the Azure Search + /// .NET SDK. + /// + public static class EnumerableExtensions + { + /// + /// Converts the elements of a collection to strings and concatenates them into a comma-separated list, + /// or returns null for null or empty collections. + /// + /// The type of elements that will be converted to strings. + /// The collection to turn into a comma-separated string. + /// A comma-separated string, or null if enumerable is null or empty. + public static string ToCommaSeparatedString(this IEnumerable enumerable) + { + if (enumerable == null || !enumerable.Any()) + { + return null; + } + + return String.Join(",", enumerable); + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/Throw.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/Throw.cs new file mode 100644 index 000000000000..bb3b9e3f1aab --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Common/Throw.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +namespace Microsoft.Azure.Search.Common +{ + using System; + + /// + /// Defines utility methods for validating arguments. + /// + public static class Throw + { + /// + /// Throws ArgumentException with the given parameter name and optional message if the given Boolean + /// value is true. + /// + /// The flag to test. This method throws if it's true and does nothing if + /// it's false. + /// The name of the parameter being validated. This is passed to the + /// ArgumentException constructor. + /// An optional error message to include in the ArgumentException. The default + /// message is "Invalid argument." + public static void IfArgument(bool isInvalid, string paramName, string message = null) + { + if (isInvalid) + { + message = message ?? "Invalid argument."; + throw new ArgumentException(message, paramName); + } + } + + /// + /// Throws ArgumentNullException with the given parameter name and optional message if the given + /// reference is null. + /// + /// The type of value to test. Must be a reference type. + /// The reference to test for null. + /// The name of the parameter being validated. This is passed to the + /// ArgumentNullException constructor. + /// An optional error message to include in the ArgumentNullException. + public static void IfArgumentNull(T value, string paramName, string message = null) where T : class + { + if (value == null) + { + if (message == null) + { + throw new ArgumentNullException(paramName); + } + else + { + throw new ArgumentNullException(paramName, message); + } + } + } + + /// + /// Throws ArgumentNullException or ArgumentException with the given parameter name and optional message + /// if the given string is null or empty, respectively. + /// + /// The string to test for null or empty. + /// The name of the parameter being validated. This is passed to the + /// ArgumentNullException or ArgumentException constructor. + /// An optional error message to include in the ArgumentNullException + /// or ArgumentException. + public static void IfArgumentNullOrEmpty(string value, string paramName, string message = null) + { + IfArgumentNull(value, paramName, message); + + message = message ?? "Argument cannot be an empty string."; + IfArgument(value.Length == 0, paramName, message); + } + + /// + /// Throws ArgumentNullException or ArgumentException with a pre-determined message if the given search + /// service name is null or empty, respectively. + /// + /// The search service name to validate. + public static void IfNullOrEmptySearchServiceName(string searchServiceName) => + IfArgumentNullOrEmpty( + searchServiceName, + nameof(searchServiceName), + "Invalid search service name. Name cannot be null or an empty string."); + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Models/ExtensibleEnum.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Models/ExtensibleEnum.cs similarity index 99% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Models/ExtensibleEnum.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Models/ExtensibleEnum.cs index 5d97116ca463..333e61e647cb 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Models/ExtensibleEnum.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Models/ExtensibleEnum.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Search.Models using System.Collections.Generic; using System.Linq; using System.Reflection; + using Common; /// /// Abstract base class for types that act like enums, but can be extended with arbitrary string values. diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SerializePropertyNamesAsCamelCaseAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Models/SerializePropertyNamesAsCamelCaseAttribute.cs similarity index 71% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SerializePropertyNamesAsCamelCaseAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Models/SerializePropertyNamesAsCamelCaseAttribute.cs index 113bd5a21f47..f705951c6779 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SerializePropertyNamesAsCamelCaseAttribute.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Models/SerializePropertyNamesAsCamelCaseAttribute.cs @@ -20,13 +20,16 @@ namespace Microsoft.Azure.Search.Models [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public class SerializePropertyNamesAsCamelCaseAttribute : Attribute { - internal static bool IsDefinedOnType() - { - return typeof(T) + /// + /// Indicates whether the given type is annotated with SerializePropertyNamesAsCamelCaseAttribute. + /// + /// The type to test. + /// true if the given type is annotated with SerializePropertyNamesAsCamelCaseAttribute, + /// false otherwise. + public static bool IsDefinedOnType() => + typeof(T) .GetTypeInfo() .GetCustomAttributes(typeof(SerializePropertyNamesAsCamelCaseAttribute), inherit: true) .Any(); - } - } } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchCredentials.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/SearchCredentials.cs similarity index 95% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchCredentials.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/SearchCredentials.cs index 664701d1fb19..38344fe3d586 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchCredentials.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/SearchCredentials.cs @@ -7,7 +7,8 @@ namespace Microsoft.Azure.Search using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; + using Common; + using Rest; /// /// Credentials used to authenticate to an Azure Search service. @@ -28,14 +29,14 @@ public class SearchCredentials : ServiceClientCredentials public SearchCredentials(string apiKey) { Throw.IfArgumentNullOrEmpty(apiKey, "apiKey"); - this.ApiKey = apiKey; + ApiKey = apiKey; } /// /// api-key used to authenticate to an Azure Search service. Can be either a query key for querying only, or /// an admin key that enables index and document management as well. /// - public string ApiKey { get; private set; } + public string ApiKey { get; } /// /// Adds the credentials to the given HTTP request. diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/ConverterBase.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ConverterBase.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/ConverterBase.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ConverterBase.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/ExtensibleEnumConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ExtensibleEnumConverter.cs similarity index 99% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/ExtensibleEnumConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ExtensibleEnumConverter.cs index 2339f93e2dda..13fc68409a72 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/ExtensibleEnumConverter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ExtensibleEnumConverter.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Search.Serialization { using System; using System.Reflection; + using Common; using Models; using Newtonsoft.Json; diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SearchRequestOptions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Generated/SearchRequestOptions.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SearchRequestOptions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Generated/SearchRequestOptions.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj new file mode 100644 index 000000000000..bc29cffa8eaf --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj @@ -0,0 +1,16 @@ + + + + Microsoft.Azure.Search.Common + Common types needed by the Azure Search .NET libraries. This is not the package you are looking for; It is only meant to be used as a dependency. + Microsoft Azure Search Common Library + Microsoft.Azure.Search.Common + 4.0.2-preview + Microsoft Azure Search;Search + See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. + + + + net452;netstandard1.4 + + \ No newline at end of file diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5126301c3f36 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +using System.Reflection; +using System.Resources; + +[assembly: AssemblyTitle("Microsoft Azure Search Common Library")] +[assembly: AssemblyDescription("Common types needed by the Azure Search .NET libraries. This is not the assembly you are looking for; It is only meant to be used as a dependency.")] + +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.2.0")] + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/DocumentsOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/DocumentsOperations.cs similarity index 99% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/DocumentsOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/DocumentsOperations.cs index 024128cb568c..4219ab1fa43f 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/DocumentsOperations.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/DocumentsOperations.cs @@ -13,11 +13,13 @@ namespace Microsoft.Azure.Search using System.Text; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; + using Common; using Models; using Newtonsoft.Json; + using Rest; + using Rest.Azure; + using Rest.Serialization; + using Serialization; internal class DocumentsOperations : IServiceOperations, IDocumentsOperations { diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/DocumentsOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/DocumentsOperationsExtensions.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/DocumentsOperationsExtensions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/DocumentsOperationsExtensions.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/IDocumentsOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/IDocumentsOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/IDocumentsOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/IDocumentsOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/Document.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/Document.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/Document.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/Document.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSearchResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSearchResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSearchResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSearchResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSearchResultBase.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSearchResultBase.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSearchResultBase.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSearchResultBase.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSearchResultOfT.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSearchResultOfT.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSearchResultOfT.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSearchResultOfT.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSuggestResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSuggestResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSuggestResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSuggestResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSuggestResultBase.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSuggestResultBase.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSuggestResultBase.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSuggestResultBase.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSuggestResultOfT.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSuggestResultOfT.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/DocumentSuggestResultOfT.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/DocumentSuggestResultOfT.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/FacetResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/FacetResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/FacetResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/FacetResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/FacetResults.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/FacetResults.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/FacetResults.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/FacetResults.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/FacetType.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/FacetType.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/FacetType.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/FacetType.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/HitHighlights.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/HitHighlights.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/HitHighlights.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/HitHighlights.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexAction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexAction.cs similarity index 99% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexAction.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexAction.cs index 30a33a94d17d..1aef3835a161 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexAction.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexAction.cs @@ -4,7 +4,7 @@ namespace Microsoft.Azure.Search.Models { - using System; + using Common; /// /// Represents an index action that operates on a document. diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexActionBase.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexActionBase.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexActionBase.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexActionBase.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexActionOfT.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexActionOfT.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexActionOfT.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexActionOfT.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexBatch.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexBatch.cs similarity index 99% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexBatch.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexBatch.cs index 530f27082c37..d4663726ef4b 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexBatch.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexBatch.cs @@ -4,9 +4,9 @@ namespace Microsoft.Azure.Search.Models { - using System; using System.Collections.Generic; using System.Linq; + using Common; /// /// Contains a batch of document upload, merge, and/or delete operations to send to the Azure Search index. diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexBatchBase.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexBatchBase.cs similarity index 98% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexBatchBase.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexBatchBase.cs index 26a59436a8ae..2ce026e02df1 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexBatchBase.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexBatchBase.cs @@ -4,8 +4,8 @@ namespace Microsoft.Azure.Search.Models { - using System; using System.Collections.Generic; + using Common; using Newtonsoft.Json; /// diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexBatchOfT.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexBatchOfT.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/IndexBatchOfT.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/IndexBatchOfT.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/QueryOption.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/QueryOption.cs new file mode 100644 index 000000000000..3436a8e01c9a --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/QueryOption.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +namespace Microsoft.Azure.Search.Models +{ + using System.Collections.Generic; + using Common; + + internal struct QueryOption + { + public QueryOption(string name, string value) : this() + { + Name = name; + Value = value; + } + + public QueryOption(string name, IEnumerable values) : this(name, values.ToCommaSeparatedString()) + { + // Do nothing. + } + + public string Name { get; } + + public string Value { get; } + + public override string ToString() => $"{Name}={Value}"; + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/RangeFacetResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/RangeFacetResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/RangeFacetResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/RangeFacetResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/ScoringParameter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/ScoringParameter.cs similarity index 79% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/ScoringParameter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/ScoringParameter.cs index 323735442a20..b0d7a2d45071 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/ScoringParameter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/ScoringParameter.cs @@ -4,11 +4,11 @@ namespace Microsoft.Azure.Search.Models { - using System; using System.Collections.Generic; using System.Globalization; using System.Linq; - using Microsoft.Spatial; + using Common; + using Spatial; /// /// Represents a parameter value to be used in scoring functions (for example, referencePointParameter). @@ -39,12 +39,12 @@ public ScoringParameter(string name, GeographyPoint value) : this(name, ToLonLat /// /// Gets the name of the scoring parameter. /// - public string Name { get; private set; } + public string Name { get; } /// /// Gets the values of the scoring parameter. /// - public IEnumerable Values{ get; private set; } + public IEnumerable Values{ get; } /// /// Returns the scoring parameter in a format that can be used in a Search API request. @@ -52,21 +52,13 @@ public ScoringParameter(string name, GeographyPoint value) : this(name, ToLonLat /// /// The scoring parameter as a colon-separated name-value pair (for example, mylocation:-122.2,44.8) /// - public override string ToString() - { - return String.Format( - CultureInfo.InvariantCulture, - "{0}-{1}", - this.Name, - this.Values.Select(v => EscapeValue(v)).ToCommaSeparatedString()); - } + public override string ToString() => + $"{Name}-{Values.Select(v => EscapeValue(v)).ToCommaSeparatedString()}"; private static string EscapeValue(string value) { - return String.Format( - CultureInfo.InvariantCulture, - "'{0}'", - value != null ? value.Replace("'", "''") : null); + value = value?.Replace("'", "''"); + return $"'{value}'"; } private static IEnumerable ToLonLatStrings(GeographyPoint point) diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchContinuationToken.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchContinuationToken.cs similarity index 98% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchContinuationToken.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchContinuationToken.cs index 1d2fdd8e3bbd..e462f03c3dcb 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchContinuationToken.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchContinuationToken.cs @@ -4,7 +4,7 @@ namespace Microsoft.Azure.Search.Models { - using System; + using Common; using Newtonsoft.Json; using Serialization; diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchContinuationTokenPayload.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchContinuationTokenPayload.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchContinuationTokenPayload.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchContinuationTokenPayload.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchParameters.cs similarity index 72% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchParameters.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchParameters.cs index 1b8d34787cd7..e5588c9b0c08 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchParameters.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchParameters.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Search.Models using System; using System.Collections.Generic; using System.Linq; + using Common; /// /// Parameters for filtering, sorting, faceting, paging, and other search @@ -140,7 +141,7 @@ private IList ScoringParameterStrings { get { - if (this.ScoringParameters == null) + if (ScoringParameters == null) { return Empty; } @@ -153,106 +154,101 @@ private IList ScoringParameterStrings /// Converts the SearchParameters instance to a URL query string. /// /// A URL query string containing all the search parameters. - public override string ToString() - { - return String.Join("&", this.GetAllOptions()); - } + public override string ToString() => String.Join("&", GetAllOptions()); - internal SearchParametersPayload ToPayload(string searchText) - { - return new SearchParametersPayload() + internal SearchParametersPayload ToPayload(string searchText) => + new SearchParametersPayload() { - Count = this.IncludeTotalResultCount, - Facets = this.Facets ?? Empty, - Filter = this.Filter, - Highlight = this.HighlightFields.ToCommaSeparatedString(), - HighlightPostTag = this.HighlightPostTag, - HighlightPreTag = this.HighlightPreTag, - MinimumCoverage = this.MinimumCoverage, - OrderBy = this.OrderBy.ToCommaSeparatedString(), - QueryType = this.QueryType, - ScoringParameters = this.ScoringParameterStrings, - ScoringProfile = this.ScoringProfile, + Count = IncludeTotalResultCount, + Facets = Facets ?? Empty, + Filter = Filter, + Highlight = HighlightFields.ToCommaSeparatedString(), + HighlightPostTag = HighlightPostTag, + HighlightPreTag = HighlightPreTag, + MinimumCoverage = MinimumCoverage, + OrderBy = OrderBy.ToCommaSeparatedString(), + QueryType = QueryType, + ScoringParameters = ScoringParameterStrings, + ScoringProfile = ScoringProfile, Search = searchText, - SearchFields = this.SearchFields.ToCommaSeparatedString(), - SearchMode = this.SearchMode, - Select = this.Select.ToCommaSeparatedString(), - Skip = this.Skip, - Top = this.Top + SearchFields = SearchFields.ToCommaSeparatedString(), + SearchMode = SearchMode, + Select = Select.ToCommaSeparatedString(), + Skip = Skip, + Top = Top }; - } private IEnumerable GetAllOptions() { - yield return new QueryOption("$count", this.IncludeTotalResultCount.ToString().ToLowerInvariant()); + yield return new QueryOption("$count", IncludeTotalResultCount.ToString().ToLowerInvariant()); - foreach (string facetExpr in this.Facets ?? Empty) + foreach (string facetExpr in Facets ?? Empty) { yield return new QueryOption("facet", Uri.EscapeDataString(facetExpr)); } - if (this.Filter != null) + if (Filter != null) { - yield return new QueryOption("$filter", Uri.EscapeDataString(this.Filter)); + yield return new QueryOption("$filter", Uri.EscapeDataString(Filter)); } - if (this.HighlightFields != null && this.HighlightFields.Any()) + if (HighlightFields != null && HighlightFields.Any()) { - yield return new QueryOption("highlight", this.HighlightFields); + yield return new QueryOption("highlight", HighlightFields); } - if (this.HighlightPreTag != null) + if (HighlightPreTag != null) { - yield return new QueryOption("highlightPreTag", Uri.EscapeDataString(this.HighlightPreTag)); + yield return new QueryOption("highlightPreTag", Uri.EscapeDataString(HighlightPreTag)); } - if (this.HighlightPostTag != null) + if (HighlightPostTag != null) { - yield return new QueryOption("highlightPostTag", Uri.EscapeDataString(this.HighlightPostTag)); + yield return new QueryOption("highlightPostTag", Uri.EscapeDataString(HighlightPostTag)); } - if (this.MinimumCoverage != null) + if (MinimumCoverage != null) { - yield return new QueryOption("minimumCoverage", this.MinimumCoverage.ToString()); + yield return new QueryOption("minimumCoverage", MinimumCoverage.ToString()); } - if (this.OrderBy != null && this.OrderBy.Any()) + if (OrderBy != null && OrderBy.Any()) { - yield return new QueryOption("$orderby", this.OrderBy); + yield return new QueryOption("$orderby", OrderBy); } - yield return new QueryOption("queryType", (this.QueryType == Models.QueryType.Simple) ? "simple" : "full"); + yield return new QueryOption("queryType", (QueryType == Models.QueryType.Simple) ? "simple" : "full"); - foreach (string scoringParameterExpr in this.ScoringParameterStrings) + foreach (string scoringParameterExpr in ScoringParameterStrings) { yield return new QueryOption("scoringParameter", scoringParameterExpr); } - if (this.ScoringProfile != null) + if (ScoringProfile != null) { - yield return new QueryOption("scoringProfile", this.ScoringProfile); + yield return new QueryOption("scoringProfile", ScoringProfile); } - if (this.SearchFields != null && this.SearchFields.Any()) + if (SearchFields != null && SearchFields.Any()) { - yield return new QueryOption("searchFields", this.SearchFields); + yield return new QueryOption("searchFields", SearchFields); } - yield return new QueryOption("searchMode", (this.SearchMode == Models.SearchMode.Any) ? "any" : "all"); + yield return new QueryOption("searchMode", (SearchMode == Models.SearchMode.Any) ? "any" : "all"); - if (this.Select != null && this.Select.Any()) + if (Select != null && Select.Any()) { - yield return new QueryOption("$select", this.Select); + yield return new QueryOption("$select", Select); } - if (this.Skip != null) + if (Skip != null) { - yield return new QueryOption("$skip", this.Skip.ToString()); + yield return new QueryOption("$skip", Skip.ToString()); } - if (this.Top != null) + if (Top != null) { - yield return new QueryOption("$top", this.Top.ToString()); + yield return new QueryOption("$top", Top.ToString()); } } } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchResultBase.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchResultBase.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchResultBase.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchResultBase.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchResultOfT.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchResultOfT.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SearchResultOfT.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SearchResultOfT.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestParameters.cs similarity index 72% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestParameters.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestParameters.cs index 0c794eb61354..fee1b2394e70 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestParameters.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestParameters.cs @@ -5,12 +5,9 @@ namespace Microsoft.Azure.Search.Models { using System; - using System.Linq; using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; + using Common; /// /// Parameters for filtering, sorting, fuzzy matching, and other @@ -99,76 +96,71 @@ public SuggestParameters() { } /// Converts the SuggestParameters instance to a URL query string. /// /// A URL query string containing all the suggestion parameters. - public override string ToString() - { - return String.Join("&", this.GetAllOptions()); - } + public override string ToString() => String.Join("&", GetAllOptions()); - internal SuggestParametersPayload ToPayload(string searchText, string suggesterName) - { - return new SuggestParametersPayload() + internal SuggestParametersPayload ToPayload(string searchText, string suggesterName) => + new SuggestParametersPayload() { - Filter = this.Filter, - Fuzzy = this.UseFuzzyMatching, - HighlightPostTag = this.HighlightPostTag, - HighlightPreTag = this.HighlightPreTag, - MinimumCoverage = this.MinimumCoverage, - OrderBy = this.OrderBy.ToCommaSeparatedString(), + Filter = Filter, + Fuzzy = UseFuzzyMatching, + HighlightPostTag = HighlightPostTag, + HighlightPreTag = HighlightPreTag, + MinimumCoverage = MinimumCoverage, + OrderBy = OrderBy.ToCommaSeparatedString(), Search = searchText, - SearchFields = this.SearchFields.ToCommaSeparatedString(), - Select = (this.Select != null && this.Select.Any()) ? this.Select.ToCommaSeparatedString() : "*", + SearchFields = SearchFields.ToCommaSeparatedString(), + Select = (Select != null && Select.Any()) ? Select.ToCommaSeparatedString() : "*", SuggesterName = suggesterName, - Top = this.Top + Top = Top }; - } private IEnumerable GetAllOptions() { - if (this.Filter != null) + if (Filter != null) { - yield return new QueryOption("$filter", Uri.EscapeDataString(this.Filter)); + yield return new QueryOption("$filter", Uri.EscapeDataString(Filter)); } - if (this.HighlightPreTag != null) + if (HighlightPreTag != null) { - yield return new QueryOption("highlightPreTag", Uri.EscapeDataString(this.HighlightPreTag)); + yield return new QueryOption("highlightPreTag", Uri.EscapeDataString(HighlightPreTag)); } - if (this.HighlightPostTag != null) + if (HighlightPostTag != null) { - yield return new QueryOption("highlightPostTag", Uri.EscapeDataString(this.HighlightPostTag)); + yield return new QueryOption("highlightPostTag", Uri.EscapeDataString(HighlightPostTag)); } - if (this.MinimumCoverage != null) + if (MinimumCoverage != null) { - yield return new QueryOption("minimumCoverage", this.MinimumCoverage.ToString()); + yield return new QueryOption("minimumCoverage", MinimumCoverage.ToString()); } - if (this.OrderBy != null && this.OrderBy.Any()) + if (OrderBy != null && OrderBy.Any()) { - yield return new QueryOption("$orderby", this.OrderBy); + yield return new QueryOption("$orderby", OrderBy); } - if (this.SearchFields != null && this.SearchFields.Any()) + if (SearchFields != null && SearchFields.Any()) { - yield return new QueryOption("searchFields", this.SearchFields); + yield return new QueryOption("searchFields", SearchFields); } - if (this.Select != null && this.Select.Any()) + if (Select != null && Select.Any()) { - yield return new QueryOption("$select", this.Select); + yield return new QueryOption("$select", Select); } else { yield return new QueryOption("$select", "*"); } - if (this.Top != null) + if (Top != null) { - yield return new QueryOption("$top", this.Top.ToString()); + yield return new QueryOption("$top", Top.ToString()); } - yield return new QueryOption("fuzzy", this.UseFuzzyMatching.ToString().ToLowerInvariant()); + yield return new QueryOption("fuzzy", UseFuzzyMatching.ToString().ToLowerInvariant()); } } } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestResultBase.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestResultBase.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestResultBase.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestResultBase.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestResultOfT.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestResultOfT.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/SuggestResultOfT.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/SuggestResultOfT.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/ValueFacetResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/ValueFacetResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/ValueFacetResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Documents/Models/ValueFacetResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/ISearchIndexClient.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/ISearchIndexClient.Customization.cs similarity index 93% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/ISearchIndexClient.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/ISearchIndexClient.Customization.cs index 21f05849e8c7..0ff1a63ef8b6 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/ISearchIndexClient.Customization.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/ISearchIndexClient.Customization.cs @@ -24,6 +24,7 @@ public partial interface ISearchIndexClient /// must guarantee that no other threads are using the client before calling it. /// /// The name of the index to which all subsequent requests should be sent. + [Obsolete("This method is deprecated. Please set the IndexName property instead.")] void TargetDifferentIndex(string newIndexName); } } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/IndexBatchException.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/IndexBatchException.cs similarity index 98% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/IndexBatchException.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/IndexBatchException.cs index c95108481720..a2663a9fa134 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/IndexBatchException.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/IndexBatchException.cs @@ -7,8 +7,9 @@ namespace Microsoft.Azure.Search using System; using System.Collections.Generic; using System.Linq; - using Microsoft.Azure.Search.Models; - using Microsoft.Rest.Azure; + using Common; + using Models; + using Rest.Azure; /// /// Exception thrown when an indexing operation only partially succeeds. diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchIndexClient.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/SearchIndexClient.Customization.cs similarity index 70% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchIndexClient.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/SearchIndexClient.Customization.cs index 0349dad14980..2c604358f684 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchIndexClient.Customization.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/SearchIndexClient.Customization.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.Search { using System; using System.Net.Http; + using Microsoft.Azure.Search.Common; + using Microsoft.Rest; public partial class SearchIndexClient { @@ -59,8 +61,8 @@ public SearchIndexClient( [Obsolete("This method is deprecated. Please set the IndexName property instead.")] public void TargetDifferentIndex(string newIndexName) { - var validatedIndexName = new IndexName(newIndexName); - IndexName = validatedIndexName; + ThrowIfNullOrEmptyIndexName(newIndexName, nameof(newIndexName)); + IndexName = newIndexName; } internal IDocumentsProxyOperations DocumentsProxy { get; private set; } @@ -70,17 +72,34 @@ partial void CustomInitialize() DocumentsProxy = new DocumentsProxyOperations(this); } - private void Initialize(string searchServiceName, string indexName, SearchCredentials credentials) + private static void ValidateSearchServiceAndIndexNames(string searchServiceName, string indexName) { - Throw.IfArgumentNull(credentials, nameof(credentials)); + Throw.IfNullOrEmptySearchServiceName(searchServiceName); + ThrowIfNullOrEmptyIndexName(indexName, nameof(indexName)); + + Uri uri = TypeConversion.TryParseUri($"https://{searchServiceName}.search.windows.net/indexes('{indexName}')/"); + + if (uri == null) + { + throw new ArgumentException( + $"Either the search service name '{searchServiceName}' or the index name '{indexName}' is invalid. Names must contain only characters that are valid in a URL.", + nameof(searchServiceName)); + } + } - var validatedSearchServiceName = new SearchServiceName(searchServiceName); - var validatedIndexName = new IndexName(indexName); + private static void ThrowIfNullOrEmptyIndexName(string name, string paramName) => + Throw.IfArgumentNullOrEmpty( + name, + paramName, + "Invalid index name. Name cannot be null or an empty string."); - validatedSearchServiceName.TryBuildUriWithIndex(validatedIndexName); + private void Initialize(string searchServiceName, string indexName, SearchCredentials credentials) + { + Throw.IfArgumentNull(credentials, nameof(credentials)); + ValidateSearchServiceAndIndexNames(searchServiceName, indexName); - SearchServiceName = validatedSearchServiceName; - IndexName = validatedIndexName; + SearchServiceName = searchServiceName; + IndexName = indexName; Credentials = credentials; Credentials.InitializeServiceClient(this); diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/DateTimeConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DateTimeConverter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/DateTimeConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DateTimeConverter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/DocumentConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DocumentConverter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/DocumentConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DocumentConverter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/DoubleConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DoubleConverter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/DoubleConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DoubleConverter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/GeographyPointConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/GeographyPointConverter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/GeographyPointConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/GeographyPointConverter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/IndexActionConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/IndexActionConverter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/IndexActionConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/IndexActionConverter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/InjectingJsonWriter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/InjectingJsonWriter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/InjectingJsonWriter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/InjectingJsonWriter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/JsonUtility.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/JsonUtility.cs similarity index 94% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/JsonUtility.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/JsonUtility.cs index 15bb3a7cd35d..c35f8d5ee8e8 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/JsonUtility.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/JsonUtility.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. -namespace Microsoft.Azure.Search +namespace Microsoft.Azure.Search.Serialization { using System.Collections.Generic; using Microsoft.Azure.Search.Models; @@ -13,9 +13,9 @@ namespace Microsoft.Azure.Search internal static class JsonUtility { - internal static IContractResolver CamelCaseResolver { get; } = new CamelCasePropertyNamesContractResolver(); + private static IContractResolver CamelCaseResolver { get; } = new CamelCasePropertyNamesContractResolver(); - internal static IContractResolver DefaultResolver { get; } = new DefaultContractResolver(); + private static IContractResolver DefaultResolver { get; } = new DefaultContractResolver(); public static JsonSerializerSettings CreateTypedSerializerSettings( JsonSerializerSettings baseSettings, @@ -41,7 +41,7 @@ public static JsonSerializerSettings CreateDocumentDeserializerSettings(JsonSeri } private static JsonSerializerSettings CreateSerializerSettings( - JsonSerializerSettings baseSettings, + JsonSerializerSettings baseSettings, bool useCamelCase) where T : class { JsonSerializerSettings settings = CopySettings(baseSettings); diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/SearchContinuationTokenConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SearchContinuationTokenConverter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/SearchContinuationTokenConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SearchContinuationTokenConverter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/SearchResultConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SearchResultConverter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/SearchResultConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SearchResultConverter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/SuggestResultConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SuggestResultConverter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Serialization/Private/SuggestResultConverter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SuggestResultConverter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Fix-GeneratedCode.ps1 b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Fix-GeneratedCode.ps1 similarity index 94% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Fix-GeneratedCode.ps1 rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Fix-GeneratedCode.ps1 index 2ffc0a31a2c6..eb0be34022e1 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Fix-GeneratedCode.ps1 +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Fix-GeneratedCode.ps1 @@ -4,7 +4,7 @@ function Replace-InFile($filePath, $oldText, $newText) (Get-Content $filePath).Replace($oldText, $newText) | Set-Content $filePath } -$generatedFolder = ".\GeneratedSearchIndex" +$generatedFolder = ".\Generated" # Make all Proxy types internal so we can version them freely. Replace-InFile $generatedFolder\IDocumentsProxyOperations.cs "public partial interface IDocumentsProxyOperations" "internal partial interface IDocumentsProxyOperations" diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/DocumentsProxyOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/DocumentsProxyOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/DocumentsProxyOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/DocumentsProxyOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/IDocumentsProxyOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/IDocumentsProxyOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/IDocumentsProxyOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/IDocumentsProxyOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/ISearchIndexClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/ISearchIndexClient.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/ISearchIndexClient.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/ISearchIndexClient.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/DocumentIndexResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/DocumentIndexResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/DocumentIndexResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/DocumentIndexResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexActionType.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/IndexActionType.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexActionType.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/IndexActionType.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexingResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/IndexingResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/IndexingResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/IndexingResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/QueryType.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/QueryType.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/QueryType.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/QueryType.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchMode.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/SearchMode.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchMode.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/SearchMode.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchParametersPayload.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/SearchParametersPayload.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SearchParametersPayload.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/SearchParametersPayload.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SuggestParametersPayload.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/SuggestParametersPayload.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/Models/SuggestParametersPayload.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/Models/SuggestParametersPayload.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SdkInfo_SearchIndexClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/SdkInfo_SearchIndexClient.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SdkInfo_SearchIndexClient.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/SdkInfo_SearchIndexClient.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SearchIndexClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/SearchIndexClient.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchIndex/SearchIndexClient.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Generated/SearchIndexClient.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj new file mode 100644 index 000000000000..b9d9b4217731 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj @@ -0,0 +1,22 @@ + + + + Microsoft.Azure.Search.Data + Use this package if you're developing a .NET application using Azure Search, and you only need to query or update documents in your indexes. If you also need to create or update indexes, synonym maps, or other service-level resources, use the Microsoft.Azure.Search package instead. + Microsoft Azure Search Data Library + Microsoft.Azure.Search.Data + 4.0.2-preview + Microsoft Azure Search;Search + See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. + + + + net452;netstandard1.4 + + + + + + + + \ No newline at end of file diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..21985443e9dd --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("Microsoft Azure Search Data Library")] +[assembly: AssemblyDescription("Use this assembly if you're developing a .NET application using Azure Search, and you only need to query or update documents in your indexes. If you also need to create or update indexes, synonym maps, or other service-level resources, use the Microsoft.Azure.Search assembly instead.")] + +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.2.0")] + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] +[assembly: InternalsVisibleTo("Search.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] + +namespace Microsoft.Azure.Search +{ + internal class Consts + { + // Putting this in AssemblyInfo.cs so we remember to change it when the major SDK version changes. + public const string TargetApiVersion = "2016-09-01-Preview"; + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient-from-private-spec.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate-from-private-spec.cmd similarity index 86% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient-from-private-spec.cmd rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate-from-private-spec.cmd index 2bed28855a1c..4603db346e11 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient-from-private-spec.cmd +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate-from-private-spec.cmd @@ -10,4 +10,4 @@ :: 2. Your remote branch name @echo off -call .\generate-searchindexclient.cmd latest %1 %2 +call .\generate.cmd latest %1 %2 diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.cmd similarity index 90% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient.cmd rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.cmd index 26b9c1d77379..2271fff6d32b 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchindexclient.cmd +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.cmd @@ -5,10 +5,10 @@ @echo off set repoRoot=%~dp0..\..\..\..\.. -set generateFolder=%~dp0GeneratedSearchIndex +set generateFolder=%~dp0Generated if exist %generateFolder% rd /S /Q %generateFolder% -call %repoRoot%\tools\generate.cmd search/data-plane/Microsoft.Azure.Search.Index %* +call %repoRoot%\tools\generate.cmd search/data-plane/Microsoft.Azure.Search.Data %* :: Delete any extra files generated for types that are shared between SearchServiceClient and SearchIndexClient. del "%generateFolder%\Models\SearchRequestOptions.cs" diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/DataSourceOperations.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/DataSourceOperations.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/DataSourceOperations.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/DataSourceOperations.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/DataSourcesOperationsExtensions.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/DataSourcesOperationsExtensions.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/DataSourcesOperationsExtensions.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/DataSourcesOperationsExtensions.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/IDataSourcesOperations.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/IDataSourcesOperations.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/IDataSourcesOperations.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/IDataSourcesOperations.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/Models/DataSource.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/Models/DataSource.Customization.cs similarity index 99% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/Models/DataSource.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/Models/DataSource.Customization.cs index b3f0be1be3c5..49725d6a94ad 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/Models/DataSource.Customization.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/Models/DataSource.Customization.cs @@ -4,6 +4,8 @@ namespace Microsoft.Azure.Search.Models { + using Common; + public partial class DataSource : IResourceWithETag { /// diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/Models/DataSourceType.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/Models/DataSourceType.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/Models/DataSourceType.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/Models/DataSourceType.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/Models/SoftDeleteColumnDeletionDetectionPolicy.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/Models/SoftDeleteColumnDeletionDetectionPolicy.Customization.cs similarity index 98% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/Models/SoftDeleteColumnDeletionDetectionPolicy.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/Models/SoftDeleteColumnDeletionDetectionPolicy.Customization.cs index fc51f46a52bb..f7569b6bbe69 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/DataSources/Models/SoftDeleteColumnDeletionDetectionPolicy.Customization.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/DataSources/Models/SoftDeleteColumnDeletionDetectionPolicy.Customization.cs @@ -4,6 +4,8 @@ namespace Microsoft.Azure.Search.Models { + using Common; + public partial class SoftDeleteColumnDeletionDetectionPolicy { /// diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/ISearchServiceClient.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/ISearchServiceClient.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/ISearchServiceClient.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/ISearchServiceClient.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/IIndexersOperations.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/IIndexersOperations.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/IIndexersOperations.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/IIndexersOperations.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/IndexersOperations.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/IndexersOperations.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/IndexersOperations.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/IndexersOperations.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/IndexersOperationsExtensions.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/IndexersOperationsExtensions.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/IndexersOperationsExtensions.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/IndexersOperationsExtensions.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/BlobExtractionMode.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/BlobExtractionMode.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/BlobExtractionMode.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/BlobExtractionMode.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/FieldMapping.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/FieldMapping.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/FieldMapping.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/FieldMapping.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/FieldMappingFunction.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/FieldMappingFunction.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/FieldMappingFunction.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/FieldMappingFunction.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/Indexer.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/Indexer.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/Indexer.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/Indexer.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/IndexingParameters.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParameters.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/IndexingParameters.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParametersExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/IndexingParametersExtensions.cs similarity index 94% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParametersExtensions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/IndexingParametersExtensions.cs index 18d777a3a3cd..0279873a3178 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParametersExtensions.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexers/Models/IndexingParametersExtensions.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Search.Models using System; using System.Collections.Generic; using System.Linq; + using Common; /// /// Defines extension methods for the IndexingParameters class. @@ -26,10 +27,8 @@ public static class IndexingParametersExtensions /// /// The IndexingParameters instance. [Obsolete("This method is obsolete. Please use SetBlobExtractionMode(BlobExtractionMode.StorageMetadata).")] - public static IndexingParameters IndexStorageMetadataOnly(this IndexingParameters parameters) - { - return parameters.SetBlobExtractionMode(BlobExtractionMode.StorageMetadata); - } + public static IndexingParameters IndexStorageMetadataOnly(this IndexingParameters parameters) => + parameters.SetBlobExtractionMode(BlobExtractionMode.StorageMetadata); /// /// Specifies that the indexer will index only the blobs with the file name extensions you specify. Each string is a file extensions with a @@ -92,10 +91,8 @@ public static IndexingParameters ExcludeFileNameExtensions(this IndexingParamete /// /// The IndexingParameters instance. [Obsolete("This method is obsolete. Please use SetBlobExtractionMode(BlobExtractionMode.AllMetadata).")] - public static IndexingParameters SkipContent(this IndexingParameters parameters) - { - return parameters.SetBlobExtractionMode(BlobExtractionMode.AllMetadata); - } + public static IndexingParameters SkipContent(this IndexingParameters parameters) => + parameters.SetBlobExtractionMode(BlobExtractionMode.AllMetadata); /// /// Specifies which parts of a blob will be indexed by the blob storage indexer. @@ -107,10 +104,8 @@ public static IndexingParameters SkipContent(this IndexingParameters parameters) /// IndexingParameters to configure. /// A BlobExtractionMode value specifying what to index. /// The IndexingParameters instance. - public static IndexingParameters SetBlobExtractionMode(this IndexingParameters parameters, BlobExtractionMode extractionMode) - { - return Configure(parameters, "dataToExtract", (string)extractionMode); - } + public static IndexingParameters SetBlobExtractionMode(this IndexingParameters parameters, BlobExtractionMode extractionMode) => + Configure(parameters, "dataToExtract", (string)extractionMode); /// /// Tells the indexer to assume that all blobs contain JSON, which it will then parse such that each blob's JSON will map to a single @@ -122,10 +117,8 @@ public static IndexingParameters SetBlobExtractionMode(this IndexingParameters p /// This option only applies to indexers that index Azure Blob Storage. /// /// The IndexingParameters instance. - public static IndexingParameters ParseJson(this IndexingParameters parameters) - { - return Configure(parameters, ParsingModeKey, "json"); - } + public static IndexingParameters ParseJson(this IndexingParameters parameters) => + Configure(parameters, ParsingModeKey, "json"); /// /// Tells the indexer to assume that all blobs contain JSON arrays, which it will then parse such that each JSON object in each array will @@ -193,10 +186,8 @@ public static IndexingParameters ParseDelimitedTextFiles(this IndexingParameters /// IndexingParameters to configure. /// /// The IndexingParameters instance. - public static IndexingParameters DoNotFailOnUnsupportedContentType(this IndexingParameters parameters) - { - return Configure(parameters, "failOnUnsupportedContentType", false); - } + public static IndexingParameters DoNotFailOnUnsupportedContentType(this IndexingParameters parameters) => + Configure(parameters, "failOnUnsupportedContentType", false); private static IndexingParameters Configure(IndexingParameters parameters, string key, object value) { diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/AnalyzerAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/AnalyzerAttribute.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/AnalyzerAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/AnalyzerAttribute.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/FieldBuilder.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/FieldBuilder.cs similarity index 95% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/FieldBuilder.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/FieldBuilder.cs index 91a8d9078916..db8cf24f6988 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/FieldBuilder.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/FieldBuilder.cs @@ -18,6 +18,10 @@ namespace Microsoft.Azure.Search /// public static class FieldBuilder { + private static IContractResolver CamelCaseResolver { get; } = new CamelCasePropertyNamesContractResolver(); + + private static IContractResolver DefaultResolver { get; } = new DefaultContractResolver(); + /// /// Creates a collection of objects corresponding to /// the properties of the type supplied. @@ -30,8 +34,8 @@ public static IList BuildForType() { bool useCamelCase = SerializePropertyNamesAsCamelCaseAttribute.IsDefinedOnType(); IContractResolver resolver = useCamelCase - ? JsonUtility.CamelCaseResolver - : JsonUtility.DefaultResolver; + ? CamelCaseResolver + : DefaultResolver; return BuildForType(resolver); } @@ -43,7 +47,7 @@ public static IList BuildForType() /// The type for which fields will be created, based on its properties. /// /// - /// Contract resolver that the will use. + /// Contract resolver that the SearchIndexClient will use. /// This ensures that the field names are generated in a way that is /// consistent with the way the model will be serialized. /// diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IndexAnalyzerAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IndexAnalyzerAttribute.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IndexAnalyzerAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IndexAnalyzerAttribute.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsFacetableAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsFacetableAttribute.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsFacetableAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsFacetableAttribute.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsFilterableAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsFilterableAttribute.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsFilterableAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsFilterableAttribute.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsRetrievableAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsRetrievableAttribute.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsRetrievableAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsRetrievableAttribute.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsSearchableAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsSearchableAttribute.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsSearchableAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsSearchableAttribute.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsSortableAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsSortableAttribute.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/IsSortableAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/IsSortableAttribute.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/SearchAnalyzerAttribute.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/SearchAnalyzerAttribute.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/FieldBuilder/SearchAnalyzerAttribute.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/FieldBuilder/SearchAnalyzerAttribute.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/IIndexesOperations.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/IIndexesOperations.Customization.cs similarity index 81% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/IIndexesOperations.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/IIndexesOperations.Customization.cs index c8d09fb19dbf..bd463462a47b 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/IIndexesOperations.Customization.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/IIndexesOperations.Customization.cs @@ -12,6 +12,11 @@ namespace Microsoft.Azure.Search public partial interface IIndexesOperations { + /// + /// Gets a reference to the SearchServiceClient underlying this operation group. + /// + SearchServiceClient Client { get; } + /// /// Creates a new Azure Search index or updates an index if it already /// exists. @@ -60,17 +65,5 @@ public partial interface IIndexesOperations /// A response with the value true if the index exists; false otherwise. /// Task> ExistsWithHttpMessagesAsync(string indexName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Creates a new index client for querying and managing documents in a given index. - /// - /// The name of the index. - /// A new SearchIndexClient instance. - /// - /// The new client is configured with full read-write access to the index. If you are only planning to use the - /// client for query operations, we recommend directly creating a - /// SearchIndexClient instance instead. - /// - ISearchIndexClient GetClient(string indexName); } } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/IndexesOperations.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/IndexesOperations.Customization.cs similarity index 66% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/IndexesOperations.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/IndexesOperations.Customization.cs index b1a72c43a46c..ee56a0a2405d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/IndexesOperations.Customization.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/IndexesOperations.Customization.cs @@ -5,8 +5,6 @@ namespace Microsoft.Azure.Search { using System.Collections.Generic; - using System.Linq; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Search.Models; @@ -30,21 +28,5 @@ public Task> ExistsWithHttpMessagesAsync( return ExistsHelper.ExistsFromGetResponse(() => this.GetWithHttpMessagesAsync(indexName, searchRequestOptions, customHeaders, cancellationToken)); } - - /// - public ISearchIndexClient GetClient(string indexName) - { - // Argument checking is done by the SearchIndexClient constructor. Note that HttpClient can't be shared in - // case it has already been used (SearchIndexClient will attempt to set the Timeout property on it). - var rootHandler = Client.HttpMessageHandlers.OfType().SingleOrDefault(); - var indexClient = - new SearchIndexClient(Client.SearchServiceName, indexName, Client.SearchCredentials, rootHandler) - { - SearchDnsSuffix = Client.SearchDnsSuffix - }; - - indexClient.HttpClient.Timeout = Client.HttpClient.Timeout; - return indexClient; - } } } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/IndexesOperationsExtensions.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/IndexesOperationsExtensions.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/IndexesOperationsExtensions.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/IndexesOperationsExtensions.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/AnalyzerName.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/AnalyzerName.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/AnalyzerName.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/AnalyzerName.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/CharFilterName.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/CharFilterName.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/CharFilterName.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/CharFilterName.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/DataType.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/DataType.cs similarity index 99% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/DataType.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/DataType.cs index f9b39e00b050..31434258b996 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/DataType.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/DataType.cs @@ -4,6 +4,7 @@ namespace Microsoft.Azure.Search.Models { + using Common; using Newtonsoft.Json; using Serialization; diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/DistanceScoringFunction.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/DistanceScoringFunction.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/DistanceScoringFunction.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/DistanceScoringFunction.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/EdgeNGramTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/EdgeNGramTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/EdgeNGramTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/EdgeNGramTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/Field.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/Field.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/Field.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/Field.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/FreshnessScoringFunction.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/FreshnessScoringFunction.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/FreshnessScoringFunction.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/FreshnessScoringFunction.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/Index.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/Index.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/Index.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/Index.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/KeywordTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/KeywordTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/KeywordTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/KeywordTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/MagnitudeScoringFunction.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/MagnitudeScoringFunction.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/MagnitudeScoringFunction.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/MagnitudeScoringFunction.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/NGramTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/NGramTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/NGramTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/NGramTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/PathHierarchyTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/PathHierarchyTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/PathHierarchyTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/PathHierarchyTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/RegexFlags.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/RegexFlags.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/RegexFlags.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/RegexFlags.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/StandardTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/StandardTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/StandardTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/StandardTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/Suggester.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/Suggester.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/Suggester.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/Suggester.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/TagScoringFunction.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/TagScoringFunction.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/TagScoringFunction.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/TagScoringFunction.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/TokenFilterName.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/TokenFilterName.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/TokenFilterName.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/TokenFilterName.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/TokenizerName.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/TokenizerName.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Indexes/Models/TokenizerName.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Indexes/Models/TokenizerName.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Models/AccessCondition.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Models/AccessCondition.Customization.cs similarity index 99% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Models/AccessCondition.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Models/AccessCondition.Customization.cs index 93ae59c02d45..5a331c3338b8 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Models/AccessCondition.Customization.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Models/AccessCondition.Customization.cs @@ -4,6 +4,8 @@ namespace Microsoft.Azure.Search.Models { + using Common; + public partial class AccessCondition { /// diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Models/IResourceWithETag.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Models/IResourceWithETag.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Models/IResourceWithETag.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Models/IResourceWithETag.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchServiceClient.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SearchServiceClient.Customization.cs similarity index 76% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchServiceClient.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SearchServiceClient.Customization.cs index b72fd44bd594..f607e9c283d3 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SearchServiceClient.Customization.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SearchServiceClient.Customization.cs @@ -4,7 +4,10 @@ namespace Microsoft.Azure.Search { + using System; using System.Net.Http; + using Common; + using Rest; public partial class SearchServiceClient { @@ -49,15 +52,27 @@ public SearchServiceClient(string searchServiceName, SearchCredentials credentia private void Initialize(string searchServiceName, SearchCredentials credentials) { - var validatedSearchServiceName = new SearchServiceName(searchServiceName); Throw.IfArgumentNull(credentials, nameof(credentials)); + ValidateSearchServiceName(searchServiceName); Credentials = credentials; - - validatedSearchServiceName.TryBuildUri(); - SearchServiceName = validatedSearchServiceName; + SearchServiceName = searchServiceName; Credentials.InitializeServiceClient(this); } + + private static void ValidateSearchServiceName(string searchServiceName) + { + Throw.IfNullOrEmptySearchServiceName(searchServiceName); + + Uri uri = TypeConversion.TryParseUri($"https://{searchServiceName}.search.windows.net/"); + + if (uri == null) + { + throw new ArgumentException( + $"Invalid search service name: '{searchServiceName}' Name contains characters that are not valid in a URL.", + nameof(searchServiceName)); + } + } } } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/ISynonymMapsOperations.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/ISynonymMapsOperations.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/ISynonymMapsOperations.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/ISynonymMapsOperations.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/Models/SynonymMap.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/Models/SynonymMap.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/Models/SynonymMap.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/Models/SynonymMap.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/Models/SynonymMapFormat.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/Models/SynonymMapFormat.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/Models/SynonymMapFormat.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/Models/SynonymMapFormat.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/SynonymMapsOperations.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/SynonymMapsOperations.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/SynonymMapsOperations.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/SynonymMapsOperations.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/SynonymMapsOperationsExtensions.Customization.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/SynonymMapsOperationsExtensions.Customization.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/SynonymMaps/SynonymMapsOperationsExtensions.Customization.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/SynonymMaps/SynonymMapsOperationsExtensions.Customization.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/ExistsHelper.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Utilities/ExistsHelper.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/ExistsHelper.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Customizations/Utilities/ExistsHelper.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/DataSourcesOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/DataSourcesOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/DataSourcesOperationsExtensions.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/DataSourcesOperationsExtensions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/DataSourcesOperationsExtensions.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IDataSourcesOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IDataSourcesOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IDataSourcesOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IDataSourcesOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexersOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IIndexersOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexersOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IIndexersOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexesOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IIndexesOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IIndexesOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IIndexesOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISearchServiceClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/ISearchServiceClient.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISearchServiceClient.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/ISearchServiceClient.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISynonymMapsOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/ISynonymMapsOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/ISynonymMapsOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/ISynonymMapsOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IndexersOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IndexersOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IndexersOperationsExtensions.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexersOperationsExtensions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IndexersOperationsExtensions.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IndexesOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IndexesOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IndexesOperationsExtensions.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/IndexesOperationsExtensions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/IndexesOperationsExtensions.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AccessCondition.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/AccessCondition.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AccessCondition.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/AccessCondition.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeRequest.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/AnalyzeRequest.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeRequest.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/AnalyzeRequest.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/AnalyzeResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AnalyzeResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/AnalyzeResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Analyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Analyzer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Analyzer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Analyzer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AsciiFoldingTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/AsciiFoldingTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/AsciiFoldingTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/AsciiFoldingTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CharFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CharFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CharFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CharFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CjkBigramTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CjkBigramTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilterScripts.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CjkBigramTokenFilterScripts.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CjkBigramTokenFilterScripts.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CjkBigramTokenFilterScripts.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ClassicTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ClassicTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ClassicTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ClassicTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CommonGramTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CommonGramTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CommonGramTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CommonGramTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CorsOptions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CorsOptions.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CorsOptions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CorsOptions.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CustomAnalyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CustomAnalyzer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/CustomAnalyzer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/CustomAnalyzer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataChangeDetectionPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataChangeDetectionPolicy.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataChangeDetectionPolicy.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataChangeDetectionPolicy.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataContainer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataContainer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataContainer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataContainer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataDeletionDetectionPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataDeletionDetectionPolicy.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataDeletionDetectionPolicy.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataDeletionDetectionPolicy.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSource.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataSource.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSource.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataSource.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceCredentials.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataSourceCredentials.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceCredentials.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataSourceCredentials.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceListResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataSourceListResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DataSourceListResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DataSourceListResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DictionaryDecompounderTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DictionaryDecompounderTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DictionaryDecompounderTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DictionaryDecompounderTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DistanceScoringFunction.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringFunction.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DistanceScoringFunction.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DistanceScoringParameters.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/DistanceScoringParameters.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/DistanceScoringParameters.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterSide.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/EdgeNGramTokenFilterSide.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterSide.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/EdgeNGramTokenFilterSide.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/EdgeNGramTokenFilterV2.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenFilterV2.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/EdgeNGramTokenFilterV2.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/EdgeNGramTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/EdgeNGramTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/EdgeNGramTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ElisionTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ElisionTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ElisionTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ElisionTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMapping.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/FieldMapping.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMapping.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/FieldMapping.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMappingFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/FieldMappingFunction.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FieldMappingFunction.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/FieldMappingFunction.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/FreshnessScoringFunction.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringFunction.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/FreshnessScoringFunction.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/FreshnessScoringParameters.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/FreshnessScoringParameters.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/FreshnessScoringParameters.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/HighWaterMarkChangeDetectionPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/HighWaterMarkChangeDetectionPolicy.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/HighWaterMarkChangeDetectionPolicy.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/HighWaterMarkChangeDetectionPolicy.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Index.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Index.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Index.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Index.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexGetStatisticsResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexGetStatisticsResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexGetStatisticsResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexGetStatisticsResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexListResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexListResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexListResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexListResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Indexer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Indexer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Indexer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Indexer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerExecutionInfo.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionInfo.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerExecutionInfo.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerExecutionResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerExecutionResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionStatus.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerExecutionStatus.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerExecutionStatus.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerExecutionStatus.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerListResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerListResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerListResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerListResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerStatus.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerStatus.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexerStatus.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexerStatus.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexingSchedule.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexingSchedule.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/IndexingSchedule.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/IndexingSchedule.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ItemError.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ItemError.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ItemError.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ItemError.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeepTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/KeepTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeepTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/KeepTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordMarkerTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/KeywordMarkerTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordMarkerTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/KeywordMarkerTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordTokenizerV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/KeywordTokenizerV2.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/KeywordTokenizerV2.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/KeywordTokenizerV2.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LengthTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/LengthTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LengthTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/LengthTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LimitTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/LimitTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/LimitTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/LimitTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MagnitudeScoringFunction.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringFunction.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MagnitudeScoringFunction.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MagnitudeScoringParameters.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MagnitudeScoringParameters.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MagnitudeScoringParameters.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MappingCharFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MappingCharFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MappingCharFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MappingCharFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageStemmingTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MicrosoftLanguageStemmingTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageStemmingTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MicrosoftLanguageStemmingTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MicrosoftLanguageTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftLanguageTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MicrosoftLanguageTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftStemmingTokenizerLanguage.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MicrosoftStemmingTokenizerLanguage.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftStemmingTokenizerLanguage.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MicrosoftStemmingTokenizerLanguage.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftTokenizerLanguage.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MicrosoftTokenizerLanguage.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/MicrosoftTokenizerLanguage.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/MicrosoftTokenizerLanguage.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenFilterV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/NGramTokenFilterV2.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenFilterV2.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/NGramTokenFilterV2.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/NGramTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/NGramTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/NGramTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PathHierarchyTokenizerV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PathHierarchyTokenizerV2.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PathHierarchyTokenizerV2.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PathHierarchyTokenizerV2.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternAnalyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternAnalyzer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternAnalyzer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternAnalyzer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternCaptureTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternCaptureTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternCaptureTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternCaptureTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceCharFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternReplaceCharFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceCharFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternReplaceCharFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternReplaceTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternReplaceTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternReplaceTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PatternTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PatternTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticEncoder.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PhoneticEncoder.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticEncoder.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PhoneticEncoder.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PhoneticTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/PhoneticTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/PhoneticTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ScoringFunction.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunction.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ScoringFunction.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionAggregation.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ScoringFunctionAggregation.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionAggregation.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ScoringFunctionAggregation.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionInterpolation.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ScoringFunctionInterpolation.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringFunctionInterpolation.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ScoringFunctionInterpolation.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringProfile.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ScoringProfile.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ScoringProfile.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ScoringProfile.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ShingleTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ShingleTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/ShingleTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/ShingleTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SnowballTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SnowballTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilterLanguage.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SnowballTokenFilterLanguage.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SnowballTokenFilterLanguage.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SnowballTokenFilterLanguage.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SoftDeleteColumnDeletionDetectionPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SoftDeleteColumnDeletionDetectionPolicy.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SoftDeleteColumnDeletionDetectionPolicy.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SoftDeleteColumnDeletionDetectionPolicy.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SqlIntegratedChangeTrackingPolicy.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SqlIntegratedChangeTrackingPolicy.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SqlIntegratedChangeTrackingPolicy.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SqlIntegratedChangeTrackingPolicy.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardAnalyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StandardAnalyzer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardAnalyzer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StandardAnalyzer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardTokenizerV2.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StandardTokenizerV2.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StandardTokenizerV2.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StandardTokenizerV2.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerOverrideTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StemmerOverrideTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerOverrideTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StemmerOverrideTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StemmerTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StemmerTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilterLanguage.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StemmerTokenFilterLanguage.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StemmerTokenFilterLanguage.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StemmerTokenFilterLanguage.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopAnalyzer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StopAnalyzer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopAnalyzer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StopAnalyzer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsList.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StopwordsList.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsList.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StopwordsList.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StopwordsTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/StopwordsTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/StopwordsTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Suggester.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Suggester.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Suggester.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Suggester.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMap.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SynonymMap.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMap.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SynonymMap.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMapListResult.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SynonymMapListResult.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymMapListResult.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SynonymMapListResult.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SynonymTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/SynonymTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/SynonymTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringFunction.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TagScoringFunction.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringFunction.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TagScoringFunction.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringParameters.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TagScoringParameters.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TagScoringParameters.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TagScoringParameters.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TextWeights.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TextWeights.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TextWeights.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TextWeights.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenCharacterKind.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TokenCharacterKind.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenCharacterKind.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TokenCharacterKind.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TokenInfo.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TokenInfo.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TokenInfo.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Tokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Tokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/Tokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/Tokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TruncateTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TruncateTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/TruncateTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/TruncateTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UaxUrlEmailTokenizer.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/UaxUrlEmailTokenizer.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UaxUrlEmailTokenizer.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/UaxUrlEmailTokenizer.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UniqueTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/UniqueTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/UniqueTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/UniqueTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/WordDelimiterTokenFilter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/WordDelimiterTokenFilter.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/Models/WordDelimiterTokenFilter.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/Models/WordDelimiterTokenFilter.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SdkInfo_SearchServiceClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/SdkInfo_SearchServiceClient.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SdkInfo_SearchServiceClient.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/SdkInfo_SearchServiceClient.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SearchServiceClient.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/SearchServiceClient.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SearchServiceClient.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/SearchServiceClient.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperations.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/SynonymMapsOperations.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperations.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/SynonymMapsOperations.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperationsExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/SynonymMapsOperationsExtensions.cs similarity index 100% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/GeneratedSearchService/SynonymMapsOperationsExtensions.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Generated/SynonymMapsOperationsExtensions.cs diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj new file mode 100644 index 000000000000..9d0dcb12e643 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj @@ -0,0 +1,22 @@ + + + + Microsoft.Azure.Search.Service + Use this package if you're developing automation in .NET to manage Azure Search indexes, synonym maps, indexers, data sources, or other service-level resources. If you only need to query or update documents in your indexes, use the Microsoft.Azure.Search.Data package instead. If you need all the functionality of Azure Search, use the Microsoft.Azure.Search package instead. + Microsoft Azure Search Service Library + Microsoft.Azure.Search.Service + 4.0.2-preview + Microsoft Azure Search;Search + See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. + + + + net452;netstandard1.4 + + + + + + + + \ No newline at end of file diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5108b2b4e880 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +using System.Reflection; +using System.Resources; + +[assembly: AssemblyTitle("Microsoft Azure Search Service Library")] +[assembly: AssemblyDescription("Use this assembly if you're developing automation in .NET to manage Azure Search indexes, synonym maps, indexers, data sources, or other service-level resources. If you only need to query or update documents in your indexes, use the Microsoft.Azure.Search.Data assembly instead. If you need all the functionality of Azure Search, use the Microsoft.Azure.Search assembly instead.")] + +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.2.0")] + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient-from-private-spec.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate-from-private-spec.cmd similarity index 86% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient-from-private-spec.cmd rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate-from-private-spec.cmd index 809de7754d17..4603db346e11 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient-from-private-spec.cmd +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate-from-private-spec.cmd @@ -10,4 +10,4 @@ :: 2. Your remote branch name @echo off -call .\generate-searchserviceclient.cmd latest %1 %2 +call .\generate.cmd latest %1 %2 diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.cmd new file mode 100644 index 000000000000..34ef2258f8c0 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.cmd @@ -0,0 +1,17 @@ +:: +:: Microsoft Azure SDK for Net - Generate library code +:: Copyright (C) Microsoft Corporation. All Rights Reserved. +:: + +@echo off +set repoRoot=%~dp0..\..\..\..\.. +set generateFolder=%~dp0Generated +set sharedGenerateFolder=%generateFolder%\..\..\Microsoft.Azure.Search.Common\Generated + +if exist %generateFolder% rd /S /Q %generateFolder% +call %repoRoot%\tools\generate.cmd search/data-plane/Microsoft.Azure.Search.Service %* + +:: Move any extra files generated for types that are shared between SearchServiceClient and SearchIndexClient to Common. +if exist %sharedGenerateFolder% rd /S /Q %sharedGenerateFolder% +mkdir %sharedGenerateFolder% +move "%generateFolder%\Models\SearchRequestOptions.cs" %sharedGenerateFolder% diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/QueryOption.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/QueryOption.cs deleted file mode 100644 index b15d19014af9..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Documents/Models/QueryOption.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -namespace Microsoft.Azure.Search.Models -{ - using System; - using System.Collections.Generic; - - internal struct QueryOption - { - public QueryOption(string name, string value) - : this() - { - this.Name = name; - this.Value = value; - } - - public QueryOption(string name, IEnumerable values) - : this(name, values.ToCommaSeparatedString()) - { - // Do nothing. - } - - public string Name { get; private set; } - - public string Value { get; private set; } - - public override string ToString() - { - return String.Format("{0}={1}", this.Name, this.Value); - } - } -} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/EnumerableExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/EnumerableExtensions.cs deleted file mode 100644 index f131e8be2075..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/EnumerableExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -namespace System.Collections.Generic -{ - using System.Linq; - - internal static class EnumerableExtensions - { - public static string ToCommaSeparatedString(this IEnumerable enumerable) - { - if (enumerable == null || !enumerable.Any()) - { - return null; - } - - return String.Join(",", enumerable); - } - } -} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/IndexName.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/IndexName.cs deleted file mode 100644 index 3894bc6de314..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/IndexName.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -namespace Microsoft.Azure.Search -{ - using System; - - internal class IndexName - { - private readonly string _name; - - public IndexName(string indexName) - { - Name.ThrowIfNullOrEmpty(indexName, "indexName", "index"); - _name = indexName; - } - - public static implicit operator string(IndexName indexName) - { - return indexName.ToString(); - } - - public override string ToString() - { - return _name ?? String.Empty; - } - } -} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/Name.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/Name.cs deleted file mode 100644 index d08b36223b86..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/Name.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -namespace Microsoft.Azure.Search -{ - using System; - - internal static class Name - { - public static void ThrowIfNullOrEmpty(string name, string paramName, string nameKind) - { - Throw.IfArgumentNullOrEmpty( - name, - paramName, - String.Format("Invalid {0} name. Name cannot be null or an empty string.", nameKind)); - } - } -} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/SearchServiceName.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/SearchServiceName.cs deleted file mode 100644 index f6c6e44b09e5..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/SearchServiceName.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -namespace Microsoft.Azure.Search -{ - using System; - using System.Globalization; - using Rest; - - internal class SearchServiceName - { - private const string InvalidSearchUriMessageFormat = - "Invalid search service name: '{0}' Name contains characters that are not valid in a URL."; - - private const string InvalidSearchOrIndexUriMessageFormat = - "Either the search service name '{0}' or the index name '{1}' is invalid. Names must contain only characters that are valid in a URL."; - - private readonly string _name; - - public SearchServiceName(string searchServiceName) - { - Name.ThrowIfNullOrEmpty(searchServiceName, "searchServiceName", "search service"); - _name = searchServiceName; - } - - public static implicit operator string(SearchServiceName searchServiceName) - { - return searchServiceName.ToString(); - } - - public override string ToString() - { - return _name ?? String.Empty; - } - - public void TryBuildUri() - { - Uri uri = TypeConversion.TryParseUri("https://" + this + ".search.windows.net/"); - - if (uri == null) - { - string message = String.Format(CultureInfo.InvariantCulture, InvalidSearchUriMessageFormat, _name); - throw new ArgumentException(message, "searchServiceName"); - } - } - - public void TryBuildUriWithIndex(IndexName indexName) - { - Uri uri = TypeConversion.TryParseUri("https://" + this + "search.windows.net/indexes('" + indexName + "')/"); - - if (uri == null) - { - string message = String.Format(CultureInfo.InvariantCulture, InvalidSearchOrIndexUriMessageFormat, _name, indexName); - throw new ArgumentException(message, "searchServiceName"); - } - } - } -} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/Throw.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/Throw.cs deleted file mode 100644 index 2db7a22822d0..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Customizations/Utilities/Throw.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -namespace Microsoft.Azure.Search -{ - using System; - - internal static class Throw - { - public static void IfArgument(bool isInvalid, string paramName, string message = null) - { - if (isInvalid) - { - message = message ?? "Invalid argument."; - throw new ArgumentException(message, paramName); - } - } - - public static void IfArgumentNull(T value, string paramName, string message = null) where T : class - { - if (value == null) - { - if (message == null) - { - throw new ArgumentNullException(paramName); - } - else - { - throw new ArgumentNullException(paramName, message); - } - } - } - - public static void IfArgumentNullOrEmpty(string value, string paramName, string message = null) - { - Throw.IfArgumentNull(value, paramName, message); - - message = message ?? "Argument cannot be an empty string."; - Throw.IfArgument(value.Length == 0, paramName, message); - } - } -} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/IndexesGetClientExtensions.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/IndexesGetClientExtensions.cs new file mode 100644 index 000000000000..139c3e40a008 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/IndexesGetClientExtensions.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +namespace Microsoft.Azure.Search +{ + using System.Linq; + using System.Net.Http; + + /// + /// Defines an extension method for obtaining a pre-configured SearchIndexClient from the Indexes property + /// of a SearchServiceClient. + /// + public static class IndexesGetClientExtensions + { + /// + /// Creates a new index client for querying and managing documents in a given index. + /// + /// The name of the index. + /// A new SearchIndexClient instance. + /// + /// The new client is configured with full read-write access to the index. If you are only planning to use the + /// client for query operations, we recommend directly creating a + /// SearchIndexClient instance instead. + /// + public static ISearchIndexClient GetClient(this IIndexesOperations operations, string indexName) + { + // Argument checking is done by the SearchIndexClient constructor. Note that HttpClient can't be shared in + // case it has already been used (SearchIndexClient will attempt to set the Timeout property on it). + SearchServiceClient serviceClient = operations.Client; + var rootHandler = serviceClient.HttpMessageHandlers.OfType().SingleOrDefault(); + var indexClient = + new SearchIndexClient(serviceClient.SearchServiceName, indexName, serviceClient.SearchCredentials, rootHandler) + { + SearchDnsSuffix = serviceClient.SearchDnsSuffix + }; + + indexClient.HttpClient.Timeout = serviceClient.HttpClient.Timeout; + return indexClient; + } + } +} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj index ab9b19f9a52d..c741c20bb98e 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj @@ -14,6 +14,7 @@ net452;netstandard1.4 - + + \ No newline at end of file diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs index 3a8f03104476..6cf30e92e12e 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs @@ -4,7 +4,6 @@ using System.Reflection; using System.Resources; -using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Microsoft Azure Search Library")] [assembly: AssemblyDescription("Makes it easy to develop a .NET application that uses Azure Search.")] @@ -19,13 +18,3 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] -[assembly: InternalsVisibleTo("Search.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] - -namespace Microsoft.Azure.Search -{ - internal class Consts - { - // Putting this in AssemblyInfo.cs so we remember to change it when the major SDK version changes. - public const string TargetApiVersion = "2016-09-01-Preview"; - } -} diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient.cmd deleted file mode 100644 index 450074721a91..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/generate-searchserviceclient.cmd +++ /dev/null @@ -1,11 +0,0 @@ -:: -:: Microsoft Azure SDK for Net - Generate library code -:: Copyright (C) Microsoft Corporation. All Rights Reserved. -:: - -@echo off -set repoRoot=%~dp0..\..\..\..\.. -set generateFolder=%~dp0GeneratedSearchService - -if exist %generateFolder% rd /S /Q %generateFolder% -call %repoRoot%\tools\generate.cmd search/data-plane/Microsoft.Azure.Search.Service %* diff --git a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/Hotel.cs b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/Hotel.cs index 365cad715c10..a017deb287d6 100644 --- a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/Hotel.cs +++ b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/Hotel.cs @@ -5,10 +5,10 @@ namespace Microsoft.Azure.Search.Tests { using System; - using System.Collections.Generic; using System.Linq; - using Microsoft.Azure.Search.Models; - using Microsoft.Spatial; + using Common; + using Models; + using Spatial; [SerializePropertyNamesAsCamelCase] public class Hotel @@ -47,67 +47,45 @@ public override bool Equals(object obj) } return - this.HotelId == other.HotelId && - DoublesEqual(this.BaseRate, other.BaseRate) && - this.Description == other.Description && - this.DescriptionFr == other.DescriptionFr && - this.HotelName == other.HotelName && - this.Category == other.Category && - ((this.Tags == null) ? (other.Tags == null || other.Tags.Length == 0) : this.Tags.SequenceEqual(other.Tags ?? new string[0])) && - this.ParkingIncluded == other.ParkingIncluded && - this.SmokingAllowed == other.SmokingAllowed && - DateTimeOffsetsEqual(this.LastRenovationDate, other.LastRenovationDate) && - this.Rating == other.Rating && - ((this.Location == null) ? other.Location == null : this.Location.Equals(other.Location)); + HotelId == other.HotelId && + DoublesEqual(BaseRate, other.BaseRate) && + Description == other.Description && + DescriptionFr == other.DescriptionFr && + HotelName == other.HotelName && + Category == other.Category && + ((Tags == null) ? (other.Tags == null || other.Tags.Length == 0) : Tags.SequenceEqual(other.Tags ?? new string[0])) && + ParkingIncluded == other.ParkingIncluded && + SmokingAllowed == other.SmokingAllowed && + DateTimeOffsetsEqual(LastRenovationDate, other.LastRenovationDate) && + Rating == other.Rating && + ((Location == null) ? other.Location == null : Location.Equals(other.Location)); } - public override int GetHashCode() - { - return (this.HotelId != null) ? this.HotelId.GetHashCode() : 0; - } + public override int GetHashCode() => HotelId?.GetHashCode() ?? 0; - public override string ToString() - { - const string Format = - "ID: {0}; BaseRate: {1}; Description: {2}; Description (French): {3}; Name: {4}; Category: {5}; " + - "Tags: {6}; Parking: {7}; Smoking: {8}; LastRenovationDate: {9}; Rating: {10}; " + - "Location: [{11}, {12}]"; - - return String.Format( - Format, - this.HotelId, - this.BaseRate, - this.Description, - this.DescriptionFr, - this.HotelName, - this.Category, - (this.Tags != null) ? this.Tags.ToCommaSeparatedString() : "null", - this.ParkingIncluded, - this.SmokingAllowed, - this.LastRenovationDate, - this.Rating, - this.Location != null ? this.Location.Longitude : 0, - this.Location != null ? this.Location.Latitude : 0); - } + public override string ToString() => + $"ID: {HotelId}; BaseRate: {BaseRate}; Description: {Description}; " + + $"Description (French): {DescriptionFr}; Name: {HotelName}; Category: {Category}; " + + $"Tags: {Tags?.ToCommaSeparatedString() ?? "null"}; Parking: {ParkingIncluded}; " + + $"Smoking: {SmokingAllowed}; LastRenovationDate: {LastRenovationDate}; Rating: {Rating}; " + + $"Location: [{Location?.Longitude ?? 0}, {Location?.Latitude ?? 0}]"; - public Document AsDocument() - { - return new Document() + public Document AsDocument() => + new Document() { - { "baseRate", this.BaseRate }, - { "category", this.Category }, - { "description", this.Description }, - { "descriptionFr", this.DescriptionFr }, - { "hotelId", this.HotelId }, - { "hotelName", this.HotelName }, - { "lastRenovationDate", this.LastRenovationDate }, - { "location", this.Location }, - { "parkingIncluded", this.ParkingIncluded }, - { "rating", this.Rating.HasValue ? (long?)this.Rating.Value : null }, // JSON.NET always deserializes to int64 - { "smokingAllowed", this.SmokingAllowed }, - { "tags", this.Tags ?? new string[0] } // OData always gives [] instead of null for collections. + ["baseRate"] = BaseRate, + ["category"] = Category, + ["description"] = Description, + ["descriptionFr"] = DescriptionFr, + ["hotelId"] = HotelId, + ["hotelName"] = HotelName, + ["lastRenovationDate"] = LastRenovationDate, + ["location"] = Location, + ["parkingIncluded"] = ParkingIncluded, + ["rating"] = Rating.HasValue ? (long?)Rating.Value : null, // JSON.NET always deserializes to int64 + ["smokingAllowed"] = SmokingAllowed, + ["tags"] = Tags ?? new string[0] // OData always gives [] instead of null for collections. }; - } private static bool DoublesEqual(double? x, double? y) { diff --git a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/LoudHotel.cs b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/LoudHotel.cs index 9e38c2ad0fe7..5f6fb35634a1 100644 --- a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/LoudHotel.cs +++ b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/LoudHotel.cs @@ -5,10 +5,10 @@ namespace Microsoft.Azure.Search.Tests { using System; - using System.Collections.Generic; using System.Linq; - using Microsoft.Spatial; + using Common; using Newtonsoft.Json; + using Spatial; public class LoudHotel { @@ -60,52 +60,31 @@ public override bool Equals(object obj) } return - this.HOTELID == other.HOTELID && - this.BASERATE == other.BASERATE && - this.DESCRIPTION == other.DESCRIPTION && - this.DESCRIPTIONFRENCH == other.DESCRIPTIONFRENCH && - this.HOTELNAME == other.HOTELNAME && - this.CATEGORY == other.CATEGORY && - ((this.TAGS == null) ? (other.TAGS == null || other.TAGS.Length == 0) : this.TAGS.SequenceEqual(other.TAGS ?? new string[0])) && - this.PARKINGINCLUDED == other.PARKINGINCLUDED && - this.SMOKINGALLOWED == other.SMOKINGALLOWED && - this.LASTRENOVATIONDATE == other.LASTRENOVATIONDATE && - this.RATING == other.RATING && - ((this.LOCATION == null) ? other.LOCATION == null : this.LOCATION.Equals(other.LOCATION)); + HOTELID == other.HOTELID && + BASERATE == other.BASERATE && + DESCRIPTION == other.DESCRIPTION && + DESCRIPTIONFRENCH == other.DESCRIPTIONFRENCH && + HOTELNAME == other.HOTELNAME && + CATEGORY == other.CATEGORY && + ((TAGS == null) ? (other.TAGS == null || other.TAGS.Length == 0) : TAGS.SequenceEqual(other.TAGS ?? new string[0])) && + PARKINGINCLUDED == other.PARKINGINCLUDED && + SMOKINGALLOWED == other.SMOKINGALLOWED && + LASTRENOVATIONDATE == other.LASTRENOVATIONDATE && + RATING == other.RATING && + ((LOCATION == null) ? other.LOCATION == null : LOCATION.Equals(other.LOCATION)); } - public override int GetHashCode() - { - return (this.HOTELID != null) ? this.HOTELID.GetHashCode() : 0; - } + public override int GetHashCode() => HOTELID?.GetHashCode() ?? 0; - public override string ToString() - { - const string Format = - "ID: {0}; BaseRate: {1}; Description: {2}; Description (French): {3}; Name: {4}; Category: {5}; " + - "Tags: {6}; Parking: {7}; Smoking: {8}; LastRenovationDate: {9}; Rating: {10}; " + - "Location: [{11}, {12}]"; - - return String.Format( - Format, - this.HOTELID, - this.BASERATE, - this.DESCRIPTION, - this.DESCRIPTIONFRENCH, - this.HOTELNAME, - this.CATEGORY, - (this.TAGS != null) ? this.TAGS.ToCommaSeparatedString() : "null", - this.PARKINGINCLUDED, - this.SMOKINGALLOWED, - this.LASTRENOVATIONDATE, - this.RATING, - this.LOCATION != null ? this.LOCATION.Longitude : 0, - this.LOCATION != null ? this.LOCATION.Latitude : 0); - } + public override string ToString() => + $"ID: {HOTELID}; BaseRate: {BASERATE}; Description: {DESCRIPTION}; " + + $"Description (French): {DESCRIPTIONFRENCH}; Name: {HOTELNAME}; Category: {CATEGORY}; " + + $"Tags: {TAGS?.ToCommaSeparatedString() ?? "null"}; Parking: {PARKINGINCLUDED}; " + + $"Smoking: {SMOKINGALLOWED}; LastRenovationDate: {LASTRENOVATIONDATE}; Rating: {RATING}; " + + $"Location: [{LOCATION?.Longitude ?? 0}, {LOCATION?.Latitude ?? 0}]"; - public Hotel ToHotel() - { - return new Hotel() + public Hotel ToHotel() => + new Hotel() { BaseRate = BASERATE, Category = CATEGORY, @@ -120,6 +99,5 @@ public Hotel ToHotel() SmokingAllowed = SMOKINGALLOWED, Tags = TAGS }; - } } } diff --git a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Serialization/SearchParametersTests.cs b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Serialization/SearchParametersTests.cs index 728eed0c735b..b9159f5ad150 100644 --- a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Serialization/SearchParametersTests.cs +++ b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Serialization/SearchParametersTests.cs @@ -5,10 +5,10 @@ namespace Microsoft.Azure.Search.Tests { using System; - using System.Collections.Generic; using System.Linq; - using Microsoft.Azure.Search.Models; - using Microsoft.Spatial; + using Common; + using Models; + using Spatial; using Xunit; public sealed class SearchParametersTests diff --git a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Serialization/SuggestParametersTests.cs b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Serialization/SuggestParametersTests.cs index 6583dd6a45ab..cf734b506b7b 100644 --- a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Serialization/SuggestParametersTests.cs +++ b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Serialization/SuggestParametersTests.cs @@ -5,8 +5,8 @@ namespace Microsoft.Azure.Search.Tests { using System; - using System.Collections.Generic; - using Microsoft.Azure.Search.Models; + using Common; + using Models; using Xunit; public sealed class SuggestParametersTests diff --git a/src/SDKs/Search/Search.sln b/src/SDKs/Search/Search.sln index d38eda750ec2..fb1184058160 100644 --- a/src/SDKs/Search/Search.sln +++ b/src/SDKs/Search/Search.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26228.4 +VisualStudioVersion = 15.0.27130.2003 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.Search", "Management\Management.Search\Microsoft.Azure.Management.Search.csproj", "{A52AF58B-7383-416B-9A7E-601B9C628CDA}" EndProject @@ -15,6 +15,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search", "D EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Search.Tests", "DataPlane\Search.Tests\Search.Tests.csproj", "{4B39B63E-16C8-415B-8201-F4330AB20380}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search.Data", "DataPlane\Microsoft.Azure.Search.Data\Microsoft.Azure.Search.Data.csproj", "{3E076803-9B46-40D0-8620-CA66699C55B5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search.Common", "DataPlane\Microsoft.Azure.Search.Common\Microsoft.Azure.Search.Common.csproj", "{59C74888-5692-4ED7-9A61-C58823B22DF1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search.Service", "DataPlane\Microsoft.Azure.Search.Service\Microsoft.Azure.Search.Service.csproj", "{CA6417A8-23A2-429D-B6D2-F636F0ABA488}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,6 +43,18 @@ Global {4B39B63E-16C8-415B-8201-F4330AB20380}.Debug|Any CPU.Build.0 = Debug|Any CPU {4B39B63E-16C8-415B-8201-F4330AB20380}.Release|Any CPU.ActiveCfg = Release|Any CPU {4B39B63E-16C8-415B-8201-F4330AB20380}.Release|Any CPU.Build.0 = Release|Any CPU + {3E076803-9B46-40D0-8620-CA66699C55B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E076803-9B46-40D0-8620-CA66699C55B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E076803-9B46-40D0-8620-CA66699C55B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E076803-9B46-40D0-8620-CA66699C55B5}.Release|Any CPU.Build.0 = Release|Any CPU + {59C74888-5692-4ED7-9A61-C58823B22DF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59C74888-5692-4ED7-9A61-C58823B22DF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59C74888-5692-4ED7-9A61-C58823B22DF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59C74888-5692-4ED7-9A61-C58823B22DF1}.Release|Any CPU.Build.0 = Release|Any CPU + {CA6417A8-23A2-429D-B6D2-F636F0ABA488}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA6417A8-23A2-429D-B6D2-F636F0ABA488}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA6417A8-23A2-429D-B6D2-F636F0ABA488}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA6417A8-23A2-429D-B6D2-F636F0ABA488}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -46,5 +64,11 @@ Global {C22D7F0A-F4D4-4AE2-AAF1-16C5A61D2703} = {248E962E-D501-4153-8B38-459B7DCD6871} {86D38C24-45C2-481A-B59F-CE77351F32B9} = {6CF5428A-7C5A-4276-AC40-41EF40911C9C} {4B39B63E-16C8-415B-8201-F4330AB20380} = {6CF5428A-7C5A-4276-AC40-41EF40911C9C} + {3E076803-9B46-40D0-8620-CA66699C55B5} = {6CF5428A-7C5A-4276-AC40-41EF40911C9C} + {59C74888-5692-4ED7-9A61-C58823B22DF1} = {6CF5428A-7C5A-4276-AC40-41EF40911C9C} + {CA6417A8-23A2-429D-B6D2-F636F0ABA488} = {6CF5428A-7C5A-4276-AC40-41EF40911C9C} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {925ADFCA-B19C-4144-B75B-3C82B1AD9C2C} EndGlobalSection EndGlobal diff --git a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Index.txt b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Data.txt similarity index 91% rename from src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Index.txt rename to src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Data.txt index a917bde74757..2420a6ff2ef4 100644 --- a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Index.txt +++ b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Data.txt @@ -1,4 +1,4 @@ -2018-02-23 01:55:45 UTC +2018-03-02 03:24:06 UTC 1) azure-rest-api-specs repository information GitHub user: Azure diff --git a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt index 820f2aa19f58..0a7c79e3144e 100644 --- a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt +++ b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt @@ -1,4 +1,4 @@ -2018-02-23 01:56:42 UTC +2018-03-02 03:32:17 UTC 1) azure-rest-api-specs repository information GitHub user: Azure From a04d88bb6d192eee3f6c7ceb8ea41666fa066459 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Thu, 1 Mar 2018 19:50:40 -0800 Subject: [PATCH 3/6] [Azure Search] Factoring out data plane assembly and package versions Also bumping all data plane package major versions since moving types to different assemblies is a breaking change. --- .../Search/DataPlane/AssemblyInfo.Common.cs | 17 +++++++++++++++++ .../Search/DataPlane/AzSearch.DataPlane.props | 10 ++++++++++ .../Microsoft.Azure.Search.Common.csproj | 10 ++++------ .../Properties/AssemblyInfo.cs | 11 ----------- .../Microsoft.Azure.Search.Data.csproj | 9 ++++----- .../Properties/AssemblyInfo.cs | 10 ---------- .../Microsoft.Azure.Search.Service.csproj | 9 ++++----- .../Properties/AssemblyInfo.cs | 11 ----------- .../Microsoft.Azure.Search.csproj | 9 ++++----- .../Properties/AssemblyInfo.cs | 11 ----------- src/SDKs/Search/Search.sln | 4 ++++ 11 files changed, 47 insertions(+), 64 deletions(-) create mode 100644 src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs create mode 100644 src/SDKs/Search/DataPlane/AzSearch.DataPlane.props diff --git a/src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs b/src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs new file mode 100644 index 000000000000..73b40154d305 --- /dev/null +++ b/src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +using System.Reflection; +using System.Resources; + +[assembly: AssemblyVersion("5.0.0.0")] +[assembly: AssemblyFileVersion("5.0.0.0")] + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] diff --git a/src/SDKs/Search/DataPlane/AzSearch.DataPlane.props b/src/SDKs/Search/DataPlane/AzSearch.DataPlane.props new file mode 100644 index 000000000000..d16fe893cf7e --- /dev/null +++ b/src/SDKs/Search/DataPlane/AzSearch.DataPlane.props @@ -0,0 +1,10 @@ + + + Microsoft Azure Search;Search + 5.0.0-preview + + + + net452;netstandard1.4 + + \ No newline at end of file diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj index bc29cffa8eaf..c7d1abb224b6 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj @@ -1,16 +1,14 @@  + Microsoft.Azure.Search.Common Common types needed by the Azure Search .NET libraries. This is not the package you are looking for; It is only meant to be used as a dependency. Microsoft Azure Search Common Library Microsoft.Azure.Search.Common - 4.0.2-preview - Microsoft Azure Search;Search See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. - - - net452;netstandard1.4 - + + + \ No newline at end of file diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs index 5126301c3f36..d4d49aa4da6c 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs @@ -7,14 +7,3 @@ [assembly: AssemblyTitle("Microsoft Azure Search Common Library")] [assembly: AssemblyDescription("Common types needed by the Azure Search .NET libraries. This is not the assembly you are looking for; It is only meant to be used as a dependency.")] - -[assembly: AssemblyVersion("4.0.0.0")] -[assembly: AssemblyFileVersion("4.0.2.0")] - -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] -[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj index b9d9b4217731..3f96f4219c20 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj @@ -1,18 +1,17 @@  + Microsoft.Azure.Search.Data Use this package if you're developing a .NET application using Azure Search, and you only need to query or update documents in your indexes. If you also need to create or update indexes, synonym maps, or other service-level resources, use the Microsoft.Azure.Search package instead. Microsoft Azure Search Data Library Microsoft.Azure.Search.Data - 4.0.2-preview - Microsoft Azure Search;Search See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. + + + - - net452;netstandard1.4 - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs index 21985443e9dd..0a137d84bd04 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs @@ -9,16 +9,6 @@ [assembly: AssemblyTitle("Microsoft Azure Search Data Library")] [assembly: AssemblyDescription("Use this assembly if you're developing a .NET application using Azure Search, and you only need to query or update documents in your indexes. If you also need to create or update indexes, synonym maps, or other service-level resources, use the Microsoft.Azure.Search assembly instead.")] -[assembly: AssemblyVersion("4.0.0.0")] -[assembly: AssemblyFileVersion("4.0.2.0")] - -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] -[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] [assembly: InternalsVisibleTo("Search.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] namespace Microsoft.Azure.Search diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj index 9d0dcb12e643..ebd6abdc2e9d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj @@ -1,18 +1,17 @@  + Microsoft.Azure.Search.Service Use this package if you're developing automation in .NET to manage Azure Search indexes, synonym maps, indexers, data sources, or other service-level resources. If you only need to query or update documents in your indexes, use the Microsoft.Azure.Search.Data package instead. If you need all the functionality of Azure Search, use the Microsoft.Azure.Search package instead. Microsoft Azure Search Service Library Microsoft.Azure.Search.Service - 4.0.2-preview - Microsoft Azure Search;Search See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. + + + - - net452;netstandard1.4 - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs index 5108b2b4e880..4c7ff12445ab 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs @@ -7,14 +7,3 @@ [assembly: AssemblyTitle("Microsoft Azure Search Service Library")] [assembly: AssemblyDescription("Use this assembly if you're developing automation in .NET to manage Azure Search indexes, synonym maps, indexers, data sources, or other service-level resources. If you only need to query or update documents in your indexes, use the Microsoft.Azure.Search.Data assembly instead. If you need all the functionality of Azure Search, use the Microsoft.Azure.Search assembly instead.")] - -[assembly: AssemblyVersion("4.0.0.0")] -[assembly: AssemblyFileVersion("4.0.2.0")] - -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] -[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj index c741c20bb98e..693e9f5814db 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj @@ -1,18 +1,17 @@  + Microsoft.Azure.Search Makes it easy to develop a .NET application that uses Azure Search. Microsoft Azure Search Library Microsoft.Azure.Search - 4.0.2-preview - Microsoft Azure Search;Search This is a preview of the newest major version of the Azure Search .NET SDK, based on version 2016-09-01-Preview of the Azure Search REST API. New in this version is support for synonyms and indexer support for JSON Blobs. See this article for help on migrating to the latest version: http://aka.ms/search-sdk-upgrade. + + + - - net452;netstandard1.4 - diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs index 6cf30e92e12e..36ba39b58c58 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs @@ -7,14 +7,3 @@ [assembly: AssemblyTitle("Microsoft Azure Search Library")] [assembly: AssemblyDescription("Makes it easy to develop a .NET application that uses Azure Search.")] - -[assembly: AssemblyVersion("4.0.0.0")] -[assembly: AssemblyFileVersion("4.0.2.0")] - -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] -[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] diff --git a/src/SDKs/Search/Search.sln b/src/SDKs/Search/Search.sln index fb1184058160..946216a5e32f 100644 --- a/src/SDKs/Search/Search.sln +++ b/src/SDKs/Search/Search.sln @@ -10,6 +10,10 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Search.Management.Tests", "Management\Search.Management.Tests\Search.Management.Tests.csproj", "{C22D7F0A-F4D4-4AE2-AAF1-16C5A61D2703}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataPlane", "DataPlane", "{6CF5428A-7C5A-4276-AC40-41EF40911C9C}" + ProjectSection(SolutionItems) = preProject + DataPlane\AssemblyInfo.Common.cs = DataPlane\AssemblyInfo.Common.cs + DataPlane\AzSearch.DataPlane.props = DataPlane\AzSearch.DataPlane.props + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search", "DataPlane\Microsoft.Azure.Search\Microsoft.Azure.Search.csproj", "{86D38C24-45C2-481A-B59F-CE77351F32B9}" EndProject From f7ee80a6716d2ec4bbd4f5bd5bc4e0538d449728 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Thu, 1 Mar 2018 20:13:44 -0800 Subject: [PATCH 4/6] [Azure Search] Replacing ConverterBase with JsonReader extension methods Reuse via inheritance is an anti-pattern, so we're getting rid of it. --- .../Serialization/ExtensibleEnumConverter.cs | 4 +- ...nverterBase.cs => JsonReaderExtensions.cs} | 42 +++++++++-------- .../Serialization/DateTimeConverter.cs | 4 +- .../Serialization/GeographyPointConverter.cs | 46 +++++++++---------- .../SearchContinuationTokenConverter.cs | 7 +-- .../Tests/Models/CustomBookConverter.cs | 13 ++---- 6 files changed, 56 insertions(+), 60 deletions(-) rename src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/{ConverterBase.cs => JsonReaderExtensions.cs} (76%) diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ExtensibleEnumConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ExtensibleEnumConverter.cs index 13fc68409a72..fa029183999f 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ExtensibleEnumConverter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ExtensibleEnumConverter.cs @@ -23,7 +23,7 @@ namespace Microsoft.Azure.Search.Serialization /// that they have well-known values, but they are extensible with new values and the values are based on strings /// instead of integers. /// - public class ExtensibleEnumConverter : ConverterBase where T : ExtensibleEnum + public class ExtensibleEnumConverter : JsonConverter where T : ExtensibleEnum { private ExtensibleEnumValueFactory _enumValueFactory; @@ -87,7 +87,7 @@ public override object ReadJson( return null; } - return _enumValueFactory(Expect(reader, JsonToken.String)); + return _enumValueFactory(reader.Expect(JsonToken.String)); } /// diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ConverterBase.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/JsonReaderExtensions.cs similarity index 76% rename from src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ConverterBase.cs rename to src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/JsonReaderExtensions.cs index 7654f4863b26..7517682207e1 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/ConverterBase.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Customizations/Search/Serialization/JsonReaderExtensions.cs @@ -9,9 +9,9 @@ namespace Microsoft.Azure.Search.Serialization using Newtonsoft.Json; /// - /// Base class for custom JsonConverters. + /// Defines extension methods for JsonReader that make it easier to implement a custom JsonConverter. /// - public abstract class ConverterBase : JsonConverter + public static class JsonReaderExtensions { /// /// Asserts that the given JSON reader is positioned on a token with the expected type. Optionally asserts @@ -22,16 +22,16 @@ public abstract class ConverterBase : JsonConverter /// The JSON reader. /// The JSON token on which the reader is expected to be positioned. /// Optional; The expected value of the current JSON token. - protected void ExpectAndAdvance(JsonReader reader, JsonToken expectedToken, object expectedValue = null) - { - ExpectAndAdvance(reader, expectedToken, expectedValue); - } + public static void ExpectAndAdvance( + this JsonReader reader, + JsonToken expectedToken, + object expectedValue = null) => ExpectAndAdvance(reader, expectedToken, expectedValue); /// - /// Asserts that the given JSON reader is positioned on a token with the expected type and retrieves the value - /// of the token, if any. Optionally asserts that the value of the token matches a given expected value. If - /// any of the assertions fail, this method throws a JsonSerializationException. Otherwise, this method - /// attempts to advance the JSON reader to the next position. + /// Asserts that the given JSON reader is positioned on a token with the expected type and retrieves the + /// value of the token, if any. Optionally asserts that the value of the token matches a given expected + /// value. If any of the assertions fail, this method throws a JsonSerializationException. Otherwise, this + /// method attempts to advance the JSON reader to the next position. /// /// The expected type of the value of the current JSON token. /// The JSON reader. @@ -40,7 +40,10 @@ protected void ExpectAndAdvance(JsonReader reader, JsonToken expectedToken, obje /// /// The value of the JSON token before advancing the reader, or default(TValue) if the token has no value. /// - protected TValue ExpectAndAdvance(JsonReader reader, JsonToken expectedToken, object expectedValue = null) + public static TValue ExpectAndAdvance( + this JsonReader reader, + JsonToken expectedToken, + object expectedValue = null) { TValue result = Expect(reader, expectedToken, expectedValue); Advance(reader); @@ -55,15 +58,13 @@ protected TValue ExpectAndAdvance(JsonReader reader, JsonToken expectedT /// The JSON reader. /// The JSON token on which the reader is expected to be positioned. /// Optional; The expected value of the current JSON token. - protected void Expect(JsonReader reader, JsonToken expectedToken, object expectedValue = null) - { + public static void Expect(this JsonReader reader, JsonToken expectedToken, object expectedValue = null) => Expect(reader, expectedToken, expectedValue); - } /// - /// Asserts that the given JSON reader is positioned on a token with the expected type and retrieves the value - /// of the token, if any. Optionally asserts that the value of the token matches a given expected value. If - /// any of the assertions fail, this method throws a JsonSerializationException. + /// Asserts that the given JSON reader is positioned on a token with the expected type and retrieves the + /// value of the token, if any. Optionally asserts that the value of the token matches a given expected + /// value. If any of the assertions fail, this method throws a JsonSerializationException. /// /// The expected type of the value of the current JSON token. /// The JSON reader. @@ -72,7 +73,10 @@ protected void Expect(JsonReader reader, JsonToken expectedToken, object expecte /// /// The value of the current JSON token, or default(TValue) if the current token has no value. /// - protected TValue Expect(JsonReader reader, JsonToken expectedToken, object expectedValue = null) + public static TValue Expect( + this JsonReader reader, + JsonToken expectedToken, + object expectedValue = null) { if (reader.TokenType != expectedToken) { @@ -116,7 +120,7 @@ protected TValue Expect(JsonReader reader, JsonToken expectedToken, obje /// Advances the given JSON reader, or throws a JsonSerializationException if it cannot be advanced. /// /// The JSON reader to advance. - protected void Advance(JsonReader reader) + public static void Advance(this JsonReader reader) { if (!reader.Read()) { diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DateTimeConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DateTimeConverter.cs index 42158fe46802..45004f50e422 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DateTimeConverter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/DateTimeConverter.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Search.Serialization /// /// Converts System.DateTime objects to System.DateTimeOffset before serialization. /// - internal class DateTimeConverter : ConverterBase + internal class DateTimeConverter : JsonConverter { public override bool CanConvert(Type objectType) { @@ -33,7 +33,7 @@ public override object ReadJson( return null; } - DateTimeOffset? dateTimeOffset = Expect(reader, JsonToken.Date); + DateTimeOffset? dateTimeOffset = reader.Expect(JsonToken.Date); return dateTimeOffset.HasValue ? dateTimeOffset.Value.UtcDateTime : (DateTime?)null; } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/GeographyPointConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/GeographyPointConverter.cs index 0f89e3eb63b4..438949820765 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/GeographyPointConverter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/GeographyPointConverter.cs @@ -12,12 +12,10 @@ namespace Microsoft.Azure.Search.Serialization /// /// Serializes Microsoft.Spatial.GeographyPoint objects to Geo-JSON and vice-versa. /// - internal class GeographyPointConverter : ConverterBase + internal class GeographyPointConverter : JsonConverter { - public override bool CanConvert(Type objectType) - { - return typeof(GeographyPoint).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); - } + public override bool CanConvert(Type objectType) => + typeof(GeographyPoint).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); public override object ReadJson( JsonReader reader, @@ -31,30 +29,30 @@ public override object ReadJson( return null; } - ExpectAndAdvance(reader, JsonToken.StartObject); - ExpectAndAdvance(reader, JsonToken.PropertyName, "type"); - ExpectAndAdvance(reader, JsonToken.String, "Point"); - ExpectAndAdvance(reader, JsonToken.PropertyName, "coordinates"); - ExpectAndAdvance(reader, JsonToken.StartArray); - double longitude = ExpectAndAdvance(reader, JsonToken.Float); - double latitude = ExpectAndAdvance(reader, JsonToken.Float); - ExpectAndAdvance(reader, JsonToken.EndArray); + reader.ExpectAndAdvance(JsonToken.StartObject); + reader.ExpectAndAdvance(JsonToken.PropertyName, "type"); + reader.ExpectAndAdvance(JsonToken.String, "Point"); + reader.ExpectAndAdvance(JsonToken.PropertyName, "coordinates"); + reader.ExpectAndAdvance(JsonToken.StartArray); + double longitude = reader.ExpectAndAdvance(JsonToken.Float); + double latitude = reader.ExpectAndAdvance(JsonToken.Float); + reader.ExpectAndAdvance(JsonToken.EndArray); if (reader.TokenType == JsonToken.PropertyName && reader.Value.Equals("crs")) { - Advance(reader); - ExpectAndAdvance(reader, JsonToken.StartObject); - ExpectAndAdvance(reader, JsonToken.PropertyName, "type"); - ExpectAndAdvance(reader, JsonToken.String, "name"); - ExpectAndAdvance(reader, JsonToken.PropertyName, "properties"); - ExpectAndAdvance(reader, JsonToken.StartObject); - ExpectAndAdvance(reader, JsonToken.PropertyName, "name"); - ExpectAndAdvance(reader, JsonToken.String, "EPSG:4326"); - ExpectAndAdvance(reader, JsonToken.EndObject); - ExpectAndAdvance(reader, JsonToken.EndObject); + reader.Advance(); + reader.ExpectAndAdvance(JsonToken.StartObject); + reader.ExpectAndAdvance(JsonToken.PropertyName, "type"); + reader.ExpectAndAdvance(JsonToken.String, "name"); + reader.ExpectAndAdvance(JsonToken.PropertyName, "properties"); + reader.ExpectAndAdvance(JsonToken.StartObject); + reader.ExpectAndAdvance(JsonToken.PropertyName, "name"); + reader.ExpectAndAdvance(JsonToken.String, "EPSG:4326"); + reader.ExpectAndAdvance(JsonToken.EndObject); + reader.ExpectAndAdvance(JsonToken.EndObject); } - Expect(reader, JsonToken.EndObject); + reader.Expect(JsonToken.EndObject); return GeographyPoint.Create(latitude, longitude); } diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SearchContinuationTokenConverter.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SearchContinuationTokenConverter.cs index ce26b6c4ea66..56d52d3ccf8d 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SearchContinuationTokenConverter.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/SearchContinuationTokenConverter.cs @@ -8,12 +8,9 @@ namespace Microsoft.Azure.Search.Serialization using Models; using Newtonsoft.Json; - internal class SearchContinuationTokenConverter : ConverterBase + internal class SearchContinuationTokenConverter : JsonConverter { - public override bool CanConvert(Type objectType) - { - return objectType == typeof(SearchContinuationToken); - } + public override bool CanConvert(Type objectType) => objectType == typeof(SearchContinuationToken); public override object ReadJson( JsonReader reader, diff --git a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/CustomBookConverter.cs b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/CustomBookConverter.cs index b0cf0de5566e..735226218a29 100644 --- a/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/CustomBookConverter.cs +++ b/src/SDKs/Search/DataPlane/Search.Tests/Tests/Models/CustomBookConverter.cs @@ -8,7 +8,7 @@ namespace Microsoft.Azure.Search.Tests using Newtonsoft.Json; using Serialization; - internal class CustomBookConverter : ConverterBase where T : CustomBook, new() + internal class CustomBookConverter : JsonConverter where T : CustomBook, new() { public void Install(ISearchIndexClient client) { @@ -16,10 +16,7 @@ public void Install(ISearchIndexClient client) client.DeserializationSettings.Converters.Add(this); } - public override bool CanConvert(Type objectType) - { - return objectType == typeof(T); - } + public override bool CanConvert(Type objectType) => objectType == typeof(T); public override object ReadJson( JsonReader reader, @@ -35,11 +32,11 @@ public override object ReadJson( var book = new T(); - ExpectAndAdvance(reader, JsonToken.StartObject); + reader.ExpectAndAdvance(JsonToken.StartObject); while (reader.TokenType != JsonToken.EndObject) { - string propertyName = ExpectAndAdvance(reader, JsonToken.PropertyName); + string propertyName = reader.ExpectAndAdvance(JsonToken.PropertyName); switch (propertyName) { case "ISBN": @@ -63,7 +60,7 @@ public override object ReadJson( break; } - Advance(reader); + reader.Advance(); } return book; From 7e51a546173ce450677d47b61745356275b81dcd Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Thu, 1 Mar 2018 21:05:41 -0800 Subject: [PATCH 5/6] [Azure Search] Fixing issue with copying JsonSerializerSettings Since the Azure .NET SDKs have to support a wide range of JSON.NET versions, it isn't safe to reference properties of JsonSerializerSettings by name since these properties come and go between versions. Instead, we use reflection to dynamically generate code to copy a JsonSerializerSettings instance. --- .../Serialization/JsonUtility.cs | 137 ++++++++++++------ 1 file changed, 90 insertions(+), 47 deletions(-) diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/JsonUtility.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/JsonUtility.cs index c35f8d5ee8e8..e03f65054cee 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/JsonUtility.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Customizations/Serialization/JsonUtility.cs @@ -4,12 +4,17 @@ namespace Microsoft.Azure.Search.Serialization { + using System; using System.Collections.Generic; + using System.Linq; + using System.Linq.Expressions; + using System.Reflection; using Microsoft.Azure.Search.Models; - using Microsoft.Azure.Search.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using Rest.Serialization; + using static System.Linq.Expressions.Expression; + using Throw = Common.Throw; internal static class JsonUtility { @@ -19,26 +24,18 @@ internal static class JsonUtility public static JsonSerializerSettings CreateTypedSerializerSettings( JsonSerializerSettings baseSettings, - bool useCamelCase) where T : class - { - return CreateSerializerSettings(baseSettings, useCamelCase); - } + bool useCamelCase) where T : class => + CreateSerializerSettings(baseSettings, useCamelCase); public static JsonSerializerSettings CreateTypedDeserializerSettings(JsonSerializerSettings baseSettings) - where T : class - { - return CreateDeserializerSettings, SuggestResult, T>(baseSettings); - } + where T : class => + CreateDeserializerSettings, SuggestResult, T>(baseSettings); - public static JsonSerializerSettings CreateDocumentSerializerSettings(JsonSerializerSettings baseSettings) - { - return CreateSerializerSettings(baseSettings, useCamelCase: false); - } + public static JsonSerializerSettings CreateDocumentSerializerSettings(JsonSerializerSettings baseSettings) => + CreateSerializerSettings(baseSettings, useCamelCase: false); - public static JsonSerializerSettings CreateDocumentDeserializerSettings(JsonSerializerSettings baseSettings) - { - return CreateDeserializerSettings(baseSettings); - } + public static JsonSerializerSettings CreateDocumentDeserializerSettings(JsonSerializerSettings baseSettings) => + CreateDeserializerSettings(baseSettings); private static JsonSerializerSettings CreateSerializerSettings( JsonSerializerSettings baseSettings, @@ -89,38 +86,84 @@ private static JsonSerializerSettings CreateDeserializerSettings + JsonSerializerSettingsCopier.Instance.Copy(baseSettings); + + // Unfortunately we can't just assign the properties of JsonSerializerSettings between instances, + // because some of these properties come and go within the span of a few JSON.NET versions, and the + // Azure .NET SDKs can reference a very wide range of possible versions. Instead, we use reflection + // and dynamic compilation to create a copy method tailored to whatever version of JSON.NET we find + // ourselves using. + private class JsonSerializerSettingsCopier { - return new JsonSerializerSettings() + private readonly Delegate _copy; + + private JsonSerializerSettingsCopier() + { + Type sourceType, targetType; + sourceType = targetType = typeof(JsonSerializerSettings); + + ParameterExpression source = Parameter(sourceType); + Expression copyExpr = MakeCopyExpr(source); + + // Emits 'source => {copyExpr}' where copyExpr refers to source and returns a copy of it. + LambdaExpression lambdaExpression = + Lambda( + delegateType: GetFuncType(sourceType, targetType), + body: copyExpr, + parameters: source); + + _copy = lambdaExpression.Compile(); + } + + public static JsonSerializerSettingsCopier Instance { get; } = new JsonSerializerSettingsCopier(); + + public JsonSerializerSettings Copy(JsonSerializerSettings source) + { + Throw.IfArgumentNull(source, nameof(source)); + + // Shallow copy all the properties first, then deep copy Converters. + var newSettings = (JsonSerializerSettings)_copy.DynamicInvoke(source); + newSettings.Converters = new List(source.Converters); + return newSettings; + } + + private static Expression MakeCopyExpr(ParameterExpression sourceExpr) + { + ParameterExpression source = Variable(typeof(JsonSerializerSettings)); + ParameterExpression target = Variable(typeof(JsonSerializerSettings)); + + Expression assignSource = Assign(left: source, right: sourceExpr); + Expression assignTarget = Assign(left: target, right: New(typeof(JsonSerializerSettings))); + + IEnumerable copy = CopyAllProperties(source, target); + + return Block( + type: typeof(JsonSerializerSettings), + variables: new[] { source, target }, + expressions: new[] { assignSource, assignTarget }.Concat(copy)); + } + + private static IEnumerable CopyAllProperties( + ParameterExpression source, + ParameterExpression target) { - Binder = baseSettings.Binder, - CheckAdditionalContent = baseSettings.CheckAdditionalContent, - ConstructorHandling = baseSettings.ConstructorHandling, - Context = baseSettings.Context, - ContractResolver = baseSettings.ContractResolver, - Converters = new List(baseSettings.Converters), - Culture = baseSettings.Culture, - DateFormatHandling = baseSettings.DateFormatHandling, - DateFormatString = baseSettings.DateFormatString, - DateParseHandling = baseSettings.DateParseHandling, - DateTimeZoneHandling = baseSettings.DateTimeZoneHandling, - DefaultValueHandling = baseSettings.DefaultValueHandling, - Error = baseSettings.Error, - FloatFormatHandling = baseSettings.FloatFormatHandling, - FloatParseHandling = baseSettings.FloatParseHandling, - Formatting = baseSettings.Formatting, - MaxDepth = baseSettings.MaxDepth, - MetadataPropertyHandling = baseSettings.MetadataPropertyHandling, - MissingMemberHandling = baseSettings.MissingMemberHandling, - NullValueHandling = baseSettings.NullValueHandling, - ObjectCreationHandling = baseSettings.ObjectCreationHandling, - PreserveReferencesHandling = baseSettings.PreserveReferencesHandling, - ReferenceLoopHandling = baseSettings.ReferenceLoopHandling, - StringEscapeHandling = baseSettings.StringEscapeHandling, - TraceWriter = baseSettings.TraceWriter, - TypeNameHandling = baseSettings.TypeNameHandling, - TypeNameAssemblyFormat = baseSettings.TypeNameAssemblyFormat - }; + var settableNonDeprecatedProperties = + typeof(JsonSerializerSettings).GetTypeInfo().DeclaredProperties + .Where(p => p.CanRead && p.CanWrite && !IsPropertyDeprecated(p)); + + foreach (PropertyInfo property in settableNonDeprecatedProperties) + { + yield return Assign( + left: PropertyOrField(target, property.Name), + right: PropertyOrField(source, property.Name)); + } + + yield return target; + } + + private static bool IsPropertyDeprecated(PropertyInfo property) => + property.GetCustomAttributes().Any(a => a is ObsoleteAttribute); } } } From 623e1f0ccbd05ce41770a856ff0acf4b1147974c Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Mon, 5 Mar 2018 17:30:10 -0800 Subject: [PATCH 6/6] [Azure Search] Versioning each data plane package separately After some discussion, we decided it was better for the purposes of decoupled development and release that we version each of the data plane packages separately. --- src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs | 3 --- src/SDKs/Search/DataPlane/AzSearch.DataPlane.props | 1 - .../Microsoft.Azure.Search.Common.csproj | 1 + .../Properties/AssemblyInfo.cs | 3 +++ .../Microsoft.Azure.Search.Data.csproj | 2 ++ .../Properties/AssemblyInfo.cs | 3 +++ .../Microsoft.Azure.Search.Service.csproj | 2 ++ .../Properties/AssemblyInfo.cs | 3 +++ .../Microsoft.Azure.Search.csproj | 5 +++++ .../Microsoft.Azure.Search/Properties/AssemblyInfo.cs | 3 +++ src/SDKs/Search/Search.sln | 10 ++++++++++ 11 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs b/src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs index 73b40154d305..2c71a8880eb1 100644 --- a/src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs +++ b/src/SDKs/Search/DataPlane/AssemblyInfo.Common.cs @@ -5,9 +5,6 @@ using System.Reflection; using System.Resources; -[assembly: AssemblyVersion("5.0.0.0")] -[assembly: AssemblyFileVersion("5.0.0.0")] - [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/src/SDKs/Search/DataPlane/AzSearch.DataPlane.props b/src/SDKs/Search/DataPlane/AzSearch.DataPlane.props index d16fe893cf7e..aa1c39b01fd7 100644 --- a/src/SDKs/Search/DataPlane/AzSearch.DataPlane.props +++ b/src/SDKs/Search/DataPlane/AzSearch.DataPlane.props @@ -1,7 +1,6 @@ Microsoft Azure Search;Search - 5.0.0-preview diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj index c7d1abb224b6..fe630669758a 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Microsoft.Azure.Search.Common.csproj @@ -6,6 +6,7 @@ Common types needed by the Azure Search .NET libraries. This is not the package you are looking for; It is only meant to be used as a dependency. Microsoft Azure Search Common Library Microsoft.Azure.Search.Common + 5.0.0-preview See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs index d4d49aa4da6c..7763bfff2df3 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Common/Properties/AssemblyInfo.cs @@ -5,5 +5,8 @@ using System.Reflection; using System.Resources; +[assembly: AssemblyVersion("5.0.0.0")] +[assembly: AssemblyFileVersion("5.0.0.0")] + [assembly: AssemblyTitle("Microsoft Azure Search Common Library")] [assembly: AssemblyDescription("Common types needed by the Azure Search .NET libraries. This is not the assembly you are looking for; It is only meant to be used as a dependency.")] diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj index 3f96f4219c20..481d438be833 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Microsoft.Azure.Search.Data.csproj @@ -6,6 +6,7 @@ Use this package if you're developing a .NET application using Azure Search, and you only need to query or update documents in your indexes. If you also need to create or update indexes, synonym maps, or other service-level resources, use the Microsoft.Azure.Search package instead. Microsoft Azure Search Data Library Microsoft.Azure.Search.Data + 5.0.0-preview See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. @@ -14,6 +15,7 @@ + diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs index 0a137d84bd04..0bc8ee30dd73 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/Properties/AssemblyInfo.cs @@ -6,6 +6,9 @@ using System.Resources; using System.Runtime.CompilerServices; +[assembly: AssemblyVersion("5.0.0.0")] +[assembly: AssemblyFileVersion("5.0.0.0")] + [assembly: AssemblyTitle("Microsoft Azure Search Data Library")] [assembly: AssemblyDescription("Use this assembly if you're developing a .NET application using Azure Search, and you only need to query or update documents in your indexes. If you also need to create or update indexes, synonym maps, or other service-level resources, use the Microsoft.Azure.Search assembly instead.")] diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj index ebd6abdc2e9d..73188f18d2b8 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Microsoft.Azure.Search.Service.csproj @@ -6,6 +6,7 @@ Use this package if you're developing automation in .NET to manage Azure Search indexes, synonym maps, indexers, data sources, or other service-level resources. If you only need to query or update documents in your indexes, use the Microsoft.Azure.Search.Data package instead. If you need all the functionality of Azure Search, use the Microsoft.Azure.Search package instead. Microsoft Azure Search Service Library Microsoft.Azure.Search.Service + 5.0.0-preview See the Microsoft.Azure.Search package for detailed release notes on the entire Azure Search .NET SDK. @@ -14,6 +15,7 @@ + diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs index 4c7ff12445ab..5a2abb05f617 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/Properties/AssemblyInfo.cs @@ -5,5 +5,8 @@ using System.Reflection; using System.Resources; +[assembly: AssemblyVersion("5.0.0.0")] +[assembly: AssemblyFileVersion("5.0.0.0")] + [assembly: AssemblyTitle("Microsoft Azure Search Service Library")] [assembly: AssemblyDescription("Use this assembly if you're developing automation in .NET to manage Azure Search indexes, synonym maps, indexers, data sources, or other service-level resources. If you only need to query or update documents in your indexes, use the Microsoft.Azure.Search.Data assembly instead. If you need all the functionality of Azure Search, use the Microsoft.Azure.Search assembly instead.")] diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj index 693e9f5814db..6bab4494ecf3 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Microsoft.Azure.Search.csproj @@ -6,12 +6,17 @@ Makes it easy to develop a .NET application that uses Azure Search. Microsoft Azure Search Library Microsoft.Azure.Search + 5.0.0-preview This is a preview of the newest major version of the Azure Search .NET SDK, based on version 2016-09-01-Preview of the Azure Search REST API. New in this version is support for synonyms and indexer support for JSON Blobs. See this article for help on migrating to the latest version: http://aka.ms/search-sdk-upgrade. + + + + diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs index 36ba39b58c58..2e65781c7787 100644 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search/Properties/AssemblyInfo.cs @@ -5,5 +5,8 @@ using System.Reflection; using System.Resources; +[assembly: AssemblyVersion("5.0.0.0")] +[assembly: AssemblyFileVersion("5.0.0.0")] + [assembly: AssemblyTitle("Microsoft Azure Search Library")] [assembly: AssemblyDescription("Makes it easy to develop a .NET application that uses Azure Search.")] diff --git a/src/SDKs/Search/Search.sln b/src/SDKs/Search/Search.sln index 946216a5e32f..1283484357b7 100644 --- a/src/SDKs/Search/Search.sln +++ b/src/SDKs/Search/Search.sln @@ -16,14 +16,24 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataPlane", "DataPlane", "{ EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search", "DataPlane\Microsoft.Azure.Search\Microsoft.Azure.Search.csproj", "{86D38C24-45C2-481A-B59F-CE77351F32B9}" + ProjectSection(ProjectDependencies) = postProject + {3E076803-9B46-40D0-8620-CA66699C55B5} = {3E076803-9B46-40D0-8620-CA66699C55B5} + {CA6417A8-23A2-429D-B6D2-F636F0ABA488} = {CA6417A8-23A2-429D-B6D2-F636F0ABA488} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Search.Tests", "DataPlane\Search.Tests\Search.Tests.csproj", "{4B39B63E-16C8-415B-8201-F4330AB20380}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search.Data", "DataPlane\Microsoft.Azure.Search.Data\Microsoft.Azure.Search.Data.csproj", "{3E076803-9B46-40D0-8620-CA66699C55B5}" + ProjectSection(ProjectDependencies) = postProject + {59C74888-5692-4ED7-9A61-C58823B22DF1} = {59C74888-5692-4ED7-9A61-C58823B22DF1} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search.Common", "DataPlane\Microsoft.Azure.Search.Common\Microsoft.Azure.Search.Common.csproj", "{59C74888-5692-4ED7-9A61-C58823B22DF1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Search.Service", "DataPlane\Microsoft.Azure.Search.Service\Microsoft.Azure.Search.Service.csproj", "{CA6417A8-23A2-429D-B6D2-F636F0ABA488}" + ProjectSection(ProjectDependencies) = postProject + {59C74888-5692-4ED7-9A61-C58823B22DF1} = {59C74888-5692-4ED7-9A61-C58823B22DF1} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution