Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
database_admin_logging_decorator.cc
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 #include "google/cloud/spanner/admin/internal/database_admin_logging_decorator.h"
20 #include "google/cloud/internal/log_wrapper.h"
21 #include "google/cloud/status_or.h"
22 #include <google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h>
23 #include <memory>
24 
25 namespace google {
26 namespace cloud {
27 namespace spanner_admin_internal {
28 inline namespace GOOGLE_CLOUD_CPP_GENERATED_NS {
29 
31  std::shared_ptr<DatabaseAdminStub> child, TracingOptions tracing_options,
32  std::set<std::string> components)
33  : child_(std::move(child)),
34  tracing_options_(std::move(tracing_options)),
35  components_(std::move(components)) {}
36 
37 StatusOr<google::spanner::admin::database::v1::ListDatabasesResponse>
39  grpc::ClientContext& context,
40  google::spanner::admin::database::v1::ListDatabasesRequest const& request) {
41  return google::cloud::internal::LogWrapper(
42  [this](grpc::ClientContext& context,
43  google::spanner::admin::database::v1::ListDatabasesRequest const&
44  request) { return child_->ListDatabases(context, request); },
45  context, request, __func__, tracing_options_);
46 }
47 
48 future<StatusOr<google::longrunning::Operation>>
51  std::unique_ptr<grpc::ClientContext> context,
52  google::spanner::admin::database::v1::CreateDatabaseRequest const&
53  request) {
54  return google::cloud::internal::LogWrapper(
55  [this](google::cloud::CompletionQueue& cq,
56  std::unique_ptr<grpc::ClientContext> context,
57  google::spanner::admin::database::v1::CreateDatabaseRequest const&
58  request) {
59  return child_->AsyncCreateDatabase(cq, std::move(context), request);
60  },
61  cq, std::move(context), request, __func__, tracing_options_);
62 }
63 
64 StatusOr<google::spanner::admin::database::v1::Database>
66  grpc::ClientContext& context,
67  google::spanner::admin::database::v1::GetDatabaseRequest const& request) {
68  return google::cloud::internal::LogWrapper(
69  [this](grpc::ClientContext& context,
70  google::spanner::admin::database::v1::GetDatabaseRequest const&
71  request) { return child_->GetDatabase(context, request); },
72  context, request, __func__, tracing_options_);
73 }
74 
75 future<StatusOr<google::longrunning::Operation>>
78  std::unique_ptr<grpc::ClientContext> context,
79  google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
80  request) {
81  return google::cloud::internal::LogWrapper(
82  [this](
84  std::unique_ptr<grpc::ClientContext> context,
85  google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
86  request) {
87  return child_->AsyncUpdateDatabaseDdl(cq, std::move(context), request);
88  },
89  cq, std::move(context), request, __func__, tracing_options_);
90 }
91 
93  grpc::ClientContext& context,
94  google::spanner::admin::database::v1::DropDatabaseRequest const& request) {
95  return google::cloud::internal::LogWrapper(
96  [this](grpc::ClientContext& context,
97  google::spanner::admin::database::v1::DropDatabaseRequest const&
98  request) { return child_->DropDatabase(context, request); },
99  context, request, __func__, tracing_options_);
100 }
101 
102 StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
104  grpc::ClientContext& context,
105  google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
106  request) {
107  return google::cloud::internal::LogWrapper(
108  [this](grpc::ClientContext& context,
109  google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
110  request) { return child_->GetDatabaseDdl(context, request); },
111  context, request, __func__, tracing_options_);
112 }
113 
114 StatusOr<google::iam::v1::Policy> DatabaseAdminLogging::SetIamPolicy(
115  grpc::ClientContext& context,
116  google::iam::v1::SetIamPolicyRequest const& request) {
117  return google::cloud::internal::LogWrapper(
118  [this](grpc::ClientContext& context,
119  google::iam::v1::SetIamPolicyRequest const& request) {
120  return child_->SetIamPolicy(context, request);
121  },
122  context, request, __func__, tracing_options_);
123 }
124 
125 StatusOr<google::iam::v1::Policy> DatabaseAdminLogging::GetIamPolicy(
126  grpc::ClientContext& context,
127  google::iam::v1::GetIamPolicyRequest const& request) {
128  return google::cloud::internal::LogWrapper(
129  [this](grpc::ClientContext& context,
130  google::iam::v1::GetIamPolicyRequest const& request) {
131  return child_->GetIamPolicy(context, request);
132  },
133  context, request, __func__, tracing_options_);
134 }
135 
136 StatusOr<google::iam::v1::TestIamPermissionsResponse>
138  grpc::ClientContext& context,
139  google::iam::v1::TestIamPermissionsRequest const& request) {
140  return google::cloud::internal::LogWrapper(
141  [this](grpc::ClientContext& context,
142  google::iam::v1::TestIamPermissionsRequest const& request) {
143  return child_->TestIamPermissions(context, request);
144  },
145  context, request, __func__, tracing_options_);
146 }
147 
148 future<StatusOr<google::longrunning::Operation>>
151  std::unique_ptr<grpc::ClientContext> context,
152  google::spanner::admin::database::v1::CreateBackupRequest const& request) {
153  return google::cloud::internal::LogWrapper(
154  [this](google::cloud::CompletionQueue& cq,
155  std::unique_ptr<grpc::ClientContext> context,
156  google::spanner::admin::database::v1::CreateBackupRequest const&
157  request) {
158  return child_->AsyncCreateBackup(cq, std::move(context), request);
159  },
160  cq, std::move(context), request, __func__, tracing_options_);
161 }
162 
163 StatusOr<google::spanner::admin::database::v1::Backup>
165  grpc::ClientContext& context,
166  google::spanner::admin::database::v1::GetBackupRequest const& request) {
167  return google::cloud::internal::LogWrapper(
168  [this](grpc::ClientContext& context,
169  google::spanner::admin::database::v1::GetBackupRequest const&
170  request) { return child_->GetBackup(context, request); },
171  context, request, __func__, tracing_options_);
172 }
173 
174 StatusOr<google::spanner::admin::database::v1::Backup>
176  grpc::ClientContext& context,
177  google::spanner::admin::database::v1::UpdateBackupRequest const& request) {
178  return google::cloud::internal::LogWrapper(
179  [this](grpc::ClientContext& context,
180  google::spanner::admin::database::v1::UpdateBackupRequest const&
181  request) { return child_->UpdateBackup(context, request); },
182  context, request, __func__, tracing_options_);
183 }
184 
186  grpc::ClientContext& context,
187  google::spanner::admin::database::v1::DeleteBackupRequest const& request) {
188  return google::cloud::internal::LogWrapper(
189  [this](grpc::ClientContext& context,
190  google::spanner::admin::database::v1::DeleteBackupRequest const&
191  request) { return child_->DeleteBackup(context, request); },
192  context, request, __func__, tracing_options_);
193 }
194 
195 StatusOr<google::spanner::admin::database::v1::ListBackupsResponse>
197  grpc::ClientContext& context,
198  google::spanner::admin::database::v1::ListBackupsRequest const& request) {
199  return google::cloud::internal::LogWrapper(
200  [this](grpc::ClientContext& context,
201  google::spanner::admin::database::v1::ListBackupsRequest const&
202  request) { return child_->ListBackups(context, request); },
203  context, request, __func__, tracing_options_);
204 }
205 
206 future<StatusOr<google::longrunning::Operation>>
209  std::unique_ptr<grpc::ClientContext> context,
210  google::spanner::admin::database::v1::RestoreDatabaseRequest const&
211  request) {
212  return google::cloud::internal::LogWrapper(
213  [this](google::cloud::CompletionQueue& cq,
214  std::unique_ptr<grpc::ClientContext> context,
215  google::spanner::admin::database::v1::RestoreDatabaseRequest const&
216  request) {
217  return child_->AsyncRestoreDatabase(cq, std::move(context), request);
218  },
219  cq, std::move(context), request, __func__, tracing_options_);
220 }
221 
222 StatusOr<google::spanner::admin::database::v1::ListDatabaseOperationsResponse>
224  grpc::ClientContext& context,
225  google::spanner::admin::database::v1::ListDatabaseOperationsRequest const&
226  request) {
227  return google::cloud::internal::LogWrapper(
228  [this](grpc::ClientContext& context,
229  google::spanner::admin::database::v1::
230  ListDatabaseOperationsRequest const& request) {
231  return child_->ListDatabaseOperations(context, request);
232  },
233  context, request, __func__, tracing_options_);
234 }
235 
236 StatusOr<google::spanner::admin::database::v1::ListBackupOperationsResponse>
238  grpc::ClientContext& context,
239  google::spanner::admin::database::v1::ListBackupOperationsRequest const&
240  request) {
241  return google::cloud::internal::LogWrapper(
242  [this](grpc::ClientContext& context,
243  google::spanner::admin::database::v1::
244  ListBackupOperationsRequest const& request) {
245  return child_->ListBackupOperations(context, request);
246  },
247  context, request, __func__, tracing_options_);
248 }
249 
250 future<StatusOr<google::longrunning::Operation>>
253  std::unique_ptr<grpc::ClientContext> context,
254  google::longrunning::GetOperationRequest const& request) {
255  return google::cloud::internal::LogWrapper(
256  [this](google::cloud::CompletionQueue& cq,
257  std::unique_ptr<grpc::ClientContext> context,
258  google::longrunning::GetOperationRequest const& request) {
259  return child_->AsyncGetOperation(cq, std::move(context), request);
260  },
261  cq, std::move(context), request, __func__, tracing_options_);
262 }
263 
266  std::unique_ptr<grpc::ClientContext> context,
267  google::longrunning::CancelOperationRequest const& request) {
268  return google::cloud::internal::LogWrapper(
269  [this](google::cloud::CompletionQueue& cq,
270  std::unique_ptr<grpc::ClientContext> context,
271  google::longrunning::CancelOperationRequest const& request) {
272  return child_->AsyncCancelOperation(cq, std::move(context), request);
273  },
274  cq, std::move(context), request, __func__, tracing_options_);
275 }
276 
277 } // namespace GOOGLE_CLOUD_CPP_GENERATED_NS
278 } // namespace spanner_admin_internal
279 } // namespace cloud
280 } // namespace google