< Summary

Class:Azure.ResourceManager.Storage.Models.CheckNameAvailabilityResult
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CheckNameAvailabilityResult.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CheckNameAvailabilityResult.Serialization.cs
Covered lines:24
Uncovered lines:2
Coverable lines:26
Total lines:89
Line coverage:92.3% (24 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()-100%100%
get_Reason()-100%100%
get_Message()-100%100%
DeserializeCheckNameAvailabilityResult(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CheckNameAvailabilityResult.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.Storage.Models
 9{
 10    /// <summary> The CheckNameAvailability operation response. </summary>
 11    public partial class CheckNameAvailabilityResult
 12    {
 13        /// <summary> Initializes a new instance of CheckNameAvailabilityResult. </summary>
 014        internal CheckNameAvailabilityResult()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of CheckNameAvailabilityResult. </summary>
 19        /// <param name="nameAvailable"> Gets a boolean value that indicates whether the name is available for you to us
 20        /// <param name="reason"> Gets the reason that a storage account name could not be used. The Reason element is o
 21        /// <param name="message"> Gets an error message explaining the Reason value in more detail. </param>
 1222        internal CheckNameAvailabilityResult(bool? nameAvailable, Reason? reason, string message)
 23        {
 1224            NameAvailable = nameAvailable;
 1225            Reason = reason;
 1226            Message = message;
 1227        }
 28
 29        /// <summary> Gets a boolean value that indicates whether the name is available for you to use. If true, the nam
 1230        public bool? NameAvailable { get; }
 31        /// <summary> Gets the reason that a storage account name could not be used. The Reason element is only returned
 1232        public Reason? Reason { get; }
 33        /// <summary> Gets an error message explaining the Reason value in more detail. </summary>
 1234        public string Message { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CheckNameAvailabilityResult.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.Storage.Models
 12{
 13    public partial class CheckNameAvailabilityResult
 14    {
 15        internal static CheckNameAvailabilityResult DeserializeCheckNameAvailabilityResult(JsonElement element)
 16        {
 1217            bool? nameAvailable = default;
 1218            Reason? reason = default;
 1219            string message = default;
 8020            foreach (var property in element.EnumerateObject())
 21            {
 2822                if (property.NameEquals("nameAvailable"))
 23                {
 1224                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 1228                    nameAvailable = property.Value.GetBoolean();
 1229                    continue;
 30                }
 1631                if (property.NameEquals("reason"))
 32                {
 833                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 837                    reason = property.Value.GetString().ToReason();
 838                    continue;
 39                }
 840                if (property.NameEquals("message"))
 41                {
 842                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 846                    message = property.Value.GetString();
 47                    continue;
 48                }
 49            }
 1250            return new CheckNameAvailabilityResult(nameAvailable, reason, message);
 51        }
 52    }
 53}