< Summary

Class:Azure.ResourceManager.Compute.Models.GalleryApplication
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplication.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplication.Serialization.cs
Covered lines:96
Uncovered lines:26
Coverable lines:122
Total lines:278
Line coverage:78.6% (96 of 122)
Covered branches:60
Total branches:76
Branch coverage:78.9% (60 of 76)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
.ctor(...)-100%100%
get_Description()-100%100%
get_Eula()-100%100%
get_PrivacyStatementUri()-100%100%
get_ReleaseNoteUri()-100%100%
get_EndOfLifeDate()-100%100%
get_SupportedOSType()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-66.67%68.18%
DeserializeGalleryApplication(...)-82.26%84.62%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplication.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 Definition that you want to create or update. </su
 14    public partial class GalleryApplication : Resource
 15    {
 16        /// <summary> Initializes a new instance of GalleryApplication. </summary>
 17        /// <param name="location"> Resource location. </param>
 418        public GalleryApplication(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 GalleryApplication. </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="description"> The description of this gallery Application Definition resource. This property is
 33        /// <param name="eula"> The Eula agreement for the gallery Application Definition. </param>
 34        /// <param name="privacyStatementUri"> The privacy statement uri. </param>
 35        /// <param name="releaseNoteUri"> The release note uri. </param>
 36        /// <param name="endOfLifeDate"> The end of life date of the gallery Application Definition. This property can b
 37        /// <param name="supportedOSType"> This property allows you to specify the supported type of the OS that applica
 1638        internal GalleryApplication(string id, string name, string type, string location, IDictionary<string, string> ta
 39        {
 1640            Description = description;
 1641            Eula = eula;
 1642            PrivacyStatementUri = privacyStatementUri;
 1643            ReleaseNoteUri = releaseNoteUri;
 1644            EndOfLifeDate = endOfLifeDate;
 1645            SupportedOSType = supportedOSType;
 1646        }
 47
 48        /// <summary> The description of this gallery Application Definition resource. This property is updatable. </sum
 8049        public string Description { get; set; }
 50        /// <summary> The Eula agreement for the gallery Application Definition. </summary>
 6851        public string Eula { get; set; }
 52        /// <summary> The privacy statement uri. </summary>
 6853        public string PrivacyStatementUri { get; set; }
 54        /// <summary> The release note uri. </summary>
 6855        public string ReleaseNoteUri { get; set; }
 56        /// <summary> The end of life date of the gallery Application Definition. This property can be used for decommis
 3257        public DateTimeOffset? EndOfLifeDate { get; set; }
 58        /// <summary> This property allows you to specify the supported type of the OS that application is built for. &l
 6859        public OperatingSystemTypes? SupportedOSType { get; set; }
 60    }
 61}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplication.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.Compute.Models
 14{
 15    public partial class GalleryApplication : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 1619            writer.WriteStartObject();
 1620            if (Id != null)
 21            {
 022                writer.WritePropertyName("id");
 023                writer.WriteStringValue(Id);
 24            }
 1625            if (Name != null)
 26            {
 027                writer.WritePropertyName("name");
 028                writer.WriteStringValue(Name);
 29            }
 1630            if (Type != null)
 31            {
 032                writer.WritePropertyName("type");
 033                writer.WriteStringValue(Type);
 34            }
 1635            writer.WritePropertyName("location");
 1636            writer.WriteStringValue(Location);
 1637            if (Tags != null)
 38            {
 039                writer.WritePropertyName("tags");
 040                writer.WriteStartObject();
 041                foreach (var item in Tags)
 42                {
 043                    writer.WritePropertyName(item.Key);
 044                    writer.WriteStringValue(item.Value);
 45                }
 046                writer.WriteEndObject();
 47            }
 1648            writer.WritePropertyName("properties");
 1649            writer.WriteStartObject();
 1650            if (Description != null)
 51            {
 1652                writer.WritePropertyName("description");
 1653                writer.WriteStringValue(Description);
 54            }
 1655            if (Eula != null)
 56            {
 1657                writer.WritePropertyName("eula");
 1658                writer.WriteStringValue(Eula);
 59            }
 1660            if (PrivacyStatementUri != null)
 61            {
 1662                writer.WritePropertyName("privacyStatementUri");
 1663                writer.WriteStringValue(PrivacyStatementUri);
 64            }
 1665            if (ReleaseNoteUri != null)
 66            {
 1667                writer.WritePropertyName("releaseNoteUri");
 1668                writer.WriteStringValue(ReleaseNoteUri);
 69            }
 1670            if (EndOfLifeDate != null)
 71            {
 072                writer.WritePropertyName("endOfLifeDate");
 073                writer.WriteStringValue(EndOfLifeDate.Value, "O");
 74            }
 1675            if (SupportedOSType != null)
 76            {
 1677                writer.WritePropertyName("supportedOSType");
 1678                writer.WriteStringValue(SupportedOSType.Value.ToSerialString());
 79            }
 1680            writer.WriteEndObject();
 1681            writer.WriteEndObject();
 1682        }
 83
 84        internal static GalleryApplication DeserializeGalleryApplication(JsonElement element)
 85        {
 1686            string id = default;
 1687            string name = default;
 1688            string type = default;
 1689            string location = default;
 1690            IDictionary<string, string> tags = default;
 1691            string description = default;
 1692            string eula = default;
 1693            string privacyStatementUri = default;
 1694            string releaseNoteUri = default;
 1695            DateTimeOffset? endOfLifeDate = default;
 1696            OperatingSystemTypes? supportedOSType = default;
 19297            foreach (var property in element.EnumerateObject())
 98            {
 8099                if (property.NameEquals("id"))
 100                {
 16101                    if (property.Value.ValueKind == JsonValueKind.Null)
 102                    {
 103                        continue;
 104                    }
 16105                    id = property.Value.GetString();
 16106                    continue;
 107                }
 64108                if (property.NameEquals("name"))
 109                {
 16110                    if (property.Value.ValueKind == JsonValueKind.Null)
 111                    {
 112                        continue;
 113                    }
 16114                    name = property.Value.GetString();
 16115                    continue;
 116                }
 48117                if (property.NameEquals("type"))
 118                {
 16119                    if (property.Value.ValueKind == JsonValueKind.Null)
 120                    {
 121                        continue;
 122                    }
 16123                    type = property.Value.GetString();
 16124                    continue;
 125                }
 32126                if (property.NameEquals("location"))
 127                {
 16128                    location = property.Value.GetString();
 16129                    continue;
 130                }
 16131                if (property.NameEquals("tags"))
 132                {
 0133                    if (property.Value.ValueKind == JsonValueKind.Null)
 134                    {
 135                        continue;
 136                    }
 0137                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0138                    foreach (var property0 in property.Value.EnumerateObject())
 139                    {
 0140                        if (property0.Value.ValueKind == JsonValueKind.Null)
 141                        {
 0142                            dictionary.Add(property0.Name, null);
 143                        }
 144                        else
 145                        {
 0146                            dictionary.Add(property0.Name, property0.Value.GetString());
 147                        }
 148                    }
 0149                    tags = dictionary;
 0150                    continue;
 151                }
 16152                if (property.NameEquals("properties"))
 153                {
 192154                    foreach (var property0 in property.Value.EnumerateObject())
 155                    {
 80156                        if (property0.NameEquals("description"))
 157                        {
 16158                            if (property0.Value.ValueKind == JsonValueKind.Null)
 159                            {
 160                                continue;
 161                            }
 16162                            description = property0.Value.GetString();
 16163                            continue;
 164                        }
 64165                        if (property0.NameEquals("eula"))
 166                        {
 16167                            if (property0.Value.ValueKind == JsonValueKind.Null)
 168                            {
 169                                continue;
 170                            }
 16171                            eula = property0.Value.GetString();
 16172                            continue;
 173                        }
 48174                        if (property0.NameEquals("privacyStatementUri"))
 175                        {
 16176                            if (property0.Value.ValueKind == JsonValueKind.Null)
 177                            {
 178                                continue;
 179                            }
 16180                            privacyStatementUri = property0.Value.GetString();
 16181                            continue;
 182                        }
 32183                        if (property0.NameEquals("releaseNoteUri"))
 184                        {
 16185                            if (property0.Value.ValueKind == JsonValueKind.Null)
 186                            {
 187                                continue;
 188                            }
 16189                            releaseNoteUri = property0.Value.GetString();
 16190                            continue;
 191                        }
 16192                        if (property0.NameEquals("endOfLifeDate"))
 193                        {
 0194                            if (property0.Value.ValueKind == JsonValueKind.Null)
 195                            {
 196                                continue;
 197                            }
 0198                            endOfLifeDate = property0.Value.GetDateTimeOffset("O");
 0199                            continue;
 200                        }
 16201                        if (property0.NameEquals("supportedOSType"))
 202                        {
 16203                            if (property0.Value.ValueKind == JsonValueKind.Null)
 204                            {
 205                                continue;
 206                            }
 16207                            supportedOSType = property0.Value.GetString().ToOperatingSystemTypes();
 208                            continue;
 209                        }
 210                    }
 211                    continue;
 212                }
 213            }
 16214            return new GalleryApplication(id, name, type, location, tags, description, eula, privacyStatementUri, releas
 215        }
 216    }
 217}