| | 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 CertificateState. |
| | 20 | | /// </summary> |
| | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | 22 | | public enum CertificateState |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// The Certificate is available for use in Pools. |
| | 26 | | /// </summary> |
| | 27 | | [EnumMember(Value = "active")] |
| | 28 | | Active, |
| | 29 | | /// <summary> |
| | 30 | | /// The user has requested that the Certificate be deleted, but the |
| | 31 | | /// delete operation has not yet completed. You may not reference the |
| | 32 | | /// Certificate when creating or updating Pools. |
| | 33 | | /// </summary> |
| | 34 | | [EnumMember(Value = "deleting")] |
| | 35 | | Deleting, |
| | 36 | | /// <summary> |
| | 37 | | /// The user requested that the Certificate be deleted, but there are |
| | 38 | | /// Pools that still have references to the Certificate, or it is still |
| | 39 | | /// installed on one or more Nodes. (The latter can occur if the |
| | 40 | | /// Certificate has been removed from the Pool, but the Compute Node |
| | 41 | | /// has not yet restarted. Compute Nodes refresh their Certificates |
| | 42 | | /// only when they restart.) You may use the cancel Certificate delete |
| | 43 | | /// operation to cancel the delete, or the delete Certificate operation |
| | 44 | | /// to retry the delete. |
| | 45 | | /// </summary> |
| | 46 | | [EnumMember(Value = "deletefailed")] |
| | 47 | | DeleteFailed |
| | 48 | | } |
| | 49 | | internal static class CertificateStateEnumExtension |
| | 50 | | { |
| | 51 | | internal static string ToSerializedValue(this CertificateState? value) |
| | 52 | | { |
| 0 | 53 | | return value == null ? null : ((CertificateState)value).ToSerializedValue(); |
| | 54 | | } |
| | 55 | |
|
| | 56 | | internal static string ToSerializedValue(this CertificateState value) |
| | 57 | | { |
| | 58 | | switch( value ) |
| | 59 | | { |
| | 60 | | case CertificateState.Active: |
| 0 | 61 | | return "active"; |
| | 62 | | case CertificateState.Deleting: |
| 0 | 63 | | return "deleting"; |
| | 64 | | case CertificateState.DeleteFailed: |
| 0 | 65 | | return "deletefailed"; |
| | 66 | | } |
| 0 | 67 | | return null; |
| | 68 | | } |
| | 69 | |
|
| | 70 | | internal static CertificateState? ParseCertificateState(this string value) |
| | 71 | | { |
| | 72 | | switch( value ) |
| | 73 | | { |
| | 74 | | case "active": |
| 0 | 75 | | return CertificateState.Active; |
| | 76 | | case "deleting": |
| 0 | 77 | | return CertificateState.Deleting; |
| | 78 | | case "deletefailed": |
| 0 | 79 | | return CertificateState.DeleteFailed; |
| | 80 | | } |
| 0 | 81 | | return null; |
| | 82 | | } |
| | 83 | | } |
| | 84 | | } |