| | 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 Models; |
| | 16 | | using System.Threading; |
| | 17 | | using System.Threading.Tasks; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Extension methods for IndexersOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class IndexersOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Resets the change tracking state associated with an indexer. |
| | 26 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Reset-Indexer" /> |
| | 27 | | /// </summary> |
| | 28 | | /// <param name='operations'> |
| | 29 | | /// The operations group for this extension method. |
| | 30 | | /// </param> |
| | 31 | | /// <param name='indexerName'> |
| | 32 | | /// The name of the indexer to reset. |
| | 33 | | /// </param> |
| | 34 | | /// <param name='searchRequestOptions'> |
| | 35 | | /// Additional parameters for the operation |
| | 36 | | /// </param> |
| | 37 | | public static void Reset(this IIndexersOperations operations, string indexerName, SearchRequestOptions searc |
| | 38 | | { |
| 2 | 39 | | operations.ResetAsync(indexerName, searchRequestOptions).GetAwaiter().GetResult(); |
| 2 | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Resets the change tracking state associated with an indexer. |
| | 44 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Reset-Indexer" /> |
| | 45 | | /// </summary> |
| | 46 | | /// <param name='operations'> |
| | 47 | | /// The operations group for this extension method. |
| | 48 | | /// </param> |
| | 49 | | /// <param name='indexerName'> |
| | 50 | | /// The name of the indexer to reset. |
| | 51 | | /// </param> |
| | 52 | | /// <param name='searchRequestOptions'> |
| | 53 | | /// Additional parameters for the operation |
| | 54 | | /// </param> |
| | 55 | | /// <param name='cancellationToken'> |
| | 56 | | /// The cancellation token. |
| | 57 | | /// </param> |
| | 58 | | public static async Task ResetAsync(this IIndexersOperations operations, string indexerName, SearchRequestOp |
| | 59 | | { |
| 2 | 60 | | (await operations.ResetWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken) |
| 2 | 61 | | } |
| | 62 | |
|
| | 63 | | /// <summary> |
| | 64 | | /// Runs an indexer on-demand. |
| | 65 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Run-Indexer" /> |
| | 66 | | /// </summary> |
| | 67 | | /// <param name='operations'> |
| | 68 | | /// The operations group for this extension method. |
| | 69 | | /// </param> |
| | 70 | | /// <param name='indexerName'> |
| | 71 | | /// The name of the indexer to run. |
| | 72 | | /// </param> |
| | 73 | | /// <param name='searchRequestOptions'> |
| | 74 | | /// Additional parameters for the operation |
| | 75 | | /// </param> |
| | 76 | | public static void Run(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchR |
| | 77 | | { |
| 0 | 78 | | operations.RunAsync(indexerName, searchRequestOptions).GetAwaiter().GetResult(); |
| 0 | 79 | | } |
| | 80 | |
|
| | 81 | | /// <summary> |
| | 82 | | /// Runs an indexer on-demand. |
| | 83 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Run-Indexer" /> |
| | 84 | | /// </summary> |
| | 85 | | /// <param name='operations'> |
| | 86 | | /// The operations group for this extension method. |
| | 87 | | /// </param> |
| | 88 | | /// <param name='indexerName'> |
| | 89 | | /// The name of the indexer to run. |
| | 90 | | /// </param> |
| | 91 | | /// <param name='searchRequestOptions'> |
| | 92 | | /// Additional parameters for the operation |
| | 93 | | /// </param> |
| | 94 | | /// <param name='cancellationToken'> |
| | 95 | | /// The cancellation token. |
| | 96 | | /// </param> |
| | 97 | | public static async Task RunAsync(this IIndexersOperations operations, string indexerName, SearchRequestOpti |
| | 98 | | { |
| 0 | 99 | | (await operations.RunWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken).C |
| 0 | 100 | | } |
| | 101 | |
|
| | 102 | | /// <summary> |
| | 103 | | /// Creates a new indexer or updates an indexer if it already exists. |
| | 104 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Indexer" /> |
| | 105 | | /// </summary> |
| | 106 | | /// <param name='operations'> |
| | 107 | | /// The operations group for this extension method. |
| | 108 | | /// </param> |
| | 109 | | /// <param name='indexerName'> |
| | 110 | | /// The name of the indexer to create or update. |
| | 111 | | /// </param> |
| | 112 | | /// <param name='indexer'> |
| | 113 | | /// The definition of the indexer to create or update. |
| | 114 | | /// </param> |
| | 115 | | /// <param name='searchRequestOptions'> |
| | 116 | | /// Additional parameters for the operation |
| | 117 | | /// </param> |
| | 118 | | /// <param name='accessCondition'> |
| | 119 | | /// Additional parameters for the operation |
| | 120 | | /// </param> |
| | 121 | | public static Indexer CreateOrUpdate(this IIndexersOperations operations, string indexerName, Indexer indexe |
| | 122 | | { |
| 0 | 123 | | return operations.CreateOrUpdateAsync(indexerName, indexer, searchRequestOptions, accessCondition).GetAw |
| | 124 | | } |
| | 125 | |
|
| | 126 | | /// <summary> |
| | 127 | | /// Creates a new indexer or updates an indexer if it already exists. |
| | 128 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Indexer" /> |
| | 129 | | /// </summary> |
| | 130 | | /// <param name='operations'> |
| | 131 | | /// The operations group for this extension method. |
| | 132 | | /// </param> |
| | 133 | | /// <param name='indexerName'> |
| | 134 | | /// The name of the indexer to create or update. |
| | 135 | | /// </param> |
| | 136 | | /// <param name='indexer'> |
| | 137 | | /// The definition of the indexer to create or update. |
| | 138 | | /// </param> |
| | 139 | | /// <param name='searchRequestOptions'> |
| | 140 | | /// Additional parameters for the operation |
| | 141 | | /// </param> |
| | 142 | | /// <param name='accessCondition'> |
| | 143 | | /// Additional parameters for the operation |
| | 144 | | /// </param> |
| | 145 | | /// <param name='cancellationToken'> |
| | 146 | | /// The cancellation token. |
| | 147 | | /// </param> |
| | 148 | | public static async Task<Indexer> CreateOrUpdateAsync(this IIndexersOperations operations, string indexerNam |
| | 149 | | { |
| 0 | 150 | | using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(indexerName, indexer, searchRe |
| | 151 | | { |
| 0 | 152 | | return _result.Body; |
| | 153 | | } |
| 0 | 154 | | } |
| | 155 | |
|
| | 156 | | /// <summary> |
| | 157 | | /// Deletes an indexer. |
| | 158 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Delete-Indexer" /> |
| | 159 | | /// </summary> |
| | 160 | | /// <param name='operations'> |
| | 161 | | /// The operations group for this extension method. |
| | 162 | | /// </param> |
| | 163 | | /// <param name='indexerName'> |
| | 164 | | /// The name of the indexer to delete. |
| | 165 | | /// </param> |
| | 166 | | /// <param name='searchRequestOptions'> |
| | 167 | | /// Additional parameters for the operation |
| | 168 | | /// </param> |
| | 169 | | /// <param name='accessCondition'> |
| | 170 | | /// Additional parameters for the operation |
| | 171 | | /// </param> |
| | 172 | | public static void Delete(this IIndexersOperations operations, string indexerName, SearchRequestOptions sear |
| | 173 | | { |
| 8 | 174 | | operations.DeleteAsync(indexerName, searchRequestOptions, accessCondition).GetAwaiter().GetResult(); |
| 4 | 175 | | } |
| | 176 | |
|
| | 177 | | /// <summary> |
| | 178 | | /// Deletes an indexer. |
| | 179 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Delete-Indexer" /> |
| | 180 | | /// </summary> |
| | 181 | | /// <param name='operations'> |
| | 182 | | /// The operations group for this extension method. |
| | 183 | | /// </param> |
| | 184 | | /// <param name='indexerName'> |
| | 185 | | /// The name of the indexer to delete. |
| | 186 | | /// </param> |
| | 187 | | /// <param name='searchRequestOptions'> |
| | 188 | | /// Additional parameters for the operation |
| | 189 | | /// </param> |
| | 190 | | /// <param name='accessCondition'> |
| | 191 | | /// Additional parameters for the operation |
| | 192 | | /// </param> |
| | 193 | | /// <param name='cancellationToken'> |
| | 194 | | /// The cancellation token. |
| | 195 | | /// </param> |
| | 196 | | public static async Task DeleteAsync(this IIndexersOperations operations, string indexerName, SearchRequestO |
| | 197 | | { |
| 8 | 198 | | (await operations.DeleteWithHttpMessagesAsync(indexerName, searchRequestOptions, accessCondition, null, |
| 4 | 199 | | } |
| | 200 | |
|
| | 201 | | /// <summary> |
| | 202 | | /// Retrieves an indexer definition. |
| | 203 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Indexer" /> |
| | 204 | | /// </summary> |
| | 205 | | /// <param name='operations'> |
| | 206 | | /// The operations group for this extension method. |
| | 207 | | /// </param> |
| | 208 | | /// <param name='indexerName'> |
| | 209 | | /// The name of the indexer to retrieve. |
| | 210 | | /// </param> |
| | 211 | | /// <param name='searchRequestOptions'> |
| | 212 | | /// Additional parameters for the operation |
| | 213 | | /// </param> |
| | 214 | | public static Indexer Get(this IIndexersOperations operations, string indexerName, SearchRequestOptions sear |
| | 215 | | { |
| 4 | 216 | | return operations.GetAsync(indexerName, searchRequestOptions).GetAwaiter().GetResult(); |
| | 217 | | } |
| | 218 | |
|
| | 219 | | /// <summary> |
| | 220 | | /// Retrieves an indexer definition. |
| | 221 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Indexer" /> |
| | 222 | | /// </summary> |
| | 223 | | /// <param name='operations'> |
| | 224 | | /// The operations group for this extension method. |
| | 225 | | /// </param> |
| | 226 | | /// <param name='indexerName'> |
| | 227 | | /// The name of the indexer to retrieve. |
| | 228 | | /// </param> |
| | 229 | | /// <param name='searchRequestOptions'> |
| | 230 | | /// Additional parameters for the operation |
| | 231 | | /// </param> |
| | 232 | | /// <param name='cancellationToken'> |
| | 233 | | /// The cancellation token. |
| | 234 | | /// </param> |
| | 235 | | public static async Task<Indexer> GetAsync(this IIndexersOperations operations, string indexerName, SearchRe |
| | 236 | | { |
| 4 | 237 | | using (var _result = await operations.GetWithHttpMessagesAsync(indexerName, searchRequestOptions, null, |
| | 238 | | { |
| 2 | 239 | | return _result.Body; |
| | 240 | | } |
| 2 | 241 | | } |
| | 242 | |
|
| | 243 | | /// <summary> |
| | 244 | | /// Lists all indexers available for a search service. |
| | 245 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/List-Indexers" /> |
| | 246 | | /// </summary> |
| | 247 | | /// <param name='operations'> |
| | 248 | | /// The operations group for this extension method. |
| | 249 | | /// </param> |
| | 250 | | /// <param name='searchRequestOptions'> |
| | 251 | | /// Additional parameters for the operation |
| | 252 | | /// </param> |
| | 253 | | public static IndexerListResult List(this IIndexersOperations operations, SearchRequestOptions searchRequest |
| | 254 | | { |
| 2 | 255 | | return operations.ListAsync(searchRequestOptions).GetAwaiter().GetResult(); |
| | 256 | | } |
| | 257 | |
|
| | 258 | | /// <summary> |
| | 259 | | /// Lists all indexers available for a search service. |
| | 260 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/List-Indexers" /> |
| | 261 | | /// </summary> |
| | 262 | | /// <param name='operations'> |
| | 263 | | /// The operations group for this extension method. |
| | 264 | | /// </param> |
| | 265 | | /// <param name='searchRequestOptions'> |
| | 266 | | /// Additional parameters for the operation |
| | 267 | | /// </param> |
| | 268 | | /// <param name='cancellationToken'> |
| | 269 | | /// The cancellation token. |
| | 270 | | /// </param> |
| | 271 | | public static async Task<IndexerListResult> ListAsync(this IIndexersOperations operations, SearchRequestOpti |
| | 272 | | { |
| 2 | 273 | | using (var _result = await operations.ListWithHttpMessagesAsync(searchRequestOptions, null, cancellation |
| | 274 | | { |
| 2 | 275 | | return _result.Body; |
| | 276 | | } |
| 2 | 277 | | } |
| | 278 | |
|
| | 279 | | /// <summary> |
| | 280 | | /// Creates a new indexer. |
| | 281 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Indexer" /> |
| | 282 | | /// </summary> |
| | 283 | | /// <param name='operations'> |
| | 284 | | /// The operations group for this extension method. |
| | 285 | | /// </param> |
| | 286 | | /// <param name='indexer'> |
| | 287 | | /// The definition of the indexer to create. |
| | 288 | | /// </param> |
| | 289 | | /// <param name='searchRequestOptions'> |
| | 290 | | /// Additional parameters for the operation |
| | 291 | | /// </param> |
| | 292 | | public static Indexer Create(this IIndexersOperations operations, Indexer indexer, SearchRequestOptions sear |
| | 293 | | { |
| 22 | 294 | | return operations.CreateAsync(indexer, searchRequestOptions).GetAwaiter().GetResult(); |
| | 295 | | } |
| | 296 | |
|
| | 297 | | /// <summary> |
| | 298 | | /// Creates a new indexer. |
| | 299 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Indexer" /> |
| | 300 | | /// </summary> |
| | 301 | | /// <param name='operations'> |
| | 302 | | /// The operations group for this extension method. |
| | 303 | | /// </param> |
| | 304 | | /// <param name='indexer'> |
| | 305 | | /// The definition of the indexer to create. |
| | 306 | | /// </param> |
| | 307 | | /// <param name='searchRequestOptions'> |
| | 308 | | /// Additional parameters for the operation |
| | 309 | | /// </param> |
| | 310 | | /// <param name='cancellationToken'> |
| | 311 | | /// The cancellation token. |
| | 312 | | /// </param> |
| | 313 | | public static async Task<Indexer> CreateAsync(this IIndexersOperations operations, Indexer indexer, SearchRe |
| | 314 | | { |
| 22 | 315 | | using (var _result = await operations.CreateWithHttpMessagesAsync(indexer, searchRequestOptions, null, c |
| | 316 | | { |
| 20 | 317 | | return _result.Body; |
| | 318 | | } |
| 20 | 319 | | } |
| | 320 | |
|
| | 321 | | /// <summary> |
| | 322 | | /// Returns the current status and execution history of an indexer. |
| | 323 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Indexer-Status" /> |
| | 324 | | /// </summary> |
| | 325 | | /// <param name='operations'> |
| | 326 | | /// The operations group for this extension method. |
| | 327 | | /// </param> |
| | 328 | | /// <param name='indexerName'> |
| | 329 | | /// The name of the indexer for which to retrieve status. |
| | 330 | | /// </param> |
| | 331 | | /// <param name='searchRequestOptions'> |
| | 332 | | /// Additional parameters for the operation |
| | 333 | | /// </param> |
| | 334 | | public static IndexerExecutionInfo GetStatus(this IIndexersOperations operations, string indexerName, Search |
| | 335 | | { |
| 6 | 336 | | return operations.GetStatusAsync(indexerName, searchRequestOptions).GetAwaiter().GetResult(); |
| | 337 | | } |
| | 338 | |
|
| | 339 | | /// <summary> |
| | 340 | | /// Returns the current status and execution history of an indexer. |
| | 341 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Indexer-Status" /> |
| | 342 | | /// </summary> |
| | 343 | | /// <param name='operations'> |
| | 344 | | /// The operations group for this extension method. |
| | 345 | | /// </param> |
| | 346 | | /// <param name='indexerName'> |
| | 347 | | /// The name of the indexer for which to retrieve status. |
| | 348 | | /// </param> |
| | 349 | | /// <param name='searchRequestOptions'> |
| | 350 | | /// Additional parameters for the operation |
| | 351 | | /// </param> |
| | 352 | | /// <param name='cancellationToken'> |
| | 353 | | /// The cancellation token. |
| | 354 | | /// </param> |
| | 355 | | public static async Task<IndexerExecutionInfo> GetStatusAsync(this IIndexersOperations operations, string in |
| | 356 | | { |
| 6 | 357 | | using (var _result = await operations.GetStatusWithHttpMessagesAsync(indexerName, searchRequestOptions, |
| | 358 | | { |
| 6 | 359 | | return _result.Body; |
| | 360 | | } |
| 6 | 361 | | } |
| | 362 | |
|
| | 363 | | } |
| | 364 | | } |