< Summary

Class:Azure.ResourceManager.Resources.Models.GenericResourceAutoGenerated
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\GenericResourceAutoGenerated.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\GenericResourceAutoGenerated.Serialization.cs
Covered lines:0
Uncovered lines:87
Coverable lines:87
Total lines:211
Line coverage:0% (0 of 87)
Covered branches:0
Total branches:56
Branch coverage:0% (0 of 56)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_ManagedBy()-0%100%
get_Sku()-0%100%
get_Identity()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeGenericResourceAutoGenerated(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\GenericResourceAutoGenerated.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.Resources.Models
 11{
 12    /// <summary> Resource information. </summary>
 13    public partial class GenericResourceAutoGenerated : Resource
 14    {
 15        /// <summary> Initializes a new instance of GenericResourceAutoGenerated. </summary>
 016        public GenericResourceAutoGenerated()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of GenericResourceAutoGenerated. </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="managedBy"> ID of the resource that manages this resource. </param>
 27        /// <param name="sku"> The SKU of the resource. </param>
 28        /// <param name="identity"> The identity of the resource. </param>
 029        internal GenericResourceAutoGenerated(string id, string name, string type, string location, IDictionary<string, 
 30        {
 031            ManagedBy = managedBy;
 032            Sku = sku;
 033            Identity = identity;
 034        }
 35
 36        /// <summary> ID of the resource that manages this resource. </summary>
 037        public string ManagedBy { get; set; }
 38        /// <summary> The SKU of the resource. </summary>
 039        public SkuAutoGenerated Sku { get; set; }
 40        /// <summary> The identity of the resource. </summary>
 041        public IdentityAutoGenerated2 Identity { get; set; }
 42    }
 43}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\GenericResourceAutoGenerated.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.Resources.Models
 13{
 14    public partial class GenericResourceAutoGenerated : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (ManagedBy != null)
 20            {
 021                writer.WritePropertyName("managedBy");
 022                writer.WriteStringValue(ManagedBy);
 23            }
 024            if (Sku != null)
 25            {
 026                writer.WritePropertyName("sku");
 027                writer.WriteObjectValue(Sku);
 28            }
 029            if (Identity != null)
 30            {
 031                writer.WritePropertyName("identity");
 032                writer.WriteObjectValue(Identity);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            if (Name != null)
 40            {
 041                writer.WritePropertyName("name");
 042                writer.WriteStringValue(Name);
 43            }
 044            if (Type != null)
 45            {
 046                writer.WritePropertyName("type");
 047                writer.WriteStringValue(Type);
 48            }
 049            if (Location != null)
 50            {
 051                writer.WritePropertyName("location");
 052                writer.WriteStringValue(Location);
 53            }
 054            if (Tags != null)
 55            {
 056                writer.WritePropertyName("tags");
 057                writer.WriteStartObject();
 058                foreach (var item in Tags)
 59                {
 060                    writer.WritePropertyName(item.Key);
 061                    writer.WriteStringValue(item.Value);
 62                }
 063                writer.WriteEndObject();
 64            }
 065            writer.WriteEndObject();
 066        }
 67
 68        internal static GenericResourceAutoGenerated DeserializeGenericResourceAutoGenerated(JsonElement element)
 69        {
 070            string managedBy = default;
 071            SkuAutoGenerated sku = default;
 072            IdentityAutoGenerated2 identity = default;
 073            string id = default;
 074            string name = default;
 075            string type = default;
 076            string location = default;
 077            IDictionary<string, string> tags = default;
 078            foreach (var property in element.EnumerateObject())
 79            {
 080                if (property.NameEquals("managedBy"))
 81                {
 082                    if (property.Value.ValueKind == JsonValueKind.Null)
 83                    {
 84                        continue;
 85                    }
 086                    managedBy = property.Value.GetString();
 087                    continue;
 88                }
 089                if (property.NameEquals("sku"))
 90                {
 091                    if (property.Value.ValueKind == JsonValueKind.Null)
 92                    {
 93                        continue;
 94                    }
 095                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
 096                    continue;
 97                }
 098                if (property.NameEquals("identity"))
 99                {
 0100                    if (property.Value.ValueKind == JsonValueKind.Null)
 101                    {
 102                        continue;
 103                    }
 0104                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
 0105                    continue;
 106                }
 0107                if (property.NameEquals("id"))
 108                {
 0109                    if (property.Value.ValueKind == JsonValueKind.Null)
 110                    {
 111                        continue;
 112                    }
 0113                    id = property.Value.GetString();
 0114                    continue;
 115                }
 0116                if (property.NameEquals("name"))
 117                {
 0118                    if (property.Value.ValueKind == JsonValueKind.Null)
 119                    {
 120                        continue;
 121                    }
 0122                    name = property.Value.GetString();
 0123                    continue;
 124                }
 0125                if (property.NameEquals("type"))
 126                {
 0127                    if (property.Value.ValueKind == JsonValueKind.Null)
 128                    {
 129                        continue;
 130                    }
 0131                    type = property.Value.GetString();
 0132                    continue;
 133                }
 0134                if (property.NameEquals("location"))
 135                {
 0136                    if (property.Value.ValueKind == JsonValueKind.Null)
 137                    {
 138                        continue;
 139                    }
 0140                    location = property.Value.GetString();
 0141                    continue;
 142                }
 0143                if (property.NameEquals("tags"))
 144                {
 0145                    if (property.Value.ValueKind == JsonValueKind.Null)
 146                    {
 147                        continue;
 148                    }
 0149                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0150                    foreach (var property0 in property.Value.EnumerateObject())
 151                    {
 0152                        if (property0.Value.ValueKind == JsonValueKind.Null)
 153                        {
 0154                            dictionary.Add(property0.Name, null);
 155                        }
 156                        else
 157                        {
 0158                            dictionary.Add(property0.Name, property0.Value.GetString());
 159                        }
 160                    }
 0161                    tags = dictionary;
 162                    continue;
 163                }
 164            }
 0165            return new GenericResourceAutoGenerated(id, name, type, location, tags, managedBy, sku, identity);
 166        }
 167    }
 168}