Google Cloud Pub/Sub C++ Client  1.32.1
A C++ Client Library for Google Cloud Pub/Sub
Public Member Functions | List of all members
google::cloud::pubsub::v1::MessageBuilder Class Reference

Constructs Message objects. More...

#include <google/cloud/pubsub/message.h>

Public Member Functions

 MessageBuilder ()=default
 
Message Build () &&
 Creates a new message. More...
 
MessageBuilderSetData (std::string data) &
 Sets the message payload to data. More...
 
MessageBuilder && SetData (std::string data) &&
 Sets the message payload to data. More...
 
MessageBuilderSetOrderingKey (std::string key) &
 Sets the ordering key to key. More...
 
MessageBuilder && SetOrderingKey (std::string key) &&
 Sets the ordering key to key. More...
 
MessageBuilderInsertAttribute (std::string const &key, std::string const &value) &
 Inserts an attribute to the message, leaving the message unchanged if key is already present. More...
 
MessageBuilder && InsertAttribute (std::string const &key, std::string const &value) &&
 Inserts an attribute to the message, leaving the message unchanged if key is already present. More...
 
MessageBuilderSetAttribute (std::string const &key, std::string value) &
 Inserts or sets an attribute on the message. More...
 
MessageBuilder && SetAttribute (std::string const &key, std::string value) &&
 Inserts or sets an attribute on the message. More...
 
template<typename Iterator >
MessageBuilderSetAttributes (Iterator begin, Iterator end) &
 Sets the attributes in the message to the attributes from the range [begin, end) More...
 
template<typename Iterator >
MessageBuilder && SetAttributes (Iterator begin, Iterator end) &&
 Sets the attributes in the message to the attributes from the range [begin, end) More...
 
MessageBuilderSetAttributes (std::vector< std::pair< std::string, std::string >> v) &
 Sets the attributes in the message to v. More...
 
MessageBuilder && SetAttributes (std::vector< std::pair< std::string, std::string >> v) &&
 Sets the attributes in the message to v. More...
 
template<typename Pair >
MessageBuilderSetAttributes (std::vector< Pair > v) &
 Sets the attributes in the message to v. More...
 
template<typename Pair >
MessageBuilder && SetAttributes (std::vector< Pair > v) &&
 Sets the attributes in the message to v. More...
 

Detailed Description

Constructs Message objects.

Definition at line 144 of file message.h.

Constructor & Destructor Documentation

◆ MessageBuilder()

google::cloud::pubsub::v1::MessageBuilder::MessageBuilder ( )
default

Member Function Documentation

◆ Build()

Message google::cloud::pubsub::v1::MessageBuilder::Build ( ) &&
inline

Creates a new message.

Definition at line 149 of file message.h.

◆ InsertAttribute() [1/2]

MessageBuilder& google::cloud::pubsub::v1::MessageBuilder::InsertAttribute ( std::string const &  key,
std::string const &  value 
) &
inline

Inserts an attribute to the message, leaving the message unchanged if key is already present.

Definition at line 176 of file message.h.

◆ InsertAttribute() [2/2]

MessageBuilder&& google::cloud::pubsub::v1::MessageBuilder::InsertAttribute ( std::string const &  key,
std::string const &  value 
) &&
inline

Inserts an attribute to the message, leaving the message unchanged if key is already present.

Definition at line 186 of file message.h.

◆ SetAttribute() [1/2]

MessageBuilder& google::cloud::pubsub::v1::MessageBuilder::SetAttribute ( std::string const &  key,
std::string  value 
) &
inline

Inserts or sets an attribute on the message.

Definition at line 192 of file message.h.

◆ SetAttribute() [2/2]

MessageBuilder&& google::cloud::pubsub::v1::MessageBuilder::SetAttribute ( std::string const &  key,
std::string  value 
) &&
inline

Inserts or sets an attribute on the message.

Definition at line 198 of file message.h.

◆ SetAttributes() [1/6]

template<typename Iterator >
MessageBuilder& google::cloud::pubsub::v1::MessageBuilder::SetAttributes ( Iterator  begin,
Iterator  end 
) &
inline

Sets the attributes in the message to the attributes from the range [begin, end)

Definition at line 205 of file message.h.

◆ SetAttributes() [2/6]

template<typename Iterator >
MessageBuilder&& google::cloud::pubsub::v1::MessageBuilder::SetAttributes ( Iterator  begin,
Iterator  end 
) &&
inline

Sets the attributes in the message to the attributes from the range [begin, end)

Definition at line 220 of file message.h.

◆ SetAttributes() [3/6]

template<typename Pair >
MessageBuilder& google::cloud::pubsub::v1::MessageBuilder::SetAttributes ( std::vector< Pair >  v) &
inline

Sets the attributes in the message to v.

Definition at line 249 of file message.h.

◆ SetAttributes() [4/6]

template<typename Pair >
MessageBuilder&& google::cloud::pubsub::v1::MessageBuilder::SetAttributes ( std::vector< Pair >  v) &&
inline

Sets the attributes in the message to v.

Definition at line 255 of file message.h.

◆ SetAttributes() [5/6]

MessageBuilder& google::cloud::pubsub::v1::MessageBuilder::SetAttributes ( std::vector< std::pair< std::string, std::string >>  v) &
inline

Sets the attributes in the message to v.

Definition at line 226 of file message.h.

◆ SetAttributes() [6/6]

MessageBuilder&& google::cloud::pubsub::v1::MessageBuilder::SetAttributes ( std::vector< std::pair< std::string, std::string >>  v) &&
inline

Sets the attributes in the message to v.

Definition at line 240 of file message.h.

◆ SetData() [1/2]

MessageBuilder& google::cloud::pubsub::v1::MessageBuilder::SetData ( std::string  data) &
inline

Sets the message payload to data.

Definition at line 152 of file message.h.

◆ SetData() [2/2]

MessageBuilder&& google::cloud::pubsub::v1::MessageBuilder::SetData ( std::string  data) &&
inline

Sets the message payload to data.

Definition at line 158 of file message.h.

◆ SetOrderingKey() [1/2]

MessageBuilder& google::cloud::pubsub::v1::MessageBuilder::SetOrderingKey ( std::string  key) &
inline

Sets the ordering key to key.

Definition at line 164 of file message.h.

◆ SetOrderingKey() [2/2]

MessageBuilder&& google::cloud::pubsub::v1::MessageBuilder::SetOrderingKey ( std::string  key) &&
inline

Sets the ordering key to key.

Definition at line 170 of file message.h.