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

namespace Google\Cloud\Iot\V1;

use UnexpectedValueException;

/**
 * Gateway type.
 *
 * Protobuf type <code>google.cloud.iot.v1.GatewayType</code>
 */
class GatewayType
{
    /**
     * If unspecified, the device is considered a non-gateway device.
     *
     * Generated from protobuf enum <code>GATEWAY_TYPE_UNSPECIFIED = 0;</code>
     */
    const GATEWAY_TYPE_UNSPECIFIED = 0;
    /**
     * The device is a gateway.
     *
     * Generated from protobuf enum <code>GATEWAY = 1;</code>
     */
    const GATEWAY = 1;
    /**
     * The device is not a gateway.
     *
     * Generated from protobuf enum <code>NON_GATEWAY = 2;</code>
     */
    const NON_GATEWAY = 2;

    private static $valueToName = [
        self::GATEWAY_TYPE_UNSPECIFIED => 'GATEWAY_TYPE_UNSPECIFIED',
        self::GATEWAY => 'GATEWAY',
        self::NON_GATEWAY => 'NON_GATEWAY',
    ];

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

