< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.AllocationStateEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\AllocationState.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:80
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%
ParseAllocationState(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\AllocationState.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 AllocationState.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum AllocationState
 23    {
 24        /// <summary>
 25        /// The Pool is not resizing. There are no changes to the number of
 26        /// Compute Nodes in the Pool in progress. A Pool enters this state
 27        /// when it is created and when no operations are being performed on
 28        /// the Pool to change the number of Compute Nodes.
 29        /// </summary>
 30        [EnumMember(Value = "steady")]
 31        Steady,
 32        /// <summary>
 33        /// The Pool is resizing; that is, Compute Nodes are being added to or
 34        /// removed from the Pool.
 35        /// </summary>
 36        [EnumMember(Value = "resizing")]
 37        Resizing,
 38        /// <summary>
 39        /// The Pool was resizing, but the user has requested that the resize
 40        /// be stopped, but the stop request has not yet been completed.
 41        /// </summary>
 42        [EnumMember(Value = "stopping")]
 43        Stopping
 44    }
 45    internal static class AllocationStateEnumExtension
 46    {
 47        internal static string ToSerializedValue(this AllocationState? value)
 48        {
 049            return value == null ? null : ((AllocationState)value).ToSerializedValue();
 50        }
 51
 52        internal static string ToSerializedValue(this AllocationState value)
 53        {
 54            switch( value )
 55            {
 56                case AllocationState.Steady:
 057                    return "steady";
 58                case AllocationState.Resizing:
 059                    return "resizing";
 60                case AllocationState.Stopping:
 061                    return "stopping";
 62            }
 063            return null;
 64        }
 65
 66        internal static AllocationState? ParseAllocationState(this string value)
 67        {
 68            switch( value )
 69            {
 70                case "steady":
 071                    return AllocationState.Steady;
 72                case "resizing":
 073                    return AllocationState.Resizing;
 74                case "stopping":
 075                    return AllocationState.Stopping;
 76            }
 077            return null;
 78        }
 79    }
 80}