< Summary

Class:Azure.ResourceManager.Network.Models.BGPCommunity
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BGPCommunity.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BGPCommunity.Serialization.cs
Covered lines:44
Uncovered lines:32
Coverable lines:76
Total lines:187
Line coverage:57.8% (44 of 76)
Covered branches:29
Total branches:44
Branch coverage:65.9% (29 of 44)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ServiceSupportedRegion()-0%100%
get_CommunityName()-0%100%
get_CommunityValue()-0%100%
get_CommunityPrefixes()-0%100%
get_IsAuthorizedToUse()-100%100%
get_ServiceGroup()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeBGPCommunity(...)-97.22%96.67%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BGPCommunity.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> Contains bgp community information offered in Service Community resources. </summary>
 13    public partial class BGPCommunity
 14    {
 15        /// <summary> Initializes a new instance of BGPCommunity. </summary>
 016        public BGPCommunity()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of BGPCommunity. </summary>
 21        /// <param name="serviceSupportedRegion"> The region which the service support. e.g. For O365, region is Global.
 22        /// <param name="communityName"> The name of the bgp community. e.g. Skype. </param>
 23        /// <param name="communityValue"> The value of the bgp community. For more information: https://docs.microsoft.c
 24        /// <param name="communityPrefixes"> The prefixes that the bgp community contains. </param>
 25        /// <param name="isAuthorizedToUse"> Customer is authorized to use bgp community or not. </param>
 26        /// <param name="serviceGroup"> The service group of the bgp community contains. </param>
 71627        internal BGPCommunity(string serviceSupportedRegion, string communityName, string communityValue, IList<string> 
 28        {
 71629            ServiceSupportedRegion = serviceSupportedRegion;
 71630            CommunityName = communityName;
 71631            CommunityValue = communityValue;
 71632            CommunityPrefixes = communityPrefixes;
 71633            IsAuthorizedToUse = isAuthorizedToUse;
 71634            ServiceGroup = serviceGroup;
 71635        }
 36
 37        /// <summary> The region which the service support. e.g. For O365, region is Global. </summary>
 038        public string ServiceSupportedRegion { get; set; }
 39        /// <summary> The name of the bgp community. e.g. Skype. </summary>
 040        public string CommunityName { get; set; }
 41        /// <summary> The value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expre
 042        public string CommunityValue { get; set; }
 43        /// <summary> The prefixes that the bgp community contains. </summary>
 044        public IList<string> CommunityPrefixes { get; set; }
 45        /// <summary> Customer is authorized to use bgp community or not. </summary>
 72046        public bool? IsAuthorizedToUse { get; set; }
 47        /// <summary> The service group of the bgp community contains. </summary>
 048        public string ServiceGroup { get; set; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BGPCommunity.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 BGPCommunity : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (ServiceSupportedRegion != null)
 20            {
 021                writer.WritePropertyName("serviceSupportedRegion");
 022                writer.WriteStringValue(ServiceSupportedRegion);
 23            }
 024            if (CommunityName != null)
 25            {
 026                writer.WritePropertyName("communityName");
 027                writer.WriteStringValue(CommunityName);
 28            }
 029            if (CommunityValue != null)
 30            {
 031                writer.WritePropertyName("communityValue");
 032                writer.WriteStringValue(CommunityValue);
 33            }
 034            if (CommunityPrefixes != null)
 35            {
 036                writer.WritePropertyName("communityPrefixes");
 037                writer.WriteStartArray();
 038                foreach (var item in CommunityPrefixes)
 39                {
 040                    writer.WriteStringValue(item);
 41                }
 042                writer.WriteEndArray();
 43            }
 044            if (IsAuthorizedToUse != null)
 45            {
 046                writer.WritePropertyName("isAuthorizedToUse");
 047                writer.WriteBooleanValue(IsAuthorizedToUse.Value);
 48            }
 049            if (ServiceGroup != null)
 50            {
 051                writer.WritePropertyName("serviceGroup");
 052                writer.WriteStringValue(ServiceGroup);
 53            }
 054            writer.WriteEndObject();
 055        }
 56
 57        internal static BGPCommunity DeserializeBGPCommunity(JsonElement element)
 58        {
 71659            string serviceSupportedRegion = default;
 71660            string communityName = default;
 71661            string communityValue = default;
 71662            IList<string> communityPrefixes = default;
 71663            bool? isAuthorizedToUse = default;
 71664            string serviceGroup = default;
 1002465            foreach (var property in element.EnumerateObject())
 66            {
 429667                if (property.NameEquals("serviceSupportedRegion"))
 68                {
 71669                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 71673                    serviceSupportedRegion = property.Value.GetString();
 71674                    continue;
 75                }
 358076                if (property.NameEquals("communityName"))
 77                {
 71678                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 71682                    communityName = property.Value.GetString();
 71683                    continue;
 84                }
 286485                if (property.NameEquals("communityValue"))
 86                {
 71687                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 71691                    communityValue = property.Value.GetString();
 71692                    continue;
 93                }
 214894                if (property.NameEquals("communityPrefixes"))
 95                {
 71696                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 716100                    List<string> array = new List<string>();
 33712101                    foreach (var item in property.Value.EnumerateArray())
 102                    {
 16140103                        if (item.ValueKind == JsonValueKind.Null)
 104                        {
 0105                            array.Add(null);
 106                        }
 107                        else
 108                        {
 16140109                            array.Add(item.GetString());
 110                        }
 111                    }
 716112                    communityPrefixes = array;
 716113                    continue;
 114                }
 1432115                if (property.NameEquals("isAuthorizedToUse"))
 116                {
 716117                    if (property.Value.ValueKind == JsonValueKind.Null)
 118                    {
 119                        continue;
 120                    }
 716121                    isAuthorizedToUse = property.Value.GetBoolean();
 716122                    continue;
 123                }
 716124                if (property.NameEquals("serviceGroup"))
 125                {
 716126                    if (property.Value.ValueKind == JsonValueKind.Null)
 127                    {
 128                        continue;
 129                    }
 716130                    serviceGroup = property.Value.GetString();
 131                    continue;
 132                }
 133            }
 716134            return new BGPCommunity(serviceSupportedRegion, communityName, communityValue, communityPrefixes, isAuthoriz
 135        }
 136    }
 137}