Google Cloud Bigtable C++ Client  2.4.0
A C++ Client Library for Google Cloud Bigtable
bigtable_table_admin_connection.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/bigtable/admin/v2/bigtable_table_admin.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_TABLE_ADMIN_CONNECTION_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_TABLE_ADMIN_CONNECTION_H
21 
22 #include "google/cloud/bigtable/admin/bigtable_table_admin_connection_idempotency_policy.h"
23 #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_retry_traits.h"
24 #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h"
25 #include "google/cloud/backoff_policy.h"
26 #include "google/cloud/future.h"
27 #include "google/cloud/options.h"
28 #include "google/cloud/polling_policy.h"
29 #include "google/cloud/status_or.h"
30 #include "google/cloud/stream_range.h"
31 #include "google/cloud/version.h"
32 #include <google/longrunning/operations.grpc.pb.h>
33 #include <memory>
34 
35 namespace google {
36 namespace cloud {
37 namespace bigtable_admin {
39 
40 using BigtableTableAdminRetryPolicy =
41  ::google::cloud::internal::TraitBasedRetryPolicy<
42  bigtable_admin_internal::BigtableTableAdminRetryTraits>;
43 
44 using BigtableTableAdminLimitedTimeRetryPolicy =
45  ::google::cloud::internal::LimitedTimeRetryPolicy<
46  bigtable_admin_internal::BigtableTableAdminRetryTraits>;
47 
48 using BigtableTableAdminLimitedErrorCountRetryPolicy =
49  ::google::cloud::internal::LimitedErrorCountRetryPolicy<
50  bigtable_admin_internal::BigtableTableAdminRetryTraits>;
51 
52 /**
53  * The `BigtableTableAdminConnection` object for `BigtableTableAdminClient`.
54  *
55  * This interface defines virtual methods for each of the user-facing overload
56  * sets in `BigtableTableAdminClient`. This allows users to inject custom
57  * behavior (e.g., with a Google Mock object) when writing tests that use
58  * objects of type `BigtableTableAdminClient`.
59  *
60  * To create a concrete instance, see `MakeBigtableTableAdminConnection()`.
61  *
62  * For mocking, see `bigtable_admin_mocks::MockBigtableTableAdminConnection`.
63  */
65  public:
67 
68  virtual Options options() { return Options{}; }
69 
70  virtual StatusOr<google::bigtable::admin::v2::Table> CreateTable(
71  google::bigtable::admin::v2::CreateTableRequest const& request);
72 
73  virtual StreamRange<google::bigtable::admin::v2::Table> ListTables(
74  google::bigtable::admin::v2::ListTablesRequest request);
75 
76  virtual StatusOr<google::bigtable::admin::v2::Table> GetTable(
77  google::bigtable::admin::v2::GetTableRequest const& request);
78 
79  virtual future<StatusOr<google::bigtable::admin::v2::Table>> UpdateTable(
80  google::bigtable::admin::v2::UpdateTableRequest const& request);
81 
83  google::bigtable::admin::v2::DeleteTableRequest const& request);
84 
85  virtual future<StatusOr<google::bigtable::admin::v2::Table>> UndeleteTable(
86  google::bigtable::admin::v2::UndeleteTableRequest const& request);
87 
88  virtual StatusOr<google::bigtable::admin::v2::Table> ModifyColumnFamilies(
89  google::bigtable::admin::v2::ModifyColumnFamiliesRequest const& request);
90 
92  google::bigtable::admin::v2::DropRowRangeRequest const& request);
93 
94  virtual StatusOr<
95  google::bigtable::admin::v2::GenerateConsistencyTokenResponse>
97  google::bigtable::admin::v2::GenerateConsistencyTokenRequest const&
98  request);
99 
100  virtual StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>
102  google::bigtable::admin::v2::CheckConsistencyRequest const& request);
103 
104  virtual future<StatusOr<google::bigtable::admin::v2::Backup>> CreateBackup(
105  google::bigtable::admin::v2::CreateBackupRequest const& request);
106 
107  virtual StatusOr<google::bigtable::admin::v2::Backup> GetBackup(
108  google::bigtable::admin::v2::GetBackupRequest const& request);
109 
110  virtual StatusOr<google::bigtable::admin::v2::Backup> UpdateBackup(
111  google::bigtable::admin::v2::UpdateBackupRequest const& request);
112 
114  google::bigtable::admin::v2::DeleteBackupRequest const& request);
115 
116  virtual StreamRange<google::bigtable::admin::v2::Backup> ListBackups(
117  google::bigtable::admin::v2::ListBackupsRequest request);
118 
119  virtual future<StatusOr<google::bigtable::admin::v2::Table>> RestoreTable(
120  google::bigtable::admin::v2::RestoreTableRequest const& request);
121 
122  virtual StatusOr<google::iam::v1::Policy> GetIamPolicy(
123  google::iam::v1::GetIamPolicyRequest const& request);
124 
125  virtual StatusOr<google::iam::v1::Policy> SetIamPolicy(
126  google::iam::v1::SetIamPolicyRequest const& request);
127 
128  virtual StatusOr<google::iam::v1::TestIamPermissionsResponse>
129  TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request);
130 
131  virtual future<
132  StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>>
134  google::bigtable::admin::v2::CheckConsistencyRequest const& request);
135 };
136 
137 /**
138  * A factory function to construct an object of type
139  * `BigtableTableAdminConnection`.
140  *
141  * The returned connection object should not be used directly; instead it
142  * should be passed as an argument to the constructor of
143  * BigtableTableAdminClient.
144  *
145  * The optional @p options argument may be used to configure aspects of the
146  * returned `BigtableTableAdminConnection`. Expected options are any of the
147  * types in the following option lists:
148  *
149  * - `google::cloud::CommonOptionList`
150  * - `google::cloud::GrpcOptionList`
151  * - `google::cloud::UnifiedCredentialsOptionList`
152  * - `google::cloud::bigtable_admin::BigtableTableAdminPolicyOptionList`
153  *
154  * @note Unexpected options will be ignored. To log unexpected options instead,
155  * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
156  *
157  * @param options (optional) Configure the `BigtableTableAdminConnection`
158  * created by this function.
159  */
161  Options options = {});
162 
164 } // namespace bigtable_admin
165 } // namespace cloud
166 } // namespace google
167 
168 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_BIGTABLE_TABLE_ADMIN_CONNECTION_H