< Summary

Class:Azure.AI.FormRecognizer.Training.CustomFormModelInfo
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\CustomFormModelInfo.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CustomFormModelInfo.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CustomFormModelInfo.Serialization.cs
Covered lines:33
Uncovered lines:2
Coverable lines:35
Total lines:119
Line coverage:94.2% (33 of 35)
Covered branches:12
Total branches:14
Branch coverage:85.7% (12 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_ModelId()-100%100%
.ctor(...)-87.5%50%
get_Status()-100%50%
get_TrainingStartedOn()-100%100%
get_TrainingCompletedOn()-100%100%
.ctor(...)-87.5%50%
DeserializeCustomFormModelInfo(...)-100%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using Azure.Core;
 6
 7namespace Azure.AI.FormRecognizer.Training
 8{
 9    /// <summary>
 10    /// Describes a model trained in a Cognitive Services Account and its status.
 11    /// </summary>
 12    [CodeGenModel("ModelInfo")]
 13    public partial class CustomFormModelInfo
 14    {
 15        /// <summary>
 16        /// The unique identifier of the model.
 17        /// </summary>
 24018        public string ModelId { get; }
 19
 20        /// <summary>
 68921        /// The status of the model.
 22        /// </summary>
 281723        public CustomFormModelStatus Status { get; }
 24
 025        /// <summary>
 26        /// The date and time (UTC) when model training was started.
 27        /// </summary>
 68928        [CodeGenMember("CreatedDateTime")]
 84529        public DateTimeOffset TrainingStartedOn { get; }
 68930
 68931        /// <summary>
 68932        /// The date and time (UTC) when model training completed.
 33        /// </summary>
 34        [CodeGenMember("LastUpdatedDateTime")]
 15635        public DateTimeOffset TrainingCompletedOn { get; }
 36    }
 37}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CustomFormModelInfo.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;
 9
 10namespace Azure.AI.FormRecognizer.Training
 11{
 12    /// <summary> Basic custom model information. </summary>
 13    public partial class CustomFormModelInfo
 14    {
 15        /// <summary> Initializes a new instance of CustomFormModelInfo. </summary>
 16        /// <param name="modelId"> Model identifier. </param>
 17        /// <param name="status"> Status of the model. </param>
 18        /// <param name="trainingStartedOn"> Date and time (UTC) when the model was created. </param>
 19        /// <param name="trainingCompletedOn"> Date and time (UTC) when the status was last updated. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="modelId"/> is null. </exception>
 68921        internal CustomFormModelInfo(string modelId, CustomFormModelStatus status, DateTimeOffset trainingStartedOn, Dat
 22        {
 68923            if (modelId == null)
 24            {
 025                throw new ArgumentNullException(nameof(modelId));
 26            }
 27
 68928            ModelId = modelId;
 68929            Status = status;
 68930            TrainingStartedOn = trainingStartedOn;
 68931            TrainingCompletedOn = trainingCompletedOn;
 68932        }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CustomFormModelInfo.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.Core;
 11
 12namespace Azure.AI.FormRecognizer.Training
 13{
 14    public partial class CustomFormModelInfo
 15    {
 16        internal static CustomFormModelInfo DeserializeCustomFormModelInfo(JsonElement element)
 17        {
 137018            string modelId = default;
 137019            CustomFormModelStatus status = default;
 137020            DateTimeOffset createdDateTime = default;
 137021            DateTimeOffset lastUpdatedDateTime = default;
 1368422            foreach (var property in element.EnumerateObject())
 23            {
 547224                if (property.NameEquals("modelId"))
 25                {
 137026                    modelId = property.Value.GetString();
 137027                    continue;
 28                }
 410229                if (property.NameEquals("status"))
 30                {
 137031                    status = property.Value.GetString().ToCustomFormModelStatus();
 137032                    continue;
 33                }
 273234                if (property.NameEquals("createdDateTime"))
 35                {
 136636                    createdDateTime = property.Value.GetDateTimeOffset("O");
 136637                    continue;
 38                }
 136639                if (property.NameEquals("lastUpdatedDateTime"))
 40                {
 136241                    lastUpdatedDateTime = property.Value.GetDateTimeOffset("O");
 42                    continue;
 43                }
 44            }
 137045            return new CustomFormModelInfo(modelId, status, createdDateTime, lastUpdatedDateTime);
 46        }
 47    }
 48}