| | 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.Threading; |
| | 11 | | using System.Threading.Tasks; |
| | 12 | |
|
| | 13 | | /// <summary> |
| | 14 | | /// Extension methods for ListManagementTerm. |
| | 15 | | /// </summary> |
| | 16 | | public static partial class ListManagementTermExtensions |
| | 17 | | { |
| | 18 | | /// <summary> |
| | 19 | | /// Add a term to the term list with list Id equal to list Id passed. |
| | 20 | | /// </summary> |
| | 21 | | /// <param name='operations'> |
| | 22 | | /// The operations group for this extension method. |
| | 23 | | /// </param> |
| | 24 | | /// <param name='listId'> |
| | 25 | | /// List Id of the image list. |
| | 26 | | /// </param> |
| | 27 | | /// <param name='term'> |
| | 28 | | /// Term to be deleted |
| | 29 | | /// </param> |
| | 30 | | /// <param name='language'> |
| | 31 | | /// Language of the terms. |
| | 32 | | /// </param> |
| | 33 | | public static object AddTerm(this IListManagementTerm operations, string listId, string term, string languag |
| | 34 | | { |
| 0 | 35 | | return operations.AddTermAsync(listId, term, language).GetAwaiter().GetResult(); |
| | 36 | | } |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Add a term to the term list with list Id equal to list Id passed. |
| | 40 | | /// </summary> |
| | 41 | | /// <param name='operations'> |
| | 42 | | /// The operations group for this extension method. |
| | 43 | | /// </param> |
| | 44 | | /// <param name='listId'> |
| | 45 | | /// List Id of the image list. |
| | 46 | | /// </param> |
| | 47 | | /// <param name='term'> |
| | 48 | | /// Term to be deleted |
| | 49 | | /// </param> |
| | 50 | | /// <param name='language'> |
| | 51 | | /// Language of the terms. |
| | 52 | | /// </param> |
| | 53 | | /// <param name='cancellationToken'> |
| | 54 | | /// The cancellation token. |
| | 55 | | /// </param> |
| | 56 | | public static async Task<object> AddTermAsync(this IListManagementTerm operations, string listId, string ter |
| | 57 | | { |
| 0 | 58 | | using (var _result = await operations.AddTermWithHttpMessagesAsync(listId, term, language, null, cancell |
| | 59 | | { |
| 0 | 60 | | return _result.Body; |
| | 61 | | } |
| 0 | 62 | | } |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// Deletes a term from the list with list Id equal to the list Id passed. |
| | 66 | | /// </summary> |
| | 67 | | /// <param name='operations'> |
| | 68 | | /// The operations group for this extension method. |
| | 69 | | /// </param> |
| | 70 | | /// <param name='listId'> |
| | 71 | | /// List Id of the image list. |
| | 72 | | /// </param> |
| | 73 | | /// <param name='term'> |
| | 74 | | /// Term to be deleted |
| | 75 | | /// </param> |
| | 76 | | /// <param name='language'> |
| | 77 | | /// Language of the terms. |
| | 78 | | /// </param> |
| | 79 | | public static string DeleteTerm(this IListManagementTerm operations, string listId, string term, string lang |
| | 80 | | { |
| 0 | 81 | | return operations.DeleteTermAsync(listId, term, language).GetAwaiter().GetResult(); |
| | 82 | | } |
| | 83 | |
|
| | 84 | | /// <summary> |
| | 85 | | /// Deletes a term from the list with list Id equal to the list Id passed. |
| | 86 | | /// </summary> |
| | 87 | | /// <param name='operations'> |
| | 88 | | /// The operations group for this extension method. |
| | 89 | | /// </param> |
| | 90 | | /// <param name='listId'> |
| | 91 | | /// List Id of the image list. |
| | 92 | | /// </param> |
| | 93 | | /// <param name='term'> |
| | 94 | | /// Term to be deleted |
| | 95 | | /// </param> |
| | 96 | | /// <param name='language'> |
| | 97 | | /// Language of the terms. |
| | 98 | | /// </param> |
| | 99 | | /// <param name='cancellationToken'> |
| | 100 | | /// The cancellation token. |
| | 101 | | /// </param> |
| | 102 | | public static async Task<string> DeleteTermAsync(this IListManagementTerm operations, string listId, string |
| | 103 | | { |
| 0 | 104 | | using (var _result = await operations.DeleteTermWithHttpMessagesAsync(listId, term, language, null, canc |
| | 105 | | { |
| 0 | 106 | | return _result.Body; |
| | 107 | | } |
| 0 | 108 | | } |
| | 109 | |
|
| | 110 | | /// <summary> |
| | 111 | | /// Gets all terms from the list with list Id equal to the list Id passed. |
| | 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='language'> |
| | 120 | | /// Language of the terms. |
| | 121 | | /// </param> |
| | 122 | | /// <param name='offset'> |
| | 123 | | /// The pagination start index. |
| | 124 | | /// </param> |
| | 125 | | /// <param name='limit'> |
| | 126 | | /// The max limit. |
| | 127 | | /// </param> |
| | 128 | | public static Terms GetAllTerms(this IListManagementTerm operations, string listId, string language, int? of |
| | 129 | | { |
| 0 | 130 | | return operations.GetAllTermsAsync(listId, language, offset, limit).GetAwaiter().GetResult(); |
| | 131 | | } |
| | 132 | |
|
| | 133 | | /// <summary> |
| | 134 | | /// Gets all terms from the list with list Id equal to the list Id passed. |
| | 135 | | /// </summary> |
| | 136 | | /// <param name='operations'> |
| | 137 | | /// The operations group for this extension method. |
| | 138 | | /// </param> |
| | 139 | | /// <param name='listId'> |
| | 140 | | /// List Id of the image list. |
| | 141 | | /// </param> |
| | 142 | | /// <param name='language'> |
| | 143 | | /// Language of the terms. |
| | 144 | | /// </param> |
| | 145 | | /// <param name='offset'> |
| | 146 | | /// The pagination start index. |
| | 147 | | /// </param> |
| | 148 | | /// <param name='limit'> |
| | 149 | | /// The max limit. |
| | 150 | | /// </param> |
| | 151 | | /// <param name='cancellationToken'> |
| | 152 | | /// The cancellation token. |
| | 153 | | /// </param> |
| | 154 | | public static async Task<Terms> GetAllTermsAsync(this IListManagementTerm operations, string listId, string |
| | 155 | | { |
| 0 | 156 | | using (var _result = await operations.GetAllTermsWithHttpMessagesAsync(listId, language, offset, limit, |
| | 157 | | { |
| 0 | 158 | | return _result.Body; |
| | 159 | | } |
| 0 | 160 | | } |
| | 161 | |
|
| | 162 | | /// <summary> |
| | 163 | | /// Deletes all terms from the list with list Id equal to the list Id passed. |
| | 164 | | /// </summary> |
| | 165 | | /// <param name='operations'> |
| | 166 | | /// The operations group for this extension method. |
| | 167 | | /// </param> |
| | 168 | | /// <param name='listId'> |
| | 169 | | /// List Id of the image list. |
| | 170 | | /// </param> |
| | 171 | | /// <param name='language'> |
| | 172 | | /// Language of the terms. |
| | 173 | | /// </param> |
| | 174 | | public static string DeleteAllTerms(this IListManagementTerm operations, string listId, string language) |
| | 175 | | { |
| 0 | 176 | | return operations.DeleteAllTermsAsync(listId, language).GetAwaiter().GetResult(); |
| | 177 | | } |
| | 178 | |
|
| | 179 | | /// <summary> |
| | 180 | | /// Deletes all terms from the list with list Id equal to the list Id passed. |
| | 181 | | /// </summary> |
| | 182 | | /// <param name='operations'> |
| | 183 | | /// The operations group for this extension method. |
| | 184 | | /// </param> |
| | 185 | | /// <param name='listId'> |
| | 186 | | /// List Id of the image list. |
| | 187 | | /// </param> |
| | 188 | | /// <param name='language'> |
| | 189 | | /// Language of the terms. |
| | 190 | | /// </param> |
| | 191 | | /// <param name='cancellationToken'> |
| | 192 | | /// The cancellation token. |
| | 193 | | /// </param> |
| | 194 | | public static async Task<string> DeleteAllTermsAsync(this IListManagementTerm operations, string listId, str |
| | 195 | | { |
| 0 | 196 | | using (var _result = await operations.DeleteAllTermsWithHttpMessagesAsync(listId, language, null, cancel |
| | 197 | | { |
| 0 | 198 | | return _result.Body; |
| | 199 | | } |
| 0 | 200 | | } |
| | 201 | |
|
| | 202 | | } |
| | 203 | | } |