Google Cloud C++ Client  2.7.0
C++ Client Library for Google Cloud Platform
rest_options.h
Go to the documentation of this file.
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_REST_OPTIONS_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REST_OPTIONS_H
17 
18 #include "google/cloud/options.h"
19 #include "google/cloud/tracing_options.h"
20 #include "google/cloud/version.h"
21 #include <chrono>
22 #include <string>
23 
24 namespace google {
25 namespace cloud {
27 
28 /**
29  * Configure the QuotaUser system parameter.
30  *
31  * A pseudo user identifier for charging per-user quotas. If not specified, the
32  * authenticated principal is used. If there is no authenticated principal, the
33  * client IP address will be used. When specified, a valid API key with service
34  * restrictions must be used to identify the quota project. Otherwise, this
35  * parameter is ignored.
36  *
37  * @ingroup rest-options
38  */
40  using Type = std::string;
41 };
42 
43 /**
44  * Configure the UserIp query parameter.
45  *
46  * This can be used to separate quota usage by source IP address.
47  *
48  * @deprecated prefer using `google::cloud::QuotaUser`.
49  * @ingroup rest-options
50  */
51 struct UserIpOption {
52  using Type = std::string;
53 };
54 
55 /**
56  * Timeout for the server to finish processing the request. This system param
57  * only applies to REST APIs for which client-side timeout is not applicable.
58  *
59  * @ingroup rest-options
60  */
62  using Type = std::chrono::milliseconds;
63 };
64 
65 /**
66  * The `TracingOptions` to use when printing REST transport http messages.
67  *
68  * @ingroup options
69  */
71  using Type = TracingOptions;
72 };
73 
74 /// The complete list of options accepted by `CurlRestClient`
75 using RestOptionList =
78 
80 } // namespace cloud
81 } // namespace google
82 
83 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REST_OPTIONS_H