| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.Search |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Microsoft.Rest.Azure; |
| | 15 | | using Microsoft.Rest.Serialization; |
| | 16 | | using Models; |
| | 17 | | using Newtonsoft.Json; |
| | 18 | | using System.Collections; |
| | 19 | | using System.Collections.Generic; |
| | 20 | | using System.Linq; |
| | 21 | | using System.Net; |
| | 22 | | using System.Net.Http; |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// Client that can be used to query an index and upload, merge, or delete |
| | 26 | | /// documents. |
| | 27 | | /// </summary> |
| | 28 | | public partial class SearchIndexClient : ServiceClient<SearchIndexClient>, ISearchIndexClient, IAzureClient |
| | 29 | | { |
| | 30 | | /// <summary> |
| | 31 | | /// The base URI of the service. |
| | 32 | | /// </summary> |
| 1542 | 33 | | internal string BaseUri {get; set;} |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Gets or sets json serialization settings. |
| | 37 | | /// </summary> |
| 1616 | 38 | | public JsonSerializerSettings SerializationSettings { get; private set; } |
| | 39 | |
|
| | 40 | | /// <summary> |
| | 41 | | /// Gets or sets json deserialization settings. |
| | 42 | | /// </summary> |
| 2296 | 43 | | public JsonSerializerSettings DeserializationSettings { get; private set; } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// Credentials needed for the client to connect to Azure. |
| | 47 | | /// </summary> |
| 3746 | 48 | | public ServiceClientCredentials Credentials { get; private set; } |
| | 49 | |
|
| | 50 | | /// <summary> |
| | 51 | | /// Client Api Version. |
| | 52 | | /// </summary> |
| 3282 | 53 | | public string ApiVersion { get; private set; } |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// The name of the search service. |
| | 57 | | /// </summary> |
| 2372 | 58 | | public string SearchServiceName { get; set; } |
| | 59 | |
|
| | 60 | | /// <summary> |
| | 61 | | /// The DNS suffix of the search service. The default is search.windows.net. |
| | 62 | | /// </summary> |
| 3058 | 63 | | public string SearchDnsSuffix { get; set; } |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// The name of the index. |
| | 67 | | /// </summary> |
| 2378 | 68 | | public string IndexName { get; set; } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// The preferred language for the response. |
| | 72 | | /// </summary> |
| 2460 | 73 | | public string AcceptLanguage { get; set; } |
| | 74 | |
|
| | 75 | | /// <summary> |
| | 76 | | /// The retry timeout in seconds for Long Running Operations. Default value is |
| | 77 | | /// 30. |
| | 78 | | /// </summary> |
| 0 | 79 | | public int? LongRunningOperationRetryTimeout { get; set; } |
| | 80 | |
|
| | 81 | | /// <summary> |
| | 82 | | /// Whether a unique x-ms-client-request-id should be generated. When set to |
| | 83 | | /// true a unique x-ms-client-request-id value is generated and included in |
| | 84 | | /// each request. Default is true. |
| | 85 | | /// </summary> |
| 2460 | 86 | | public bool? GenerateClientRequestId { get; set; } |
| | 87 | |
|
| | 88 | | /// <summary> |
| | 89 | | /// Gets the IDocumentsProxyOperations. |
| | 90 | | /// </summary> |
| 1574 | 91 | | internal IDocumentsProxyOperations DocumentsProxy { get; private set; } |
| | 92 | |
|
| | 93 | | /// <summary> |
| | 94 | | /// Initializes a new instance of the SearchIndexClient class. |
| | 95 | | /// </summary> |
| | 96 | | /// <param name='httpClient'> |
| | 97 | | /// HttpClient to be used |
| | 98 | | /// </param> |
| | 99 | | /// <param name='disposeHttpClient'> |
| | 100 | | /// True: will dispose the provided httpClient on calling SearchIndexClient.Dispose(). False: will not dispose p |
| 0 | 101 | | protected SearchIndexClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) |
| | 102 | | { |
| 0 | 103 | | Initialize(); |
| 0 | 104 | | } |
| | 105 | |
|
| | 106 | | /// <summary> |
| | 107 | | /// Initializes a new instance of the SearchIndexClient class. |
| | 108 | | /// </summary> |
| | 109 | | /// <param name='handlers'> |
| | 110 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 111 | | /// </param> |
| 666 | 112 | | protected SearchIndexClient(params DelegatingHandler[] handlers) : base(handlers) |
| | 113 | | { |
| 666 | 114 | | Initialize(); |
| 666 | 115 | | } |
| | 116 | |
|
| | 117 | | /// <summary> |
| | 118 | | /// Initializes a new instance of the SearchIndexClient class. |
| | 119 | | /// </summary> |
| | 120 | | /// <param name='rootHandler'> |
| | 121 | | /// Optional. The http client handler used to handle http transport. |
| | 122 | | /// </param> |
| | 123 | | /// <param name='handlers'> |
| | 124 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 125 | | /// </param> |
| 22 | 126 | | protected SearchIndexClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandl |
| | 127 | | { |
| 22 | 128 | | Initialize(); |
| 22 | 129 | | } |
| | 130 | |
|
| | 131 | | /// <summary> |
| | 132 | | /// Initializes a new instance of the SearchIndexClient class. |
| | 133 | | /// </summary> |
| | 134 | | /// <param name='credentials'> |
| | 135 | | /// Required. Credentials needed for the client to connect to Azure. |
| | 136 | | /// </param> |
| | 137 | | /// <param name='handlers'> |
| | 138 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 139 | | /// </param> |
| | 140 | | /// <exception cref="System.ArgumentNullException"> |
| | 141 | | /// Thrown when a required parameter is null |
| | 142 | | /// </exception> |
| 652 | 143 | | public SearchIndexClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handl |
| | 144 | | { |
| 652 | 145 | | if (credentials == null) |
| | 146 | | { |
| 2 | 147 | | throw new System.ArgumentNullException("credentials"); |
| | 148 | | } |
| 650 | 149 | | Credentials = credentials; |
| 650 | 150 | | if (Credentials != null) |
| | 151 | | { |
| 650 | 152 | | Credentials.InitializeServiceClient(this); |
| | 153 | | } |
| 650 | 154 | | } |
| | 155 | |
|
| | 156 | | /// <summary> |
| | 157 | | /// Initializes a new instance of the SearchIndexClient class. |
| | 158 | | /// </summary> |
| | 159 | | /// <param name='credentials'> |
| | 160 | | /// Required. Credentials needed for the client to connect to Azure. |
| | 161 | | /// </param> |
| | 162 | | /// <param name='httpClient'> |
| | 163 | | /// HttpClient to be used |
| | 164 | | /// </param> |
| | 165 | | /// <param name='disposeHttpClient'> |
| | 166 | | /// True: will dispose the provided httpClient on calling SearchIndexClient.Dispose(). False: will not dispose p |
| | 167 | | /// <exception cref="System.ArgumentNullException"> |
| | 168 | | /// Thrown when a required parameter is null |
| | 169 | | /// </exception> |
| 0 | 170 | | public SearchIndexClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : |
| | 171 | | { |
| 0 | 172 | | if (credentials == null) |
| | 173 | | { |
| 0 | 174 | | throw new System.ArgumentNullException("credentials"); |
| | 175 | | } |
| 0 | 176 | | Credentials = credentials; |
| 0 | 177 | | if (Credentials != null) |
| | 178 | | { |
| 0 | 179 | | Credentials.InitializeServiceClient(this); |
| | 180 | | } |
| 0 | 181 | | } |
| | 182 | |
|
| | 183 | | /// <summary> |
| | 184 | | /// Initializes a new instance of the SearchIndexClient class. |
| | 185 | | /// </summary> |
| | 186 | | /// <param name='credentials'> |
| | 187 | | /// Required. Credentials needed for the client to connect to Azure. |
| | 188 | | /// </param> |
| | 189 | | /// <param name='rootHandler'> |
| | 190 | | /// Optional. The http client handler used to handle http transport. |
| | 191 | | /// </param> |
| | 192 | | /// <param name='handlers'> |
| | 193 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 194 | | /// </param> |
| | 195 | | /// <exception cref="System.ArgumentNullException"> |
| | 196 | | /// Thrown when a required parameter is null |
| | 197 | | /// </exception> |
| 2 | 198 | | public SearchIndexClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingH |
| | 199 | | { |
| 2 | 200 | | if (credentials == null) |
| | 201 | | { |
| 2 | 202 | | throw new System.ArgumentNullException("credentials"); |
| | 203 | | } |
| 0 | 204 | | Credentials = credentials; |
| 0 | 205 | | if (Credentials != null) |
| | 206 | | { |
| 0 | 207 | | Credentials.InitializeServiceClient(this); |
| | 208 | | } |
| 0 | 209 | | } |
| | 210 | |
|
| | 211 | | /// <summary> |
| | 212 | | /// An optional partial-method to perform custom initialization. |
| | 213 | | /// </summary> |
| | 214 | | partial void CustomInitialize(); |
| | 215 | | /// <summary> |
| | 216 | | /// Initializes client properties. |
| | 217 | | /// </summary> |
| | 218 | | private void Initialize() |
| | 219 | | { |
| 688 | 220 | | DocumentsProxy = new DocumentsProxyOperations(this); |
| 688 | 221 | | BaseUri = "https://{searchServiceName}.{searchDnsSuffix}/indexes('{indexName}')"; |
| 688 | 222 | | ApiVersion = "2019-05-06"; |
| 688 | 223 | | SearchDnsSuffix = "search.windows.net"; |
| 688 | 224 | | AcceptLanguage = "en-US"; |
| 688 | 225 | | LongRunningOperationRetryTimeout = 30; |
| 688 | 226 | | GenerateClientRequestId = true; |
| 688 | 227 | | SerializationSettings = new JsonSerializerSettings |
| 688 | 228 | | { |
| 688 | 229 | | Formatting = Newtonsoft.Json.Formatting.Indented, |
| 688 | 230 | | DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, |
| 688 | 231 | | DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, |
| 688 | 232 | | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, |
| 688 | 233 | | ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, |
| 688 | 234 | | ContractResolver = new ReadOnlyJsonContractResolver(), |
| 688 | 235 | | Converters = new List<JsonConverter> |
| 688 | 236 | | { |
| 688 | 237 | | new Iso8601TimeSpanConverter() |
| 688 | 238 | | } |
| 688 | 239 | | }; |
| 688 | 240 | | DeserializationSettings = new JsonSerializerSettings |
| 688 | 241 | | { |
| 688 | 242 | | DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, |
| 688 | 243 | | DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, |
| 688 | 244 | | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, |
| 688 | 245 | | ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, |
| 688 | 246 | | ContractResolver = new ReadOnlyJsonContractResolver(), |
| 688 | 247 | | Converters = new List<JsonConverter> |
| 688 | 248 | | { |
| 688 | 249 | | new Iso8601TimeSpanConverter() |
| 688 | 250 | | } |
| 688 | 251 | | }; |
| 688 | 252 | | CustomInitialize(); |
| 688 | 253 | | DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); |
| 688 | 254 | | } |
| | 255 | | } |
| | 256 | | } |