| | | 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 DataSourcesOperations. |
| | | 21 | | /// </summary> |
| | | 22 | | public static partial class DataSourcesOperationsExtensions |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// Creates a new datasource or updates a datasource if it already exists. |
| | | 26 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Update-Data-Source" /> |
| | | 27 | | /// </summary> |
| | | 28 | | /// <param name='operations'> |
| | | 29 | | /// The operations group for this extension method. |
| | | 30 | | /// </param> |
| | | 31 | | /// <param name='dataSourceName'> |
| | | 32 | | /// The name of the datasource to create or update. |
| | | 33 | | /// </param> |
| | | 34 | | /// <param name='dataSource'> |
| | | 35 | | /// The definition of the datasource 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 DataSource CreateOrUpdate(this IDataSourcesOperations operations, string dataSourceName, DataS |
| | | 44 | | { |
| | 0 | 45 | | return operations.CreateOrUpdateAsync(dataSourceName, dataSource, searchRequestOptions, accessCondition) |
| | | 46 | | } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Creates a new datasource or updates a datasource if it already exists. |
| | | 50 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Update-Data-Source" /> |
| | | 51 | | /// </summary> |
| | | 52 | | /// <param name='operations'> |
| | | 53 | | /// The operations group for this extension method. |
| | | 54 | | /// </param> |
| | | 55 | | /// <param name='dataSourceName'> |
| | | 56 | | /// The name of the datasource to create or update. |
| | | 57 | | /// </param> |
| | | 58 | | /// <param name='dataSource'> |
| | | 59 | | /// The definition of the datasource 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<DataSource> CreateOrUpdateAsync(this IDataSourcesOperations operations, string data |
| | | 71 | | { |
| | 0 | 72 | | using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(dataSourceName, dataSource, se |
| | | 73 | | { |
| | 0 | 74 | | return _result.Body; |
| | | 75 | | } |
| | 0 | 76 | | } |
| | | 77 | | |
| | | 78 | | /// <summary> |
| | | 79 | | /// Deletes a datasource. |
| | | 80 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Delete-Data-Source" /> |
| | | 81 | | /// </summary> |
| | | 82 | | /// <param name='operations'> |
| | | 83 | | /// The operations group for this extension method. |
| | | 84 | | /// </param> |
| | | 85 | | /// <param name='dataSourceName'> |
| | | 86 | | /// The name of the datasource 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 IDataSourcesOperations operations, string dataSourceName, SearchRequestOption |
| | | 95 | | { |
| | 72 | 96 | | operations.DeleteAsync(dataSourceName, searchRequestOptions, accessCondition).GetAwaiter().GetResult(); |
| | 68 | 97 | | } |
| | | 98 | | |
| | | 99 | | /// <summary> |
| | | 100 | | /// Deletes a datasource. |
| | | 101 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Delete-Data-Source" /> |
| | | 102 | | /// </summary> |
| | | 103 | | /// <param name='operations'> |
| | | 104 | | /// The operations group for this extension method. |
| | | 105 | | /// </param> |
| | | 106 | | /// <param name='dataSourceName'> |
| | | 107 | | /// The name of the datasource 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 IDataSourcesOperations operations, string dataSourceName, SearchRe |
| | | 119 | | { |
| | 72 | 120 | | (await operations.DeleteWithHttpMessagesAsync(dataSourceName, searchRequestOptions, accessCondition, nul |
| | 68 | 121 | | } |
| | | 122 | | |
| | | 123 | | /// <summary> |
| | | 124 | | /// Retrieves a datasource definition. |
| | | 125 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Data-Source" /> |
| | | 126 | | /// </summary> |
| | | 127 | | /// <param name='operations'> |
| | | 128 | | /// The operations group for this extension method. |
| | | 129 | | /// </param> |
| | | 130 | | /// <param name='dataSourceName'> |
| | | 131 | | /// The name of the datasource to retrieve. |
| | | 132 | | /// </param> |
| | | 133 | | /// <param name='searchRequestOptions'> |
| | | 134 | | /// Additional parameters for the operation |
| | | 135 | | /// </param> |
| | | 136 | | public static DataSource Get(this IDataSourcesOperations operations, string dataSourceName, SearchRequestOpt |
| | | 137 | | { |
| | 34 | 138 | | return operations.GetAsync(dataSourceName, searchRequestOptions).GetAwaiter().GetResult(); |
| | | 139 | | } |
| | | 140 | | |
| | | 141 | | /// <summary> |
| | | 142 | | /// Retrieves a datasource definition. |
| | | 143 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Data-Source" /> |
| | | 144 | | /// </summary> |
| | | 145 | | /// <param name='operations'> |
| | | 146 | | /// The operations group for this extension method. |
| | | 147 | | /// </param> |
| | | 148 | | /// <param name='dataSourceName'> |
| | | 149 | | /// The name of the datasource 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<DataSource> GetAsync(this IDataSourcesOperations operations, string dataSourceName, |
| | | 158 | | { |
| | 34 | 159 | | using (var _result = await operations.GetWithHttpMessagesAsync(dataSourceName, searchRequestOptions, nul |
| | | 160 | | { |
| | 32 | 161 | | return _result.Body; |
| | | 162 | | } |
| | 32 | 163 | | } |
| | | 164 | | |
| | | 165 | | /// <summary> |
| | | 166 | | /// Lists all datasources available for a search service. |
| | | 167 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/List-Data-Sources" /> |
| | | 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 DataSourceListResult List(this IDataSourcesOperations operations, SearchRequestOptions searchR |
| | | 176 | | { |
| | 2 | 177 | | return operations.ListAsync(searchRequestOptions).GetAwaiter().GetResult(); |
| | | 178 | | } |
| | | 179 | | |
| | | 180 | | /// <summary> |
| | | 181 | | /// Lists all datasources available for a search service. |
| | | 182 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/List-Data-Sources" /> |
| | | 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<DataSourceListResult> ListAsync(this IDataSourcesOperations 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 datasource. |
| | | 203 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Data-Source" /> |
| | | 204 | | /// </summary> |
| | | 205 | | /// <param name='operations'> |
| | | 206 | | /// The operations group for this extension method. |
| | | 207 | | /// </param> |
| | | 208 | | /// <param name='dataSource'> |
| | | 209 | | /// The definition of the datasource to create. |
| | | 210 | | /// </param> |
| | | 211 | | /// <param name='searchRequestOptions'> |
| | | 212 | | /// Additional parameters for the operation |
| | | 213 | | /// </param> |
| | | 214 | | public static DataSource Create(this IDataSourcesOperations operations, DataSource dataSource, SearchRequest |
| | | 215 | | { |
| | 120 | 216 | | return operations.CreateAsync(dataSource, searchRequestOptions).GetAwaiter().GetResult(); |
| | | 217 | | } |
| | | 218 | | |
| | | 219 | | /// <summary> |
| | | 220 | | /// Creates a new datasource. |
| | | 221 | | /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Data-Source" /> |
| | | 222 | | /// </summary> |
| | | 223 | | /// <param name='operations'> |
| | | 224 | | /// The operations group for this extension method. |
| | | 225 | | /// </param> |
| | | 226 | | /// <param name='dataSource'> |
| | | 227 | | /// The definition of the datasource 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<DataSource> CreateAsync(this IDataSourcesOperations operations, DataSource dataSour |
| | | 236 | | { |
| | 120 | 237 | | using (var _result = await operations.CreateWithHttpMessagesAsync(dataSource, searchRequestOptions, null |
| | | 238 | | { |
| | 118 | 239 | | return _result.Body; |
| | | 240 | | } |
| | 118 | 241 | | } |
| | | 242 | | |
| | | 243 | | } |
| | | 244 | | } |