// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datalakestore.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * The type of encryption configuration being used. Currently the only supported types are 'UserManaged' and
 * 'ServiceManaged'.
 */
public enum EncryptionConfigType {
    /** Enum value UserManaged. */
    USER_MANAGED("UserManaged"),

    /** Enum value ServiceManaged. */
    SERVICE_MANAGED("ServiceManaged");

    /** The actual serialized value for a EncryptionConfigType instance. */
    private final String value;

    EncryptionConfigType(String value) {
        this.value = value;
    }

    /**
     * Parses a serialized value to a EncryptionConfigType instance.
     *
     * @param value the serialized value to parse.
     * @return the parsed EncryptionConfigType object, or null if unable to parse.
     */
    @JsonCreator
    public static EncryptionConfigType fromString(String value) {
        if (value == null) {
            return null;
        }
        EncryptionConfigType[] items = EncryptionConfigType.values();
        for (EncryptionConfigType item : items) {
            if (item.toString().equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }

    /** {@inheritDoc} */
    @JsonValue
    @Override
    public String toString() {
        return this.value;
    }
}
