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

namespace PhpWA\Protocol\Proto;

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

/**
 * Generated from protobuf message <code>proto.MessageAddOn</code>
 */
class MessageAddOn extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.MessageAddOn.MessageAddOnType messageAddOnType = 1;</code>
     */
    protected $messageAddOnType = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message messageAddOn = 2;</code>
     */
    protected $messageAddOn = null;
    /**
     * Generated from protobuf field <code>optional int64 senderTimestampMs = 3;</code>
     */
    protected $senderTimestampMs = null;
    /**
     * Generated from protobuf field <code>optional int64 serverTimestampMs = 4;</code>
     */
    protected $serverTimestampMs = null;
    /**
     * Generated from protobuf field <code>optional .proto.WebMessageInfo.Status status = 5;</code>
     */
    protected $status = null;
    /**
     * Generated from protobuf field <code>optional .proto.MessageAddOnContextInfo addOnContextInfo = 6;</code>
     */
    protected $addOnContextInfo = null;
    /**
     * Generated from protobuf field <code>optional .proto.MessageKey messageAddOnKey = 7;</code>
     */
    protected $messageAddOnKey = null;
    /**
     * Generated from protobuf field <code>optional .proto.LegacyMessage legacyMessage = 8;</code>
     */
    protected $legacyMessage = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $messageAddOnType
     *     @type \PhpWA\Protocol\Proto\Message $messageAddOn
     *     @type int|string $senderTimestampMs
     *     @type int|string $serverTimestampMs
     *     @type int $status
     *     @type \PhpWA\Protocol\Proto\MessageAddOnContextInfo $addOnContextInfo
     *     @type \PhpWA\Protocol\Proto\MessageKey $messageAddOnKey
     *     @type \PhpWA\Protocol\Proto\LegacyMessage $legacyMessage
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageAddOn.MessageAddOnType messageAddOnType = 1;</code>
     * @return int
     */
    public function getMessageAddOnType()
    {
        return isset($this->messageAddOnType) ? $this->messageAddOnType : 0;
    }

    public function hasMessageAddOnType()
    {
        return isset($this->messageAddOnType);
    }

    public function clearMessageAddOnType()
    {
        unset($this->messageAddOnType);
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageAddOn.MessageAddOnType messageAddOnType = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setMessageAddOnType($var)
    {
        GPBUtil::checkEnum($var, \PhpWA\Protocol\Proto\MessageAddOn\MessageAddOnType::class);
        $this->messageAddOnType = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message messageAddOn = 2;</code>
     * @return \PhpWA\Protocol\Proto\Message|null
     */
    public function getMessageAddOn()
    {
        return $this->messageAddOn;
    }

    public function hasMessageAddOn()
    {
        return isset($this->messageAddOn);
    }

    public function clearMessageAddOn()
    {
        unset($this->messageAddOn);
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message messageAddOn = 2;</code>
     * @param \PhpWA\Protocol\Proto\Message $var
     * @return $this
     */
    public function setMessageAddOn($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\Message::class);
        $this->messageAddOn = $var;

        return $this;
    }

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

    public function hasSenderTimestampMs()
    {
        return isset($this->senderTimestampMs);
    }

    public function clearSenderTimestampMs()
    {
        unset($this->senderTimestampMs);
    }

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

        return $this;
    }

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

    public function hasServerTimestampMs()
    {
        return isset($this->serverTimestampMs);
    }

    public function clearServerTimestampMs()
    {
        unset($this->serverTimestampMs);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.WebMessageInfo.Status status = 5;</code>
     * @return int
     */
    public function getStatus()
    {
        return isset($this->status) ? $this->status : 0;
    }

    public function hasStatus()
    {
        return isset($this->status);
    }

    public function clearStatus()
    {
        unset($this->status);
    }

    /**
     * Generated from protobuf field <code>optional .proto.WebMessageInfo.Status status = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setStatus($var)
    {
        GPBUtil::checkEnum($var, \PhpWA\Protocol\Proto\WebMessageInfo\Status::class);
        $this->status = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageAddOnContextInfo addOnContextInfo = 6;</code>
     * @return \PhpWA\Protocol\Proto\MessageAddOnContextInfo|null
     */
    public function getAddOnContextInfo()
    {
        return $this->addOnContextInfo;
    }

    public function hasAddOnContextInfo()
    {
        return isset($this->addOnContextInfo);
    }

    public function clearAddOnContextInfo()
    {
        unset($this->addOnContextInfo);
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageAddOnContextInfo addOnContextInfo = 6;</code>
     * @param \PhpWA\Protocol\Proto\MessageAddOnContextInfo $var
     * @return $this
     */
    public function setAddOnContextInfo($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\MessageAddOnContextInfo::class);
        $this->addOnContextInfo = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageKey messageAddOnKey = 7;</code>
     * @return \PhpWA\Protocol\Proto\MessageKey|null
     */
    public function getMessageAddOnKey()
    {
        return $this->messageAddOnKey;
    }

    public function hasMessageAddOnKey()
    {
        return isset($this->messageAddOnKey);
    }

    public function clearMessageAddOnKey()
    {
        unset($this->messageAddOnKey);
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageKey messageAddOnKey = 7;</code>
     * @param \PhpWA\Protocol\Proto\MessageKey $var
     * @return $this
     */
    public function setMessageAddOnKey($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\MessageKey::class);
        $this->messageAddOnKey = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.LegacyMessage legacyMessage = 8;</code>
     * @return \PhpWA\Protocol\Proto\LegacyMessage|null
     */
    public function getLegacyMessage()
    {
        return $this->legacyMessage;
    }

    public function hasLegacyMessage()
    {
        return isset($this->legacyMessage);
    }

    public function clearLegacyMessage()
    {
        unset($this->legacyMessage);
    }

    /**
     * Generated from protobuf field <code>optional .proto.LegacyMessage legacyMessage = 8;</code>
     * @param \PhpWA\Protocol\Proto\LegacyMessage $var
     * @return $this
     */
    public function setLegacyMessage($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\LegacyMessage::class);
        $this->legacyMessage = $var;

        return $this;
    }

}

