<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/databasecenter/v1beta/service.proto

namespace Google\Cloud\DatabaseCenter\V1beta;

use UnexpectedValueException;

/**
 * The enum value corresponds to 'type' suffix in the resource_type field.
 *
 * Protobuf type <code>google.cloud.databasecenter.v1beta.ResourceCategory</code>
 */
class ResourceCategory
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>RESOURCE_CATEGORY_UNSPECIFIED = 0;</code>
     */
    const RESOURCE_CATEGORY_UNSPECIFIED = 0;
    /**
     * A resource that is an Instance.
     *
     * Generated from protobuf enum <code>INSTANCE = 1;</code>
     */
    const INSTANCE = 1;
    /**
     * A resource that is a Cluster.
     *
     * Generated from protobuf enum <code>CLUSTER = 2;</code>
     */
    const CLUSTER = 2;
    /**
     * A resource that is a Database.
     *
     * Generated from protobuf enum <code>DATABASE = 3;</code>
     */
    const DATABASE = 3;

    private static $valueToName = [
        self::RESOURCE_CATEGORY_UNSPECIFIED => 'RESOURCE_CATEGORY_UNSPECIFIED',
        self::INSTANCE => 'INSTANCE',
        self::CLUSTER => 'CLUSTER',
        self::DATABASE => 'DATABASE',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

