Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
database_admin_stub.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 // 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/database/v1/spanner_database_admin.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_STUB_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_STUB_H
21 
22 #include "google/cloud/completion_queue.h"
23 #include "google/cloud/future.h"
24 #include "google/cloud/status_or.h"
25 #include "google/cloud/version.h"
26 #include <google/longrunning/operations.grpc.pb.h>
27 #include <google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h>
28 #include <memory>
29 
30 namespace google {
31 namespace cloud {
32 namespace spanner_admin_internal {
33 inline namespace GOOGLE_CLOUD_CPP_GENERATED_NS {
34 
36  public:
37  virtual ~DatabaseAdminStub() = 0;
38 
39  virtual StatusOr<google::spanner::admin::database::v1::ListDatabasesResponse>
41  grpc::ClientContext& context,
42  google::spanner::admin::database::v1::ListDatabasesRequest const&
43  request) = 0;
44 
45  virtual future<StatusOr<google::longrunning::Operation>> AsyncCreateDatabase(
47  std::unique_ptr<grpc::ClientContext> context,
48  google::spanner::admin::database::v1::CreateDatabaseRequest const&
49  request) = 0;
50 
51  virtual StatusOr<google::spanner::admin::database::v1::Database> GetDatabase(
52  grpc::ClientContext& context,
53  google::spanner::admin::database::v1::GetDatabaseRequest const&
54  request) = 0;
55 
56  virtual future<StatusOr<google::longrunning::Operation>>
59  std::unique_ptr<grpc::ClientContext> context,
60  google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
61  request) = 0;
62 
64  grpc::ClientContext& context,
65  google::spanner::admin::database::v1::DropDatabaseRequest const&
66  request) = 0;
67 
68  virtual StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
70  grpc::ClientContext& context,
71  google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
72  request) = 0;
73 
74  virtual StatusOr<google::iam::v1::Policy> SetIamPolicy(
75  grpc::ClientContext& context,
76  google::iam::v1::SetIamPolicyRequest const& request) = 0;
77 
78  virtual StatusOr<google::iam::v1::Policy> GetIamPolicy(
79  grpc::ClientContext& context,
80  google::iam::v1::GetIamPolicyRequest const& request) = 0;
81 
82  virtual StatusOr<google::iam::v1::TestIamPermissionsResponse>
84  grpc::ClientContext& context,
85  google::iam::v1::TestIamPermissionsRequest const& request) = 0;
86 
87  virtual future<StatusOr<google::longrunning::Operation>> AsyncCreateBackup(
89  std::unique_ptr<grpc::ClientContext> context,
90  google::spanner::admin::database::v1::CreateBackupRequest const&
91  request) = 0;
92 
93  virtual StatusOr<google::spanner::admin::database::v1::Backup> GetBackup(
94  grpc::ClientContext& context,
95  google::spanner::admin::database::v1::GetBackupRequest const&
96  request) = 0;
97 
98  virtual StatusOr<google::spanner::admin::database::v1::Backup> UpdateBackup(
99  grpc::ClientContext& context,
100  google::spanner::admin::database::v1::UpdateBackupRequest const&
101  request) = 0;
102 
104  grpc::ClientContext& context,
105  google::spanner::admin::database::v1::DeleteBackupRequest const&
106  request) = 0;
107 
108  virtual StatusOr<google::spanner::admin::database::v1::ListBackupsResponse>
109  ListBackups(grpc::ClientContext& context,
110  google::spanner::admin::database::v1::ListBackupsRequest const&
111  request) = 0;
112 
113  virtual future<StatusOr<google::longrunning::Operation>> AsyncRestoreDatabase(
115  std::unique_ptr<grpc::ClientContext> context,
116  google::spanner::admin::database::v1::RestoreDatabaseRequest const&
117  request) = 0;
118 
119  virtual StatusOr<
120  google::spanner::admin::database::v1::ListDatabaseOperationsResponse>
122  grpc::ClientContext& context,
123  google::spanner::admin::database::v1::ListDatabaseOperationsRequest const&
124  request) = 0;
125 
126  virtual StatusOr<
127  google::spanner::admin::database::v1::ListBackupOperationsResponse>
129  grpc::ClientContext& context,
130  google::spanner::admin::database::v1::ListBackupOperationsRequest const&
131  request) = 0;
132 
133  virtual future<StatusOr<google::longrunning::Operation>> AsyncGetOperation(
135  std::unique_ptr<grpc::ClientContext> context,
136  google::longrunning::GetOperationRequest const& request) = 0;
137 
140  std::unique_ptr<grpc::ClientContext> context,
141  google::longrunning::CancelOperationRequest const& request) = 0;
142 };
143 
145  public:
147  std::unique_ptr<
148  google::spanner::admin::database::v1::DatabaseAdmin::StubInterface>
149  grpc_stub,
150  std::unique_ptr<google::longrunning::Operations::StubInterface>
151  operations)
152  : grpc_stub_(std::move(grpc_stub)), operations_(std::move(operations)) {}
153 
154  StatusOr<google::spanner::admin::database::v1::ListDatabasesResponse>
156  grpc::ClientContext& client_context,
157  google::spanner::admin::database::v1::ListDatabasesRequest const& request)
158  override;
159 
160  future<StatusOr<google::longrunning::Operation>> AsyncCreateDatabase(
162  std::unique_ptr<grpc::ClientContext> context,
163  google::spanner::admin::database::v1::CreateDatabaseRequest const&
164  request) override;
165 
166  StatusOr<google::spanner::admin::database::v1::Database> GetDatabase(
167  grpc::ClientContext& client_context,
168  google::spanner::admin::database::v1::GetDatabaseRequest const& request)
169  override;
170 
171  future<StatusOr<google::longrunning::Operation>> AsyncUpdateDatabaseDdl(
173  std::unique_ptr<grpc::ClientContext> context,
174  google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
175  request) override;
176 
178  grpc::ClientContext& client_context,
179  google::spanner::admin::database::v1::DropDatabaseRequest const& request)
180  override;
181 
182  StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
184  grpc::ClientContext& client_context,
185  google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
186  request) override;
187 
188  StatusOr<google::iam::v1::Policy> SetIamPolicy(
189  grpc::ClientContext& client_context,
190  google::iam::v1::SetIamPolicyRequest const& request) override;
191 
192  StatusOr<google::iam::v1::Policy> GetIamPolicy(
193  grpc::ClientContext& client_context,
194  google::iam::v1::GetIamPolicyRequest const& request) override;
195 
196  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
197  grpc::ClientContext& client_context,
198  google::iam::v1::TestIamPermissionsRequest const& request) override;
199 
200  future<StatusOr<google::longrunning::Operation>> AsyncCreateBackup(
202  std::unique_ptr<grpc::ClientContext> context,
203  google::spanner::admin::database::v1::CreateBackupRequest const& request)
204  override;
205 
206  StatusOr<google::spanner::admin::database::v1::Backup> GetBackup(
207  grpc::ClientContext& client_context,
208  google::spanner::admin::database::v1::GetBackupRequest const& request)
209  override;
210 
211  StatusOr<google::spanner::admin::database::v1::Backup> UpdateBackup(
212  grpc::ClientContext& client_context,
213  google::spanner::admin::database::v1::UpdateBackupRequest const& request)
214  override;
215 
217  grpc::ClientContext& client_context,
218  google::spanner::admin::database::v1::DeleteBackupRequest const& request)
219  override;
220 
221  StatusOr<google::spanner::admin::database::v1::ListBackupsResponse>
222  ListBackups(grpc::ClientContext& client_context,
223  google::spanner::admin::database::v1::ListBackupsRequest const&
224  request) override;
225 
226  future<StatusOr<google::longrunning::Operation>> AsyncRestoreDatabase(
228  std::unique_ptr<grpc::ClientContext> context,
229  google::spanner::admin::database::v1::RestoreDatabaseRequest const&
230  request) override;
231 
232  StatusOr<google::spanner::admin::database::v1::ListDatabaseOperationsResponse>
234  grpc::ClientContext& client_context,
235  google::spanner::admin::database::v1::ListDatabaseOperationsRequest const&
236  request) override;
237 
238  StatusOr<google::spanner::admin::database::v1::ListBackupOperationsResponse>
240  grpc::ClientContext& client_context,
241  google::spanner::admin::database::v1::ListBackupOperationsRequest const&
242  request) override;
243 
244  future<StatusOr<google::longrunning::Operation>> AsyncGetOperation(
246  std::unique_ptr<grpc::ClientContext> context,
247  google::longrunning::GetOperationRequest const& request) override;
248 
251  std::unique_ptr<grpc::ClientContext> context,
252  google::longrunning::CancelOperationRequest const& request) override;
253 
254  private:
255  std::unique_ptr<
256  google::spanner::admin::database::v1::DatabaseAdmin::StubInterface>
257  grpc_stub_;
258  std::unique_ptr<google::longrunning::Operations::StubInterface> operations_;
259 };
260 
261 } // namespace GOOGLE_CLOUD_CPP_GENERATED_NS
262 } // namespace spanner_admin_internal
263 } // namespace cloud
264 } // namespace google
265 
266 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_STUB_H