< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-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%
DeserializeScriptConfigurationBase(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptConfigurationBase.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> Common configuration settings for both Azure PowerShell and Azure CLI scripts. </summary>
 14    public partial class ScriptConfigurationBase
 15    {
 16        /// <summary> Initializes a new instance of ScriptConfigurationBase. </summary>
 17        /// <param name="retentionInterval"> Interval for which the service retains the script resource after it reaches
 018        public ScriptConfigurationBase(TimeSpan retentionInterval)
 19        {
 020            RetentionInterval = retentionInterval;
 021        }
 22
 23        /// <summary> Initializes a new instance of ScriptConfigurationBase. </summary>
 24        /// <param name="primaryScriptUri"> Uri for the script. This is the entry point for the external script. </param
 25        /// <param name="supportingScriptUris"> Supporting files for the external script. </param>
 26        /// <param name="scriptContent"> Script body. </param>
 27        /// <param name="arguments"> Command line arguments to pass to the script. Arguments are separated by spaces. ex
 28        /// <param name="environmentVariables"> The environment variables to pass over to the script. </param>
 29        /// <param name="forceUpdateTag"> Gets or sets how the deployment script should be forced to execute even if the
 30        /// <param name="retentionInterval"> Interval for which the service retains the script resource after it reaches
 31        /// <param name="timeout"> Maximum allowed script execution time specified in ISO 8601 format. Default value is 
 032        internal ScriptConfigurationBase(string primaryScriptUri, IList<string> supportingScriptUris, string scriptConte
 33        {
 034            PrimaryScriptUri = primaryScriptUri;
 035            SupportingScriptUris = supportingScriptUris;
 036            ScriptContent = scriptContent;
 037            Arguments = arguments;
 038            EnvironmentVariables = environmentVariables;
 039            ForceUpdateTag = forceUpdateTag;
 040            RetentionInterval = retentionInterval;
 041            Timeout = timeout;
 042        }
 43
 44        /// <summary> Uri for the script. This is the entry point for the external script. </summary>
 045        public string PrimaryScriptUri { get; set; }
 46        /// <summary> Supporting files for the external script. </summary>
 047        public IList<string> SupportingScriptUris { get; set; }
 48        /// <summary> Script body. </summary>
 049        public string ScriptContent { get; set; }
 50        /// <summary> Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -
 051        public string Arguments { get; set; }
 52        /// <summary> The environment variables to pass over to the script. </summary>
 053        public IList<EnvironmentVariable> EnvironmentVariables { get; set; }
 54        /// <summary> Gets or sets how the deployment script should be forced to execute even if the script resource has
 055        public string ForceUpdateTag { get; set; }
 56        /// <summary> Interval for which the service retains the script resource after it reaches a terminal state. Reso
 057        public TimeSpan RetentionInterval { get; set; }
 58        /// <summary> Maximum allowed script execution time specified in ISO 8601 format. Default value is PT1H. </summa
 059        public TimeSpan? Timeout { get; set; }
 60    }
 61}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ScriptConfigurationBase.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 ScriptConfigurationBase : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 019            writer.WriteStartObject();
 020            if (PrimaryScriptUri != null)
 21            {
 022                writer.WritePropertyName("primaryScriptUri");
 023                writer.WriteStringValue(PrimaryScriptUri);
 24            }
 025            if (SupportingScriptUris != null)
 26            {
 027                writer.WritePropertyName("supportingScriptUris");
 028                writer.WriteStartArray();
 029                foreach (var item in SupportingScriptUris)
 30                {
 031                    writer.WriteStringValue(item);
 32                }
 033                writer.WriteEndArray();
 34            }
 035            if (ScriptContent != null)
 36            {
 037                writer.WritePropertyName("scriptContent");
 038                writer.WriteStringValue(ScriptContent);
 39            }
 040            if (Arguments != null)
 41            {
 042                writer.WritePropertyName("arguments");
 043                writer.WriteStringValue(Arguments);
 44            }
 045            if (EnvironmentVariables != null)
 46            {
 047                writer.WritePropertyName("environmentVariables");
 048                writer.WriteStartArray();
 049                foreach (var item in EnvironmentVariables)
 50                {
 051                    writer.WriteObjectValue(item);
 52                }
 053                writer.WriteEndArray();
 54            }
 055            if (ForceUpdateTag != null)
 56            {
 057                writer.WritePropertyName("forceUpdateTag");
 058                writer.WriteStringValue(ForceUpdateTag);
 59            }
 060            writer.WritePropertyName("retentionInterval");
 061            writer.WriteStringValue(RetentionInterval, "P");
 062            if (Timeout != null)
 63            {
 064                writer.WritePropertyName("timeout");
 065                writer.WriteStringValue(Timeout.Value, "P");
 66            }
 067            writer.WriteEndObject();
 068        }
 69
 70        internal static ScriptConfigurationBase DeserializeScriptConfigurationBase(JsonElement element)
 71        {
 072            string primaryScriptUri = default;
 073            IList<string> supportingScriptUris = default;
 074            string scriptContent = default;
 075            string arguments = default;
 076            IList<EnvironmentVariable> environmentVariables = default;
 077            string forceUpdateTag = default;
 078            TimeSpan retentionInterval = default;
 079            TimeSpan? timeout = default;
 080            foreach (var property in element.EnumerateObject())
 81            {
 082                if (property.NameEquals("primaryScriptUri"))
 83                {
 084                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 088                    primaryScriptUri = property.Value.GetString();
 089                    continue;
 90                }
 091                if (property.NameEquals("supportingScriptUris"))
 92                {
 093                    if (property.Value.ValueKind == JsonValueKind.Null)
 94                    {
 95                        continue;
 96                    }
 097                    List<string> array = new List<string>();
 098                    foreach (var item in property.Value.EnumerateArray())
 99                    {
 0100                        if (item.ValueKind == JsonValueKind.Null)
 101                        {
 0102                            array.Add(null);
 103                        }
 104                        else
 105                        {
 0106                            array.Add(item.GetString());
 107                        }
 108                    }
 0109                    supportingScriptUris = array;
 0110                    continue;
 111                }
 0112                if (property.NameEquals("scriptContent"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    scriptContent = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("arguments"))
 122                {
 0123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 125                        continue;
 126                    }
 0127                    arguments = property.Value.GetString();
 0128                    continue;
 129                }
 0130                if (property.NameEquals("environmentVariables"))
 131                {
 0132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 0136                    List<EnvironmentVariable> array = new List<EnvironmentVariable>();
 0137                    foreach (var item in property.Value.EnumerateArray())
 138                    {
 0139                        if (item.ValueKind == JsonValueKind.Null)
 140                        {
 0141                            array.Add(null);
 142                        }
 143                        else
 144                        {
 0145                            array.Add(EnvironmentVariable.DeserializeEnvironmentVariable(item));
 146                        }
 147                    }
 0148                    environmentVariables = array;
 0149                    continue;
 150                }
 0151                if (property.NameEquals("forceUpdateTag"))
 152                {
 0153                    if (property.Value.ValueKind == JsonValueKind.Null)
 154                    {
 155                        continue;
 156                    }
 0157                    forceUpdateTag = property.Value.GetString();
 0158                    continue;
 159                }
 0160                if (property.NameEquals("retentionInterval"))
 161                {
 0162                    retentionInterval = property.Value.GetTimeSpan("P");
 0163                    continue;
 164                }
 0165                if (property.NameEquals("timeout"))
 166                {
 0167                    if (property.Value.ValueKind == JsonValueKind.Null)
 168                    {
 169                        continue;
 170                    }
 0171                    timeout = property.Value.GetTimeSpan("P");
 172                    continue;
 173                }
 174            }
 0175            return new ScriptConfigurationBase(primaryScriptUri, supportingScriptUris, scriptContent, arguments, environ
 176        }
 177    }
 178}