Google Cloud Storage C++ Client  1.26.0
A C++ Client Library for Google Cloud Storage
version.h
Go to the documentation of this file.
1 // Copyright 2018 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 // http://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_VERSION_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_VERSION_H
17 
19 #include "google/cloud/internal/attributes.h"
20 #include "google/cloud/version.h"
21 #include <string>
22 
23 #define GOOGLE_CLOUD_CPP_STORAGE_IAM_DEPRECATED(alternative) \
24  GOOGLE_CLOUD_CPP_DEPRECATED( \
25  "this function predates IAM conditions and does not work with policies " \
26  "that include IAM conditions. Please use " alternative \
27  " instead. The function will be removed on 2022-04-01 or shortly " \
28  "after. See GitHub issue #5929 for more information.")
29 
30 #define STORAGE_CLIENT_NS \
31  GOOGLE_CLOUD_CPP_VEVAL(STORAGE_CLIENT_VERSION_MAJOR, \
32  STORAGE_CLIENT_VERSION_MINOR)
33 
34 namespace google {
35 namespace cloud {
39 namespace storage {
52 inline namespace STORAGE_CLIENT_NS {
58 int constexpr version_major() { return STORAGE_CLIENT_VERSION_MAJOR; }
59 
65 int constexpr version_minor() { return STORAGE_CLIENT_VERSION_MINOR; }
66 
72 int constexpr version_patch() { return STORAGE_CLIENT_VERSION_PATCH; }
73 
75 int constexpr version() {
76  static_assert(::google::cloud::version_major() == version_major(),
77  "Mismatched major version");
78  static_assert(::google::cloud::version_minor() == version_minor(),
79  "Mismatched minor version");
80  static_assert(::google::cloud::version_patch() == version_patch(),
81  "Mismatched patch version");
82  return ::google::cloud::version();
83 }
84 
86 std::string version_string();
87 
89 std::string x_goog_api_client();
90 
91 } // namespace STORAGE_CLIENT_NS
92 } // namespace storage
93 } // namespace cloud
94 } // namespace google
95 
96 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_VERSION_H
STORAGE_CLIENT_VERSION_MINOR
#define STORAGE_CLIENT_VERSION_MINOR
Definition: version_info.h:21
google::cloud::storage::v1::version_patch
constexpr int version_patch()
Returns the Google Cloud Storage C++ Client patch version.
Definition: version.h:72
version.h
google::cloud::storage::v1::version_major
constexpr int version_major()
Returns the Google Cloud Storage C++ Client major version.
Definition: version.h:58
google::cloud::storage::v1::version_minor
constexpr int version_minor()
Returns the Google Cloud Storage C++ Client minor version.
Definition: version.h:65
google::cloud::storage::v1::version_string
std::string version_string()
Returns the version as a string, in MAJOR.MINOR.PATCH+gitrev format.
Definition: version.cc:23
STORAGE_CLIENT_VERSION_PATCH
#define STORAGE_CLIENT_VERSION_PATCH
Definition: version_info.h:22
version_info.h
STORAGE_CLIENT_NS
#define STORAGE_CLIENT_NS
Definition: version.h:30
google::cloud::storage::v1::version
constexpr int version()
Returns a single integer representing the Major/Minor/Patch version.
Definition: version.h:75
STORAGE_CLIENT_VERSION_MAJOR
#define STORAGE_CLIENT_VERSION_MAJOR
Definition: version_info.h:20
google
google::cloud::storage::v1::x_goog_api_client
std::string x_goog_api_client()
Returns the value for x-goog-api-client header.
Definition: version.cc:25