<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: WAProto.proto

namespace PhpWA\Protocol\Proto\ChatRowOpaqueData;

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

/**
 * Generated from protobuf message <code>proto.ChatRowOpaqueData.DraftMessage</code>
 */
class DraftMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional string text = 1;</code>
     */
    protected $text = null;
    /**
     * Generated from protobuf field <code>optional string omittedUrl = 2;</code>
     */
    protected $omittedUrl = null;
    /**
     * Generated from protobuf field <code>optional .proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData ctwaContextLinkData = 3;</code>
     */
    protected $ctwaContextLinkData = null;
    /**
     * Generated from protobuf field <code>optional .proto.ChatRowOpaqueData.DraftMessage.CtwaContextData ctwaContext = 4;</code>
     */
    protected $ctwaContext = null;
    /**
     * Generated from protobuf field <code>optional int64 timestamp = 5;</code>
     */
    protected $timestamp = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *     @type string $omittedUrl
     *     @type \PhpWA\Protocol\Proto\ChatRowOpaqueData\DraftMessage\CtwaContextLinkData $ctwaContextLinkData
     *     @type \PhpWA\Protocol\Proto\ChatRowOpaqueData\DraftMessage\CtwaContextData $ctwaContext
     *     @type int|string $timestamp
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional string text = 1;</code>
     * @return string
     */
    public function getText()
    {
        return isset($this->text) ? $this->text : '';
    }

    public function hasText()
    {
        return isset($this->text);
    }

    public function clearText()
    {
        unset($this->text);
    }

    /**
     * Generated from protobuf field <code>optional string text = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->text = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string omittedUrl = 2;</code>
     * @return string
     */
    public function getOmittedUrl()
    {
        return isset($this->omittedUrl) ? $this->omittedUrl : '';
    }

    public function hasOmittedUrl()
    {
        return isset($this->omittedUrl);
    }

    public function clearOmittedUrl()
    {
        unset($this->omittedUrl);
    }

    /**
     * Generated from protobuf field <code>optional string omittedUrl = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setOmittedUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->omittedUrl = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData ctwaContextLinkData = 3;</code>
     * @return \PhpWA\Protocol\Proto\ChatRowOpaqueData\DraftMessage\CtwaContextLinkData|null
     */
    public function getCtwaContextLinkData()
    {
        return $this->ctwaContextLinkData;
    }

    public function hasCtwaContextLinkData()
    {
        return isset($this->ctwaContextLinkData);
    }

    public function clearCtwaContextLinkData()
    {
        unset($this->ctwaContextLinkData);
    }

    /**
     * Generated from protobuf field <code>optional .proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData ctwaContextLinkData = 3;</code>
     * @param \PhpWA\Protocol\Proto\ChatRowOpaqueData\DraftMessage\CtwaContextLinkData $var
     * @return $this
     */
    public function setCtwaContextLinkData($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\ChatRowOpaqueData\DraftMessage\CtwaContextLinkData::class);
        $this->ctwaContextLinkData = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.ChatRowOpaqueData.DraftMessage.CtwaContextData ctwaContext = 4;</code>
     * @return \PhpWA\Protocol\Proto\ChatRowOpaqueData\DraftMessage\CtwaContextData|null
     */
    public function getCtwaContext()
    {
        return $this->ctwaContext;
    }

    public function hasCtwaContext()
    {
        return isset($this->ctwaContext);
    }

    public function clearCtwaContext()
    {
        unset($this->ctwaContext);
    }

    /**
     * Generated from protobuf field <code>optional .proto.ChatRowOpaqueData.DraftMessage.CtwaContextData ctwaContext = 4;</code>
     * @param \PhpWA\Protocol\Proto\ChatRowOpaqueData\DraftMessage\CtwaContextData $var
     * @return $this
     */
    public function setCtwaContext($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\ChatRowOpaqueData\DraftMessage\CtwaContextData::class);
        $this->ctwaContext = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional int64 timestamp = 5;</code>
     * @return int|string
     */
    public function getTimestamp()
    {
        return isset($this->timestamp) ? $this->timestamp : 0;
    }

    public function hasTimestamp()
    {
        return isset($this->timestamp);
    }

    public function clearTimestamp()
    {
        unset($this->timestamp);
    }

    /**
     * Generated from protobuf field <code>optional int64 timestamp = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setTimestamp($var)
    {
        GPBUtil::checkInt64($var);
        $this->timestamp = $var;

        return $this;
    }

}

