Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
project_team.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_PROJECT_TEAM_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_PROJECT_TEAM_H
17
18#include "google/cloud/storage/version.h"
19#include <string>
20#include <tuple>
21#include <utility>
22
23namespace google {
24namespace cloud {
25namespace storage {
26GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
27
28/**
29 * Represents the projectTeam field in *AccessControls.
30 *
31 * @see
32 * https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls
33 * https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls
34 */
35struct ProjectTeam {
36 std::string project_number;
37 std::string team;
38};
39
40inline bool operator==(ProjectTeam const& lhs, ProjectTeam const& rhs) {
41 return std::tie(lhs.project_number, lhs.team) ==
42 std::tie(rhs.project_number, rhs.team);
43}
44
45inline bool operator<(ProjectTeam const& lhs, ProjectTeam const& rhs) {
46 return std::tie(lhs.project_number, lhs.team) <
47 std::tie(rhs.project_number, rhs.team);
48}
49
50inline bool operator!=(ProjectTeam const& lhs, ProjectTeam const& rhs) {
51 return std::rel_ops::operator!=(lhs, rhs);
52}
53
54inline bool operator>(ProjectTeam const& lhs, ProjectTeam const& rhs) {
55 return std::rel_ops::operator>(lhs, rhs);
56}
57
58inline bool operator<=(ProjectTeam const& lhs, ProjectTeam const& rhs) {
59 return std::rel_ops::operator<=(lhs, rhs);
60}
61
62inline bool operator>=(ProjectTeam const& lhs, ProjectTeam const& rhs) {
63 return std::rel_ops::operator>=(lhs, rhs);
64}
65
66///@{
67/**
68 * @name Well-known values for the project_team().team field..
69 *
70 * The following functions are handy to avoid common typos in the team names.
71 * We use functions instead of enums because enums are not backwards
72 * compatible and are brittle to changes in the server-side.
73 */
74inline std::string TEAM_EDITORS() { return "editors"; }
75inline std::string TEAM_OWNERS() { return "owners"; }
76inline std::string TEAM_VIEWERS() { return "viewers"; }
77///@}
78
79GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
80} // namespace storage
81} // namespace cloud
82} // namespace google
83
84#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_PROJECT_TEAM_H
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
bool operator>(ProjectTeam const &lhs, ProjectTeam const &rhs)
Definition: project_team.h:54
bool operator<(ProjectTeam const &lhs, ProjectTeam const &rhs)
Definition: project_team.h:45
std::string TEAM_VIEWERS()
Definition: project_team.h:76
bool operator==(ProjectTeam const &lhs, ProjectTeam const &rhs)
Definition: project_team.h:40
bool operator>=(ProjectTeam const &lhs, ProjectTeam const &rhs)
Definition: project_team.h:62
bool operator!=(ProjectTeam const &lhs, ProjectTeam const &rhs)
Definition: project_team.h:50
std::string TEAM_EDITORS()
Definition: project_team.h:74
std::string TEAM_OWNERS()
Definition: project_team.h:75
bool operator<=(ProjectTeam const &lhs, ProjectTeam const &rhs)
Definition: project_team.h:58
Represents the projectTeam field in *AccessControls.
Definition: project_team.h:35
std::string project_number
Definition: project_team.h:36
std::string team
Definition: project_team.h:37