< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.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%
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%
get_AzCliVersion()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureCliScript(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AzureCliScript.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> Object model for the Azure CLI script. </summary>
 14    public partial class AzureCliScript : DeploymentScript
 15    {
 16        /// <summary> Initializes a new instance of AzureCliScript. </summary>
 17        /// <param name="identity"> Managed identity to be used for this deployment script. Currently, only user-assigne
 18        /// <param name="location"> The location of the ACI and the storage account for the deployment script. </param>
 19        /// <param name="retentionInterval"> Interval for which the service retains the script resource after it reaches
 20        /// <param name="azCliVersion"> Azure CLI module version to be used. </param>
 021        public AzureCliScript(ManagedServiceIdentity identity, string location, TimeSpan retentionInterval, string azCli
 22        {
 023            if (identity == null)
 24            {
 025                throw new ArgumentNullException(nameof(identity));
 26            }
 027            if (location == null)
 28            {
 029                throw new ArgumentNullException(nameof(location));
 30            }
 031            if (azCliVersion == null)
 32            {
 033                throw new ArgumentNullException(nameof(azCliVersion));
 34            }
 35
 036            RetentionInterval = retentionInterval;
 037            AzCliVersion = azCliVersion;
 038            Kind = ScriptType.AzureCLI;
 039        }
 40
 41        /// <summary> Initializes a new instance of AzureCliScript. </summary>
 42        /// <param name="id"> String Id used to locate any resource on Azure. </param>
 43        /// <param name="name"> Name of this resource. </param>
 44        /// <param name="type"> Type of this resource. </param>
 45        /// <param name="identity"> Managed identity to be used for this deployment script. Currently, only user-assigne
 46        /// <param name="location"> The location of the ACI and the storage account for the deployment script. </param>
 47        /// <param name="tags"> Resource tags. </param>
 48        /// <param name="kind"> Type of the script. </param>
 49        /// <param name="systemData"> The system metadata related to this resource. </param>
 50        /// <param name="containerSettings"> Container settings. </param>
 51        /// <param name="storageAccountSettings"> Storage Account settings. </param>
 52        /// <param name="cleanupPreference"> The clean up preference when the script execution gets in a terminal state.
 53        /// <param name="provisioningState"> State of the script execution. This only appears in the response. </param>
 54        /// <param name="status"> Contains the results of script execution. </param>
 55        /// <param name="outputs"> List of script outputs. </param>
 56        /// <param name="primaryScriptUri"> Uri for the script. This is the entry point for the external script. </param
 57        /// <param name="supportingScriptUris"> Supporting files for the external script. </param>
 58        /// <param name="scriptContent"> Script body. </param>
 59        /// <param name="arguments"> Command line arguments to pass to the script. Arguments are separated by spaces. ex
 60        /// <param name="environmentVariables"> The environment variables to pass over to the script. </param>
 61        /// <param name="forceUpdateTag"> Gets or sets how the deployment script should be forced to execute even if the
 62        /// <param name="retentionInterval"> Interval for which the service retains the script resource after it reaches
 63        /// <param name="timeout"> Maximum allowed script execution time specified in ISO 8601 format. Default value is 
 64        /// <param name="azCliVersion"> Azure CLI module version to be used. </param>
 065        internal AzureCliScript(string id, string name, string type, ManagedServiceIdentity identity, string location, I
 66        {
 067            ContainerSettings = containerSettings;
 068            StorageAccountSettings = storageAccountSettings;
 069            CleanupPreference = cleanupPreference;
 070            ProvisioningState = provisioningState;
 071            Status = status;
 072            Outputs = outputs;
 073            PrimaryScriptUri = primaryScriptUri;
 074            SupportingScriptUris = supportingScriptUris;
 075            ScriptContent = scriptContent;
 076            Arguments = arguments;
 077            EnvironmentVariables = environmentVariables;
 078            ForceUpdateTag = forceUpdateTag;
 079            RetentionInterval = retentionInterval;
 080            Timeout = timeout;
 081            AzCliVersion = azCliVersion;
 082            Kind = kind;
 083        }
 84
 85        /// <summary> Container settings. </summary>
 086        public ContainerConfiguration ContainerSettings { get; set; }
 87        /// <summary> Storage Account settings. </summary>
 088        public StorageAccountConfiguration StorageAccountSettings { get; set; }
 89        /// <summary> The clean up preference when the script execution gets in a terminal state. Default setting is &ap
 090        public CleanupOptions? CleanupPreference { get; set; }
 91        /// <summary> State of the script execution. This only appears in the response. </summary>
 092        public ScriptProvisioningState? ProvisioningState { get; }
 93        /// <summary> Contains the results of script execution. </summary>
 094        public ScriptStatus Status { get; }
 95        /// <summary> List of script outputs. </summary>
 096        public IDictionary<string, object> Outputs { get; }
 97        /// <summary> Uri for the script. This is the entry point for the external script. </summary>
 098        public string PrimaryScriptUri { get; set; }
 99        /// <summary> Supporting files for the external script. </summary>
 0100        public IList<string> SupportingScriptUris { get; set; }
 101        /// <summary> Script body. </summary>
 0102        public string ScriptContent { get; set; }
 103        /// <summary> Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -
 0104        public string Arguments { get; set; }
 105        /// <summary> The environment variables to pass over to the script. </summary>
 0106        public IList<EnvironmentVariable> EnvironmentVariables { get; set; }
 107        /// <summary> Gets or sets how the deployment script should be forced to execute even if the script resource has
 0108        public string ForceUpdateTag { get; set; }
 109        /// <summary> Interval for which the service retains the script resource after it reaches a terminal state. Reso
 0110        public TimeSpan RetentionInterval { get; set; }
 111        /// <summary> Maximum allowed script execution time specified in ISO 8601 format. Default value is PT1H. </summa
 0112        public TimeSpan? Timeout { get; set; }
 113        /// <summary> Azure CLI module version to be used. </summary>
 0114        public string AzCliVersion { get; set; }
 115    }
 116}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AzureCliScript.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 AzureCliScript : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 019            writer.WriteStartObject();
 020            writer.WritePropertyName("identity");
 021            writer.WriteObjectValue(Identity);
 022            writer.WritePropertyName("location");
 023            writer.WriteStringValue(Location);
 024            if (Tags != null)
 25            {
 026                writer.WritePropertyName("tags");
 027                writer.WriteStartObject();
 028                foreach (var item in Tags)
 29                {
 030                    writer.WritePropertyName(item.Key);
 031                    writer.WriteStringValue(item.Value);
 32                }
 033                writer.WriteEndObject();
 34            }
 035            writer.WritePropertyName("kind");
 036            writer.WriteStringValue(Kind.ToString());
 037            if (SystemData != null)
 38            {
 039                writer.WritePropertyName("systemData");
 040                writer.WriteObjectValue(SystemData);
 41            }
 042            if (Id != null)
 43            {
 044                writer.WritePropertyName("id");
 045                writer.WriteStringValue(Id);
 46            }
 047            if (Name != null)
 48            {
 049                writer.WritePropertyName("name");
 050                writer.WriteStringValue(Name);
 51            }
 052            if (Type != null)
 53            {
 054                writer.WritePropertyName("type");
 055                writer.WriteStringValue(Type);
 56            }
 057            writer.WritePropertyName("properties");
 058            writer.WriteStartObject();
 059            if (ContainerSettings != null)
 60            {
 061                writer.WritePropertyName("containerSettings");
 062                writer.WriteObjectValue(ContainerSettings);
 63            }
 064            if (StorageAccountSettings != null)
 65            {
 066                writer.WritePropertyName("storageAccountSettings");
 067                writer.WriteObjectValue(StorageAccountSettings);
 68            }
 069            if (CleanupPreference != null)
 70            {
 071                writer.WritePropertyName("cleanupPreference");
 072                writer.WriteStringValue(CleanupPreference.Value.ToString());
 73            }
 074            if (ProvisioningState != null)
 75            {
 076                writer.WritePropertyName("provisioningState");
 077                writer.WriteStringValue(ProvisioningState.Value.ToString());
 78            }
 079            if (Status != null)
 80            {
 081                writer.WritePropertyName("status");
 082                writer.WriteObjectValue(Status);
 83            }
 084            if (Outputs != null)
 85            {
 086                writer.WritePropertyName("outputs");
 087                writer.WriteStartObject();
 088                foreach (var item in Outputs)
 89                {
 090                    writer.WritePropertyName(item.Key);
 091                    writer.WriteObjectValue(item.Value);
 92                }
 093                writer.WriteEndObject();
 94            }
 095            if (PrimaryScriptUri != null)
 96            {
 097                writer.WritePropertyName("primaryScriptUri");
 098                writer.WriteStringValue(PrimaryScriptUri);
 99            }
 0100            if (SupportingScriptUris != null)
 101            {
 0102                writer.WritePropertyName("supportingScriptUris");
 0103                writer.WriteStartArray();
 0104                foreach (var item in SupportingScriptUris)
 105                {
 0106                    writer.WriteStringValue(item);
 107                }
 0108                writer.WriteEndArray();
 109            }
 0110            if (ScriptContent != null)
 111            {
 0112                writer.WritePropertyName("scriptContent");
 0113                writer.WriteStringValue(ScriptContent);
 114            }
 0115            if (Arguments != null)
 116            {
 0117                writer.WritePropertyName("arguments");
 0118                writer.WriteStringValue(Arguments);
 119            }
 0120            if (EnvironmentVariables != null)
 121            {
 0122                writer.WritePropertyName("environmentVariables");
 0123                writer.WriteStartArray();
 0124                foreach (var item in EnvironmentVariables)
 125                {
 0126                    writer.WriteObjectValue(item);
 127                }
 0128                writer.WriteEndArray();
 129            }
 0130            if (ForceUpdateTag != null)
 131            {
 0132                writer.WritePropertyName("forceUpdateTag");
 0133                writer.WriteStringValue(ForceUpdateTag);
 134            }
 0135            writer.WritePropertyName("retentionInterval");
 0136            writer.WriteStringValue(RetentionInterval, "P");
 0137            if (Timeout != null)
 138            {
 0139                writer.WritePropertyName("timeout");
 0140                writer.WriteStringValue(Timeout.Value, "P");
 141            }
 0142            writer.WritePropertyName("azCliVersion");
 0143            writer.WriteStringValue(AzCliVersion);
 0144            writer.WriteEndObject();
 0145            writer.WriteEndObject();
 0146        }
 147
 148        internal static AzureCliScript DeserializeAzureCliScript(JsonElement element)
 149        {
 0150            ManagedServiceIdentity identity = default;
 0151            string location = default;
 0152            IDictionary<string, string> tags = default;
 0153            ScriptType kind = default;
 0154            SystemData systemData = default;
 0155            string id = default;
 0156            string name = default;
 0157            string type = default;
 0158            ContainerConfiguration containerSettings = default;
 0159            StorageAccountConfiguration storageAccountSettings = default;
 0160            CleanupOptions? cleanupPreference = default;
 0161            ScriptProvisioningState? provisioningState = default;
 0162            ScriptStatus status = default;
 0163            IDictionary<string, object> outputs = default;
 0164            string primaryScriptUri = default;
 0165            IList<string> supportingScriptUris = default;
 0166            string scriptContent = default;
 0167            string arguments = default;
 0168            IList<EnvironmentVariable> environmentVariables = default;
 0169            string forceUpdateTag = default;
 0170            TimeSpan retentionInterval = default;
 0171            TimeSpan? timeout = default;
 0172            string azCliVersion = default;
 0173            foreach (var property in element.EnumerateObject())
 174            {
 0175                if (property.NameEquals("identity"))
 176                {
 0177                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
 0178                    continue;
 179                }
 0180                if (property.NameEquals("location"))
 181                {
 0182                    location = property.Value.GetString();
 0183                    continue;
 184                }
 0185                if (property.NameEquals("tags"))
 186                {
 0187                    if (property.Value.ValueKind == JsonValueKind.Null)
 188                    {
 189                        continue;
 190                    }
 0191                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0192                    foreach (var property0 in property.Value.EnumerateObject())
 193                    {
 0194                        if (property0.Value.ValueKind == JsonValueKind.Null)
 195                        {
 0196                            dictionary.Add(property0.Name, null);
 197                        }
 198                        else
 199                        {
 0200                            dictionary.Add(property0.Name, property0.Value.GetString());
 201                        }
 202                    }
 0203                    tags = dictionary;
 0204                    continue;
 205                }
 0206                if (property.NameEquals("kind"))
 207                {
 0208                    kind = new ScriptType(property.Value.GetString());
 0209                    continue;
 210                }
 0211                if (property.NameEquals("systemData"))
 212                {
 0213                    if (property.Value.ValueKind == JsonValueKind.Null)
 214                    {
 215                        continue;
 216                    }
 0217                    systemData = SystemData.DeserializeSystemData(property.Value);
 0218                    continue;
 219                }
 0220                if (property.NameEquals("id"))
 221                {
 0222                    if (property.Value.ValueKind == JsonValueKind.Null)
 223                    {
 224                        continue;
 225                    }
 0226                    id = property.Value.GetString();
 0227                    continue;
 228                }
 0229                if (property.NameEquals("name"))
 230                {
 0231                    if (property.Value.ValueKind == JsonValueKind.Null)
 232                    {
 233                        continue;
 234                    }
 0235                    name = property.Value.GetString();
 0236                    continue;
 237                }
 0238                if (property.NameEquals("type"))
 239                {
 0240                    if (property.Value.ValueKind == JsonValueKind.Null)
 241                    {
 242                        continue;
 243                    }
 0244                    type = property.Value.GetString();
 0245                    continue;
 246                }
 0247                if (property.NameEquals("properties"))
 248                {
 0249                    foreach (var property0 in property.Value.EnumerateObject())
 250                    {
 0251                        if (property0.NameEquals("containerSettings"))
 252                        {
 0253                            if (property0.Value.ValueKind == JsonValueKind.Null)
 254                            {
 255                                continue;
 256                            }
 0257                            containerSettings = ContainerConfiguration.DeserializeContainerConfiguration(property0.Value
 0258                            continue;
 259                        }
 0260                        if (property0.NameEquals("storageAccountSettings"))
 261                        {
 0262                            if (property0.Value.ValueKind == JsonValueKind.Null)
 263                            {
 264                                continue;
 265                            }
 0266                            storageAccountSettings = StorageAccountConfiguration.DeserializeStorageAccountConfiguration(
 0267                            continue;
 268                        }
 0269                        if (property0.NameEquals("cleanupPreference"))
 270                        {
 0271                            if (property0.Value.ValueKind == JsonValueKind.Null)
 272                            {
 273                                continue;
 274                            }
 0275                            cleanupPreference = new CleanupOptions(property0.Value.GetString());
 0276                            continue;
 277                        }
 0278                        if (property0.NameEquals("provisioningState"))
 279                        {
 0280                            if (property0.Value.ValueKind == JsonValueKind.Null)
 281                            {
 282                                continue;
 283                            }
 0284                            provisioningState = new ScriptProvisioningState(property0.Value.GetString());
 0285                            continue;
 286                        }
 0287                        if (property0.NameEquals("status"))
 288                        {
 0289                            if (property0.Value.ValueKind == JsonValueKind.Null)
 290                            {
 291                                continue;
 292                            }
 0293                            status = ScriptStatus.DeserializeScriptStatus(property0.Value);
 0294                            continue;
 295                        }
 0296                        if (property0.NameEquals("outputs"))
 297                        {
 0298                            if (property0.Value.ValueKind == JsonValueKind.Null)
 299                            {
 300                                continue;
 301                            }
 0302                            Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0303                            foreach (var property1 in property0.Value.EnumerateObject())
 304                            {
 0305                                if (property1.Value.ValueKind == JsonValueKind.Null)
 306                                {
 0307                                    dictionary.Add(property1.Name, null);
 308                                }
 309                                else
 310                                {
 0311                                    dictionary.Add(property1.Name, property1.Value.GetObject());
 312                                }
 313                            }
 0314                            outputs = dictionary;
 0315                            continue;
 316                        }
 0317                        if (property0.NameEquals("primaryScriptUri"))
 318                        {
 0319                            if (property0.Value.ValueKind == JsonValueKind.Null)
 320                            {
 321                                continue;
 322                            }
 0323                            primaryScriptUri = property0.Value.GetString();
 0324                            continue;
 325                        }
 0326                        if (property0.NameEquals("supportingScriptUris"))
 327                        {
 0328                            if (property0.Value.ValueKind == JsonValueKind.Null)
 329                            {
 330                                continue;
 331                            }
 0332                            List<string> array = new List<string>();
 0333                            foreach (var item in property0.Value.EnumerateArray())
 334                            {
 0335                                if (item.ValueKind == JsonValueKind.Null)
 336                                {
 0337                                    array.Add(null);
 338                                }
 339                                else
 340                                {
 0341                                    array.Add(item.GetString());
 342                                }
 343                            }
 0344                            supportingScriptUris = array;
 0345                            continue;
 346                        }
 0347                        if (property0.NameEquals("scriptContent"))
 348                        {
 0349                            if (property0.Value.ValueKind == JsonValueKind.Null)
 350                            {
 351                                continue;
 352                            }
 0353                            scriptContent = property0.Value.GetString();
 0354                            continue;
 355                        }
 0356                        if (property0.NameEquals("arguments"))
 357                        {
 0358                            if (property0.Value.ValueKind == JsonValueKind.Null)
 359                            {
 360                                continue;
 361                            }
 0362                            arguments = property0.Value.GetString();
 0363                            continue;
 364                        }
 0365                        if (property0.NameEquals("environmentVariables"))
 366                        {
 0367                            if (property0.Value.ValueKind == JsonValueKind.Null)
 368                            {
 369                                continue;
 370                            }
 0371                            List<EnvironmentVariable> array = new List<EnvironmentVariable>();
 0372                            foreach (var item in property0.Value.EnumerateArray())
 373                            {
 0374                                if (item.ValueKind == JsonValueKind.Null)
 375                                {
 0376                                    array.Add(null);
 377                                }
 378                                else
 379                                {
 0380                                    array.Add(EnvironmentVariable.DeserializeEnvironmentVariable(item));
 381                                }
 382                            }
 0383                            environmentVariables = array;
 0384                            continue;
 385                        }
 0386                        if (property0.NameEquals("forceUpdateTag"))
 387                        {
 0388                            if (property0.Value.ValueKind == JsonValueKind.Null)
 389                            {
 390                                continue;
 391                            }
 0392                            forceUpdateTag = property0.Value.GetString();
 0393                            continue;
 394                        }
 0395                        if (property0.NameEquals("retentionInterval"))
 396                        {
 0397                            retentionInterval = property0.Value.GetTimeSpan("P");
 0398                            continue;
 399                        }
 0400                        if (property0.NameEquals("timeout"))
 401                        {
 0402                            if (property0.Value.ValueKind == JsonValueKind.Null)
 403                            {
 404                                continue;
 405                            }
 0406                            timeout = property0.Value.GetTimeSpan("P");
 0407                            continue;
 408                        }
 0409                        if (property0.NameEquals("azCliVersion"))
 410                        {
 0411                            azCliVersion = property0.Value.GetString();
 412                            continue;
 413                        }
 414                    }
 415                    continue;
 416                }
 417            }
 0418            return new AzureCliScript(id, name, type, identity, location, tags, kind, systemData, containerSettings, sto
 419        }
 420    }
 421}