< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_AzPowerShellVersion()-0%100%
get_PrimaryScriptUri()-0%100%
get_SupportingScriptUris()-0%100%
get_ScriptContent()-0%100%
get_Arguments()-0%100%
get_EnvironmentVariables()-0%100%
get_ForceUpdateTag()-0%100%
get_RetentionInterval()-0%100%
get_Timeout()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzurePowerShellScriptProperties(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AzurePowerShellScriptProperties.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.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Resources.Models
 12{
 13    /// <summary> Properties of the Azure PowerShell script object. </summary>
 14    public partial class AzurePowerShellScriptProperties : DeploymentScriptPropertiesBase
 15    {
 16        /// <summary> Initializes a new instance of AzurePowerShellScriptProperties. </summary>
 17        /// <param name="azPowerShellVersion"> Azure PowerShell module version to be used. </param>
 18        /// <param name="retentionInterval"> Interval for which the service retains the script resource after it reaches
 019        public AzurePowerShellScriptProperties(string azPowerShellVersion, TimeSpan retentionInterval)
 20        {
 021            if (azPowerShellVersion == null)
 22            {
 023                throw new ArgumentNullException(nameof(azPowerShellVersion));
 24            }
 25
 026            AzPowerShellVersion = azPowerShellVersion;
 027            RetentionInterval = retentionInterval;
 028        }
 29
 30        /// <summary> Initializes a new instance of AzurePowerShellScriptProperties. </summary>
 31        /// <param name="containerSettings"> Container settings. </param>
 32        /// <param name="storageAccountSettings"> Storage Account settings. </param>
 33        /// <param name="cleanupPreference"> The clean up preference when the script execution gets in a terminal state.
 34        /// <param name="provisioningState"> State of the script execution. This only appears in the response. </param>
 35        /// <param name="status"> Contains the results of script execution. </param>
 36        /// <param name="outputs"> List of script outputs. </param>
 37        /// <param name="azPowerShellVersion"> Azure PowerShell module version to be used. </param>
 38        /// <param name="primaryScriptUri"> Uri for the script. This is the entry point for the external script. </param
 39        /// <param name="supportingScriptUris"> Supporting files for the external script. </param>
 40        /// <param name="scriptContent"> Script body. </param>
 41        /// <param name="arguments"> Command line arguments to pass to the script. Arguments are separated by spaces. ex
 42        /// <param name="environmentVariables"> The environment variables to pass over to the script. </param>
 43        /// <param name="forceUpdateTag"> Gets or sets how the deployment script should be forced to execute even if the
 44        /// <param name="retentionInterval"> Interval for which the service retains the script resource after it reaches
 45        /// <param name="timeout"> Maximum allowed script execution time specified in ISO 8601 format. Default value is 
 046        internal AzurePowerShellScriptProperties(ContainerConfiguration containerSettings, StorageAccountConfiguration s
 47        {
 048            AzPowerShellVersion = azPowerShellVersion;
 049            PrimaryScriptUri = primaryScriptUri;
 050            SupportingScriptUris = supportingScriptUris;
 051            ScriptContent = scriptContent;
 052            Arguments = arguments;
 053            EnvironmentVariables = environmentVariables;
 054            ForceUpdateTag = forceUpdateTag;
 055            RetentionInterval = retentionInterval;
 056            Timeout = timeout;
 057        }
 58
 59        /// <summary> Azure PowerShell module version to be used. </summary>
 060        public string AzPowerShellVersion { get; set; }
 61        /// <summary> Uri for the script. This is the entry point for the external script. </summary>
 062        public string PrimaryScriptUri { get; set; }
 63        /// <summary> Supporting files for the external script. </summary>
 064        public IList<string> SupportingScriptUris { get; set; }
 65        /// <summary> Script body. </summary>
 066        public string ScriptContent { get; set; }
 67        /// <summary> Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -
 068        public string Arguments { get; set; }
 69        /// <summary> The environment variables to pass over to the script. </summary>
 070        public IList<EnvironmentVariable> EnvironmentVariables { get; set; }
 71        /// <summary> Gets or sets how the deployment script should be forced to execute even if the script resource has
 072        public string ForceUpdateTag { get; set; }
 73        /// <summary> Interval for which the service retains the script resource after it reaches a terminal state. Reso
 074        public TimeSpan RetentionInterval { get; set; }
 75        /// <summary> Maximum allowed script execution time specified in ISO 8601 format. Default value is PT1H. </summa
 076        public TimeSpan? Timeout { get; set; }
 77    }
 78}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AzurePowerShellScriptProperties.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.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.Resources.Models
 14{
 15    public partial class AzurePowerShellScriptProperties : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 019            writer.WriteStartObject();
 020            writer.WritePropertyName("azPowerShellVersion");
 021            writer.WriteStringValue(AzPowerShellVersion);
 022            if (PrimaryScriptUri != null)
 23            {
 024                writer.WritePropertyName("primaryScriptUri");
 025                writer.WriteStringValue(PrimaryScriptUri);
 26            }
 027            if (SupportingScriptUris != null)
 28            {
 029                writer.WritePropertyName("supportingScriptUris");
 030                writer.WriteStartArray();
 031                foreach (var item in SupportingScriptUris)
 32                {
 033                    writer.WriteStringValue(item);
 34                }
 035                writer.WriteEndArray();
 36            }
 037            if (ScriptContent != null)
 38            {
 039                writer.WritePropertyName("scriptContent");
 040                writer.WriteStringValue(ScriptContent);
 41            }
 042            if (Arguments != null)
 43            {
 044                writer.WritePropertyName("arguments");
 045                writer.WriteStringValue(Arguments);
 46            }
 047            if (EnvironmentVariables != null)
 48            {
 049                writer.WritePropertyName("environmentVariables");
 050                writer.WriteStartArray();
 051                foreach (var item in EnvironmentVariables)
 52                {
 053                    writer.WriteObjectValue(item);
 54                }
 055                writer.WriteEndArray();
 56            }
 057            if (ForceUpdateTag != null)
 58            {
 059                writer.WritePropertyName("forceUpdateTag");
 060                writer.WriteStringValue(ForceUpdateTag);
 61            }
 062            writer.WritePropertyName("retentionInterval");
 063            writer.WriteStringValue(RetentionInterval, "P");
 064            if (Timeout != null)
 65            {
 066                writer.WritePropertyName("timeout");
 067                writer.WriteStringValue(Timeout.Value, "P");
 68            }
 069            if (ContainerSettings != null)
 70            {
 071                writer.WritePropertyName("containerSettings");
 072                writer.WriteObjectValue(ContainerSettings);
 73            }
 074            if (StorageAccountSettings != null)
 75            {
 076                writer.WritePropertyName("storageAccountSettings");
 077                writer.WriteObjectValue(StorageAccountSettings);
 78            }
 079            if (CleanupPreference != null)
 80            {
 081                writer.WritePropertyName("cleanupPreference");
 082                writer.WriteStringValue(CleanupPreference.Value.ToString());
 83            }
 084            if (ProvisioningState != null)
 85            {
 086                writer.WritePropertyName("provisioningState");
 087                writer.WriteStringValue(ProvisioningState.Value.ToString());
 88            }
 089            if (Status != null)
 90            {
 091                writer.WritePropertyName("status");
 092                writer.WriteObjectValue(Status);
 93            }
 094            if (Outputs != null)
 95            {
 096                writer.WritePropertyName("outputs");
 097                writer.WriteStartObject();
 098                foreach (var item in Outputs)
 99                {
 0100                    writer.WritePropertyName(item.Key);
 0101                    writer.WriteObjectValue(item.Value);
 102                }
 0103                writer.WriteEndObject();
 104            }
 0105            writer.WriteEndObject();
 0106        }
 107
 108        internal static AzurePowerShellScriptProperties DeserializeAzurePowerShellScriptProperties(JsonElement element)
 109        {
 0110            string azPowerShellVersion = default;
 0111            string primaryScriptUri = default;
 0112            IList<string> supportingScriptUris = default;
 0113            string scriptContent = default;
 0114            string arguments = default;
 0115            IList<EnvironmentVariable> environmentVariables = default;
 0116            string forceUpdateTag = default;
 0117            TimeSpan retentionInterval = default;
 0118            TimeSpan? timeout = default;
 0119            ContainerConfiguration containerSettings = default;
 0120            StorageAccountConfiguration storageAccountSettings = default;
 0121            CleanupOptions? cleanupPreference = default;
 0122            ScriptProvisioningState? provisioningState = default;
 0123            ScriptStatus status = default;
 0124            IDictionary<string, object> outputs = default;
 0125            foreach (var property in element.EnumerateObject())
 126            {
 0127                if (property.NameEquals("azPowerShellVersion"))
 128                {
 0129                    azPowerShellVersion = property.Value.GetString();
 0130                    continue;
 131                }
 0132                if (property.NameEquals("primaryScriptUri"))
 133                {
 0134                    if (property.Value.ValueKind == JsonValueKind.Null)
 135                    {
 136                        continue;
 137                    }
 0138                    primaryScriptUri = property.Value.GetString();
 0139                    continue;
 140                }
 0141                if (property.NameEquals("supportingScriptUris"))
 142                {
 0143                    if (property.Value.ValueKind == JsonValueKind.Null)
 144                    {
 145                        continue;
 146                    }
 0147                    List<string> array = new List<string>();
 0148                    foreach (var item in property.Value.EnumerateArray())
 149                    {
 0150                        if (item.ValueKind == JsonValueKind.Null)
 151                        {
 0152                            array.Add(null);
 153                        }
 154                        else
 155                        {
 0156                            array.Add(item.GetString());
 157                        }
 158                    }
 0159                    supportingScriptUris = array;
 0160                    continue;
 161                }
 0162                if (property.NameEquals("scriptContent"))
 163                {
 0164                    if (property.Value.ValueKind == JsonValueKind.Null)
 165                    {
 166                        continue;
 167                    }
 0168                    scriptContent = property.Value.GetString();
 0169                    continue;
 170                }
 0171                if (property.NameEquals("arguments"))
 172                {
 0173                    if (property.Value.ValueKind == JsonValueKind.Null)
 174                    {
 175                        continue;
 176                    }
 0177                    arguments = property.Value.GetString();
 0178                    continue;
 179                }
 0180                if (property.NameEquals("environmentVariables"))
 181                {
 0182                    if (property.Value.ValueKind == JsonValueKind.Null)
 183                    {
 184                        continue;
 185                    }
 0186                    List<EnvironmentVariable> array = new List<EnvironmentVariable>();
 0187                    foreach (var item in property.Value.EnumerateArray())
 188                    {
 0189                        if (item.ValueKind == JsonValueKind.Null)
 190                        {
 0191                            array.Add(null);
 192                        }
 193                        else
 194                        {
 0195                            array.Add(EnvironmentVariable.DeserializeEnvironmentVariable(item));
 196                        }
 197                    }
 0198                    environmentVariables = array;
 0199                    continue;
 200                }
 0201                if (property.NameEquals("forceUpdateTag"))
 202                {
 0203                    if (property.Value.ValueKind == JsonValueKind.Null)
 204                    {
 205                        continue;
 206                    }
 0207                    forceUpdateTag = property.Value.GetString();
 0208                    continue;
 209                }
 0210                if (property.NameEquals("retentionInterval"))
 211                {
 0212                    retentionInterval = property.Value.GetTimeSpan("P");
 0213                    continue;
 214                }
 0215                if (property.NameEquals("timeout"))
 216                {
 0217                    if (property.Value.ValueKind == JsonValueKind.Null)
 218                    {
 219                        continue;
 220                    }
 0221                    timeout = property.Value.GetTimeSpan("P");
 0222                    continue;
 223                }
 0224                if (property.NameEquals("containerSettings"))
 225                {
 0226                    if (property.Value.ValueKind == JsonValueKind.Null)
 227                    {
 228                        continue;
 229                    }
 0230                    containerSettings = ContainerConfiguration.DeserializeContainerConfiguration(property.Value);
 0231                    continue;
 232                }
 0233                if (property.NameEquals("storageAccountSettings"))
 234                {
 0235                    if (property.Value.ValueKind == JsonValueKind.Null)
 236                    {
 237                        continue;
 238                    }
 0239                    storageAccountSettings = StorageAccountConfiguration.DeserializeStorageAccountConfiguration(property
 0240                    continue;
 241                }
 0242                if (property.NameEquals("cleanupPreference"))
 243                {
 0244                    if (property.Value.ValueKind == JsonValueKind.Null)
 245                    {
 246                        continue;
 247                    }
 0248                    cleanupPreference = new CleanupOptions(property.Value.GetString());
 0249                    continue;
 250                }
 0251                if (property.NameEquals("provisioningState"))
 252                {
 0253                    if (property.Value.ValueKind == JsonValueKind.Null)
 254                    {
 255                        continue;
 256                    }
 0257                    provisioningState = new ScriptProvisioningState(property.Value.GetString());
 0258                    continue;
 259                }
 0260                if (property.NameEquals("status"))
 261                {
 0262                    if (property.Value.ValueKind == JsonValueKind.Null)
 263                    {
 264                        continue;
 265                    }
 0266                    status = ScriptStatus.DeserializeScriptStatus(property.Value);
 0267                    continue;
 268                }
 0269                if (property.NameEquals("outputs"))
 270                {
 0271                    if (property.Value.ValueKind == JsonValueKind.Null)
 272                    {
 273                        continue;
 274                    }
 0275                    Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0276                    foreach (var property0 in property.Value.EnumerateObject())
 277                    {
 0278                        if (property0.Value.ValueKind == JsonValueKind.Null)
 279                        {
 0280                            dictionary.Add(property0.Name, null);
 281                        }
 282                        else
 283                        {
 0284                            dictionary.Add(property0.Name, property0.Value.GetObject());
 285                        }
 286                    }
 0287                    outputs = dictionary;
 288                    continue;
 289                }
 290            }
 0291            return new AzurePowerShellScriptProperties(containerSettings, storageAccountSettings, cleanupPreference, pro
 292        }
 293    }
 294}