< Summary

Class:Azure.ResourceManager.Compute.Models.SnapshotUpdate
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SnapshotUpdate.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SnapshotUpdate.Serialization.cs
Covered lines:21
Uncovered lines:23
Coverable lines:44
Total lines:110
Line coverage:47.7% (21 of 44)
Covered branches:9
Total branches:14
Branch coverage:64.2% (9 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_Tags()-100%100%
get_Sku()-0%100%
get_OsType()-0%100%
get_DiskSizeGB()-0%100%
get_EncryptionSettingsCollection()-0%100%
get_Encryption()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-64.29%64.29%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SnapshotUpdate.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> Snapshot update resource. </summary>
 13    public partial class SnapshotUpdate
 14    {
 15        /// <summary> Initializes a new instance of SnapshotUpdate. </summary>
 816        public SnapshotUpdate()
 17        {
 818        }
 19
 20        /// <summary> Initializes a new instance of SnapshotUpdate. </summary>
 21        /// <param name="tags"> Resource tags. </param>
 22        /// <param name="sku"> The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. </param>
 23        /// <param name="osType"> the Operating System type. </param>
 24        /// <param name="diskSizeGB"> If creationData.createOption is Empty, this field is mandatory and it indicates th
 25        /// <param name="encryptionSettingsCollection"> Encryption settings collection used be Azure Disk Encryption, ca
 26        /// <param name="encryption"> Encryption property can be used to encrypt data at rest with customer managed keys
 027        internal SnapshotUpdate(IDictionary<string, string> tags, SnapshotSku sku, OperatingSystemTypes? osType, int? di
 28        {
 029            Tags = tags;
 030            Sku = sku;
 031            OsType = osType;
 032            DiskSizeGB = diskSizeGB;
 033            EncryptionSettingsCollection = encryptionSettingsCollection;
 034            Encryption = encryption;
 035        }
 36
 37        /// <summary> Resource tags. </summary>
 4038        public IDictionary<string, string> Tags { get; set; }
 39        /// <summary> The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. </summary>
 040        public SnapshotSku Sku { get; set; }
 41        /// <summary> the Operating System type. </summary>
 042        public OperatingSystemTypes? OsType { get; set; }
 43        /// <summary> If creationData.createOption is Empty, this field is mandatory and it indicates the size of the di
 044        public int? DiskSizeGB { get; set; }
 45        /// <summary> Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption sett
 046        public EncryptionSettingsCollection EncryptionSettingsCollection { get; set; }
 47        /// <summary> Encryption property can be used to encrypt data at rest with customer managed keys or platform man
 048        public Encryption Encryption { get; set; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SnapshotUpdate.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 SnapshotUpdate : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            if (Tags != null)
 19            {
 1620                writer.WritePropertyName("tags");
 1621                writer.WriteStartObject();
 6422                foreach (var item in Tags)
 23                {
 1624                    writer.WritePropertyName(item.Key);
 1625                    writer.WriteStringValue(item.Value);
 26                }
 1627                writer.WriteEndObject();
 28            }
 1629            if (Sku != null)
 30            {
 031                writer.WritePropertyName("sku");
 032                writer.WriteObjectValue(Sku);
 33            }
 1634            writer.WritePropertyName("properties");
 1635            writer.WriteStartObject();
 1636            if (OsType != null)
 37            {
 038                writer.WritePropertyName("osType");
 039                writer.WriteStringValue(OsType.Value.ToSerialString());
 40            }
 1641            if (DiskSizeGB != null)
 42            {
 043                writer.WritePropertyName("diskSizeGB");
 044                writer.WriteNumberValue(DiskSizeGB.Value);
 45            }
 1646            if (EncryptionSettingsCollection != null)
 47            {
 048                writer.WritePropertyName("encryptionSettingsCollection");
 049                writer.WriteObjectValue(EncryptionSettingsCollection);
 50            }
 1651            if (Encryption != null)
 52            {
 053                writer.WritePropertyName("encryption");
 054                writer.WriteObjectValue(Encryption);
 55            }
 1656            writer.WriteEndObject();
 1657            writer.WriteEndObject();
 1658        }
 59    }
 60}