Google Cloud Storage C++ Client  1.24.0
A C++ Client Library for Google Cloud Storage
bucket_metadata.cc
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 
16 #include "google/cloud/storage/internal/bucket_acl_requests.h"
17 #include "google/cloud/storage/internal/bucket_requests.h"
18 #include "google/cloud/storage/internal/metadata_parser.h"
19 #include "google/cloud/storage/internal/object_acl_requests.h"
20 #include "google/cloud/internal/absl_str_join_quiet.h"
21 #include "google/cloud/internal/format_time_point.h"
22 #include "google/cloud/internal/ios_flags_saver.h"
23 #include "google/cloud/status.h"
24 #include "absl/strings/str_format.h"
25 #include <nlohmann/json.hpp>
26 
27 namespace google {
28 namespace cloud {
29 namespace storage {
30 inline namespace STORAGE_CLIENT_NS {
31 
32 std::ostream& operator<<(std::ostream& os, CorsEntry const& rhs) {
33  os << "CorsEntry={";
34  char const* sep = "";
35  if (rhs.max_age_seconds.has_value()) {
36  os << "max_age_seconds=" << *rhs.max_age_seconds;
37  sep = ", ";
38  }
39  return os << sep << "method=[" << absl::StrJoin(rhs.method, ", ")
40  << "], origin=[" << absl::StrJoin(rhs.origin, ", ")
41  << "], response_header=["
42  << absl::StrJoin(rhs.response_header, ", ") << "]}";
43 }
44 
45 std::ostream& operator<<(std::ostream& os,
46  UniformBucketLevelAccess const& rhs) {
47  google::cloud::internal::IosFlagsSaver save_format(os);
48  return os << "UniformBucketLevelAccess={enabled=" << std::boolalpha
49  << rhs.enabled << ", locked_time="
50  << google::cloud::internal::FormatRfc3339(rhs.locked_time) << "}";
51 }
52 
53 std::ostream& operator<<(std::ostream& os, BucketIamConfiguration const& rhs) {
54  os << "BucketIamConfiguration={";
55  if (rhs.uniform_bucket_level_access.has_value()) {
56  os << "uniform_bucket_level_access=" << *rhs.uniform_bucket_level_access;
57  return os << "}";
58  };
59  return os << "}";
60 }
61 
62 std::ostream& operator<<(std::ostream& os, BucketLogging const& rhs) {
63  return os << "BucketLogging={log_bucket=" << rhs.log_bucket
64  << ", log_object_prefix=" << rhs.log_object_prefix << "}";
65 }
66 
67 std::ostream& operator<<(std::ostream& os, BucketRetentionPolicy const& rhs) {
68  return os << "BucketRetentionPolicy={retention_period="
69  << rhs.retention_period.count() << "s, effective_time="
70  << google::cloud::internal::FormatRfc3339(rhs.effective_time)
71  << ", locked=" << rhs.is_locked << "}";
72 }
73 
74 bool operator==(BucketMetadata const& lhs, BucketMetadata const& rhs) {
75  return static_cast<internal::CommonMetadata<BucketMetadata> const&>(lhs) ==
76  rhs &&
77  lhs.acl_ == rhs.acl_ && lhs.billing_ == rhs.billing_ &&
78  lhs.cors_ == rhs.cors_ &&
79  lhs.default_event_based_hold_ == rhs.default_event_based_hold_ &&
80  lhs.default_acl_ == rhs.default_acl_ &&
81  lhs.encryption_ == rhs.encryption_ &&
82  lhs.iam_configuration_ == rhs.iam_configuration_ &&
83  lhs.project_number_ == rhs.project_number_ &&
84  lhs.lifecycle_ == rhs.lifecycle_ && lhs.location_ == rhs.location_ &&
85  lhs.location_type_ == rhs.location_type_ &&
86  lhs.logging_ == rhs.logging_ && lhs.labels_ == rhs.labels_ &&
87  lhs.retention_policy_ == rhs.retention_policy_ &&
88  lhs.versioning_ == rhs.versioning_ && lhs.website_ == rhs.website_;
89 }
90 
91 std::ostream& operator<<(std::ostream& os, BucketMetadata const& rhs) {
92  google::cloud::internal::IosFlagsSaver save_format(os);
93  os << "BucketMetadata={name=" << rhs.name();
94 
95  os << ", acl=[";
96  os << absl::StrJoin(rhs.acl(), ", ", absl::StreamFormatter());
97  os << "]";
98 
99  if (rhs.has_billing()) {
100  auto previous_flags = os.flags();
101  os << ", billing.requesterPays=" << std::boolalpha
102  << rhs.billing().requester_pays;
103  os.flags(previous_flags);
104  }
105 
106  os << ", cors=[";
107  os << absl::StrJoin(rhs.cors(), ", ", absl::StreamFormatter());
108  os << "]";
109 
110  os << ", default_event_based_hold=" << std::boolalpha
111  << rhs.default_event_based_hold();
112 
113  os << ", default_acl=[";
114  os << absl::StrJoin(rhs.default_acl(), ", ", absl::StreamFormatter());
115  os << "]";
116 
117  if (rhs.has_encryption()) {
118  os << ", encryption.default_kms_key_name="
120  }
121 
122  os << ", etag=" << rhs.etag();
123 
124  if (rhs.has_iam_configuration()) {
125  os << ", iam_configuration=" << rhs.iam_configuration();
126  }
127 
128  os << ", id=" << rhs.id() << ", kind=" << rhs.kind();
129 
130  for (auto const& kv : rhs.labels_) {
131  os << ", labels." << kv.first << "=" << kv.second;
132  }
133 
134  if (rhs.has_lifecycle()) {
135  os << ", lifecycle.rule=[";
136  os << absl::StrJoin(rhs.lifecycle().rule, ", ", absl::StreamFormatter());
137  os << "]";
138  }
139 
140  os << ", location=" << rhs.location();
141 
142  os << ", location_type=" << rhs.location_type();
143 
144  if (rhs.has_logging()) {
145  os << ", logging=" << rhs.logging();
146  }
147 
148  os << ", metageneration=" << rhs.metageneration() << ", name=" << rhs.name();
149 
150  if (rhs.has_owner()) {
151  os << ", owner.entity=" << rhs.owner().entity
152  << ", owner.entity_id=" << rhs.owner().entity_id;
153  }
154 
155  os << ", project_number=" << rhs.project_number()
156  << ", self_link=" << rhs.self_link()
157  << ", storage_class=" << rhs.storage_class() << ", time_created="
158  << google::cloud::internal::FormatRfc3339(rhs.time_created())
159  << ", updated=" << google::cloud::internal::FormatRfc3339(rhs.updated());
160 
161  if (rhs.has_retention_policy()) {
162  os << ", retention_policy.retention_period="
163  << rhs.retention_policy().retention_period.count()
164  << ", retention_policy.effective_time="
165  << google::cloud::internal::FormatRfc3339(
167  << ", retention_policy.is_locked=" << std::boolalpha
168  << rhs.retention_policy().is_locked;
169  }
170 
171  if (rhs.versioning().has_value()) {
172  auto previous_flags = os.flags();
173  os << ", versioning.enabled=" << std::boolalpha
174  << rhs.versioning()->enabled;
175  os.flags(previous_flags);
176  }
177 
178  if (rhs.has_website()) {
179  os << ", website.main_page_suffix=" << rhs.website().main_page_suffix
180  << ", website.not_found_page=" << rhs.website().not_found_page;
181  }
182 
183  return os << "}";
184 }
185 
186 std::string BucketMetadataPatchBuilder::BuildPatch() const {
187  internal::PatchBuilder tmp = impl_;
188  if (labels_subpatch_dirty_) {
189  if (labels_subpatch_.empty()) {
190  tmp.RemoveField("labels");
191  } else {
192  tmp.AddSubPatch("labels", labels_subpatch_);
193  }
194  }
195  return tmp.ToString();
196 }
197 
198 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetAcl(
199  std::vector<BucketAccessControl> const& v) {
200  if (v.empty()) {
201  return ResetAcl();
202  }
203  auto array = nlohmann::json::array();
204  for (auto const& a : v) {
205  array.emplace_back(nlohmann::json{
206  {"entity", a.entity()},
207  {"role", a.role()},
208  });
209  }
210  impl_.SetArrayField("acl", array.dump());
211  return *this;
212 }
213 
214 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetAcl() {
215  impl_.RemoveField("acl");
216  return *this;
217 }
218 
219 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetBilling(
220  BucketBilling const& v) {
221  impl_.AddSubPatch("billing", internal::PatchBuilder().SetBoolField(
222  "requesterPays", v.requester_pays));
223  return *this;
224 }
225 
226 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetBilling() {
227  impl_.RemoveField("billing");
228  return *this;
229 }
230 
231 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetCors(
232  std::vector<CorsEntry> const& v) {
233  if (v.empty()) {
234  return ResetCors();
235  }
236  auto array = nlohmann::json::array();
237  for (auto const& a : v) {
238  nlohmann::json entry;
239  if (a.max_age_seconds.has_value()) {
240  entry["maxAgeSeconds"] = *a.max_age_seconds;
241  }
242  if (!a.method.empty()) {
243  entry["method"] = a.method;
244  }
245  if (!a.origin.empty()) {
246  entry["origin"] = a.origin;
247  }
248  if (!a.response_header.empty()) {
249  entry["responseHeader"] = a.response_header;
250  }
251  array.emplace_back(std::move(entry));
252  }
253  impl_.SetArrayField("cors", array.dump());
254  return *this;
255 }
256 
257 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetCors() {
258  impl_.RemoveField("cors");
259  return *this;
260 }
261 
263 BucketMetadataPatchBuilder::SetDefaultEventBasedHold(bool v) {
264  impl_.SetBoolField("defaultEventBasedHold", v);
265  return *this;
266 }
267 
269 BucketMetadataPatchBuilder::ResetDefaultEventBasedHold() {
270  impl_.RemoveField("defaultEventBasedHold");
271  return *this;
272 }
273 
274 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetDefaultAcl(
275  std::vector<ObjectAccessControl> const& v) {
276  if (v.empty()) {
277  return ResetDefaultAcl();
278  }
279  auto array = nlohmann::json::array();
280  for (auto const& a : v) {
281  array.emplace_back(nlohmann::json{
282  {"entity", a.entity()},
283  {"role", a.role()},
284  });
285  }
286  impl_.SetArrayField("defaultObjectAcl", array.dump());
287  return *this;
288 }
289 
290 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetDefaultAcl() {
291  impl_.RemoveField("defaultObjectAcl");
292  return *this;
293 }
294 
295 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetEncryption(
296  BucketEncryption const& v) {
297  impl_.AddSubPatch("encryption",
298  internal::PatchBuilder().SetStringField(
299  "defaultKmsKeyName", v.default_kms_key_name));
300  return *this;
301 }
302 
303 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetEncryption() {
304  impl_.RemoveField("encryption");
305  return *this;
306 }
307 
308 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetIamConfiguration(
309  BucketIamConfiguration const& v) {
310  internal::PatchBuilder iam_configuration;
311 
312  if (v.uniform_bucket_level_access.has_value()) {
313  internal::PatchBuilder uniform_bucket_level_access;
314  uniform_bucket_level_access.SetBoolField(
315  "enabled", v.uniform_bucket_level_access->enabled);
316  // The lockedTime field should not be set, this is not a mutable field, it
317  // is set by the server when the policy is enabled.
318  iam_configuration.AddSubPatch("uniformBucketLevelAccess",
319  uniform_bucket_level_access);
320  impl_.AddSubPatch("iamConfiguration", iam_configuration);
321  return *this;
322  }
323  impl_.AddSubPatch("iamConfiguration", iam_configuration);
324  return *this;
325 }
326 
328 BucketMetadataPatchBuilder::ResetIamConfiguration() {
329  impl_.RemoveField("iamConfiguration");
330  return *this;
331 }
332 
333 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetLabel(
334  std::string const& label, std::string const& value) {
335  labels_subpatch_.SetStringField(label.c_str(), value);
336  labels_subpatch_dirty_ = true;
337  return *this;
338 }
339 
340 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetLabel(
341  std::string const& label) {
342  labels_subpatch_.RemoveField(label.c_str());
343  labels_subpatch_dirty_ = true;
344  return *this;
345 }
346 
347 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetLabels() {
348  labels_subpatch_.clear();
349  labels_subpatch_dirty_ = true;
350  return *this;
351 }
352 
353 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetLifecycle(
354  BucketLifecycle const& v) {
355  if (v.rule.empty()) {
356  return ResetLifecycle();
357  }
358  internal::PatchBuilder subpatch;
359  auto array = nlohmann::json::array();
360  for (auto const& a : v.rule) {
361  nlohmann::json condition;
362  auto const& c = a.condition();
363  if (c.age.has_value()) {
364  condition["age"] = *c.age;
365  }
366  if (c.created_before.has_value()) {
367  condition["createdBefore"] =
368  absl::StrFormat("%04d-%02d-%02d", c.created_before->year(),
369  c.created_before->month(), c.created_before->day());
370  }
371  if (c.is_live.has_value()) {
372  condition["isLive"] = *c.is_live;
373  }
374  if (c.matches_storage_class.has_value()) {
375  condition["matchesStorageClass"] = *c.matches_storage_class;
376  }
377  if (c.num_newer_versions.has_value()) {
378  condition["numNewerVersions"] = *c.num_newer_versions;
379  }
380  nlohmann::json action;
381  if (!a.action().type.empty()) {
382  action["type"] = a.action().type;
383  }
384  if (!a.action().storage_class.empty()) {
385  action["storageClass"] = a.action().storage_class;
386  }
387  array.emplace_back(nlohmann::json{
388  {"action", action},
389  {"condition", condition},
390  });
391  }
392  subpatch.SetArrayField("rule", array.dump());
393  impl_.AddSubPatch("lifecycle", subpatch);
394  return *this;
395 }
396 
397 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetLifecycle() {
398  impl_.RemoveField("lifecycle");
399  return *this;
400 }
401 
402 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetLogging(
403  BucketLogging const& v) {
404  impl_.AddSubPatch(
405  "logging", internal::PatchBuilder()
406  .SetStringField("logBucket", v.log_bucket)
407  .SetStringField("logObjectPrefix", v.log_object_prefix));
408  return *this;
409 }
410 
411 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetLogging() {
412  impl_.RemoveField("logging");
413  return *this;
414 }
415 
416 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetName(
417  std::string const& v) {
418  if (v.empty()) {
419  return ResetName();
420  }
421  impl_.SetStringField("name", v);
422  return *this;
423 }
424 
425 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetName() {
426  impl_.RemoveField("name");
427  return *this;
428 }
429 
430 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetRetentionPolicy(
431  BucketRetentionPolicy const& v) {
432  // Only the retentionPeriod field is writeable, so do not modify the other
433  // fields.
434  impl_.AddSubPatch("retentionPolicy",
435  internal::PatchBuilder().SetIntField(
436  "retentionPeriod", static_cast<std::uint64_t>(
437  v.retention_period.count())));
438  return *this;
439 }
440 
441 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetRetentionPolicy() {
442  impl_.RemoveField("retentionPolicy");
443  return *this;
444 }
445 
446 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetStorageClass(
447  std::string const& v) {
448  if (v.empty()) {
449  return ResetStorageClass();
450  }
451  impl_.SetStringField("storageClass", v);
452  return *this;
453 }
454 
455 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetStorageClass() {
456  impl_.RemoveField("storageClass");
457  return *this;
458 }
459 
460 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetVersioning(
461  BucketVersioning const& v) {
462  impl_.AddSubPatch("versioning", internal::PatchBuilder().SetBoolField(
463  "enabled", v.enabled));
464  return *this;
465 }
466 
467 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetVersioning() {
468  impl_.RemoveField("versioning");
469  return *this;
470 }
471 
472 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetWebsite(
473  BucketWebsite const& v) {
474  impl_.AddSubPatch("website",
475  internal::PatchBuilder()
476  .SetStringField("mainPageSuffix", v.main_page_suffix)
477  .SetStringField("notFoundPage", v.not_found_page));
478  return *this;
479 }
480 
481 BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetWebsite() {
482  impl_.RemoveField("website");
483  return *this;
484 }
485 
486 } // namespace STORAGE_CLIENT_NS
487 } // namespace storage
488 } // namespace cloud
489 } // namespace google
google::cloud::storage::v1::UniformBucketLevelAccess::enabled
bool enabled
Definition: bucket_metadata.h:153
status.h
google::cloud::storage::v1::BucketLogging::log_bucket
std::string log_bucket
Definition: bucket_metadata.h:293
google::cloud::storage::v1::BucketMetadata::billing
BucketBilling const & billing() const
Definition: bucket_metadata.h:533
google::cloud::storage::v1::BucketMetadata::has_encryption
bool has_encryption() const
Definition: bucket_metadata.h:627
google::cloud::storage::v1::BucketVersioning::enabled
bool enabled
Definition: bucket_metadata.h:433
google::cloud::storage::v1::BucketWebsite
The website configuration for a Bucket.
Definition: bucket_metadata.h:472
google::cloud::storage::v1::BucketMetadata::project_number
std::int64_t const & project_number() const
Definition: bucket_metadata.h:768
google::cloud::storage::v1::BucketLogging
The Logging configuration for a Bucket.
Definition: bucket_metadata.h:292
google::cloud::storage::v1::operator<<
std::ostream & operator<<(std::ostream &os, BucketAccessControl const &rhs)
Definition: bucket_access_control.cc:27
google::cloud::storage::v1::BucketMetadata::location_type
std::string const & location_type() const
Definition: bucket_metadata.h:739
google::cloud::storage::v1::BucketMetadata::has_website
bool has_website() const
Definition: bucket_metadata.h:840
google::cloud::storage::v1::BucketMetadata::location
std::string const & location() const
Definition: bucket_metadata.h:733
google::cloud::storage::v1::BucketMetadata::cors
std::vector< CorsEntry > const & cors() const
Definition: bucket_metadata.h:585
google::cloud::storage::v1::BucketMetadata::logging
BucketLogging const & logging() const
Definition: bucket_metadata.h:744
bucket_metadata.h
google::cloud::storage::v1::BucketRetentionPolicy::effective_time
std::chrono::system_clock::time_point effective_time
Definition: bucket_metadata.h:385
google::cloud::storage::v1::BucketRetentionPolicy::retention_period
std::chrono::seconds retention_period
Definition: bucket_metadata.h:384
google::cloud::storage::v1::BucketLogging::log_object_prefix
std::string log_object_prefix
Definition: bucket_metadata.h:294
google::cloud::storage::v1::BucketMetadata::retention_policy
BucketRetentionPolicy const & retention_policy() const
Sets the retention period.
Definition: bucket_metadata.h:775
google::cloud::storage::v1::BucketMetadata::website
BucketWebsite const & website() const
Definition: bucket_metadata.h:841
google::cloud::storage::v1::BucketEncryption
Describes the default customer managed encryption key for a bucket.
Definition: bucket_metadata.h:337
google::cloud::storage::v1::BucketMetadata::default_acl
std::vector< ObjectAccessControl > const & default_acl() const
Definition: bucket_metadata.h:604
google::cloud::storage::v1::BucketMetadata::has_billing
bool has_billing() const
Definition: bucket_metadata.h:532
google::cloud::storage::v1::BucketIamConfiguration
The IAM configuration for a Bucket.
Definition: bucket_metadata.h:210
google::cloud::storage::v1::BucketVersioning
The versioning configuration for a Bucket.
Definition: bucket_metadata.h:429
google::cloud::storage::v1::BucketMetadata::default_event_based_hold
bool default_event_based_hold() const
Definition: bucket_metadata.h:565
google::cloud::storage::v1::BucketMetadata
Represents a Google Cloud Storage Bucket Metadata object.
Definition: bucket_metadata.h:506
google::cloud::storage::v1::BucketMetadata::has_logging
bool has_logging() const
Definition: bucket_metadata.h:743
google::cloud::storage::v1::BucketEncryption::default_kms_key_name
std::string default_kms_key_name
Definition: bucket_metadata.h:338
google::cloud::storage::v1::BucketMetadataPatchBuilder
Prepares a patch for the Bucket resource.
Definition: bucket_metadata.h:898
google::cloud::storage::v1::BucketMetadata::versioning
absl::optional< BucketVersioning > const & versioning() const
Definition: bucket_metadata.h:816
google::cloud::storage::v1::BucketLifecycle
The Object Lifecycle configuration for a Bucket.
Definition: bucket_metadata.h:255
google::cloud::storage::v1::CorsEntry::max_age_seconds
absl::optional< std::int64_t > max_age_seconds
Definition: bucket_metadata.h:95
google::cloud::storage::v1::BucketWebsite::not_found_page
std::string not_found_page
Definition: bucket_metadata.h:474
google::cloud::storage::v1::BucketBilling::requester_pays
bool requester_pays
Definition: bucket_metadata.h:50
google::cloud::storage::v1::BucketMetadata::lifecycle
BucketLifecycle const & lifecycle() const
Definition: bucket_metadata.h:719
google::cloud::storage::v1::BucketBilling
The billing configuration for a Bucket.
Definition: bucket_metadata.h:45
STORAGE_CLIENT_NS
#define STORAGE_CLIENT_NS
Definition: version.h:22
google::cloud::storage::v1::BucketMetadata::encryption
BucketEncryption const & encryption() const
Definition: bucket_metadata.h:628
google::cloud::storage::v1::CorsEntry
An entry in the CORS list.
Definition: bucket_metadata.h:94
google::cloud::storage::v1::CorsEntry::origin
std::vector< std::string > origin
Definition: bucket_metadata.h:97
google::cloud::storage::v1::BucketRetentionPolicy::is_locked
bool is_locked
Definition: bucket_metadata.h:386
google::cloud::storage::v1::operator==
bool operator==(BucketAccessControl const &lhs, BucketAccessControl const &rhs)
Definition: bucket_access_control.cc:22
google::cloud::storage::v1::BucketIamConfiguration::uniform_bucket_level_access
absl::optional< UniformBucketLevelAccess > uniform_bucket_level_access
Definition: bucket_metadata.h:211
google::cloud::storage::v1::UniformBucketLevelAccess::locked_time
std::chrono::system_clock::time_point locked_time
Definition: bucket_metadata.h:154
google::cloud::storage::v1::BucketLifecycle::rule
std::vector< LifecycleRule > rule
Definition: bucket_metadata.h:256
google::cloud::storage::v1::BucketMetadata::iam_configuration
BucketIamConfiguration const & iam_configuration() const
Definition: bucket_metadata.h:658
google::cloud::storage::v1::BucketMetadata::has_lifecycle
bool has_lifecycle() const
Definition: bucket_metadata.h:718
google::cloud::storage::v1::BucketRetentionPolicy
The retention policy for a bucket.
Definition: bucket_metadata.h:383
google::cloud::storage::v1::CorsEntry::response_header
std::vector< std::string > response_header
Definition: bucket_metadata.h:98
google::cloud::storage::v1::UniformBucketLevelAccess
Configure if only the IAM policies are used for access control.
Definition: bucket_metadata.h:152
google::cloud::storage::v1::BucketMetadata::acl
std::vector< BucketAccessControl > const & acl() const
Definition: bucket_metadata.h:518
google::cloud::storage::v1::BucketMetadata::has_iam_configuration
bool has_iam_configuration() const
Definition: bucket_metadata.h:657
google
google::cloud::storage::v1::BucketMetadata::has_retention_policy
bool has_retention_policy() const
Sets the retention period.
Definition: bucket_metadata.h:774
google::cloud::storage::v1::BucketWebsite::main_page_suffix
std::string main_page_suffix
Definition: bucket_metadata.h:473
google::cloud::storage::v1::CorsEntry::method
std::vector< std::string > method
Definition: bucket_metadata.h:96