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

package tsptest.literalservice.models;

/**
 * Defines values for PutRequestOptionalLiteralParam.
 */
public enum PutRequestOptionalLiteralParam {
    /**
     * Enum value optionalLiteralParam.
     */
    OPTIONAL_LITERAL_PARAM("optionalLiteralParam");

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

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

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

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