Google Cloud C++ Client  1.32.1
C++ Client Library for Google Cloud Platform
Public Types | Public Member Functions | List of all members
google::cloud::v1::IamBindings Class Reference

Simplified view of multiple roles and their members for IAM. More...

#include <google/cloud/iam_bindings.h>

Public Types

using iterator = std::map< std::string, std::set< std::string > >::const_iterator
 

Public Member Functions

 IamBindings ()=default
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED IamBindings (std::vector< IamBinding > bindings)
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED IamBindings (std::string role, std::set< std::string > members)
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED iterator begin () const
 Returns an iterator referring to the first element in IamBindings container. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED iterator end () const
 Returns an iterator referring to the past-the-end element in IamBindings container. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED bool empty () const
 Returns whether the Bindings container is empty. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED std::size_t size () const
 Return number of Bindings in container. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED std::map< std::string, std::set< std::string > > const & bindings () const
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED iterator find (std::string const &role) const
 Finds the members for a role. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED std::set< std::string > at (std::string const &role) const
 Returns the members for a role. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED void AddMember (std::string const &role, std::string member)
 Adds a new member if a binding exists with given role otherwise inserts a new key-value pair of role and member to the container. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED void AddMembers (google::cloud::IamBinding const &iam_binding)
 Adds a new key-value pair of role and members to the container if there is none for the role of given binding else appends members of given binding to the associated role's key-value entry. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED void AddMembers (std::string const &role, std::set< std::string > const &members)
 Adds a new key-value pair of role and members to the container if there no existing for given role else appends the given members to the give role's member set. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED void RemoveMember (std::string const &role, std::string const &member)
 Removes the given member from the given role's member set if there exists one in container. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED void RemoveMembers (google::cloud::IamBinding const &iam_binding)
 Removes the given binding's member from the given binding's role's member set if there exists one in container. More...
 
GOOGLE_CLOUD_CPP_IAM_DEPRECATED void RemoveMembers (std::string const &role, std::set< std::string > const &members)
 Removes the given members from given role's member set if there exists one in container. More...
 

Detailed Description

Simplified view of multiple roles and their members for IAM.

Deprecated:
this class is deprecated. Any functions that use it have also been deprecated. The class was defined before IAM conditional bindings, and does not support them. Nor will it be able to support future IAM features. Please use the alternative functions.
See also
Identity and Access Management
Overview of IAM Conditions

Definition at line 44 of file iam_bindings.h.

Member Typedef Documentation

◆ iterator

using google::cloud::v1::IamBindings::iterator = std::map<std::string, std::set<std::string> >::const_iterator

Definition at line 61 of file iam_bindings.h.

Constructor & Destructor Documentation

◆ IamBindings() [1/3]

google::cloud::v1::IamBindings::IamBindings ( )
default

◆ IamBindings() [2/3]

GOOGLE_CLOUD_CPP_IAM_DEPRECATED google::cloud::v1::IamBindings::IamBindings ( std::vector< IamBinding bindings)
inlineexplicit

Definition at line 48 of file iam_bindings.h.

◆ IamBindings() [3/3]

GOOGLE_CLOUD_CPP_IAM_DEPRECATED google::cloud::v1::IamBindings::IamBindings ( std::string  role,
std::set< std::string >  members 
)
inline

Definition at line 56 of file iam_bindings.h.

Member Function Documentation

◆ AddMember()

void google::cloud::v1::IamBindings::AddMember ( std::string const &  role,
std::string  member 
)

Adds a new member if a binding exists with given role otherwise inserts a new key-value pair of role and member to the container.

Parameters
rolerole of the new member.
memberspecifies the identity requesting access for a cloud platform resource.

Definition at line 26 of file iam_bindings.cc.

◆ AddMembers() [1/2]

void google::cloud::v1::IamBindings::AddMembers ( google::cloud::IamBinding const &  iam_binding)

Adds a new key-value pair of role and members to the container if there is none for the role of given binding else appends members of given binding to the associated role's key-value entry.

Parameters
iam_bindingbinding representing a set of members and role for them.

Definition at line 30 of file iam_bindings.cc.

◆ AddMembers() [2/2]

void google::cloud::v1::IamBindings::AddMembers ( std::string const &  role,
std::set< std::string > const &  members 
)

Adds a new key-value pair of role and members to the container if there no existing for given role else appends the given members to the give role's member set.

Parameters
rolerole of the member set to be added.
membersa set of member which are needed to be added.

Definition at line 37 of file iam_bindings.cc.

◆ at()

GOOGLE_CLOUD_CPP_IAM_DEPRECATED std::set<std::string> google::cloud::v1::IamBindings::at ( std::string const &  role) const
inline

Returns the members for a role.

Definition at line 110 of file iam_bindings.h.

◆ begin()

GOOGLE_CLOUD_CPP_IAM_DEPRECATED iterator google::cloud::v1::IamBindings::begin ( ) const
inline

Returns an iterator referring to the first element in IamBindings container.

Definition at line 67 of file iam_bindings.h.

◆ bindings()

GOOGLE_CLOUD_CPP_IAM_DEPRECATED std::map<std::string, std::set<std::string> > const& google::cloud::v1::IamBindings::bindings ( ) const
inline

Definition at line 98 of file iam_bindings.h.

◆ empty()

GOOGLE_CLOUD_CPP_IAM_DEPRECATED bool google::cloud::v1::IamBindings::empty ( ) const
inline

Returns whether the Bindings container is empty.

Returns
bool whether the container is empty or not.

Definition at line 84 of file iam_bindings.h.

◆ end()

GOOGLE_CLOUD_CPP_IAM_DEPRECATED iterator google::cloud::v1::IamBindings::end ( ) const
inline

Returns an iterator referring to the past-the-end element in IamBindings container.

Definition at line 75 of file iam_bindings.h.

◆ find()

GOOGLE_CLOUD_CPP_IAM_DEPRECATED iterator google::cloud::v1::IamBindings::find ( std::string const &  role) const
inline

Finds the members for a role.

Definition at line 105 of file iam_bindings.h.

◆ RemoveMember()

void google::cloud::v1::IamBindings::RemoveMember ( std::string const &  role,
std::string const &  member 
)

Removes the given member from the given role's member set if there exists one in container.

Parameters
rolerole of the member to be removed.
memberspecifies the identity requesting access for a cloud platform resource.

Definition at line 42 of file iam_bindings.cc.

◆ RemoveMembers() [1/2]

void google::cloud::v1::IamBindings::RemoveMembers ( google::cloud::IamBinding const &  iam_binding)

Removes the given binding's member from the given binding's role's member set if there exists one in container.

Parameters
iam_bindingbinding representing a set of members and role for them.

Definition at line 60 of file iam_bindings.cc.

◆ RemoveMembers() [2/2]

void google::cloud::v1::IamBindings::RemoveMembers ( std::string const &  role,
std::set< std::string > const &  members 
)

Removes the given members from given role's member set if there exists one in container.

Parameters
rolerole of the member set to be removed.
membersa set of members which are needed to be removed.

Definition at line 64 of file iam_bindings.cc.

◆ size()

GOOGLE_CLOUD_CPP_IAM_DEPRECATED std::size_t google::cloud::v1::IamBindings::size ( ) const
inline

Return number of Bindings in container.

Returns
int the size of the container.

Definition at line 93 of file iam_bindings.h.