Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
database_admin_metadata_decorator.h
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/database/v1/spanner_database_admin.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_METADATA_DECORATOR_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_METADATA_DECORATOR_H
21 
22 #include "google/cloud/spanner/admin/internal/database_admin_stub.h"
23 #include "google/cloud/version.h"
24 #include <google/longrunning/operations.grpc.pb.h>
25 #include <memory>
26 #include <string>
27 
28 namespace google {
29 namespace cloud {
30 namespace spanner_admin_internal {
31 inline namespace GOOGLE_CLOUD_CPP_GENERATED_NS {
32 
34  public:
35  ~DatabaseAdminMetadata() override = default;
36  explicit DatabaseAdminMetadata(std::shared_ptr<DatabaseAdminStub> child);
37 
38  StatusOr<google::spanner::admin::database::v1::ListDatabasesResponse>
40  grpc::ClientContext& context,
41  google::spanner::admin::database::v1::ListDatabasesRequest const& request)
42  override;
43 
44  future<StatusOr<google::longrunning::Operation>> AsyncCreateDatabase(
46  std::unique_ptr<grpc::ClientContext> context,
47  google::spanner::admin::database::v1::CreateDatabaseRequest const&
48  request) override;
49 
50  StatusOr<google::spanner::admin::database::v1::Database> GetDatabase(
51  grpc::ClientContext& context,
52  google::spanner::admin::database::v1::GetDatabaseRequest const& request)
53  override;
54 
55  future<StatusOr<google::longrunning::Operation>> AsyncUpdateDatabaseDdl(
57  std::unique_ptr<grpc::ClientContext> context,
58  google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
59  request) override;
60 
62  grpc::ClientContext& context,
63  google::spanner::admin::database::v1::DropDatabaseRequest const& request)
64  override;
65 
66  StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
68  grpc::ClientContext& context,
69  google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
70  request) override;
71 
72  StatusOr<google::iam::v1::Policy> SetIamPolicy(
73  grpc::ClientContext& context,
74  google::iam::v1::SetIamPolicyRequest const& request) override;
75 
76  StatusOr<google::iam::v1::Policy> GetIamPolicy(
77  grpc::ClientContext& context,
78  google::iam::v1::GetIamPolicyRequest const& request) override;
79 
80  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
81  grpc::ClientContext& context,
82  google::iam::v1::TestIamPermissionsRequest const& request) override;
83 
84  future<StatusOr<google::longrunning::Operation>> AsyncCreateBackup(
86  std::unique_ptr<grpc::ClientContext> context,
87  google::spanner::admin::database::v1::CreateBackupRequest const& request)
88  override;
89 
90  StatusOr<google::spanner::admin::database::v1::Backup> GetBackup(
91  grpc::ClientContext& context,
92  google::spanner::admin::database::v1::GetBackupRequest const& request)
93  override;
94 
95  StatusOr<google::spanner::admin::database::v1::Backup> UpdateBackup(
96  grpc::ClientContext& context,
97  google::spanner::admin::database::v1::UpdateBackupRequest const& request)
98  override;
99 
101  grpc::ClientContext& context,
102  google::spanner::admin::database::v1::DeleteBackupRequest const& request)
103  override;
104 
105  StatusOr<google::spanner::admin::database::v1::ListBackupsResponse>
106  ListBackups(grpc::ClientContext& context,
107  google::spanner::admin::database::v1::ListBackupsRequest const&
108  request) override;
109 
110  future<StatusOr<google::longrunning::Operation>> AsyncRestoreDatabase(
112  std::unique_ptr<grpc::ClientContext> context,
113  google::spanner::admin::database::v1::RestoreDatabaseRequest const&
114  request) override;
115 
116  StatusOr<google::spanner::admin::database::v1::ListDatabaseOperationsResponse>
118  grpc::ClientContext& context,
119  google::spanner::admin::database::v1::ListDatabaseOperationsRequest const&
120  request) override;
121 
122  StatusOr<google::spanner::admin::database::v1::ListBackupOperationsResponse>
124  grpc::ClientContext& context,
125  google::spanner::admin::database::v1::ListBackupOperationsRequest const&
126  request) override;
127 
128  future<StatusOr<google::longrunning::Operation>> AsyncGetOperation(
130  std::unique_ptr<grpc::ClientContext> context,
131  google::longrunning::GetOperationRequest const& request) override;
132 
135  std::unique_ptr<grpc::ClientContext> context,
136  google::longrunning::CancelOperationRequest const& request) override;
137 
138  private:
139  void SetMetadata(grpc::ClientContext& context,
140  std::string const& request_params);
141  std::shared_ptr<DatabaseAdminStub> child_;
142  std::string api_client_header_;
143 }; // DatabaseAdminMetadata
144 
145 } // namespace GOOGLE_CLOUD_CPP_GENERATED_NS
146 } // namespace spanner_admin_internal
147 } // namespace cloud
148 } // namespace google
149 
150 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_METADATA_DECORATOR_H