< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Schema()-0%100%
get_ContentVersion()-0%100%
get_Parameters()-0%100%
get_Resources()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualMachineCaptureResult(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineCaptureResult.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;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Output of virtual machine capture operation. </summary>
 13    public partial class VirtualMachineCaptureResult : SubResource
 14    {
 15        /// <summary> Initializes a new instance of VirtualMachineCaptureResult. </summary>
 016        public VirtualMachineCaptureResult()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualMachineCaptureResult. </summary>
 21        /// <param name="id"> Resource Id. </param>
 22        /// <param name="schema"> the schema of the captured virtual machine. </param>
 23        /// <param name="contentVersion"> the version of the content. </param>
 24        /// <param name="parameters"> parameters of the captured virtual machine. </param>
 25        /// <param name="resources"> a list of resource items of the captured virtual machine. </param>
 026        internal VirtualMachineCaptureResult(string id, string schema, string contentVersion, object parameters, IList<o
 27        {
 028            Schema = schema;
 029            ContentVersion = contentVersion;
 030            Parameters = parameters;
 031            Resources = resources;
 032        }
 33
 34        /// <summary> the schema of the captured virtual machine. </summary>
 035        public string Schema { get; }
 36        /// <summary> the version of the content. </summary>
 037        public string ContentVersion { get; }
 38        /// <summary> parameters of the captured virtual machine. </summary>
 039        public object Parameters { get; }
 40        /// <summary> a list of resource items of the captured virtual machine. </summary>
 041        public IList<object> Resources { get; }
 42    }
 43}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineCaptureResult.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 VirtualMachineCaptureResult : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Schema != null)
 20            {
 021                writer.WritePropertyName("$schema");
 022                writer.WriteStringValue(Schema);
 23            }
 024            if (ContentVersion != null)
 25            {
 026                writer.WritePropertyName("contentVersion");
 027                writer.WriteStringValue(ContentVersion);
 28            }
 029            if (Parameters != null)
 30            {
 031                writer.WritePropertyName("parameters");
 032                writer.WriteObjectValue(Parameters);
 33            }
 034            if (Resources != null)
 35            {
 036                writer.WritePropertyName("resources");
 037                writer.WriteStartArray();
 038                foreach (var item in Resources)
 39                {
 040                    writer.WriteObjectValue(item);
 41                }
 042                writer.WriteEndArray();
 43            }
 044            if (Id != null)
 45            {
 046                writer.WritePropertyName("id");
 047                writer.WriteStringValue(Id);
 48            }
 049            writer.WriteEndObject();
 050        }
 51
 52        internal static VirtualMachineCaptureResult DeserializeVirtualMachineCaptureResult(JsonElement element)
 53        {
 054            string schema = default;
 055            string contentVersion = default;
 056            object parameters = default;
 057            IList<object> resources = default;
 058            string id = default;
 059            foreach (var property in element.EnumerateObject())
 60            {
 061                if (property.NameEquals("$schema"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    schema = property.Value.GetString();
 068                    continue;
 69                }
 070                if (property.NameEquals("contentVersion"))
 71                {
 072                    if (property.Value.ValueKind == JsonValueKind.Null)
 73                    {
 74                        continue;
 75                    }
 076                    contentVersion = property.Value.GetString();
 077                    continue;
 78                }
 079                if (property.NameEquals("parameters"))
 80                {
 081                    if (property.Value.ValueKind == JsonValueKind.Null)
 82                    {
 83                        continue;
 84                    }
 085                    parameters = property.Value.GetObject();
 086                    continue;
 87                }
 088                if (property.NameEquals("resources"))
 89                {
 090                    if (property.Value.ValueKind == JsonValueKind.Null)
 91                    {
 92                        continue;
 93                    }
 094                    List<object> array = new List<object>();
 095                    foreach (var item in property.Value.EnumerateArray())
 96                    {
 097                        if (item.ValueKind == JsonValueKind.Null)
 98                        {
 099                            array.Add(null);
 100                        }
 101                        else
 102                        {
 0103                            array.Add(item.GetObject());
 104                        }
 105                    }
 0106                    resources = array;
 0107                    continue;
 108                }
 0109                if (property.NameEquals("id"))
 110                {
 0111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 0115                    id = property.Value.GetString();
 116                    continue;
 117                }
 118            }
 0119            return new VirtualMachineCaptureResult(id, schema, contentVersion, parameters, resources);
 120        }
 121    }
 122}