| | 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 SynonymMapsOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class SynonymMapsOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Creates a new synonym map or updates a synonym map if it already exists. |
| | 26 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Update-Synonym-Map" /> |
| | 27 | | /// </summary> |
| | 28 | | /// <param name='operations'> |
| | 29 | | /// The operations group for this extension method. |
| | 30 | | /// </param> |
| | 31 | | /// <param name='synonymMapName'> |
| | 32 | | /// The name of the synonym map to create or update. |
| | 33 | | /// </param> |
| | 34 | | /// <param name='synonymMap'> |
| | 35 | | /// The definition of the synonym map to create or update. |
| | 36 | | /// </param> |
| | 37 | | /// <param name='searchRequestOptions'> |
| | 38 | | /// Additional parameters for the operation |
| | 39 | | /// </param> |
| | 40 | | /// <param name='accessCondition'> |
| | 41 | | /// Additional parameters for the operation |
| | 42 | | /// </param> |
| | 43 | | public static SynonymMap CreateOrUpdate(this ISynonymMapsOperations operations, string synonymMapName, Synon |
| | 44 | | { |
| 0 | 45 | | return operations.CreateOrUpdateAsync(synonymMapName, synonymMap, searchRequestOptions, accessCondition) |
| | 46 | | } |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// Creates a new synonym map or updates a synonym map if it already exists. |
| | 50 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Update-Synonym-Map" /> |
| | 51 | | /// </summary> |
| | 52 | | /// <param name='operations'> |
| | 53 | | /// The operations group for this extension method. |
| | 54 | | /// </param> |
| | 55 | | /// <param name='synonymMapName'> |
| | 56 | | /// The name of the synonym map to create or update. |
| | 57 | | /// </param> |
| | 58 | | /// <param name='synonymMap'> |
| | 59 | | /// The definition of the synonym map to create or update. |
| | 60 | | /// </param> |
| | 61 | | /// <param name='searchRequestOptions'> |
| | 62 | | /// Additional parameters for the operation |
| | 63 | | /// </param> |
| | 64 | | /// <param name='accessCondition'> |
| | 65 | | /// Additional parameters for the operation |
| | 66 | | /// </param> |
| | 67 | | /// <param name='cancellationToken'> |
| | 68 | | /// The cancellation token. |
| | 69 | | /// </param> |
| | 70 | | public static async Task<SynonymMap> CreateOrUpdateAsync(this ISynonymMapsOperations operations, string syno |
| | 71 | | { |
| 0 | 72 | | using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(synonymMapName, synonymMap, se |
| | 73 | | { |
| 0 | 74 | | return _result.Body; |
| | 75 | | } |
| 0 | 76 | | } |
| | 77 | |
|
| | 78 | | /// <summary> |
| | 79 | | /// Deletes a synonym map. |
| | 80 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Delete-Synonym-Map" /> |
| | 81 | | /// </summary> |
| | 82 | | /// <param name='operations'> |
| | 83 | | /// The operations group for this extension method. |
| | 84 | | /// </param> |
| | 85 | | /// <param name='synonymMapName'> |
| | 86 | | /// The name of the synonym map to delete. |
| | 87 | | /// </param> |
| | 88 | | /// <param name='searchRequestOptions'> |
| | 89 | | /// Additional parameters for the operation |
| | 90 | | /// </param> |
| | 91 | | /// <param name='accessCondition'> |
| | 92 | | /// Additional parameters for the operation |
| | 93 | | /// </param> |
| | 94 | | public static void Delete(this ISynonymMapsOperations operations, string synonymMapName, SearchRequestOption |
| | 95 | | { |
| 12 | 96 | | operations.DeleteAsync(synonymMapName, searchRequestOptions, accessCondition).GetAwaiter().GetResult(); |
| 8 | 97 | | } |
| | 98 | |
|
| | 99 | | /// <summary> |
| | 100 | | /// Deletes a synonym map. |
| | 101 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Delete-Synonym-Map" /> |
| | 102 | | /// </summary> |
| | 103 | | /// <param name='operations'> |
| | 104 | | /// The operations group for this extension method. |
| | 105 | | /// </param> |
| | 106 | | /// <param name='synonymMapName'> |
| | 107 | | /// The name of the synonym map to delete. |
| | 108 | | /// </param> |
| | 109 | | /// <param name='searchRequestOptions'> |
| | 110 | | /// Additional parameters for the operation |
| | 111 | | /// </param> |
| | 112 | | /// <param name='accessCondition'> |
| | 113 | | /// Additional parameters for the operation |
| | 114 | | /// </param> |
| | 115 | | /// <param name='cancellationToken'> |
| | 116 | | /// The cancellation token. |
| | 117 | | /// </param> |
| | 118 | | public static async Task DeleteAsync(this ISynonymMapsOperations operations, string synonymMapName, SearchRe |
| | 119 | | { |
| 12 | 120 | | (await operations.DeleteWithHttpMessagesAsync(synonymMapName, searchRequestOptions, accessCondition, nul |
| 8 | 121 | | } |
| | 122 | |
|
| | 123 | | /// <summary> |
| | 124 | | /// Retrieves a synonym map definition. |
| | 125 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Synonym-Map" /> |
| | 126 | | /// </summary> |
| | 127 | | /// <param name='operations'> |
| | 128 | | /// The operations group for this extension method. |
| | 129 | | /// </param> |
| | 130 | | /// <param name='synonymMapName'> |
| | 131 | | /// The name of the synonym map to retrieve. |
| | 132 | | /// </param> |
| | 133 | | /// <param name='searchRequestOptions'> |
| | 134 | | /// Additional parameters for the operation |
| | 135 | | /// </param> |
| | 136 | | public static SynonymMap Get(this ISynonymMapsOperations operations, string synonymMapName, SearchRequestOpt |
| | 137 | | { |
| 4 | 138 | | return operations.GetAsync(synonymMapName, searchRequestOptions).GetAwaiter().GetResult(); |
| | 139 | | } |
| | 140 | |
|
| | 141 | | /// <summary> |
| | 142 | | /// Retrieves a synonym map definition. |
| | 143 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Synonym-Map" /> |
| | 144 | | /// </summary> |
| | 145 | | /// <param name='operations'> |
| | 146 | | /// The operations group for this extension method. |
| | 147 | | /// </param> |
| | 148 | | /// <param name='synonymMapName'> |
| | 149 | | /// The name of the synonym map to retrieve. |
| | 150 | | /// </param> |
| | 151 | | /// <param name='searchRequestOptions'> |
| | 152 | | /// Additional parameters for the operation |
| | 153 | | /// </param> |
| | 154 | | /// <param name='cancellationToken'> |
| | 155 | | /// The cancellation token. |
| | 156 | | /// </param> |
| | 157 | | public static async Task<SynonymMap> GetAsync(this ISynonymMapsOperations operations, string synonymMapName, |
| | 158 | | { |
| 4 | 159 | | using (var _result = await operations.GetWithHttpMessagesAsync(synonymMapName, searchRequestOptions, nul |
| | 160 | | { |
| 2 | 161 | | return _result.Body; |
| | 162 | | } |
| 2 | 163 | | } |
| | 164 | |
|
| | 165 | | /// <summary> |
| | 166 | | /// Lists all synonym maps available for a search service. |
| | 167 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/List-Synonym-Maps" /> |
| | 168 | | /// </summary> |
| | 169 | | /// <param name='operations'> |
| | 170 | | /// The operations group for this extension method. |
| | 171 | | /// </param> |
| | 172 | | /// <param name='searchRequestOptions'> |
| | 173 | | /// Additional parameters for the operation |
| | 174 | | /// </param> |
| | 175 | | public static SynonymMapListResult List(this ISynonymMapsOperations operations, SearchRequestOptions searchR |
| | 176 | | { |
| 2 | 177 | | return operations.ListAsync(searchRequestOptions).GetAwaiter().GetResult(); |
| | 178 | | } |
| | 179 | |
|
| | 180 | | /// <summary> |
| | 181 | | /// Lists all synonym maps available for a search service. |
| | 182 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/List-Synonym-Maps" /> |
| | 183 | | /// </summary> |
| | 184 | | /// <param name='operations'> |
| | 185 | | /// The operations group for this extension method. |
| | 186 | | /// </param> |
| | 187 | | /// <param name='searchRequestOptions'> |
| | 188 | | /// Additional parameters for the operation |
| | 189 | | /// </param> |
| | 190 | | /// <param name='cancellationToken'> |
| | 191 | | /// The cancellation token. |
| | 192 | | /// </param> |
| | 193 | | public static async Task<SynonymMapListResult> ListAsync(this ISynonymMapsOperations operations, SearchReque |
| | 194 | | { |
| 2 | 195 | | using (var _result = await operations.ListWithHttpMessagesAsync(searchRequestOptions, null, cancellation |
| | 196 | | { |
| 2 | 197 | | return _result.Body; |
| | 198 | | } |
| 2 | 199 | | } |
| | 200 | |
|
| | 201 | | /// <summary> |
| | 202 | | /// Creates a new synonym map. |
| | 203 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Synonym-Map" /> |
| | 204 | | /// </summary> |
| | 205 | | /// <param name='operations'> |
| | 206 | | /// The operations group for this extension method. |
| | 207 | | /// </param> |
| | 208 | | /// <param name='synonymMap'> |
| | 209 | | /// The definition of the synonym map to create. |
| | 210 | | /// </param> |
| | 211 | | /// <param name='searchRequestOptions'> |
| | 212 | | /// Additional parameters for the operation |
| | 213 | | /// </param> |
| | 214 | | public static SynonymMap Create(this ISynonymMapsOperations operations, SynonymMap synonymMap, SearchRequest |
| | 215 | | { |
| 24 | 216 | | return operations.CreateAsync(synonymMap, searchRequestOptions).GetAwaiter().GetResult(); |
| | 217 | | } |
| | 218 | |
|
| | 219 | | /// <summary> |
| | 220 | | /// Creates a new synonym map. |
| | 221 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Synonym-Map" /> |
| | 222 | | /// </summary> |
| | 223 | | /// <param name='operations'> |
| | 224 | | /// The operations group for this extension method. |
| | 225 | | /// </param> |
| | 226 | | /// <param name='synonymMap'> |
| | 227 | | /// The definition of the synonym map to create. |
| | 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<SynonymMap> CreateAsync(this ISynonymMapsOperations operations, SynonymMap synonymM |
| | 236 | | { |
| 24 | 237 | | using (var _result = await operations.CreateWithHttpMessagesAsync(synonymMap, searchRequestOptions, null |
| | 238 | | { |
| 22 | 239 | | return _result.Body; |
| | 240 | | } |
| 22 | 241 | | } |
| | 242 | |
|
| | 243 | | } |
| | 244 | | } |