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