< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Type()-0%100%
get_LinkedResourceType()-0%100%
get_Link()-0%100%
get_ProvisioningState()-0%100%
get_AllowDelete()-0%100%
get_Locations()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeServiceAssociationLink(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceAssociationLink.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> ServiceAssociationLink resource. </summary>
 13    public partial class ServiceAssociationLink : SubResource
 14    {
 15        /// <summary> Initializes a new instance of ServiceAssociationLink. </summary>
 016        public ServiceAssociationLink()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ServiceAssociationLink. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Name of the resource that is unique within a resource group. This name can be used to ac
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="type"> Resource type. </param>
 25        /// <param name="linkedResourceType"> Resource type of the linked resource. </param>
 26        /// <param name="link"> Link to the external resource. </param>
 27        /// <param name="provisioningState"> The provisioning state of the service association link resource. </param>
 28        /// <param name="allowDelete"> If true, the resource can be deleted. </param>
 29        /// <param name="locations"> A list of locations. </param>
 030        internal ServiceAssociationLink(string id, string name, string etag, string type, string linkedResourceType, str
 31        {
 032            Name = name;
 033            Etag = etag;
 034            Type = type;
 035            LinkedResourceType = linkedResourceType;
 036            Link = link;
 037            ProvisioningState = provisioningState;
 038            AllowDelete = allowDelete;
 039            Locations = locations;
 040        }
 41
 42        /// <summary> Name of the resource that is unique within a resource group. This name can be used to access the r
 043        public string Name { get; set; }
 44        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 045        public string Etag { get; }
 46        /// <summary> Resource type. </summary>
 047        public string Type { get; }
 48        /// <summary> Resource type of the linked resource. </summary>
 049        public string LinkedResourceType { get; set; }
 50        /// <summary> Link to the external resource. </summary>
 051        public string Link { get; set; }
 52        /// <summary> The provisioning state of the service association link resource. </summary>
 053        public ProvisioningState? ProvisioningState { get; }
 54        /// <summary> If true, the resource can be deleted. </summary>
 055        public bool? AllowDelete { get; set; }
 56        /// <summary> A list of locations. </summary>
 057        public IList<string> Locations { get; set; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceAssociationLink.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 ServiceAssociationLink : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            writer.WritePropertyName("properties");
 040            writer.WriteStartObject();
 041            if (LinkedResourceType != null)
 42            {
 043                writer.WritePropertyName("linkedResourceType");
 044                writer.WriteStringValue(LinkedResourceType);
 45            }
 046            if (Link != null)
 47            {
 048                writer.WritePropertyName("link");
 049                writer.WriteStringValue(Link);
 50            }
 051            if (ProvisioningState != null)
 52            {
 053                writer.WritePropertyName("provisioningState");
 054                writer.WriteStringValue(ProvisioningState.Value.ToString());
 55            }
 056            if (AllowDelete != null)
 57            {
 058                writer.WritePropertyName("allowDelete");
 059                writer.WriteBooleanValue(AllowDelete.Value);
 60            }
 061            if (Locations != null)
 62            {
 063                writer.WritePropertyName("locations");
 064                writer.WriteStartArray();
 065                foreach (var item in Locations)
 66                {
 067                    writer.WriteStringValue(item);
 68                }
 069                writer.WriteEndArray();
 70            }
 071            writer.WriteEndObject();
 072            writer.WriteEndObject();
 073        }
 74
 75        internal static ServiceAssociationLink DeserializeServiceAssociationLink(JsonElement element)
 76        {
 077            string name = default;
 078            string etag = default;
 079            string type = default;
 080            string id = default;
 081            string linkedResourceType = default;
 082            string link = default;
 083            ProvisioningState? provisioningState = default;
 084            bool? allowDelete = default;
 085            IList<string> locations = default;
 086            foreach (var property in element.EnumerateObject())
 87            {
 088                if (property.NameEquals("name"))
 89                {
 090                    if (property.Value.ValueKind == JsonValueKind.Null)
 91                    {
 92                        continue;
 93                    }
 094                    name = property.Value.GetString();
 095                    continue;
 96                }
 097                if (property.NameEquals("etag"))
 98                {
 099                    if (property.Value.ValueKind == JsonValueKind.Null)
 100                    {
 101                        continue;
 102                    }
 0103                    etag = property.Value.GetString();
 0104                    continue;
 105                }
 0106                if (property.NameEquals("type"))
 107                {
 0108                    if (property.Value.ValueKind == JsonValueKind.Null)
 109                    {
 110                        continue;
 111                    }
 0112                    type = property.Value.GetString();
 0113                    continue;
 114                }
 0115                if (property.NameEquals("id"))
 116                {
 0117                    if (property.Value.ValueKind == JsonValueKind.Null)
 118                    {
 119                        continue;
 120                    }
 0121                    id = property.Value.GetString();
 0122                    continue;
 123                }
 0124                if (property.NameEquals("properties"))
 125                {
 0126                    foreach (var property0 in property.Value.EnumerateObject())
 127                    {
 0128                        if (property0.NameEquals("linkedResourceType"))
 129                        {
 0130                            if (property0.Value.ValueKind == JsonValueKind.Null)
 131                            {
 132                                continue;
 133                            }
 0134                            linkedResourceType = property0.Value.GetString();
 0135                            continue;
 136                        }
 0137                        if (property0.NameEquals("link"))
 138                        {
 0139                            if (property0.Value.ValueKind == JsonValueKind.Null)
 140                            {
 141                                continue;
 142                            }
 0143                            link = property0.Value.GetString();
 0144                            continue;
 145                        }
 0146                        if (property0.NameEquals("provisioningState"))
 147                        {
 0148                            if (property0.Value.ValueKind == JsonValueKind.Null)
 149                            {
 150                                continue;
 151                            }
 0152                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0153                            continue;
 154                        }
 0155                        if (property0.NameEquals("allowDelete"))
 156                        {
 0157                            if (property0.Value.ValueKind == JsonValueKind.Null)
 158                            {
 159                                continue;
 160                            }
 0161                            allowDelete = property0.Value.GetBoolean();
 0162                            continue;
 163                        }
 0164                        if (property0.NameEquals("locations"))
 165                        {
 0166                            if (property0.Value.ValueKind == JsonValueKind.Null)
 167                            {
 168                                continue;
 169                            }
 0170                            List<string> array = new List<string>();
 0171                            foreach (var item in property0.Value.EnumerateArray())
 172                            {
 0173                                if (item.ValueKind == JsonValueKind.Null)
 174                                {
 0175                                    array.Add(null);
 176                                }
 177                                else
 178                                {
 0179                                    array.Add(item.GetString());
 180                                }
 181                            }
 0182                            locations = array;
 183                            continue;
 184                        }
 185                    }
 186                    continue;
 187                }
 188            }
 0189            return new ServiceAssociationLink(id, name, etag, type, linkedResourceType, link, provisioningState, allowDe
 190        }
 191    }
 192}