1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License.
3 // Code generated by Microsoft (R) AutoRest Code Generator
4
5 package com.microsoft.azure.batch.protocol.models;
6
7 import com.fasterxml.jackson.annotation.JsonCreator;
8 import com.fasterxml.jackson.annotation.JsonValue;
9
10 /**
11 * Defines values for CertificateFormat.
12 */
13 public enum CertificateFormat {
14 /** The certificate is a PFX (PKCS#12) formatted certificate or certificate chain. */
15 PFX("pfx"),
16
17 /** The certificate is a base64-encoded X.509 certificate. */
18 CER("cer");
19
20 /** The actual serialized value for a CertificateFormat instance. */
21 private String value;
22
23 CertificateFormat(String value) {
24 this.value = value;
25 }
26
27 /**
28 * Parses a serialized value to a CertificateFormat instance.
29 *
30 * @param value the serialized value to parse.
31 * @return the parsed CertificateFormat object, or null if unable to parse.
32 */
33 @JsonCreator
34 public static CertificateFormat fromString(String value) {
35 CertificateFormat[] items = CertificateFormat.values();
36 for (CertificateFormat item : items) {
37 if (item.toString().equalsIgnoreCase(value)) {
38 return item;
39 }
40 }
41 return null;
42 }
43
44 @JsonValue
45 @Override
46 public String toString() {
47 return this.value;
48 }
49 }