Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
instance_admin_connection.h
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// 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/spanner/admin/instance/v1/spanner_instance_admin.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CONNECTION_H
21
22#include "google/cloud/spanner/admin/instance_admin_connection_idempotency_policy.h"
23#include "google/cloud/spanner/admin/internal/instance_admin_retry_traits.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/future.h"
26#include "google/cloud/options.h"
27#include "google/cloud/polling_policy.h"
28#include "google/cloud/status_or.h"
29#include "google/cloud/stream_range.h"
30#include "google/cloud/version.h"
31#include <google/longrunning/operations.grpc.pb.h>
32#include <google/spanner/admin/instance/v1/spanner_instance_admin.pb.h>
33#include <memory>
34
35namespace google {
36namespace cloud {
37namespace spanner_admin {
38GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
39
40using InstanceAdminRetryPolicy =
41 ::google::cloud::internal::TraitBasedRetryPolicy<
42 spanner_admin_internal::InstanceAdminRetryTraits>;
43
44using InstanceAdminLimitedTimeRetryPolicy =
45 ::google::cloud::internal::LimitedTimeRetryPolicy<
46 spanner_admin_internal::InstanceAdminRetryTraits>;
47
48using InstanceAdminLimitedErrorCountRetryPolicy =
49 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
50 spanner_admin_internal::InstanceAdminRetryTraits>;
51
52/**
53 * The `InstanceAdminConnection` object for `InstanceAdminClient`.
54 *
55 * This interface defines virtual methods for each of the user-facing overload
56 * sets in `InstanceAdminClient`. This allows users to inject custom behavior
57 * (e.g., with a Google Mock object) when writing tests that use objects of type
58 * `InstanceAdminClient`.
59 *
60 * To create a concrete instance, see `MakeInstanceAdminConnection()`.
61 *
62 * For mocking, see `spanner_admin_mocks::MockInstanceAdminConnection`.
63 */
65 public:
66 virtual ~InstanceAdminConnection() = 0;
67
68 virtual Options options() { return Options{}; }
69
70 virtual StreamRange<google::spanner::admin::instance::v1::InstanceConfig>
72 google::spanner::admin::instance::v1::ListInstanceConfigsRequest request);
73
74 virtual StatusOr<google::spanner::admin::instance::v1::InstanceConfig>
76 google::spanner::admin::instance::v1::GetInstanceConfigRequest const&
77 request);
78
79 virtual future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
81 google::spanner::admin::instance::v1::CreateInstanceConfigRequest const&
82 request);
83
84 virtual future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
86 google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const&
87 request);
88
90 google::spanner::admin::instance::v1::DeleteInstanceConfigRequest const&
91 request);
92
93 virtual StreamRange<google::longrunning::Operation>
95 google::spanner::admin::instance::v1::ListInstanceConfigOperationsRequest
96 request);
97
98 virtual StreamRange<google::spanner::admin::instance::v1::Instance>
100 google::spanner::admin::instance::v1::ListInstancesRequest request);
101
102 virtual StatusOr<google::spanner::admin::instance::v1::Instance> GetInstance(
103 google::spanner::admin::instance::v1::GetInstanceRequest const& request);
104
105 virtual future<StatusOr<google::spanner::admin::instance::v1::Instance>>
107 google::spanner::admin::instance::v1::CreateInstanceRequest const&
108 request);
109
110 virtual future<StatusOr<google::spanner::admin::instance::v1::Instance>>
112 google::spanner::admin::instance::v1::UpdateInstanceRequest const&
113 request);
114
115 virtual Status DeleteInstance(
116 google::spanner::admin::instance::v1::DeleteInstanceRequest const&
117 request);
118
119 virtual StatusOr<google::iam::v1::Policy> SetIamPolicy(
120 google::iam::v1::SetIamPolicyRequest const& request);
121
122 virtual StatusOr<google::iam::v1::Policy> GetIamPolicy(
123 google::iam::v1::GetIamPolicyRequest const& request);
124
125 virtual StatusOr<google::iam::v1::TestIamPermissionsResponse>
126 TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request);
127};
128
129/**
130 * A factory function to construct an object of type `InstanceAdminConnection`.
131 *
132 * The returned connection object should not be used directly; instead it
133 * should be passed as an argument to the constructor of InstanceAdminClient.
134 *
135 * The optional @p options argument may be used to configure aspects of the
136 * returned `InstanceAdminConnection`. Expected options are any of the types in
137 * the following option lists:
138 *
139 * - `google::cloud::CommonOptionList`
140 * - `google::cloud::GrpcOptionList`
141 * - `google::cloud::UnifiedCredentialsOptionList`
142 * - `google::cloud::spanner_admin::InstanceAdminPolicyOptionList`
143 *
144 * @note Unexpected options will be ignored. To log unexpected options instead,
145 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
146 *
147 * @param options (optional) Configure the `InstanceAdminConnection` created by
148 * this function.
149 */
151 Options options = {});
152
153GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
154namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
155} // namespace spanner_admin
156} // namespace cloud
157} // namespace google
158
159#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CONNECTION_H
friend friend class future
The InstanceAdminConnection object for InstanceAdminClient.
Definition: instance_admin_connection.h:64
virtual future< StatusOr< google::spanner::admin::instance::v1::Instance > > CreateInstance(google::spanner::admin::instance::v1::CreateInstanceRequest const &request)
virtual StreamRange< google::longrunning::Operation > ListInstanceConfigOperations(google::spanner::admin::instance::v1::ListInstanceConfigOperationsRequest request)
virtual StreamRange< google::spanner::admin::instance::v1::InstanceConfig > ListInstanceConfigs(google::spanner::admin::instance::v1::ListInstanceConfigsRequest request)
virtual Options options()
Definition: instance_admin_connection.h:68
virtual StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request)
virtual StatusOr< google::spanner::admin::instance::v1::Instance > GetInstance(google::spanner::admin::instance::v1::GetInstanceRequest const &request)
virtual StatusOr< google::spanner::admin::instance::v1::InstanceConfig > GetInstanceConfig(google::spanner::admin::instance::v1::GetInstanceConfigRequest const &request)
virtual future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > > CreateInstanceConfig(google::spanner::admin::instance::v1::CreateInstanceConfigRequest const &request)
virtual future< StatusOr< google::spanner::admin::instance::v1::Instance > > UpdateInstance(google::spanner::admin::instance::v1::UpdateInstanceRequest const &request)
virtual StreamRange< google::spanner::admin::instance::v1::Instance > ListInstances(google::spanner::admin::instance::v1::ListInstancesRequest request)
virtual future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > > UpdateInstanceConfig(google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const &request)
virtual StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request)
virtual Status DeleteInstanceConfig(google::spanner::admin::instance::v1::DeleteInstanceConfigRequest const &request)
virtual Status DeleteInstance(google::spanner::admin::instance::v1::DeleteInstanceRequest const &request)
virtual StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request)
Definition: database_admin_client.h:34
std::shared_ptr< InstanceAdminConnection > MakeInstanceAdminConnection(Options options={})
A factory function to construct an object of type InstanceAdminConnection.