<?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.SyncdMutation</code>
 */
class SyncdMutation extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.SyncdMutation.SyncdOperation operation = 1;</code>
     */
    protected $operation = null;
    /**
     * Generated from protobuf field <code>optional .proto.SyncdRecord record = 2;</code>
     */
    protected $record = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $operation
     *     @type \PhpWA\Protocol\Proto\SyncdRecord $record
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional .proto.SyncdMutation.SyncdOperation operation = 1;</code>
     * @return int
     */
    public function getOperation()
    {
        return isset($this->operation) ? $this->operation : 0;
    }

    public function hasOperation()
    {
        return isset($this->operation);
    }

    public function clearOperation()
    {
        unset($this->operation);
    }

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

        return $this;
    }

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

    public function hasRecord()
    {
        return isset($this->record);
    }

    public function clearRecord()
    {
        unset($this->record);
    }

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

        return $this;
    }

}

