<?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.TemplateMessage</code>
 */
class TemplateMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.ContextInfo contextInfo = 3;</code>
     */
    protected $contextInfo = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message.TemplateMessage.HydratedFourRowTemplate hydratedTemplate = 4;</code>
     */
    protected $hydratedTemplate = null;
    /**
     * Generated from protobuf field <code>optional string templateId = 9;</code>
     */
    protected $templateId = null;
    protected $format;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \PhpWA\Protocol\Proto\ContextInfo $contextInfo
     *     @type \PhpWA\Protocol\Proto\Message\TemplateMessage\HydratedFourRowTemplate $hydratedTemplate
     *     @type string $templateId
     *     @type \PhpWA\Protocol\Proto\Message\TemplateMessage\FourRowTemplate $fourRowTemplate
     *     @type \PhpWA\Protocol\Proto\Message\TemplateMessage\HydratedFourRowTemplate $hydratedFourRowTemplate
     *     @type \PhpWA\Protocol\Proto\Message\InteractiveMessage $interactiveMessageTemplate
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * 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.TemplateMessage.HydratedFourRowTemplate hydratedTemplate = 4;</code>
     * @return \PhpWA\Protocol\Proto\Message\TemplateMessage\HydratedFourRowTemplate|null
     */
    public function getHydratedTemplate()
    {
        return $this->hydratedTemplate;
    }

    public function hasHydratedTemplate()
    {
        return isset($this->hydratedTemplate);
    }

    public function clearHydratedTemplate()
    {
        unset($this->hydratedTemplate);
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message.TemplateMessage.HydratedFourRowTemplate hydratedTemplate = 4;</code>
     * @param \PhpWA\Protocol\Proto\Message\TemplateMessage\HydratedFourRowTemplate $var
     * @return $this
     */
    public function setHydratedTemplate($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\Message\TemplateMessage\HydratedFourRowTemplate::class);
        $this->hydratedTemplate = $var;

        return $this;
    }

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

    public function hasTemplateId()
    {
        return isset($this->templateId);
    }

    public function clearTemplateId()
    {
        unset($this->templateId);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.Message.TemplateMessage.FourRowTemplate fourRowTemplate = 1;</code>
     * @return \PhpWA\Protocol\Proto\Message\TemplateMessage\FourRowTemplate|null
     */
    public function getFourRowTemplate()
    {
        return $this->readOneof(1);
    }

    public function hasFourRowTemplate()
    {
        return $this->hasOneof(1);
    }

    /**
     * Generated from protobuf field <code>.proto.Message.TemplateMessage.FourRowTemplate fourRowTemplate = 1;</code>
     * @param \PhpWA\Protocol\Proto\Message\TemplateMessage\FourRowTemplate $var
     * @return $this
     */
    public function setFourRowTemplate($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\Message\TemplateMessage\FourRowTemplate::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.Message.TemplateMessage.HydratedFourRowTemplate hydratedFourRowTemplate = 2;</code>
     * @return \PhpWA\Protocol\Proto\Message\TemplateMessage\HydratedFourRowTemplate|null
     */
    public function getHydratedFourRowTemplate()
    {
        return $this->readOneof(2);
    }

    public function hasHydratedFourRowTemplate()
    {
        return $this->hasOneof(2);
    }

    /**
     * Generated from protobuf field <code>.proto.Message.TemplateMessage.HydratedFourRowTemplate hydratedFourRowTemplate = 2;</code>
     * @param \PhpWA\Protocol\Proto\Message\TemplateMessage\HydratedFourRowTemplate $var
     * @return $this
     */
    public function setHydratedFourRowTemplate($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\Message\TemplateMessage\HydratedFourRowTemplate::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.Message.InteractiveMessage interactiveMessageTemplate = 5;</code>
     * @return \PhpWA\Protocol\Proto\Message\InteractiveMessage|null
     */
    public function getInteractiveMessageTemplate()
    {
        return $this->readOneof(5);
    }

    public function hasInteractiveMessageTemplate()
    {
        return $this->hasOneof(5);
    }

    /**
     * Generated from protobuf field <code>.proto.Message.InteractiveMessage interactiveMessageTemplate = 5;</code>
     * @param \PhpWA\Protocol\Proto\Message\InteractiveMessage $var
     * @return $this
     */
    public function setInteractiveMessageTemplate($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\Message\InteractiveMessage::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getFormat()
    {
        return $this->whichOneof("format");
    }

}

