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

package com.azure.resourcemanager.datamigration.models;

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

/**
 * Permission group for validations. These groups will run a set of permissions for validating user activity. Select the
 * permission group for the activity that you are performing.
 */
public enum ServerLevelPermissionsGroup {
    /** Enum value Default. */
    DEFAULT("Default"),

    /** Enum value MigrationFromSqlServerToAzureDB. */
    MIGRATION_FROM_SQL_SERVER_TO_AZURE_DB("MigrationFromSqlServerToAzureDB"),

    /** Enum value MigrationFromSqlServerToAzureMI. */
    MIGRATION_FROM_SQL_SERVER_TO_AZURE_MI("MigrationFromSqlServerToAzureMI"),

    /** Enum value MigrationFromMySQLToAzureDBForMySQL. */
    MIGRATION_FROM_MY_SQLTO_AZURE_DBFOR_MY_SQL("MigrationFromMySQLToAzureDBForMySQL");

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

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

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

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