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

namespace Google\Cloud\GkeMultiCloud\V1\LoggingComponentConfig;

use UnexpectedValueException;

/**
 * The components of the logging configuration;
 *
 * Protobuf type <code>google.cloud.gkemulticloud.v1.LoggingComponentConfig.Component</code>
 */
class Component
{
    /**
     * No component is specified
     *
     * Generated from protobuf enum <code>COMPONENT_UNSPECIFIED = 0;</code>
     */
    const COMPONENT_UNSPECIFIED = 0;
    /**
     * This indicates that system logging components is enabled.
     *
     * Generated from protobuf enum <code>SYSTEM_COMPONENTS = 1;</code>
     */
    const SYSTEM_COMPONENTS = 1;
    /**
     * This indicates that user workload logging component is enabled.
     *
     * 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);
    }
}


