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::Subscription Class Reference

Objects of this class identify a Cloud Pub/Sub subscription. More...

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

Public Member Functions

 Subscription (std::string project_id, std::string subscription_id)
 
Copy and move
 Subscription (Subscription const &)=default
 Returns the Project ID. More...
 
Subscriptionoperator= (Subscription const &)=default
 Returns the Project ID. More...
 
 Subscription (Subscription &&)=default
 Returns the Project ID. More...
 
Subscriptionoperator= (Subscription &&)=default
 Returns the Project ID. More...
 
std::string const & project_id () const
 Returns the Project ID. More...
 
std::string const & subscription_id () const
 Returns the Subscription ID. More...
 
std::string FullName () const
 Returns the fully qualified subscription name as a string of the form: "projects/<project-id>/subscriptions/<subscription-id>". More...
 

Equality operators

bool operator== (Subscription const &a, Subscription const &b)
 Output the FullName() format. More...
 
bool operator!= (Subscription const &a, Subscription const &b)
 Output the FullName() format. More...
 
std::ostream & operator<< (std::ostream &os, Subscription const &rhs)
 Output the FullName() format. More...
 

Detailed Description

Objects of this class identify a Cloud Pub/Sub subscription.

Note
This class makes no effort to validate the ids provided. The application should verify that any ids passed to this application conform to the Cloud Pub/Sub resource name restrictions.

Definition at line 37 of file subscription.h.

Constructor & Destructor Documentation

◆ Subscription() [1/3]

google::cloud::pubsub::v1::Subscription::Subscription ( std::string  project_id,
std::string  subscription_id 
)
inline

Definition at line 39 of file subscription.h.

◆ Subscription() [2/3]

google::cloud::pubsub::v1::Subscription::Subscription ( Subscription const &  )
default

Returns the Project ID.

◆ Subscription() [3/3]

google::cloud::pubsub::v1::Subscription::Subscription ( Subscription &&  )
default

Returns the Project ID.

Member Function Documentation

◆ FullName()

std::string google::cloud::pubsub::v1::Subscription::FullName ( ) const

Returns the fully qualified subscription name as a string of the form: "projects/<project-id>/subscriptions/<subscription-id>".

Definition at line 22 of file subscription.cc.

◆ operator=() [1/2]

Subscription& google::cloud::pubsub::v1::Subscription::operator= ( Subscription &&  )
default

Returns the Project ID.

◆ operator=() [2/2]

Subscription& google::cloud::pubsub::v1::Subscription::operator= ( Subscription const &  )
default

Returns the Project ID.

◆ project_id()

std::string const& google::cloud::pubsub::v1::Subscription::project_id ( ) const
inline

Returns the Project ID.

Definition at line 52 of file subscription.h.

◆ subscription_id()

std::string const& google::cloud::pubsub::v1::Subscription::subscription_id ( ) const
inline

Returns the Subscription ID.

Definition at line 55 of file subscription.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( Subscription const &  a,
Subscription const &  b 
)
friend

Output the FullName() format.

Definition at line 66 of file subscription.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
Subscription const &  rhs 
)
friend

Output the FullName() format.

Definition at line 31 of file subscription.cc.

◆ operator==

bool operator== ( Subscription const &  a,
Subscription const &  b 
)
friend

Output the FullName() format.

Definition at line 26 of file subscription.cc.