Google Cloud Storage C++ Client
1.25.0
A C++ Client Library for Google Cloud Storage
|
Go to the documentation of this file.
15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_METADATA_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_METADATA_H
19 #include "google/cloud/storage/internal/common_metadata.h"
20 #include "google/cloud/storage/internal/patch_builder.h"
25 #include "absl/types/optional.h"
35 struct BucketMetadataParser;
50 bool requester_pays{
false};
252 std::vector<LifecycleRule>
rule;
514 std::vector<BucketAccessControl>
const&
acl()
const {
return acl_; }
517 acl_ = std::move(acl);
563 default_event_based_hold_ = v;
581 std::vector<CorsEntry>
const&
cors()
const {
return cors_; }
584 cors_ = std::move(cors);
607 default_acl_ = std::move(acl);
629 encryption_ = std::move(v);
638 using CommonMetadata::etag;
655 return *iam_configuration_;
659 return iam_configuration_;
662 iam_configuration_ = std::move(v);
666 iam_configuration_.reset();
671 using CommonMetadata::id;
672 using CommonMetadata::kind;
675 bool has_label(std::string
const& key)
const {
677 return labels_.end() != labels_.find(key);
679 std::string
const&
label(std::string
const& key)
const {
680 return labels_.at(key);
684 auto i = labels_.find(key);
685 if (i == labels_.end()) {
694 auto i = labels_.lower_bound(key);
695 if (i == labels_.end() || i->first != key) {
696 labels_.emplace_hint(i, std::move(key), std::move(value));
698 i->second = std::move(value);
703 std::map<std::string, std::string>
const&
labels()
const {
return labels_; }
720 lifecycle_ = std::move(v);
729 std::string
const&
location()
const {
return location_; }
731 location_ = std::move(v);
738 bool has_logging()
const {
return logging_.has_value(); }
745 logging_ = std::move(v);
754 using CommonMetadata::metageneration;
755 using CommonMetadata::name;
757 CommonMetadata::set_name(std::move(v));
761 using CommonMetadata::has_owner;
762 using CommonMetadata::owner;
766 using CommonMetadata::self_link;
769 bool has_retention_policy()
const {
return retention_policy_.has_value(); }
772 return *retention_policy_;
776 return retention_policy_;
779 retention_policy_ = std::move(v);
792 retention_period, std::chrono::system_clock::time_point{},
false});
796 retention_policy_.reset();
801 using CommonMetadata::storage_class;
803 CommonMetadata::set_storage_class(std::move(v));
807 using CommonMetadata::time_created;
808 using CommonMetadata::updated;
811 absl::optional<BucketVersioning>
const& versioning()
const {
829 versioning_ = std::move(v);
835 bool has_website()
const {
return website_.has_value(); }
842 website_ = std::move(v);
853 return !(lhs == rhs);
857 friend struct internal::BucketMetadataParser;
858 friend class internal::GrpcClient;
862 std::vector<BucketAccessControl> acl_;
863 absl::optional<BucketBilling> billing_;
864 std::vector<CorsEntry> cors_;
865 bool default_event_based_hold_ =
false;
866 std::vector<ObjectAccessControl> default_acl_;
867 absl::optional<BucketEncryption> encryption_;
868 absl::optional<BucketIamConfiguration> iam_configuration_;
869 std::map<std::string, std::string> labels_;
870 absl::optional<BucketLifecycle> lifecycle_;
871 std::string location_;
872 std::string location_type_;
873 absl::optional<BucketLogging> logging_;
874 std::int64_t project_number_ = 0;
875 absl::optional<BucketRetentionPolicy> retention_policy_;
876 absl::optional<BucketVersioning> versioning_;
877 absl::optional<BucketWebsite> website_;
898 std::string BuildPatch()
const;
919 std::vector<ObjectAccessControl>
const& v);
936 std::string
const& value);
952 std::chrono::seconds retention_period) {
956 retention_period, std::chrono::system_clock::time_point{},
false});
970 internal::PatchBuilder impl_;
971 bool labels_subpatch_dirty_{
false};
972 internal::PatchBuilder labels_subpatch_;
980 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_METADATA_H
The website configuration for a Bucket.
The Logging configuration for a Bucket.
bool operator<(BucketBilling const &lhs, BucketBilling const &rhs)
std::ostream & operator<<(std::ostream &os, BucketAccessControl const &rhs)
BucketVersioning(bool flag)
bool operator>(BucketWebsite const &lhs, BucketWebsite const &rhs)
bool operator>=(BucketWebsite const &lhs, BucketWebsite const &rhs)
bool operator>(BucketBilling const &lhs, BucketBilling const &rhs)
BucketVersioning()=default
std::chrono::system_clock::time_point effective_time
std::chrono::seconds retention_period
bool operator!=(BucketBilling const &lhs, BucketBilling const &rhs)
std::string log_object_prefix
Describes the default customer managed encryption key for a bucket.
The IAM configuration for a Bucket.
The versioning configuration for a Bucket.
bool operator<=(BucketWebsite const &lhs, BucketWebsite const &rhs)
std::string default_kms_key_name
bool operator!=(BucketWebsite const &lhs, BucketWebsite const &rhs)
The Object Lifecycle configuration for a Bucket.
absl::optional< std::int64_t > max_age_seconds
std::string not_found_page
The billing configuration for a Bucket.
#define STORAGE_CLIENT_NS
An entry in the CORS list.
std::vector< std::string > origin
bool operator>=(BucketBilling const &lhs, BucketBilling const &rhs)
bool operator==(BucketAccessControl const &lhs, BucketAccessControl const &rhs)
absl::optional< UniformBucketLevelAccess > uniform_bucket_level_access
std::vector< LifecycleRule > rule
The retention policy for a bucket.
std::vector< std::string > response_header
std::string main_page_suffix
bool operator<=(BucketBilling const &lhs, BucketBilling const &rhs)
std::vector< std::string > method