Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
database_admin_client.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_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_DATABASE_ADMIN_CLIENT_H
21
22#include "google/cloud/spanner/admin/database_admin_connection.h"
23#include "google/cloud/future.h"
24#include "google/cloud/iam_updater.h"
25#include "google/cloud/options.h"
26#include "google/cloud/polling_policy.h"
27#include "google/cloud/status_or.h"
28#include "google/cloud/version.h"
29#include <google/longrunning/operations.grpc.pb.h>
30#include <memory>
31
32namespace google {
33namespace cloud {
34namespace spanner_admin {
35GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
36
37///
38/// Cloud Spanner Database Admin API
39///
40/// The Cloud Spanner Database Admin API can be used to:
41/// * create, drop, and list databases
42/// * update the schema of pre-existing databases
43/// * create, delete and list backups for a database
44/// * restore a database from an existing backup
45///
46/// @par Equality
47///
48/// Instances of this class created via copy-construction or copy-assignment
49/// always compare equal. Instances created with equal
50/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
51/// equal share the same underlying resources.
52///
53/// @par Performance
54///
55/// Creating a new instance of this class is a relatively expensive operation,
56/// new objects establish new connections to the service. In contrast,
57/// copy-construction, move-construction, and the corresponding assignment
58/// operations are relatively efficient as the copies share all underlying
59/// resources.
60///
61/// @par Thread Safety
62///
63/// Concurrent access to different instances of this class, even if they compare
64/// equal, is guaranteed to work. Two or more threads operating on the same
65/// instance of this class is not guaranteed to work. Since copy-construction
66/// and move-construction is a relatively efficient operation, consider using
67/// such a copy when using this class from multiple threads.
68///
70 public:
71 explicit DatabaseAdminClient(
72 std::shared_ptr<DatabaseAdminConnection> connection, Options opts = {});
74
75 ///@{
76 /// @name Copy and move support
81 ///@}
82
83 ///@{
84 /// @name Equality
85 friend bool operator==(DatabaseAdminClient const& a,
86 DatabaseAdminClient const& b) {
87 return a.connection_ == b.connection_;
88 }
89 friend bool operator!=(DatabaseAdminClient const& a,
90 DatabaseAdminClient const& b) {
91 return !(a == b);
92 }
93 ///@}
94
95 // clang-format off
96 ///
97 /// Lists Cloud Spanner databases.
98 ///
99 /// @param parent Required. The instance whose databases should be listed.
100 /// Values are of the form `projects/<project>/instances/<instance>`.
101 /// @param opts Optional. Override the class-level options, such as retry and
102 /// backoff policies.
103 /// @return a [StreamRange](@ref google::cloud::StreamRange)
104 /// to iterate of the results. See the documentation of this type for
105 /// details. In brief, this class has `begin()` and `end()` member
106 /// functions returning a iterator class meeting the
107 /// [input iterator requirements]. The value type for this iterator is a
108 /// [`StatusOr`] as the iteration may fail even after some values are
109 /// retrieved successfully, for example, if there is a network disconnect.
110 /// An empty set of results does not indicate an error, it indicates
111 /// that there are no resources meeting the request criteria.
112 /// On a successful iteration the `StatusOr<T>` contains elements of type
113 /// [google.spanner.admin.database.v1.Database], or rather,
114 /// the C++ class generated by Protobuf from that type. Please consult the
115 /// Protobuf documentation for details on the [Protobuf mapping rules].
116 ///
117 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
118 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
119 /// [Long Running Operation]: https://google.aip.dev/151
120 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
121 /// [`future`]: @ref google::cloud::future
122 /// [`StatusOr`]: @ref google::cloud::StatusOr
123 /// [`Status`]: @ref google::cloud::Status
124 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
125 /// [google.spanner.admin.database.v1.ListDatabasesRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L513}
126 ///
127 // clang-format on
128 StreamRange<google::spanner::admin::database::v1::Database> ListDatabases(
129 std::string const& parent, Options opts = {});
130
131 // clang-format off
132 ///
133 /// Lists Cloud Spanner databases.
134 ///
135 /// @param request Unary RPCs, such as the one wrapped by this
136 /// function, receive a single `request` proto message which includes all
137 /// the inputs for the RPC. In this case, the proto message is a
138 /// [google.spanner.admin.database.v1.ListDatabasesRequest].
139 /// Proto messages are converted to C++ classes by Protobuf, using the
140 /// [Protobuf mapping rules].
141 /// @param opts Optional. Override the class-level options, such as retry and
142 /// backoff policies.
143 /// @return a [StreamRange](@ref google::cloud::StreamRange)
144 /// to iterate of the results. See the documentation of this type for
145 /// details. In brief, this class has `begin()` and `end()` member
146 /// functions returning a iterator class meeting the
147 /// [input iterator requirements]. The value type for this iterator is a
148 /// [`StatusOr`] as the iteration may fail even after some values are
149 /// retrieved successfully, for example, if there is a network disconnect.
150 /// An empty set of results does not indicate an error, it indicates
151 /// that there are no resources meeting the request criteria.
152 /// On a successful iteration the `StatusOr<T>` contains elements of type
153 /// [google.spanner.admin.database.v1.Database], or rather,
154 /// the C++ class generated by Protobuf from that type. Please consult the
155 /// Protobuf documentation for details on the [Protobuf mapping rules].
156 ///
157 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
158 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
159 /// [Long Running Operation]: https://google.aip.dev/151
160 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
161 /// [`future`]: @ref google::cloud::future
162 /// [`StatusOr`]: @ref google::cloud::StatusOr
163 /// [`Status`]: @ref google::cloud::Status
164 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
165 /// [google.spanner.admin.database.v1.ListDatabasesRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L513}
166 ///
167 // clang-format on
168 StreamRange<google::spanner::admin::database::v1::Database> ListDatabases(
169 google::spanner::admin::database::v1::ListDatabasesRequest request,
170 Options opts = {});
171
172 // clang-format off
173 ///
174 /// Creates a new Cloud Spanner database and starts to prepare it for serving.
175 /// The returned [long-running operation][google.longrunning.Operation] will
176 /// have a name of the format `<database_name>/operations/<operation_id>` and
177 /// can be used to track preparation of the database. The
178 /// [metadata][google.longrunning.Operation.metadata] field type is
179 /// [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
180 /// [response][google.longrunning.Operation.response] field type is
181 /// [Database][google.spanner.admin.database.v1.Database], if successful.
182 ///
183 /// @param parent Required. The name of the instance that will serve the new database.
184 /// Values are of the form `projects/<project>/instances/<instance>`.
185 /// @param create_statement Required. A `CREATE DATABASE` statement, which specifies the ID of the
186 /// new database. The database ID must conform to the regular expression
187 /// `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length.
188 /// If the database ID is a reserved word or if it contains a hyphen, the
189 /// database ID must be enclosed in backticks (`` ` ``).
190 /// @param opts Optional. Override the class-level options, such as retry and
191 /// backoff policies.
192 /// @return A [`future`] that becomes satisfied when the LRO
193 /// ([Long Running Operation]) completes or the polling policy in effect
194 /// for this call is exhausted. The future is satisfied with an error if
195 /// the LRO completes with an error or the polling policy is exhausted.
196 /// In this case the [`StatusOr`] returned by the future contains the
197 /// error. If the LRO completes successfully the value of the future
198 /// contains the LRO's result. For this RPC the result is a
199 /// [google.spanner.admin.database.v1.Database] proto message.
200 /// The C++ class representing this message is created by Protobuf, using
201 /// the [Protobuf mapping rules].
202 ///
203 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
204 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
205 /// [Long Running Operation]: https://google.aip.dev/151
206 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
207 /// [`future`]: @ref google::cloud::future
208 /// [`StatusOr`]: @ref google::cloud::StatusOr
209 /// [`Status`]: @ref google::cloud::Status
210 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
211 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
212 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
213 /// [google.spanner.admin.database.v1.CreateDatabaseMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L579}
214 /// [google.spanner.admin.database.v1.CreateDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L545}
215 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
216 ///
217 // clang-format on
218 future<StatusOr<google::spanner::admin::database::v1::Database>>
219 CreateDatabase(std::string const& parent, std::string const& create_statement,
220 Options opts = {});
221
222 // clang-format off
223 ///
224 /// Creates a new Cloud Spanner database and starts to prepare it for serving.
225 /// The returned [long-running operation][google.longrunning.Operation] will
226 /// have a name of the format `<database_name>/operations/<operation_id>` and
227 /// can be used to track preparation of the database. The
228 /// [metadata][google.longrunning.Operation.metadata] field type is
229 /// [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
230 /// [response][google.longrunning.Operation.response] field type is
231 /// [Database][google.spanner.admin.database.v1.Database], if successful.
232 ///
233 /// @param request Unary RPCs, such as the one wrapped by this
234 /// function, receive a single `request` proto message which includes all
235 /// the inputs for the RPC. In this case, the proto message is a
236 /// [google.spanner.admin.database.v1.CreateDatabaseRequest].
237 /// Proto messages are converted to C++ classes by Protobuf, using the
238 /// [Protobuf mapping rules].
239 /// @param opts Optional. Override the class-level options, such as retry and
240 /// backoff policies.
241 /// @return A [`future`] that becomes satisfied when the LRO
242 /// ([Long Running Operation]) completes or the polling policy in effect
243 /// for this call is exhausted. The future is satisfied with an error if
244 /// the LRO completes with an error or the polling policy is exhausted.
245 /// In this case the [`StatusOr`] returned by the future contains the
246 /// error. If the LRO completes successfully the value of the future
247 /// contains the LRO's result. For this RPC the result is a
248 /// [google.spanner.admin.database.v1.Database] proto message.
249 /// The C++ class representing this message is created by Protobuf, using
250 /// the [Protobuf mapping rules].
251 ///
252 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
253 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
254 /// [Long Running Operation]: https://google.aip.dev/151
255 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
256 /// [`future`]: @ref google::cloud::future
257 /// [`StatusOr`]: @ref google::cloud::StatusOr
258 /// [`Status`]: @ref google::cloud::Status
259 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
260 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
261 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
262 /// [google.spanner.admin.database.v1.CreateDatabaseMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L579}
263 /// [google.spanner.admin.database.v1.CreateDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L545}
264 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
265 ///
266 // clang-format on
267 future<StatusOr<google::spanner::admin::database::v1::Database>>
269 google::spanner::admin::database::v1::CreateDatabaseRequest const&
270 request,
271 Options opts = {});
272
273 // clang-format off
274 ///
275 /// Gets the state of a Cloud Spanner database.
276 ///
277 /// @param name Required. The name of the requested database. Values are of the form
278 /// `projects/<project>/instances/<instance>/databases/<database>`.
279 /// @param opts Optional. Override the class-level options, such as retry and
280 /// backoff policies.
281 /// @return the result of the RPC. The response message type
282 /// ([google.spanner.admin.database.v1.Database])
283 /// is mapped to a C++ class using the [Protobuf mapping rules].
284 /// If the request fails, the [`StatusOr`] contains the error details.
285 ///
286 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
287 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
288 /// [Long Running Operation]: https://google.aip.dev/151
289 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
290 /// [`future`]: @ref google::cloud::future
291 /// [`StatusOr`]: @ref google::cloud::StatusOr
292 /// [`Status`]: @ref google::cloud::Status
293 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
294 /// [google.spanner.admin.database.v1.GetDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L587}
295 ///
296 // clang-format on
297 StatusOr<google::spanner::admin::database::v1::Database> GetDatabase(
298 std::string const& name, Options opts = {});
299
300 // clang-format off
301 ///
302 /// Gets the state of a Cloud Spanner database.
303 ///
304 /// @param request Unary RPCs, such as the one wrapped by this
305 /// function, receive a single `request` proto message which includes all
306 /// the inputs for the RPC. In this case, the proto message is a
307 /// [google.spanner.admin.database.v1.GetDatabaseRequest].
308 /// Proto messages are converted to C++ classes by Protobuf, using the
309 /// [Protobuf mapping rules].
310 /// @param opts Optional. Override the class-level options, such as retry and
311 /// backoff policies.
312 /// @return the result of the RPC. The response message type
313 /// ([google.spanner.admin.database.v1.Database])
314 /// is mapped to a C++ class using the [Protobuf mapping rules].
315 /// If the request fails, the [`StatusOr`] contains the error details.
316 ///
317 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
318 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
319 /// [Long Running Operation]: https://google.aip.dev/151
320 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
321 /// [`future`]: @ref google::cloud::future
322 /// [`StatusOr`]: @ref google::cloud::StatusOr
323 /// [`Status`]: @ref google::cloud::Status
324 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
325 /// [google.spanner.admin.database.v1.GetDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L587}
326 ///
327 // clang-format on
328 StatusOr<google::spanner::admin::database::v1::Database> GetDatabase(
329 google::spanner::admin::database::v1::GetDatabaseRequest const& request,
330 Options opts = {});
331
332 // clang-format off
333 ///
334 /// Updates a Cloud Spanner database. The returned
335 /// [long-running operation][google.longrunning.Operation] can be used to track
336 /// the progress of updating the database. If the named database does not
337 /// exist, returns `NOT_FOUND`.
338 ///
339 /// While the operation is pending:
340 ///
341 /// * The database's
342 /// [reconciling][google.spanner.admin.database.v1.Database.reconciling]
343 /// field is set to true.
344 /// * Cancelling the operation is best-effort. If the cancellation succeeds,
345 /// the operation metadata's
346 /// [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time]
347 /// is set, the updates are reverted, and the operation terminates with a
348 /// `CANCELLED` status.
349 /// * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error
350 /// until the pending operation is done (returns successfully or with
351 /// error).
352 /// * Reading the database via the API continues to give the pre-request
353 /// values.
354 ///
355 /// Upon completion of the returned operation:
356 ///
357 /// * The new values are in effect and readable via the API.
358 /// * The database's
359 /// [reconciling][google.spanner.admin.database.v1.Database.reconciling]
360 /// field becomes false.
361 ///
362 /// The returned [long-running operation][google.longrunning.Operation] will
363 /// have a name of the format
364 /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
365 /// and can be used to track the database modification. The
366 /// [metadata][google.longrunning.Operation.metadata] field type is
367 /// [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata].
368 /// The [response][google.longrunning.Operation.response] field type is
369 /// [Database][google.spanner.admin.database.v1.Database], if successful.
370 ///
371 /// @param database Required. The database to update.
372 /// The `name` field of the database is of the form
373 /// `projects/<project>/instances/<instance>/databases/<database>`.
374 /// @param update_mask Required. The list of fields to update. Currently, only
375 /// `enable_drop_protection` field can be updated.
376 /// @param opts Optional. Override the class-level options, such as retry and
377 /// backoff policies.
378 /// @return A [`future`] that becomes satisfied when the LRO
379 /// ([Long Running Operation]) completes or the polling policy in effect
380 /// for this call is exhausted. The future is satisfied with an error if
381 /// the LRO completes with an error or the polling policy is exhausted.
382 /// In this case the [`StatusOr`] returned by the future contains the
383 /// error. If the LRO completes successfully the value of the future
384 /// contains the LRO's result. For this RPC the result is a
385 /// [google.spanner.admin.database.v1.Database] proto message.
386 /// The C++ class representing this message is created by Protobuf, using
387 /// the [Protobuf mapping rules].
388 ///
389 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
390 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
391 /// [Long Running Operation]: https://google.aip.dev/151
392 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
393 /// [`future`]: @ref google::cloud::future
394 /// [`StatusOr`]: @ref google::cloud::StatusOr
395 /// [`Status`]: @ref google::cloud::Status
396 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
397 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
398 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
399 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
400 /// [google.spanner.admin.database.v1.Database.reconciling]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L509}
401 /// [google.spanner.admin.database.v1.UpdateDatabaseMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L614}
402 /// [google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L626}
403 /// [google.spanner.admin.database.v1.UpdateDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L600}
404 ///
405 // clang-format on
406 future<StatusOr<google::spanner::admin::database::v1::Database>>
407 UpdateDatabase(google::spanner::admin::database::v1::Database const& database,
408 google::protobuf::FieldMask const& update_mask,
409 Options opts = {});
410
411 // clang-format off
412 ///
413 /// Updates a Cloud Spanner database. The returned
414 /// [long-running operation][google.longrunning.Operation] can be used to track
415 /// the progress of updating the database. If the named database does not
416 /// exist, returns `NOT_FOUND`.
417 ///
418 /// While the operation is pending:
419 ///
420 /// * The database's
421 /// [reconciling][google.spanner.admin.database.v1.Database.reconciling]
422 /// field is set to true.
423 /// * Cancelling the operation is best-effort. If the cancellation succeeds,
424 /// the operation metadata's
425 /// [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time]
426 /// is set, the updates are reverted, and the operation terminates with a
427 /// `CANCELLED` status.
428 /// * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error
429 /// until the pending operation is done (returns successfully or with
430 /// error).
431 /// * Reading the database via the API continues to give the pre-request
432 /// values.
433 ///
434 /// Upon completion of the returned operation:
435 ///
436 /// * The new values are in effect and readable via the API.
437 /// * The database's
438 /// [reconciling][google.spanner.admin.database.v1.Database.reconciling]
439 /// field becomes false.
440 ///
441 /// The returned [long-running operation][google.longrunning.Operation] will
442 /// have a name of the format
443 /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
444 /// and can be used to track the database modification. The
445 /// [metadata][google.longrunning.Operation.metadata] field type is
446 /// [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata].
447 /// The [response][google.longrunning.Operation.response] field type is
448 /// [Database][google.spanner.admin.database.v1.Database], if successful.
449 ///
450 /// @param request Unary RPCs, such as the one wrapped by this
451 /// function, receive a single `request` proto message which includes all
452 /// the inputs for the RPC. In this case, the proto message is a
453 /// [google.spanner.admin.database.v1.UpdateDatabaseRequest].
454 /// Proto messages are converted to C++ classes by Protobuf, using the
455 /// [Protobuf mapping rules].
456 /// @param opts Optional. Override the class-level options, such as retry and
457 /// backoff policies.
458 /// @return A [`future`] that becomes satisfied when the LRO
459 /// ([Long Running Operation]) completes or the polling policy in effect
460 /// for this call is exhausted. The future is satisfied with an error if
461 /// the LRO completes with an error or the polling policy is exhausted.
462 /// In this case the [`StatusOr`] returned by the future contains the
463 /// error. If the LRO completes successfully the value of the future
464 /// contains the LRO's result. For this RPC the result is a
465 /// [google.spanner.admin.database.v1.Database] proto message.
466 /// The C++ class representing this message is created by Protobuf, using
467 /// the [Protobuf mapping rules].
468 ///
469 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
470 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
471 /// [Long Running Operation]: https://google.aip.dev/151
472 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
473 /// [`future`]: @ref google::cloud::future
474 /// [`StatusOr`]: @ref google::cloud::StatusOr
475 /// [`Status`]: @ref google::cloud::Status
476 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
477 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
478 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
479 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
480 /// [google.spanner.admin.database.v1.Database.reconciling]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L509}
481 /// [google.spanner.admin.database.v1.UpdateDatabaseMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L614}
482 /// [google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L626}
483 /// [google.spanner.admin.database.v1.UpdateDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L600}
484 ///
485 // clang-format on
486 future<StatusOr<google::spanner::admin::database::v1::Database>>
488 google::spanner::admin::database::v1::UpdateDatabaseRequest const&
489 request,
490 Options opts = {});
491
492 // clang-format off
493 ///
494 /// Updates the schema of a Cloud Spanner database by
495 /// creating/altering/dropping tables, columns, indexes, etc. The returned
496 /// [long-running operation][google.longrunning.Operation] will have a name of
497 /// the format `<database_name>/operations/<operation_id>` and can be used to
498 /// track execution of the schema change(s). The
499 /// [metadata][google.longrunning.Operation.metadata] field type is
500 /// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
501 ///
502 /// @param database Required. The database to update.
503 /// @param statements Required. DDL statements to be applied to the database.
504 /// @param opts Optional. Override the class-level options, such as retry and
505 /// backoff policies.
506 /// @return A [`future`] that becomes satisfied when the LRO
507 /// ([Long Running Operation]) completes or the polling policy in effect
508 /// for this call is exhausted. The future is satisfied with an error if
509 /// the LRO completes with an error or the polling policy is exhausted.
510 /// In this case the [`StatusOr`] returned by the future contains the
511 /// error. If the LRO completes successfully the value of the future
512 /// contains the LRO's result. For this RPC the result is a
513 /// [google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata] proto message.
514 /// The C++ class representing this message is created by Protobuf, using
515 /// the [Protobuf mapping rules].
516 ///
517 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
518 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
519 /// [Long Running Operation]: https://google.aip.dev/151
520 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
521 /// [`future`]: @ref google::cloud::future
522 /// [`StatusOr`]: @ref google::cloud::StatusOr
523 /// [`Status`]: @ref google::cloud::Status
524 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
525 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
526 /// [google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L702}
527 /// [google.spanner.admin.database.v1.UpdateDatabaseDdlRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L645}
528 ///
529 // clang-format on
530 future<
531 StatusOr<google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
532 UpdateDatabaseDdl(std::string const& database,
533 std::vector<std::string> const& statements,
534 Options opts = {});
535
536 // clang-format off
537 ///
538 /// Updates the schema of a Cloud Spanner database by
539 /// creating/altering/dropping tables, columns, indexes, etc. The returned
540 /// [long-running operation][google.longrunning.Operation] will have a name of
541 /// the format `<database_name>/operations/<operation_id>` and can be used to
542 /// track execution of the schema change(s). The
543 /// [metadata][google.longrunning.Operation.metadata] field type is
544 /// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
545 ///
546 /// @param request Unary RPCs, such as the one wrapped by this
547 /// function, receive a single `request` proto message which includes all
548 /// the inputs for the RPC. In this case, the proto message is a
549 /// [google.spanner.admin.database.v1.UpdateDatabaseDdlRequest].
550 /// Proto messages are converted to C++ classes by Protobuf, using the
551 /// [Protobuf mapping rules].
552 /// @param opts Optional. Override the class-level options, such as retry and
553 /// backoff policies.
554 /// @return A [`future`] that becomes satisfied when the LRO
555 /// ([Long Running Operation]) completes or the polling policy in effect
556 /// for this call is exhausted. The future is satisfied with an error if
557 /// the LRO completes with an error or the polling policy is exhausted.
558 /// In this case the [`StatusOr`] returned by the future contains the
559 /// error. If the LRO completes successfully the value of the future
560 /// contains the LRO's result. For this RPC the result is a
561 /// [google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata] proto message.
562 /// The C++ class representing this message is created by Protobuf, using
563 /// the [Protobuf mapping rules].
564 ///
565 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
566 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
567 /// [Long Running Operation]: https://google.aip.dev/151
568 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
569 /// [`future`]: @ref google::cloud::future
570 /// [`StatusOr`]: @ref google::cloud::StatusOr
571 /// [`Status`]: @ref google::cloud::Status
572 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
573 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
574 /// [google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L702}
575 /// [google.spanner.admin.database.v1.UpdateDatabaseDdlRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L645}
576 ///
577 // clang-format on
578 future<
579 StatusOr<google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
581 google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
582 request,
583 Options opts = {});
584
585 // clang-format off
586 ///
587 /// Drops (aka deletes) a Cloud Spanner database.
588 /// Completed backups for the database will be retained according to their
589 /// `expire_time`.
590 /// Note: Cloud Spanner might continue to accept requests for a few seconds
591 /// after the database has been deleted.
592 ///
593 /// @param database Required. The database to be dropped.
594 /// @param opts Optional. Override the class-level options, such as retry and
595 /// backoff policies.
596 /// @return a [`Status`] object. If the request failed, the
597 /// status contains the details of the failure.
598 ///
599 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
600 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
601 /// [Long Running Operation]: https://google.aip.dev/151
602 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
603 /// [`future`]: @ref google::cloud::future
604 /// [`StatusOr`]: @ref google::cloud::StatusOr
605 /// [`Status`]: @ref google::cloud::Status
606 /// [google.spanner.admin.database.v1.DropDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L737}
607 ///
608 // clang-format on
609 Status DropDatabase(std::string const& database, Options opts = {});
610
611 // clang-format off
612 ///
613 /// Drops (aka deletes) a Cloud Spanner database.
614 /// Completed backups for the database will be retained according to their
615 /// `expire_time`.
616 /// Note: Cloud Spanner might continue to accept requests for a few seconds
617 /// after the database has been deleted.
618 ///
619 /// @param request Unary RPCs, such as the one wrapped by this
620 /// function, receive a single `request` proto message which includes all
621 /// the inputs for the RPC. In this case, the proto message is a
622 /// [google.spanner.admin.database.v1.DropDatabaseRequest].
623 /// Proto messages are converted to C++ classes by Protobuf, using the
624 /// [Protobuf mapping rules].
625 /// @param opts Optional. Override the class-level options, such as retry and
626 /// backoff policies.
627 /// @return a [`Status`] object. If the request failed, the
628 /// status contains the details of the failure.
629 ///
630 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
631 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
632 /// [Long Running Operation]: https://google.aip.dev/151
633 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
634 /// [`future`]: @ref google::cloud::future
635 /// [`StatusOr`]: @ref google::cloud::StatusOr
636 /// [`Status`]: @ref google::cloud::Status
637 /// [google.spanner.admin.database.v1.DropDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L737}
638 ///
639 // clang-format on
641 google::spanner::admin::database::v1::DropDatabaseRequest const& request,
642 Options opts = {});
643
644 // clang-format off
645 ///
646 /// Returns the schema of a Cloud Spanner database as a list of formatted
647 /// DDL statements. This method does not show pending schema updates, those may
648 /// be queried using the [Operations][google.longrunning.Operations] API.
649 ///
650 /// @param database Required. The database whose schema we wish to get.
651 /// Values are of the form
652 /// `projects/<project>/instances/<instance>/databases/<database>`
653 /// @param opts Optional. Override the class-level options, such as retry and
654 /// backoff policies.
655 /// @return the result of the RPC. The response message type
656 /// ([google.spanner.admin.database.v1.GetDatabaseDdlResponse])
657 /// is mapped to a C++ class using the [Protobuf mapping rules].
658 /// If the request fails, the [`StatusOr`] contains the error details.
659 ///
660 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
661 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
662 /// [Long Running Operation]: https://google.aip.dev/151
663 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
664 /// [`future`]: @ref google::cloud::future
665 /// [`StatusOr`]: @ref google::cloud::StatusOr
666 /// [`Status`]: @ref google::cloud::Status
667 /// [google.longrunning.Operations]: @googleapis_reference_link{google/longrunning/operations.proto#L54}
668 /// [google.spanner.admin.database.v1.GetDatabaseDdlRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L748}
669 /// [google.spanner.admin.database.v1.GetDatabaseDdlResponse]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L761}
670 ///
671 // clang-format on
672 StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
673 GetDatabaseDdl(std::string const& database, Options opts = {});
674
675 // clang-format off
676 ///
677 /// Returns the schema of a Cloud Spanner database as a list of formatted
678 /// DDL statements. This method does not show pending schema updates, those may
679 /// be queried using the [Operations][google.longrunning.Operations] API.
680 ///
681 /// @param request Unary RPCs, such as the one wrapped by this
682 /// function, receive a single `request` proto message which includes all
683 /// the inputs for the RPC. In this case, the proto message is a
684 /// [google.spanner.admin.database.v1.GetDatabaseDdlRequest].
685 /// Proto messages are converted to C++ classes by Protobuf, using the
686 /// [Protobuf mapping rules].
687 /// @param opts Optional. Override the class-level options, such as retry and
688 /// backoff policies.
689 /// @return the result of the RPC. The response message type
690 /// ([google.spanner.admin.database.v1.GetDatabaseDdlResponse])
691 /// is mapped to a C++ class using the [Protobuf mapping rules].
692 /// If the request fails, the [`StatusOr`] contains the error details.
693 ///
694 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
695 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
696 /// [Long Running Operation]: https://google.aip.dev/151
697 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
698 /// [`future`]: @ref google::cloud::future
699 /// [`StatusOr`]: @ref google::cloud::StatusOr
700 /// [`Status`]: @ref google::cloud::Status
701 /// [google.longrunning.Operations]: @googleapis_reference_link{google/longrunning/operations.proto#L54}
702 /// [google.spanner.admin.database.v1.GetDatabaseDdlRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L748}
703 /// [google.spanner.admin.database.v1.GetDatabaseDdlResponse]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L761}
704 ///
705 // clang-format on
706 StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
708 google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
709 request,
710 Options opts = {});
711
712 // clang-format off
713 ///
714 /// Sets the access control policy on a database or backup resource.
715 /// Replaces any existing policy.
716 ///
717 /// Authorization requires `spanner.databases.setIamPolicy`
718 /// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
719 /// For backups, authorization requires `spanner.backups.setIamPolicy`
720 /// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
721 ///
722 /// @param resource REQUIRED: The resource for which the policy is being specified.
723 /// See the operation documentation for the appropriate value for this field.
724 /// @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of
725 /// the policy is limited to a few 10s of KB. An empty policy is a
726 /// valid policy but certain Cloud Platform services (such as Projects)
727 /// might reject them.
728 /// @param opts Optional. Override the class-level options, such as retry and
729 /// backoff policies.
730 /// @return the result of the RPC. The response message type
731 /// ([google.iam.v1.Policy])
732 /// is mapped to a C++ class using the [Protobuf mapping rules].
733 /// If the request fails, the [`StatusOr`] contains the error details.
734 ///
735 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
736 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
737 /// [Long Running Operation]: https://google.aip.dev/151
738 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
739 /// [`future`]: @ref google::cloud::future
740 /// [`StatusOr`]: @ref google::cloud::StatusOr
741 /// [`Status`]: @ref google::cloud::Status
742 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
743 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
744 /// [google.iam.v1.SetIamPolicyRequest.resource]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L104}
745 ///
746 // clang-format on
747 StatusOr<google::iam::v1::Policy> SetIamPolicy(
748 std::string const& resource, google::iam::v1::Policy const& policy,
749 Options opts = {});
750
751 /**
752 * Updates the IAM policy for @p resource using an optimistic concurrency
753 * control loop.
754 *
755 * The loop fetches the current policy for @p resource, and passes it to @p
756 * updater, which should return the new policy. This new policy should use the
757 * current etag so that the read-modify-write cycle can detect races and rerun
758 * the update when there is a mismatch. If the new policy does not have an
759 * etag, the existing policy will be blindly overwritten. If @p updater does
760 * not yield a policy, the control loop is terminated and kCancelled is
761 * returned.
762 *
763 * @param resource Required. The resource for which the policy is being
764 * specified. See the operation documentation for the appropriate value for
765 * this field.
766 * @param updater Required. Functor to map the current policy to a new one.
767 * @param opts Optional. Override the class-level options, such as retry and
768 * backoff policies.
769 * @return google::iam::v1::Policy
770 */
771 StatusOr<google::iam::v1::Policy> SetIamPolicy(std::string const& resource,
772 IamUpdater const& updater,
773 Options opts = {});
774
775 // clang-format off
776 ///
777 /// Sets the access control policy on a database or backup resource.
778 /// Replaces any existing policy.
779 ///
780 /// Authorization requires `spanner.databases.setIamPolicy`
781 /// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
782 /// For backups, authorization requires `spanner.backups.setIamPolicy`
783 /// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
784 ///
785 /// @param request Unary RPCs, such as the one wrapped by this
786 /// function, receive a single `request` proto message which includes all
787 /// the inputs for the RPC. In this case, the proto message is a
788 /// [google.iam.v1.SetIamPolicyRequest].
789 /// Proto messages are converted to C++ classes by Protobuf, using the
790 /// [Protobuf mapping rules].
791 /// @param opts Optional. Override the class-level options, such as retry and
792 /// backoff policies.
793 /// @return the result of the RPC. The response message type
794 /// ([google.iam.v1.Policy])
795 /// is mapped to a C++ class using the [Protobuf mapping rules].
796 /// If the request fails, the [`StatusOr`] contains the error details.
797 ///
798 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
799 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
800 /// [Long Running Operation]: https://google.aip.dev/151
801 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
802 /// [`future`]: @ref google::cloud::future
803 /// [`StatusOr`]: @ref google::cloud::StatusOr
804 /// [`Status`]: @ref google::cloud::Status
805 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
806 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
807 /// [google.iam.v1.SetIamPolicyRequest.resource]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L104}
808 ///
809 // clang-format on
810 StatusOr<google::iam::v1::Policy> SetIamPolicy(
811 google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
812
813 // clang-format off
814 ///
815 /// Gets the access control policy for a database or backup resource.
816 /// Returns an empty policy if a database or backup exists but does not have a
817 /// policy set.
818 ///
819 /// Authorization requires `spanner.databases.getIamPolicy` permission on
820 /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
821 /// For backups, authorization requires `spanner.backups.getIamPolicy`
822 /// permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
823 ///
824 /// @param resource REQUIRED: The resource for which the policy is being requested.
825 /// See the operation documentation for the appropriate value for this field.
826 /// @param opts Optional. Override the class-level options, such as retry and
827 /// backoff policies.
828 /// @return the result of the RPC. The response message type
829 /// ([google.iam.v1.Policy])
830 /// is mapped to a C++ class using the [Protobuf mapping rules].
831 /// If the request fails, the [`StatusOr`] contains the error details.
832 ///
833 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
834 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
835 /// [Long Running Operation]: https://google.aip.dev/151
836 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
837 /// [`future`]: @ref google::cloud::future
838 /// [`StatusOr`]: @ref google::cloud::StatusOr
839 /// [`Status`]: @ref google::cloud::Status
840 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
841 /// [google.iam.v1.GetIamPolicyRequest.resource]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L126}
842 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
843 ///
844 // clang-format on
845 StatusOr<google::iam::v1::Policy> GetIamPolicy(std::string const& resource,
846 Options opts = {});
847
848 // clang-format off
849 ///
850 /// Gets the access control policy for a database or backup resource.
851 /// Returns an empty policy if a database or backup exists but does not have a
852 /// policy set.
853 ///
854 /// Authorization requires `spanner.databases.getIamPolicy` permission on
855 /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
856 /// For backups, authorization requires `spanner.backups.getIamPolicy`
857 /// permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
858 ///
859 /// @param request Unary RPCs, such as the one wrapped by this
860 /// function, receive a single `request` proto message which includes all
861 /// the inputs for the RPC. In this case, the proto message is a
862 /// [google.iam.v1.GetIamPolicyRequest].
863 /// Proto messages are converted to C++ classes by Protobuf, using the
864 /// [Protobuf mapping rules].
865 /// @param opts Optional. Override the class-level options, such as retry and
866 /// backoff policies.
867 /// @return the result of the RPC. The response message type
868 /// ([google.iam.v1.Policy])
869 /// is mapped to a C++ class using the [Protobuf mapping rules].
870 /// If the request fails, the [`StatusOr`] contains the error details.
871 ///
872 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
873 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
874 /// [Long Running Operation]: https://google.aip.dev/151
875 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
876 /// [`future`]: @ref google::cloud::future
877 /// [`StatusOr`]: @ref google::cloud::StatusOr
878 /// [`Status`]: @ref google::cloud::Status
879 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
880 /// [google.iam.v1.GetIamPolicyRequest.resource]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L126}
881 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
882 ///
883 // clang-format on
884 StatusOr<google::iam::v1::Policy> GetIamPolicy(
885 google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
886
887 // clang-format off
888 ///
889 /// Returns permissions that the caller has on the specified database or backup
890 /// resource.
891 ///
892 /// Attempting this RPC on a non-existent Cloud Spanner database will
893 /// result in a NOT_FOUND error if the user has
894 /// `spanner.databases.list` permission on the containing Cloud
895 /// Spanner instance. Otherwise returns an empty set of permissions.
896 /// Calling this method on a backup that does not exist will
897 /// result in a NOT_FOUND error if the user has
898 /// `spanner.backups.list` permission on the containing instance.
899 ///
900 /// @param resource REQUIRED: The resource for which the policy detail is being requested.
901 /// See the operation documentation for the appropriate value for this field.
902 /// @param permissions The set of permissions to check for the `resource`. Permissions with
903 /// wildcards (such as '*' or 'storage.*') are not allowed. For more
904 /// information see
905 /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
906 /// @param opts Optional. Override the class-level options, such as retry and
907 /// backoff policies.
908 /// @return the result of the RPC. The response message type
909 /// ([google.iam.v1.TestIamPermissionsResponse])
910 /// is mapped to a C++ class using the [Protobuf mapping rules].
911 /// If the request fails, the [`StatusOr`] contains the error details.
912 ///
913 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
914 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
915 /// [Long Running Operation]: https://google.aip.dev/151
916 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
917 /// [`future`]: @ref google::cloud::future
918 /// [`StatusOr`]: @ref google::cloud::StatusOr
919 /// [`Status`]: @ref google::cloud::Status
920 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
921 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
922 ///
923 // clang-format on
924 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
925 std::string const& resource, std::vector<std::string> const& permissions,
926 Options opts = {});
927
928 // clang-format off
929 ///
930 /// Returns permissions that the caller has on the specified database or backup
931 /// resource.
932 ///
933 /// Attempting this RPC on a non-existent Cloud Spanner database will
934 /// result in a NOT_FOUND error if the user has
935 /// `spanner.databases.list` permission on the containing Cloud
936 /// Spanner instance. Otherwise returns an empty set of permissions.
937 /// Calling this method on a backup that does not exist will
938 /// result in a NOT_FOUND error if the user has
939 /// `spanner.backups.list` permission on the containing instance.
940 ///
941 /// @param request Unary RPCs, such as the one wrapped by this
942 /// function, receive a single `request` proto message which includes all
943 /// the inputs for the RPC. In this case, the proto message is a
944 /// [google.iam.v1.TestIamPermissionsRequest].
945 /// Proto messages are converted to C++ classes by Protobuf, using the
946 /// [Protobuf mapping rules].
947 /// @param opts Optional. Override the class-level options, such as retry and
948 /// backoff policies.
949 /// @return the result of the RPC. The response message type
950 /// ([google.iam.v1.TestIamPermissionsResponse])
951 /// is mapped to a C++ class using the [Protobuf mapping rules].
952 /// If the request fails, the [`StatusOr`] contains the error details.
953 ///
954 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
955 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
956 /// [Long Running Operation]: https://google.aip.dev/151
957 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
958 /// [`future`]: @ref google::cloud::future
959 /// [`StatusOr`]: @ref google::cloud::StatusOr
960 /// [`Status`]: @ref google::cloud::Status
961 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
962 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
963 ///
964 // clang-format on
965 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
966 google::iam::v1::TestIamPermissionsRequest const& request,
967 Options opts = {});
968
969 // clang-format off
970 ///
971 /// Starts creating a new Cloud Spanner Backup.
972 /// The returned backup [long-running operation][google.longrunning.Operation]
973 /// will have a name of the format
974 /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
975 /// and can be used to track creation of the backup. The
976 /// [metadata][google.longrunning.Operation.metadata] field type is
977 /// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
978 /// [response][google.longrunning.Operation.response] field type is
979 /// [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
980 /// creation and delete the backup.
981 /// There can be only one pending backup creation per database. Backup creation
982 /// of different databases can run concurrently.
983 ///
984 /// @param parent Required. The name of the instance in which the backup will be
985 /// created. This must be the same instance that contains the database the
986 /// backup will be created from. The backup will be stored in the
987 /// location(s) specified in the instance configuration of this
988 /// instance. Values are of the form
989 /// `projects/<project>/instances/<instance>`.
990 /// @param backup Required. The backup to create.
991 /// @param backup_id Required. The id of the backup to be created. The `backup_id` appended to
992 /// `parent` forms the full backup name of the form
993 /// `projects/<project>/instances/<instance>/backups/<backup_id>`.
994 /// @param opts Optional. Override the class-level options, such as retry and
995 /// backoff policies.
996 /// @return A [`future`] that becomes satisfied when the LRO
997 /// ([Long Running Operation]) completes or the polling policy in effect
998 /// for this call is exhausted. The future is satisfied with an error if
999 /// the LRO completes with an error or the polling policy is exhausted.
1000 /// In this case the [`StatusOr`] returned by the future contains the
1001 /// error. If the LRO completes successfully the value of the future
1002 /// contains the LRO's result. For this RPC the result is a
1003 /// [google.spanner.admin.database.v1.Backup] proto message.
1004 /// The C++ class representing this message is created by Protobuf, using
1005 /// the [Protobuf mapping rules].
1006 ///
1007 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1008 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1009 /// [Long Running Operation]: https://google.aip.dev/151
1010 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1011 /// [`future`]: @ref google::cloud::future
1012 /// [`StatusOr`]: @ref google::cloud::StatusOr
1013 /// [`Status`]: @ref google::cloud::Status
1014 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1015 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1016 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1017 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1018 /// [google.spanner.admin.database.v1.CreateBackupMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L178}
1019 /// [google.spanner.admin.database.v1.CreateBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L146}
1020 ///
1021 // clang-format on
1022 future<StatusOr<google::spanner::admin::database::v1::Backup>> CreateBackup(
1023 std::string const& parent,
1024 google::spanner::admin::database::v1::Backup const& backup,
1025 std::string const& backup_id, Options opts = {});
1026
1027 // clang-format off
1028 ///
1029 /// Starts creating a new Cloud Spanner Backup.
1030 /// The returned backup [long-running operation][google.longrunning.Operation]
1031 /// will have a name of the format
1032 /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
1033 /// and can be used to track creation of the backup. The
1034 /// [metadata][google.longrunning.Operation.metadata] field type is
1035 /// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
1036 /// [response][google.longrunning.Operation.response] field type is
1037 /// [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
1038 /// creation and delete the backup.
1039 /// There can be only one pending backup creation per database. Backup creation
1040 /// of different databases can run concurrently.
1041 ///
1042 /// @param request Unary RPCs, such as the one wrapped by this
1043 /// function, receive a single `request` proto message which includes all
1044 /// the inputs for the RPC. In this case, the proto message is a
1045 /// [google.spanner.admin.database.v1.CreateBackupRequest].
1046 /// Proto messages are converted to C++ classes by Protobuf, using the
1047 /// [Protobuf mapping rules].
1048 /// @param opts Optional. Override the class-level options, such as retry and
1049 /// backoff policies.
1050 /// @return A [`future`] that becomes satisfied when the LRO
1051 /// ([Long Running Operation]) completes or the polling policy in effect
1052 /// for this call is exhausted. The future is satisfied with an error if
1053 /// the LRO completes with an error or the polling policy is exhausted.
1054 /// In this case the [`StatusOr`] returned by the future contains the
1055 /// error. If the LRO completes successfully the value of the future
1056 /// contains the LRO's result. For this RPC the result is a
1057 /// [google.spanner.admin.database.v1.Backup] proto message.
1058 /// The C++ class representing this message is created by Protobuf, using
1059 /// the [Protobuf mapping rules].
1060 ///
1061 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1062 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1063 /// [Long Running Operation]: https://google.aip.dev/151
1064 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1065 /// [`future`]: @ref google::cloud::future
1066 /// [`StatusOr`]: @ref google::cloud::StatusOr
1067 /// [`Status`]: @ref google::cloud::Status
1068 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1069 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1070 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1071 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1072 /// [google.spanner.admin.database.v1.CreateBackupMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L178}
1073 /// [google.spanner.admin.database.v1.CreateBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L146}
1074 ///
1075 // clang-format on
1076 future<StatusOr<google::spanner::admin::database::v1::Backup>> CreateBackup(
1077 google::spanner::admin::database::v1::CreateBackupRequest const& request,
1078 Options opts = {});
1079
1080 // clang-format off
1081 ///
1082 /// Starts copying a Cloud Spanner Backup.
1083 /// The returned backup [long-running operation][google.longrunning.Operation]
1084 /// will have a name of the format
1085 /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
1086 /// and can be used to track copying of the backup. The operation is associated
1087 /// with the destination backup.
1088 /// The [metadata][google.longrunning.Operation.metadata] field type is
1089 /// [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
1090 /// The [response][google.longrunning.Operation.response] field type is
1091 /// [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
1092 /// copying and delete the backup.
1093 /// Concurrent CopyBackup requests can run on the same source backup.
1094 ///
1095 /// @param parent Required. The name of the destination instance that will contain the backup copy.
1096 /// Values are of the form: `projects/<project>/instances/<instance>`.
1097 /// @param backup_id Required. The id of the backup copy.
1098 /// The `backup_id` appended to `parent` forms the full backup_uri of the form
1099 /// `projects/<project>/instances/<instance>/backups/<backup>`.
1100 /// @param source_backup Required. The source backup to be copied.
1101 /// The source backup needs to be in READY state for it to be copied.
1102 /// Once CopyBackup is in progress, the source backup cannot be deleted or
1103 /// cleaned up on expiration until CopyBackup is finished.
1104 /// Values are of the form:
1105 /// `projects/<project>/instances/<instance>/backups/<backup>`.
1106 /// @param expire_time Required. The expiration time of the backup in microsecond granularity.
1107 /// The expiration time must be at least 6 hours and at most 366 days
1108 /// from the `create_time` of the source backup. Once the `expire_time` has
1109 /// passed, the backup is eligible to be automatically deleted by Cloud Spanner
1110 /// to free the resources used by the backup.
1111 /// @param opts Optional. Override the class-level options, such as retry and
1112 /// backoff policies.
1113 /// @return A [`future`] that becomes satisfied when the LRO
1114 /// ([Long Running Operation]) completes or the polling policy in effect
1115 /// for this call is exhausted. The future is satisfied with an error if
1116 /// the LRO completes with an error or the polling policy is exhausted.
1117 /// In this case the [`StatusOr`] returned by the future contains the
1118 /// error. If the LRO completes successfully the value of the future
1119 /// contains the LRO's result. For this RPC the result is a
1120 /// [google.spanner.admin.database.v1.Backup] proto message.
1121 /// The C++ class representing this message is created by Protobuf, using
1122 /// the [Protobuf mapping rules].
1123 ///
1124 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1125 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1126 /// [Long Running Operation]: https://google.aip.dev/151
1127 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1128 /// [`future`]: @ref google::cloud::future
1129 /// [`StatusOr`]: @ref google::cloud::StatusOr
1130 /// [`Status`]: @ref google::cloud::Status
1131 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1132 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1133 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1134 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1135 /// [google.spanner.admin.database.v1.CopyBackupMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L254}
1136 /// [google.spanner.admin.database.v1.CopyBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L209}
1137 ///
1138 // clang-format on
1139 future<StatusOr<google::spanner::admin::database::v1::Backup>> CopyBackup(
1140 std::string const& parent, std::string const& backup_id,
1141 std::string const& source_backup,
1142 google::protobuf::Timestamp const& expire_time, Options opts = {});
1143
1144 // clang-format off
1145 ///
1146 /// Starts copying a Cloud Spanner Backup.
1147 /// The returned backup [long-running operation][google.longrunning.Operation]
1148 /// will have a name of the format
1149 /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
1150 /// and can be used to track copying of the backup. The operation is associated
1151 /// with the destination backup.
1152 /// The [metadata][google.longrunning.Operation.metadata] field type is
1153 /// [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
1154 /// The [response][google.longrunning.Operation.response] field type is
1155 /// [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
1156 /// copying and delete the backup.
1157 /// Concurrent CopyBackup requests can run on the same source backup.
1158 ///
1159 /// @param request Unary RPCs, such as the one wrapped by this
1160 /// function, receive a single `request` proto message which includes all
1161 /// the inputs for the RPC. In this case, the proto message is a
1162 /// [google.spanner.admin.database.v1.CopyBackupRequest].
1163 /// Proto messages are converted to C++ classes by Protobuf, using the
1164 /// [Protobuf mapping rules].
1165 /// @param opts Optional. Override the class-level options, such as retry and
1166 /// backoff policies.
1167 /// @return A [`future`] that becomes satisfied when the LRO
1168 /// ([Long Running Operation]) completes or the polling policy in effect
1169 /// for this call is exhausted. The future is satisfied with an error if
1170 /// the LRO completes with an error or the polling policy is exhausted.
1171 /// In this case the [`StatusOr`] returned by the future contains the
1172 /// error. If the LRO completes successfully the value of the future
1173 /// contains the LRO's result. For this RPC the result is a
1174 /// [google.spanner.admin.database.v1.Backup] proto message.
1175 /// The C++ class representing this message is created by Protobuf, using
1176 /// the [Protobuf mapping rules].
1177 ///
1178 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1179 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1180 /// [Long Running Operation]: https://google.aip.dev/151
1181 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1182 /// [`future`]: @ref google::cloud::future
1183 /// [`StatusOr`]: @ref google::cloud::StatusOr
1184 /// [`Status`]: @ref google::cloud::Status
1185 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1186 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1187 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1188 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1189 /// [google.spanner.admin.database.v1.CopyBackupMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L254}
1190 /// [google.spanner.admin.database.v1.CopyBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L209}
1191 ///
1192 // clang-format on
1193 future<StatusOr<google::spanner::admin::database::v1::Backup>> CopyBackup(
1194 google::spanner::admin::database::v1::CopyBackupRequest const& request,
1195 Options opts = {});
1196
1197 // clang-format off
1198 ///
1199 /// Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
1200 ///
1201 /// @param name Required. Name of the backup.
1202 /// Values are of the form
1203 /// `projects/<project>/instances/<instance>/backups/<backup>`.
1204 /// @param opts Optional. Override the class-level options, such as retry and
1205 /// backoff policies.
1206 /// @return the result of the RPC. The response message type
1207 /// ([google.spanner.admin.database.v1.Backup])
1208 /// is mapped to a C++ class using the [Protobuf mapping rules].
1209 /// If the request fails, the [`StatusOr`] contains the error details.
1210 ///
1211 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1212 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1213 /// [Long Running Operation]: https://google.aip.dev/151
1214 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1215 /// [`future`]: @ref google::cloud::future
1216 /// [`StatusOr`]: @ref google::cloud::StatusOr
1217 /// [`Status`]: @ref google::cloud::Status
1218 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1219 /// [google.spanner.admin.database.v1.GetBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L305}
1220 ///
1221 // clang-format on
1222 StatusOr<google::spanner::admin::database::v1::Backup> GetBackup(
1223 std::string const& name, Options opts = {});
1224
1225 // clang-format off
1226 ///
1227 /// Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
1228 ///
1229 /// @param request Unary RPCs, such as the one wrapped by this
1230 /// function, receive a single `request` proto message which includes all
1231 /// the inputs for the RPC. In this case, the proto message is a
1232 /// [google.spanner.admin.database.v1.GetBackupRequest].
1233 /// Proto messages are converted to C++ classes by Protobuf, using the
1234 /// [Protobuf mapping rules].
1235 /// @param opts Optional. Override the class-level options, such as retry and
1236 /// backoff policies.
1237 /// @return the result of the RPC. The response message type
1238 /// ([google.spanner.admin.database.v1.Backup])
1239 /// is mapped to a C++ class using the [Protobuf mapping rules].
1240 /// If the request fails, the [`StatusOr`] contains the error details.
1241 ///
1242 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1243 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1244 /// [Long Running Operation]: https://google.aip.dev/151
1245 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1246 /// [`future`]: @ref google::cloud::future
1247 /// [`StatusOr`]: @ref google::cloud::StatusOr
1248 /// [`Status`]: @ref google::cloud::Status
1249 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1250 /// [google.spanner.admin.database.v1.GetBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L305}
1251 ///
1252 // clang-format on
1253 StatusOr<google::spanner::admin::database::v1::Backup> GetBackup(
1254 google::spanner::admin::database::v1::GetBackupRequest const& request,
1255 Options opts = {});
1256
1257 // clang-format off
1258 ///
1259 /// Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
1260 ///
1261 /// @param backup Required. The backup to update. `backup.name`, and the fields to be updated
1262 /// as specified by `update_mask` are required. Other fields are ignored.
1263 /// Update is only supported for the following fields:
1264 /// * `backup.expire_time`.
1265 /// @param update_mask Required. A mask specifying which fields (e.g. `expire_time`) in the
1266 /// Backup resource should be updated. This mask is relative to the Backup
1267 /// resource, not to the request message. The field mask must always be
1268 /// specified; this prevents any future fields from being erased accidentally
1269 /// by clients that do not know about them.
1270 /// @param opts Optional. Override the class-level options, such as retry and
1271 /// backoff policies.
1272 /// @return the result of the RPC. The response message type
1273 /// ([google.spanner.admin.database.v1.Backup])
1274 /// is mapped to a C++ class using the [Protobuf mapping rules].
1275 /// If the request fails, the [`StatusOr`] contains the error details.
1276 ///
1277 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1278 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1279 /// [Long Running Operation]: https://google.aip.dev/151
1280 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1281 /// [`future`]: @ref google::cloud::future
1282 /// [`StatusOr`]: @ref google::cloud::StatusOr
1283 /// [`Status`]: @ref google::cloud::Status
1284 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1285 /// [google.spanner.admin.database.v1.UpdateBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L289}
1286 ///
1287 // clang-format on
1288 StatusOr<google::spanner::admin::database::v1::Backup> UpdateBackup(
1289 google::spanner::admin::database::v1::Backup const& backup,
1290 google::protobuf::FieldMask const& update_mask, Options opts = {});
1291
1292 // clang-format off
1293 ///
1294 /// Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
1295 ///
1296 /// @param request Unary RPCs, such as the one wrapped by this
1297 /// function, receive a single `request` proto message which includes all
1298 /// the inputs for the RPC. In this case, the proto message is a
1299 /// [google.spanner.admin.database.v1.UpdateBackupRequest].
1300 /// Proto messages are converted to C++ classes by Protobuf, using the
1301 /// [Protobuf mapping rules].
1302 /// @param opts Optional. Override the class-level options, such as retry and
1303 /// backoff policies.
1304 /// @return the result of the RPC. The response message type
1305 /// ([google.spanner.admin.database.v1.Backup])
1306 /// is mapped to a C++ class using the [Protobuf mapping rules].
1307 /// If the request fails, the [`StatusOr`] contains the error details.
1308 ///
1309 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1310 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1311 /// [Long Running Operation]: https://google.aip.dev/151
1312 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1313 /// [`future`]: @ref google::cloud::future
1314 /// [`StatusOr`]: @ref google::cloud::StatusOr
1315 /// [`Status`]: @ref google::cloud::Status
1316 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1317 /// [google.spanner.admin.database.v1.UpdateBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L289}
1318 ///
1319 // clang-format on
1320 StatusOr<google::spanner::admin::database::v1::Backup> UpdateBackup(
1321 google::spanner::admin::database::v1::UpdateBackupRequest const& request,
1322 Options opts = {});
1323
1324 // clang-format off
1325 ///
1326 /// Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
1327 ///
1328 /// @param name Required. Name of the backup to delete.
1329 /// Values are of the form
1330 /// `projects/<project>/instances/<instance>/backups/<backup>`.
1331 /// @param opts Optional. Override the class-level options, such as retry and
1332 /// backoff policies.
1333 /// @return a [`Status`] object. If the request failed, the
1334 /// status contains the details of the failure.
1335 ///
1336 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1337 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1338 /// [Long Running Operation]: https://google.aip.dev/151
1339 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1340 /// [`future`]: @ref google::cloud::future
1341 /// [`StatusOr`]: @ref google::cloud::StatusOr
1342 /// [`Status`]: @ref google::cloud::Status
1343 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1344 /// [google.spanner.admin.database.v1.DeleteBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L318}
1345 ///
1346 // clang-format on
1347 Status DeleteBackup(std::string const& name, Options opts = {});
1348
1349 // clang-format off
1350 ///
1351 /// Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
1352 ///
1353 /// @param request Unary RPCs, such as the one wrapped by this
1354 /// function, receive a single `request` proto message which includes all
1355 /// the inputs for the RPC. In this case, the proto message is a
1356 /// [google.spanner.admin.database.v1.DeleteBackupRequest].
1357 /// Proto messages are converted to C++ classes by Protobuf, using the
1358 /// [Protobuf mapping rules].
1359 /// @param opts Optional. Override the class-level options, such as retry and
1360 /// backoff policies.
1361 /// @return a [`Status`] object. If the request failed, the
1362 /// status contains the details of the failure.
1363 ///
1364 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1365 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1366 /// [Long Running Operation]: https://google.aip.dev/151
1367 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1368 /// [`future`]: @ref google::cloud::future
1369 /// [`StatusOr`]: @ref google::cloud::StatusOr
1370 /// [`Status`]: @ref google::cloud::Status
1371 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1372 /// [google.spanner.admin.database.v1.DeleteBackupRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L318}
1373 ///
1374 // clang-format on
1376 google::spanner::admin::database::v1::DeleteBackupRequest const& request,
1377 Options opts = {});
1378
1379 // clang-format off
1380 ///
1381 /// Lists completed and pending backups.
1382 /// Backups returned are ordered by `create_time` in descending order,
1383 /// starting from the most recent `create_time`.
1384 ///
1385 /// @param parent Required. The instance to list backups from. Values are of the
1386 /// form `projects/<project>/instances/<instance>`.
1387 /// @param opts Optional. Override the class-level options, such as retry and
1388 /// backoff policies.
1389 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1390 /// to iterate of the results. See the documentation of this type for
1391 /// details. In brief, this class has `begin()` and `end()` member
1392 /// functions returning a iterator class meeting the
1393 /// [input iterator requirements]. The value type for this iterator is a
1394 /// [`StatusOr`] as the iteration may fail even after some values are
1395 /// retrieved successfully, for example, if there is a network disconnect.
1396 /// An empty set of results does not indicate an error, it indicates
1397 /// that there are no resources meeting the request criteria.
1398 /// On a successful iteration the `StatusOr<T>` contains elements of type
1399 /// [google.spanner.admin.database.v1.Backup], or rather,
1400 /// the C++ class generated by Protobuf from that type. Please consult the
1401 /// Protobuf documentation for details on the [Protobuf mapping rules].
1402 ///
1403 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1404 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1405 /// [Long Running Operation]: https://google.aip.dev/151
1406 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1407 /// [`future`]: @ref google::cloud::future
1408 /// [`StatusOr`]: @ref google::cloud::StatusOr
1409 /// [`Status`]: @ref google::cloud::Status
1410 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1411 /// [google.spanner.admin.database.v1.ListBackupsRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L331}
1412 ///
1413 // clang-format on
1414 StreamRange<google::spanner::admin::database::v1::Backup> ListBackups(
1415 std::string const& parent, Options opts = {});
1416
1417 // clang-format off
1418 ///
1419 /// Lists completed and pending backups.
1420 /// Backups returned are ordered by `create_time` in descending order,
1421 /// starting from the most recent `create_time`.
1422 ///
1423 /// @param request Unary RPCs, such as the one wrapped by this
1424 /// function, receive a single `request` proto message which includes all
1425 /// the inputs for the RPC. In this case, the proto message is a
1426 /// [google.spanner.admin.database.v1.ListBackupsRequest].
1427 /// Proto messages are converted to C++ classes by Protobuf, using the
1428 /// [Protobuf mapping rules].
1429 /// @param opts Optional. Override the class-level options, such as retry and
1430 /// backoff policies.
1431 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1432 /// to iterate of the results. See the documentation of this type for
1433 /// details. In brief, this class has `begin()` and `end()` member
1434 /// functions returning a iterator class meeting the
1435 /// [input iterator requirements]. The value type for this iterator is a
1436 /// [`StatusOr`] as the iteration may fail even after some values are
1437 /// retrieved successfully, for example, if there is a network disconnect.
1438 /// An empty set of results does not indicate an error, it indicates
1439 /// that there are no resources meeting the request criteria.
1440 /// On a successful iteration the `StatusOr<T>` contains elements of type
1441 /// [google.spanner.admin.database.v1.Backup], or rather,
1442 /// the C++ class generated by Protobuf from that type. Please consult the
1443 /// Protobuf documentation for details on the [Protobuf mapping rules].
1444 ///
1445 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1446 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1447 /// [Long Running Operation]: https://google.aip.dev/151
1448 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1449 /// [`future`]: @ref google::cloud::future
1450 /// [`StatusOr`]: @ref google::cloud::StatusOr
1451 /// [`Status`]: @ref google::cloud::Status
1452 /// [google.spanner.admin.database.v1.Backup]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
1453 /// [google.spanner.admin.database.v1.ListBackupsRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L331}
1454 ///
1455 // clang-format on
1456 StreamRange<google::spanner::admin::database::v1::Backup> ListBackups(
1457 google::spanner::admin::database::v1::ListBackupsRequest request,
1458 Options opts = {});
1459
1460 // clang-format off
1461 ///
1462 /// Create a new database by restoring from a completed backup. The new
1463 /// database must be in the same project and in an instance with the same
1464 /// instance configuration as the instance containing
1465 /// the backup. The returned database [long-running
1466 /// operation][google.longrunning.Operation] has a name of the format
1467 /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
1468 /// and can be used to track the progress of the operation, and to cancel it.
1469 /// The [metadata][google.longrunning.Operation.metadata] field type is
1470 /// [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
1471 /// The [response][google.longrunning.Operation.response] type
1472 /// is [Database][google.spanner.admin.database.v1.Database], if
1473 /// successful. Cancelling the returned operation will stop the restore and
1474 /// delete the database.
1475 /// There can be only one database being restored into an instance at a time.
1476 /// Once the restore operation completes, a new restore operation can be
1477 /// initiated, without waiting for the optimize operation associated with the
1478 /// first restore to complete.
1479 ///
1480 /// @param parent Required. The name of the instance in which to create the
1481 /// restored database. This instance must be in the same project and
1482 /// have the same instance configuration as the instance containing
1483 /// the source backup. Values are of the form
1484 /// `projects/<project>/instances/<instance>`.
1485 /// @param database_id Required. The id of the database to create and restore to. This
1486 /// database must not already exist. The `database_id` appended to
1487 /// `parent` forms the full database name of the form
1488 /// `projects/<project>/instances/<instance>/databases/<database_id>`.
1489 /// @param backup Name of the backup from which to restore. Values are of the form
1490 /// `projects/<project>/instances/<instance>/backups/<backup>`.
1491 /// @param opts Optional. Override the class-level options, such as retry and
1492 /// backoff policies.
1493 /// @return A [`future`] that becomes satisfied when the LRO
1494 /// ([Long Running Operation]) completes or the polling policy in effect
1495 /// for this call is exhausted. The future is satisfied with an error if
1496 /// the LRO completes with an error or the polling policy is exhausted.
1497 /// In this case the [`StatusOr`] returned by the future contains the
1498 /// error. If the LRO completes successfully the value of the future
1499 /// contains the LRO's result. For this RPC the result is a
1500 /// [google.spanner.admin.database.v1.Database] proto message.
1501 /// The C++ class representing this message is created by Protobuf, using
1502 /// the [Protobuf mapping rules].
1503 ///
1504 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1505 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1506 /// [Long Running Operation]: https://google.aip.dev/151
1507 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1508 /// [`future`]: @ref google::cloud::future
1509 /// [`StatusOr`]: @ref google::cloud::StatusOr
1510 /// [`Status`]: @ref google::cloud::Status
1511 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1512 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1513 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1514 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
1515 /// [google.spanner.admin.database.v1.RestoreDatabaseMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L926}
1516 /// [google.spanner.admin.database.v1.RestoreDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L852}
1517 ///
1518 // clang-format on
1519 future<StatusOr<google::spanner::admin::database::v1::Database>>
1520 RestoreDatabase(std::string const& parent, std::string const& database_id,
1521 std::string const& backup, Options opts = {});
1522
1523 // clang-format off
1524 ///
1525 /// Create a new database by restoring from a completed backup. The new
1526 /// database must be in the same project and in an instance with the same
1527 /// instance configuration as the instance containing
1528 /// the backup. The returned database [long-running
1529 /// operation][google.longrunning.Operation] has a name of the format
1530 /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
1531 /// and can be used to track the progress of the operation, and to cancel it.
1532 /// The [metadata][google.longrunning.Operation.metadata] field type is
1533 /// [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
1534 /// The [response][google.longrunning.Operation.response] type
1535 /// is [Database][google.spanner.admin.database.v1.Database], if
1536 /// successful. Cancelling the returned operation will stop the restore and
1537 /// delete the database.
1538 /// There can be only one database being restored into an instance at a time.
1539 /// Once the restore operation completes, a new restore operation can be
1540 /// initiated, without waiting for the optimize operation associated with the
1541 /// first restore to complete.
1542 ///
1543 /// @param request Unary RPCs, such as the one wrapped by this
1544 /// function, receive a single `request` proto message which includes all
1545 /// the inputs for the RPC. In this case, the proto message is a
1546 /// [google.spanner.admin.database.v1.RestoreDatabaseRequest].
1547 /// Proto messages are converted to C++ classes by Protobuf, using the
1548 /// [Protobuf mapping rules].
1549 /// @param opts Optional. Override the class-level options, such as retry and
1550 /// backoff policies.
1551 /// @return A [`future`] that becomes satisfied when the LRO
1552 /// ([Long Running Operation]) completes or the polling policy in effect
1553 /// for this call is exhausted. The future is satisfied with an error if
1554 /// the LRO completes with an error or the polling policy is exhausted.
1555 /// In this case the [`StatusOr`] returned by the future contains the
1556 /// error. If the LRO completes successfully the value of the future
1557 /// contains the LRO's result. For this RPC the result is a
1558 /// [google.spanner.admin.database.v1.Database] proto message.
1559 /// The C++ class representing this message is created by Protobuf, using
1560 /// the [Protobuf mapping rules].
1561 ///
1562 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1563 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1564 /// [Long Running Operation]: https://google.aip.dev/151
1565 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1566 /// [`future`]: @ref google::cloud::future
1567 /// [`StatusOr`]: @ref google::cloud::StatusOr
1568 /// [`Status`]: @ref google::cloud::Status
1569 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1570 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1571 /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L160}
1572 /// [google.spanner.admin.database.v1.Database]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L415}
1573 /// [google.spanner.admin.database.v1.RestoreDatabaseMetadata]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L926}
1574 /// [google.spanner.admin.database.v1.RestoreDatabaseRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L852}
1575 ///
1576 // clang-format on
1577 future<StatusOr<google::spanner::admin::database::v1::Database>>
1579 google::spanner::admin::database::v1::RestoreDatabaseRequest const&
1580 request,
1581 Options opts = {});
1582
1583 // clang-format off
1584 ///
1585 /// Lists database [longrunning-operations][google.longrunning.Operation].
1586 /// A database operation has a name of the form
1587 /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
1588 /// The long-running operation
1589 /// [metadata][google.longrunning.Operation.metadata] field type
1590 /// `metadata.type_url` describes the type of the metadata. Operations returned
1591 /// include those that have completed/failed/canceled within the last 7 days,
1592 /// and pending operations.
1593 ///
1594 /// @param parent Required. The instance of the database operations.
1595 /// Values are of the form `projects/<project>/instances/<instance>`.
1596 /// @param opts Optional. Override the class-level options, such as retry and
1597 /// backoff policies.
1598 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1599 /// to iterate of the results. See the documentation of this type for
1600 /// details. In brief, this class has `begin()` and `end()` member
1601 /// functions returning a iterator class meeting the
1602 /// [input iterator requirements]. The value type for this iterator is a
1603 /// [`StatusOr`] as the iteration may fail even after some values are
1604 /// retrieved successfully, for example, if there is a network disconnect.
1605 /// An empty set of results does not indicate an error, it indicates
1606 /// that there are no resources meeting the request criteria.
1607 /// On a successful iteration the `StatusOr<T>` contains elements of type
1608 /// [google.longrunning.Operation], or rather,
1609 /// the C++ class generated by Protobuf from that type. Please consult the
1610 /// Protobuf documentation for details on the [Protobuf mapping rules].
1611 ///
1612 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1613 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1614 /// [Long Running Operation]: https://google.aip.dev/151
1615 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1616 /// [`future`]: @ref google::cloud::future
1617 /// [`StatusOr`]: @ref google::cloud::StatusOr
1618 /// [`Status`]: @ref google::cloud::Status
1619 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1620 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1621 /// [google.spanner.admin.database.v1.ListDatabaseOperationsRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L769}
1622 ///
1623 // clang-format on
1624 StreamRange<google::longrunning::Operation> ListDatabaseOperations(
1625 std::string const& parent, Options opts = {});
1626
1627 // clang-format off
1628 ///
1629 /// Lists database [longrunning-operations][google.longrunning.Operation].
1630 /// A database operation has a name of the form
1631 /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
1632 /// The long-running operation
1633 /// [metadata][google.longrunning.Operation.metadata] field type
1634 /// `metadata.type_url` describes the type of the metadata. Operations returned
1635 /// include those that have completed/failed/canceled within the last 7 days,
1636 /// and pending operations.
1637 ///
1638 /// @param request Unary RPCs, such as the one wrapped by this
1639 /// function, receive a single `request` proto message which includes all
1640 /// the inputs for the RPC. In this case, the proto message is a
1641 /// [google.spanner.admin.database.v1.ListDatabaseOperationsRequest].
1642 /// Proto messages are converted to C++ classes by Protobuf, using the
1643 /// [Protobuf mapping rules].
1644 /// @param opts Optional. Override the class-level options, such as retry and
1645 /// backoff policies.
1646 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1647 /// to iterate of the results. See the documentation of this type for
1648 /// details. In brief, this class has `begin()` and `end()` member
1649 /// functions returning a iterator class meeting the
1650 /// [input iterator requirements]. The value type for this iterator is a
1651 /// [`StatusOr`] as the iteration may fail even after some values are
1652 /// retrieved successfully, for example, if there is a network disconnect.
1653 /// An empty set of results does not indicate an error, it indicates
1654 /// that there are no resources meeting the request criteria.
1655 /// On a successful iteration the `StatusOr<T>` contains elements of type
1656 /// [google.longrunning.Operation], or rather,
1657 /// the C++ class generated by Protobuf from that type. Please consult the
1658 /// Protobuf documentation for details on the [Protobuf mapping rules].
1659 ///
1660 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1661 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1662 /// [Long Running Operation]: https://google.aip.dev/151
1663 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1664 /// [`future`]: @ref google::cloud::future
1665 /// [`StatusOr`]: @ref google::cloud::StatusOr
1666 /// [`Status`]: @ref google::cloud::Status
1667 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1668 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1669 /// [google.spanner.admin.database.v1.ListDatabaseOperationsRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L769}
1670 ///
1671 // clang-format on
1672 StreamRange<google::longrunning::Operation> ListDatabaseOperations(
1673 google::spanner::admin::database::v1::ListDatabaseOperationsRequest
1674 request,
1675 Options opts = {});
1676
1677 // clang-format off
1678 ///
1679 /// Lists the backup [long-running operations][google.longrunning.Operation] in
1680 /// the given instance. A backup operation has a name of the form
1681 /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
1682 /// The long-running operation
1683 /// [metadata][google.longrunning.Operation.metadata] field type
1684 /// `metadata.type_url` describes the type of the metadata. Operations returned
1685 /// include those that have completed/failed/canceled within the last 7 days,
1686 /// and pending operations. Operations returned are ordered by
1687 /// `operation.metadata.value.progress.start_time` in descending order starting
1688 /// from the most recently started operation.
1689 ///
1690 /// @param parent Required. The instance of the backup operations. Values are of
1691 /// the form `projects/<project>/instances/<instance>`.
1692 /// @param opts Optional. Override the class-level options, such as retry and
1693 /// backoff policies.
1694 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1695 /// to iterate of the results. See the documentation of this type for
1696 /// details. In brief, this class has `begin()` and `end()` member
1697 /// functions returning a iterator class meeting the
1698 /// [input iterator requirements]. The value type for this iterator is a
1699 /// [`StatusOr`] as the iteration may fail even after some values are
1700 /// retrieved successfully, for example, if there is a network disconnect.
1701 /// An empty set of results does not indicate an error, it indicates
1702 /// that there are no resources meeting the request criteria.
1703 /// On a successful iteration the `StatusOr<T>` contains elements of type
1704 /// [google.longrunning.Operation], or rather,
1705 /// the C++ class generated by Protobuf from that type. Please consult the
1706 /// Protobuf documentation for details on the [Protobuf mapping rules].
1707 ///
1708 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1709 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1710 /// [Long Running Operation]: https://google.aip.dev/151
1711 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1712 /// [`future`]: @ref google::cloud::future
1713 /// [`StatusOr`]: @ref google::cloud::StatusOr
1714 /// [`Status`]: @ref google::cloud::Status
1715 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1716 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1717 /// [google.spanner.admin.database.v1.ListBackupOperationsRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L403}
1718 ///
1719 // clang-format on
1720 StreamRange<google::longrunning::Operation> ListBackupOperations(
1721 std::string const& parent, Options opts = {});
1722
1723 // clang-format off
1724 ///
1725 /// Lists the backup [long-running operations][google.longrunning.Operation] in
1726 /// the given instance. A backup operation has a name of the form
1727 /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
1728 /// The long-running operation
1729 /// [metadata][google.longrunning.Operation.metadata] field type
1730 /// `metadata.type_url` describes the type of the metadata. Operations returned
1731 /// include those that have completed/failed/canceled within the last 7 days,
1732 /// and pending operations. Operations returned are ordered by
1733 /// `operation.metadata.value.progress.start_time` in descending order starting
1734 /// from the most recently started operation.
1735 ///
1736 /// @param request Unary RPCs, such as the one wrapped by this
1737 /// function, receive a single `request` proto message which includes all
1738 /// the inputs for the RPC. In this case, the proto message is a
1739 /// [google.spanner.admin.database.v1.ListBackupOperationsRequest].
1740 /// Proto messages are converted to C++ classes by Protobuf, using the
1741 /// [Protobuf mapping rules].
1742 /// @param opts Optional. Override the class-level options, such as retry and
1743 /// backoff policies.
1744 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1745 /// to iterate of the results. See the documentation of this type for
1746 /// details. In brief, this class has `begin()` and `end()` member
1747 /// functions returning a iterator class meeting the
1748 /// [input iterator requirements]. The value type for this iterator is a
1749 /// [`StatusOr`] as the iteration may fail even after some values are
1750 /// retrieved successfully, for example, if there is a network disconnect.
1751 /// An empty set of results does not indicate an error, it indicates
1752 /// that there are no resources meeting the request criteria.
1753 /// On a successful iteration the `StatusOr<T>` contains elements of type
1754 /// [google.longrunning.Operation], or rather,
1755 /// the C++ class generated by Protobuf from that type. Please consult the
1756 /// Protobuf documentation for details on the [Protobuf mapping rules].
1757 ///
1758 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1759 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1760 /// [Long Running Operation]: https://google.aip.dev/151
1761 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1762 /// [`future`]: @ref google::cloud::future
1763 /// [`StatusOr`]: @ref google::cloud::StatusOr
1764 /// [`Status`]: @ref google::cloud::Status
1765 /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L128}
1766 /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L138}
1767 /// [google.spanner.admin.database.v1.ListBackupOperationsRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L403}
1768 ///
1769 // clang-format on
1770 StreamRange<google::longrunning::Operation> ListBackupOperations(
1771 google::spanner::admin::database::v1::ListBackupOperationsRequest request,
1772 Options opts = {});
1773
1774 // clang-format off
1775 ///
1776 /// Lists Cloud Spanner database roles.
1777 ///
1778 /// @param parent Required. The database whose roles should be listed.
1779 /// Values are of the form
1780 /// `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
1781 /// @param opts Optional. Override the class-level options, such as retry and
1782 /// backoff policies.
1783 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1784 /// to iterate of the results. See the documentation of this type for
1785 /// details. In brief, this class has `begin()` and `end()` member
1786 /// functions returning a iterator class meeting the
1787 /// [input iterator requirements]. The value type for this iterator is a
1788 /// [`StatusOr`] as the iteration may fail even after some values are
1789 /// retrieved successfully, for example, if there is a network disconnect.
1790 /// An empty set of results does not indicate an error, it indicates
1791 /// that there are no resources meeting the request criteria.
1792 /// On a successful iteration the `StatusOr<T>` contains elements of type
1793 /// [google.spanner.admin.database.v1.DatabaseRole], or rather,
1794 /// the C++ class generated by Protobuf from that type. Please consult the
1795 /// Protobuf documentation for details on the [Protobuf mapping rules].
1796 ///
1797 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1798 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1799 /// [Long Running Operation]: https://google.aip.dev/151
1800 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1801 /// [`future`]: @ref google::cloud::future
1802 /// [`StatusOr`]: @ref google::cloud::StatusOr
1803 /// [`Status`]: @ref google::cloud::Status
1804 /// [google.spanner.admin.database.v1.DatabaseRole]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L998}
1805 /// [google.spanner.admin.database.v1.ListDatabaseRolesRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L1013}
1806 ///
1807 // clang-format on
1808 StreamRange<google::spanner::admin::database::v1::DatabaseRole>
1809 ListDatabaseRoles(std::string const& parent, Options opts = {});
1810
1811 // clang-format off
1812 ///
1813 /// Lists Cloud Spanner database roles.
1814 ///
1815 /// @param request Unary RPCs, such as the one wrapped by this
1816 /// function, receive a single `request` proto message which includes all
1817 /// the inputs for the RPC. In this case, the proto message is a
1818 /// [google.spanner.admin.database.v1.ListDatabaseRolesRequest].
1819 /// Proto messages are converted to C++ classes by Protobuf, using the
1820 /// [Protobuf mapping rules].
1821 /// @param opts Optional. Override the class-level options, such as retry and
1822 /// backoff policies.
1823 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1824 /// to iterate of the results. See the documentation of this type for
1825 /// details. In brief, this class has `begin()` and `end()` member
1826 /// functions returning a iterator class meeting the
1827 /// [input iterator requirements]. The value type for this iterator is a
1828 /// [`StatusOr`] as the iteration may fail even after some values are
1829 /// retrieved successfully, for example, if there is a network disconnect.
1830 /// An empty set of results does not indicate an error, it indicates
1831 /// that there are no resources meeting the request criteria.
1832 /// On a successful iteration the `StatusOr<T>` contains elements of type
1833 /// [google.spanner.admin.database.v1.DatabaseRole], or rather,
1834 /// the C++ class generated by Protobuf from that type. Please consult the
1835 /// Protobuf documentation for details on the [Protobuf mapping rules].
1836 ///
1837 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1838 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1839 /// [Long Running Operation]: https://google.aip.dev/151
1840 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1841 /// [`future`]: @ref google::cloud::future
1842 /// [`StatusOr`]: @ref google::cloud::StatusOr
1843 /// [`Status`]: @ref google::cloud::Status
1844 /// [google.spanner.admin.database.v1.DatabaseRole]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L998}
1845 /// [google.spanner.admin.database.v1.ListDatabaseRolesRequest]: @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L1013}
1846 ///
1847 // clang-format on
1848 StreamRange<google::spanner::admin::database::v1::DatabaseRole>
1850 google::spanner::admin::database::v1::ListDatabaseRolesRequest request,
1851 Options opts = {});
1852
1853 private:
1854 std::shared_ptr<DatabaseAdminConnection> connection_;
1855 Options options_;
1856};
1857
1858GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
1859namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
1860} // namespace spanner_admin
1861} // namespace cloud
1862} // namespace google
1863
1864#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_DATABASE_ADMIN_CLIENT_H
friend friend class future
Cloud Spanner Database Admin API.
Definition: database_admin_client.h:69
friend bool operator!=(DatabaseAdminClient const &a, DatabaseAdminClient const &b)
Definition: database_admin_client.h:89
StreamRange< google::spanner::admin::database::v1::Database > ListDatabases(std::string const &parent, Options opts={})
Lists Cloud Spanner databases.
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, IamUpdater const &updater, Options opts={})
Updates the IAM policy for resource using an optimistic concurrency control loop.
StreamRange< google::longrunning::Operation > ListBackupOperations(std::string const &parent, Options opts={})
Lists the backup long-running operations in the given instance.
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabaseDdl(google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const &request, Options opts={})
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables,...
DatabaseAdminClient(std::shared_ptr< DatabaseAdminConnection > connection, Options opts={})
future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase(google::spanner::admin::database::v1::RestoreDatabaseRequest const &request, Options opts={})
Create a new database by restoring from a completed backup.
DatabaseAdminClient & operator=(DatabaseAdminClient &&)=default
StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
Sets the access control policy on a database or backup resource.
StreamRange< google::longrunning::Operation > ListDatabaseOperations(std::string const &parent, Options opts={})
Lists database longrunning-operations.
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
Returns permissions that the caller has on the specified database or backup resource.
future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase(google::spanner::admin::database::v1::CreateDatabaseRequest const &request, Options opts={})
Creates a new Cloud Spanner database and starts to prepare it for serving.
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl(google::spanner::admin::database::v1::GetDatabaseDdlRequest const &request, Options opts={})
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements.
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabaseDdl(std::string const &database, std::vector< std::string > const &statements, Options opts={})
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables,...
StatusOr< google::spanner::admin::database::v1::Backup > GetBackup(google::spanner::admin::database::v1::GetBackupRequest const &request, Options opts={})
Gets metadata on a pending or completed Backup.
StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
Gets the access control policy for a database or backup resource.
future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase(std::string const &parent, std::string const &database_id, std::string const &backup, Options opts={})
Create a new database by restoring from a completed backup.
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, google::iam::v1::Policy const &policy, Options opts={})
Sets the access control policy on a database or backup resource.
Status DropDatabase(google::spanner::admin::database::v1::DropDatabaseRequest const &request, Options opts={})
Drops (aka deletes) a Cloud Spanner database.
future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase(std::string const &parent, std::string const &create_statement, Options opts={})
Creates a new Cloud Spanner database and starts to prepare it for serving.
StreamRange< google::spanner::admin::database::v1::DatabaseRole > ListDatabaseRoles(std::string const &parent, Options opts={})
Lists Cloud Spanner database roles.
StreamRange< google::spanner::admin::database::v1::Database > ListDatabases(google::spanner::admin::database::v1::ListDatabasesRequest request, Options opts={})
Lists Cloud Spanner databases.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CopyBackup(google::spanner::admin::database::v1::CopyBackupRequest const &request, Options opts={})
Starts copying a Cloud Spanner Backup.
future< StatusOr< google::spanner::admin::database::v1::Database > > UpdateDatabase(google::spanner::admin::database::v1::Database const &database, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates a Cloud Spanner database.
Status DeleteBackup(std::string const &name, Options opts={})
Deletes a pending or completed Backup.
StreamRange< google::spanner::admin::database::v1::DatabaseRole > ListDatabaseRoles(google::spanner::admin::database::v1::ListDatabaseRolesRequest request, Options opts={})
Lists Cloud Spanner database roles.
StreamRange< google::spanner::admin::database::v1::Backup > ListBackups(google::spanner::admin::database::v1::ListBackupsRequest request, Options opts={})
Lists completed and pending backups.
DatabaseAdminClient(DatabaseAdminClient &&)=default
DatabaseAdminClient(DatabaseAdminClient const &)=default
StatusOr< google::iam::v1::Policy > GetIamPolicy(std::string const &resource, Options opts={})
Gets the access control policy for a database or backup resource.
StatusOr< google::spanner::admin::database::v1::Database > GetDatabase(std::string const &name, Options opts={})
Gets the state of a Cloud Spanner database.
StatusOr< google::spanner::admin::database::v1::Backup > GetBackup(std::string const &name, Options opts={})
Gets metadata on a pending or completed Backup.
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackup(google::spanner::admin::database::v1::UpdateBackupRequest const &request, Options opts={})
Updates a pending or completed Backup.
future< StatusOr< google::spanner::admin::database::v1::Database > > UpdateDatabase(google::spanner::admin::database::v1::UpdateDatabaseRequest const &request, Options opts={})
Updates a Cloud Spanner database.
StatusOr< google::spanner::admin::database::v1::Database > GetDatabase(google::spanner::admin::database::v1::GetDatabaseRequest const &request, Options opts={})
Gets the state of a Cloud Spanner database.
friend bool operator==(DatabaseAdminClient const &a, DatabaseAdminClient const &b)
Definition: database_admin_client.h:85
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(std::string const &resource, std::vector< std::string > const &permissions, Options opts={})
Returns permissions that the caller has on the specified database or backup resource.
Status DeleteBackup(google::spanner::admin::database::v1::DeleteBackupRequest const &request, Options opts={})
Deletes a pending or completed Backup.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup(google::spanner::admin::database::v1::CreateBackupRequest const &request, Options opts={})
Starts creating a new Cloud Spanner Backup.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CopyBackup(std::string const &parent, std::string const &backup_id, std::string const &source_backup, google::protobuf::Timestamp const &expire_time, Options opts={})
Starts copying a Cloud Spanner Backup.
DatabaseAdminClient & operator=(DatabaseAdminClient const &)=default
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl(std::string const &database, Options opts={})
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements.
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackup(google::spanner::admin::database::v1::Backup const &backup, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates a pending or completed Backup.
StreamRange< google::longrunning::Operation > ListDatabaseOperations(google::spanner::admin::database::v1::ListDatabaseOperationsRequest request, Options opts={})
Lists database longrunning-operations.
StreamRange< google::spanner::admin::database::v1::Backup > ListBackups(std::string const &parent, Options opts={})
Lists completed and pending backups.
StreamRange< google::longrunning::Operation > ListBackupOperations(google::spanner::admin::database::v1::ListBackupOperationsRequest request, Options opts={})
Lists the backup long-running operations in the given instance.
Status DropDatabase(std::string const &database, Options opts={})
Drops (aka deletes) a Cloud Spanner database.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup(std::string const &parent, google::spanner::admin::database::v1::Backup const &backup, std::string const &backup_id, Options opts={})
Starts creating a new Cloud Spanner Backup.
The DatabaseAdminConnection object for DatabaseAdminClient.
Definition: database_admin_connection.h:64
Definition: database_admin_client.h:34