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

namespace Google\Cloud\ContactCenterInsights\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The call participant speaking for a given utterance.
 *
 * Generated from protobuf message <code>google.cloud.contactcenterinsights.v1.ConversationParticipant</code>
 */
class ConversationParticipant extends \Google\Protobuf\Internal\Message
{
    /**
     * Deprecated. Use `dialogflow_participant_name` instead.
     * The name of the Dialogflow participant. Format:
     * projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
     *
     * Generated from protobuf field <code>string dialogflow_participant = 1 [deprecated = true];</code>
     * @deprecated
     */
    protected $dialogflow_participant = '';
    /**
     * Obfuscated user ID from Dialogflow.
     *
     * Generated from protobuf field <code>string obfuscated_external_user_id = 3;</code>
     */
    private $obfuscated_external_user_id = '';
    /**
     * The role of the participant.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.ConversationParticipant.Role role = 2;</code>
     */
    private $role = 0;
    protected $participant;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $dialogflow_participant_name
     *           The name of the participant provided by Dialogflow. Format:
     *           projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
     *     @type string $user_id
     *           A user-specified ID representing the participant.
     *     @type string $dialogflow_participant
     *           Deprecated. Use `dialogflow_participant_name` instead.
     *           The name of the Dialogflow participant. Format:
     *           projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
     *     @type string $obfuscated_external_user_id
     *           Obfuscated user ID from Dialogflow.
     *     @type int $role
     *           The role of the participant.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the participant provided by Dialogflow. Format:
     * projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
     *
     * Generated from protobuf field <code>string dialogflow_participant_name = 5 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getDialogflowParticipantName()
    {
        return $this->readOneof(5);
    }

    public function hasDialogflowParticipantName()
    {
        return $this->hasOneof(5);
    }

    /**
     * The name of the participant provided by Dialogflow. Format:
     * projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
     *
     * Generated from protobuf field <code>string dialogflow_participant_name = 5 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setDialogflowParticipantName($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * A user-specified ID representing the participant.
     *
     * Generated from protobuf field <code>string user_id = 6;</code>
     * @return string
     */
    public function getUserId()
    {
        return $this->readOneof(6);
    }

    public function hasUserId()
    {
        return $this->hasOneof(6);
    }

    /**
     * A user-specified ID representing the participant.
     *
     * Generated from protobuf field <code>string user_id = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setUserId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Deprecated. Use `dialogflow_participant_name` instead.
     * The name of the Dialogflow participant. Format:
     * projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
     *
     * Generated from protobuf field <code>string dialogflow_participant = 1 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getDialogflowParticipant()
    {
        @trigger_error('dialogflow_participant is deprecated.', E_USER_DEPRECATED);
        return $this->dialogflow_participant;
    }

    /**
     * Deprecated. Use `dialogflow_participant_name` instead.
     * The name of the Dialogflow participant. Format:
     * projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
     *
     * Generated from protobuf field <code>string dialogflow_participant = 1 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setDialogflowParticipant($var)
    {
        @trigger_error('dialogflow_participant is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->dialogflow_participant = $var;

        return $this;
    }

    /**
     * Obfuscated user ID from Dialogflow.
     *
     * Generated from protobuf field <code>string obfuscated_external_user_id = 3;</code>
     * @return string
     */
    public function getObfuscatedExternalUserId()
    {
        return $this->obfuscated_external_user_id;
    }

    /**
     * Obfuscated user ID from Dialogflow.
     *
     * Generated from protobuf field <code>string obfuscated_external_user_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setObfuscatedExternalUserId($var)
    {
        GPBUtil::checkString($var, True);
        $this->obfuscated_external_user_id = $var;

        return $this;
    }

    /**
     * The role of the participant.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.ConversationParticipant.Role role = 2;</code>
     * @return int
     */
    public function getRole()
    {
        return $this->role;
    }

    /**
     * The role of the participant.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.ConversationParticipant.Role role = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setRole($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\ConversationParticipant\Role::class);
        $this->role = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getParticipant()
    {
        return $this->whichOneof("participant");
    }

}

