< Summary

Class:Azure.ResourceManager.AppConfiguration.Models.NameAvailabilityStatus
Assembly:Azure.ResourceManager.AppConfiguration
File(s):C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\NameAvailabilityStatus.cs
C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\NameAvailabilityStatus.Serialization.cs
Covered lines:21
Uncovered lines:5
Coverable lines:26
Total lines:89
Line coverage:80.7% (21 of 26)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_NameAvailable()-0%100%
get_Message()-0%100%
get_Reason()-0%100%
DeserializeNameAvailabilityStatus(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\NameAvailabilityStatus.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
 8namespace Azure.ResourceManager.AppConfiguration.Models
 9{
 10    /// <summary> The result of a request to check the availability of a resource name. </summary>
 11    public partial class NameAvailabilityStatus
 12    {
 13        /// <summary> Initializes a new instance of NameAvailabilityStatus. </summary>
 014        internal NameAvailabilityStatus()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of NameAvailabilityStatus. </summary>
 19        /// <param name="nameAvailable"> The value indicating whether the resource name is available. </param>
 20        /// <param name="message"> If any, the error message that provides more detail for the reason that the name is n
 21        /// <param name="reason"> If any, the reason that the name is not available. </param>
 422        internal NameAvailabilityStatus(bool? nameAvailable, string message, string reason)
 23        {
 424            NameAvailable = nameAvailable;
 425            Message = message;
 426            Reason = reason;
 427        }
 28
 29        /// <summary> The value indicating whether the resource name is available. </summary>
 030        public bool? NameAvailable { get; }
 31        /// <summary> If any, the error message that provides more detail for the reason that the name is not available.
 032        public string Message { get; }
 33        /// <summary> If any, the reason that the name is not available. </summary>
 034        public string Reason { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\NameAvailabilityStatus.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.AppConfiguration.Models
 12{
 13    public partial class NameAvailabilityStatus
 14    {
 15        internal static NameAvailabilityStatus DeserializeNameAvailabilityStatus(JsonElement element)
 16        {
 417            bool? nameAvailable = default;
 418            string message = default;
 419            string reason = default;
 3220            foreach (var property in element.EnumerateObject())
 21            {
 1222                if (property.NameEquals("nameAvailable"))
 23                {
 424                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 428                    nameAvailable = property.Value.GetBoolean();
 429                    continue;
 30                }
 831                if (property.NameEquals("message"))
 32                {
 433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 437                    message = property.Value.GetString();
 438                    continue;
 39                }
 440                if (property.NameEquals("reason"))
 41                {
 442                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 446                    reason = property.Value.GetString();
 47                    continue;
 48                }
 49            }
 450            return new NameAvailabilityStatus(nameAvailable, message, reason);
 51        }
 52    }
 53}