< Summary

Class:Azure.ResourceManager.Network.Models.NetworkIntentPolicy
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkIntentPolicy.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkIntentPolicy.Serialization.cs
Covered lines:0
Uncovered lines:67
Coverable lines:67
Total lines:173
Line coverage:0% (0 of 67)
Covered branches:0
Total branches:44
Branch coverage:0% (0 of 44)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeNetworkIntentPolicy(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkIntentPolicy.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Network Intent Policy resource. </summary>
 13    public partial class NetworkIntentPolicy : Resource
 14    {
 15        /// <summary> Initializes a new instance of NetworkIntentPolicy. </summary>
 016        public NetworkIntentPolicy()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of NetworkIntentPolicy. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="location"> Resource location. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 027        internal NetworkIntentPolicy(string id, string name, string type, string location, IDictionary<string, string> t
 28        {
 029            Etag = etag;
 030        }
 31
 32        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 033        public string Etag { get; }
 34    }
 35}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkIntentPolicy.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.Core;
 11
 12namespace Azure.ResourceManager.Network.Models
 13{
 14    public partial class NetworkIntentPolicy : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 024            if (Id != null)
 25            {
 026                writer.WritePropertyName("id");
 027                writer.WriteStringValue(Id);
 28            }
 029            if (Name != null)
 30            {
 031                writer.WritePropertyName("name");
 032                writer.WriteStringValue(Name);
 33            }
 034            if (Type != null)
 35            {
 036                writer.WritePropertyName("type");
 037                writer.WriteStringValue(Type);
 38            }
 039            if (Location != null)
 40            {
 041                writer.WritePropertyName("location");
 042                writer.WriteStringValue(Location);
 43            }
 044            if (Tags != null)
 45            {
 046                writer.WritePropertyName("tags");
 047                writer.WriteStartObject();
 048                foreach (var item in Tags)
 49                {
 050                    writer.WritePropertyName(item.Key);
 051                    writer.WriteStringValue(item.Value);
 52                }
 053                writer.WriteEndObject();
 54            }
 055            writer.WriteEndObject();
 056        }
 57
 58        internal static NetworkIntentPolicy DeserializeNetworkIntentPolicy(JsonElement element)
 59        {
 060            string etag = default;
 061            string id = default;
 062            string name = default;
 063            string type = default;
 064            string location = default;
 065            IDictionary<string, string> tags = default;
 066            foreach (var property in element.EnumerateObject())
 67            {
 068                if (property.NameEquals("etag"))
 69                {
 070                    if (property.Value.ValueKind == JsonValueKind.Null)
 71                    {
 72                        continue;
 73                    }
 074                    etag = property.Value.GetString();
 075                    continue;
 76                }
 077                if (property.NameEquals("id"))
 78                {
 079                    if (property.Value.ValueKind == JsonValueKind.Null)
 80                    {
 81                        continue;
 82                    }
 083                    id = property.Value.GetString();
 084                    continue;
 85                }
 086                if (property.NameEquals("name"))
 87                {
 088                    if (property.Value.ValueKind == JsonValueKind.Null)
 89                    {
 90                        continue;
 91                    }
 092                    name = property.Value.GetString();
 093                    continue;
 94                }
 095                if (property.NameEquals("type"))
 96                {
 097                    if (property.Value.ValueKind == JsonValueKind.Null)
 98                    {
 99                        continue;
 100                    }
 0101                    type = property.Value.GetString();
 0102                    continue;
 103                }
 0104                if (property.NameEquals("location"))
 105                {
 0106                    if (property.Value.ValueKind == JsonValueKind.Null)
 107                    {
 108                        continue;
 109                    }
 0110                    location = property.Value.GetString();
 0111                    continue;
 112                }
 0113                if (property.NameEquals("tags"))
 114                {
 0115                    if (property.Value.ValueKind == JsonValueKind.Null)
 116                    {
 117                        continue;
 118                    }
 0119                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0120                    foreach (var property0 in property.Value.EnumerateObject())
 121                    {
 0122                        if (property0.Value.ValueKind == JsonValueKind.Null)
 123                        {
 0124                            dictionary.Add(property0.Name, null);
 125                        }
 126                        else
 127                        {
 0128                            dictionary.Add(property0.Name, property0.Value.GetString());
 129                        }
 130                    }
 0131                    tags = dictionary;
 132                    continue;
 133                }
 134            }
 0135            return new NetworkIntentPolicy(id, name, type, location, tags, etag);
 136        }
 137    }
 138}