Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
database_admin_connection.h
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_DATABASE_ADMIN_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_DATABASE_ADMIN_CONNECTION_H
21
22#include "google/cloud/spanner/admin/database_admin_connection_idempotency_policy.h"
23#include "google/cloud/spanner/admin/internal/database_admin_retry_traits.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/future.h"
26#include "google/cloud/options.h"
27#include "google/cloud/polling_policy.h"
28#include "google/cloud/status_or.h"
29#include "google/cloud/stream_range.h"
30#include "google/cloud/version.h"
31#include <google/longrunning/operations.grpc.pb.h>
32#include <google/spanner/admin/database/v1/spanner_database_admin.pb.h>
33#include <memory>
34
35namespace google {
36namespace cloud {
37namespace spanner_admin {
38GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
39
40using DatabaseAdminRetryPolicy =
41 ::google::cloud::internal::TraitBasedRetryPolicy<
42 spanner_admin_internal::DatabaseAdminRetryTraits>;
43
44using DatabaseAdminLimitedTimeRetryPolicy =
45 ::google::cloud::internal::LimitedTimeRetryPolicy<
46 spanner_admin_internal::DatabaseAdminRetryTraits>;
47
48using DatabaseAdminLimitedErrorCountRetryPolicy =
49 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
50 spanner_admin_internal::DatabaseAdminRetryTraits>;
51
52/**
53 * The `DatabaseAdminConnection` object for `DatabaseAdminClient`.
54 *
55 * This interface defines virtual methods for each of the user-facing overload
56 * sets in `DatabaseAdminClient`. This allows users to inject custom behavior
57 * (e.g., with a Google Mock object) when writing tests that use objects of type
58 * `DatabaseAdminClient`.
59 *
60 * To create a concrete instance, see `MakeDatabaseAdminConnection()`.
61 *
62 * For mocking, see `spanner_admin_mocks::MockDatabaseAdminConnection`.
63 */
65 public:
66 virtual ~DatabaseAdminConnection() = 0;
67
68 virtual Options options() { return Options{}; }
69
70 virtual StreamRange<google::spanner::admin::database::v1::Database>
72 google::spanner::admin::database::v1::ListDatabasesRequest request);
73
74 virtual future<StatusOr<google::spanner::admin::database::v1::Database>>
76 google::spanner::admin::database::v1::CreateDatabaseRequest const&
77 request);
78
79 virtual StatusOr<google::spanner::admin::database::v1::Database> GetDatabase(
80 google::spanner::admin::database::v1::GetDatabaseRequest const& request);
81
82 virtual future<StatusOr<google::spanner::admin::database::v1::Database>>
84 google::spanner::admin::database::v1::UpdateDatabaseRequest const&
85 request);
86
87 virtual future<
88 StatusOr<google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
90 google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
91 request);
92
93 virtual Status DropDatabase(
94 google::spanner::admin::database::v1::DropDatabaseRequest const& request);
95
96 virtual StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
98 google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
99 request);
100
101 virtual StatusOr<google::iam::v1::Policy> SetIamPolicy(
102 google::iam::v1::SetIamPolicyRequest const& request);
103
104 virtual StatusOr<google::iam::v1::Policy> GetIamPolicy(
105 google::iam::v1::GetIamPolicyRequest const& request);
106
107 virtual StatusOr<google::iam::v1::TestIamPermissionsResponse>
108 TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request);
109
110 virtual future<StatusOr<google::spanner::admin::database::v1::Backup>>
112 google::spanner::admin::database::v1::CreateBackupRequest const& request);
113
114 virtual future<StatusOr<google::spanner::admin::database::v1::Backup>>
116 google::spanner::admin::database::v1::CopyBackupRequest const& request);
117
118 virtual StatusOr<google::spanner::admin::database::v1::Backup> GetBackup(
119 google::spanner::admin::database::v1::GetBackupRequest const& request);
120
121 virtual StatusOr<google::spanner::admin::database::v1::Backup> UpdateBackup(
122 google::spanner::admin::database::v1::UpdateBackupRequest const& request);
123
124 virtual Status DeleteBackup(
125 google::spanner::admin::database::v1::DeleteBackupRequest const& request);
126
127 virtual StreamRange<google::spanner::admin::database::v1::Backup> ListBackups(
128 google::spanner::admin::database::v1::ListBackupsRequest request);
129
130 virtual future<StatusOr<google::spanner::admin::database::v1::Database>>
132 google::spanner::admin::database::v1::RestoreDatabaseRequest const&
133 request);
134
135 virtual StreamRange<google::longrunning::Operation> ListDatabaseOperations(
136 google::spanner::admin::database::v1::ListDatabaseOperationsRequest
137 request);
138
139 virtual StreamRange<google::longrunning::Operation> ListBackupOperations(
140 google::spanner::admin::database::v1::ListBackupOperationsRequest
141 request);
142
143 virtual StreamRange<google::spanner::admin::database::v1::DatabaseRole>
145 google::spanner::admin::database::v1::ListDatabaseRolesRequest request);
146};
147
148/**
149 * A factory function to construct an object of type `DatabaseAdminConnection`.
150 *
151 * The returned connection object should not be used directly; instead it
152 * should be passed as an argument to the constructor of DatabaseAdminClient.
153 *
154 * The optional @p options argument may be used to configure aspects of the
155 * returned `DatabaseAdminConnection`. Expected options are any of the types in
156 * the following option lists:
157 *
158 * - `google::cloud::CommonOptionList`
159 * - `google::cloud::GrpcOptionList`
160 * - `google::cloud::UnifiedCredentialsOptionList`
161 * - `google::cloud::spanner_admin::DatabaseAdminPolicyOptionList`
162 *
163 * @note Unexpected options will be ignored. To log unexpected options instead,
164 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
165 *
166 * @param options (optional) Configure the `DatabaseAdminConnection` created by
167 * this function.
168 */
170 Options options = {});
171
172GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
173namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
174} // namespace spanner_admin
175} // namespace cloud
176} // namespace google
177
178#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_DATABASE_ADMIN_CONNECTION_H
friend friend class future
The DatabaseAdminConnection object for DatabaseAdminClient.
Definition: database_admin_connection.h:64
virtual StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request)
virtual future< StatusOr< google::spanner::admin::database::v1::Backup > > CopyBackup(google::spanner::admin::database::v1::CopyBackupRequest const &request)
virtual Status DeleteBackup(google::spanner::admin::database::v1::DeleteBackupRequest const &request)
virtual StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl(google::spanner::admin::database::v1::GetDatabaseDdlRequest const &request)
virtual StreamRange< google::longrunning::Operation > ListBackupOperations(google::spanner::admin::database::v1::ListBackupOperationsRequest request)
virtual future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabaseDdl(google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const &request)
virtual StatusOr< google::spanner::admin::database::v1::Backup > GetBackup(google::spanner::admin::database::v1::GetBackupRequest const &request)
virtual StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request)
virtual StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackup(google::spanner::admin::database::v1::UpdateBackupRequest const &request)
virtual StreamRange< google::spanner::admin::database::v1::Backup > ListBackups(google::spanner::admin::database::v1::ListBackupsRequest request)
virtual Options options()
Definition: database_admin_connection.h:68
virtual StreamRange< google::longrunning::Operation > ListDatabaseOperations(google::spanner::admin::database::v1::ListDatabaseOperationsRequest request)
virtual StatusOr< google::spanner::admin::database::v1::Database > GetDatabase(google::spanner::admin::database::v1::GetDatabaseRequest const &request)
virtual StreamRange< google::spanner::admin::database::v1::DatabaseRole > ListDatabaseRoles(google::spanner::admin::database::v1::ListDatabaseRolesRequest request)
virtual future< StatusOr< google::spanner::admin::database::v1::Database > > UpdateDatabase(google::spanner::admin::database::v1::UpdateDatabaseRequest const &request)
virtual Status DropDatabase(google::spanner::admin::database::v1::DropDatabaseRequest const &request)
virtual StreamRange< google::spanner::admin::database::v1::Database > ListDatabases(google::spanner::admin::database::v1::ListDatabasesRequest request)
virtual future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase(google::spanner::admin::database::v1::CreateDatabaseRequest const &request)
virtual future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup(google::spanner::admin::database::v1::CreateBackupRequest const &request)
virtual StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request)
virtual future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase(google::spanner::admin::database::v1::RestoreDatabaseRequest const &request)
Definition: database_admin_client.h:34
std::shared_ptr< DatabaseAdminConnection > MakeDatabaseAdminConnection(Options options={})
A factory function to construct an object of type DatabaseAdminConnection.