15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_LIFECYCLE_RULE_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_LIFECYCLE_RULE_H
18 #include "google/cloud/storage/storage_class.h"
19 #include "google/cloud/storage/version.h"
20 #include "google/cloud/internal/parse_rfc3339.h"
21 #include "google/cloud/optional.h"
22 #include "google/cloud/status_or.h"
23 #include "absl/time/civil_time.h"
24 #include "absl/types/optional.h"
35 struct LifecycleRuleParser;
36 struct GrpcBucketMetadataParser;
59 return std::rel_ops::operator!=(lhs, rhs);
64 return std::rel_ops::operator>(lhs, rhs);
69 return std::rel_ops::operator<=(lhs, rhs);
74 return std::rel_ops::operator>=(lhs, rhs);
81 absl::optional<std::int32_t>
age;
102 return std::rel_ops::operator!=(lhs, rhs);
107 return std::rel_ops::operator>(lhs, rhs);
112 return std::rel_ops::operator<=(lhs, rhs);
117 return std::rel_ops::operator>=(lhs, rhs);
135 : action_(std::move(action)), condition_(std::move(condition)) {}
162 result
.age.emplace(std::move(days));
174 result
.is_live.emplace(std::move(value));
179 std::vector<std::string> value;
180 value.emplace_back(std::move(storage_class));
187 std::initializer_list<std::string> list) {
188 std::vector<std::string> classes(std::move(list));
194 template <
typename Iterator>
197 std::vector<std::string> classes(begin, end);
263 std::vector<std::string> value;
264 value.emplace_back(std::move(prefix));
271 std::initializer_list<std::string> list) {
272 std::vector<std::string> classes(std::move(list));
279 std::vector<std::string> value;
280 value.emplace_back(std::move(suffix));
287 std::initializer_list<std::string> list) {
288 std::vector<std::string> classes(std::move(list));
320 template <
typename... Condition>
323 MergeConditions(result, std::forward<Condition>(condition)...);
328 friend struct internal::LifecycleRuleParser;
329 friend struct internal::GrpcBucketMetadataParser;
331 LifecycleRule() =
default;
336 template <
typename... Condition>
339 Condition&&... tail) {
340 MergeConditions(result, head);
341 MergeConditions(result, std::forward<Condition>(tail)...);
359 return std::rel_ops::operator!=(lhs, rhs);
363 return std::rel_ops::operator>(lhs, rhs);
367 return std::rel_ops::operator<=(lhs, rhs);
371 return std::rel_ops::operator>=(lhs, rhs);