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

package com.azure.resourcemanager.customerinsights.models;

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

/** Type of roles. */
public enum RoleTypes {
    /** Enum value Admin. */
    ADMIN("Admin"),

    /** Enum value Reader. */
    READER("Reader"),

    /** Enum value ManageAdmin. */
    MANAGE_ADMIN("ManageAdmin"),

    /** Enum value ManageReader. */
    MANAGE_READER("ManageReader"),

    /** Enum value DataAdmin. */
    DATA_ADMIN("DataAdmin"),

    /** Enum value DataReader. */
    DATA_READER("DataReader");

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

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

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

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