<?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.PollCreationMessage</code>
 */
class PollCreationMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional bytes encKey = 1;</code>
     */
    protected $encKey = null;
    /**
     * Generated from protobuf field <code>optional string name = 2;</code>
     */
    protected $name = null;
    /**
     * Generated from protobuf field <code>repeated .proto.Message.PollCreationMessage.Option options = 3;</code>
     */
    private $options;
    /**
     * Generated from protobuf field <code>optional uint32 selectableOptionsCount = 4;</code>
     */
    protected $selectableOptionsCount = null;
    /**
     * Generated from protobuf field <code>optional .proto.ContextInfo contextInfo = 5;</code>
     */
    protected $contextInfo = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message.PollContentType pollContentType = 6;</code>
     */
    protected $pollContentType = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message.PollType pollType = 7;</code>
     */
    protected $pollType = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message.PollCreationMessage.Option correctAnswer = 8;</code>
     */
    protected $correctAnswer = null;

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

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

    public function hasEncKey()
    {
        return isset($this->encKey);
    }

    public function clearEncKey()
    {
        unset($this->encKey);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string name = 2;</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 = 2;</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.PollCreationMessage.Option options = 3;</code>
     * @return RepeatedField<\PhpWA\Protocol\Proto\Message\PollCreationMessage\Option>
     */
    public function getOptions()
    {
        return $this->options;
    }

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

        return $this;
    }

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

    public function hasSelectableOptionsCount()
    {
        return isset($this->selectableOptionsCount);
    }

    public function clearSelectableOptionsCount()
    {
        unset($this->selectableOptionsCount);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.ContextInfo contextInfo = 5;</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 = 5;</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.PollContentType pollContentType = 6;</code>
     * @return int
     */
    public function getPollContentType()
    {
        return isset($this->pollContentType) ? $this->pollContentType : 0;
    }

    public function hasPollContentType()
    {
        return isset($this->pollContentType);
    }

    public function clearPollContentType()
    {
        unset($this->pollContentType);
    }

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

        return $this;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message.PollCreationMessage.Option correctAnswer = 8;</code>
     * @return \PhpWA\Protocol\Proto\Message\PollCreationMessage\Option|null
     */
    public function getCorrectAnswer()
    {
        return $this->correctAnswer;
    }

    public function hasCorrectAnswer()
    {
        return isset($this->correctAnswer);
    }

    public function clearCorrectAnswer()
    {
        unset($this->correctAnswer);
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message.PollCreationMessage.Option correctAnswer = 8;</code>
     * @param \PhpWA\Protocol\Proto\Message\PollCreationMessage\Option $var
     * @return $this
     */
    public function setCorrectAnswer($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\Message\PollCreationMessage\Option::class);
        $this->correctAnswer = $var;

        return $this;
    }

}

