<?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.MessageAssociation</code>
 */
class MessageAssociation extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.MessageAssociation.AssociationType associationType = 1;</code>
     */
    protected $associationType = null;
    /**
     * Generated from protobuf field <code>optional .proto.MessageKey parentMessageKey = 2;</code>
     */
    protected $parentMessageKey = null;
    /**
     * Generated from protobuf field <code>optional int32 messageIndex = 3;</code>
     */
    protected $messageIndex = null;

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

    /**
     * Generated from protobuf field <code>optional .proto.MessageAssociation.AssociationType associationType = 1;</code>
     * @return int
     */
    public function getAssociationType()
    {
        return isset($this->associationType) ? $this->associationType : 0;
    }

    public function hasAssociationType()
    {
        return isset($this->associationType);
    }

    public function clearAssociationType()
    {
        unset($this->associationType);
    }

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

        return $this;
    }

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

    public function hasParentMessageKey()
    {
        return isset($this->parentMessageKey);
    }

    public function clearParentMessageKey()
    {
        unset($this->parentMessageKey);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional int32 messageIndex = 3;</code>
     * @return int
     */
    public function getMessageIndex()
    {
        return isset($this->messageIndex) ? $this->messageIndex : 0;
    }

    public function hasMessageIndex()
    {
        return isset($this->messageIndex);
    }

    public function clearMessageIndex()
    {
        unset($this->messageIndex);
    }

    /**
     * Generated from protobuf field <code>optional int32 messageIndex = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setMessageIndex($var)
    {
        GPBUtil::checkInt32($var);
        $this->messageIndex = $var;

        return $this;
    }

}

