19 #include "google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.h"
20 #include "google/cloud/internal/api_client_header.h"
21 #include "google/cloud/status_or.h"
22 #include <google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h>
32 : child_(std::move(child)),
34 google::
cloud::internal::ApiClientHeader(
"generator")) {}
36 StatusOr<
google::spanner::admin::instance::v1::ListInstanceConfigsResponse>
38 grpc::ClientContext& context,
39 google::spanner::admin::instance::v1::ListInstanceConfigsRequest
const&
41 SetMetadata(context,
"parent=" + request.parent());
45 StatusOr<
google::spanner::admin::instance::v1::InstanceConfig>
47 grpc::ClientContext& context,
48 google::spanner::admin::instance::v1::GetInstanceConfigRequest
const&
50 SetMetadata(context,
"name=" + request.name());
54 StatusOr<
google::spanner::admin::instance::v1::ListInstancesResponse>
56 grpc::ClientContext& context,
57 google::spanner::admin::instance::v1::ListInstancesRequest
const& request) {
58 SetMetadata(context,
"parent=" + request.parent());
62 StatusOr<
google::spanner::admin::instance::v1::Instance>
64 grpc::ClientContext& context,
65 google::spanner::admin::instance::v1::GetInstanceRequest
const& request) {
66 SetMetadata(context,
"name=" + request.name());
73 std::unique_ptr<grpc::ClientContext> context,
74 google::spanner::admin::instance::v1::CreateInstanceRequest
const&
76 SetMetadata(*context,
"parent=" + request.parent());
83 std::unique_ptr<grpc::ClientContext> context,
84 google::spanner::admin::instance::v1::UpdateInstanceRequest
const&
86 SetMetadata(*context,
"instance.name=" + request.instance().name());
91 grpc::ClientContext& context,
92 google::spanner::admin::instance::v1::DeleteInstanceRequest
const&
94 SetMetadata(context,
"name=" + request.name());
99 grpc::ClientContext& context,
100 google::iam::v1::SetIamPolicyRequest
const& request) {
101 SetMetadata(context,
"resource=" + request.resource());
106 grpc::ClientContext& context,
107 google::iam::v1::GetIamPolicyRequest
const& request) {
108 SetMetadata(context,
"resource=" + request.resource());
112 StatusOr<
google::iam::v1::TestIamPermissionsResponse>
114 grpc::ClientContext& context,
115 google::iam::v1::TestIamPermissionsRequest
const& request) {
116 SetMetadata(context,
"resource=" + request.resource());
123 std::unique_ptr<grpc::ClientContext> context,
124 google::longrunning::GetOperationRequest
const& request) {
125 SetMetadata(*context,
"name=" + request.name());
131 std::unique_ptr<grpc::ClientContext> context,
132 google::longrunning::CancelOperationRequest
const& request) {
133 SetMetadata(*context,
"name=" + request.name());
138 std::string
const& request_params) {
139 context.AddMetadata(
"x-goog-request-params", request_params);
140 context.AddMetadata(
"x-goog-api-client", api_client_header_);