< Summary

Class:Azure.AI.FormRecognizer.Models.ModelsSummary
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ModelsSummary.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ModelsSummary.Serialization.cs
Covered lines:20
Uncovered lines:1
Coverable lines:21
Total lines:75
Line coverage:95.2% (20 of 21)
Covered branches:8
Total branches:8
Branch coverage:100% (8 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_Count()-100%100%
get_Limit()-100%100%
get_LastUpdatedDateTime()-0%100%
DeserializeModelsSummary(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ModelsSummary.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.Models
 11{
 12    /// <summary> Summary of all trained custom models. </summary>
 13    internal partial class ModelsSummary
 14    {
 15        /// <summary> Initializes a new instance of ModelsSummary. </summary>
 16        /// <param name="count"> Current count of trained custom models. </param>
 17        /// <param name="limit"> Max number of models that can be trained for this account. </param>
 18        /// <param name="lastUpdatedDateTime"> Date and time (UTC) when the summary was last updated. </param>
 819        internal ModelsSummary(int count, int limit, DateTimeOffset lastUpdatedDateTime)
 20        {
 821            Count = count;
 822            Limit = limit;
 823            LastUpdatedDateTime = lastUpdatedDateTime;
 824        }
 25
 26        /// <summary> Current count of trained custom models. </summary>
 827        public int Count { get; }
 28        /// <summary> Max number of models that can be trained for this account. </summary>
 829        public int Limit { get; }
 30        /// <summary> Date and time (UTC) when the summary was last updated. </summary>
 031        public DateTimeOffset LastUpdatedDateTime { get; }
 32    }
 33}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ModelsSummary.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.Models
 13{
 14    internal partial class ModelsSummary
 15    {
 16        internal static ModelsSummary DeserializeModelsSummary(JsonElement element)
 17        {
 818            int count = default;
 819            int limit = default;
 820            DateTimeOffset lastUpdatedDateTime = default;
 6421            foreach (var property in element.EnumerateObject())
 22            {
 2423                if (property.NameEquals("count"))
 24                {
 825                    count = property.Value.GetInt32();
 826                    continue;
 27                }
 1628                if (property.NameEquals("limit"))
 29                {
 830                    limit = property.Value.GetInt32();
 831                    continue;
 32                }
 833                if (property.NameEquals("lastUpdatedDateTime"))
 34                {
 835                    lastUpdatedDateTime = property.Value.GetDateTimeOffset("O");
 36                    continue;
 37                }
 38            }
 839            return new ModelsSummary(count, limit, lastUpdatedDateTime);
 40        }
 41    }
 42}