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

namespace Google\Cloud\Channel\V1\EntitlementChange;

use UnexpectedValueException;

/**
 * Specifies the type of operator responsible for the change
 *
 * Protobuf type <code>google.cloud.channel.v1.EntitlementChange.OperatorType</code>
 */
class OperatorType
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>OPERATOR_TYPE_UNSPECIFIED = 0;</code>
     */
    const OPERATOR_TYPE_UNSPECIFIED = 0;
    /**
     * Customer service representative.
     *
     * Generated from protobuf enum <code>CUSTOMER_SERVICE_REPRESENTATIVE = 1;</code>
     */
    const CUSTOMER_SERVICE_REPRESENTATIVE = 1;
    /**
     * System auto job.
     *
     * Generated from protobuf enum <code>SYSTEM = 2;</code>
     */
    const SYSTEM = 2;
    /**
     * Customer user.
     *
     * Generated from protobuf enum <code>CUSTOMER = 3;</code>
     */
    const CUSTOMER = 3;
    /**
     * Reseller user.
     *
     * Generated from protobuf enum <code>RESELLER = 4;</code>
     */
    const RESELLER = 4;

    private static $valueToName = [
        self::OPERATOR_TYPE_UNSPECIFIED => 'OPERATOR_TYPE_UNSPECIFIED',
        self::CUSTOMER_SERVICE_REPRESENTATIVE => 'CUSTOMER_SERVICE_REPRESENTATIVE',
        self::SYSTEM => 'SYSTEM',
        self::CUSTOMER => 'CUSTOMER',
        self::RESELLER => 'RESELLER',
    ];

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


