15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_ACCESS_CONTROL_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_ACCESS_CONTROL_H
18#include "google/cloud/storage/internal/patch_builder.h"
19#include "google/cloud/storage/project_team.h"
20#include "google/cloud/storage/version.h"
21#include "google/cloud/status_or.h"
27GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
30
31
32
33
34
35
36
37
38
45
46
47
48
49
50
51 static std::string
ROLE_OWNER() {
return "OWNER"; }
52 static std::string
ROLE_READER() {
return "READER"; }
57
58
59
60
61
62
70
71
72 std::string
const&
bucket()
const {
return bucket_; }
73 std::string
const&
domain()
const {
return domain_; }
74 std::string
const&
email()
const {
return email_; }
75 std::string
const&
entity()
const {
return entity_; }
76 std::string
const&
entity_id()
const {
return entity_id_; }
77 std::string
const&
etag()
const {
return etag_; }
78 std::string
const&
id()
const {
return id_; }
79 std::string
const&
kind()
const {
return kind_; }
85 std::string
const&
role()
const {
return role_; }
86 std::string
const&
self_link()
const {
return self_link_; }
91
92
93
94
96 entity_ = std::move(v);
100 role_ = std::move(v);
107
108
109
110
111
112
114 bucket_ = std::move(v);
118 domain_ = std::move(v);
122 email_ = std::move(v);
126 entity_id_ = std::move(v);
130 etag_ = std::move(v);
138 kind_ = std::move(v);
142 project_team_ = std::move(v);
146 self_link_ = std::move(v);
155 return !(lhs
== rhs);
163 std::string entity_id_;
169 std::string self_link_;
175
176
177
178
179
180
181
182
183
184
185
186
187
192 std::string
BuildPatch()
const {
return impl_.ToString(); }
195 impl_.SetStringField(
"entity", v);
200 impl_.RemoveField(
"entity");
205 impl_.SetStringField(
"role", v);
210 impl_.RemoveField(
"role");
215 friend struct internal::PatchBuilderDetails;
216 internal::PatchBuilder impl_;
219GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Prepares a patch for a BucketAccessControl resource.
Definition: bucket_access_control.h:188
BucketAccessControlPatchBuilder & set_role(std::string const &v)
Definition: bucket_access_control.h:204
BucketAccessControlPatchBuilder & set_entity(std::string const &v)
Definition: bucket_access_control.h:194
BucketAccessControlPatchBuilder()=default
BucketAccessControlPatchBuilder & delete_entity()
Definition: bucket_access_control.h:199
BucketAccessControlPatchBuilder & delete_role()
Definition: bucket_access_control.h:209
std::string BuildPatch() const
Definition: bucket_access_control.h:192
Wraps the bucketAccessControl resource in Google Cloud Storage.
Definition: bucket_access_control.h:39
ProjectTeam const & project_team() const
Definition: bucket_access_control.h:81
BucketAccessControl & set_etag(std::string v)
Definition: bucket_access_control.h:129
BucketAccessControl & set_self_link(std::string v)
Definition: bucket_access_control.h:145
static std::string ROLE_OWNER()
Definition: bucket_access_control.h:51
BucketAccessControl & set_project_team(ProjectTeam v)
Definition: bucket_access_control.h:141
static std::string TEAM_VIEWERS()
Definition: bucket_access_control.h:65
std::string const & bucket() const
Definition: bucket_access_control.h:72
BucketAccessControl()=default
BucketAccessControl & set_domain(std::string v)
Definition: bucket_access_control.h:117
friend bool operator!=(BucketAccessControl const &lhs, BucketAccessControl const &rhs)
Definition: bucket_access_control.h:153
BucketAccessControl & set_kind(std::string v)
Definition: bucket_access_control.h:137
std::string const & entity() const
Definition: bucket_access_control.h:75
absl::optional< ProjectTeam > const & project_team_as_optional() const
Definition: bucket_access_control.h:82
std::string const & domain() const
Definition: bucket_access_control.h:73
static std::string ROLE_READER()
Definition: bucket_access_control.h:52
std::string const & role() const
Definition: bucket_access_control.h:85
friend bool operator==(BucketAccessControl const &lhs, BucketAccessControl const &rhs)
BucketAccessControl & set_role(std::string v)
Definition: bucket_access_control.h:99
std::string const & entity_id() const
Definition: bucket_access_control.h:76
std::string const & kind() const
Definition: bucket_access_control.h:79
std::string const & self_link() const
Definition: bucket_access_control.h:86
BucketAccessControl & set_entity_id(std::string v)
Definition: bucket_access_control.h:125
BucketAccessControl & set_id(std::string v)
Definition: bucket_access_control.h:133
std::string const & email() const
Definition: bucket_access_control.h:74
static std::string TEAM_OWNERS()
Definition: bucket_access_control.h:64
BucketAccessControl & set_entity(std::string v)
Definition: bucket_access_control.h:95
bool has_project_team() const
Definition: bucket_access_control.h:80
static std::string TEAM_EDITORS()
Definition: bucket_access_control.h:63
std::string const & id() const
Definition: bucket_access_control.h:78
BucketAccessControl & set_email(std::string v)
Definition: bucket_access_control.h:121
std::string const & etag() const
Definition: bucket_access_control.h:77
BucketAccessControl & set_bucket(std::string v)
Definition: bucket_access_control.h:113
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
std::string TEAM_VIEWERS()
Definition: project_team.h:76
std::string TEAM_EDITORS()
Definition: project_team.h:74
std::string TEAM_OWNERS()
Definition: project_team.h:75
Represents the projectTeam field in *AccessControls.
Definition: project_team.h:35