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

namespace Google\Cloud\ContactCenterInsights\V1\ConversationParticipant;

use UnexpectedValueException;

/**
 * The role of the participant.
 *
 * Protobuf type <code>google.cloud.contactcenterinsights.v1.ConversationParticipant.Role</code>
 */
class Role
{
    /**
     * Participant's role is not set.
     *
     * Generated from protobuf enum <code>ROLE_UNSPECIFIED = 0;</code>
     */
    const ROLE_UNSPECIFIED = 0;
    /**
     * Participant is a human agent.
     *
     * Generated from protobuf enum <code>HUMAN_AGENT = 1;</code>
     */
    const HUMAN_AGENT = 1;
    /**
     * Participant is an automated agent.
     *
     * Generated from protobuf enum <code>AUTOMATED_AGENT = 2;</code>
     */
    const AUTOMATED_AGENT = 2;
    /**
     * Participant is an end user who conversed with the contact center.
     *
     * Generated from protobuf enum <code>END_USER = 3;</code>
     */
    const END_USER = 3;
    /**
     * Participant is either a human or automated agent.
     *
     * Generated from protobuf enum <code>ANY_AGENT = 4;</code>
     */
    const ANY_AGENT = 4;

    private static $valueToName = [
        self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED',
        self::HUMAN_AGENT => 'HUMAN_AGENT',
        self::AUTOMATED_AGENT => 'AUTOMATED_AGENT',
        self::END_USER => 'END_USER',
        self::ANY_AGENT => 'ANY_AGENT',
    ];

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


