| | 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 CachingType. |
| | 20 | | /// </summary> |
| | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | 22 | | public enum CachingType |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// The caching mode for the disk is not enabled. |
| | 26 | | /// </summary> |
| | 27 | | [EnumMember(Value = "none")] |
| | 28 | | None, |
| | 29 | | /// <summary> |
| | 30 | | /// The caching mode for the disk is read only. |
| | 31 | | /// </summary> |
| | 32 | | [EnumMember(Value = "readonly")] |
| | 33 | | ReadOnly, |
| | 34 | | /// <summary> |
| | 35 | | /// The caching mode for the disk is read and write. |
| | 36 | | /// </summary> |
| | 37 | | [EnumMember(Value = "readwrite")] |
| | 38 | | ReadWrite |
| | 39 | | } |
| | 40 | | internal static class CachingTypeEnumExtension |
| | 41 | | { |
| | 42 | | internal static string ToSerializedValue(this CachingType? value) |
| | 43 | | { |
| 0 | 44 | | return value == null ? null : ((CachingType)value).ToSerializedValue(); |
| | 45 | | } |
| | 46 | |
|
| | 47 | | internal static string ToSerializedValue(this CachingType value) |
| | 48 | | { |
| | 49 | | switch( value ) |
| | 50 | | { |
| | 51 | | case CachingType.None: |
| 0 | 52 | | return "none"; |
| | 53 | | case CachingType.ReadOnly: |
| 0 | 54 | | return "readonly"; |
| | 55 | | case CachingType.ReadWrite: |
| 0 | 56 | | return "readwrite"; |
| | 57 | | } |
| 0 | 58 | | return null; |
| | 59 | | } |
| | 60 | |
|
| | 61 | | internal static CachingType? ParseCachingType(this string value) |
| | 62 | | { |
| | 63 | | switch( value ) |
| | 64 | | { |
| | 65 | | case "none": |
| 0 | 66 | | return CachingType.None; |
| | 67 | | case "readonly": |
| 0 | 68 | | return CachingType.ReadOnly; |
| | 69 | | case "readwrite": |
| 0 | 70 | | return CachingType.ReadWrite; |
| | 71 | | } |
| 0 | 72 | | return null; |
| | 73 | | } |
| | 74 | | } |
| | 75 | | } |