< Summary

Class:Azure.AI.FormRecognizer.OperationExtensions
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\OperationExtensions.cs
Covered lines:0
Uncovered lines:15
Coverable lines:15
Total lines:82
Line coverage:0% (0 of 15)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
WaitForCompletionAsync()-0%100%
WaitForCompletionAsync()-0%100%
WaitForCompletionAsync()-0%100%
WaitForCompletionAsync()-0%100%
WaitForCompletionAsync()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\OperationExtensions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using System.Threading;
 6using System.Threading.Tasks;
 7using Azure.AI.FormRecognizer.Models;
 8using Azure.AI.FormRecognizer.Training;
 9
 10namespace Azure.AI.FormRecognizer
 11{
 12    /// <summary>
 13    /// The set of extension methods for the subclasses of <see cref="Operation{T}" />.
 14    /// </summary>
 15    public static class OperationExtensions
 16    {
 17        /// <summary>
 18        /// Periodically calls the server until the long-running operation completes.
 19        /// </summary>
 20        /// <param name="operation">The instance that this method was invoked on.</param>
 21        /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
 22        /// <returns>A <see cref="Response{T}"/> representing the result of the operation. It can be cast to a <see cref
 23        /// containing the recognized receipts.</returns>
 24        public static async Task<Response<RecognizedFormCollection>> WaitForCompletionAsync(this Task<RecognizeReceiptsO
 25        {
 026            var o = await operation.ConfigureAwait(false);
 027            return await o.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
 028        }
 29
 30        /// <summary>
 31        /// Periodically calls the server until the long-running operation completes.
 32        /// </summary>
 33        /// <param name="operation">The instance that this method was invoked on.</param>
 34        /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
 35        /// <returns>A <see cref="Response{T}"/> representing the result of the operation. It can be cast to a <see cref
 36        /// containing the recognized forms.</returns>
 37        public static async Task<Response<RecognizedFormCollection>> WaitForCompletionAsync(this Task<RecognizeCustomFor
 38        {
 039            var o = await operation.ConfigureAwait(false);
 040            return await o.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
 041        }
 42
 43        /// <summary>
 44        /// Periodically calls the server until the long-running operation completes.
 45        /// </summary>
 46        /// <param name="operation">The instance that this method was invoked on.</param>
 47        /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
 48        /// <returns>A <see cref="Response{T}"/> representing the result of the operation. It can be cast to a <see cref
 49        /// containing the recognized pages.</returns>
 50        public static async Task<Response<FormPageCollection>> WaitForCompletionAsync(this Task<RecognizeContentOperatio
 51        {
 052            var o = await operation.ConfigureAwait(false);
 053            return await o.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
 054        }
 55
 56        /// <summary>
 57        /// Periodically calls the server until the long-running operation completes.
 58        /// </summary>
 59        /// <param name="operation">The instance that this method was invoked on.</param>
 60        /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
 61        /// <returns>A <see cref="Response{T}"/> representing the result of the operation. It can be cast to a <see cref
 62        /// containing meta-data about the trained model.</returns>
 63        public static async Task<Response<CustomFormModel>> WaitForCompletionAsync(this Task<TrainingOperation> operatio
 64        {
 065            var o = await operation.ConfigureAwait(false);
 066            return await o.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
 067        }
 68
 69        /// <summary>
 70        /// Periodically calls the server until the long-running operation completes.
 71        /// </summary>
 72        /// <param name="operation">The instance that this method was invoked on.</param>
 73        /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
 74        /// <returns>A <see cref="Response{T}"/> representing the result of the operation. It can be cast to a <see cref
 75        /// containing meta-data about the trained model.</returns>
 76        public static async Task<Response<CustomFormModelInfo>> WaitForCompletionAsync(this Task<CopyModelOperation> ope
 77        {
 078            var o = await operation.ConfigureAwait(false);
 079            return await o.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
 080        }
 81    }
 82}