< Summary

Class:Azure.ResourceManager.Compute.Models.GalleryImageVersion
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryImageVersion.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryImageVersion.Serialization.cs
Covered lines:77
Uncovered lines:25
Coverable lines:102
Total lines:239
Line coverage:75.4% (77 of 102)
Covered branches:49
Total branches:64
Branch coverage:76.5% (49 of 64)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
.ctor(...)-100%100%
get_PublishingProfile()-100%100%
get_ProvisioningState()-100%100%
get_StorageProfile()-100%100%
get_ReplicationStatus()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-55.56%55.56%
DeserializeGalleryImageVersion(...)-84.62%86.36%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryImageVersion.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.Compute.Models
 12{
 13    /// <summary> Specifies information about the gallery Image Version that you want to create or update. </summary>
 14    public partial class GalleryImageVersion : Resource
 15    {
 16        /// <summary> Initializes a new instance of GalleryImageVersion. </summary>
 17        /// <param name="location"> Resource location. </param>
 418        public GalleryImageVersion(string location) : base(location)
 19        {
 420            if (location == null)
 21            {
 022                throw new ArgumentNullException(nameof(location));
 23            }
 424        }
 25
 26        /// <summary> Initializes a new instance of GalleryImageVersion. </summary>
 27        /// <param name="id"> Resource Id. </param>
 28        /// <param name="name"> Resource name. </param>
 29        /// <param name="type"> Resource type. </param>
 30        /// <param name="location"> Resource location. </param>
 31        /// <param name="tags"> Resource tags. </param>
 32        /// <param name="publishingProfile"> Describes the basic gallery artifact publishing profile. </param>
 33        /// <param name="provisioningState"> The provisioning state, which only appears in the response. </param>
 34        /// <param name="storageProfile"> This is the storage profile of a Gallery Image Version. </param>
 35        /// <param name="replicationStatus"> This is the replication status of the gallery Image Version. </param>
 2436        internal GalleryImageVersion(string id, string name, string type, string location, IDictionary<string, string> t
 37        {
 2438            PublishingProfile = publishingProfile;
 2439            ProvisioningState = provisioningState;
 2440            StorageProfile = storageProfile;
 2441            ReplicationStatus = replicationStatus;
 2442        }
 43
 44        /// <summary> Describes the basic gallery artifact publishing profile. </summary>
 8845        public GalleryArtifactPublishingProfileBase PublishingProfile { get; set; }
 46        /// <summary> The provisioning state, which only appears in the response. </summary>
 2447        public GalleryImageVersionPropertiesProvisioningState? ProvisioningState { get; }
 48        /// <summary> This is the storage profile of a Gallery Image Version. </summary>
 7649        public GalleryImageVersionStorageProfile StorageProfile { get; set; }
 50        /// <summary> This is the replication status of the gallery Image Version. </summary>
 2451        public ReplicationStatus ReplicationStatus { get; }
 52    }
 53}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryImageVersion.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.Compute.Models
 13{
 14    public partial class GalleryImageVersion : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 1618            writer.WriteStartObject();
 1619            if (Id != null)
 20            {
 021                writer.WritePropertyName("id");
 022                writer.WriteStringValue(Id);
 23            }
 1624            if (Name != null)
 25            {
 026                writer.WritePropertyName("name");
 027                writer.WriteStringValue(Name);
 28            }
 1629            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 1634            writer.WritePropertyName("location");
 1635            writer.WriteStringValue(Location);
 1636            if (Tags != null)
 37            {
 038                writer.WritePropertyName("tags");
 039                writer.WriteStartObject();
 040                foreach (var item in Tags)
 41                {
 042                    writer.WritePropertyName(item.Key);
 043                    writer.WriteStringValue(item.Value);
 44                }
 045                writer.WriteEndObject();
 46            }
 1647            writer.WritePropertyName("properties");
 1648            writer.WriteStartObject();
 1649            if (PublishingProfile != null)
 50            {
 1651                writer.WritePropertyName("publishingProfile");
 1652                writer.WriteObjectValue(PublishingProfile);
 53            }
 1654            if (ProvisioningState != null)
 55            {
 056                writer.WritePropertyName("provisioningState");
 057                writer.WriteStringValue(ProvisioningState.Value.ToString());
 58            }
 1659            if (StorageProfile != null)
 60            {
 1661                writer.WritePropertyName("storageProfile");
 1662                writer.WriteObjectValue(StorageProfile);
 63            }
 1664            if (ReplicationStatus != null)
 65            {
 066                writer.WritePropertyName("replicationStatus");
 067                writer.WriteObjectValue(ReplicationStatus);
 68            }
 1669            writer.WriteEndObject();
 1670            writer.WriteEndObject();
 1671        }
 72
 73        internal static GalleryImageVersion DeserializeGalleryImageVersion(JsonElement element)
 74        {
 2475            string id = default;
 2476            string name = default;
 2477            string type = default;
 2478            string location = default;
 2479            IDictionary<string, string> tags = default;
 2480            GalleryArtifactPublishingProfileBase publishingProfile = default;
 2481            GalleryImageVersionPropertiesProvisioningState? provisioningState = default;
 2482            GalleryImageVersionStorageProfile storageProfile = default;
 2483            ReplicationStatus replicationStatus = default;
 28884            foreach (var property in element.EnumerateObject())
 85            {
 12086                if (property.NameEquals("id"))
 87                {
 2488                    if (property.Value.ValueKind == JsonValueKind.Null)
 89                    {
 90                        continue;
 91                    }
 2492                    id = property.Value.GetString();
 2493                    continue;
 94                }
 9695                if (property.NameEquals("name"))
 96                {
 2497                    if (property.Value.ValueKind == JsonValueKind.Null)
 98                    {
 99                        continue;
 100                    }
 24101                    name = property.Value.GetString();
 24102                    continue;
 103                }
 72104                if (property.NameEquals("type"))
 105                {
 24106                    if (property.Value.ValueKind == JsonValueKind.Null)
 107                    {
 108                        continue;
 109                    }
 24110                    type = property.Value.GetString();
 24111                    continue;
 112                }
 48113                if (property.NameEquals("location"))
 114                {
 24115                    location = property.Value.GetString();
 24116                    continue;
 117                }
 24118                if (property.NameEquals("tags"))
 119                {
 0120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 0124                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0125                    foreach (var property0 in property.Value.EnumerateObject())
 126                    {
 0127                        if (property0.Value.ValueKind == JsonValueKind.Null)
 128                        {
 0129                            dictionary.Add(property0.Name, null);
 130                        }
 131                        else
 132                        {
 0133                            dictionary.Add(property0.Name, property0.Value.GetString());
 134                        }
 135                    }
 0136                    tags = dictionary;
 0137                    continue;
 138                }
 24139                if (property.NameEquals("properties"))
 140                {
 216141                    foreach (var property0 in property.Value.EnumerateObject())
 142                    {
 84143                        if (property0.NameEquals("publishingProfile"))
 144                        {
 24145                            if (property0.Value.ValueKind == JsonValueKind.Null)
 146                            {
 147                                continue;
 148                            }
 24149                            publishingProfile = GalleryArtifactPublishingProfileBase.DeserializeGalleryArtifactPublishin
 24150                            continue;
 151                        }
 60152                        if (property0.NameEquals("provisioningState"))
 153                        {
 24154                            if (property0.Value.ValueKind == JsonValueKind.Null)
 155                            {
 156                                continue;
 157                            }
 24158                            provisioningState = new GalleryImageVersionPropertiesProvisioningState(property0.Value.GetSt
 24159                            continue;
 160                        }
 36161                        if (property0.NameEquals("storageProfile"))
 162                        {
 24163                            if (property0.Value.ValueKind == JsonValueKind.Null)
 164                            {
 165                                continue;
 166                            }
 24167                            storageProfile = GalleryImageVersionStorageProfile.DeserializeGalleryImageVersionStorageProf
 24168                            continue;
 169                        }
 12170                        if (property0.NameEquals("replicationStatus"))
 171                        {
 12172                            if (property0.Value.ValueKind == JsonValueKind.Null)
 173                            {
 174                                continue;
 175                            }
 12176                            replicationStatus = ReplicationStatus.DeserializeReplicationStatus(property0.Value);
 177                            continue;
 178                        }
 179                    }
 180                    continue;
 181                }
 182            }
 24183            return new GalleryImageVersion(id, name, type, location, tags, publishingProfile, provisioningState, storage
 184        }
 185    }
 186}