<?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;

/**
 * The pricing plan for this instance.
 *
 * Protobuf type <code>google.cloud.sql.v1beta4.SqlPricingPlan</code>
 */
class SqlPricingPlan
{
    /**
     * This is an unknown pricing plan for this instance.
     *
     * Generated from protobuf enum <code>SQL_PRICING_PLAN_UNSPECIFIED = 0;</code>
     */
    const SQL_PRICING_PLAN_UNSPECIFIED = 0;
    /**
     * The instance is billed at a monthly flat rate.
     *
     * Generated from protobuf enum <code>PACKAGE = 1;</code>
     */
    const PACKAGE = 1;
    /**
     * The instance is billed per usage.
     *
     * Generated from protobuf enum <code>PER_USE = 2;</code>
     */
    const PER_USE = 2;

    private static $valueToName = [
        self::SQL_PRICING_PLAN_UNSPECIFIED => 'SQL_PRICING_PLAN_UNSPECIFIED',
        self::PACKAGE => 'PACKAGE',
        self::PER_USE => 'PER_USE',
    ];

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

