| | 1 | | // <auto-generated> |
| | 2 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 3 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 4 | | // regenerated. |
| | 5 | | // </auto-generated> |
| | 6 | |
|
| | 7 | | namespace Microsoft.Azure.CognitiveServices.ContentModerator |
| | 8 | | { |
| | 9 | | using Models; |
| | 10 | | using System.Collections; |
| | 11 | | using System.Collections.Generic; |
| | 12 | | using System.Threading; |
| | 13 | | using System.Threading.Tasks; |
| | 14 | |
|
| | 15 | | /// <summary> |
| | 16 | | /// Extension methods for ListManagementTermLists. |
| | 17 | | /// </summary> |
| | 18 | | public static partial class ListManagementTermListsExtensions |
| | 19 | | { |
| | 20 | | /// <summary> |
| | 21 | | /// Returns list Id details of the term list with list Id equal to list Id |
| | 22 | | /// passed. |
| | 23 | | /// </summary> |
| | 24 | | /// <param name='operations'> |
| | 25 | | /// The operations group for this extension method. |
| | 26 | | /// </param> |
| | 27 | | /// <param name='listId'> |
| | 28 | | /// List Id of the image list. |
| | 29 | | /// </param> |
| | 30 | | public static TermList GetDetails(this IListManagementTermLists operations, string listId) |
| | 31 | | { |
| 0 | 32 | | return operations.GetDetailsAsync(listId).GetAwaiter().GetResult(); |
| | 33 | | } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Returns list Id details of the term list with list Id equal to list Id |
| | 37 | | /// passed. |
| | 38 | | /// </summary> |
| | 39 | | /// <param name='operations'> |
| | 40 | | /// The operations group for this extension method. |
| | 41 | | /// </param> |
| | 42 | | /// <param name='listId'> |
| | 43 | | /// List Id of the image list. |
| | 44 | | /// </param> |
| | 45 | | /// <param name='cancellationToken'> |
| | 46 | | /// The cancellation token. |
| | 47 | | /// </param> |
| | 48 | | public static async Task<TermList> GetDetailsAsync(this IListManagementTermLists operations, string listId, |
| | 49 | | { |
| 0 | 50 | | using (var _result = await operations.GetDetailsWithHttpMessagesAsync(listId, null, cancellationToken).C |
| | 51 | | { |
| 0 | 52 | | return _result.Body; |
| | 53 | | } |
| 0 | 54 | | } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Deletes term list with the list Id equal to list Id passed. |
| | 58 | | /// </summary> |
| | 59 | | /// <param name='operations'> |
| | 60 | | /// The operations group for this extension method. |
| | 61 | | /// </param> |
| | 62 | | /// <param name='listId'> |
| | 63 | | /// List Id of the image list. |
| | 64 | | /// </param> |
| | 65 | | public static string Delete(this IListManagementTermLists operations, string listId) |
| | 66 | | { |
| 0 | 67 | | return operations.DeleteAsync(listId).GetAwaiter().GetResult(); |
| | 68 | | } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Deletes term list with the list Id equal to list Id passed. |
| | 72 | | /// </summary> |
| | 73 | | /// <param name='operations'> |
| | 74 | | /// The operations group for this extension method. |
| | 75 | | /// </param> |
| | 76 | | /// <param name='listId'> |
| | 77 | | /// List Id of the image list. |
| | 78 | | /// </param> |
| | 79 | | /// <param name='cancellationToken'> |
| | 80 | | /// The cancellation token. |
| | 81 | | /// </param> |
| | 82 | | public static async Task<string> DeleteAsync(this IListManagementTermLists operations, string listId, Cancel |
| | 83 | | { |
| 0 | 84 | | using (var _result = await operations.DeleteWithHttpMessagesAsync(listId, null, cancellationToken).Confi |
| | 85 | | { |
| 0 | 86 | | return _result.Body; |
| | 87 | | } |
| 0 | 88 | | } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// Updates an Term List. |
| | 92 | | /// </summary> |
| | 93 | | /// <param name='operations'> |
| | 94 | | /// The operations group for this extension method. |
| | 95 | | /// </param> |
| | 96 | | /// <param name='listId'> |
| | 97 | | /// List Id of the image list. |
| | 98 | | /// </param> |
| | 99 | | /// <param name='contentType'> |
| | 100 | | /// The content type. |
| | 101 | | /// </param> |
| | 102 | | /// <param name='body'> |
| | 103 | | /// Schema of the body. |
| | 104 | | /// </param> |
| | 105 | | public static TermList Update(this IListManagementTermLists operations, string listId, string contentType, B |
| | 106 | | { |
| 0 | 107 | | return operations.UpdateAsync(listId, contentType, body).GetAwaiter().GetResult(); |
| | 108 | | } |
| | 109 | |
|
| | 110 | | /// <summary> |
| | 111 | | /// Updates an Term List. |
| | 112 | | /// </summary> |
| | 113 | | /// <param name='operations'> |
| | 114 | | /// The operations group for this extension method. |
| | 115 | | /// </param> |
| | 116 | | /// <param name='listId'> |
| | 117 | | /// List Id of the image list. |
| | 118 | | /// </param> |
| | 119 | | /// <param name='contentType'> |
| | 120 | | /// The content type. |
| | 121 | | /// </param> |
| | 122 | | /// <param name='body'> |
| | 123 | | /// Schema of the body. |
| | 124 | | /// </param> |
| | 125 | | /// <param name='cancellationToken'> |
| | 126 | | /// The cancellation token. |
| | 127 | | /// </param> |
| | 128 | | public static async Task<TermList> UpdateAsync(this IListManagementTermLists operations, string listId, stri |
| | 129 | | { |
| 0 | 130 | | using (var _result = await operations.UpdateWithHttpMessagesAsync(listId, contentType, body, null, cance |
| | 131 | | { |
| 0 | 132 | | return _result.Body; |
| | 133 | | } |
| 0 | 134 | | } |
| | 135 | |
|
| | 136 | | /// <summary> |
| | 137 | | /// Creates a Term List |
| | 138 | | /// </summary> |
| | 139 | | /// <param name='operations'> |
| | 140 | | /// The operations group for this extension method. |
| | 141 | | /// </param> |
| | 142 | | /// <param name='contentType'> |
| | 143 | | /// The content type. |
| | 144 | | /// </param> |
| | 145 | | /// <param name='body'> |
| | 146 | | /// Schema of the body. |
| | 147 | | /// </param> |
| | 148 | | public static TermList Create(this IListManagementTermLists operations, string contentType, Body body) |
| | 149 | | { |
| 0 | 150 | | return operations.CreateAsync(contentType, body).GetAwaiter().GetResult(); |
| | 151 | | } |
| | 152 | |
|
| | 153 | | /// <summary> |
| | 154 | | /// Creates a Term List |
| | 155 | | /// </summary> |
| | 156 | | /// <param name='operations'> |
| | 157 | | /// The operations group for this extension method. |
| | 158 | | /// </param> |
| | 159 | | /// <param name='contentType'> |
| | 160 | | /// The content type. |
| | 161 | | /// </param> |
| | 162 | | /// <param name='body'> |
| | 163 | | /// Schema of the body. |
| | 164 | | /// </param> |
| | 165 | | /// <param name='cancellationToken'> |
| | 166 | | /// The cancellation token. |
| | 167 | | /// </param> |
| | 168 | | public static async Task<TermList> CreateAsync(this IListManagementTermLists operations, string contentType, |
| | 169 | | { |
| 0 | 170 | | using (var _result = await operations.CreateWithHttpMessagesAsync(contentType, body, null, cancellationT |
| | 171 | | { |
| 0 | 172 | | return _result.Body; |
| | 173 | | } |
| 0 | 174 | | } |
| | 175 | |
|
| | 176 | | /// <summary> |
| | 177 | | /// gets all the Term Lists |
| | 178 | | /// </summary> |
| | 179 | | /// <param name='operations'> |
| | 180 | | /// The operations group for this extension method. |
| | 181 | | /// </param> |
| | 182 | | public static IList<TermList> GetAllTermLists(this IListManagementTermLists operations) |
| | 183 | | { |
| 0 | 184 | | return operations.GetAllTermListsAsync().GetAwaiter().GetResult(); |
| | 185 | | } |
| | 186 | |
|
| | 187 | | /// <summary> |
| | 188 | | /// gets all the Term Lists |
| | 189 | | /// </summary> |
| | 190 | | /// <param name='operations'> |
| | 191 | | /// The operations group for this extension method. |
| | 192 | | /// </param> |
| | 193 | | /// <param name='cancellationToken'> |
| | 194 | | /// The cancellation token. |
| | 195 | | /// </param> |
| | 196 | | public static async Task<IList<TermList>> GetAllTermListsAsync(this IListManagementTermLists operations, Can |
| | 197 | | { |
| 0 | 198 | | using (var _result = await operations.GetAllTermListsWithHttpMessagesAsync(null, cancellationToken).Conf |
| | 199 | | { |
| 0 | 200 | | return _result.Body; |
| | 201 | | } |
| 0 | 202 | | } |
| | 203 | |
|
| | 204 | | /// <summary> |
| | 205 | | /// Refreshes the index of the list with list Id equal to list ID passed. |
| | 206 | | /// </summary> |
| | 207 | | /// <param name='operations'> |
| | 208 | | /// The operations group for this extension method. |
| | 209 | | /// </param> |
| | 210 | | /// <param name='listId'> |
| | 211 | | /// List Id of the image list. |
| | 212 | | /// </param> |
| | 213 | | /// <param name='language'> |
| | 214 | | /// Language of the terms. |
| | 215 | | /// </param> |
| | 216 | | public static RefreshIndex RefreshIndexMethod(this IListManagementTermLists operations, string listId, strin |
| | 217 | | { |
| 0 | 218 | | return operations.RefreshIndexMethodAsync(listId, language).GetAwaiter().GetResult(); |
| | 219 | | } |
| | 220 | |
|
| | 221 | | /// <summary> |
| | 222 | | /// Refreshes the index of the list with list Id equal to list ID passed. |
| | 223 | | /// </summary> |
| | 224 | | /// <param name='operations'> |
| | 225 | | /// The operations group for this extension method. |
| | 226 | | /// </param> |
| | 227 | | /// <param name='listId'> |
| | 228 | | /// List Id of the image list. |
| | 229 | | /// </param> |
| | 230 | | /// <param name='language'> |
| | 231 | | /// Language of the terms. |
| | 232 | | /// </param> |
| | 233 | | /// <param name='cancellationToken'> |
| | 234 | | /// The cancellation token. |
| | 235 | | /// </param> |
| | 236 | | public static async Task<RefreshIndex> RefreshIndexMethodAsync(this IListManagementTermLists operations, str |
| | 237 | | { |
| 0 | 238 | | using (var _result = await operations.RefreshIndexMethodWithHttpMessagesAsync(listId, language, null, ca |
| | 239 | | { |
| 0 | 240 | | return _result.Body; |
| | 241 | | } |
| 0 | 242 | | } |
| | 243 | |
|
| | 244 | | } |
| | 245 | | } |