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

namespace PhpWA\Protocol\Proto\SessionStructure;

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

/**
 * Generated from protobuf message <code>proto.SessionStructure.Chain</code>
 */
class Chain extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional bytes senderRatchetKey = 1;</code>
     */
    protected $senderRatchetKey = null;
    /**
     * Generated from protobuf field <code>optional bytes senderRatchetKeyPrivate = 2;</code>
     */
    protected $senderRatchetKeyPrivate = null;
    /**
     * Generated from protobuf field <code>optional .proto.SessionStructure.Chain.ChainKey chainKey = 3;</code>
     */
    protected $chainKey = null;
    /**
     * Generated from protobuf field <code>repeated .proto.SessionStructure.Chain.MessageKey messageKeys = 4;</code>
     */
    private $messageKeys;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $senderRatchetKey
     *     @type string $senderRatchetKeyPrivate
     *     @type \PhpWA\Protocol\Proto\SessionStructure\Chain\ChainKey $chainKey
     *     @type \PhpWA\Protocol\Proto\SessionStructure\Chain\MessageKey[] $messageKeys
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

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

    public function hasSenderRatchetKey()
    {
        return isset($this->senderRatchetKey);
    }

    public function clearSenderRatchetKey()
    {
        unset($this->senderRatchetKey);
    }

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

        return $this;
    }

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

    public function hasSenderRatchetKeyPrivate()
    {
        return isset($this->senderRatchetKeyPrivate);
    }

    public function clearSenderRatchetKeyPrivate()
    {
        unset($this->senderRatchetKeyPrivate);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.SessionStructure.Chain.ChainKey chainKey = 3;</code>
     * @return \PhpWA\Protocol\Proto\SessionStructure\Chain\ChainKey|null
     */
    public function getChainKey()
    {
        return $this->chainKey;
    }

    public function hasChainKey()
    {
        return isset($this->chainKey);
    }

    public function clearChainKey()
    {
        unset($this->chainKey);
    }

    /**
     * Generated from protobuf field <code>optional .proto.SessionStructure.Chain.ChainKey chainKey = 3;</code>
     * @param \PhpWA\Protocol\Proto\SessionStructure\Chain\ChainKey $var
     * @return $this
     */
    public function setChainKey($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\SessionStructure\Chain\ChainKey::class);
        $this->chainKey = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .proto.SessionStructure.Chain.MessageKey messageKeys = 4;</code>
     * @return RepeatedField<\PhpWA\Protocol\Proto\SessionStructure\Chain\MessageKey>
     */
    public function getMessageKeys()
    {
        return $this->messageKeys;
    }

    /**
     * Generated from protobuf field <code>repeated .proto.SessionStructure.Chain.MessageKey messageKeys = 4;</code>
     * @param \PhpWA\Protocol\Proto\SessionStructure\Chain\MessageKey[] $var
     * @return $this
     */
    public function setMessageKeys($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \PhpWA\Protocol\Proto\SessionStructure\Chain\MessageKey::class);
        $this->messageKeys = $arr;

        return $this;
    }

}

