< Summary

Class:Azure.AI.FormRecognizer.Models.Models
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\Models.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\Models.Serialization.cs
Covered lines:24
Uncovered lines:3
Coverable lines:27
Total lines:89
Line coverage:88.8% (24 of 27)
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_Summary()-100%100%
get_ModelList()-100%100%
get_NextLink()-100%100%
DeserializeModels(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\Models.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.Collections.Generic;
 9using Azure.AI.FormRecognizer.Training;
 10using Azure.Core;
 11
 12namespace Azure.AI.FormRecognizer.Models
 13{
 14    /// <summary> Response to the list custom models operation. </summary>
 15    internal partial class Models
 16    {
 17        /// <summary> Initializes a new instance of Models. </summary>
 018        internal Models()
 19        {
 020            ModelList = new ChangeTrackingList<CustomFormModelInfo>();
 021        }
 22
 23        /// <summary> Initializes a new instance of Models. </summary>
 24        /// <param name="summary"> Summary of all trained custom models. </param>
 25        /// <param name="modelList"> Collection of trained custom models. </param>
 26        /// <param name="nextLink"> Link to the next page of custom models. </param>
 2027        internal Models(ModelsSummary summary, IReadOnlyList<CustomFormModelInfo> modelList, string nextLink)
 28        {
 2029            Summary = summary;
 2030            ModelList = modelList;
 2031            NextLink = nextLink;
 2032        }
 33
 34        /// <summary> Summary of all trained custom models. </summary>
 835        public ModelsSummary Summary { get; }
 36        /// <summary> Collection of trained custom models. </summary>
 1237        public IReadOnlyList<CustomFormModelInfo> ModelList { get; }
 38        /// <summary> Link to the next page of custom models. </summary>
 1239        public string NextLink { get; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\Models.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.AI.FormRecognizer.Training;
 11using Azure.Core;
 12
 13namespace Azure.AI.FormRecognizer.Models
 14{
 15    internal partial class Models
 16    {
 17        internal static Models DeserializeModels(JsonElement element)
 18        {
 2019            Optional<ModelsSummary> summary = default;
 2020            Optional<IReadOnlyList<CustomFormModelInfo>> modelList = default;
 2021            Optional<string> nextLink = default;
 10422            foreach (var property in element.EnumerateObject())
 23            {
 3224                if (property.NameEquals("summary"))
 25                {
 826                    summary = ModelsSummary.DeserializeModelsSummary(property.Value);
 827                    continue;
 28                }
 2429                if (property.NameEquals("modelList"))
 30                {
 1231                    List<CustomFormModelInfo> array = new List<CustomFormModelInfo>();
 63232                    foreach (var item in property.Value.EnumerateArray())
 33                    {
 30434                        array.Add(CustomFormModelInfo.DeserializeCustomFormModelInfo(item));
 35                    }
 1236                    modelList = array;
 1237                    continue;
 38                }
 1239                if (property.NameEquals("nextLink"))
 40                {
 1241                    nextLink = property.Value.GetString();
 42                    continue;
 43                }
 44            }
 2045            return new Models(summary.Value, Optional.ToList(modelList), nextLink.Value);
 46        }
 47    }
 48}