< Summary

Class:Azure.ResourceManager.Compute.Models.RunCommandParameterDefinition
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandParameterDefinition.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandParameterDefinition.Serialization.cs
Covered lines:22
Uncovered lines:15
Coverable lines:37
Total lines:110
Line coverage:59.4% (22 of 37)
Covered branches:12
Total branches:18
Branch coverage:66.6% (12 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Name()-0%100%
get_Type()-0%100%
get_DefaultValue()-0%100%
get_Required()-0%100%
DeserializeRunCommandParameterDefinition(...)-84.21%85.71%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandParameterDefinition.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.Compute.Models
 11{
 12    /// <summary> Describes the properties of a run command parameter. </summary>
 13    public partial class RunCommandParameterDefinition
 14    {
 15        /// <summary> Initializes a new instance of RunCommandParameterDefinition. </summary>
 16        /// <param name="name"> The run command parameter name. </param>
 17        /// <param name="type"> The run command parameter type. </param>
 018        internal RunCommandParameterDefinition(string name, string type)
 19        {
 020            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 024            if (type == null)
 25            {
 026                throw new ArgumentNullException(nameof(type));
 27            }
 28
 029            Name = name;
 030            Type = type;
 031        }
 32
 33        /// <summary> Initializes a new instance of RunCommandParameterDefinition. </summary>
 34        /// <param name="name"> The run command parameter name. </param>
 35        /// <param name="type"> The run command parameter type. </param>
 36        /// <param name="defaultValue"> The run command parameter default value. </param>
 37        /// <param name="required"> The run command parameter required. </param>
 838        internal RunCommandParameterDefinition(string name, string type, string defaultValue, bool? required)
 39        {
 840            Name = name;
 841            Type = type;
 842            DefaultValue = defaultValue;
 843            Required = required;
 844        }
 45
 46        /// <summary> The run command parameter name. </summary>
 047        public string Name { get; }
 48        /// <summary> The run command parameter type. </summary>
 049        public string Type { get; }
 50        /// <summary> The run command parameter default value. </summary>
 051        public string DefaultValue { get; }
 52        /// <summary> The run command parameter required. </summary>
 053        public bool? Required { get; }
 54    }
 55}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandParameterDefinition.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    public partial class RunCommandParameterDefinition
 14    {
 15        internal static RunCommandParameterDefinition DeserializeRunCommandParameterDefinition(JsonElement element)
 16        {
 817            string name = default;
 818            string type = default;
 819            string defaultValue = default;
 820            bool? required = default;
 6421            foreach (var property in element.EnumerateObject())
 22            {
 2423                if (property.NameEquals("name"))
 24                {
 825                    name = property.Value.GetString();
 826                    continue;
 27                }
 1628                if (property.NameEquals("type"))
 29                {
 830                    type = property.Value.GetString();
 831                    continue;
 32                }
 833                if (property.NameEquals("defaultValue"))
 34                {
 035                    if (property.Value.ValueKind == JsonValueKind.Null)
 36                    {
 37                        continue;
 38                    }
 039                    defaultValue = property.Value.GetString();
 040                    continue;
 41                }
 842                if (property.NameEquals("required"))
 43                {
 844                    if (property.Value.ValueKind == JsonValueKind.Null)
 45                    {
 46                        continue;
 47                    }
 848                    required = property.Value.GetBoolean();
 49                    continue;
 50                }
 51            }
 852            return new RunCommandParameterDefinition(name, type, defaultValue, required);
 53        }
 54    }
 55}