<?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.SyncdSnapshot</code>
 */
class SyncdSnapshot extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.SyncdVersion version = 1;</code>
     */
    protected $version = null;
    /**
     * Generated from protobuf field <code>repeated .proto.SyncdRecord records = 2;</code>
     */
    private $records;
    /**
     * Generated from protobuf field <code>optional bytes mac = 3;</code>
     */
    protected $mac = null;
    /**
     * Generated from protobuf field <code>optional .proto.KeyId keyId = 4;</code>
     */
    protected $keyId = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \PhpWA\Protocol\Proto\SyncdVersion $version
     *     @type \PhpWA\Protocol\Proto\SyncdRecord[] $records
     *     @type string $mac
     *     @type \PhpWA\Protocol\Proto\KeyId $keyId
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional .proto.SyncdVersion version = 1;</code>
     * @return \PhpWA\Protocol\Proto\SyncdVersion|null
     */
    public function getVersion()
    {
        return $this->version;
    }

    public function hasVersion()
    {
        return isset($this->version);
    }

    public function clearVersion()
    {
        unset($this->version);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .proto.SyncdRecord records = 2;</code>
     * @return RepeatedField<\PhpWA\Protocol\Proto\SyncdRecord>
     */
    public function getRecords()
    {
        return $this->records;
    }

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

        return $this;
    }

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

    public function hasMac()
    {
        return isset($this->mac);
    }

    public function clearMac()
    {
        unset($this->mac);
    }

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

        return $this;
    }

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

    public function hasKeyId()
    {
        return isset($this->keyId);
    }

    public function clearKeyId()
    {
        unset($this->keyId);
    }

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

        return $this;
    }

}

