Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
bucket_versioning.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_VERSIONING_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_VERSIONING_H
17
18#include "google/cloud/storage/version.h"
19#include <utility>
20
21namespace google {
22namespace cloud {
23namespace storage {
24GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
25
26/**
27 * The versioning configuration for a Bucket.
28 *
29 * @see https://cloud.google.com/storage/docs/requester-pays for general
30 * information on "Requester Pays" billing.
31 */
32struct BucketVersioning {
33 BucketVersioning() = default;
34 explicit BucketVersioning(bool flag) : enabled(flag) {}
35
36 bool enabled{true};
37};
38
39inline bool operator==(BucketVersioning const& lhs,
40 BucketVersioning const& rhs) {
41 return lhs.enabled == rhs.enabled;
42}
43
44inline bool operator<(BucketVersioning const& lhs,
45 BucketVersioning const& rhs) {
46 return !lhs.enabled && rhs.enabled;
47}
48
49inline bool operator!=(BucketVersioning const& lhs,
50 BucketVersioning const& rhs) {
51 return std::rel_ops::operator!=(lhs, rhs);
52}
53
54inline bool operator>(BucketVersioning const& lhs,
55 BucketVersioning const& rhs) {
56 return std::rel_ops::operator>(lhs, rhs);
57}
58
59inline bool operator<=(BucketVersioning const& lhs,
60 BucketVersioning const& rhs) {
61 return std::rel_ops::operator<=(lhs, rhs);
62}
63
64inline bool operator>=(BucketVersioning const& lhs,
65 BucketVersioning const& rhs) {
66 return std::rel_ops::operator>=(lhs, rhs);
67}
68
69GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
70} // namespace storage
71} // namespace cloud
72} // namespace google
73
74#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_VERSIONING_H
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
bool operator!=(BucketVersioning const &lhs, BucketVersioning const &rhs)
Definition: bucket_versioning.h:49
bool operator>(BucketVersioning const &lhs, BucketVersioning const &rhs)
Definition: bucket_versioning.h:54
bool operator<(BucketVersioning const &lhs, BucketVersioning const &rhs)
Definition: bucket_versioning.h:44
bool operator==(BucketVersioning const &lhs, BucketVersioning const &rhs)
Definition: bucket_versioning.h:39
bool operator>=(BucketVersioning const &lhs, BucketVersioning const &rhs)
Definition: bucket_versioning.h:64
bool operator<=(BucketVersioning const &lhs, BucketVersioning const &rhs)
Definition: bucket_versioning.h:59
The versioning configuration for a Bucket.
Definition: bucket_versioning.h:32
BucketVersioning(bool flag)
Definition: bucket_versioning.h:34
bool enabled
Definition: bucket_versioning.h:36