Represents a container for providing users with a handful of operation to users which they can use to add and remove members to Binding which is used for defining IAM Policy for Cloud Platform Resources.
More...
#include <google/cloud/iam_bindings.h>
|
using | iterator = std::map< std::string, std::set< std::string > >::const_iterator |
|
|
| IamBindings ()=default |
|
| IamBindings (std::vector< IamBinding > bindings) |
|
| IamBindings (std::string const &role, std::set< std::string > const &members) |
|
iterator | begin () const |
| Returns an iterator referring to the first element in IamBindings container. More...
|
|
iterator | end () const |
| Returns an iterator referring to the past-the-end element in IamBindings container. More...
|
|
bool | empty () const |
| Returns whether the Bindings container is empty. More...
|
|
std::size_t | size () const |
| Return number of Bindings in container. More...
|
|
std::map< std::string, std::set< std::string > > const & | bindings () const |
|
iterator | find (std::string const &role) const |
| Finds the members for a role. More...
|
|
std::set< std::string > | at (std::string const &role) const |
| Returns the members for a role. More...
|
|
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...
|
|
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...
|
|
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...
|
|
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...
|
|
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...
|
|
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...
|
|
bool | operator== (IamBindings const &rhs) const |
|
bool | operator< (IamBindings const &rhs) const |
|
bool | operator!= (IamBindings const &rhs) const |
|
bool | operator> (IamBindings const &rhs) const |
|
bool | operator<= (IamBindings const &rhs) const |
|
bool | operator>= (IamBindings const &rhs) const |
|
Represents a container for providing users with a handful of operation to users which they can use to add and remove members to Binding which is used for defining IAM Policy for Cloud Platform Resources.
For more information about a Binding please refer to: https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Binding
Definition at line 35 of file iam_bindings.h.
◆ iterator
◆ IamBindings() [1/3]
google::cloud::v0::IamBindings::IamBindings |
( |
| ) |
|
|
default |
◆ IamBindings() [2/3]
google::cloud::v0::IamBindings::IamBindings |
( |
std::vector< IamBinding > |
bindings | ) |
|
|
inlineexplicit |
◆ IamBindings() [3/3]
google::cloud::v0::IamBindings::IamBindings |
( |
std::string const & |
role, |
|
|
std::set< std::string > const & |
members |
|
) |
| |
|
inline |
◆ AddMember()
void google::cloud::v0::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
-
role | role of the new member. |
member | specifies the identity requesting access for a cloud platform resource. |
Definition at line 23 of file iam_bindings.cc.
◆ AddMembers() [1/2]
void google::cloud::v0::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_binding | binding representing a set of members and role for them. |
Definition at line 27 of file iam_bindings.cc.
◆ AddMembers() [2/2]
void google::cloud::v0::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
-
role | role of the member set to be added. |
members | a set of member which are needed to be added. |
Definition at line 34 of file iam_bindings.cc.
◆ at()
std::set<std::string> google::cloud::v0::IamBindings::at |
( |
std::string const & |
role | ) |
const |
|
inline |
◆ begin()
iterator google::cloud::v0::IamBindings::begin |
( |
| ) |
const |
|
inline |
◆ bindings()
std::map<std::string, std::set<std::string> > const& google::cloud::v0::IamBindings::bindings |
( |
| ) |
const |
|
inline |
◆ empty()
bool google::cloud::v0::IamBindings::empty |
( |
| ) |
const |
|
inline |
Returns whether the Bindings container is empty.
- Returns
- bool whether the container is empty or not.
Definition at line 68 of file iam_bindings.h.
◆ end()
iterator google::cloud::v0::IamBindings::end |
( |
| ) |
const |
|
inline |
◆ find()
iterator google::cloud::v0::IamBindings::find |
( |
std::string const & |
role | ) |
const |
|
inline |
◆ operator!=()
bool google::cloud::v0::IamBindings::operator!= |
( |
IamBindings const & |
rhs | ) |
const |
|
inline |
◆ operator<()
bool google::cloud::v0::IamBindings::operator< |
( |
IamBindings const & |
rhs | ) |
const |
|
inline |
◆ operator<=()
bool google::cloud::v0::IamBindings::operator<= |
( |
IamBindings const & |
rhs | ) |
const |
|
inline |
◆ operator==()
bool google::cloud::v0::IamBindings::operator== |
( |
IamBindings const & |
rhs | ) |
const |
|
inline |
◆ operator>()
bool google::cloud::v0::IamBindings::operator> |
( |
IamBindings const & |
rhs | ) |
const |
|
inline |
◆ operator>=()
bool google::cloud::v0::IamBindings::operator>= |
( |
IamBindings const & |
rhs | ) |
const |
|
inline |
◆ RemoveMember()
void google::cloud::v0::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
-
role | role of the member to be removed. |
member | specifies the identity requesting access for a cloud platform resource. |
Definition at line 39 of file iam_bindings.cc.
◆ RemoveMembers() [1/2]
void google::cloud::v0::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_binding | binding representing a set of members and role for them. |
Definition at line 57 of file iam_bindings.cc.
◆ RemoveMembers() [2/2]
void google::cloud::v0::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
-
role | role of the member set to be removed. |
members | a set of members which are needed to be removed. |
Definition at line 61 of file iam_bindings.cc.
◆ size()
std::size_t google::cloud::v0::IamBindings::size |
( |
| ) |
const |
|
inline |
Return number of Bindings in container.
- Returns
- int the size of the container.
Definition at line 75 of file iam_bindings.h.