< Summary

Class:Azure.AI.FormRecognizer.Models.CopyOperationResult
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyOperationResult.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyOperationResult.Serialization.cs
Covered lines:27
Uncovered lines:5
Coverable lines:32
Total lines:98
Line coverage:84.3% (27 of 32)
Covered branches:10
Total branches:10
Branch coverage:100% (10 of 10)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyOperationResult.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 copy operation. </summary>
 14    internal partial class CopyOperationResult
 15    {
 16        /// <summary> Initializes a new instance of CopyOperationResult. </summary>
 17        /// <param name="status"> Operation status. </param>
 18        /// <param name="createdDateTime"> Date and time (UTC) when the copy operation was submitted. </param>
 19        /// <param name="lastUpdatedDateTime"> Date and time (UTC) when the status was last updated. </param>
 020        internal CopyOperationResult(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedD
 21        {
 022            Status = status;
 023            CreatedDateTime = createdDateTime;
 024            LastUpdatedDateTime = lastUpdatedDateTime;
 025        }
 26
 27        /// <summary> Initializes a new instance of CopyOperationResult. </summary>
 28        /// <param name="status"> Operation status. </param>
 29        /// <param name="createdDateTime"> Date and time (UTC) when the copy operation was submitted. </param>
 30        /// <param name="lastUpdatedDateTime"> Date and time (UTC) when the status was last updated. </param>
 31        /// <param name="copyResult"> Results of the copy operation. </param>
 18632        internal CopyOperationResult(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedD
 33        {
 18634            Status = status;
 18635            CreatedDateTime = createdDateTime;
 18636            LastUpdatedDateTime = lastUpdatedDateTime;
 18637            CopyResult = copyResult;
 18638        }
 39
 40        /// <summary> Operation status. </summary>
 36441        public OperationStatus Status { get; }
 42        /// <summary> Date and time (UTC) when the copy operation was submitted. </summary>
 843        public DateTimeOffset CreatedDateTime { get; }
 44        /// <summary> Date and time (UTC) when the status was last updated. </summary>
 845        public DateTimeOffset LastUpdatedDateTime { get; }
 46        /// <summary> Results of the copy operation. </summary>
 447        public CopyResult CopyResult { get; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyOperationResult.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 CopyOperationResult
 16    {
 17        internal static CopyOperationResult DeserializeCopyOperationResult(JsonElement element)
 18        {
 18619            OperationStatus status = default;
 18620            DateTimeOffset createdDateTime = default;
 18621            DateTimeOffset lastUpdatedDateTime = default;
 18622            Optional<CopyResult> copyResult = default;
 182823            foreach (var property in element.EnumerateObject())
 24            {
 72825                if (property.NameEquals("status"))
 26                {
 18227                    status = property.Value.GetString().ToOperationStatus();
 18228                    continue;
 29                }
 54630                if (property.NameEquals("createdDateTime"))
 31                {
 18232                    createdDateTime = property.Value.GetDateTimeOffset("O");
 18233                    continue;
 34                }
 36435                if (property.NameEquals("lastUpdatedDateTime"))
 36                {
 18237                    lastUpdatedDateTime = property.Value.GetDateTimeOffset("O");
 18238                    continue;
 39                }
 18240                if (property.NameEquals("copyResult"))
 41                {
 18242                    copyResult = CopyResult.DeserializeCopyResult(property.Value);
 43                    continue;
 44                }
 45            }
 18646            return new CopyOperationResult(status, createdDateTime, lastUpdatedDateTime, copyResult.Value);
 47        }
 48    }
 49}