Google Cloud C++ Client  1.32.1
C++ Client Library for Google Cloud Platform
common_options.h
Go to the documentation of this file.
1 // Copyright 2021 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_COMMON_OPTIONS_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMON_OPTIONS_H
17 
18 #include "google/cloud/options.h"
19 #include "google/cloud/version.h"
20 #include <set>
21 #include <string>
22 #include <vector>
23 
24 namespace google {
25 namespace cloud {
26 inline namespace GOOGLE_CLOUD_CPP_NS {
27 
28 /**
29  * Change the endpoint.
30  *
31  * In almost all cases a suitable default will be chosen automatically.
32  * Applications may need to be changed to (1) test against a fake or simulator,
33  * or (2) use a beta or EAP version of the service.
34  */
36  using Type = std::string;
37 };
38 
39 /**
40  * User-agent products to include with each request.
41  *
42  * Libraries or services that use Cloud C++ clients may want to set their own
43  * user-agent product information. This can help them develop telemetry
44  * information about number of users running particular versions of their
45  * system or library.
46  *
47  * @see https://tools.ietf.org/html/rfc7231#section-5.5.3
48  */
50  using Type = std::vector<std::string>;
51 };
52 
53 /**
54  * Return whether tracing is enabled for the given @p component.
55  *
56  * The C++ clients can log interesting events to help library and application
57  * developers troubleshoot problems. To see log messages (maybe lots) you can
58  * enable tracing for the component that interests you. Valid components are
59  * currently:
60  *
61  * - rpc
62  * - rpc-streams
63  */
65  using Type = std::set<std::string>;
66 };
67 
68 /**
69  * A list of all the common options.
70  */
71 using CommonOptionList = OptionList<EndpointOption, UserAgentProductsOption,
73 
74 } // namespace GOOGLE_CLOUD_CPP_NS
75 } // namespace cloud
76 } // namespace google
77 
78 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMON_OPTIONS_H