< Summary

Class:Azure.ResourceManager.Resources.Models.ScriptLog
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptLog.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptLog.Serialization.cs
Covered lines:26
Uncovered lines:21
Coverable lines:47
Total lines:130
Line coverage:55.3% (26 of 47)
Covered branches:22
Total branches:30
Branch coverage:73.3% (22 of 30)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Log()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeScriptLog(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptLog.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.Resources.Models
 9{
 10    /// <summary> Script execution log object. </summary>
 11    public partial class ScriptLog : AzureResourceBase
 12    {
 13        /// <summary> Initializes a new instance of ScriptLog. </summary>
 014        public ScriptLog()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ScriptLog. </summary>
 19        /// <param name="id"> String Id used to locate any resource on Azure. </param>
 20        /// <param name="name"> Name of this resource. </param>
 21        /// <param name="type"> Type of this resource. </param>
 22        /// <param name="log"> Script execution logs in text format. </param>
 423        internal ScriptLog(string id, string name, string type, string log) : base(id, name, type)
 24        {
 425            Log = log;
 426        }
 27
 28        /// <summary> Script execution logs in text format. </summary>
 029        public string Log { get; }
 30    }
 31}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptLog.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 ScriptLog : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Id != null)
 19            {
 020                writer.WritePropertyName("id");
 021                writer.WriteStringValue(Id);
 22            }
 023            if (Name != null)
 24            {
 025                writer.WritePropertyName("name");
 026                writer.WriteStringValue(Name);
 27            }
 028            if (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteStringValue(Type);
 32            }
 033            writer.WritePropertyName("properties");
 034            writer.WriteStartObject();
 035            if (Log != null)
 36            {
 037                writer.WritePropertyName("log");
 038                writer.WriteStringValue(Log);
 39            }
 040            writer.WriteEndObject();
 041            writer.WriteEndObject();
 042        }
 43
 44        internal static ScriptLog DeserializeScriptLog(JsonElement element)
 45        {
 446            string id = default;
 447            string name = default;
 448            string type = default;
 449            string log = default;
 4050            foreach (var property in element.EnumerateObject())
 51            {
 1652                if (property.NameEquals("id"))
 53                {
 454                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 458                    id = property.Value.GetString();
 459                    continue;
 60                }
 1261                if (property.NameEquals("name"))
 62                {
 463                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 467                    name = property.Value.GetString();
 468                    continue;
 69                }
 870                if (property.NameEquals("type"))
 71                {
 472                    if (property.Value.ValueKind == JsonValueKind.Null)
 73                    {
 74                        continue;
 75                    }
 476                    type = property.Value.GetString();
 477                    continue;
 78                }
 479                if (property.NameEquals("properties"))
 80                {
 1681                    foreach (var property0 in property.Value.EnumerateObject())
 82                    {
 483                        if (property0.NameEquals("log"))
 84                        {
 485                            if (property0.Value.ValueKind == JsonValueKind.Null)
 86                            {
 87                                continue;
 88                            }
 489                            log = property0.Value.GetString();
 90                            continue;
 91                        }
 92                    }
 93                    continue;
 94                }
 95            }
 496            return new ScriptLog(id, name, type, log);
 97        }
 98    }
 99}