19 #include "google/cloud/spanner/admin/internal/database_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/database/v1/spanner_database_admin.grpc.pb.h>
32 : child_(std::move(child)),
34 google::
cloud::internal::ApiClientHeader(
"generator")) {}
36 StatusOr<
google::spanner::admin::database::v1::ListDatabasesResponse>
38 grpc::ClientContext& context,
39 google::spanner::admin::database::v1::ListDatabasesRequest
const& request) {
40 SetMetadata(context,
"parent=" + request.parent());
47 std::unique_ptr<grpc::ClientContext> context,
48 google::spanner::admin::database::v1::CreateDatabaseRequest
const&
50 SetMetadata(*context,
"parent=" + request.parent());
54 StatusOr<
google::spanner::admin::database::v1::Database>
56 grpc::ClientContext& context,
57 google::spanner::admin::database::v1::GetDatabaseRequest
const& request) {
58 SetMetadata(context,
"name=" + request.name());
65 std::unique_ptr<grpc::ClientContext> context,
66 google::spanner::admin::database::v1::UpdateDatabaseDdlRequest
const&
68 SetMetadata(*context,
"database=" + request.database());
73 grpc::ClientContext& context,
74 google::spanner::admin::database::v1::DropDatabaseRequest
const& request) {
75 SetMetadata(context,
"database=" + request.database());
79 StatusOr<
google::spanner::admin::database::v1::GetDatabaseDdlResponse>
81 grpc::ClientContext& context,
82 google::spanner::admin::database::v1::GetDatabaseDdlRequest
const&
84 SetMetadata(context,
"database=" + request.database());
89 grpc::ClientContext& context,
90 google::iam::v1::SetIamPolicyRequest
const& request) {
91 SetMetadata(context,
"resource=" + request.resource());
96 grpc::ClientContext& context,
97 google::iam::v1::GetIamPolicyRequest
const& request) {
98 SetMetadata(context,
"resource=" + request.resource());
102 StatusOr<
google::iam::v1::TestIamPermissionsResponse>
104 grpc::ClientContext& context,
105 google::iam::v1::TestIamPermissionsRequest
const& request) {
106 SetMetadata(context,
"resource=" + request.resource());
113 std::unique_ptr<grpc::ClientContext> context,
114 google::spanner::admin::database::v1::CreateBackupRequest
const& request) {
115 SetMetadata(*context,
"parent=" + request.parent());
119 StatusOr<
google::spanner::admin::database::v1::Backup>
121 grpc::ClientContext& context,
122 google::spanner::admin::database::v1::GetBackupRequest
const& request) {
123 SetMetadata(context,
"name=" + request.name());
127 StatusOr<
google::spanner::admin::database::v1::Backup>
129 grpc::ClientContext& context,
130 google::spanner::admin::database::v1::UpdateBackupRequest
const& request) {
131 SetMetadata(context,
"backup.name=" + request.backup().name());
136 grpc::ClientContext& context,
137 google::spanner::admin::database::v1::DeleteBackupRequest
const& request) {
138 SetMetadata(context,
"name=" + request.name());
142 StatusOr<
google::spanner::admin::database::v1::ListBackupsResponse>
144 grpc::ClientContext& context,
145 google::spanner::admin::database::v1::ListBackupsRequest
const& request) {
146 SetMetadata(context,
"parent=" + request.parent());
153 std::unique_ptr<grpc::ClientContext> context,
154 google::spanner::admin::database::v1::RestoreDatabaseRequest
const&
156 SetMetadata(*context,
"parent=" + request.parent());
160 StatusOr<
google::spanner::admin::database::v1::ListDatabaseOperationsResponse>
162 grpc::ClientContext& context,
163 google::spanner::admin::database::v1::ListDatabaseOperationsRequest
const&
165 SetMetadata(context,
"parent=" + request.parent());
169 StatusOr<
google::spanner::admin::database::v1::ListBackupOperationsResponse>
171 grpc::ClientContext& context,
172 google::spanner::admin::database::v1::ListBackupOperationsRequest
const&
174 SetMetadata(context,
"parent=" + request.parent());
181 std::unique_ptr<grpc::ClientContext> context,
182 google::longrunning::GetOperationRequest
const& request) {
183 SetMetadata(*context,
"name=" + request.name());
189 std::unique_ptr<grpc::ClientContext> context,
190 google::longrunning::CancelOperationRequest
const& request) {
191 SetMetadata(*context,
"name=" + request.name());
196 std::string
const& request_params) {
197 context.AddMetadata(
"x-goog-request-params", request_params);
198 context.AddMetadata(
"x-goog-api-client", api_client_header_);