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

namespace Google\Cloud\Ces\V1\TransferRule;

use UnexpectedValueException;

/**
 * The direction of the transfer.
 *
 * Protobuf type <code>google.cloud.ces.v1.TransferRule.Direction</code>
 */
class Direction
{
    /**
     * Unspecified direction.
     *
     * Generated from protobuf enum <code>DIRECTION_UNSPECIFIED = 0;</code>
     */
    const DIRECTION_UNSPECIFIED = 0;
    /**
     * Transfer from the parent agent to the child agent.
     *
     * Generated from protobuf enum <code>PARENT_TO_CHILD = 1;</code>
     */
    const PARENT_TO_CHILD = 1;
    /**
     * Transfer from the child agent to the parent agent.
     *
     * Generated from protobuf enum <code>CHILD_TO_PARENT = 2;</code>
     */
    const CHILD_TO_PARENT = 2;

    private static $valueToName = [
        self::DIRECTION_UNSPECIFIED => 'DIRECTION_UNSPECIFIED',
        self::PARENT_TO_CHILD => 'PARENT_TO_CHILD',
        self::CHILD_TO_PARENT => 'CHILD_TO_PARENT',
    ];

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

