< Summary

Class:Azure.ResourceManager.AppConfiguration.Models.ConfigurationStore
Assembly:Azure.ResourceManager.AppConfiguration
File(s):C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\ConfigurationStore.cs
C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\ConfigurationStore.Serialization.cs
Covered lines:112
Uncovered lines:39
Coverable lines:151
Total lines:333
Line coverage:74.1% (112 of 151)
Covered branches:68
Total branches:92
Branch coverage:73.9% (68 of 92)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-71.43%50%
.ctor(...)-100%100%
get_Identity()-100%100%
get_Sku()-100%100%
get_ProvisioningState()-100%100%
get_CreationDate()-100%100%
get_Endpoint()-100%100%
get_Encryption()-100%100%
get_PrivateEndpointConnections()-100%100%
get_PublicNetworkAccess()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-42%42.31%
DeserializeConfigurationStore(...)-89.47%88.71%

File(s)

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\ConfigurationStore.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.AppConfiguration.Models
 12{
 13    /// <summary> The configuration store along with all resource properties. The Configuration Store will have all info
 14    public partial class ConfigurationStore : Resource
 15    {
 16        /// <summary> Initializes a new instance of ConfigurationStore. </summary>
 17        /// <param name="location"> The location of the resource. This cannot be changed after the resource is created. 
 18        /// <param name="sku"> The sku of the configuration store. </param>
 819        public ConfigurationStore(string location, Sku sku) : base(location)
 20        {
 821            if (location == null)
 22            {
 023                throw new ArgumentNullException(nameof(location));
 24            }
 825            if (sku == null)
 26            {
 027                throw new ArgumentNullException(nameof(sku));
 28            }
 29
 830            Sku = sku;
 831        }
 32
 33        /// <summary> Initializes a new instance of ConfigurationStore. </summary>
 34        /// <param name="id"> The resource ID. </param>
 35        /// <param name="name"> The name of the resource. </param>
 36        /// <param name="type"> The type of the resource. </param>
 37        /// <param name="location"> The location of the resource. This cannot be changed after the resource is created. 
 38        /// <param name="tags"> The tags of the resource. </param>
 39        /// <param name="identity"> The managed identity information, if configured. </param>
 40        /// <param name="sku"> The sku of the configuration store. </param>
 41        /// <param name="provisioningState"> The provisioning state of the configuration store. </param>
 42        /// <param name="creationDate"> The creation date of configuration store. </param>
 43        /// <param name="endpoint"> The DNS endpoint where the configuration store API will be available. </param>
 44        /// <param name="encryption"> The encryption settings of the configuration store. </param>
 45        /// <param name="privateEndpointConnections"> The list of private endpoint connections that are set up for this 
 46        /// <param name="publicNetworkAccess"> Control permission for data plane traffic coming from public networks whi
 2447        internal ConfigurationStore(string id, string name, string type, string location, IDictionary<string, string> ta
 48        {
 2449            Identity = identity;
 2450            Sku = sku;
 2451            ProvisioningState = provisioningState;
 2452            CreationDate = creationDate;
 2453            Endpoint = endpoint;
 2454            Encryption = encryption;
 2455            PrivateEndpointConnections = privateEndpointConnections;
 2456            PublicNetworkAccess = publicNetworkAccess;
 2457        }
 58
 59        /// <summary> The managed identity information, if configured. </summary>
 4060        public ResourceIdentity Identity { get; set; }
 61        /// <summary> The sku of the configuration store. </summary>
 4862        public Sku Sku { get; set; }
 63        /// <summary> The provisioning state of the configuration store. </summary>
 2464        public ProvisioningState? ProvisioningState { get; }
 65        /// <summary> The creation date of configuration store. </summary>
 1666        public DateTimeOffset? CreationDate { get; }
 67        /// <summary> The DNS endpoint where the configuration store API will be available. </summary>
 1668        public string Endpoint { get; }
 69        /// <summary> The encryption settings of the configuration store. </summary>
 4070        public EncryptionProperties Encryption { get; set; }
 71        /// <summary> The list of private endpoint connections that are set up for this resource. </summary>
 2472        public IList<PrivateEndpointConnectionReference> PrivateEndpointConnections { get; }
 73        /// <summary> Control permission for data plane traffic coming from public networks while private endpoint is en
 4074        public PublicNetworkAccess? PublicNetworkAccess { get; set; }
 75    }
 76}

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\ConfigurationStore.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;
 9using System.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.AppConfiguration.Models
 14{
 15    public partial class ConfigurationStore : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 1619            writer.WriteStartObject();
 1620            if (Identity != null)
 21            {
 022                writer.WritePropertyName("identity");
 023                writer.WriteObjectValue(Identity);
 24            }
 1625            writer.WritePropertyName("sku");
 1626            writer.WriteObjectValue(Sku);
 1627            if (Id != null)
 28            {
 029                writer.WritePropertyName("id");
 030                writer.WriteStringValue(Id);
 31            }
 1632            if (Name != null)
 33            {
 034                writer.WritePropertyName("name");
 035                writer.WriteStringValue(Name);
 36            }
 1637            if (Type != null)
 38            {
 039                writer.WritePropertyName("type");
 040                writer.WriteStringValue(Type);
 41            }
 1642            writer.WritePropertyName("location");
 1643            writer.WriteStringValue(Location);
 1644            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            }
 1655            writer.WritePropertyName("properties");
 1656            writer.WriteStartObject();
 1657            if (ProvisioningState != null)
 58            {
 059                writer.WritePropertyName("provisioningState");
 060                writer.WriteStringValue(ProvisioningState.Value.ToString());
 61            }
 1662            if (CreationDate != null)
 63            {
 064                writer.WritePropertyName("creationDate");
 065                writer.WriteStringValue(CreationDate.Value, "O");
 66            }
 1667            if (Endpoint != null)
 68            {
 069                writer.WritePropertyName("endpoint");
 070                writer.WriteStringValue(Endpoint);
 71            }
 1672            if (Encryption != null)
 73            {
 074                writer.WritePropertyName("encryption");
 075                writer.WriteObjectValue(Encryption);
 76            }
 1677            if (PrivateEndpointConnections != null)
 78            {
 079                writer.WritePropertyName("privateEndpointConnections");
 080                writer.WriteStartArray();
 081                foreach (var item in PrivateEndpointConnections)
 82                {
 083                    writer.WriteObjectValue(item);
 84                }
 085                writer.WriteEndArray();
 86            }
 1687            if (PublicNetworkAccess != null)
 88            {
 089                writer.WritePropertyName("publicNetworkAccess");
 090                writer.WriteStringValue(PublicNetworkAccess.Value.ToString());
 91            }
 1692            writer.WriteEndObject();
 1693            writer.WriteEndObject();
 1694        }
 95
 96        internal static ConfigurationStore DeserializeConfigurationStore(JsonElement element)
 97        {
 2498            ResourceIdentity identity = default;
 2499            Sku sku = default;
 24100            string id = default;
 24101            string name = default;
 24102            string type = default;
 24103            string location = default;
 24104            IDictionary<string, string> tags = default;
 24105            ProvisioningState? provisioningState = default;
 24106            DateTimeOffset? creationDate = default;
 24107            string endpoint = default;
 24108            EncryptionProperties encryption = default;
 24109            IList<PrivateEndpointConnectionReference> privateEndpointConnections = default;
 24110            PublicNetworkAccess? publicNetworkAccess = default;
 384111            foreach (var property in element.EnumerateObject())
 112            {
 168113                if (property.NameEquals("identity"))
 114                {
 0115                    if (property.Value.ValueKind == JsonValueKind.Null)
 116                    {
 117                        continue;
 118                    }
 0119                    identity = ResourceIdentity.DeserializeResourceIdentity(property.Value);
 0120                    continue;
 121                }
 168122                if (property.NameEquals("sku"))
 123                {
 24124                    sku = Sku.DeserializeSku(property.Value);
 24125                    continue;
 126                }
 144127                if (property.NameEquals("id"))
 128                {
 24129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 24133                    id = property.Value.GetString();
 24134                    continue;
 135                }
 120136                if (property.NameEquals("name"))
 137                {
 24138                    if (property.Value.ValueKind == JsonValueKind.Null)
 139                    {
 140                        continue;
 141                    }
 24142                    name = property.Value.GetString();
 24143                    continue;
 144                }
 96145                if (property.NameEquals("type"))
 146                {
 24147                    if (property.Value.ValueKind == JsonValueKind.Null)
 148                    {
 149                        continue;
 150                    }
 24151                    type = property.Value.GetString();
 24152                    continue;
 153                }
 72154                if (property.NameEquals("location"))
 155                {
 24156                    location = property.Value.GetString();
 24157                    continue;
 158                }
 48159                if (property.NameEquals("tags"))
 160                {
 24161                    if (property.Value.ValueKind == JsonValueKind.Null)
 162                    {
 163                        continue;
 164                    }
 24165                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 56166                    foreach (var property0 in property.Value.EnumerateObject())
 167                    {
 4168                        if (property0.Value.ValueKind == JsonValueKind.Null)
 169                        {
 0170                            dictionary.Add(property0.Name, null);
 171                        }
 172                        else
 173                        {
 4174                            dictionary.Add(property0.Name, property0.Value.GetString());
 175                        }
 176                    }
 24177                    tags = dictionary;
 24178                    continue;
 179                }
 24180                if (property.NameEquals("properties"))
 181                {
 288182                    foreach (var property0 in property.Value.EnumerateObject())
 183                    {
 120184                        if (property0.NameEquals("provisioningState"))
 185                        {
 24186                            if (property0.Value.ValueKind == JsonValueKind.Null)
 187                            {
 188                                continue;
 189                            }
 24190                            provisioningState = new ProvisioningState(property0.Value.GetString());
 24191                            continue;
 192                        }
 96193                        if (property0.NameEquals("creationDate"))
 194                        {
 24195                            if (property0.Value.ValueKind == JsonValueKind.Null)
 196                            {
 197                                continue;
 198                            }
 24199                            creationDate = property0.Value.GetDateTimeOffset("O");
 24200                            continue;
 201                        }
 72202                        if (property0.NameEquals("endpoint"))
 203                        {
 24204                            if (property0.Value.ValueKind == JsonValueKind.Null)
 205                            {
 206                                continue;
 207                            }
 24208                            endpoint = property0.Value.GetString();
 24209                            continue;
 210                        }
 48211                        if (property0.NameEquals("encryption"))
 212                        {
 24213                            if (property0.Value.ValueKind == JsonValueKind.Null)
 214                            {
 215                                continue;
 216                            }
 24217                            encryption = EncryptionProperties.DeserializeEncryptionProperties(property0.Value);
 24218                            continue;
 219                        }
 24220                        if (property0.NameEquals("privateEndpointConnections"))
 221                        {
 24222                            if (property0.Value.ValueKind == JsonValueKind.Null)
 223                            {
 224                                continue;
 225                            }
 16226                            List<PrivateEndpointConnectionReference> array = new List<PrivateEndpointConnectionReference
 64227                            foreach (var item in property0.Value.EnumerateArray())
 228                            {
 16229                                if (item.ValueKind == JsonValueKind.Null)
 230                                {
 0231                                    array.Add(null);
 232                                }
 233                                else
 234                                {
 16235                                    array.Add(PrivateEndpointConnectionReference.DeserializePrivateEndpointConnectionRef
 236                                }
 237                            }
 16238                            privateEndpointConnections = array;
 16239                            continue;
 240                        }
 0241                        if (property0.NameEquals("publicNetworkAccess"))
 242                        {
 0243                            if (property0.Value.ValueKind == JsonValueKind.Null)
 244                            {
 245                                continue;
 246                            }
 0247                            publicNetworkAccess = new PublicNetworkAccess(property0.Value.GetString());
 248                            continue;
 249                        }
 250                    }
 251                    continue;
 252                }
 253            }
 24254            return new ConfigurationStore(id, name, type, location, tags, identity, sku, provisioningState, creationDate
 255        }
 256    }
 257}