< Summary

Class:Azure.ResourceManager.Resources.Models.ScriptStatus
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptStatus.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptStatus.Serialization.cs
Covered lines:44
Uncovered lines:24
Coverable lines:68
Total lines:170
Line coverage:64.7% (44 of 68)
Covered branches:26
Total branches:38
Branch coverage:68.4% (26 of 38)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ContainerInstanceId()-100%100%
get_StorageAccountId()-100%100%
get_StartTime()-100%100%
get_EndTime()-100%100%
get_ExpirationTime()-0%100%
get_Error()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeScriptStatus(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptStatus.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;
 9
 10namespace Azure.ResourceManager.Resources.Models
 11{
 12    /// <summary> Generic object modeling results of script execution. </summary>
 13    public partial class ScriptStatus
 14    {
 15        /// <summary> Initializes a new instance of ScriptStatus. </summary>
 016        public ScriptStatus()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ScriptStatus. </summary>
 21        /// <param name="containerInstanceId"> ACI resource Id. </param>
 22        /// <param name="storageAccountId"> Storage account resource Id. </param>
 23        /// <param name="startTime"> Start time of the script execution. </param>
 24        /// <param name="endTime"> End time of the script execution. </param>
 25        /// <param name="expirationTime"> Time the deployment script resource will expire. </param>
 26        /// <param name="error"> Error that is relayed from the script execution. </param>
 7427        internal ScriptStatus(string containerInstanceId, string storageAccountId, DateTimeOffset? startTime, DateTimeOf
 28        {
 7429            ContainerInstanceId = containerInstanceId;
 7430            StorageAccountId = storageAccountId;
 7431            StartTime = startTime;
 7432            EndTime = endTime;
 7433            ExpirationTime = expirationTime;
 7434            Error = error;
 7435        }
 36
 37        /// <summary> ACI resource Id. </summary>
 438        public string ContainerInstanceId { get; }
 39        /// <summary> Storage account resource Id. </summary>
 440        public string StorageAccountId { get; }
 41        /// <summary> Start time of the script execution. </summary>
 442        public DateTimeOffset? StartTime { get; }
 43        /// <summary> End time of the script execution. </summary>
 444        public DateTimeOffset? EndTime { get; }
 45        /// <summary> Time the deployment script resource will expire. </summary>
 046        public DateTimeOffset? ExpirationTime { get; }
 47        /// <summary> Error that is relayed from the script execution. </summary>
 8248        public ErrorResponse Error { get; set; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptStatus.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Resources.Models
 13{
 14    public partial class ScriptStatus : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (ContainerInstanceId != null)
 20            {
 021                writer.WritePropertyName("containerInstanceId");
 022                writer.WriteStringValue(ContainerInstanceId);
 23            }
 024            if (StorageAccountId != null)
 25            {
 026                writer.WritePropertyName("storageAccountId");
 027                writer.WriteStringValue(StorageAccountId);
 28            }
 029            if (StartTime != null)
 30            {
 031                writer.WritePropertyName("startTime");
 032                writer.WriteStringValue(StartTime.Value, "O");
 33            }
 034            if (EndTime != null)
 35            {
 036                writer.WritePropertyName("endTime");
 037                writer.WriteStringValue(EndTime.Value, "O");
 38            }
 039            if (ExpirationTime != null)
 40            {
 041                writer.WritePropertyName("expirationTime");
 042                writer.WriteStringValue(ExpirationTime.Value, "O");
 43            }
 044            if (Error != null)
 45            {
 046                writer.WritePropertyName("error");
 047                writer.WriteObjectValue(Error);
 48            }
 049            writer.WriteEndObject();
 050        }
 51
 52        internal static ScriptStatus DeserializeScriptStatus(JsonElement element)
 53        {
 7454            string containerInstanceId = default;
 7455            string storageAccountId = default;
 7456            DateTimeOffset? startTime = default;
 7457            DateTimeOffset? endTime = default;
 7458            DateTimeOffset? expirationTime = default;
 7459            ErrorResponse error = default;
 70860            foreach (var property in element.EnumerateObject())
 61            {
 28062                if (property.NameEquals("containerInstanceId"))
 63                {
 5664                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 5668                    containerInstanceId = property.Value.GetString();
 5669                    continue;
 70                }
 22471                if (property.NameEquals("storageAccountId"))
 72                {
 5873                    if (property.Value.ValueKind == JsonValueKind.Null)
 74                    {
 75                        continue;
 76                    }
 5877                    storageAccountId = property.Value.GetString();
 5878                    continue;
 79                }
 16680                if (property.NameEquals("startTime"))
 81                {
 7082                    if (property.Value.ValueKind == JsonValueKind.Null)
 83                    {
 84                        continue;
 85                    }
 7086                    startTime = property.Value.GetDateTimeOffset("O");
 7087                    continue;
 88                }
 9689                if (property.NameEquals("endTime"))
 90                {
 4091                    if (property.Value.ValueKind == JsonValueKind.Null)
 92                    {
 93                        continue;
 94                    }
 4095                    endTime = property.Value.GetDateTimeOffset("O");
 4096                    continue;
 97                }
 5698                if (property.NameEquals("expirationTime"))
 99                {
 40100                    if (property.Value.ValueKind == JsonValueKind.Null)
 101                    {
 102                        continue;
 103                    }
 40104                    expirationTime = property.Value.GetDateTimeOffset("O");
 40105                    continue;
 106                }
 16107                if (property.NameEquals("error"))
 108                {
 16109                    if (property.Value.ValueKind == JsonValueKind.Null)
 110                    {
 111                        continue;
 112                    }
 16113                    error = ErrorResponse.DeserializeErrorResponse(property.Value);
 114                    continue;
 115                }
 116            }
 74117            return new ScriptStatus(containerInstanceId, storageAccountId, startTime, endTime, expirationTime, error);
 118        }
 119    }
 120}