< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Id()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeGalleryArtifactVersionSource(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryArtifactVersionSource.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> The gallery artifact version source. </summary>
 11    public partial class GalleryArtifactVersionSource
 12    {
 13        /// <summary> Initializes a new instance of GalleryArtifactVersionSource. </summary>
 414        public GalleryArtifactVersionSource()
 15        {
 416        }
 17
 18        /// <summary> Initializes a new instance of GalleryArtifactVersionSource. </summary>
 19        /// <param name="id"> The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or us
 4820        internal GalleryArtifactVersionSource(string id)
 21        {
 4822            Id = id;
 4823        }
 24
 25        /// <summary> The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image
 9226        public string Id { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryArtifactVersionSource.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 GalleryArtifactVersionSource : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            if (Id != null)
 19            {
 1620                writer.WritePropertyName("id");
 1621                writer.WriteStringValue(Id);
 22            }
 1623            writer.WriteEndObject();
 1624        }
 25
 26        internal static GalleryArtifactVersionSource DeserializeGalleryArtifactVersionSource(JsonElement element)
 27        {
 4828            string id = default;
 14429            foreach (var property in element.EnumerateObject())
 30            {
 2431                if (property.NameEquals("id"))
 32                {
 2433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 2437                    id = property.Value.GetString();
 38                    continue;
 39                }
 40            }
 4841            return new GalleryArtifactVersionSource(id);
 42        }
 43    }
 44}