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

namespace Google\Cloud\GkeMultiCloud\V1\AwsInstancePlacement;

use UnexpectedValueException;

/**
 * Tenancy defines how EC2 instances are distributed across physical hardware.
 *
 * Protobuf type <code>google.cloud.gkemulticloud.v1.AwsInstancePlacement.Tenancy</code>
 */
class Tenancy
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>TENANCY_UNSPECIFIED = 0;</code>
     */
    const TENANCY_UNSPECIFIED = 0;
    /**
     * Use default VPC tenancy.
     *
     * Generated from protobuf enum <code>DEFAULT = 1;</code>
     */
    const PBDEFAULT = 1;
    /**
     * Run a dedicated instance.
     *
     * Generated from protobuf enum <code>DEDICATED = 2;</code>
     */
    const DEDICATED = 2;
    /**
     * Launch this instance to a dedicated host.
     *
     * Generated from protobuf enum <code>HOST = 3;</code>
     */
    const HOST = 3;

    private static $valueToName = [
        self::TENANCY_UNSPECIFIED => 'TENANCY_UNSPECIFIED',
        self::PBDEFAULT => 'DEFAULT',
        self::DEDICATED => 'DEDICATED',
        self::HOST => 'HOST',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}


