| | 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 | |
|
| | 11 | | namespace 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 | | { |
| 0 | 49 | | 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: |
| 0 | 57 | | return "steady"; |
| | 58 | | case AllocationState.Resizing: |
| 0 | 59 | | return "resizing"; |
| | 60 | | case AllocationState.Stopping: |
| 0 | 61 | | return "stopping"; |
| | 62 | | } |
| 0 | 63 | | return null; |
| | 64 | | } |
| | 65 | |
|
| | 66 | | internal static AllocationState? ParseAllocationState(this string value) |
| | 67 | | { |
| | 68 | | switch( value ) |
| | 69 | | { |
| | 70 | | case "steady": |
| 0 | 71 | | return AllocationState.Steady; |
| | 72 | | case "resizing": |
| 0 | 73 | | return AllocationState.Resizing; |
| | 74 | | case "stopping": |
| 0 | 75 | | return AllocationState.Stopping; |
| | 76 | | } |
| 0 | 77 | | return null; |
| | 78 | | } |
| | 79 | | } |
| | 80 | | } |