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

package com.azure.resourcemanager.automation.models;

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

/** Gets or sets the provisioning state of the module. */
public enum ModuleProvisioningState {
    /** Enum value Created. */
    CREATED("Created"),

    /** Enum value Creating. */
    CREATING("Creating"),

    /** Enum value StartingImportModuleRunbook. */
    STARTING_IMPORT_MODULE_RUNBOOK("StartingImportModuleRunbook"),

    /** Enum value RunningImportModuleRunbook. */
    RUNNING_IMPORT_MODULE_RUNBOOK("RunningImportModuleRunbook"),

    /** Enum value ContentRetrieved. */
    CONTENT_RETRIEVED("ContentRetrieved"),

    /** Enum value ContentDownloaded. */
    CONTENT_DOWNLOADED("ContentDownloaded"),

    /** Enum value ContentValidated. */
    CONTENT_VALIDATED("ContentValidated"),

    /** Enum value ConnectionTypeImported. */
    CONNECTION_TYPE_IMPORTED("ConnectionTypeImported"),

    /** Enum value ContentStored. */
    CONTENT_STORED("ContentStored"),

    /** Enum value ModuleDataStored. */
    MODULE_DATA_STORED("ModuleDataStored"),

    /** Enum value ActivitiesStored. */
    ACTIVITIES_STORED("ActivitiesStored"),

    /** Enum value ModuleImportRunbookComplete. */
    MODULE_IMPORT_RUNBOOK_COMPLETE("ModuleImportRunbookComplete"),

    /** Enum value Succeeded. */
    SUCCEEDED("Succeeded"),

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

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

    /** Enum value Updating. */
    UPDATING("Updating");

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

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

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

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