15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_METADATA_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_METADATA_H
18 #include "google/cloud/storage/bucket_access_control.h"
19 #include "google/cloud/storage/internal/common_metadata.h"
20 #include "google/cloud/storage/internal/patch_builder.h"
21 #include "google/cloud/storage/lifecycle_rule.h"
22 #include "google/cloud/storage/object_access_control.h"
23 #include "google/cloud/storage/version.h"
24 #include "google/cloud/optional.h"
25 #include "absl/types/optional.h"
38 struct BucketMetadataParser;
39 struct GrpcBucketMetadataParser;
40 struct GrpcBucketRequestParser;
66 return std::rel_ops::operator!=(lhs, rhs);
70 return std::rel_ops::operator>(lhs, rhs);
74 return std::rel_ops::operator<=(lhs, rhs);
78 return std::rel_ops::operator>=(lhs, rhs);
122 return std::rel_ops::operator!=(lhs, rhs);
126 return std::rel_ops::operator>(lhs, rhs);
130 return std::rel_ops::operator<=(lhs, rhs);
134 return std::rel_ops::operator>=(lhs, rhs);
138 std::ostream& operator<<(std::ostream& os,
CorsEntry const& rhs);
174 return std::rel_ops::operator!=(lhs, rhs);
179 return std::rel_ops::operator>(lhs, rhs);
184 return std::rel_ops::operator<=(lhs, rhs);
189 return std::rel_ops::operator>=(lhs, rhs);
219 GOOGLE_CLOUD_CPP_DEPRECATED(
"Use PublicAccessPreventionInherited()")
243 return std::rel_ops::operator!=(lhs, rhs);
248 return std::rel_ops::operator>(lhs, rhs);
253 return std::rel_ops::operator<=(lhs, rhs);
258 return std::rel_ops::operator>=(lhs, rhs);
285 return std::rel_ops::operator!=(lhs, rhs);
289 return std::rel_ops::operator>(lhs, rhs);
293 return std::rel_ops::operator<=(lhs, rhs);
297 return std::rel_ops::operator>=(lhs, rhs);
323 return std::rel_ops::operator!=(lhs, rhs);
327 return std::rel_ops::operator>(lhs, rhs);
331 return std::rel_ops::operator<=(lhs, rhs);
335 return std::rel_ops::operator>=(lhs, rhs);
368 return std::rel_ops::operator!=(lhs, rhs);
373 return std::rel_ops::operator>(lhs, rhs);
378 return std::rel_ops::operator<=(lhs, rhs);
383 return std::rel_ops::operator>=(lhs, rhs);
418 return std::rel_ops::operator!=(lhs, rhs);
423 return std::rel_ops::operator>(lhs, rhs);
428 return std::rel_ops::operator<=(lhs, rhs);
433 return std::rel_ops::operator>=(lhs, rhs);
469 return std::rel_ops::operator!=(lhs, rhs);
474 return std::rel_ops::operator>(lhs, rhs);
479 return std::rel_ops::operator<=(lhs, rhs);
484 return std::rel_ops::operator>=(lhs, rhs);
509 return std::rel_ops::operator!=(lhs, rhs);
513 return std::rel_ops::operator>(lhs, rhs);
517 return std::rel_ops::operator<=(lhs, rhs);
521 return std::rel_ops::operator>=(lhs, rhs);
542 acl_ = std::move(acl);
588 default_event_based_hold_ = v;
609 cors_ = std::move(cors);
632 default_acl_ = std::move(acl);
654 encryption_ = std::move(v);
663 using CommonMetadata::etag;
680 return *iam_configuration_;
684 return iam_configuration_;
687 iam_configuration_ = std::move(v);
691 iam_configuration_.reset();
696 using CommonMetadata::id;
697 using CommonMetadata::kind;
704 return labels_.end() != labels_.find(key);
712 std::string
const&
label(std::string
const& key)
const {
713 return labels_.at(key);
718 auto i = labels_.find(key);
719 if (i == labels_.end()) {
728 auto i = labels_.lower_bound(key);
729 if (i == labels_.end() || i->first != key) {
730 labels_.emplace_hint(i, std::move(key), std::move(value));
732 i->second = std::move(value);
738 std::map<std::string, std::string>
const&
labels()
const {
return labels_; }
757 lifecycle_ = std::move(v);
766 std::string
const&
location()
const {
return location_; }
768 location_ = std::move(v);
782 logging_ = std::move(v);
792 using CommonMetadata::metageneration;
795 using CommonMetadata::name;
805 CommonMetadata::set_name(std::move(v));
810 using CommonMetadata::has_owner;
811 using CommonMetadata::owner;
815 using CommonMetadata::self_link;
821 return *retention_policy_;
825 return retention_policy_;
828 retention_policy_ = std::move(v);
841 retention_period, std::chrono::system_clock::time_point{},
false}
);
845 retention_policy_.reset();
852 std::string
const&
rpo()
const {
return rpo_; }
861 using CommonMetadata::storage_class;
863 CommonMetadata::set_storage_class(std::move(v));
869 using CommonMetadata::time_created;
872 using CommonMetadata::updated;
893 versioning_ = std::move(v);
906 website_ = std::move(v);
917 return !(lhs
== rhs);
921 friend struct internal::BucketMetadataParser;
922 friend struct internal::GrpcBucketMetadataParser;
929 bool default_event_based_hold_ =
false;
933 std::map<std::string, std::string> labels_;
935 std::string location_;
936 std::string location_type_;
938 std::int64_t project_number_ = 0;
1001 std::string
const& value);
1017 std::chrono::seconds retention_period) {
1021 retention_period, std::chrono::system_clock::time_point{},
false}
);
1038 friend struct internal::GrpcBucketRequestParser;
1040 internal::PatchBuilder impl_;
1041 bool labels_subpatch_dirty_{
false};
1042 internal::PatchBuilder labels_subpatch_;