Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
instance_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/instance/v1/spanner_instance_admin.proto
18 
19 #include "google/cloud/spanner/admin/internal/instance_admin_logging_decorator.h"
20 #include "google/cloud/internal/log_wrapper.h"
21 #include "google/cloud/status_or.h"
22 #include <google/spanner/admin/instance/v1/spanner_instance_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<InstanceAdminStub> 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::instance::v1::ListInstanceConfigsResponse>
39  grpc::ClientContext& context,
40  google::spanner::admin::instance::v1::ListInstanceConfigsRequest const&
41  request) {
42  return google::cloud::internal::LogWrapper(
43  [this](grpc::ClientContext& context,
44  google::spanner::admin::instance::v1::
45  ListInstanceConfigsRequest const& request) {
46  return child_->ListInstanceConfigs(context, request);
47  },
48  context, request, __func__, tracing_options_);
49 }
50 
51 StatusOr<google::spanner::admin::instance::v1::InstanceConfig>
53  grpc::ClientContext& context,
54  google::spanner::admin::instance::v1::GetInstanceConfigRequest const&
55  request) {
56  return google::cloud::internal::LogWrapper(
57  [this](
58  grpc::ClientContext& context,
59  google::spanner::admin::instance::v1::GetInstanceConfigRequest const&
60  request) { return child_->GetInstanceConfig(context, request); },
61  context, request, __func__, tracing_options_);
62 }
63 
64 StatusOr<google::spanner::admin::instance::v1::ListInstancesResponse>
66  grpc::ClientContext& context,
67  google::spanner::admin::instance::v1::ListInstancesRequest const& request) {
68  return google::cloud::internal::LogWrapper(
69  [this](grpc::ClientContext& context,
70  google::spanner::admin::instance::v1::ListInstancesRequest const&
71  request) { return child_->ListInstances(context, request); },
72  context, request, __func__, tracing_options_);
73 }
74 
75 StatusOr<google::spanner::admin::instance::v1::Instance>
77  grpc::ClientContext& context,
78  google::spanner::admin::instance::v1::GetInstanceRequest const& request) {
79  return google::cloud::internal::LogWrapper(
80  [this](grpc::ClientContext& context,
81  google::spanner::admin::instance::v1::GetInstanceRequest const&
82  request) { return child_->GetInstance(context, request); },
83  context, request, __func__, tracing_options_);
84 }
85 
86 future<StatusOr<google::longrunning::Operation>>
89  std::unique_ptr<grpc::ClientContext> context,
90  google::spanner::admin::instance::v1::CreateInstanceRequest const&
91  request) {
92  return google::cloud::internal::LogWrapper(
93  [this](google::cloud::CompletionQueue& cq,
94  std::unique_ptr<grpc::ClientContext> context,
95  google::spanner::admin::instance::v1::CreateInstanceRequest const&
96  request) {
97  return child_->AsyncCreateInstance(cq, std::move(context), request);
98  },
99  cq, std::move(context), request, __func__, tracing_options_);
100 }
101 
102 future<StatusOr<google::longrunning::Operation>>
105  std::unique_ptr<grpc::ClientContext> context,
106  google::spanner::admin::instance::v1::UpdateInstanceRequest const&
107  request) {
108  return google::cloud::internal::LogWrapper(
109  [this](google::cloud::CompletionQueue& cq,
110  std::unique_ptr<grpc::ClientContext> context,
111  google::spanner::admin::instance::v1::UpdateInstanceRequest const&
112  request) {
113  return child_->AsyncUpdateInstance(cq, std::move(context), request);
114  },
115  cq, std::move(context), request, __func__, tracing_options_);
116 }
117 
119  grpc::ClientContext& context,
120  google::spanner::admin::instance::v1::DeleteInstanceRequest const&
121  request) {
122  return google::cloud::internal::LogWrapper(
123  [this](grpc::ClientContext& context,
124  google::spanner::admin::instance::v1::DeleteInstanceRequest const&
125  request) { return child_->DeleteInstance(context, request); },
126  context, request, __func__, tracing_options_);
127 }
128 
129 StatusOr<google::iam::v1::Policy> InstanceAdminLogging::SetIamPolicy(
130  grpc::ClientContext& context,
131  google::iam::v1::SetIamPolicyRequest const& request) {
132  return google::cloud::internal::LogWrapper(
133  [this](grpc::ClientContext& context,
134  google::iam::v1::SetIamPolicyRequest const& request) {
135  return child_->SetIamPolicy(context, request);
136  },
137  context, request, __func__, tracing_options_);
138 }
139 
140 StatusOr<google::iam::v1::Policy> InstanceAdminLogging::GetIamPolicy(
141  grpc::ClientContext& context,
142  google::iam::v1::GetIamPolicyRequest const& request) {
143  return google::cloud::internal::LogWrapper(
144  [this](grpc::ClientContext& context,
145  google::iam::v1::GetIamPolicyRequest const& request) {
146  return child_->GetIamPolicy(context, request);
147  },
148  context, request, __func__, tracing_options_);
149 }
150 
151 StatusOr<google::iam::v1::TestIamPermissionsResponse>
153  grpc::ClientContext& context,
154  google::iam::v1::TestIamPermissionsRequest const& request) {
155  return google::cloud::internal::LogWrapper(
156  [this](grpc::ClientContext& context,
157  google::iam::v1::TestIamPermissionsRequest const& request) {
158  return child_->TestIamPermissions(context, request);
159  },
160  context, request, __func__, tracing_options_);
161 }
162 
163 future<StatusOr<google::longrunning::Operation>>
166  std::unique_ptr<grpc::ClientContext> context,
167  google::longrunning::GetOperationRequest const& request) {
168  return google::cloud::internal::LogWrapper(
169  [this](google::cloud::CompletionQueue& cq,
170  std::unique_ptr<grpc::ClientContext> context,
171  google::longrunning::GetOperationRequest const& request) {
172  return child_->AsyncGetOperation(cq, std::move(context), request);
173  },
174  cq, std::move(context), request, __func__, tracing_options_);
175 }
176 
179  std::unique_ptr<grpc::ClientContext> context,
180  google::longrunning::CancelOperationRequest const& request) {
181  return google::cloud::internal::LogWrapper(
182  [this](google::cloud::CompletionQueue& cq,
183  std::unique_ptr<grpc::ClientContext> context,
184  google::longrunning::CancelOperationRequest const& request) {
185  return child_->AsyncCancelOperation(cq, std::move(context), request);
186  },
187  cq, std::move(context), request, __func__, tracing_options_);
188 }
189 
190 } // namespace GOOGLE_CLOUD_CPP_GENERATED_NS
191 } // namespace spanner_admin_internal
192 } // namespace cloud
193 } // namespace google