Google Cloud C++ Client  0.4.0
C++ Client Library for Google Cloud Platform
iam_binding.h
Go to the documentation of this file.
1 // Copyright 2018 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_BINDING_H_
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_BINDING_H_
17 
18 #include "google/cloud/version.h"
19 #include <set>
20 
21 namespace google {
22 namespace cloud {
23 inline namespace GOOGLE_CLOUD_CPP_NS {
24 /**
25  * Represents a Binding which associates a `member` with a particular `role`
26  * which can be used for Identity and Access management for Cloud Platform
27  * Resources.
28  *
29  * For more information about a Binding please refer to:
30  * https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Binding
31  */
32 class IamBinding {
33  public:
34  IamBinding(std::string role, std::set<std::string> members)
35  : role_(std::move(role)), members_(std::move(members)) {}
36 
37  std::string const& role() const { return role_; };
38  std::set<std::string> const& members() const { return members_; };
39 
40  private:
41  std::string role_;
42  std::set<std::string> members_;
43 };
44 
45 } // namespace GOOGLE_CLOUD_CPP_NS
46 } // namespace cloud
47 } // namespace google
48 
49 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_BINDING_H_
#define GOOGLE_CLOUD_CPP_NS
Definition: version.h:24
Contains all the Google Cloud C++ Library APIs.
Definition: iam_bindings.cc:21
std::set< std::string > const & members() const
Definition: iam_binding.h:38
IamBinding(std::string role, std::set< std::string > members)
Definition: iam_binding.h:34
std::string const & role() const
Definition: iam_binding.h:37
Represents a Binding which associates a member with a particular role which can be used for Identity ...
Definition: iam_binding.h:32