| | 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 JobState. |
| | 20 | | /// </summary> |
| | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | 22 | | public enum JobState |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// The Job is available to have Tasks scheduled. |
| | 26 | | /// </summary> |
| | 27 | | [EnumMember(Value = "active")] |
| | 28 | | Active, |
| | 29 | | /// <summary> |
| | 30 | | /// A user has requested that the Job be disabled, but the disable |
| | 31 | | /// operation is still in progress (for example, waiting for Tasks to |
| | 32 | | /// terminate). |
| | 33 | | /// </summary> |
| | 34 | | [EnumMember(Value = "disabling")] |
| | 35 | | Disabling, |
| | 36 | | /// <summary> |
| | 37 | | /// A user has disabled the Job. No Tasks are running, and no new Tasks |
| | 38 | | /// will be scheduled. |
| | 39 | | /// </summary> |
| | 40 | | [EnumMember(Value = "disabled")] |
| | 41 | | Disabled, |
| | 42 | | /// <summary> |
| | 43 | | /// A user has requested that the Job be enabled, but the enable |
| | 44 | | /// operation is still in progress. |
| | 45 | | /// </summary> |
| | 46 | | [EnumMember(Value = "enabling")] |
| | 47 | | Enabling, |
| | 48 | | /// <summary> |
| | 49 | | /// The Job is about to complete, either because a Job Manager Task has |
| | 50 | | /// completed or because the user has terminated the Job, but the |
| | 51 | | /// terminate operation is still in progress (for example, because Job |
| | 52 | | /// Release Tasks are running). |
| | 53 | | /// </summary> |
| | 54 | | [EnumMember(Value = "terminating")] |
| | 55 | | Terminating, |
| | 56 | | /// <summary> |
| | 57 | | /// All Tasks have terminated, and the system will not accept any more |
| | 58 | | /// Tasks or any further changes to the Job. |
| | 59 | | /// </summary> |
| | 60 | | [EnumMember(Value = "completed")] |
| | 61 | | Completed, |
| | 62 | | /// <summary> |
| | 63 | | /// A user has requested that the Job be deleted, but the delete |
| | 64 | | /// operation is still in progress (for example, because the system is |
| | 65 | | /// still terminating running Tasks). |
| | 66 | | /// </summary> |
| | 67 | | [EnumMember(Value = "deleting")] |
| | 68 | | Deleting |
| | 69 | | } |
| | 70 | | internal static class JobStateEnumExtension |
| | 71 | | { |
| | 72 | | internal static string ToSerializedValue(this JobState? value) |
| | 73 | | { |
| 0 | 74 | | return value == null ? null : ((JobState)value).ToSerializedValue(); |
| | 75 | | } |
| | 76 | |
|
| | 77 | | internal static string ToSerializedValue(this JobState value) |
| | 78 | | { |
| | 79 | | switch( value ) |
| | 80 | | { |
| | 81 | | case JobState.Active: |
| 0 | 82 | | return "active"; |
| | 83 | | case JobState.Disabling: |
| 0 | 84 | | return "disabling"; |
| | 85 | | case JobState.Disabled: |
| 0 | 86 | | return "disabled"; |
| | 87 | | case JobState.Enabling: |
| 0 | 88 | | return "enabling"; |
| | 89 | | case JobState.Terminating: |
| 0 | 90 | | return "terminating"; |
| | 91 | | case JobState.Completed: |
| 0 | 92 | | return "completed"; |
| | 93 | | case JobState.Deleting: |
| 0 | 94 | | return "deleting"; |
| | 95 | | } |
| 0 | 96 | | return null; |
| | 97 | | } |
| | 98 | |
|
| | 99 | | internal static JobState? ParseJobState(this string value) |
| | 100 | | { |
| | 101 | | switch( value ) |
| | 102 | | { |
| | 103 | | case "active": |
| 0 | 104 | | return JobState.Active; |
| | 105 | | case "disabling": |
| 0 | 106 | | return JobState.Disabling; |
| | 107 | | case "disabled": |
| 0 | 108 | | return JobState.Disabled; |
| | 109 | | case "enabling": |
| 0 | 110 | | return JobState.Enabling; |
| | 111 | | case "terminating": |
| 0 | 112 | | return JobState.Terminating; |
| | 113 | | case "completed": |
| 0 | 114 | | return JobState.Completed; |
| | 115 | | case "deleting": |
| 0 | 116 | | return JobState.Deleting; |
| | 117 | | } |
| 0 | 118 | | return null; |
| | 119 | | } |
| | 120 | | } |
| | 121 | | } |