< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\PlanAutoGenerated.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;
 9
 10namespace Azure.ResourceManager.Resources.Models
 11{
 12    /// <summary> Plan for the managed application. </summary>
 13    public partial class PlanAutoGenerated
 14    {
 15        /// <summary> Initializes a new instance of PlanAutoGenerated. </summary>
 16        /// <param name="name"> The plan name. </param>
 17        /// <param name="publisher"> The publisher ID. </param>
 18        /// <param name="product"> The product code. </param>
 19        /// <param name="version"> The plan&apos;s version. </param>
 020        public PlanAutoGenerated(string name, string publisher, string product, string version)
 21        {
 022            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 026            if (publisher == null)
 27            {
 028                throw new ArgumentNullException(nameof(publisher));
 29            }
 030            if (product == null)
 31            {
 032                throw new ArgumentNullException(nameof(product));
 33            }
 034            if (version == null)
 35            {
 036                throw new ArgumentNullException(nameof(version));
 37            }
 38
 039            Name = name;
 040            Publisher = publisher;
 041            Product = product;
 042            Version = version;
 043        }
 44
 45        /// <summary> Initializes a new instance of PlanAutoGenerated. </summary>
 46        /// <param name="name"> The plan name. </param>
 47        /// <param name="publisher"> The publisher ID. </param>
 48        /// <param name="product"> The product code. </param>
 49        /// <param name="promotionCode"> The promotion code. </param>
 50        /// <param name="version"> The plan&apos;s version. </param>
 051        internal PlanAutoGenerated(string name, string publisher, string product, string promotionCode, string version)
 52        {
 053            Name = name;
 054            Publisher = publisher;
 055            Product = product;
 056            PromotionCode = promotionCode;
 057            Version = version;
 058        }
 59
 60        /// <summary> The plan name. </summary>
 061        public string Name { get; set; }
 62        /// <summary> The publisher ID. </summary>
 063        public string Publisher { get; set; }
 64        /// <summary> The product code. </summary>
 065        public string Product { get; set; }
 66        /// <summary> The promotion code. </summary>
 067        public string PromotionCode { get; set; }
 68        /// <summary> The plan&apos;s version. </summary>
 069        public string Version { get; set; }
 70    }
 71}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\PlanAutoGenerated.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.Resources.Models
 12{
 13    public partial class PlanAutoGenerated : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("name");
 019            writer.WriteStringValue(Name);
 020            writer.WritePropertyName("publisher");
 021            writer.WriteStringValue(Publisher);
 022            writer.WritePropertyName("product");
 023            writer.WriteStringValue(Product);
 024            if (PromotionCode != null)
 25            {
 026                writer.WritePropertyName("promotionCode");
 027                writer.WriteStringValue(PromotionCode);
 28            }
 029            writer.WritePropertyName("version");
 030            writer.WriteStringValue(Version);
 031            writer.WriteEndObject();
 032        }
 33
 34        internal static PlanAutoGenerated DeserializePlanAutoGenerated(JsonElement element)
 35        {
 036            string name = default;
 037            string publisher = default;
 038            string product = default;
 039            string promotionCode = default;
 040            string version = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("name"))
 44                {
 045                    name = property.Value.GetString();
 046                    continue;
 47                }
 048                if (property.NameEquals("publisher"))
 49                {
 050                    publisher = property.Value.GetString();
 051                    continue;
 52                }
 053                if (property.NameEquals("product"))
 54                {
 055                    product = property.Value.GetString();
 056                    continue;
 57                }
 058                if (property.NameEquals("promotionCode"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    promotionCode = property.Value.GetString();
 065                    continue;
 66                }
 067                if (property.NameEquals("version"))
 68                {
 069                    version = property.Value.GetString();
 70                    continue;
 71                }
 72            }
 073            return new PlanAutoGenerated(name, publisher, product, promotionCode, version);
 74        }
 75    }
 76}