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

package tsptest.server.contoso.models;

/**
 * Defines values for APIVersions.
 */
public enum APIVersions {
    /**
     * Enum value v1.
     */
    V1("v1");

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

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

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

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