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

package tsptest.naming.models;

/**
 * Defines values for RunObjectLastErrorCodeRenamed.
 */
public enum RunObjectLastErrorCodeRenamed {
    /**
     * Enum value server_error.
     */
    SERVER_ERROR("server_error"),

    /**
     * Enum value rate_limit_exceeded.
     */
    RATE_LIMIT_EXCEEDED("rate_limit_exceeded"),

    /**
     * Enum value invalid_prompt.
     */
    INVALID_PROMPT("invalid_prompt");

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

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

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

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