< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.CertificateStateEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\CertificateState.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:84
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerializedValue(...)-0%0%
ToSerializedValue(...)-0%0%
ParseCertificateState(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\CertificateState.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Batch.Protocol.Models
 12{
 13    using Newtonsoft.Json;
 14    using Newtonsoft.Json.Converters;
 15    using System.Runtime;
 16    using System.Runtime.Serialization;
 17
 18    /// <summary>
 19    /// Defines values for CertificateState.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum CertificateState
 23    {
 24        /// <summary>
 25        /// The Certificate is available for use in Pools.
 26        /// </summary>
 27        [EnumMember(Value = "active")]
 28        Active,
 29        /// <summary>
 30        /// The user has requested that the Certificate be deleted, but the
 31        /// delete operation has not yet completed. You may not reference the
 32        /// Certificate when creating or updating Pools.
 33        /// </summary>
 34        [EnumMember(Value = "deleting")]
 35        Deleting,
 36        /// <summary>
 37        /// The user requested that the Certificate be deleted, but there are
 38        /// Pools that still have references to the Certificate, or it is still
 39        /// installed on one or more Nodes. (The latter can occur if the
 40        /// Certificate has been removed from the Pool, but the Compute Node
 41        /// has not yet restarted. Compute Nodes refresh their Certificates
 42        /// only when they restart.) You may use the cancel Certificate delete
 43        /// operation to cancel the delete, or the delete Certificate operation
 44        /// to retry the delete.
 45        /// </summary>
 46        [EnumMember(Value = "deletefailed")]
 47        DeleteFailed
 48    }
 49    internal static class CertificateStateEnumExtension
 50    {
 51        internal static string ToSerializedValue(this CertificateState? value)
 52        {
 053            return value == null ? null : ((CertificateState)value).ToSerializedValue();
 54        }
 55
 56        internal static string ToSerializedValue(this CertificateState value)
 57        {
 58            switch( value )
 59            {
 60                case CertificateState.Active:
 061                    return "active";
 62                case CertificateState.Deleting:
 063                    return "deleting";
 64                case CertificateState.DeleteFailed:
 065                    return "deletefailed";
 66            }
 067            return null;
 68        }
 69
 70        internal static CertificateState? ParseCertificateState(this string value)
 71        {
 72            switch( value )
 73            {
 74                case "active":
 075                    return CertificateState.Active;
 76                case "deleting":
 077                    return CertificateState.Deleting;
 78                case "deletefailed":
 079                    return CertificateState.DeleteFailed;
 80            }
 081            return null;
 82        }
 83    }
 84}