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

package com.azure.resourcemanager.labservices.models;

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

/** The state of a virtual machine. */
public enum LabState {
    /** Enum value Draft. */
    DRAFT("Draft"),

    /** Enum value Publishing. */
    PUBLISHING("Publishing"),

    /** Enum value Scaling. */
    SCALING("Scaling"),

    /** Enum value Syncing. */
    SYNCING("Syncing"),

    /** Enum value Published. */
    PUBLISHED("Published");

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

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

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

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