19 #include "google/cloud/spanner/admin/internal/instance_admin_stub.h"
20 #include "google/cloud/grpc_error_delegate.h"
21 #include "google/cloud/status_or.h"
22 #include <google/longrunning/operations.grpc.pb.h>
23 #include <google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h>
33 StatusOr<
google::spanner::admin::instance::v1::ListInstanceConfigsResponse>
35 grpc::ClientContext& client_context,
36 google::spanner::admin::instance::v1::ListInstanceConfigsRequest
const&
38 google::spanner::admin::instance::v1::ListInstanceConfigsResponse response;
40 grpc_stub_->ListInstanceConfigs(&client_context, request, &response);
47 StatusOr<
google::spanner::admin::instance::v1::InstanceConfig>
49 grpc::ClientContext& client_context,
50 google::spanner::admin::instance::v1::GetInstanceConfigRequest
const&
52 google::spanner::admin::instance::v1::InstanceConfig response;
54 grpc_stub_->GetInstanceConfig(&client_context, request, &response);
61 StatusOr<
google::spanner::admin::instance::v1::ListInstancesResponse>
63 grpc::ClientContext& client_context,
64 google::spanner::admin::instance::v1::ListInstancesRequest
const& request) {
65 google::spanner::admin::instance::v1::ListInstancesResponse response;
66 auto status = grpc_stub_->ListInstances(&client_context, request, &response);
73 StatusOr<
google::spanner::admin::instance::v1::Instance>
75 grpc::ClientContext& client_context,
76 google::spanner::admin::instance::v1::GetInstanceRequest
const& request) {
77 google::spanner::admin::instance::v1::Instance response;
78 auto status = grpc_stub_->GetInstance(&client_context, request, &response);
88 std::unique_ptr<grpc::ClientContext> context,
89 google::spanner::admin::instance::v1::CreateInstanceRequest
const&
92 [
this](grpc::ClientContext* context,
93 google::spanner::admin::instance::v1::CreateInstanceRequest
const&
95 grpc::CompletionQueue* cq) {
96 return grpc_stub_->AsyncCreateInstance(context, request, cq);
98 request
, std::move(context)
);
104 std::unique_ptr<grpc::ClientContext> context,
105 google::spanner::admin::instance::v1::UpdateInstanceRequest
const&
108 [
this](grpc::ClientContext* context,
109 google::spanner::admin::instance::v1::UpdateInstanceRequest
const&
111 grpc::CompletionQueue* cq) {
112 return grpc_stub_->AsyncUpdateInstance(context, request, cq);
114 request
, std::move(context)
);
118 grpc::ClientContext& client_context,
119 google::spanner::admin::instance::v1::DeleteInstanceRequest
const&
121 google::protobuf::Empty response;
122 auto status = grpc_stub_->DeleteInstance(&client_context, request, &response);
130 grpc::ClientContext& client_context,
131 google::iam::v1::SetIamPolicyRequest
const& request) {
132 google::iam::v1::Policy response;
133 auto status = grpc_stub_->SetIamPolicy(&client_context, request, &response);
141 grpc::ClientContext& client_context,
142 google::iam::v1::GetIamPolicyRequest
const& request) {
143 google::iam::v1::Policy response;
144 auto status = grpc_stub_->GetIamPolicy(&client_context, request, &response);
151 StatusOr<
google::iam::v1::TestIamPermissionsResponse>
153 grpc::ClientContext& client_context,
154 google::iam::v1::TestIamPermissionsRequest
const& request) {
155 google::iam::v1::TestIamPermissionsResponse response;
157 grpc_stub_->TestIamPermissions(&client_context, request, &response);
167 std::unique_ptr<grpc::ClientContext> context,
168 google::longrunning::GetOperationRequest
const& request) {
170 [
this](grpc::ClientContext* context,
171 google::longrunning::GetOperationRequest
const& request,
172 grpc::CompletionQueue* cq) {
173 return operations_->AsyncGetOperation(context, request, cq);
175 request
, std::move(context)
);
180 std::unique_ptr<grpc::ClientContext> context,
181 google::longrunning::CancelOperationRequest
const& request) {
184 [
this](grpc::ClientContext* context,
185 google::longrunning::CancelOperationRequest
const& request,
186 grpc::CompletionQueue* cq) {
187 return operations_->AsyncCancelOperation(context, request, cq);
189 request
, std::move(context)
)