< Summary

Class:Azure.AI.FormRecognizer.Models.AnalyzeOperationResult
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\AnalyzeOperationResult.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\AnalyzeOperationResult.Serialization.cs
Covered lines:28
Uncovered lines:7
Coverable lines:35
Total lines:103
Line coverage:80% (28 of 35)
Covered branches:12
Total branches:12
Branch coverage:100% (12 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_Status()-100%100%
get_CreatedDateTime()-0%100%
get_LastUpdatedDateTime()-0%100%
get_AnalyzeResult()-100%100%
DeserializeAnalyzeOperationResult(...)-100%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using Azure.AI.FormRecognizer;
 10
 11namespace Azure.AI.FormRecognizer.Models
 12{
 13    /// <summary> Status and result of the queued analyze operation. </summary>
 14    internal partial class AnalyzeOperationResult
 15    {
 16        /// <summary> Initializes a new instance of AnalyzeOperationResult. </summary>
 17        /// <param name="status"> Operation status. </param>
 18        /// <param name="createdDateTime"> Date and time (UTC) when the analyze operation was submitted. </param>
 19        /// <param name="lastUpdatedDateTime"> Date and time (UTC) when the status was last updated. </param>
 020        internal AnalyzeOperationResult(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdat
 21        {
 022            Status = status;
 023            CreatedDateTime = createdDateTime;
 024            LastUpdatedDateTime = lastUpdatedDateTime;
 025        }
 26
 27        /// <summary> Initializes a new instance of AnalyzeOperationResult. </summary>
 28        /// <param name="status"> Operation status. </param>
 29        /// <param name="createdDateTime"> Date and time (UTC) when the analyze operation was submitted. </param>
 30        /// <param name="lastUpdatedDateTime"> Date and time (UTC) when the status was last updated. </param>
 31        /// <param name="analyzeResult"> Results of the analyze operation. </param>
 105832        internal AnalyzeOperationResult(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdat
 33        {
 105834            Status = status;
 105835            CreatedDateTime = createdDateTime;
 105836            LastUpdatedDateTime = lastUpdatedDateTime;
 105837            AnalyzeResult = analyzeResult;
 105838        }
 39
 40        /// <summary> Operation status. </summary>
 196841        public OperationStatus Status { get; }
 42        /// <summary> Date and time (UTC) when the analyze operation was submitted. </summary>
 043        public DateTimeOffset CreatedDateTime { get; }
 44        /// <summary> Date and time (UTC) when the status was last updated. </summary>
 045        public DateTimeOffset LastUpdatedDateTime { get; }
 46        /// <summary> Results of the analyze operation. </summary>
 20047        public AnalyzeResult AnalyzeResult { get; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\AnalyzeOperationResult.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Text.Json;
 10using Azure.AI.FormRecognizer;
 11using Azure.Core;
 12
 13namespace Azure.AI.FormRecognizer.Models
 14{
 15    internal partial class AnalyzeOperationResult
 16    {
 17        internal static AnalyzeOperationResult DeserializeAnalyzeOperationResult(JsonElement element)
 18        {
 105819            OperationStatus status = default;
 105820            DateTimeOffset createdDateTime = default;
 105821            DateTimeOffset lastUpdatedDateTime = default;
 105822            Optional<AnalyzeResult> analyzeResult = default;
 894423            foreach (var property in element.EnumerateObject())
 24            {
 341425                if (property.NameEquals("status"))
 26                {
 104627                    status = property.Value.GetString().ToOperationStatus();
 104628                    continue;
 29                }
 236830                if (property.NameEquals("createdDateTime"))
 31                {
 104632                    createdDateTime = property.Value.GetDateTimeOffset("O");
 104633                    continue;
 34                }
 132235                if (property.NameEquals("lastUpdatedDateTime"))
 36                {
 104637                    lastUpdatedDateTime = property.Value.GetDateTimeOffset("O");
 104638                    continue;
 39                }
 27640                if (property.NameEquals("analyzeResult"))
 41                {
 27642                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 11644                        analyzeResult = null;
 11645                        continue;
 46                    }
 16047                    analyzeResult = AnalyzeResult.DeserializeAnalyzeResult(property.Value);
 48                    continue;
 49                }
 50            }
 105851            return new AnalyzeOperationResult(status, createdDateTime, lastUpdatedDateTime, analyzeResult.Value);
 52        }
 53    }
 54}