15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_ACCESS_CONTROL_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_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&
object()
const {
return object_; }
75 std::string
const&
domain()
const {
return domain_; }
76 std::string
const&
email()
const {
return email_; }
77 std::string
const&
entity()
const {
return entity_; }
78 std::string
const&
entity_id()
const {
return entity_id_; }
79 std::string
const&
etag()
const {
return etag_; }
80 std::string
const&
id()
const {
return id_; }
81 std::string
const&
kind()
const {
return kind_; }
87 std::string
const&
role()
const {
return role_; }
88 std::string
const&
self_link()
const {
return self_link_; }
93
94
95
96
98 entity_ = std::move(v);
102 role_ = std::move(v);
109
110
111
112
113
114
116 bucket_ = std::move(v);
120 object_ = std::move(v);
128 domain_ = std::move(v);
132 email_ = std::move(v);
136 entity_id_ = std::move(v);
140 etag_ = std::move(v);
148 kind_ = std::move(v);
152 project_team_ = std::move(v);
156 self_link_ = std::move(v);
165 return !(lhs
== rhs);
171 std::int64_t generation_ = 0;
175 std::string entity_id_;
181 std::string self_link_;
187
188
189
190
191
192
193
194
195
196
197
198
199
204 std::string
BuildPatch()
const {
return impl_.ToString(); }
207 impl_.SetStringField(
"entity", v);
212 impl_.RemoveField(
"entity");
217 impl_.SetStringField(
"role", v);
222 impl_.RemoveField(
"role");
227 friend struct internal::PatchBuilderDetails;
228 internal::PatchBuilder impl_;
231GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Prepares a patch for an ObjectAccessControl resource.
Definition: object_access_control.h:200
ObjectAccessControlPatchBuilder & delete_entity()
Definition: object_access_control.h:211
ObjectAccessControlPatchBuilder & delete_role()
Definition: object_access_control.h:221
ObjectAccessControlPatchBuilder()=default
std::string BuildPatch() const
Definition: object_access_control.h:204
ObjectAccessControlPatchBuilder & set_entity(std::string const &v)
Definition: object_access_control.h:206
ObjectAccessControlPatchBuilder & set_role(std::string const &v)
Definition: object_access_control.h:216
Wraps the objectAccessControl resource in Google Cloud Storage.
Definition: object_access_control.h:39
ObjectAccessControl & set_object(std::string v)
Definition: object_access_control.h:119
std::string const & domain() const
Definition: object_access_control.h:75
std::string const & entity_id() const
Definition: object_access_control.h:78
static std::string TEAM_OWNERS()
Definition: object_access_control.h:64
std::int64_t generation() const
Definition: object_access_control.h:74
std::string const & entity() const
Definition: object_access_control.h:77
ObjectAccessControl & set_domain(std::string v)
Definition: object_access_control.h:127
std::string const & id() const
Definition: object_access_control.h:80
ObjectAccessControl & set_project_team(ProjectTeam v)
Definition: object_access_control.h:151
ObjectAccessControl & set_kind(std::string v)
Definition: object_access_control.h:147
std::string const & etag() const
Definition: object_access_control.h:79
std::string const & bucket() const
Definition: object_access_control.h:72
ObjectAccessControl & set_generation(std::int64_t v)
Definition: object_access_control.h:123
std::string const & role() const
Definition: object_access_control.h:87
ObjectAccessControl & set_entity(std::string v)
Definition: object_access_control.h:97
friend bool operator!=(ObjectAccessControl const &lhs, ObjectAccessControl const &rhs)
Definition: object_access_control.h:163
static std::string ROLE_OWNER()
Definition: object_access_control.h:51
std::string const & email() const
Definition: object_access_control.h:76
ProjectTeam const & project_team() const
Definition: object_access_control.h:83
static std::string ROLE_READER()
Definition: object_access_control.h:52
ObjectAccessControl & set_role(std::string v)
Definition: object_access_control.h:101
ObjectAccessControl()=default
ObjectAccessControl & set_etag(std::string v)
Definition: object_access_control.h:139
std::string const & kind() const
Definition: object_access_control.h:81
std::string const & object() const
Definition: object_access_control.h:73
bool has_project_team() const
Definition: object_access_control.h:82
ObjectAccessControl & set_id(std::string v)
Definition: object_access_control.h:143
absl::optional< ProjectTeam > const & project_team_as_optional() const
Definition: object_access_control.h:84
ObjectAccessControl & set_self_link(std::string v)
Definition: object_access_control.h:155
ObjectAccessControl & set_entity_id(std::string v)
Definition: object_access_control.h:135
static std::string TEAM_VIEWERS()
Definition: object_access_control.h:65
friend bool operator==(ObjectAccessControl const &lhs, ObjectAccessControl const &rhs)
ObjectAccessControl & set_email(std::string v)
Definition: object_access_control.h:131
static std::string TEAM_EDITORS()
Definition: object_access_control.h:63
ObjectAccessControl & set_bucket(std::string v)
Definition: object_access_control.h:115
std::string const & self_link() const
Definition: object_access_control.h:88
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