<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/netapp/v1/quota_rule.proto

namespace Google\Cloud\NetApp\V1\QuotaRule;

use UnexpectedValueException;

/**
 * Types of Quota Rule
 *
 * Protobuf type <code>google.cloud.netapp.v1.QuotaRule.Type</code>
 */
class Type
{
    /**
     * Unspecified type for quota rule
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * Individual user quota rule
     *
     * Generated from protobuf enum <code>INDIVIDUAL_USER_QUOTA = 1;</code>
     */
    const INDIVIDUAL_USER_QUOTA = 1;
    /**
     * Individual group quota rule
     *
     * Generated from protobuf enum <code>INDIVIDUAL_GROUP_QUOTA = 2;</code>
     */
    const INDIVIDUAL_GROUP_QUOTA = 2;
    /**
     * Default user quota rule
     *
     * Generated from protobuf enum <code>DEFAULT_USER_QUOTA = 3;</code>
     */
    const DEFAULT_USER_QUOTA = 3;
    /**
     * Default group quota rule
     *
     * Generated from protobuf enum <code>DEFAULT_GROUP_QUOTA = 4;</code>
     */
    const DEFAULT_GROUP_QUOTA = 4;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::INDIVIDUAL_USER_QUOTA => 'INDIVIDUAL_USER_QUOTA',
        self::INDIVIDUAL_GROUP_QUOTA => 'INDIVIDUAL_GROUP_QUOTA',
        self::DEFAULT_USER_QUOTA => 'DEFAULT_USER_QUOTA',
        self::DEFAULT_GROUP_QUOTA => 'DEFAULT_GROUP_QUOTA',
    ];

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


