| | 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 ImageModeration. |
| | 16 | | /// </summary> |
| | 17 | | public static partial class ImageModerationExtensions |
| | 18 | | { |
| | 19 | | /// <summary> |
| | 20 | | /// Returns the list of faces found. |
| | 21 | | /// </summary> |
| | 22 | | /// <param name='operations'> |
| | 23 | | /// The operations group for this extension method. |
| | 24 | | /// </param> |
| | 25 | | /// <param name='cacheImage'> |
| | 26 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 27 | | /// omitted. |
| | 28 | | /// </param> |
| | 29 | | public static FoundFaces FindFaces(this IImageModeration operations, bool? cacheImage = default(bool?)) |
| | 30 | | { |
| 0 | 31 | | return operations.FindFacesAsync(cacheImage).GetAwaiter().GetResult(); |
| | 32 | | } |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Returns the list of faces found. |
| | 36 | | /// </summary> |
| | 37 | | /// <param name='operations'> |
| | 38 | | /// The operations group for this extension method. |
| | 39 | | /// </param> |
| | 40 | | /// <param name='cacheImage'> |
| | 41 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 42 | | /// omitted. |
| | 43 | | /// </param> |
| | 44 | | /// <param name='cancellationToken'> |
| | 45 | | /// The cancellation token. |
| | 46 | | /// </param> |
| | 47 | | public static async Task<FoundFaces> FindFacesAsync(this IImageModeration operations, bool? cacheImage = def |
| | 48 | | { |
| 0 | 49 | | using (var _result = await operations.FindFacesWithHttpMessagesAsync(cacheImage, null, cancellationToken |
| | 50 | | { |
| 0 | 51 | | return _result.Body; |
| | 52 | | } |
| 0 | 53 | | } |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// Returns any text found in the image for the language specified. If no |
| | 57 | | /// language is specified in input then the detection defaults to English. |
| | 58 | | /// </summary> |
| | 59 | | /// <param name='operations'> |
| | 60 | | /// The operations group for this extension method. |
| | 61 | | /// </param> |
| | 62 | | /// <param name='language'> |
| | 63 | | /// Language of the terms. |
| | 64 | | /// </param> |
| | 65 | | /// <param name='cacheImage'> |
| | 66 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 67 | | /// omitted. |
| | 68 | | /// </param> |
| | 69 | | /// <param name='enhanced'> |
| | 70 | | /// When set to True, the image goes through additional processing to come with |
| | 71 | | /// additional candidates. |
| | 72 | | /// |
| | 73 | | /// image/tiff is not supported when enhanced is set to true |
| | 74 | | /// |
| | 75 | | /// Note: This impacts the response time. |
| | 76 | | /// </param> |
| | 77 | | public static OCR OCRMethod(this IImageModeration operations, string language, bool? cacheImage = default(bo |
| | 78 | | { |
| 0 | 79 | | return operations.OCRMethodAsync(language, cacheImage, enhanced).GetAwaiter().GetResult(); |
| | 80 | | } |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Returns any text found in the image for the language specified. If no |
| | 84 | | /// language is specified in input then the detection defaults to English. |
| | 85 | | /// </summary> |
| | 86 | | /// <param name='operations'> |
| | 87 | | /// The operations group for this extension method. |
| | 88 | | /// </param> |
| | 89 | | /// <param name='language'> |
| | 90 | | /// Language of the terms. |
| | 91 | | /// </param> |
| | 92 | | /// <param name='cacheImage'> |
| | 93 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 94 | | /// omitted. |
| | 95 | | /// </param> |
| | 96 | | /// <param name='enhanced'> |
| | 97 | | /// When set to True, the image goes through additional processing to come with |
| | 98 | | /// additional candidates. |
| | 99 | | /// |
| | 100 | | /// image/tiff is not supported when enhanced is set to true |
| | 101 | | /// |
| | 102 | | /// Note: This impacts the response time. |
| | 103 | | /// </param> |
| | 104 | | /// <param name='cancellationToken'> |
| | 105 | | /// The cancellation token. |
| | 106 | | /// </param> |
| | 107 | | public static async Task<OCR> OCRMethodAsync(this IImageModeration operations, string language, bool? cacheI |
| | 108 | | { |
| 0 | 109 | | using (var _result = await operations.OCRMethodWithHttpMessagesAsync(language, cacheImage, enhanced, nul |
| | 110 | | { |
| 0 | 111 | | return _result.Body; |
| | 112 | | } |
| 0 | 113 | | } |
| | 114 | |
|
| | 115 | | /// <summary> |
| | 116 | | /// Returns probabilities of the image containing racy or adult content. |
| | 117 | | /// </summary> |
| | 118 | | /// <param name='operations'> |
| | 119 | | /// The operations group for this extension method. |
| | 120 | | /// </param> |
| | 121 | | /// <param name='cacheImage'> |
| | 122 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 123 | | /// omitted. |
| | 124 | | /// </param> |
| | 125 | | public static Evaluate EvaluateMethod(this IImageModeration operations, bool? cacheImage = default(bool?)) |
| | 126 | | { |
| 0 | 127 | | return operations.EvaluateMethodAsync(cacheImage).GetAwaiter().GetResult(); |
| | 128 | | } |
| | 129 | |
|
| | 130 | | /// <summary> |
| | 131 | | /// Returns probabilities of the image containing racy or adult content. |
| | 132 | | /// </summary> |
| | 133 | | /// <param name='operations'> |
| | 134 | | /// The operations group for this extension method. |
| | 135 | | /// </param> |
| | 136 | | /// <param name='cacheImage'> |
| | 137 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 138 | | /// omitted. |
| | 139 | | /// </param> |
| | 140 | | /// <param name='cancellationToken'> |
| | 141 | | /// The cancellation token. |
| | 142 | | /// </param> |
| | 143 | | public static async Task<Evaluate> EvaluateMethodAsync(this IImageModeration operations, bool? cacheImage = |
| | 144 | | { |
| 0 | 145 | | using (var _result = await operations.EvaluateMethodWithHttpMessagesAsync(cacheImage, null, cancellation |
| | 146 | | { |
| 0 | 147 | | return _result.Body; |
| | 148 | | } |
| 0 | 149 | | } |
| | 150 | |
|
| | 151 | | /// <summary> |
| | 152 | | /// Fuzzily match an image against one of your custom Image Lists. You can |
| | 153 | | /// create and manage your custom image lists using <a |
| | 154 | | /// href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> |
| | 155 | | /// API. |
| | 156 | | /// |
| | 157 | | /// Returns ID and tags of matching image.<br/> |
| | 158 | | /// <br/> |
| | 159 | | /// Note: Refresh Index must be run on the corresponding Image List before |
| | 160 | | /// additions and removals are reflected in the response. |
| | 161 | | /// </summary> |
| | 162 | | /// <param name='operations'> |
| | 163 | | /// The operations group for this extension method. |
| | 164 | | /// </param> |
| | 165 | | /// <param name='listId'> |
| | 166 | | /// The list Id. |
| | 167 | | /// </param> |
| | 168 | | /// <param name='cacheImage'> |
| | 169 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 170 | | /// omitted. |
| | 171 | | /// </param> |
| | 172 | | public static MatchResponse MatchMethod(this IImageModeration operations, string listId = default(string), b |
| | 173 | | { |
| 0 | 174 | | return operations.MatchMethodAsync(listId, cacheImage).GetAwaiter().GetResult(); |
| | 175 | | } |
| | 176 | |
|
| | 177 | | /// <summary> |
| | 178 | | /// Fuzzily match an image against one of your custom Image Lists. You can |
| | 179 | | /// create and manage your custom image lists using <a |
| | 180 | | /// href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> |
| | 181 | | /// API. |
| | 182 | | /// |
| | 183 | | /// Returns ID and tags of matching image.<br/> |
| | 184 | | /// <br/> |
| | 185 | | /// Note: Refresh Index must be run on the corresponding Image List before |
| | 186 | | /// additions and removals are reflected in the response. |
| | 187 | | /// </summary> |
| | 188 | | /// <param name='operations'> |
| | 189 | | /// The operations group for this extension method. |
| | 190 | | /// </param> |
| | 191 | | /// <param name='listId'> |
| | 192 | | /// The list Id. |
| | 193 | | /// </param> |
| | 194 | | /// <param name='cacheImage'> |
| | 195 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 196 | | /// omitted. |
| | 197 | | /// </param> |
| | 198 | | /// <param name='cancellationToken'> |
| | 199 | | /// The cancellation token. |
| | 200 | | /// </param> |
| | 201 | | public static async Task<MatchResponse> MatchMethodAsync(this IImageModeration operations, string listId = d |
| | 202 | | { |
| 0 | 203 | | using (var _result = await operations.MatchMethodWithHttpMessagesAsync(listId, cacheImage, null, cancell |
| | 204 | | { |
| 0 | 205 | | return _result.Body; |
| | 206 | | } |
| 0 | 207 | | } |
| | 208 | |
|
| | 209 | | /// <summary> |
| | 210 | | /// Returns the list of faces found. |
| | 211 | | /// </summary> |
| | 212 | | /// <param name='operations'> |
| | 213 | | /// The operations group for this extension method. |
| | 214 | | /// </param> |
| | 215 | | /// <param name='imageStream'> |
| | 216 | | /// The image file. |
| | 217 | | /// </param> |
| | 218 | | /// <param name='cacheImage'> |
| | 219 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 220 | | /// omitted. |
| | 221 | | /// </param> |
| | 222 | | public static FoundFaces FindFacesFileInput(this IImageModeration operations, Stream imageStream, bool? cach |
| | 223 | | { |
| 0 | 224 | | return operations.FindFacesFileInputAsync(imageStream, cacheImage).GetAwaiter().GetResult(); |
| | 225 | | } |
| | 226 | |
|
| | 227 | | /// <summary> |
| | 228 | | /// Returns the list of faces found. |
| | 229 | | /// </summary> |
| | 230 | | /// <param name='operations'> |
| | 231 | | /// The operations group for this extension method. |
| | 232 | | /// </param> |
| | 233 | | /// <param name='imageStream'> |
| | 234 | | /// The image file. |
| | 235 | | /// </param> |
| | 236 | | /// <param name='cacheImage'> |
| | 237 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 238 | | /// omitted. |
| | 239 | | /// </param> |
| | 240 | | /// <param name='cancellationToken'> |
| | 241 | | /// The cancellation token. |
| | 242 | | /// </param> |
| | 243 | | public static async Task<FoundFaces> FindFacesFileInputAsync(this IImageModeration operations, Stream imageS |
| | 244 | | { |
| 0 | 245 | | using (var _result = await operations.FindFacesFileInputWithHttpMessagesAsync(imageStream, cacheImage, n |
| | 246 | | { |
| 0 | 247 | | return _result.Body; |
| | 248 | | } |
| 0 | 249 | | } |
| | 250 | |
|
| | 251 | | /// <summary> |
| | 252 | | /// Returns the list of faces found. |
| | 253 | | /// </summary> |
| | 254 | | /// <param name='operations'> |
| | 255 | | /// The operations group for this extension method. |
| | 256 | | /// </param> |
| | 257 | | /// <param name='contentType'> |
| | 258 | | /// The content type. |
| | 259 | | /// </param> |
| | 260 | | /// <param name='imageUrl'> |
| | 261 | | /// The image url. |
| | 262 | | /// </param> |
| | 263 | | /// <param name='cacheImage'> |
| | 264 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 265 | | /// omitted. |
| | 266 | | /// </param> |
| | 267 | | public static FoundFaces FindFacesUrlInput(this IImageModeration operations, string contentType, BodyModel i |
| | 268 | | { |
| 0 | 269 | | return operations.FindFacesUrlInputAsync(contentType, imageUrl, cacheImage).GetAwaiter().GetResult(); |
| | 270 | | } |
| | 271 | |
|
| | 272 | | /// <summary> |
| | 273 | | /// Returns the list of faces found. |
| | 274 | | /// </summary> |
| | 275 | | /// <param name='operations'> |
| | 276 | | /// The operations group for this extension method. |
| | 277 | | /// </param> |
| | 278 | | /// <param name='contentType'> |
| | 279 | | /// The content type. |
| | 280 | | /// </param> |
| | 281 | | /// <param name='imageUrl'> |
| | 282 | | /// The image url. |
| | 283 | | /// </param> |
| | 284 | | /// <param name='cacheImage'> |
| | 285 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 286 | | /// omitted. |
| | 287 | | /// </param> |
| | 288 | | /// <param name='cancellationToken'> |
| | 289 | | /// The cancellation token. |
| | 290 | | /// </param> |
| | 291 | | public static async Task<FoundFaces> FindFacesUrlInputAsync(this IImageModeration operations, string content |
| | 292 | | { |
| 0 | 293 | | using (var _result = await operations.FindFacesUrlInputWithHttpMessagesAsync(contentType, imageUrl, cach |
| | 294 | | { |
| 0 | 295 | | return _result.Body; |
| | 296 | | } |
| 0 | 297 | | } |
| | 298 | |
|
| | 299 | | /// <summary> |
| | 300 | | /// Returns any text found in the image for the language specified. If no |
| | 301 | | /// language is specified in input then the detection defaults to English. |
| | 302 | | /// </summary> |
| | 303 | | /// <param name='operations'> |
| | 304 | | /// The operations group for this extension method. |
| | 305 | | /// </param> |
| | 306 | | /// <param name='language'> |
| | 307 | | /// Language of the terms. |
| | 308 | | /// </param> |
| | 309 | | /// <param name='contentType'> |
| | 310 | | /// The content type. |
| | 311 | | /// </param> |
| | 312 | | /// <param name='imageUrl'> |
| | 313 | | /// The image url. |
| | 314 | | /// </param> |
| | 315 | | /// <param name='cacheImage'> |
| | 316 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 317 | | /// omitted. |
| | 318 | | /// </param> |
| | 319 | | /// <param name='enhanced'> |
| | 320 | | /// When set to True, the image goes through additional processing to come with |
| | 321 | | /// additional candidates. |
| | 322 | | /// |
| | 323 | | /// image/tiff is not supported when enhanced is set to true |
| | 324 | | /// |
| | 325 | | /// Note: This impacts the response time. |
| | 326 | | /// </param> |
| | 327 | | public static OCR OCRUrlInput(this IImageModeration operations, string language, string contentType, BodyMod |
| | 328 | | { |
| 0 | 329 | | return operations.OCRUrlInputAsync(language, contentType, imageUrl, cacheImage, enhanced).GetAwaiter().G |
| | 330 | | } |
| | 331 | |
|
| | 332 | | /// <summary> |
| | 333 | | /// Returns any text found in the image for the language specified. If no |
| | 334 | | /// language is specified in input then the detection defaults to English. |
| | 335 | | /// </summary> |
| | 336 | | /// <param name='operations'> |
| | 337 | | /// The operations group for this extension method. |
| | 338 | | /// </param> |
| | 339 | | /// <param name='language'> |
| | 340 | | /// Language of the terms. |
| | 341 | | /// </param> |
| | 342 | | /// <param name='contentType'> |
| | 343 | | /// The content type. |
| | 344 | | /// </param> |
| | 345 | | /// <param name='imageUrl'> |
| | 346 | | /// The image url. |
| | 347 | | /// </param> |
| | 348 | | /// <param name='cacheImage'> |
| | 349 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 350 | | /// omitted. |
| | 351 | | /// </param> |
| | 352 | | /// <param name='enhanced'> |
| | 353 | | /// When set to True, the image goes through additional processing to come with |
| | 354 | | /// additional candidates. |
| | 355 | | /// |
| | 356 | | /// image/tiff is not supported when enhanced is set to true |
| | 357 | | /// |
| | 358 | | /// Note: This impacts the response time. |
| | 359 | | /// </param> |
| | 360 | | /// <param name='cancellationToken'> |
| | 361 | | /// The cancellation token. |
| | 362 | | /// </param> |
| | 363 | | public static async Task<OCR> OCRUrlInputAsync(this IImageModeration operations, string language, string con |
| | 364 | | { |
| 0 | 365 | | using (var _result = await operations.OCRUrlInputWithHttpMessagesAsync(language, contentType, imageUrl, |
| | 366 | | { |
| 0 | 367 | | return _result.Body; |
| | 368 | | } |
| 0 | 369 | | } |
| | 370 | |
|
| | 371 | | /// <summary> |
| | 372 | | /// Returns any text found in the image for the language specified. If no |
| | 373 | | /// language is specified in input then the detection defaults to English. |
| | 374 | | /// </summary> |
| | 375 | | /// <param name='operations'> |
| | 376 | | /// The operations group for this extension method. |
| | 377 | | /// </param> |
| | 378 | | /// <param name='language'> |
| | 379 | | /// Language of the terms. |
| | 380 | | /// </param> |
| | 381 | | /// <param name='imageStream'> |
| | 382 | | /// The image file. |
| | 383 | | /// </param> |
| | 384 | | /// <param name='cacheImage'> |
| | 385 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 386 | | /// omitted. |
| | 387 | | /// </param> |
| | 388 | | /// <param name='enhanced'> |
| | 389 | | /// When set to True, the image goes through additional processing to come with |
| | 390 | | /// additional candidates. |
| | 391 | | /// |
| | 392 | | /// image/tiff is not supported when enhanced is set to true |
| | 393 | | /// |
| | 394 | | /// Note: This impacts the response time. |
| | 395 | | /// </param> |
| | 396 | | public static OCR OCRFileInput(this IImageModeration operations, string language, Stream imageStream, bool? |
| | 397 | | { |
| 0 | 398 | | return operations.OCRFileInputAsync(language, imageStream, cacheImage, enhanced).GetAwaiter().GetResult( |
| | 399 | | } |
| | 400 | |
|
| | 401 | | /// <summary> |
| | 402 | | /// Returns any text found in the image for the language specified. If no |
| | 403 | | /// language is specified in input then the detection defaults to English. |
| | 404 | | /// </summary> |
| | 405 | | /// <param name='operations'> |
| | 406 | | /// The operations group for this extension method. |
| | 407 | | /// </param> |
| | 408 | | /// <param name='language'> |
| | 409 | | /// Language of the terms. |
| | 410 | | /// </param> |
| | 411 | | /// <param name='imageStream'> |
| | 412 | | /// The image file. |
| | 413 | | /// </param> |
| | 414 | | /// <param name='cacheImage'> |
| | 415 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 416 | | /// omitted. |
| | 417 | | /// </param> |
| | 418 | | /// <param name='enhanced'> |
| | 419 | | /// When set to True, the image goes through additional processing to come with |
| | 420 | | /// additional candidates. |
| | 421 | | /// |
| | 422 | | /// image/tiff is not supported when enhanced is set to true |
| | 423 | | /// |
| | 424 | | /// Note: This impacts the response time. |
| | 425 | | /// </param> |
| | 426 | | /// <param name='cancellationToken'> |
| | 427 | | /// The cancellation token. |
| | 428 | | /// </param> |
| | 429 | | public static async Task<OCR> OCRFileInputAsync(this IImageModeration operations, string language, Stream im |
| | 430 | | { |
| 0 | 431 | | using (var _result = await operations.OCRFileInputWithHttpMessagesAsync(language, imageStream, cacheImag |
| | 432 | | { |
| 0 | 433 | | return _result.Body; |
| | 434 | | } |
| 0 | 435 | | } |
| | 436 | |
|
| | 437 | | /// <summary> |
| | 438 | | /// Returns probabilities of the image containing racy or adult content. |
| | 439 | | /// </summary> |
| | 440 | | /// <param name='operations'> |
| | 441 | | /// The operations group for this extension method. |
| | 442 | | /// </param> |
| | 443 | | /// <param name='imageStream'> |
| | 444 | | /// The image file. |
| | 445 | | /// </param> |
| | 446 | | /// <param name='cacheImage'> |
| | 447 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 448 | | /// omitted. |
| | 449 | | /// </param> |
| | 450 | | public static Evaluate EvaluateFileInput(this IImageModeration operations, Stream imageStream, bool? cacheIm |
| | 451 | | { |
| 0 | 452 | | return operations.EvaluateFileInputAsync(imageStream, cacheImage).GetAwaiter().GetResult(); |
| | 453 | | } |
| | 454 | |
|
| | 455 | | /// <summary> |
| | 456 | | /// Returns probabilities of the image containing racy or adult content. |
| | 457 | | /// </summary> |
| | 458 | | /// <param name='operations'> |
| | 459 | | /// The operations group for this extension method. |
| | 460 | | /// </param> |
| | 461 | | /// <param name='imageStream'> |
| | 462 | | /// The image file. |
| | 463 | | /// </param> |
| | 464 | | /// <param name='cacheImage'> |
| | 465 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 466 | | /// omitted. |
| | 467 | | /// </param> |
| | 468 | | /// <param name='cancellationToken'> |
| | 469 | | /// The cancellation token. |
| | 470 | | /// </param> |
| | 471 | | public static async Task<Evaluate> EvaluateFileInputAsync(this IImageModeration operations, Stream imageStre |
| | 472 | | { |
| 0 | 473 | | using (var _result = await operations.EvaluateFileInputWithHttpMessagesAsync(imageStream, cacheImage, nu |
| | 474 | | { |
| 0 | 475 | | return _result.Body; |
| | 476 | | } |
| 0 | 477 | | } |
| | 478 | |
|
| | 479 | | /// <summary> |
| | 480 | | /// Returns probabilities of the image containing racy or adult content. |
| | 481 | | /// </summary> |
| | 482 | | /// <param name='operations'> |
| | 483 | | /// The operations group for this extension method. |
| | 484 | | /// </param> |
| | 485 | | /// <param name='contentType'> |
| | 486 | | /// The content type. |
| | 487 | | /// </param> |
| | 488 | | /// <param name='imageUrl'> |
| | 489 | | /// The image url. |
| | 490 | | /// </param> |
| | 491 | | /// <param name='cacheImage'> |
| | 492 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 493 | | /// omitted. |
| | 494 | | /// </param> |
| | 495 | | public static Evaluate EvaluateUrlInput(this IImageModeration operations, string contentType, BodyModel imag |
| | 496 | | { |
| 0 | 497 | | return operations.EvaluateUrlInputAsync(contentType, imageUrl, cacheImage).GetAwaiter().GetResult(); |
| | 498 | | } |
| | 499 | |
|
| | 500 | | /// <summary> |
| | 501 | | /// Returns probabilities of the image containing racy or adult content. |
| | 502 | | /// </summary> |
| | 503 | | /// <param name='operations'> |
| | 504 | | /// The operations group for this extension method. |
| | 505 | | /// </param> |
| | 506 | | /// <param name='contentType'> |
| | 507 | | /// The content type. |
| | 508 | | /// </param> |
| | 509 | | /// <param name='imageUrl'> |
| | 510 | | /// The image url. |
| | 511 | | /// </param> |
| | 512 | | /// <param name='cacheImage'> |
| | 513 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 514 | | /// omitted. |
| | 515 | | /// </param> |
| | 516 | | /// <param name='cancellationToken'> |
| | 517 | | /// The cancellation token. |
| | 518 | | /// </param> |
| | 519 | | public static async Task<Evaluate> EvaluateUrlInputAsync(this IImageModeration operations, string contentTyp |
| | 520 | | { |
| 0 | 521 | | using (var _result = await operations.EvaluateUrlInputWithHttpMessagesAsync(contentType, imageUrl, cache |
| | 522 | | { |
| 0 | 523 | | return _result.Body; |
| | 524 | | } |
| 0 | 525 | | } |
| | 526 | |
|
| | 527 | | /// <summary> |
| | 528 | | /// Fuzzily match an image against one of your custom Image Lists. You can |
| | 529 | | /// create and manage your custom image lists using <a |
| | 530 | | /// href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> |
| | 531 | | /// API. |
| | 532 | | /// |
| | 533 | | /// Returns ID and tags of matching image.<br/> |
| | 534 | | /// <br/> |
| | 535 | | /// Note: Refresh Index must be run on the corresponding Image List before |
| | 536 | | /// additions and removals are reflected in the response. |
| | 537 | | /// </summary> |
| | 538 | | /// <param name='operations'> |
| | 539 | | /// The operations group for this extension method. |
| | 540 | | /// </param> |
| | 541 | | /// <param name='contentType'> |
| | 542 | | /// The content type. |
| | 543 | | /// </param> |
| | 544 | | /// <param name='imageUrl'> |
| | 545 | | /// The image url. |
| | 546 | | /// </param> |
| | 547 | | /// <param name='listId'> |
| | 548 | | /// The list Id. |
| | 549 | | /// </param> |
| | 550 | | /// <param name='cacheImage'> |
| | 551 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 552 | | /// omitted. |
| | 553 | | /// </param> |
| | 554 | | public static MatchResponse MatchUrlInput(this IImageModeration operations, string contentType, BodyModel im |
| | 555 | | { |
| 0 | 556 | | return operations.MatchUrlInputAsync(contentType, imageUrl, listId, cacheImage).GetAwaiter().GetResult() |
| | 557 | | } |
| | 558 | |
|
| | 559 | | /// <summary> |
| | 560 | | /// Fuzzily match an image against one of your custom Image Lists. You can |
| | 561 | | /// create and manage your custom image lists using <a |
| | 562 | | /// href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> |
| | 563 | | /// API. |
| | 564 | | /// |
| | 565 | | /// Returns ID and tags of matching image.<br/> |
| | 566 | | /// <br/> |
| | 567 | | /// Note: Refresh Index must be run on the corresponding Image List before |
| | 568 | | /// additions and removals are reflected in the response. |
| | 569 | | /// </summary> |
| | 570 | | /// <param name='operations'> |
| | 571 | | /// The operations group for this extension method. |
| | 572 | | /// </param> |
| | 573 | | /// <param name='contentType'> |
| | 574 | | /// The content type. |
| | 575 | | /// </param> |
| | 576 | | /// <param name='imageUrl'> |
| | 577 | | /// The image url. |
| | 578 | | /// </param> |
| | 579 | | /// <param name='listId'> |
| | 580 | | /// The list Id. |
| | 581 | | /// </param> |
| | 582 | | /// <param name='cacheImage'> |
| | 583 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 584 | | /// omitted. |
| | 585 | | /// </param> |
| | 586 | | /// <param name='cancellationToken'> |
| | 587 | | /// The cancellation token. |
| | 588 | | /// </param> |
| | 589 | | public static async Task<MatchResponse> MatchUrlInputAsync(this IImageModeration operations, string contentT |
| | 590 | | { |
| 0 | 591 | | using (var _result = await operations.MatchUrlInputWithHttpMessagesAsync(contentType, imageUrl, listId, |
| | 592 | | { |
| 0 | 593 | | return _result.Body; |
| | 594 | | } |
| 0 | 595 | | } |
| | 596 | |
|
| | 597 | | /// <summary> |
| | 598 | | /// Fuzzily match an image against one of your custom Image Lists. You can |
| | 599 | | /// create and manage your custom image lists using <a |
| | 600 | | /// href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> |
| | 601 | | /// API. |
| | 602 | | /// |
| | 603 | | /// Returns ID and tags of matching image.<br/> |
| | 604 | | /// <br/> |
| | 605 | | /// Note: Refresh Index must be run on the corresponding Image List before |
| | 606 | | /// additions and removals are reflected in the response. |
| | 607 | | /// </summary> |
| | 608 | | /// <param name='operations'> |
| | 609 | | /// The operations group for this extension method. |
| | 610 | | /// </param> |
| | 611 | | /// <param name='imageStream'> |
| | 612 | | /// The image file. |
| | 613 | | /// </param> |
| | 614 | | /// <param name='listId'> |
| | 615 | | /// The list Id. |
| | 616 | | /// </param> |
| | 617 | | /// <param name='cacheImage'> |
| | 618 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 619 | | /// omitted. |
| | 620 | | /// </param> |
| | 621 | | public static MatchResponse MatchFileInput(this IImageModeration operations, Stream imageStream, string list |
| | 622 | | { |
| 0 | 623 | | return operations.MatchFileInputAsync(imageStream, listId, cacheImage).GetAwaiter().GetResult(); |
| | 624 | | } |
| | 625 | |
|
| | 626 | | /// <summary> |
| | 627 | | /// Fuzzily match an image against one of your custom Image Lists. You can |
| | 628 | | /// create and manage your custom image lists using <a |
| | 629 | | /// href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> |
| | 630 | | /// API. |
| | 631 | | /// |
| | 632 | | /// Returns ID and tags of matching image.<br/> |
| | 633 | | /// <br/> |
| | 634 | | /// Note: Refresh Index must be run on the corresponding Image List before |
| | 635 | | /// additions and removals are reflected in the response. |
| | 636 | | /// </summary> |
| | 637 | | /// <param name='operations'> |
| | 638 | | /// The operations group for this extension method. |
| | 639 | | /// </param> |
| | 640 | | /// <param name='imageStream'> |
| | 641 | | /// The image file. |
| | 642 | | /// </param> |
| | 643 | | /// <param name='listId'> |
| | 644 | | /// The list Id. |
| | 645 | | /// </param> |
| | 646 | | /// <param name='cacheImage'> |
| | 647 | | /// Whether to retain the submitted image for future use; defaults to false if |
| | 648 | | /// omitted. |
| | 649 | | /// </param> |
| | 650 | | /// <param name='cancellationToken'> |
| | 651 | | /// The cancellation token. |
| | 652 | | /// </param> |
| | 653 | | public static async Task<MatchResponse> MatchFileInputAsync(this IImageModeration operations, Stream imageSt |
| | 654 | | { |
| 0 | 655 | | using (var _result = await operations.MatchFileInputWithHttpMessagesAsync(imageStream, listId, cacheImag |
| | 656 | | { |
| 0 | 657 | | return _result.Body; |
| | 658 | | } |
| 0 | 659 | | } |
| | 660 | |
|
| | 661 | | } |
| | 662 | | } |