Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
bucket_billing.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_BILLING_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_BILLING_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 billing 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 BucketBilling {
33 BucketBilling() = default;
34 // NOLINTNEXTLINE(google-explicit-constructor)
35 BucketBilling(bool v) : requester_pays(v) {}
36
37 bool requester_pays{false};
38};
39
40inline bool operator==(BucketBilling const& lhs, BucketBilling const& rhs) {
41 return lhs.requester_pays == rhs.requester_pays;
42}
43
44inline bool operator<(BucketBilling const& lhs, BucketBilling const& rhs) {
45 return !lhs.requester_pays && rhs.requester_pays;
46}
47
48inline bool operator!=(BucketBilling const& lhs, BucketBilling const& rhs) {
49 return std::rel_ops::operator!=(lhs, rhs);
50}
51
52inline bool operator>(BucketBilling const& lhs, BucketBilling const& rhs) {
53 return std::rel_ops::operator>(lhs, rhs);
54}
55
56inline bool operator<=(BucketBilling const& lhs, BucketBilling const& rhs) {
57 return std::rel_ops::operator<=(lhs, rhs);
58}
59
60inline bool operator>=(BucketBilling const& lhs, BucketBilling const& rhs) {
61 return std::rel_ops::operator>=(lhs, rhs);
62}
63
64GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
65} // namespace storage
66} // namespace cloud
67} // namespace google
68
69#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_BUCKET_BILLING_H
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
bool operator<(BucketBilling const &lhs, BucketBilling const &rhs)
Definition: bucket_billing.h:44
bool operator<=(BucketBilling const &lhs, BucketBilling const &rhs)
Definition: bucket_billing.h:56
bool operator>(BucketBilling const &lhs, BucketBilling const &rhs)
Definition: bucket_billing.h:52
bool operator==(BucketBilling const &lhs, BucketBilling const &rhs)
Definition: bucket_billing.h:40
bool operator!=(BucketBilling const &lhs, BucketBilling const &rhs)
Definition: bucket_billing.h:48
bool operator>=(BucketBilling const &lhs, BucketBilling const &rhs)
Definition: bucket_billing.h:60
The billing configuration for a Bucket.
Definition: bucket_billing.h:32
bool requester_pays
Definition: bucket_billing.h:37
BucketBilling(bool v)
Definition: bucket_billing.h:35