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

namespace Zaly\Proto\Platform;

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

/**
 *support batch send
 *
 * Generated from protobuf message <code>platform.PushBody</code>
 */
class PushBody extends \Google\Protobuf\Internal\Message
{
    /**
     * subTitle
     * if roomId != "" && roomName != "", show the subTitle
     *
     * Generated from protobuf field <code>string roomId = 1;</code>
     */
    private $roomId = '';
    /**
     * Generated from protobuf field <code>string roomName = 2;</code>
     */
    private $roomName = '';
    /**
     * Generated from protobuf field <code>.core.MessageRoomType roomType = 3;</code>
     */
    private $roomType = 0;
    /**
     * Sender Info
     * if fromUserId != "" && fromUserName != "", show the sender info
     *
     * Generated from protobuf field <code>string fromUserId = 4;</code>
     */
    private $fromUserId = '';
    /**
     * Generated from protobuf field <code>string fromUserName = 5;</code>
     */
    private $fromUserName = '';
    /**
     * Content
     * if pushContent != "", use pushContent
     * else make the content from msgType.
     *
     * Generated from protobuf field <code>.core.MessageType msgType = 6;</code>
     */
    private $msgType = 0;
    /**
     * Generated from protobuf field <code>string pushContent = 7;</code>
     */
    private $pushContent = '';
    /**
     * icon
     * avatar must be prefix with "http://" or "https://" 
     *
     * Generated from protobuf field <code>string iconHref = 8;</code>
     */
    private $iconHref = '';
    /**
     * GotoUrl
     * if gotoUrl == "", make the url from the infomation above.
     *
     * Generated from protobuf field <code>string gotoUrl = 9;</code>
     */
    private $gotoUrl = '';
    /**
     * pemId = sha1(pem)，因为平台这边有pem，同时不需要做sign的verify，所以传递Ids，以减少请求包大小
     *
     * Generated from protobuf field <code>repeated string toDevicePubkPemIds = 10;</code>
     */
    private $toDevicePubkPemIds;

    public function __construct() {
        \GPBMetadata\Platform\Common::initOnce();
        parent::__construct();
    }

    /**
     * subTitle
     * if roomId != "" && roomName != "", show the subTitle
     *
     * Generated from protobuf field <code>string roomId = 1;</code>
     * @return string
     */
    public function getRoomId()
    {
        return $this->roomId;
    }

    /**
     * subTitle
     * if roomId != "" && roomName != "", show the subTitle
     *
     * Generated from protobuf field <code>string roomId = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setRoomId($var)
    {
        GPBUtil::checkString($var, True);
        $this->roomId = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string roomName = 2;</code>
     * @return string
     */
    public function getRoomName()
    {
        return $this->roomName;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.core.MessageRoomType roomType = 3;</code>
     * @return int
     */
    public function getRoomType()
    {
        return $this->roomType;
    }

    /**
     * Generated from protobuf field <code>.core.MessageRoomType roomType = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setRoomType($var)
    {
        GPBUtil::checkEnum($var, \Zaly\Proto\Core\MessageRoomType::class);
        $this->roomType = $var;

        return $this;
    }

    /**
     * Sender Info
     * if fromUserId != "" && fromUserName != "", show the sender info
     *
     * Generated from protobuf field <code>string fromUserId = 4;</code>
     * @return string
     */
    public function getFromUserId()
    {
        return $this->fromUserId;
    }

    /**
     * Sender Info
     * if fromUserId != "" && fromUserName != "", show the sender info
     *
     * Generated from protobuf field <code>string fromUserId = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setFromUserId($var)
    {
        GPBUtil::checkString($var, True);
        $this->fromUserId = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string fromUserName = 5;</code>
     * @return string
     */
    public function getFromUserName()
    {
        return $this->fromUserName;
    }

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

        return $this;
    }

    /**
     * Content
     * if pushContent != "", use pushContent
     * else make the content from msgType.
     *
     * Generated from protobuf field <code>.core.MessageType msgType = 6;</code>
     * @return int
     */
    public function getMsgType()
    {
        return $this->msgType;
    }

    /**
     * Content
     * if pushContent != "", use pushContent
     * else make the content from msgType.
     *
     * Generated from protobuf field <code>.core.MessageType msgType = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setMsgType($var)
    {
        GPBUtil::checkEnum($var, \Zaly\Proto\Core\MessageType::class);
        $this->msgType = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string pushContent = 7;</code>
     * @return string
     */
    public function getPushContent()
    {
        return $this->pushContent;
    }

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

        return $this;
    }

    /**
     * icon
     * avatar must be prefix with "http://" or "https://" 
     *
     * Generated from protobuf field <code>string iconHref = 8;</code>
     * @return string
     */
    public function getIconHref()
    {
        return $this->iconHref;
    }

    /**
     * icon
     * avatar must be prefix with "http://" or "https://" 
     *
     * Generated from protobuf field <code>string iconHref = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setIconHref($var)
    {
        GPBUtil::checkString($var, True);
        $this->iconHref = $var;

        return $this;
    }

    /**
     * GotoUrl
     * if gotoUrl == "", make the url from the infomation above.
     *
     * Generated from protobuf field <code>string gotoUrl = 9;</code>
     * @return string
     */
    public function getGotoUrl()
    {
        return $this->gotoUrl;
    }

    /**
     * GotoUrl
     * if gotoUrl == "", make the url from the infomation above.
     *
     * Generated from protobuf field <code>string gotoUrl = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setGotoUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->gotoUrl = $var;

        return $this;
    }

    /**
     * pemId = sha1(pem)，因为平台这边有pem，同时不需要做sign的verify，所以传递Ids，以减少请求包大小
     *
     * Generated from protobuf field <code>repeated string toDevicePubkPemIds = 10;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getToDevicePubkPemIds()
    {
        return $this->toDevicePubkPemIds;
    }

    /**
     * pemId = sha1(pem)，因为平台这边有pem，同时不需要做sign的verify，所以传递Ids，以减少请求包大小
     *
     * Generated from protobuf field <code>repeated string toDevicePubkPemIds = 10;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setToDevicePubkPemIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->toDevicePubkPemIds = $arr;

        return $this;
    }

}

