<?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.SyncdPatch</code>
 */
class SyncdPatch 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.SyncdMutation mutations = 2;</code>
     */
    private $mutations;
    /**
     * Generated from protobuf field <code>optional .proto.ExternalBlobReference externalMutations = 3;</code>
     */
    protected $externalMutations = null;
    /**
     * Generated from protobuf field <code>optional bytes snapshotMac = 4;</code>
     */
    protected $snapshotMac = null;
    /**
     * Generated from protobuf field <code>optional bytes patchMac = 5;</code>
     */
    protected $patchMac = null;
    /**
     * Generated from protobuf field <code>optional .proto.KeyId keyId = 6;</code>
     */
    protected $keyId = null;
    /**
     * Generated from protobuf field <code>optional .proto.ExitCode exitCode = 7;</code>
     */
    protected $exitCode = null;
    /**
     * Generated from protobuf field <code>optional uint32 deviceIndex = 8;</code>
     */
    protected $deviceIndex = null;
    /**
     * Generated from protobuf field <code>optional bytes clientDebugData = 9;</code>
     */
    protected $clientDebugData = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \PhpWA\Protocol\Proto\SyncdVersion $version
     *     @type \PhpWA\Protocol\Proto\SyncdMutation[] $mutations
     *     @type \PhpWA\Protocol\Proto\ExternalBlobReference $externalMutations
     *     @type string $snapshotMac
     *     @type string $patchMac
     *     @type \PhpWA\Protocol\Proto\KeyId $keyId
     *     @type \PhpWA\Protocol\Proto\ExitCode $exitCode
     *     @type int $deviceIndex
     *     @type string $clientDebugData
     * }
     */
    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.SyncdMutation mutations = 2;</code>
     * @return RepeatedField<\PhpWA\Protocol\Proto\SyncdMutation>
     */
    public function getMutations()
    {
        return $this->mutations;
    }

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

        return $this;
    }

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

    public function hasExternalMutations()
    {
        return isset($this->externalMutations);
    }

    public function clearExternalMutations()
    {
        unset($this->externalMutations);
    }

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

        return $this;
    }

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

    public function hasSnapshotMac()
    {
        return isset($this->snapshotMac);
    }

    public function clearSnapshotMac()
    {
        unset($this->snapshotMac);
    }

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

        return $this;
    }

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

    public function hasPatchMac()
    {
        return isset($this->patchMac);
    }

    public function clearPatchMac()
    {
        unset($this->patchMac);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.KeyId keyId = 6;</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 = 6;</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;
    }

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

    public function hasExitCode()
    {
        return isset($this->exitCode);
    }

    public function clearExitCode()
    {
        unset($this->exitCode);
    }

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

        return $this;
    }

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

    public function hasDeviceIndex()
    {
        return isset($this->deviceIndex);
    }

    public function clearDeviceIndex()
    {
        unset($this->deviceIndex);
    }

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

        return $this;
    }

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

    public function hasClientDebugData()
    {
        return isset($this->clientDebugData);
    }

    public function clearClientDebugData()
    {
        unset($this->clientDebugData);
    }

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

        return $this;
    }

}

