19 #include "google/cloud/spanner/admin/internal/instance_admin_auth_decorator.h"
20 #include <google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h>
29 std::shared_ptr<
google::
cloud::internal::GrpcAuthenticationStrategy> auth,
31 : auth_(std::move(auth)), child_(std::move(child)) {}
33 StatusOr<
google::spanner::admin::instance::v1::ListInstanceConfigsResponse>
35 grpc::ClientContext& context,
36 google::spanner::admin::instance::v1::ListInstanceConfigsRequest
const&
38 auto status = auth_->ConfigureContext(context);
39 if (!status
.ok())
return status;
43 StatusOr<
google::spanner::admin::instance::v1::InstanceConfig>
45 grpc::ClientContext& context,
46 google::spanner::admin::instance::v1::GetInstanceConfigRequest
const&
48 auto status = auth_->ConfigureContext(context);
49 if (!status
.ok())
return status;
53 StatusOr<
google::spanner::admin::instance::v1::ListInstancesResponse>
55 grpc::ClientContext& context,
56 google::spanner::admin::instance::v1::ListInstancesRequest
const& request) {
57 auto status = auth_->ConfigureContext(context);
58 if (!status
.ok())
return status;
62 StatusOr<
google::spanner::admin::instance::v1::Instance>
64 grpc::ClientContext& context,
65 google::spanner::admin::instance::v1::GetInstanceRequest
const& request) {
66 auto status = auth_->ConfigureContext(context);
67 if (!status
.ok())
return status;
74 std::unique_ptr<grpc::ClientContext> context,
75 google::spanner::admin::instance::v1::CreateInstanceRequest
const&
77 using ReturnType = StatusOr<
google::longrunning::Operation>;
79 return auth_->AsyncConfigureContext(std::move(context))
81 request](
future<StatusOr<std::unique_ptr<grpc::ClientContext>>>
94 std::unique_ptr<grpc::ClientContext> context,
95 google::spanner::admin::instance::v1::UpdateInstanceRequest
const&
97 using ReturnType = StatusOr<
google::longrunning::Operation>;
99 return auth_->AsyncConfigureContext(std::move(context))
101 request](
future<StatusOr<std::unique_ptr<grpc::ClientContext>>>
112 grpc::ClientContext& context,
113 google::spanner::admin::instance::v1::DeleteInstanceRequest
const&
115 auto status = auth_->ConfigureContext(context);
116 if (!status
.ok())
return status;
121 grpc::ClientContext& context,
122 google::iam::v1::SetIamPolicyRequest
const& request) {
123 auto status = auth_->ConfigureContext(context);
124 if (!status
.ok())
return status;
129 grpc::ClientContext& context,
130 google::iam::v1::GetIamPolicyRequest
const& request) {
131 auto status = auth_->ConfigureContext(context);
132 if (!status
.ok())
return status;
136 StatusOr<
google::iam::v1::TestIamPermissionsResponse>
138 grpc::ClientContext& context,
139 google::iam::v1::TestIamPermissionsRequest
const& request) {
140 auto status = auth_->ConfigureContext(context);
141 if (!status
.ok())
return status;
148 std::unique_ptr<grpc::ClientContext> context,
149 google::longrunning::GetOperationRequest
const& request) {
150 using ReturnType = StatusOr<
google::longrunning::Operation>;
152 return auth_->AsyncConfigureContext(std::move(context))
154 request](
future<StatusOr<std::unique_ptr<grpc::ClientContext>>>
166 std::unique_ptr<grpc::ClientContext> context,
167 google::longrunning::CancelOperationRequest
const& request) {
169 return auth_->AsyncConfigureContext(std::move(context))
171 request](
future<StatusOr<std::unique_ptr<grpc::ClientContext>>>