<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: WAProto.proto

namespace PhpWA\Protocol\Proto\Message;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Generated from protobuf message <code>proto.Message.PollResultSnapshotMessage</code>
 */
class PollResultSnapshotMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional string name = 1;</code>
     */
    protected $name = null;
    /**
     * Generated from protobuf field <code>repeated .proto.Message.PollResultSnapshotMessage.PollVote pollVotes = 2;</code>
     */
    private $pollVotes;
    /**
     * Generated from protobuf field <code>optional .proto.ContextInfo contextInfo = 3;</code>
     */
    protected $contextInfo = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message.PollType pollType = 4;</code>
     */
    protected $pollType = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *     @type \PhpWA\Protocol\Proto\Message\PollResultSnapshotMessage\PollVote[] $pollVotes
     *     @type \PhpWA\Protocol\Proto\ContextInfo $contextInfo
     *     @type int $pollType
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

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

    public function hasName()
    {
        return isset($this->name);
    }

    public function clearName()
    {
        unset($this->name);
    }

    /**
     * Generated from protobuf field <code>optional string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .proto.Message.PollResultSnapshotMessage.PollVote pollVotes = 2;</code>
     * @return RepeatedField<\PhpWA\Protocol\Proto\Message\PollResultSnapshotMessage\PollVote>
     */
    public function getPollVotes()
    {
        return $this->pollVotes;
    }

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

        return $this;
    }

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

    public function hasContextInfo()
    {
        return isset($this->contextInfo);
    }

    public function clearContextInfo()
    {
        unset($this->contextInfo);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message.PollType pollType = 4;</code>
     * @return int
     */
    public function getPollType()
    {
        return isset($this->pollType) ? $this->pollType : 0;
    }

    public function hasPollType()
    {
        return isset($this->pollType);
    }

    public function clearPollType()
    {
        unset($this->pollType);
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message.PollType pollType = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setPollType($var)
    {
        GPBUtil::checkEnum($var, \PhpWA\Protocol\Proto\Message\PollType::class);
        $this->pollType = $var;

        return $this;
    }

}

