< Summary

Class:Azure.ResourceManager.Compute.Models.GalleryApplicationVersion
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplicationVersion.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplicationVersion.Serialization.cs
Covered lines:0
Uncovered lines:92
Coverable lines:92
Total lines:220
Line coverage:0% (0 of 92)
Covered branches:0
Total branches:58
Branch coverage:0% (0 of 58)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_PublishingProfile()-0%100%
get_ProvisioningState()-0%100%
get_ReplicationStatus()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeGalleryApplicationVersion(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplicationVersion.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 Application Version that you want to create or update. </summa
 14    public partial class GalleryApplicationVersion : Resource
 15    {
 16        /// <summary> Initializes a new instance of GalleryApplicationVersion. </summary>
 17        /// <param name="location"> Resource location. </param>
 018        public GalleryApplicationVersion(string location) : base(location)
 19        {
 020            if (location == null)
 21            {
 022                throw new ArgumentNullException(nameof(location));
 23            }
 024        }
 25
 26        /// <summary> Initializes a new instance of GalleryApplicationVersion. </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"> The publishing profile of a gallery Image Version. </param>
 33        /// <param name="provisioningState"> The provisioning state, which only appears in the response. </param>
 34        /// <param name="replicationStatus"> This is the replication status of the gallery Image Version. </param>
 035        internal GalleryApplicationVersion(string id, string name, string type, string location, IDictionary<string, str
 36        {
 037            PublishingProfile = publishingProfile;
 038            ProvisioningState = provisioningState;
 039            ReplicationStatus = replicationStatus;
 040        }
 41
 42        /// <summary> The publishing profile of a gallery Image Version. </summary>
 043        public GalleryApplicationVersionPublishingProfile PublishingProfile { get; set; }
 44        /// <summary> The provisioning state, which only appears in the response. </summary>
 045        public GalleryApplicationVersionPropertiesProvisioningState? ProvisioningState { get; }
 46        /// <summary> This is the replication status of the gallery Image Version. </summary>
 047        public ReplicationStatus ReplicationStatus { get; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplicationVersion.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 GalleryApplicationVersion : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Id != null)
 20            {
 021                writer.WritePropertyName("id");
 022                writer.WriteStringValue(Id);
 23            }
 024            if (Name != null)
 25            {
 026                writer.WritePropertyName("name");
 027                writer.WriteStringValue(Name);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            writer.WritePropertyName("location");
 035            writer.WriteStringValue(Location);
 036            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            }
 047            writer.WritePropertyName("properties");
 048            writer.WriteStartObject();
 049            if (PublishingProfile != null)
 50            {
 051                writer.WritePropertyName("publishingProfile");
 052                writer.WriteObjectValue(PublishingProfile);
 53            }
 054            if (ProvisioningState != null)
 55            {
 056                writer.WritePropertyName("provisioningState");
 057                writer.WriteStringValue(ProvisioningState.Value.ToString());
 58            }
 059            if (ReplicationStatus != null)
 60            {
 061                writer.WritePropertyName("replicationStatus");
 062                writer.WriteObjectValue(ReplicationStatus);
 63            }
 064            writer.WriteEndObject();
 065            writer.WriteEndObject();
 066        }
 67
 68        internal static GalleryApplicationVersion DeserializeGalleryApplicationVersion(JsonElement element)
 69        {
 070            string id = default;
 071            string name = default;
 072            string type = default;
 073            string location = default;
 074            IDictionary<string, string> tags = default;
 075            GalleryApplicationVersionPublishingProfile publishingProfile = default;
 076            GalleryApplicationVersionPropertiesProvisioningState? provisioningState = default;
 077            ReplicationStatus replicationStatus = default;
 078            foreach (var property in element.EnumerateObject())
 79            {
 080                if (property.NameEquals("id"))
 81                {
 082                    if (property.Value.ValueKind == JsonValueKind.Null)
 83                    {
 84                        continue;
 85                    }
 086                    id = property.Value.GetString();
 087                    continue;
 88                }
 089                if (property.NameEquals("name"))
 90                {
 091                    if (property.Value.ValueKind == JsonValueKind.Null)
 92                    {
 93                        continue;
 94                    }
 095                    name = property.Value.GetString();
 096                    continue;
 97                }
 098                if (property.NameEquals("type"))
 99                {
 0100                    if (property.Value.ValueKind == JsonValueKind.Null)
 101                    {
 102                        continue;
 103                    }
 0104                    type = property.Value.GetString();
 0105                    continue;
 106                }
 0107                if (property.NameEquals("location"))
 108                {
 0109                    location = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("tags"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0119                    foreach (var property0 in property.Value.EnumerateObject())
 120                    {
 0121                        if (property0.Value.ValueKind == JsonValueKind.Null)
 122                        {
 0123                            dictionary.Add(property0.Name, null);
 124                        }
 125                        else
 126                        {
 0127                            dictionary.Add(property0.Name, property0.Value.GetString());
 128                        }
 129                    }
 0130                    tags = dictionary;
 0131                    continue;
 132                }
 0133                if (property.NameEquals("properties"))
 134                {
 0135                    foreach (var property0 in property.Value.EnumerateObject())
 136                    {
 0137                        if (property0.NameEquals("publishingProfile"))
 138                        {
 0139                            if (property0.Value.ValueKind == JsonValueKind.Null)
 140                            {
 141                                continue;
 142                            }
 0143                            publishingProfile = GalleryApplicationVersionPublishingProfile.DeserializeGalleryApplication
 0144                            continue;
 145                        }
 0146                        if (property0.NameEquals("provisioningState"))
 147                        {
 0148                            if (property0.Value.ValueKind == JsonValueKind.Null)
 149                            {
 150                                continue;
 151                            }
 0152                            provisioningState = new GalleryApplicationVersionPropertiesProvisioningState(property0.Value
 0153                            continue;
 154                        }
 0155                        if (property0.NameEquals("replicationStatus"))
 156                        {
 0157                            if (property0.Value.ValueKind == JsonValueKind.Null)
 158                            {
 159                                continue;
 160                            }
 0161                            replicationStatus = ReplicationStatus.DeserializeReplicationStatus(property0.Value);
 162                            continue;
 163                        }
 164                    }
 165                    continue;
 166                }
 167            }
 0168            return new GalleryApplicationVersion(id, name, type, location, tags, publishingProfile, provisioningState, r
 169        }
 170    }
 171}