PubSub/src/V1/PublishRequest.php
public function setMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\PubsubMessage::class);
        $this->messages = $arr;

        return $this;
    }
public function setMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\PubsubMessage::class);
        $this->messages = $arr;

        return $this;
    }
public function setMessages ( $ var ) { $ arr = GPBUtil :: checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType :: MESSAGE , \ Google \ Cloud \ PubSub \ V1 \ PubsubMessage :: class ) ; $ this -> messages = $ arr ; return $ this ; }
The messages to publish.

Generated from protobuf field <code>repeated .google.pubsub.v1.PubsubMessage messages = 2;</code>
@param \Google\Cloud\PubSub\V1\PubsubMessage[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this
The messages to publish .