Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
user_ip_option.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_USER_IP_OPTION_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_USER_IP_OPTION_H
17
18#include "google/cloud/storage/internal/complex_option.h"
19#include "google/cloud/version.h"
20#include <string>
21
22namespace google {
23namespace cloud {
24namespace storage {
25GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
26
27/**
28 * Sets the user IP on an operation for quota enforcement purposes.
29 *
30 * This parameter lets you enforce per-user quotas when calling the API from a
31 * server-side application.
32 *
33 * @note The recommended practice is to use `QuotaUser`. This parameter is
34 * overridden by `QuotaUser` if both are set.
35 *
36 * If you set this parameter to an empty string, the client library will
37 * automatically select one of the user IP addresses of your server to include
38 * in the request.
39 *
40 * @see https://cloud.google.com/apis/docs/capping-api-usage for an introduction
41 * to quotas in Google Cloud Platform.
42 */
43struct UserIp : public internal::ComplexOption<UserIp, std::string> {
44 using ComplexOption<UserIp, std::string>::ComplexOption;
45 static char const* name() { return "userIp"; }
46};
47
48GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
49} // namespace storage
50} // namespace cloud
51} // namespace google
52
53#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_USER_IP_OPTION_H
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
Sets the user IP on an operation for quota enforcement purposes.
Definition: user_ip_option.h:43
static char const * name()
Definition: user_ip_option.h:45