| | | 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.IO; |
| | | 11 | | using System.Threading; |
| | | 12 | | using System.Threading.Tasks; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Extension methods for ListManagementImage. |
| | | 16 | | /// </summary> |
| | | 17 | | public static partial class ListManagementImageExtensions |
| | | 18 | | { |
| | | 19 | | /// <summary> |
| | | 20 | | /// Add an image to the list with list Id equal to list Id passed. |
| | | 21 | | /// </summary> |
| | | 22 | | /// <param name='operations'> |
| | | 23 | | /// The operations group for this extension method. |
| | | 24 | | /// </param> |
| | | 25 | | /// <param name='listId'> |
| | | 26 | | /// List Id of the image list. |
| | | 27 | | /// </param> |
| | | 28 | | /// <param name='tag'> |
| | | 29 | | /// Tag for the image. |
| | | 30 | | /// </param> |
| | | 31 | | /// <param name='label'> |
| | | 32 | | /// The image label. |
| | | 33 | | /// </param> |
| | | 34 | | public static Image AddImage(this IListManagementImage operations, string listId, int? tag = default(int?), |
| | | 35 | | { |
| | 0 | 36 | | return operations.AddImageAsync(listId, tag, label).GetAwaiter().GetResult(); |
| | | 37 | | } |
| | | 38 | | |
| | | 39 | | /// <summary> |
| | | 40 | | /// Add an image to the list with list Id equal to list Id passed. |
| | | 41 | | /// </summary> |
| | | 42 | | /// <param name='operations'> |
| | | 43 | | /// The operations group for this extension method. |
| | | 44 | | /// </param> |
| | | 45 | | /// <param name='listId'> |
| | | 46 | | /// List Id of the image list. |
| | | 47 | | /// </param> |
| | | 48 | | /// <param name='tag'> |
| | | 49 | | /// Tag for the image. |
| | | 50 | | /// </param> |
| | | 51 | | /// <param name='label'> |
| | | 52 | | /// The image label. |
| | | 53 | | /// </param> |
| | | 54 | | /// <param name='cancellationToken'> |
| | | 55 | | /// The cancellation token. |
| | | 56 | | /// </param> |
| | | 57 | | public static async Task<Image> AddImageAsync(this IListManagementImage operations, string listId, int? tag |
| | | 58 | | { |
| | 0 | 59 | | using (var _result = await operations.AddImageWithHttpMessagesAsync(listId, tag, label, null, cancellati |
| | | 60 | | { |
| | 0 | 61 | | return _result.Body; |
| | | 62 | | } |
| | 0 | 63 | | } |
| | | 64 | | |
| | | 65 | | /// <summary> |
| | | 66 | | /// Deletes all images from the list with list Id equal to list Id passed. |
| | | 67 | | /// </summary> |
| | | 68 | | /// <param name='operations'> |
| | | 69 | | /// The operations group for this extension method. |
| | | 70 | | /// </param> |
| | | 71 | | /// <param name='listId'> |
| | | 72 | | /// List Id of the image list. |
| | | 73 | | /// </param> |
| | | 74 | | public static string DeleteAllImages(this IListManagementImage operations, string listId) |
| | | 75 | | { |
| | 0 | 76 | | return operations.DeleteAllImagesAsync(listId).GetAwaiter().GetResult(); |
| | | 77 | | } |
| | | 78 | | |
| | | 79 | | /// <summary> |
| | | 80 | | /// Deletes all images from the list with list Id equal to list Id passed. |
| | | 81 | | /// </summary> |
| | | 82 | | /// <param name='operations'> |
| | | 83 | | /// The operations group for this extension method. |
| | | 84 | | /// </param> |
| | | 85 | | /// <param name='listId'> |
| | | 86 | | /// List Id of the image list. |
| | | 87 | | /// </param> |
| | | 88 | | /// <param name='cancellationToken'> |
| | | 89 | | /// The cancellation token. |
| | | 90 | | /// </param> |
| | | 91 | | public static async Task<string> DeleteAllImagesAsync(this IListManagementImage operations, string listId, C |
| | | 92 | | { |
| | 0 | 93 | | using (var _result = await operations.DeleteAllImagesWithHttpMessagesAsync(listId, null, cancellationTok |
| | | 94 | | { |
| | 0 | 95 | | return _result.Body; |
| | | 96 | | } |
| | 0 | 97 | | } |
| | | 98 | | |
| | | 99 | | /// <summary> |
| | | 100 | | /// Gets all image Ids from the list with list Id equal to list Id passed. |
| | | 101 | | /// </summary> |
| | | 102 | | /// <param name='operations'> |
| | | 103 | | /// The operations group for this extension method. |
| | | 104 | | /// </param> |
| | | 105 | | /// <param name='listId'> |
| | | 106 | | /// List Id of the image list. |
| | | 107 | | /// </param> |
| | | 108 | | public static ImageIds GetAllImageIds(this IListManagementImage operations, string listId) |
| | | 109 | | { |
| | 0 | 110 | | return operations.GetAllImageIdsAsync(listId).GetAwaiter().GetResult(); |
| | | 111 | | } |
| | | 112 | | |
| | | 113 | | /// <summary> |
| | | 114 | | /// Gets all image Ids from the list with list Id equal to list Id passed. |
| | | 115 | | /// </summary> |
| | | 116 | | /// <param name='operations'> |
| | | 117 | | /// The operations group for this extension method. |
| | | 118 | | /// </param> |
| | | 119 | | /// <param name='listId'> |
| | | 120 | | /// List Id of the image list. |
| | | 121 | | /// </param> |
| | | 122 | | /// <param name='cancellationToken'> |
| | | 123 | | /// The cancellation token. |
| | | 124 | | /// </param> |
| | | 125 | | public static async Task<ImageIds> GetAllImageIdsAsync(this IListManagementImage operations, string listId, |
| | | 126 | | { |
| | 0 | 127 | | using (var _result = await operations.GetAllImageIdsWithHttpMessagesAsync(listId, null, cancellationToke |
| | | 128 | | { |
| | 0 | 129 | | return _result.Body; |
| | | 130 | | } |
| | 0 | 131 | | } |
| | | 132 | | |
| | | 133 | | /// <summary> |
| | | 134 | | /// Deletes an image from the list with list Id and image 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='imageId'> |
| | | 143 | | /// Id of the image. |
| | | 144 | | /// </param> |
| | | 145 | | public static string DeleteImage(this IListManagementImage operations, string listId, string imageId) |
| | | 146 | | { |
| | 0 | 147 | | return operations.DeleteImageAsync(listId, imageId).GetAwaiter().GetResult(); |
| | | 148 | | } |
| | | 149 | | |
| | | 150 | | /// <summary> |
| | | 151 | | /// Deletes an image from the list with list Id and image Id passed. |
| | | 152 | | /// </summary> |
| | | 153 | | /// <param name='operations'> |
| | | 154 | | /// The operations group for this extension method. |
| | | 155 | | /// </param> |
| | | 156 | | /// <param name='listId'> |
| | | 157 | | /// List Id of the image list. |
| | | 158 | | /// </param> |
| | | 159 | | /// <param name='imageId'> |
| | | 160 | | /// Id of the image. |
| | | 161 | | /// </param> |
| | | 162 | | /// <param name='cancellationToken'> |
| | | 163 | | /// The cancellation token. |
| | | 164 | | /// </param> |
| | | 165 | | public static async Task<string> DeleteImageAsync(this IListManagementImage operations, string listId, strin |
| | | 166 | | { |
| | 0 | 167 | | using (var _result = await operations.DeleteImageWithHttpMessagesAsync(listId, imageId, null, cancellati |
| | | 168 | | { |
| | 0 | 169 | | return _result.Body; |
| | | 170 | | } |
| | 0 | 171 | | } |
| | | 172 | | |
| | | 173 | | /// <summary> |
| | | 174 | | /// Add an image to the list with list Id equal to list Id passed. |
| | | 175 | | /// </summary> |
| | | 176 | | /// <param name='operations'> |
| | | 177 | | /// The operations group for this extension method. |
| | | 178 | | /// </param> |
| | | 179 | | /// <param name='listId'> |
| | | 180 | | /// List Id of the image list. |
| | | 181 | | /// </param> |
| | | 182 | | /// <param name='contentType'> |
| | | 183 | | /// The content type. |
| | | 184 | | /// </param> |
| | | 185 | | /// <param name='imageUrl'> |
| | | 186 | | /// The image url. |
| | | 187 | | /// </param> |
| | | 188 | | /// <param name='tag'> |
| | | 189 | | /// Tag for the image. |
| | | 190 | | /// </param> |
| | | 191 | | /// <param name='label'> |
| | | 192 | | /// The image label. |
| | | 193 | | /// </param> |
| | | 194 | | public static Image AddImageUrlInput(this IListManagementImage operations, string listId, string contentType |
| | | 195 | | { |
| | 0 | 196 | | return operations.AddImageUrlInputAsync(listId, contentType, imageUrl, tag, label).GetAwaiter().GetResul |
| | | 197 | | } |
| | | 198 | | |
| | | 199 | | /// <summary> |
| | | 200 | | /// Add an image to the list with list Id equal to list Id passed. |
| | | 201 | | /// </summary> |
| | | 202 | | /// <param name='operations'> |
| | | 203 | | /// The operations group for this extension method. |
| | | 204 | | /// </param> |
| | | 205 | | /// <param name='listId'> |
| | | 206 | | /// List Id of the image list. |
| | | 207 | | /// </param> |
| | | 208 | | /// <param name='contentType'> |
| | | 209 | | /// The content type. |
| | | 210 | | /// </param> |
| | | 211 | | /// <param name='imageUrl'> |
| | | 212 | | /// The image url. |
| | | 213 | | /// </param> |
| | | 214 | | /// <param name='tag'> |
| | | 215 | | /// Tag for the image. |
| | | 216 | | /// </param> |
| | | 217 | | /// <param name='label'> |
| | | 218 | | /// The image label. |
| | | 219 | | /// </param> |
| | | 220 | | /// <param name='cancellationToken'> |
| | | 221 | | /// The cancellation token. |
| | | 222 | | /// </param> |
| | | 223 | | public static async Task<Image> AddImageUrlInputAsync(this IListManagementImage operations, string listId, s |
| | | 224 | | { |
| | 0 | 225 | | using (var _result = await operations.AddImageUrlInputWithHttpMessagesAsync(listId, contentType, imageUr |
| | | 226 | | { |
| | 0 | 227 | | return _result.Body; |
| | | 228 | | } |
| | 0 | 229 | | } |
| | | 230 | | |
| | | 231 | | /// <summary> |
| | | 232 | | /// Add an image to the list with list Id equal to list Id passed. |
| | | 233 | | /// </summary> |
| | | 234 | | /// <param name='operations'> |
| | | 235 | | /// The operations group for this extension method. |
| | | 236 | | /// </param> |
| | | 237 | | /// <param name='listId'> |
| | | 238 | | /// List Id of the image list. |
| | | 239 | | /// </param> |
| | | 240 | | /// <param name='imageStream'> |
| | | 241 | | /// The image file. |
| | | 242 | | /// </param> |
| | | 243 | | /// <param name='tag'> |
| | | 244 | | /// Tag for the image. |
| | | 245 | | /// </param> |
| | | 246 | | /// <param name='label'> |
| | | 247 | | /// The image label. |
| | | 248 | | /// </param> |
| | | 249 | | public static Image AddImageFileInput(this IListManagementImage operations, string listId, Stream imageStrea |
| | | 250 | | { |
| | 0 | 251 | | return operations.AddImageFileInputAsync(listId, imageStream, tag, label).GetAwaiter().GetResult(); |
| | | 252 | | } |
| | | 253 | | |
| | | 254 | | /// <summary> |
| | | 255 | | /// Add an image to the list with list Id equal to list Id passed. |
| | | 256 | | /// </summary> |
| | | 257 | | /// <param name='operations'> |
| | | 258 | | /// The operations group for this extension method. |
| | | 259 | | /// </param> |
| | | 260 | | /// <param name='listId'> |
| | | 261 | | /// List Id of the image list. |
| | | 262 | | /// </param> |
| | | 263 | | /// <param name='imageStream'> |
| | | 264 | | /// The image file. |
| | | 265 | | /// </param> |
| | | 266 | | /// <param name='tag'> |
| | | 267 | | /// Tag for the image. |
| | | 268 | | /// </param> |
| | | 269 | | /// <param name='label'> |
| | | 270 | | /// The image label. |
| | | 271 | | /// </param> |
| | | 272 | | /// <param name='cancellationToken'> |
| | | 273 | | /// The cancellation token. |
| | | 274 | | /// </param> |
| | | 275 | | public static async Task<Image> AddImageFileInputAsync(this IListManagementImage operations, string listId, |
| | | 276 | | { |
| | 0 | 277 | | using (var _result = await operations.AddImageFileInputWithHttpMessagesAsync(listId, imageStream, tag, l |
| | | 278 | | { |
| | 0 | 279 | | return _result.Body; |
| | | 280 | | } |
| | 0 | 281 | | } |
| | | 282 | | |
| | | 283 | | } |
| | | 284 | | } |