<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: dy.proto

namespace Douyin;

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

/**
 * Generated from protobuf message <code>douyin.TextPiece</code>
 */
class TextPiece extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>bool type = 1;</code>
     */
    protected $type = false;
    /**
     * Generated from protobuf field <code>.douyin.TextFormat format = 2;</code>
     */
    protected $format = null;
    /**
     * Generated from protobuf field <code>string stringValue = 3;</code>
     */
    protected $stringValue = '';
    /**
     * Generated from protobuf field <code>.douyin.TextPieceUser userValue = 4;</code>
     */
    protected $userValue = null;
    /**
     * Generated from protobuf field <code>.douyin.TextPieceGift giftValue = 5;</code>
     */
    protected $giftValue = null;
    /**
     * Generated from protobuf field <code>.douyin.TextPieceHeart heartValue = 6;</code>
     */
    protected $heartValue = null;
    /**
     * Generated from protobuf field <code>.douyin.TextPiecePatternRef patternRefValue = 7;</code>
     */
    protected $patternRefValue = null;
    /**
     * Generated from protobuf field <code>.douyin.TextPieceImage imageValue = 8;</code>
     */
    protected $imageValue = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $type
     *     @type \Douyin\TextFormat $format
     *     @type string $stringValue
     *     @type \Douyin\TextPieceUser $userValue
     *     @type \Douyin\TextPieceGift $giftValue
     *     @type \Douyin\TextPieceHeart $heartValue
     *     @type \Douyin\TextPiecePatternRef $patternRefValue
     *     @type \Douyin\TextPieceImage $imageValue
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Dy::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>bool type = 1;</code>
     * @return bool
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Generated from protobuf field <code>bool type = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkBool($var);
        $this->type = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.douyin.TextFormat format = 2;</code>
     * @return \Douyin\TextFormat|null
     */
    public function getFormat()
    {
        return $this->format;
    }

    public function hasFormat()
    {
        return isset($this->format);
    }

    public function clearFormat()
    {
        unset($this->format);
    }

    /**
     * Generated from protobuf field <code>.douyin.TextFormat format = 2;</code>
     * @param \Douyin\TextFormat $var
     * @return $this
     */
    public function setFormat($var)
    {
        GPBUtil::checkMessage($var, \Douyin\TextFormat::class);
        $this->format = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string stringValue = 3;</code>
     * @return string
     */
    public function getStringValue()
    {
        return $this->stringValue;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPieceUser userValue = 4;</code>
     * @return \Douyin\TextPieceUser|null
     */
    public function getUserValue()
    {
        return $this->userValue;
    }

    public function hasUserValue()
    {
        return isset($this->userValue);
    }

    public function clearUserValue()
    {
        unset($this->userValue);
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPieceUser userValue = 4;</code>
     * @param \Douyin\TextPieceUser $var
     * @return $this
     */
    public function setUserValue($var)
    {
        GPBUtil::checkMessage($var, \Douyin\TextPieceUser::class);
        $this->userValue = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPieceGift giftValue = 5;</code>
     * @return \Douyin\TextPieceGift|null
     */
    public function getGiftValue()
    {
        return $this->giftValue;
    }

    public function hasGiftValue()
    {
        return isset($this->giftValue);
    }

    public function clearGiftValue()
    {
        unset($this->giftValue);
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPieceGift giftValue = 5;</code>
     * @param \Douyin\TextPieceGift $var
     * @return $this
     */
    public function setGiftValue($var)
    {
        GPBUtil::checkMessage($var, \Douyin\TextPieceGift::class);
        $this->giftValue = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPieceHeart heartValue = 6;</code>
     * @return \Douyin\TextPieceHeart|null
     */
    public function getHeartValue()
    {
        return $this->heartValue;
    }

    public function hasHeartValue()
    {
        return isset($this->heartValue);
    }

    public function clearHeartValue()
    {
        unset($this->heartValue);
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPieceHeart heartValue = 6;</code>
     * @param \Douyin\TextPieceHeart $var
     * @return $this
     */
    public function setHeartValue($var)
    {
        GPBUtil::checkMessage($var, \Douyin\TextPieceHeart::class);
        $this->heartValue = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPiecePatternRef patternRefValue = 7;</code>
     * @return \Douyin\TextPiecePatternRef|null
     */
    public function getPatternRefValue()
    {
        return $this->patternRefValue;
    }

    public function hasPatternRefValue()
    {
        return isset($this->patternRefValue);
    }

    public function clearPatternRefValue()
    {
        unset($this->patternRefValue);
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPiecePatternRef patternRefValue = 7;</code>
     * @param \Douyin\TextPiecePatternRef $var
     * @return $this
     */
    public function setPatternRefValue($var)
    {
        GPBUtil::checkMessage($var, \Douyin\TextPiecePatternRef::class);
        $this->patternRefValue = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPieceImage imageValue = 8;</code>
     * @return \Douyin\TextPieceImage|null
     */
    public function getImageValue()
    {
        return $this->imageValue;
    }

    public function hasImageValue()
    {
        return isset($this->imageValue);
    }

    public function clearImageValue()
    {
        unset($this->imageValue);
    }

    /**
     * Generated from protobuf field <code>.douyin.TextPieceImage imageValue = 8;</code>
     * @param \Douyin\TextPieceImage $var
     * @return $this
     */
    public function setImageValue($var)
    {
        GPBUtil::checkMessage($var, \Douyin\TextPieceImage::class);
        $this->imageValue = $var;

        return $this;
    }

}

