< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Id()-0%100%
get_Name()-0%100%
get_Type()-0%100%
get_Location()-0%100%
get_Tags()-0%100%
get_Etag()-0%100%
get_ResourceGuid()-0%100%
get_ProvisioningState()-0%100%
get_VirtualNetworks()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDdosProtectionPlan(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DdosProtectionPlan.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> A DDoS protection plan in a resource group. </summary>
 13    public partial class DdosProtectionPlan
 14    {
 15        /// <summary> Initializes a new instance of DdosProtectionPlan. </summary>
 016        public DdosProtectionPlan()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of DdosProtectionPlan. </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>
 27        /// <param name="resourceGuid"> The resource GUID property of the DDoS protection plan resource. It uniquely ide
 28        /// <param name="provisioningState"> The provisioning state of the DDoS protection plan resource. </param>
 29        /// <param name="virtualNetworks"> The list of virtual networks associated with the DDoS protection plan resourc
 030        internal DdosProtectionPlan(string id, string name, string type, string location, IDictionary<string, string> ta
 31        {
 032            Id = id;
 033            Name = name;
 034            Type = type;
 035            Location = location;
 036            Tags = tags;
 037            Etag = etag;
 038            ResourceGuid = resourceGuid;
 039            ProvisioningState = provisioningState;
 040            VirtualNetworks = virtualNetworks;
 041        }
 42
 43        /// <summary> Resource ID. </summary>
 044        public string Id { get; }
 45        /// <summary> Resource name. </summary>
 046        public string Name { get; }
 47        /// <summary> Resource type. </summary>
 048        public string Type { get; }
 49        /// <summary> Resource location. </summary>
 050        public string Location { get; set; }
 51        /// <summary> Resource tags. </summary>
 052        public IDictionary<string, string> Tags { get; set; }
 53        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 054        public string Etag { get; }
 55        /// <summary> The resource GUID property of the DDoS protection plan resource. It uniquely identifies the resour
 056        public string ResourceGuid { get; }
 57        /// <summary> The provisioning state of the DDoS protection plan resource. </summary>
 058        public ProvisioningState? ProvisioningState { get; }
 59        /// <summary> The list of virtual networks associated with the DDoS protection plan resource. This list is read-
 060        public IList<SubResource> VirtualNetworks { get; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DdosProtectionPlan.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 DdosProtectionPlan : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Id != null)
 20            {
 021                writer.WritePropertyName("id");
 022                writer.WriteStringValue(Id);
 23            }
 024            if (Name != null)
 25            {
 026                writer.WritePropertyName("name");
 027                writer.WriteStringValue(Name);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Location != null)
 35            {
 036                writer.WritePropertyName("location");
 037                writer.WriteStringValue(Location);
 38            }
 039            if (Tags != null)
 40            {
 041                writer.WritePropertyName("tags");
 042                writer.WriteStartObject();
 043                foreach (var item in Tags)
 44                {
 045                    writer.WritePropertyName(item.Key);
 046                    writer.WriteStringValue(item.Value);
 47                }
 048                writer.WriteEndObject();
 49            }
 050            if (Etag != null)
 51            {
 052                writer.WritePropertyName("etag");
 053                writer.WriteStringValue(Etag);
 54            }
 055            writer.WritePropertyName("properties");
 056            writer.WriteStartObject();
 057            if (ResourceGuid != null)
 58            {
 059                writer.WritePropertyName("resourceGuid");
 060                writer.WriteStringValue(ResourceGuid);
 61            }
 062            if (ProvisioningState != null)
 63            {
 064                writer.WritePropertyName("provisioningState");
 065                writer.WriteStringValue(ProvisioningState.Value.ToString());
 66            }
 067            if (VirtualNetworks != null)
 68            {
 069                writer.WritePropertyName("virtualNetworks");
 070                writer.WriteStartArray();
 071                foreach (var item in VirtualNetworks)
 72                {
 073                    writer.WriteObjectValue(item);
 74                }
 075                writer.WriteEndArray();
 76            }
 077            writer.WriteEndObject();
 078            writer.WriteEndObject();
 079        }
 80
 81        internal static DdosProtectionPlan DeserializeDdosProtectionPlan(JsonElement element)
 82        {
 083            string id = default;
 084            string name = default;
 085            string type = default;
 086            string location = default;
 087            IDictionary<string, string> tags = default;
 088            string etag = default;
 089            string resourceGuid = default;
 090            ProvisioningState? provisioningState = default;
 091            IList<SubResource> virtualNetworks = default;
 092            foreach (var property in element.EnumerateObject())
 93            {
 094                if (property.NameEquals("id"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    id = property.Value.GetString();
 0101                    continue;
 102                }
 0103                if (property.NameEquals("name"))
 104                {
 0105                    if (property.Value.ValueKind == JsonValueKind.Null)
 106                    {
 107                        continue;
 108                    }
 0109                    name = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("type"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    type = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("location"))
 122                {
 0123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 125                        continue;
 126                    }
 0127                    location = property.Value.GetString();
 0128                    continue;
 129                }
 0130                if (property.NameEquals("tags"))
 131                {
 0132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 0136                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0137                    foreach (var property0 in property.Value.EnumerateObject())
 138                    {
 0139                        if (property0.Value.ValueKind == JsonValueKind.Null)
 140                        {
 0141                            dictionary.Add(property0.Name, null);
 142                        }
 143                        else
 144                        {
 0145                            dictionary.Add(property0.Name, property0.Value.GetString());
 146                        }
 147                    }
 0148                    tags = dictionary;
 0149                    continue;
 150                }
 0151                if (property.NameEquals("etag"))
 152                {
 0153                    if (property.Value.ValueKind == JsonValueKind.Null)
 154                    {
 155                        continue;
 156                    }
 0157                    etag = property.Value.GetString();
 0158                    continue;
 159                }
 0160                if (property.NameEquals("properties"))
 161                {
 0162                    foreach (var property0 in property.Value.EnumerateObject())
 163                    {
 0164                        if (property0.NameEquals("resourceGuid"))
 165                        {
 0166                            if (property0.Value.ValueKind == JsonValueKind.Null)
 167                            {
 168                                continue;
 169                            }
 0170                            resourceGuid = property0.Value.GetString();
 0171                            continue;
 172                        }
 0173                        if (property0.NameEquals("provisioningState"))
 174                        {
 0175                            if (property0.Value.ValueKind == JsonValueKind.Null)
 176                            {
 177                                continue;
 178                            }
 0179                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0180                            continue;
 181                        }
 0182                        if (property0.NameEquals("virtualNetworks"))
 183                        {
 0184                            if (property0.Value.ValueKind == JsonValueKind.Null)
 185                            {
 186                                continue;
 187                            }
 0188                            List<SubResource> array = new List<SubResource>();
 0189                            foreach (var item in property0.Value.EnumerateArray())
 190                            {
 0191                                if (item.ValueKind == JsonValueKind.Null)
 192                                {
 0193                                    array.Add(null);
 194                                }
 195                                else
 196                                {
 0197                                    array.Add(SubResource.DeserializeSubResource(item));
 198                                }
 199                            }
 0200                            virtualNetworks = array;
 201                            continue;
 202                        }
 203                    }
 204                    continue;
 205                }
 206            }
 0207            return new DdosProtectionPlan(id, name, type, location, tags, etag, resourceGuid, provisioningState, virtual
 208        }
 209    }
 210}