<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/sql/v1beta4/cloud_sql_resources.proto

namespace Google\Cloud\Sql\V1beta4;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.cloud.sql.v1beta4.SqlInstanceType</code>
 */
class SqlInstanceType
{
    /**
     * This is an unknown Cloud SQL instance type.
     *
     * Generated from protobuf enum <code>SQL_INSTANCE_TYPE_UNSPECIFIED = 0;</code>
     */
    const SQL_INSTANCE_TYPE_UNSPECIFIED = 0;
    /**
     * A regular Cloud SQL instance.
     *
     * Generated from protobuf enum <code>CLOUD_SQL_INSTANCE = 1;</code>
     */
    const CLOUD_SQL_INSTANCE = 1;
    /**
     * An instance running on the customer's premises that is not managed by
     * Cloud SQL.
     *
     * Generated from protobuf enum <code>ON_PREMISES_INSTANCE = 2;</code>
     */
    const ON_PREMISES_INSTANCE = 2;
    /**
     * A Cloud SQL instance acting as a read-replica.
     *
     * Generated from protobuf enum <code>READ_REPLICA_INSTANCE = 3;</code>
     */
    const READ_REPLICA_INSTANCE = 3;

    private static $valueToName = [
        self::SQL_INSTANCE_TYPE_UNSPECIFIED => 'SQL_INSTANCE_TYPE_UNSPECIFIED',
        self::CLOUD_SQL_INSTANCE => 'CLOUD_SQL_INSTANCE',
        self::ON_PREMISES_INSTANCE => 'ON_PREMISES_INSTANCE',
        self::READ_REPLICA_INSTANCE => 'READ_REPLICA_INSTANCE',
    ];

    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);
    }
}

