<?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.SessionStructure</code>
 */
class SessionStructure extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional uint32 sessionVersion = 1;</code>
     */
    protected $sessionVersion = null;
    /**
     * Generated from protobuf field <code>optional bytes localIdentityPublic = 2;</code>
     */
    protected $localIdentityPublic = null;
    /**
     * Generated from protobuf field <code>optional bytes remoteIdentityPublic = 3;</code>
     */
    protected $remoteIdentityPublic = null;
    /**
     * Generated from protobuf field <code>optional bytes rootKey = 4;</code>
     */
    protected $rootKey = null;
    /**
     * Generated from protobuf field <code>optional uint32 previousCounter = 5;</code>
     */
    protected $previousCounter = null;
    /**
     * Generated from protobuf field <code>optional .proto.SessionStructure.Chain senderChain = 6;</code>
     */
    protected $senderChain = null;
    /**
     * Generated from protobuf field <code>repeated .proto.SessionStructure.Chain receiverChains = 7;</code>
     */
    private $receiverChains;
    /**
     * Generated from protobuf field <code>optional .proto.SessionStructure.PendingKeyExchange pendingKeyExchange = 8;</code>
     */
    protected $pendingKeyExchange = null;
    /**
     * Generated from protobuf field <code>optional .proto.SessionStructure.PendingPreKey pendingPreKey = 9;</code>
     */
    protected $pendingPreKey = null;
    /**
     * Generated from protobuf field <code>optional uint32 remoteRegistrationId = 10;</code>
     */
    protected $remoteRegistrationId = null;
    /**
     * Generated from protobuf field <code>optional uint32 localRegistrationId = 11;</code>
     */
    protected $localRegistrationId = null;
    /**
     * Generated from protobuf field <code>optional bool needsRefresh = 12;</code>
     */
    protected $needsRefresh = null;
    /**
     * Generated from protobuf field <code>optional bytes aliceBaseKey = 13;</code>
     */
    protected $aliceBaseKey = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $sessionVersion
     *     @type string $localIdentityPublic
     *     @type string $remoteIdentityPublic
     *     @type string $rootKey
     *     @type int $previousCounter
     *     @type \PhpWA\Protocol\Proto\SessionStructure\Chain $senderChain
     *     @type \PhpWA\Protocol\Proto\SessionStructure\Chain[] $receiverChains
     *     @type \PhpWA\Protocol\Proto\SessionStructure\PendingKeyExchange $pendingKeyExchange
     *     @type \PhpWA\Protocol\Proto\SessionStructure\PendingPreKey $pendingPreKey
     *     @type int $remoteRegistrationId
     *     @type int $localRegistrationId
     *     @type bool $needsRefresh
     *     @type string $aliceBaseKey
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional uint32 sessionVersion = 1;</code>
     * @return int
     */
    public function getSessionVersion()
    {
        return isset($this->sessionVersion) ? $this->sessionVersion : 0;
    }

    public function hasSessionVersion()
    {
        return isset($this->sessionVersion);
    }

    public function clearSessionVersion()
    {
        unset($this->sessionVersion);
    }

    /**
     * Generated from protobuf field <code>optional uint32 sessionVersion = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setSessionVersion($var)
    {
        GPBUtil::checkUint32($var);
        $this->sessionVersion = $var;

        return $this;
    }

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

    public function hasLocalIdentityPublic()
    {
        return isset($this->localIdentityPublic);
    }

    public function clearLocalIdentityPublic()
    {
        unset($this->localIdentityPublic);
    }

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

        return $this;
    }

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

    public function hasRemoteIdentityPublic()
    {
        return isset($this->remoteIdentityPublic);
    }

    public function clearRemoteIdentityPublic()
    {
        unset($this->remoteIdentityPublic);
    }

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

        return $this;
    }

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

    public function hasRootKey()
    {
        return isset($this->rootKey);
    }

    public function clearRootKey()
    {
        unset($this->rootKey);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional uint32 previousCounter = 5;</code>
     * @return int
     */
    public function getPreviousCounter()
    {
        return isset($this->previousCounter) ? $this->previousCounter : 0;
    }

    public function hasPreviousCounter()
    {
        return isset($this->previousCounter);
    }

    public function clearPreviousCounter()
    {
        unset($this->previousCounter);
    }

    /**
     * Generated from protobuf field <code>optional uint32 previousCounter = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setPreviousCounter($var)
    {
        GPBUtil::checkUint32($var);
        $this->previousCounter = $var;

        return $this;
    }

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

    public function hasSenderChain()
    {
        return isset($this->senderChain);
    }

    public function clearSenderChain()
    {
        unset($this->senderChain);
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

    public function hasPendingKeyExchange()
    {
        return isset($this->pendingKeyExchange);
    }

    public function clearPendingKeyExchange()
    {
        unset($this->pendingKeyExchange);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.SessionStructure.PendingPreKey pendingPreKey = 9;</code>
     * @return \PhpWA\Protocol\Proto\SessionStructure\PendingPreKey|null
     */
    public function getPendingPreKey()
    {
        return $this->pendingPreKey;
    }

    public function hasPendingPreKey()
    {
        return isset($this->pendingPreKey);
    }

    public function clearPendingPreKey()
    {
        unset($this->pendingPreKey);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional uint32 remoteRegistrationId = 10;</code>
     * @return int
     */
    public function getRemoteRegistrationId()
    {
        return isset($this->remoteRegistrationId) ? $this->remoteRegistrationId : 0;
    }

    public function hasRemoteRegistrationId()
    {
        return isset($this->remoteRegistrationId);
    }

    public function clearRemoteRegistrationId()
    {
        unset($this->remoteRegistrationId);
    }

    /**
     * Generated from protobuf field <code>optional uint32 remoteRegistrationId = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setRemoteRegistrationId($var)
    {
        GPBUtil::checkUint32($var);
        $this->remoteRegistrationId = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional uint32 localRegistrationId = 11;</code>
     * @return int
     */
    public function getLocalRegistrationId()
    {
        return isset($this->localRegistrationId) ? $this->localRegistrationId : 0;
    }

    public function hasLocalRegistrationId()
    {
        return isset($this->localRegistrationId);
    }

    public function clearLocalRegistrationId()
    {
        unset($this->localRegistrationId);
    }

    /**
     * Generated from protobuf field <code>optional uint32 localRegistrationId = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setLocalRegistrationId($var)
    {
        GPBUtil::checkUint32($var);
        $this->localRegistrationId = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bool needsRefresh = 12;</code>
     * @return bool
     */
    public function getNeedsRefresh()
    {
        return isset($this->needsRefresh) ? $this->needsRefresh : false;
    }

    public function hasNeedsRefresh()
    {
        return isset($this->needsRefresh);
    }

    public function clearNeedsRefresh()
    {
        unset($this->needsRefresh);
    }

    /**
     * Generated from protobuf field <code>optional bool needsRefresh = 12;</code>
     * @param bool $var
     * @return $this
     */
    public function setNeedsRefresh($var)
    {
        GPBUtil::checkBool($var);
        $this->needsRefresh = $var;

        return $this;
    }

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

    public function hasAliceBaseKey()
    {
        return isset($this->aliceBaseKey);
    }

    public function clearAliceBaseKey()
    {
        unset($this->aliceBaseKey);
    }

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

        return $this;
    }

}

