< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_ServiceEndpointPolicyDefinitions()-0%100%
get_Subnets()-0%100%
get_ResourceGuid()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeServiceEndpointPolicy(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceEndpointPolicy.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> Service End point policy resource. </summary>
 13    public partial class ServiceEndpointPolicy : Resource
 14    {
 15        /// <summary> Initializes a new instance of ServiceEndpointPolicy. </summary>
 016        public ServiceEndpointPolicy()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ServiceEndpointPolicy. </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="serviceEndpointPolicyDefinitions"> A collection of service endpoint policy definitions of the s
 28        /// <param name="subnets"> A collection of references to subnets. </param>
 29        /// <param name="resourceGuid"> The resource GUID property of the service endpoint policy resource. </param>
 30        /// <param name="provisioningState"> The provisioning state of the service endpoint policy resource. </param>
 031        internal ServiceEndpointPolicy(string id, string name, string type, string location, IDictionary<string, string>
 32        {
 033            Etag = etag;
 034            ServiceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions;
 035            Subnets = subnets;
 036            ResourceGuid = resourceGuid;
 037            ProvisioningState = provisioningState;
 038        }
 39
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 041        public string Etag { get; }
 42        /// <summary> A collection of service endpoint policy definitions of the service endpoint policy. </summary>
 043        public IList<ServiceEndpointPolicyDefinition> ServiceEndpointPolicyDefinitions { get; set; }
 44        /// <summary> A collection of references to subnets. </summary>
 045        public IList<Subnet> Subnets { get; }
 46        /// <summary> The resource GUID property of the service endpoint policy resource. </summary>
 047        public string ResourceGuid { get; }
 48        /// <summary> The provisioning state of the service endpoint policy resource. </summary>
 049        public ProvisioningState? ProvisioningState { get; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceEndpointPolicy.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 ServiceEndpointPolicy : 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.WritePropertyName("properties");
 056            writer.WriteStartObject();
 057            if (ServiceEndpointPolicyDefinitions != null)
 58            {
 059                writer.WritePropertyName("serviceEndpointPolicyDefinitions");
 060                writer.WriteStartArray();
 061                foreach (var item in ServiceEndpointPolicyDefinitions)
 62                {
 063                    writer.WriteObjectValue(item);
 64                }
 065                writer.WriteEndArray();
 66            }
 067            if (Subnets != null)
 68            {
 069                writer.WritePropertyName("subnets");
 070                writer.WriteStartArray();
 071                foreach (var item in Subnets)
 72                {
 073                    writer.WriteObjectValue(item);
 74                }
 075                writer.WriteEndArray();
 76            }
 077            if (ResourceGuid != null)
 78            {
 079                writer.WritePropertyName("resourceGuid");
 080                writer.WriteStringValue(ResourceGuid);
 81            }
 082            if (ProvisioningState != null)
 83            {
 084                writer.WritePropertyName("provisioningState");
 085                writer.WriteStringValue(ProvisioningState.Value.ToString());
 86            }
 087            writer.WriteEndObject();
 088            writer.WriteEndObject();
 089        }
 90
 91        internal static ServiceEndpointPolicy DeserializeServiceEndpointPolicy(JsonElement element)
 92        {
 093            string etag = default;
 094            string id = default;
 095            string name = default;
 096            string type = default;
 097            string location = default;
 098            IDictionary<string, string> tags = default;
 099            IList<ServiceEndpointPolicyDefinition> serviceEndpointPolicyDefinitions = default;
 0100            IList<Subnet> subnets = default;
 0101            string resourceGuid = default;
 0102            ProvisioningState? provisioningState = default;
 0103            foreach (var property in element.EnumerateObject())
 104            {
 0105                if (property.NameEquals("etag"))
 106                {
 0107                    if (property.Value.ValueKind == JsonValueKind.Null)
 108                    {
 109                        continue;
 110                    }
 0111                    etag = property.Value.GetString();
 0112                    continue;
 113                }
 0114                if (property.NameEquals("id"))
 115                {
 0116                    if (property.Value.ValueKind == JsonValueKind.Null)
 117                    {
 118                        continue;
 119                    }
 0120                    id = property.Value.GetString();
 0121                    continue;
 122                }
 0123                if (property.NameEquals("name"))
 124                {
 0125                    if (property.Value.ValueKind == JsonValueKind.Null)
 126                    {
 127                        continue;
 128                    }
 0129                    name = property.Value.GetString();
 0130                    continue;
 131                }
 0132                if (property.NameEquals("type"))
 133                {
 0134                    if (property.Value.ValueKind == JsonValueKind.Null)
 135                    {
 136                        continue;
 137                    }
 0138                    type = property.Value.GetString();
 0139                    continue;
 140                }
 0141                if (property.NameEquals("location"))
 142                {
 0143                    if (property.Value.ValueKind == JsonValueKind.Null)
 144                    {
 145                        continue;
 146                    }
 0147                    location = property.Value.GetString();
 0148                    continue;
 149                }
 0150                if (property.NameEquals("tags"))
 151                {
 0152                    if (property.Value.ValueKind == JsonValueKind.Null)
 153                    {
 154                        continue;
 155                    }
 0156                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0157                    foreach (var property0 in property.Value.EnumerateObject())
 158                    {
 0159                        if (property0.Value.ValueKind == JsonValueKind.Null)
 160                        {
 0161                            dictionary.Add(property0.Name, null);
 162                        }
 163                        else
 164                        {
 0165                            dictionary.Add(property0.Name, property0.Value.GetString());
 166                        }
 167                    }
 0168                    tags = dictionary;
 0169                    continue;
 170                }
 0171                if (property.NameEquals("properties"))
 172                {
 0173                    foreach (var property0 in property.Value.EnumerateObject())
 174                    {
 0175                        if (property0.NameEquals("serviceEndpointPolicyDefinitions"))
 176                        {
 0177                            if (property0.Value.ValueKind == JsonValueKind.Null)
 178                            {
 179                                continue;
 180                            }
 0181                            List<ServiceEndpointPolicyDefinition> array = new List<ServiceEndpointPolicyDefinition>();
 0182                            foreach (var item in property0.Value.EnumerateArray())
 183                            {
 0184                                if (item.ValueKind == JsonValueKind.Null)
 185                                {
 0186                                    array.Add(null);
 187                                }
 188                                else
 189                                {
 0190                                    array.Add(ServiceEndpointPolicyDefinition.DeserializeServiceEndpointPolicyDefinition
 191                                }
 192                            }
 0193                            serviceEndpointPolicyDefinitions = array;
 0194                            continue;
 195                        }
 0196                        if (property0.NameEquals("subnets"))
 197                        {
 0198                            if (property0.Value.ValueKind == JsonValueKind.Null)
 199                            {
 200                                continue;
 201                            }
 0202                            List<Subnet> array = new List<Subnet>();
 0203                            foreach (var item in property0.Value.EnumerateArray())
 204                            {
 0205                                if (item.ValueKind == JsonValueKind.Null)
 206                                {
 0207                                    array.Add(null);
 208                                }
 209                                else
 210                                {
 0211                                    array.Add(Subnet.DeserializeSubnet(item));
 212                                }
 213                            }
 0214                            subnets = array;
 0215                            continue;
 216                        }
 0217                        if (property0.NameEquals("resourceGuid"))
 218                        {
 0219                            if (property0.Value.ValueKind == JsonValueKind.Null)
 220                            {
 221                                continue;
 222                            }
 0223                            resourceGuid = property0.Value.GetString();
 0224                            continue;
 225                        }
 0226                        if (property0.NameEquals("provisioningState"))
 227                        {
 0228                            if (property0.Value.ValueKind == JsonValueKind.Null)
 229                            {
 230                                continue;
 231                            }
 0232                            provisioningState = new ProvisioningState(property0.Value.GetString());
 233                            continue;
 234                        }
 235                    }
 236                    continue;
 237                }
 238            }
 0239            return new ServiceEndpointPolicy(id, name, type, location, tags, etag, serviceEndpointPolicyDefinitions, sub
 240        }
 241    }
 242}