| | | 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 SubtaskState. |
| | | 20 | | /// </summary> |
| | | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | | 22 | | public enum SubtaskState |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// The Task has been assigned to a Compute Node, but is waiting for a |
| | | 26 | | /// required Job Preparation Task to complete on the Compute Node. If |
| | | 27 | | /// the Job Preparation Task succeeds, the Task will move to running. |
| | | 28 | | /// If the Job Preparation Task fails, the Task will return to active |
| | | 29 | | /// and will be eligible to be assigned to a different Compute Node. |
| | | 30 | | /// </summary> |
| | | 31 | | [EnumMember(Value = "preparing")] |
| | | 32 | | Preparing, |
| | | 33 | | /// <summary> |
| | | 34 | | /// The Task is running on a Compute Node. This includes task-level |
| | | 35 | | /// preparation such as downloading resource files or deploying |
| | | 36 | | /// Packages specified on the Task - it does not necessarily mean that |
| | | 37 | | /// the Task command line has started executing. |
| | | 38 | | /// </summary> |
| | | 39 | | [EnumMember(Value = "running")] |
| | | 40 | | Running, |
| | | 41 | | /// <summary> |
| | | 42 | | /// The Task is no longer eligible to run, usually because the Task has |
| | | 43 | | /// finished successfully, or the Task has finished unsuccessfully and |
| | | 44 | | /// has exhausted its retry limit. A Task is also marked as completed |
| | | 45 | | /// if an error occurred launching the Task, or when the Task has been |
| | | 46 | | /// terminated. |
| | | 47 | | /// </summary> |
| | | 48 | | [EnumMember(Value = "completed")] |
| | | 49 | | Completed |
| | | 50 | | } |
| | | 51 | | internal static class SubtaskStateEnumExtension |
| | | 52 | | { |
| | | 53 | | internal static string ToSerializedValue(this SubtaskState? value) |
| | | 54 | | { |
| | 0 | 55 | | return value == null ? null : ((SubtaskState)value).ToSerializedValue(); |
| | | 56 | | } |
| | | 57 | | |
| | | 58 | | internal static string ToSerializedValue(this SubtaskState value) |
| | | 59 | | { |
| | | 60 | | switch( value ) |
| | | 61 | | { |
| | | 62 | | case SubtaskState.Preparing: |
| | 0 | 63 | | return "preparing"; |
| | | 64 | | case SubtaskState.Running: |
| | 0 | 65 | | return "running"; |
| | | 66 | | case SubtaskState.Completed: |
| | 0 | 67 | | return "completed"; |
| | | 68 | | } |
| | 0 | 69 | | return null; |
| | | 70 | | } |
| | | 71 | | |
| | | 72 | | internal static SubtaskState? ParseSubtaskState(this string value) |
| | | 73 | | { |
| | | 74 | | switch( value ) |
| | | 75 | | { |
| | | 76 | | case "preparing": |
| | 0 | 77 | | return SubtaskState.Preparing; |
| | | 78 | | case "running": |
| | 0 | 79 | | return SubtaskState.Running; |
| | | 80 | | case "completed": |
| | 0 | 81 | | return SubtaskState.Completed; |
| | | 82 | | } |
| | 0 | 83 | | return null; |
| | | 84 | | } |
| | | 85 | | } |
| | | 86 | | } |