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

package com.azure.resourcemanager.managementgroups.models;

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

/** The status of the Tenant Backfill. */
public enum Status {
    /** Enum value NotStarted. */
    NOT_STARTED("NotStarted"),

    /** Enum value NotStartedButGroupsExist. */
    NOT_STARTED_BUT_GROUPS_EXIST("NotStartedButGroupsExist"),

    /** Enum value Started. */
    STARTED("Started"),

    /** Enum value Failed. */
    FAILED("Failed"),

    /** Enum value Cancelled. */
    CANCELLED("Cancelled"),

    /** Enum value Completed. */
    COMPLETED("Completed");

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

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

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

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