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

namespace Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo;

use UnexpectedValueException;

/**
 * The type of resource.
 *
 * Protobuf type <code>google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType</code>
 */
class ResourceType
{
    /**
     * Unknown resource type.
     *
     * Generated from protobuf enum <code>RESOURCE_TYPE_UNSPECIFIED = 0;</code>
     */
    const RESOURCE_TYPE_UNSPECIFIED = 0;
    /**
     * Deprecated. Existing workloads will continue to support this, but new
     * CreateWorkloadRequests should not specify this as an input value.
     *
     * Generated from protobuf enum <code>CONSUMER_PROJECT = 1 [deprecated = true];</code>
     */
    const CONSUMER_PROJECT = 1;
    /**
     * Consumer Folder.
     *
     * Generated from protobuf enum <code>CONSUMER_FOLDER = 4;</code>
     */
    const CONSUMER_FOLDER = 4;
    /**
     * Consumer project containing encryption keys.
     *
     * Generated from protobuf enum <code>ENCRYPTION_KEYS_PROJECT = 2;</code>
     */
    const ENCRYPTION_KEYS_PROJECT = 2;
    /**
     * Keyring resource that hosts encryption keys.
     *
     * Generated from protobuf enum <code>KEYRING = 3;</code>
     */
    const KEYRING = 3;

    private static $valueToName = [
        self::RESOURCE_TYPE_UNSPECIFIED => 'RESOURCE_TYPE_UNSPECIFIED',
        self::CONSUMER_PROJECT => 'CONSUMER_PROJECT',
        self::CONSUMER_FOLDER => 'CONSUMER_FOLDER',
        self::ENCRYPTION_KEYS_PROJECT => 'ENCRYPTION_KEYS_PROJECT',
        self::KEYRING => 'KEYRING',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ResourceType::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceInfo_ResourceType::class);

