Google Cloud C++ Client  2.1.0
C++ Client Library for Google Cloud Platform
Public Member Functions | List of all members
google::cloud::Project Class Reference

This class identifies a Cloud Project. More...

#include <google/cloud/project.h>

Public Member Functions

 Project (std::string project_id)
 Constructs a Project object identified by the given project_id. More...
 
Copy and move
 Project (Project const &)=default
 Returns the Project ID. More...
 
Projectoperator= (Project const &)=default
 Returns the Project ID. More...
 
 Project (Project &&)=default
 Returns the Project ID. More...
 
Projectoperator= (Project &&)=default
 Returns the Project ID. More...
 
std::string const & project_id () const
 Returns the Project ID. More...
 
std::string FullName () const
 Returns the fully qualified project name as a string of the form: "projects/<project-id>". More...
 

Equality operators

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

Detailed Description

This class identifies a Cloud Project.

A Cloud project is identified by its project_id.

Note
This class makes no effort to validate the components of the project name. It is the application's responsibility to provide a valid project id. Passing invalid values will not be checked until the project name is used in an RPC.

For more info about the project_id format, see https://cloud.google.com/resource-manager/docs/creating-managing-projects

Definition at line 40 of file project.h.

Constructor & Destructor Documentation

◆ Project() [1/3]

google::cloud::Project::Project ( std::string  project_id)
explicit

Constructs a Project object identified by the given project_id.

◆ Project() [2/3]

google::cloud::Project::Project ( Project const &  )
default

Returns the Project ID.

◆ Project() [3/3]

google::cloud::Project::Project ( Project &&  )
default

Returns the Project ID.

Member Function Documentation

◆ FullName()

std::string google::cloud::Project::FullName ( ) const

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

◆ operator=() [1/2]

Project& google::cloud::Project::operator= ( Project &&  )
default

Returns the Project ID.

◆ operator=() [2/2]

Project& google::cloud::Project::operator= ( Project const &  )
default

Returns the Project ID.

◆ project_id()

std::string const& google::cloud::Project::project_id ( ) const
inline

Returns the Project ID.

Definition at line 54 of file project.h.

Friends And Related Function Documentation

◆ operator!=

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

Output the FullName() format.

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
Project const &   
)
friend

Output the FullName() format.

◆ operator==

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

Output the FullName() format.