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

package com.azure.resourcemanager.vmwarecloudsimple.models;

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

/** Disk's independence mode type. */
public enum DiskIndependenceMode {
    /** Enum value persistent. */
    PERSISTENT("persistent"),

    /** Enum value independent_persistent. */
    INDEPENDENT_PERSISTENT("independent_persistent"),

    /** Enum value independent_nonpersistent. */
    INDEPENDENT_NONPERSISTENT("independent_nonpersistent");

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

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

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

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