< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_PublicCertData()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVpnClientRootCertificate(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnClientRootCertificate.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> VPN client root certificate of virtual network gateway. </summary>
 13    public partial class VpnClientRootCertificate : SubResource
 14    {
 15        /// <summary> Initializes a new instance of VpnClientRootCertificate. </summary>
 16        /// <param name="publicCertData"> The certificate public data. </param>
 017        public VpnClientRootCertificate(string publicCertData)
 18        {
 019            if (publicCertData == null)
 20            {
 021                throw new ArgumentNullException(nameof(publicCertData));
 22            }
 23
 024            PublicCertData = publicCertData;
 025        }
 26
 27        /// <summary> Initializes a new instance of VpnClientRootCertificate. </summary>
 28        /// <param name="id"> Resource ID. </param>
 29        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 30        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 31        /// <param name="publicCertData"> The certificate public data. </param>
 32        /// <param name="provisioningState"> The provisioning state of the VPN client root certificate resource. </param
 033        internal VpnClientRootCertificate(string id, string name, string etag, string publicCertData, ProvisioningState?
 34        {
 035            Name = name;
 036            Etag = etag;
 037            PublicCertData = publicCertData;
 038            ProvisioningState = provisioningState;
 039        }
 40
 41        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 042        public string Name { get; set; }
 43        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 044        public string Etag { get; }
 45        /// <summary> The certificate public data. </summary>
 046        public string PublicCertData { get; set; }
 47        /// <summary> The provisioning state of the VPN client root certificate resource. </summary>
 048        public ProvisioningState? ProvisioningState { get; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnClientRootCertificate.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class VpnClientRootCertificate : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Name != null)
 19            {
 020                writer.WritePropertyName("name");
 021                writer.WriteStringValue(Name);
 22            }
 023            if (Etag != null)
 24            {
 025                writer.WritePropertyName("etag");
 026                writer.WriteStringValue(Etag);
 27            }
 028            if (Id != null)
 29            {
 030                writer.WritePropertyName("id");
 031                writer.WriteStringValue(Id);
 32            }
 033            writer.WritePropertyName("properties");
 034            writer.WriteStartObject();
 035            writer.WritePropertyName("publicCertData");
 036            writer.WriteStringValue(PublicCertData);
 037            if (ProvisioningState != null)
 38            {
 039                writer.WritePropertyName("provisioningState");
 040                writer.WriteStringValue(ProvisioningState.Value.ToString());
 41            }
 042            writer.WriteEndObject();
 043            writer.WriteEndObject();
 044        }
 45
 46        internal static VpnClientRootCertificate DeserializeVpnClientRootCertificate(JsonElement element)
 47        {
 048            string name = default;
 049            string etag = default;
 050            string id = default;
 051            string publicCertData = default;
 052            ProvisioningState? provisioningState = default;
 053            foreach (var property in element.EnumerateObject())
 54            {
 055                if (property.NameEquals("name"))
 56                {
 057                    if (property.Value.ValueKind == JsonValueKind.Null)
 58                    {
 59                        continue;
 60                    }
 061                    name = property.Value.GetString();
 062                    continue;
 63                }
 064                if (property.NameEquals("etag"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    etag = property.Value.GetString();
 071                    continue;
 72                }
 073                if (property.NameEquals("id"))
 74                {
 075                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 079                    id = property.Value.GetString();
 080                    continue;
 81                }
 082                if (property.NameEquals("properties"))
 83                {
 084                    foreach (var property0 in property.Value.EnumerateObject())
 85                    {
 086                        if (property0.NameEquals("publicCertData"))
 87                        {
 088                            publicCertData = property0.Value.GetString();
 089                            continue;
 90                        }
 091                        if (property0.NameEquals("provisioningState"))
 92                        {
 093                            if (property0.Value.ValueKind == JsonValueKind.Null)
 94                            {
 95                                continue;
 96                            }
 097                            provisioningState = new ProvisioningState(property0.Value.GetString());
 98                            continue;
 99                        }
 100                    }
 101                    continue;
 102                }
 103            }
 0104            return new VpnClientRootCertificate(id, name, etag, publicCertData, provisioningState);
 105        }
 106    }
 107}