< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_PassName()-0%100%
get_ComponentName()-0%100%
get_SettingName()-0%100%
get_Content()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAdditionalUnattendContent(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\AdditionalUnattendContent.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> Specifies additional XML formatted information that can be included in the Unattend.xml file, which is
 11    public partial class AdditionalUnattendContent
 12    {
 13        /// <summary> Initializes a new instance of AdditionalUnattendContent. </summary>
 014        public AdditionalUnattendContent()
 15        {
 016            PassName = "OobeSystem";
 017            ComponentName = "Microsoft-Windows-Shell-Setup";
 018        }
 19
 20        /// <summary> Initializes a new instance of AdditionalUnattendContent. </summary>
 21        /// <param name="passName"> The pass name. Currently, the only allowable value is OobeSystem. </param>
 22        /// <param name="componentName"> The component name. Currently, the only allowable value is Microsoft-Windows-Sh
 23        /// <param name="settingName"> Specifies the name of the setting to which the content applies. Possible values a
 24        /// <param name="content"> Specifies the XML formatted content that is added to the unattend.xml file for the sp
 025        internal AdditionalUnattendContent(string passName, string componentName, SettingNames? settingName, string cont
 26        {
 027            PassName = passName;
 028            ComponentName = componentName;
 029            SettingName = settingName;
 030            Content = content;
 031        }
 32
 33        /// <summary> The pass name. Currently, the only allowable value is OobeSystem. </summary>
 034        public string PassName { get; set; }
 35        /// <summary> The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. </summar
 036        public string ComponentName { get; set; }
 37        /// <summary> Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCom
 038        public SettingNames? SettingName { get; set; }
 39        /// <summary> Specifies the XML formatted content that is added to the unattend.xml file for the specified path 
 040        public string Content { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\AdditionalUnattendContent.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 AdditionalUnattendContent : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (PassName != null)
 19            {
 020                writer.WritePropertyName("passName");
 021                writer.WriteStringValue(PassName);
 22            }
 023            if (ComponentName != null)
 24            {
 025                writer.WritePropertyName("componentName");
 026                writer.WriteStringValue(ComponentName);
 27            }
 028            if (SettingName != null)
 29            {
 030                writer.WritePropertyName("settingName");
 031                writer.WriteStringValue(SettingName.Value.ToSerialString());
 32            }
 033            if (Content != null)
 34            {
 035                writer.WritePropertyName("content");
 036                writer.WriteStringValue(Content);
 37            }
 038            writer.WriteEndObject();
 039        }
 40
 41        internal static AdditionalUnattendContent DeserializeAdditionalUnattendContent(JsonElement element)
 42        {
 043            string passName = default;
 044            string componentName = default;
 045            SettingNames? settingName = default;
 046            string content = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("passName"))
 50                {
 051                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 055                    passName = property.Value.GetString();
 056                    continue;
 57                }
 058                if (property.NameEquals("componentName"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    componentName = property.Value.GetString();
 065                    continue;
 66                }
 067                if (property.NameEquals("settingName"))
 68                {
 069                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 073                    settingName = property.Value.GetString().ToSettingNames();
 074                    continue;
 75                }
 076                if (property.NameEquals("content"))
 77                {
 078                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 082                    content = property.Value.GetString();
 83                    continue;
 84                }
 85            }
 086            return new AdditionalUnattendContent(passName, componentName, settingName, content);
 87        }
 88    }
 89}