Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
bucket_lifecycle.h
1// Copyright 2022 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// https://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
15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_LIFECYCLE_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_LIFECYCLE_H
17
18#include "google/cloud/storage/lifecycle_rule.h"
19#include "google/cloud/storage/version.h"
20#include <utility>
21#include <vector>
22
23namespace google {
24namespace cloud {
25namespace storage {
26GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
27
28/**
29 * The Object Lifecycle configuration for a Bucket.
30 *
31 * @see https://cloud.google.com/storage/docs/managing-lifecycles for general
32 * information on object lifecycle rules.
33 */
34struct BucketLifecycle {
35 std::vector<LifecycleRule> rule;
36};
37
38///@{
39/// @name Comparison operators for BucketLifecycle.
40inline bool operator==(BucketLifecycle const& lhs, BucketLifecycle const& rhs) {
41 return lhs.rule == rhs.rule;
42}
43
44inline bool operator<(BucketLifecycle const& lhs, BucketLifecycle const& rhs) {
45 return lhs.rule < rhs.rule;
46}
47
48inline bool operator!=(BucketLifecycle const& lhs, BucketLifecycle const& rhs) {
49 return std::rel_ops::operator!=(lhs, rhs);
50}
51
52inline bool operator>(BucketLifecycle const& lhs, BucketLifecycle const& rhs) {
53 return std::rel_ops::operator>(lhs, rhs);
54}
55
56inline bool operator<=(BucketLifecycle const& lhs, BucketLifecycle const& rhs) {
57 return std::rel_ops::operator<=(lhs, rhs);
58}
59
60inline bool operator>=(BucketLifecycle const& lhs, BucketLifecycle const& rhs) {
61 return std::rel_ops::operator>=(lhs, rhs);
62}
63///@}
64
65GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
66} // namespace storage
67} // namespace cloud
68} // namespace google
69
70#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_LIFECYCLE_H
Defines objects to read, create, and modify Object Lifecycle Rules.
Definition: lifecycle_rule.h:127
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
bool operator>(BucketLifecycle const &lhs, BucketLifecycle const &rhs)
Definition: bucket_lifecycle.h:52
bool operator==(BucketLifecycle const &lhs, BucketLifecycle const &rhs)
Definition: bucket_lifecycle.h:40
bool operator!=(BucketLifecycle const &lhs, BucketLifecycle const &rhs)
Definition: bucket_lifecycle.h:48
bool operator<=(BucketLifecycle const &lhs, BucketLifecycle const &rhs)
Definition: bucket_lifecycle.h:56
bool operator<(BucketLifecycle const &lhs, BucketLifecycle const &rhs)
Definition: bucket_lifecycle.h:44
bool operator>=(BucketLifecycle const &lhs, BucketLifecycle const &rhs)
Definition: bucket_lifecycle.h:60
The Object Lifecycle configuration for a Bucket.
Definition: bucket_lifecycle.h:34
std::vector< LifecycleRule > rule
Definition: bucket_lifecycle.h:35