< Summary

Class:Azure.ResourceManager.KeyVault.Models.CheckNameAvailabilityResult
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\CheckNameAvailabilityResult.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\CheckNameAvailabilityResult.Serialization.cs
Covered lines:0
Uncovered lines:23
Coverable lines:23
Total lines:77
Line coverage:0% (0 of 23)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\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.KeyVault.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"> A boolean value that indicates whether the name is available for you to use. If
 20        /// <param name="reason"> The reason that a vault name could not be used. The Reason element is only returned if
 21        /// <param name="message"> An error message explaining the Reason value in more detail. </param>
 022        internal CheckNameAvailabilityResult(bool? nameAvailable, Reason? reason, string message)
 23        {
 024            NameAvailable = nameAvailable;
 025            Reason = reason;
 026            Message = message;
 027        }
 28
 29        /// <summary> A boolean value that indicates whether the name is available for you to use. If true, the name is 
 030        public bool? NameAvailable { get; }
 31        /// <summary> The reason that a vault name could not be used. The Reason element is only returned if NameAvailab
 032        public Reason? Reason { get; }
 33        /// <summary> An error message explaining the Reason value in more detail. </summary>
 034        public string Message { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\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.KeyVault.Models
 12{
 13    public partial class CheckNameAvailabilityResult
 14    {
 15        internal static CheckNameAvailabilityResult DeserializeCheckNameAvailabilityResult(JsonElement element)
 16        {
 017            Optional<bool> nameAvailable = default;
 018            Optional<Reason> reason = default;
 019            Optional<string> message = default;
 020            foreach (var property in element.EnumerateObject())
 21            {
 022                if (property.NameEquals("nameAvailable"))
 23                {
 024                    nameAvailable = property.Value.GetBoolean();
 025                    continue;
 26                }
 027                if (property.NameEquals("reason"))
 28                {
 029                    reason = property.Value.GetString().ToReason();
 030                    continue;
 31                }
 032                if (property.NameEquals("message"))
 33                {
 034                    message = property.Value.GetString();
 35                    continue;
 36                }
 37            }
 038            return new CheckNameAvailabilityResult(Optional.ToNullable(nameAvailable), Optional.ToNullable(reason), mess
 39        }
 40    }
 41}