| | | 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 ComputeNodeDeallocationOption. |
| | | 20 | | /// </summary> |
| | | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | | 22 | | public enum ComputeNodeDeallocationOption |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// Terminate running Task processes and requeue the Tasks. The Tasks |
| | | 26 | | /// will run again when a Compute Node is available. Remove Compute |
| | | 27 | | /// Nodes as soon as Tasks have been terminated. |
| | | 28 | | /// </summary> |
| | | 29 | | [EnumMember(Value = "requeue")] |
| | | 30 | | Requeue, |
| | | 31 | | /// <summary> |
| | | 32 | | /// Terminate running Tasks. The Tasks will be completed with |
| | | 33 | | /// failureInfo indicating that they were terminated, and will not run |
| | | 34 | | /// again. Remove Compute Nodes as soon as Tasks have been terminated. |
| | | 35 | | /// </summary> |
| | | 36 | | [EnumMember(Value = "terminate")] |
| | | 37 | | Terminate, |
| | | 38 | | /// <summary> |
| | | 39 | | /// Allow currently running Tasks to complete. Schedule no new Tasks |
| | | 40 | | /// while waiting. Remove Compute Nodes when all Tasks have completed. |
| | | 41 | | /// </summary> |
| | | 42 | | [EnumMember(Value = "taskcompletion")] |
| | | 43 | | TaskCompletion, |
| | | 44 | | /// <summary> |
| | | 45 | | /// Allow currently running Tasks to complete, then wait for all Task |
| | | 46 | | /// data retention periods to expire. Schedule no new Tasks while |
| | | 47 | | /// waiting. Remove Compute Nodes when all Task retention periods have |
| | | 48 | | /// expired. |
| | | 49 | | /// </summary> |
| | | 50 | | [EnumMember(Value = "retaineddata")] |
| | | 51 | | RetainedData |
| | | 52 | | } |
| | | 53 | | internal static class ComputeNodeDeallocationOptionEnumExtension |
| | | 54 | | { |
| | | 55 | | internal static string ToSerializedValue(this ComputeNodeDeallocationOption? value) |
| | | 56 | | { |
| | 0 | 57 | | return value == null ? null : ((ComputeNodeDeallocationOption)value).ToSerializedValue(); |
| | | 58 | | } |
| | | 59 | | |
| | | 60 | | internal static string ToSerializedValue(this ComputeNodeDeallocationOption value) |
| | | 61 | | { |
| | | 62 | | switch( value ) |
| | | 63 | | { |
| | | 64 | | case ComputeNodeDeallocationOption.Requeue: |
| | 0 | 65 | | return "requeue"; |
| | | 66 | | case ComputeNodeDeallocationOption.Terminate: |
| | 0 | 67 | | return "terminate"; |
| | | 68 | | case ComputeNodeDeallocationOption.TaskCompletion: |
| | 0 | 69 | | return "taskcompletion"; |
| | | 70 | | case ComputeNodeDeallocationOption.RetainedData: |
| | 0 | 71 | | return "retaineddata"; |
| | | 72 | | } |
| | 0 | 73 | | return null; |
| | | 74 | | } |
| | | 75 | | |
| | | 76 | | internal static ComputeNodeDeallocationOption? ParseComputeNodeDeallocationOption(this string value) |
| | | 77 | | { |
| | | 78 | | switch( value ) |
| | | 79 | | { |
| | | 80 | | case "requeue": |
| | 0 | 81 | | return ComputeNodeDeallocationOption.Requeue; |
| | | 82 | | case "terminate": |
| | 0 | 83 | | return ComputeNodeDeallocationOption.Terminate; |
| | | 84 | | case "taskcompletion": |
| | 0 | 85 | | return ComputeNodeDeallocationOption.TaskCompletion; |
| | | 86 | | case "retaineddata": |
| | 0 | 87 | | return ComputeNodeDeallocationOption.RetainedData; |
| | | 88 | | } |
| | 0 | 89 | | return null; |
| | | 90 | | } |
| | | 91 | | } |
| | | 92 | | } |