< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Publisher()-0%100%
get_Product()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeImagePurchasePlan(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ImagePurchasePlan.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
 8namespace Azure.ResourceManager.Compute.Models
 9{
 10    /// <summary> Describes the gallery Image Definition purchase plan. This is used by marketplace images. </summary>
 11    public partial class ImagePurchasePlan
 12    {
 13        /// <summary> Initializes a new instance of ImagePurchasePlan. </summary>
 014        public ImagePurchasePlan()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ImagePurchasePlan. </summary>
 19        /// <param name="name"> The plan ID. </param>
 20        /// <param name="publisher"> The publisher ID. </param>
 21        /// <param name="product"> The product ID. </param>
 022        internal ImagePurchasePlan(string name, string publisher, string product)
 23        {
 024            Name = name;
 025            Publisher = publisher;
 026            Product = product;
 027        }
 28
 29        /// <summary> The plan ID. </summary>
 030        public string Name { get; set; }
 31        /// <summary> The publisher ID. </summary>
 032        public string Publisher { get; set; }
 33        /// <summary> The product ID. </summary>
 034        public string Product { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ImagePurchasePlan.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    public partial class ImagePurchasePlan : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Name != null)
 19            {
 020                writer.WritePropertyName("name");
 021                writer.WriteStringValue(Name);
 22            }
 023            if (Publisher != null)
 24            {
 025                writer.WritePropertyName("publisher");
 026                writer.WriteStringValue(Publisher);
 27            }
 028            if (Product != null)
 29            {
 030                writer.WritePropertyName("product");
 031                writer.WriteStringValue(Product);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static ImagePurchasePlan DeserializeImagePurchasePlan(JsonElement element)
 37        {
 038            string name = default;
 039            string publisher = default;
 040            string product = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("name"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    name = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("publisher"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    publisher = property.Value.GetString();
 059                    continue;
 60                }
 061                if (property.NameEquals("product"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    product = property.Value.GetString();
 68                    continue;
 69                }
 70            }
 071            return new ImagePurchasePlan(name, publisher, product);
 72        }
 73    }
 74}