Resource Settings API C++ Client 2.13.0
A C++ Client Library for the Resource Settings API
Loading...
Searching...
No Matches
resource_settings_connection.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// Generated by the Codegen C++ plugin.
16// If you make any local changes, they will be lost.
17// source: google/cloud/resourcesettings/v1/resource_settings.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCESETTINGS_V1_RESOURCE_SETTINGS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCESETTINGS_V1_RESOURCE_SETTINGS_CONNECTION_H
21
22#include "google/cloud/resourcesettings/v1/internal/resource_settings_retry_traits.h"
23#include "google/cloud/resourcesettings/v1/resource_settings_connection_idempotency_policy.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/options.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/stream_range.h"
28#include "google/cloud/version.h"
29#include <google/cloud/resourcesettings/v1/resource_settings.pb.h>
30#include <memory>
31
32namespace google {
33namespace cloud {
34namespace resourcesettings_v1 {
35GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
36
37using ResourceSettingsServiceRetryPolicy =
38 ::google::cloud::internal::TraitBasedRetryPolicy<
39 resourcesettings_v1_internal::ResourceSettingsServiceRetryTraits>;
40
41using ResourceSettingsServiceLimitedTimeRetryPolicy =
42 ::google::cloud::internal::LimitedTimeRetryPolicy<
43 resourcesettings_v1_internal::ResourceSettingsServiceRetryTraits>;
44
45using ResourceSettingsServiceLimitedErrorCountRetryPolicy =
46 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47 resourcesettings_v1_internal::ResourceSettingsServiceRetryTraits>;
48
49/**
50 * The `ResourceSettingsServiceConnection` object for
51 * `ResourceSettingsServiceClient`.
52 *
53 * This interface defines virtual methods for each of the user-facing overload
54 * sets in `ResourceSettingsServiceClient`. This allows users to inject custom
55 * behavior (e.g., with a Google Mock object) when writing tests that use
56 * objects of type `ResourceSettingsServiceClient`.
57 *
58 * To create a concrete instance, see `MakeResourceSettingsServiceConnection()`.
59 *
60 * For mocking, see
61 * `resourcesettings_v1_mocks::MockResourceSettingsServiceConnection`.
62 */
64 public:
66
67 virtual Options options() { return Options{}; }
68
69 virtual StreamRange<google::cloud::resourcesettings::v1::Setting>
71 google::cloud::resourcesettings::v1::ListSettingsRequest request);
72
73 virtual StatusOr<google::cloud::resourcesettings::v1::Setting> GetSetting(
74 google::cloud::resourcesettings::v1::GetSettingRequest const& request);
75
76 virtual StatusOr<google::cloud::resourcesettings::v1::Setting> UpdateSetting(
77 google::cloud::resourcesettings::v1::UpdateSettingRequest const& request);
78};
79
80/**
81 * A factory function to construct an object of type
82 * `ResourceSettingsServiceConnection`.
83 *
84 * The returned connection object should not be used directly; instead it
85 * should be passed as an argument to the constructor of
86 * ResourceSettingsServiceClient.
87 *
88 * The optional @p options argument may be used to configure aspects of the
89 * returned `ResourceSettingsServiceConnection`. Expected options are any of the
90 * types in the following option lists:
91 *
92 * - `google::cloud::CommonOptionList`
93 * - `google::cloud::GrpcOptionList`
94 * - `google::cloud::UnifiedCredentialsOptionList`
95 * -
96 * `google::cloud::resourcesettings_v1::ResourceSettingsServicePolicyOptionList`
97 *
98 * @note Unexpected options will be ignored. To log unexpected options instead,
99 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
100 *
101 * @param options (optional) Configure the `ResourceSettingsServiceConnection`
102 * created by this function.
103 */
106
107GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
108} // namespace resourcesettings_v1
109} // namespace cloud
110} // namespace google
111
112#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCESETTINGS_V1_RESOURCE_SETTINGS_CONNECTION_H
The ResourceSettingsServiceConnection object for ResourceSettingsServiceClient.
Definition: resource_settings_connection.h:63
virtual StatusOr< google::cloud::resourcesettings::v1::Setting > GetSetting(google::cloud::resourcesettings::v1::GetSettingRequest const &request)
virtual Options options()
Definition: resource_settings_connection.h:67
virtual StreamRange< google::cloud::resourcesettings::v1::Setting > ListSettings(google::cloud::resourcesettings::v1::ListSettingsRequest request)
virtual StatusOr< google::cloud::resourcesettings::v1::Setting > UpdateSetting(google::cloud::resourcesettings::v1::UpdateSettingRequest const &request)
Definition: resource_settings_client.h:32
std::shared_ptr< ResourceSettingsServiceConnection > MakeResourceSettingsServiceConnection(Options options={})
A factory function to construct an object of type ResourceSettingsServiceConnection.
Definition: resource_settings_client.h:30