< Summary

Class:Azure.ResourceManager.Resources.Models.DeploymentScriptPropertiesBase
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\DeploymentScriptPropertiesBase.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\DeploymentScriptPropertiesBase.Serialization.cs
Covered lines:0
Uncovered lines:77
Coverable lines:77
Total lines:188
Line coverage:0% (0 of 77)
Covered branches:0
Total branches:44
Branch coverage:0% (0 of 44)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_ContainerSettings()-0%100%
get_StorageAccountSettings()-0%100%
get_CleanupPreference()-0%100%
get_ProvisioningState()-0%100%
get_Status()-0%100%
get_Outputs()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDeploymentScriptPropertiesBase(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\DeploymentScriptPropertiesBase.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.Resources.Models
 11{
 12    /// <summary> Common properties for the deployment script. </summary>
 13    public partial class DeploymentScriptPropertiesBase
 14    {
 15        /// <summary> Initializes a new instance of DeploymentScriptPropertiesBase. </summary>
 016        public DeploymentScriptPropertiesBase()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of DeploymentScriptPropertiesBase. </summary>
 21        /// <param name="containerSettings"> Container settings. </param>
 22        /// <param name="storageAccountSettings"> Storage Account settings. </param>
 23        /// <param name="cleanupPreference"> The clean up preference when the script execution gets in a terminal state.
 24        /// <param name="provisioningState"> State of the script execution. This only appears in the response. </param>
 25        /// <param name="status"> Contains the results of script execution. </param>
 26        /// <param name="outputs"> List of script outputs. </param>
 027        internal DeploymentScriptPropertiesBase(ContainerConfiguration containerSettings, StorageAccountConfiguration st
 28        {
 029            ContainerSettings = containerSettings;
 030            StorageAccountSettings = storageAccountSettings;
 031            CleanupPreference = cleanupPreference;
 032            ProvisioningState = provisioningState;
 033            Status = status;
 034            Outputs = outputs;
 035        }
 36
 37        /// <summary> Container settings. </summary>
 038        public ContainerConfiguration ContainerSettings { get; set; }
 39        /// <summary> Storage Account settings. </summary>
 040        public StorageAccountConfiguration StorageAccountSettings { get; set; }
 41        /// <summary> The clean up preference when the script execution gets in a terminal state. Default setting is &ap
 042        public CleanupOptions? CleanupPreference { get; set; }
 43        /// <summary> State of the script execution. This only appears in the response. </summary>
 044        public ScriptProvisioningState? ProvisioningState { get; }
 45        /// <summary> Contains the results of script execution. </summary>
 046        public ScriptStatus Status { get; }
 47        /// <summary> List of script outputs. </summary>
 048        public IDictionary<string, object> Outputs { get; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\DeploymentScriptPropertiesBase.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.Resources.Models
 13{
 14    public partial class DeploymentScriptPropertiesBase : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (ContainerSettings != null)
 20            {
 021                writer.WritePropertyName("containerSettings");
 022                writer.WriteObjectValue(ContainerSettings);
 23            }
 024            if (StorageAccountSettings != null)
 25            {
 026                writer.WritePropertyName("storageAccountSettings");
 027                writer.WriteObjectValue(StorageAccountSettings);
 28            }
 029            if (CleanupPreference != null)
 30            {
 031                writer.WritePropertyName("cleanupPreference");
 032                writer.WriteStringValue(CleanupPreference.Value.ToString());
 33            }
 034            if (ProvisioningState != null)
 35            {
 036                writer.WritePropertyName("provisioningState");
 037                writer.WriteStringValue(ProvisioningState.Value.ToString());
 38            }
 039            if (Status != null)
 40            {
 041                writer.WritePropertyName("status");
 042                writer.WriteObjectValue(Status);
 43            }
 044            if (Outputs != null)
 45            {
 046                writer.WritePropertyName("outputs");
 047                writer.WriteStartObject();
 048                foreach (var item in Outputs)
 49                {
 050                    writer.WritePropertyName(item.Key);
 051                    writer.WriteObjectValue(item.Value);
 52                }
 053                writer.WriteEndObject();
 54            }
 055            writer.WriteEndObject();
 056        }
 57
 58        internal static DeploymentScriptPropertiesBase DeserializeDeploymentScriptPropertiesBase(JsonElement element)
 59        {
 060            ContainerConfiguration containerSettings = default;
 061            StorageAccountConfiguration storageAccountSettings = default;
 062            CleanupOptions? cleanupPreference = default;
 063            ScriptProvisioningState? provisioningState = default;
 064            ScriptStatus status = default;
 065            IDictionary<string, object> outputs = default;
 066            foreach (var property in element.EnumerateObject())
 67            {
 068                if (property.NameEquals("containerSettings"))
 69                {
 070                    if (property.Value.ValueKind == JsonValueKind.Null)
 71                    {
 72                        continue;
 73                    }
 074                    containerSettings = ContainerConfiguration.DeserializeContainerConfiguration(property.Value);
 075                    continue;
 76                }
 077                if (property.NameEquals("storageAccountSettings"))
 78                {
 079                    if (property.Value.ValueKind == JsonValueKind.Null)
 80                    {
 81                        continue;
 82                    }
 083                    storageAccountSettings = StorageAccountConfiguration.DeserializeStorageAccountConfiguration(property
 084                    continue;
 85                }
 086                if (property.NameEquals("cleanupPreference"))
 87                {
 088                    if (property.Value.ValueKind == JsonValueKind.Null)
 89                    {
 90                        continue;
 91                    }
 092                    cleanupPreference = new CleanupOptions(property.Value.GetString());
 093                    continue;
 94                }
 095                if (property.NameEquals("provisioningState"))
 96                {
 097                    if (property.Value.ValueKind == JsonValueKind.Null)
 98                    {
 99                        continue;
 100                    }
 0101                    provisioningState = new ScriptProvisioningState(property.Value.GetString());
 0102                    continue;
 103                }
 0104                if (property.NameEquals("status"))
 105                {
 0106                    if (property.Value.ValueKind == JsonValueKind.Null)
 107                    {
 108                        continue;
 109                    }
 0110                    status = ScriptStatus.DeserializeScriptStatus(property.Value);
 0111                    continue;
 112                }
 0113                if (property.NameEquals("outputs"))
 114                {
 0115                    if (property.Value.ValueKind == JsonValueKind.Null)
 116                    {
 117                        continue;
 118                    }
 0119                    Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0120                    foreach (var property0 in property.Value.EnumerateObject())
 121                    {
 0122                        if (property0.Value.ValueKind == JsonValueKind.Null)
 123                        {
 0124                            dictionary.Add(property0.Name, null);
 125                        }
 126                        else
 127                        {
 0128                            dictionary.Add(property0.Name, property0.Value.GetObject());
 129                        }
 130                    }
 0131                    outputs = dictionary;
 132                    continue;
 133                }
 134            }
 0135            return new DeploymentScriptPropertiesBase(containerSettings, storageAccountSettings, cleanupPreference, prov
 136        }
 137    }
 138}