class Google::Apis::PubsubV1::Message

A message data and its attributes. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.

Attributes

attributes[RW]

Optional attributes for this message. Corresponds to the JSON property `attributes` @return [Hash<String,String>]

data[RW]

The message payload. For JSON requests, the value of this field must be base64- encoded. Corresponds to the JSON property `data` @return [String]

message_id[RW]

ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a `PubsubMessage` via a `Pull` call or a push delivery. It must not be populated by the publisher in a `Publish` call. Corresponds to the JSON property `messageId` @return [String]

publish_time[RW]

The time at which the message was published, populated by the server when it receives the `Publish` call. It must not be populated by the publisher in a ` Publish` call. Corresponds to the JSON property `publishTime` @return [String]

Public Class Methods

new(**args) click to toggle source
# File generated/google/apis/pubsub_v1/classes.rb, line 252
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File generated/google/apis/pubsub_v1/classes.rb, line 257
def update!(**args)
  @data = args[:data] if args.key?(:data)
  @attributes = args[:attributes] if args.key?(:attributes)
  @message_id = args[:message_id] if args.key?(:message_id)
  @publish_time = args[:publish_time] if args.key?(:publish_time)
end