<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/generator.proto

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * Represents a message entry of a conversation.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.MessageEntry</code>
 */
class MessageEntry extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Participant role of the message.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $role = 0;
    /**
     * Optional. Transcript content of the message.
     *
     * Generated from protobuf field <code>string text = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $text = '';
    /**
     * Optional. The language of the text. See [Language
     * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
     * list of the currently supported language codes.
     *
     * Generated from protobuf field <code>string language_code = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $language_code = '';
    /**
     * Optional. Create time of the message entry.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $create_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $role
     *           Optional. Participant role of the message.
     *     @type string $text
     *           Optional. Transcript content of the message.
     *     @type string $language_code
     *           Optional. The language of the text. See [Language
     *           Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
     *           list of the currently supported language codes.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Optional. Create time of the message entry.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Participant role of the message.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getRole()
    {
        return $this->role;
    }

    /**
     * Optional. Participant role of the message.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setRole($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\MessageEntry\Role::class);
        $this->role = $var;

        return $this;
    }

    /**
     * Optional. Transcript content of the message.
     *
     * Generated from protobuf field <code>string text = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * Optional. Transcript content of the message.
     *
     * Generated from protobuf field <code>string text = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->text = $var;

        return $this;
    }

    /**
     * Optional. The language of the text. See [Language
     * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
     * list of the currently supported language codes.
     *
     * Generated from protobuf field <code>string language_code = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getLanguageCode()
    {
        return $this->language_code;
    }

    /**
     * Optional. The language of the text. See [Language
     * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
     * list of the currently supported language codes.
     *
     * Generated from protobuf field <code>string language_code = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setLanguageCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->language_code = $var;

        return $this;
    }

    /**
     * Optional. Create time of the message entry.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Optional. Create time of the message entry.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

}

