Cloud PubSub V1 Client - Class PublishRequest (1.46.5)

Reference documentation and code samples for the Cloud PubSub V1 Client class PublishRequest.

Request for the Publish method.

Generated from protobuf message google.pubsub.v1.PublishRequest

Namespace

Google \ Cloud \ PubSub \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ topic string

Required. The messages in the request will be published on this topic. Format is projects/{project}/topics/{topic}.

↳ messages array<Google\Cloud\PubSub\V1\PubsubMessage>

Required. The messages to publish.

getTopic

Required. The messages in the request will be published on this topic.

Format is projects/{project}/topics/{topic}.

Returns
TypeDescription
string

setTopic

Required. The messages in the request will be published on this topic.

Format is projects/{project}/topics/{topic}.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getMessages

Required. The messages to publish.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setMessages

Required. The messages to publish.

Parameter
NameDescription
var array<Google\Cloud\PubSub\V1\PubsubMessage>
Returns
TypeDescription
$this

static::build

Parameters
NameDescription
topic string

Required. The messages in the request will be published on this topic. Format is projects/{project}/topics/{topic}. Please see Google\Cloud\PubSub\V1\PublisherClient::topicName() for help formatting this field.

messages array<Google\Cloud\PubSub\V1\PubsubMessage>

Required. The messages to publish.

Returns
TypeDescription
Google\Cloud\PubSub\V1\PublishRequest