| | 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 PoolLifetimeOption. |
| | 20 | | /// </summary> |
| | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | 22 | | public enum PoolLifetimeOption |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// The Pool exists for the lifetime of the Job Schedule. The Batch |
| | 26 | | /// Service creates the Pool when it creates the first Job on the |
| | 27 | | /// schedule. You may apply this option only to Job Schedules, not to |
| | 28 | | /// Jobs. |
| | 29 | | /// </summary> |
| | 30 | | [EnumMember(Value = "jobschedule")] |
| | 31 | | JobSchedule, |
| | 32 | | /// <summary> |
| | 33 | | /// The Pool exists for the lifetime of the Job to which it is |
| | 34 | | /// dedicated. The Batch service creates the Pool when it creates the |
| | 35 | | /// Job. If the 'job' option is applied to a Job Schedule, the Batch |
| | 36 | | /// service creates a new auto Pool for every Job created on the |
| | 37 | | /// schedule. |
| | 38 | | /// </summary> |
| | 39 | | [EnumMember(Value = "job")] |
| | 40 | | Job |
| | 41 | | } |
| | 42 | | internal static class PoolLifetimeOptionEnumExtension |
| | 43 | | { |
| | 44 | | internal static string ToSerializedValue(this PoolLifetimeOption? value) |
| | 45 | | { |
| 0 | 46 | | return value == null ? null : ((PoolLifetimeOption)value).ToSerializedValue(); |
| | 47 | | } |
| | 48 | |
|
| | 49 | | internal static string ToSerializedValue(this PoolLifetimeOption value) |
| | 50 | | { |
| | 51 | | switch( value ) |
| | 52 | | { |
| | 53 | | case PoolLifetimeOption.JobSchedule: |
| 0 | 54 | | return "jobschedule"; |
| | 55 | | case PoolLifetimeOption.Job: |
| 0 | 56 | | return "job"; |
| | 57 | | } |
| 0 | 58 | | return null; |
| | 59 | | } |
| | 60 | |
|
| | 61 | | internal static PoolLifetimeOption? ParsePoolLifetimeOption(this string value) |
| | 62 | | { |
| | 63 | | switch( value ) |
| | 64 | | { |
| | 65 | | case "jobschedule": |
| 0 | 66 | | return PoolLifetimeOption.JobSchedule; |
| | 67 | | case "job": |
| 0 | 68 | | return PoolLifetimeOption.Job; |
| | 69 | | } |
| 0 | 70 | | return null; |
| | 71 | | } |
| | 72 | | } |
| | 73 | | } |