| | 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 SchedulingState. |
| | 20 | | /// </summary> |
| | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | 22 | | public enum SchedulingState |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Tasks can be scheduled on the Compute Node. |
| | 26 | | /// </summary> |
| | 27 | | [EnumMember(Value = "enabled")] |
| | 28 | | Enabled, |
| | 29 | | /// <summary> |
| | 30 | | /// No new Tasks will be scheduled on the Compute Node. Tasks already |
| | 31 | | /// running on the Compute Node may still run to completion. All |
| | 32 | | /// Compute Nodes start with scheduling enabled. |
| | 33 | | /// </summary> |
| | 34 | | [EnumMember(Value = "disabled")] |
| | 35 | | Disabled |
| | 36 | | } |
| | 37 | | internal static class SchedulingStateEnumExtension |
| | 38 | | { |
| | 39 | | internal static string ToSerializedValue(this SchedulingState? value) |
| | 40 | | { |
| 0 | 41 | | return value == null ? null : ((SchedulingState)value).ToSerializedValue(); |
| | 42 | | } |
| | 43 | |
|
| | 44 | | internal static string ToSerializedValue(this SchedulingState value) |
| | 45 | | { |
| | 46 | | switch( value ) |
| | 47 | | { |
| | 48 | | case SchedulingState.Enabled: |
| 0 | 49 | | return "enabled"; |
| | 50 | | case SchedulingState.Disabled: |
| 0 | 51 | | return "disabled"; |
| | 52 | | } |
| 0 | 53 | | return null; |
| | 54 | | } |
| | 55 | |
|
| | 56 | | internal static SchedulingState? ParseSchedulingState(this string value) |
| | 57 | | { |
| | 58 | | switch( value ) |
| | 59 | | { |
| | 60 | | case "enabled": |
| 0 | 61 | | return SchedulingState.Enabled; |
| | 62 | | case "disabled": |
| 0 | 63 | | return SchedulingState.Disabled; |
| | 64 | | } |
| 0 | 65 | | return null; |
| | 66 | | } |
| | 67 | | } |
| | 68 | | } |