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

namespace Google\Cloud\Container\V1\LoggingComponentConfig;

use UnexpectedValueException;

/**
 * GKE components exposing logs
 *
 * Protobuf type <code>google.container.v1.LoggingComponentConfig.Component</code>
 */
class Component
{
    /**
     * Default value. This shouldn't be used.
     *
     * Generated from protobuf enum <code>COMPONENT_UNSPECIFIED = 0;</code>
     */
    const COMPONENT_UNSPECIFIED = 0;
    /**
     * system components
     *
     * Generated from protobuf enum <code>SYSTEM_COMPONENTS = 1;</code>
     */
    const SYSTEM_COMPONENTS = 1;
    /**
     * workloads
     *
     * Generated from protobuf enum <code>WORKLOADS = 2;</code>
     */
    const WORKLOADS = 2;

    private static $valueToName = [
        self::COMPONENT_UNSPECIFIED => 'COMPONENT_UNSPECIFIED',
        self::SYSTEM_COMPONENTS => 'SYSTEM_COMPONENTS',
        self::WORKLOADS => 'WORKLOADS',
    ];

    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(Component::class, \Google\Cloud\Container\V1\LoggingComponentConfig_Component::class);

