| | 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 CertificateFormat. |
| | 20 | | /// </summary> |
| | 21 | | [JsonConverter(typeof(StringEnumConverter))] |
| | 22 | | public enum CertificateFormat |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// The Certificate is a PFX (PKCS#12) formatted Certificate or |
| | 26 | | /// Certificate chain. |
| | 27 | | /// </summary> |
| | 28 | | [EnumMember(Value = "pfx")] |
| | 29 | | Pfx, |
| | 30 | | /// <summary> |
| | 31 | | /// The Certificate is a base64-encoded X.509 Certificate. |
| | 32 | | /// </summary> |
| | 33 | | [EnumMember(Value = "cer")] |
| | 34 | | Cer |
| | 35 | | } |
| | 36 | | internal static class CertificateFormatEnumExtension |
| | 37 | | { |
| | 38 | | internal static string ToSerializedValue(this CertificateFormat? value) |
| | 39 | | { |
| 0 | 40 | | return value == null ? null : ((CertificateFormat)value).ToSerializedValue(); |
| | 41 | | } |
| | 42 | |
|
| | 43 | | internal static string ToSerializedValue(this CertificateFormat value) |
| | 44 | | { |
| | 45 | | switch( value ) |
| | 46 | | { |
| | 47 | | case CertificateFormat.Pfx: |
| 0 | 48 | | return "pfx"; |
| | 49 | | case CertificateFormat.Cer: |
| 0 | 50 | | return "cer"; |
| | 51 | | } |
| 0 | 52 | | return null; |
| | 53 | | } |
| | 54 | |
|
| | 55 | | internal static CertificateFormat? ParseCertificateFormat(this string value) |
| | 56 | | { |
| | 57 | | switch( value ) |
| | 58 | | { |
| | 59 | | case "pfx": |
| 0 | 60 | | return CertificateFormat.Pfx; |
| | 61 | | case "cer": |
| 0 | 62 | | return CertificateFormat.Cer; |
| | 63 | | } |
| 0 | 64 | | return null; |
| | 65 | | } |
| | 66 | | } |
| | 67 | | } |