Google Cloud Spanner C++ Client  2.1.0
A C++ Client Library for Google Cloud Spanner
database_admin_client.h
Go to the documentation of this file.
1 // Copyright 2021 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 // Generated by the Codegen C++ plugin.
16 // If you make any local changes, they will be lost.
17 // source: google/spanner/admin/database/v1/spanner_database_admin.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_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 
32 namespace google {
33 namespace cloud {
34 namespace spanner_admin {
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:
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  ///
96  /// Lists Cloud Spanner databases.
97  ///
98  /// @param parent Required. The instance whose databases should be listed.
99  /// Values are of the form `projects/<project>/instances/<instance>`.
100  /// @param opts Optional. Override the class-level options, such as retry and
101  /// backoff policies.
102  /// @return
103  /// @googleapis_link{google::spanner::admin::database::v1::Database,google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
104  ///
105  /// [google.spanner.admin.database.v1.ListDatabasesRequest]:
106  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L455}
107  /// [google.spanner.admin.database.v1.Database]:
108  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
109  ///
110  StreamRange<google::spanner::admin::database::v1::Database> ListDatabases(
111  std::string const& parent, Options opts = {});
112 
113  ///
114  /// Lists Cloud Spanner databases.
115  ///
116  /// @param request
117  /// @googleapis_link{google::spanner::admin::database::v1::ListDatabasesRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L455}
118  /// @param opts Optional. Override the class-level options, such as retry and
119  /// backoff policies.
120  /// @return
121  /// @googleapis_link{google::spanner::admin::database::v1::Database,google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
122  ///
123  /// [google.spanner.admin.database.v1.ListDatabasesRequest]:
124  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L455}
125  /// [google.spanner.admin.database.v1.Database]:
126  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
127  ///
128  StreamRange<google::spanner::admin::database::v1::Database> ListDatabases(
129  google::spanner::admin::database::v1::ListDatabasesRequest request,
130  Options opts = {});
131 
132  ///
133  /// Creates a new Cloud Spanner database and starts to prepare it for serving.
134  /// The returned [long-running operation][google.longrunning.Operation] will
135  /// have a name of the format `<database_name>/operations/<operation_id>` and
136  /// can be used to track preparation of the database. The
137  /// [metadata][google.longrunning.Operation.metadata] field type is
138  /// [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata].
139  /// The [response][google.longrunning.Operation.response] field type is
140  /// [Database][google.spanner.admin.database.v1.Database], if successful.
141  ///
142  /// @param parent Required. The name of the instance that will serve the new
143  /// database.
144  /// Values are of the form `projects/<project>/instances/<instance>`.
145  /// @param create_statement Required. A `CREATE DATABASE` statement, which
146  /// specifies the ID of the
147  /// new database. The database ID must conform to the regular expression
148  /// `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length.
149  /// If the database ID is a reserved word or if it contains a hyphen, the
150  /// database ID must be enclosed in backticks (`` ` ``).
151  /// @param opts Optional. Override the class-level options, such as retry and
152  /// backoff policies.
153  /// @return
154  /// @googleapis_link{google::spanner::admin::database::v1::Database,google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
155  ///
156  /// [google.spanner.admin.database.v1.CreateDatabaseRequest]:
157  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L487}
158  /// [google.spanner.admin.database.v1.Database]:
159  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
160  ///
161  future<StatusOr<google::spanner::admin::database::v1::Database>>
162  CreateDatabase(std::string const& parent, std::string const& create_statement,
163  Options opts = {});
164 
165  ///
166  /// Creates a new Cloud Spanner database and starts to prepare it for serving.
167  /// The returned [long-running operation][google.longrunning.Operation] will
168  /// have a name of the format `<database_name>/operations/<operation_id>` and
169  /// can be used to track preparation of the database. The
170  /// [metadata][google.longrunning.Operation.metadata] field type is
171  /// [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata].
172  /// The [response][google.longrunning.Operation.response] field type is
173  /// [Database][google.spanner.admin.database.v1.Database], if successful.
174  ///
175  /// @param request
176  /// @googleapis_link{google::spanner::admin::database::v1::CreateDatabaseRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L487}
177  /// @param opts Optional. Override the class-level options, such as retry and
178  /// backoff policies.
179  /// @return
180  /// @googleapis_link{google::spanner::admin::database::v1::Database,google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
181  ///
182  /// [google.spanner.admin.database.v1.CreateDatabaseRequest]:
183  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L487}
184  /// [google.spanner.admin.database.v1.Database]:
185  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
186  ///
187  future<StatusOr<google::spanner::admin::database::v1::Database>>
189  google::spanner::admin::database::v1::CreateDatabaseRequest const&
190  request,
191  Options opts = {});
192 
193  ///
194  /// Gets the state of a Cloud Spanner database.
195  ///
196  /// @param name Required. The name of the requested database. Values are of
197  /// the form
198  /// `projects/<project>/instances/<instance>/databases/<database>`.
199  /// @param opts Optional. Override the class-level options, such as retry and
200  /// backoff policies.
201  /// @return
202  /// @googleapis_link{google::spanner::admin::database::v1::Database,google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
203  ///
204  /// [google.spanner.admin.database.v1.GetDatabaseRequest]:
205  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L529}
206  /// [google.spanner.admin.database.v1.Database]:
207  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
208  ///
209  StatusOr<google::spanner::admin::database::v1::Database> GetDatabase(
210  std::string const& name, Options opts = {});
211 
212  ///
213  /// Gets the state of a Cloud Spanner database.
214  ///
215  /// @param request
216  /// @googleapis_link{google::spanner::admin::database::v1::GetDatabaseRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L529}
217  /// @param opts Optional. Override the class-level options, such as retry and
218  /// backoff policies.
219  /// @return
220  /// @googleapis_link{google::spanner::admin::database::v1::Database,google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
221  ///
222  /// [google.spanner.admin.database.v1.GetDatabaseRequest]:
223  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L529}
224  /// [google.spanner.admin.database.v1.Database]:
225  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
226  ///
227  StatusOr<google::spanner::admin::database::v1::Database> GetDatabase(
228  google::spanner::admin::database::v1::GetDatabaseRequest const& request,
229  Options opts = {});
230 
231  ///
232  /// Updates the schema of a Cloud Spanner database by
233  /// creating/altering/dropping tables, columns, indexes, etc. The returned
234  /// [long-running operation][google.longrunning.Operation] will have a name of
235  /// the format `<database_name>/operations/<operation_id>` and can be used to
236  /// track execution of the schema change(s). The
237  /// [metadata][google.longrunning.Operation.metadata] field type is
238  /// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
239  /// The operation has no response.
240  ///
241  /// @param database Required. The database to update.
242  /// @param statements Required. DDL statements to be applied to the database.
243  /// @param opts Optional. Override the class-level options, such as retry and
244  /// backoff policies.
245  /// @return
246  /// @googleapis_link{google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata,google/spanner/admin/database/v1/spanner_database_admin.proto#L592}
247  ///
248  /// [google.spanner.admin.database.v1.UpdateDatabaseDdlRequest]:
249  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L556}
250  /// [google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]:
251  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L592}
252  ///
253  future<
254  StatusOr<google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
255  UpdateDatabaseDdl(std::string const& database,
256  std::vector<std::string> const& statements,
257  Options opts = {});
258 
259  ///
260  /// Updates the schema of a Cloud Spanner database by
261  /// creating/altering/dropping tables, columns, indexes, etc. The returned
262  /// [long-running operation][google.longrunning.Operation] will have a name of
263  /// the format `<database_name>/operations/<operation_id>` and can be used to
264  /// track execution of the schema change(s). The
265  /// [metadata][google.longrunning.Operation.metadata] field type is
266  /// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
267  /// The operation has no response.
268  ///
269  /// @param request
270  /// @googleapis_link{google::spanner::admin::database::v1::UpdateDatabaseDdlRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L556}
271  /// @param opts Optional. Override the class-level options, such as retry and
272  /// backoff policies.
273  /// @return
274  /// @googleapis_link{google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata,google/spanner/admin/database/v1/spanner_database_admin.proto#L592}
275  ///
276  /// [google.spanner.admin.database.v1.UpdateDatabaseDdlRequest]:
277  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L556}
278  /// [google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]:
279  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L592}
280  ///
281  future<
282  StatusOr<google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
284  google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
285  request,
286  Options opts = {});
287 
288  ///
289  /// Drops (aka deletes) a Cloud Spanner database.
290  /// Completed backups for the database will be retained according to their
291  /// `expire_time`.
292  /// Note: Cloud Spanner might continue to accept requests for a few seconds
293  /// after the database has been deleted.
294  ///
295  /// @param database Required. The database to be dropped.
296  /// @param opts Optional. Override the class-level options, such as retry and
297  /// backoff policies.
298  ///
299  /// [google.spanner.admin.database.v1.DropDatabaseRequest]:
300  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L624}
301  ///
302  Status DropDatabase(std::string const& database, Options opts = {});
303 
304  ///
305  /// Drops (aka deletes) a Cloud Spanner database.
306  /// Completed backups for the database will be retained according to their
307  /// `expire_time`.
308  /// Note: Cloud Spanner might continue to accept requests for a few seconds
309  /// after the database has been deleted.
310  ///
311  /// @param request
312  /// @googleapis_link{google::spanner::admin::database::v1::DropDatabaseRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L624}
313  /// @param opts Optional. Override the class-level options, such as retry and
314  /// backoff policies.
315  ///
316  /// [google.spanner.admin.database.v1.DropDatabaseRequest]:
317  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L624}
318  ///
320  google::spanner::admin::database::v1::DropDatabaseRequest const& request,
321  Options opts = {});
322 
323  ///
324  /// Returns the schema of a Cloud Spanner database as a list of formatted
325  /// DDL statements. This method does not show pending schema updates, those
326  /// may be queried using the [Operations][google.longrunning.Operations] API.
327  ///
328  /// @param database Required. The database whose schema we wish to get.
329  /// Values are of the form
330  /// `projects/<project>/instances/<instance>/databases/<database>`
331  /// @param opts Optional. Override the class-level options, such as retry and
332  /// backoff policies.
333  /// @return
334  /// @googleapis_link{google::spanner::admin::database::v1::GetDatabaseDdlResponse,google/spanner/admin/database/v1/spanner_database_admin.proto#L648}
335  ///
336  /// [google.spanner.admin.database.v1.GetDatabaseDdlRequest]:
337  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L635}
338  /// [google.spanner.admin.database.v1.GetDatabaseDdlResponse]:
339  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L648}
340  ///
341  StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
342  GetDatabaseDdl(std::string const& database, Options opts = {});
343 
344  ///
345  /// Returns the schema of a Cloud Spanner database as a list of formatted
346  /// DDL statements. This method does not show pending schema updates, those
347  /// may be queried using the [Operations][google.longrunning.Operations] API.
348  ///
349  /// @param request
350  /// @googleapis_link{google::spanner::admin::database::v1::GetDatabaseDdlRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L635}
351  /// @param opts Optional. Override the class-level options, such as retry and
352  /// backoff policies.
353  /// @return
354  /// @googleapis_link{google::spanner::admin::database::v1::GetDatabaseDdlResponse,google/spanner/admin/database/v1/spanner_database_admin.proto#L648}
355  ///
356  /// [google.spanner.admin.database.v1.GetDatabaseDdlRequest]:
357  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L635}
358  /// [google.spanner.admin.database.v1.GetDatabaseDdlResponse]:
359  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L648}
360  ///
361  StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>
363  google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
364  request,
365  Options opts = {});
366 
367  ///
368  /// Sets the access control policy on a database or backup resource.
369  /// Replaces any existing policy.
370  ///
371  /// Authorization requires `spanner.databases.setIamPolicy`
372  /// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
373  /// For backups, authorization requires `spanner.backups.setIamPolicy`
374  /// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
375  ///
376  /// @param resource REQUIRED: The resource for which the policy is being
377  /// specified.
378  /// See the operation documentation for the appropriate value for this field.
379  /// @param policy REQUIRED: The complete policy to be applied to the
380  /// `resource`. The size of
381  /// the policy is limited to a few 10s of KB. An empty policy is a
382  /// valid policy but certain Cloud Platform services (such as Projects)
383  /// might reject them.
384  /// @param opts Optional. Override the class-level options, such as retry and
385  /// backoff policies.
386  /// @return
387  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
388  ///
389  /// [google.iam.v1.SetIamPolicyRequest]:
390  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
391  /// [google.iam.v1.Policy]:
392  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
393  ///
394  StatusOr<google::iam::v1::Policy> SetIamPolicy(
395  std::string const& resource, google::iam::v1::Policy const& policy,
396  Options opts = {});
397 
398  /**
399  * Updates the IAM policy for @p resource using an optimistic concurrency
400  * control loop.
401  *
402  * The loop fetches the current policy for @p resource, and passes it to @p
403  * updater, which should return the new policy. This new policy should use the
404  * current etag so that the read-modify-write cycle can detect races and rerun
405  * the update when there is a mismatch. If the new policy does not have an
406  * etag, the existing policy will be blindly overwritten. If @p updater does
407  * not yield a policy, the control loop is terminated and kCancelled is
408  * returned.
409  *
410  * @param resource Required. The resource for which the policy is being
411  * specified. See the operation documentation for the appropriate value for
412  * this field.
413  * @param updater Required. Functor to map the current policy to a new one.
414  * @param opts Optional. Override the class-level options, such as retry and
415  * backoff policies.
416  * @return google::iam::v1::Policy
417  */
418  StatusOr<google::iam::v1::Policy> SetIamPolicy(std::string const& resource,
419  IamUpdater const& updater,
420  Options opts = {});
421 
422  ///
423  /// Sets the access control policy on a database or backup resource.
424  /// Replaces any existing policy.
425  ///
426  /// Authorization requires `spanner.databases.setIamPolicy`
427  /// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
428  /// For backups, authorization requires `spanner.backups.setIamPolicy`
429  /// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
430  ///
431  /// @param request
432  /// @googleapis_link{google::iam::v1::SetIamPolicyRequest,google/iam/v1/iam_policy.proto#L101}
433  /// @param opts Optional. Override the class-level options, such as retry and
434  /// backoff policies.
435  /// @return
436  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
437  ///
438  /// [google.iam.v1.SetIamPolicyRequest]:
439  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
440  /// [google.iam.v1.Policy]:
441  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
442  ///
443  StatusOr<google::iam::v1::Policy> SetIamPolicy(
444  google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
445 
446  ///
447  /// Gets the access control policy for a database or backup resource.
448  /// Returns an empty policy if a database or backup exists but does not have a
449  /// policy set.
450  ///
451  /// Authorization requires `spanner.databases.getIamPolicy` permission on
452  /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
453  /// For backups, authorization requires `spanner.backups.getIamPolicy`
454  /// permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
455  ///
456  /// @param resource REQUIRED: The resource for which the policy is being
457  /// requested.
458  /// See the operation documentation for the appropriate value for this field.
459  /// @param opts Optional. Override the class-level options, such as retry and
460  /// backoff policies.
461  /// @return
462  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
463  ///
464  /// [google.iam.v1.GetIamPolicyRequest]:
465  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
466  /// [google.iam.v1.Policy]:
467  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
468  ///
469  StatusOr<google::iam::v1::Policy> GetIamPolicy(std::string const& resource,
470  Options opts = {});
471 
472  ///
473  /// Gets the access control policy for a database or backup resource.
474  /// Returns an empty policy if a database or backup exists but does not have a
475  /// policy set.
476  ///
477  /// Authorization requires `spanner.databases.getIamPolicy` permission on
478  /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
479  /// For backups, authorization requires `spanner.backups.getIamPolicy`
480  /// permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
481  ///
482  /// @param request
483  /// @googleapis_link{google::iam::v1::GetIamPolicyRequest,google/iam/v1/iam_policy.proto#L123}
484  /// @param opts Optional. Override the class-level options, such as retry and
485  /// backoff policies.
486  /// @return
487  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
488  ///
489  /// [google.iam.v1.GetIamPolicyRequest]:
490  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
491  /// [google.iam.v1.Policy]:
492  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
493  ///
494  StatusOr<google::iam::v1::Policy> GetIamPolicy(
495  google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
496 
497  ///
498  /// Returns permissions that the caller has on the specified database or
499  /// backup resource.
500  ///
501  /// Attempting this RPC on a non-existent Cloud Spanner database will
502  /// result in a NOT_FOUND error if the user has
503  /// `spanner.databases.list` permission on the containing Cloud
504  /// Spanner instance. Otherwise returns an empty set of permissions.
505  /// Calling this method on a backup that does not exist will
506  /// result in a NOT_FOUND error if the user has
507  /// `spanner.backups.list` permission on the containing instance.
508  ///
509  /// @param resource REQUIRED: The resource for which the policy detail is
510  /// being requested.
511  /// See the operation documentation for the appropriate value for this field.
512  /// @param permissions The set of permissions to check for the `resource`.
513  /// Permissions with
514  /// wildcards (such as '*' or 'storage.*') are not allowed. For more
515  /// information see
516  /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
517  /// @param opts Optional. Override the class-level options, such as retry and
518  /// backoff policies.
519  /// @return
520  /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
521  ///
522  /// [google.iam.v1.TestIamPermissionsRequest]:
523  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
524  /// [google.iam.v1.TestIamPermissionsResponse]:
525  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
526  ///
527  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
528  std::string const& resource, std::vector<std::string> const& permissions,
529  Options opts = {});
530 
531  ///
532  /// Returns permissions that the caller has on the specified database or
533  /// backup resource.
534  ///
535  /// Attempting this RPC on a non-existent Cloud Spanner database will
536  /// result in a NOT_FOUND error if the user has
537  /// `spanner.databases.list` permission on the containing Cloud
538  /// Spanner instance. Otherwise returns an empty set of permissions.
539  /// Calling this method on a backup that does not exist will
540  /// result in a NOT_FOUND error if the user has
541  /// `spanner.backups.list` permission on the containing instance.
542  ///
543  /// @param request
544  /// @googleapis_link{google::iam::v1::TestIamPermissionsRequest,google/iam/v1/iam_policy.proto#L136}
545  /// @param opts Optional. Override the class-level options, such as retry and
546  /// backoff policies.
547  /// @return
548  /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
549  ///
550  /// [google.iam.v1.TestIamPermissionsRequest]:
551  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
552  /// [google.iam.v1.TestIamPermissionsResponse]:
553  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
554  ///
555  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
556  google::iam::v1::TestIamPermissionsRequest const& request,
557  Options opts = {});
558 
559  ///
560  /// Starts creating a new Cloud Spanner Backup.
561  /// The returned backup [long-running operation][google.longrunning.Operation]
562  /// will have a name of the format
563  /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
564  /// and can be used to track creation of the backup. The
565  /// [metadata][google.longrunning.Operation.metadata] field type is
566  /// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
567  /// The [response][google.longrunning.Operation.response] field type is
568  /// [Backup][google.spanner.admin.database.v1.Backup], if successful.
569  /// Cancelling the returned operation will stop the creation and delete the
570  /// backup. There can be only one pending backup creation per database. Backup
571  /// creation of different databases can run concurrently.
572  ///
573  /// @param parent Required. The name of the instance in which the backup will
574  /// be
575  /// created. This must be the same instance that contains the database the
576  /// backup will be created from. The backup will be stored in the
577  /// location(s) specified in the instance configuration of this
578  /// instance. Values are of the form
579  /// `projects/<project>/instances/<instance>`.
580  /// @param backup Required. The backup to create.
581  /// @param backup_id Required. The id of the backup to be created. The
582  /// `backup_id` appended to
583  /// `parent` forms the full backup name of the form
584  /// `projects/<project>/instances/<instance>/backups/<backup_id>`.
585  /// @param opts Optional. Override the class-level options, such as retry and
586  /// backoff policies.
587  /// @return
588  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
589  ///
590  /// [google.spanner.admin.database.v1.CreateBackupRequest]:
591  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L146}
592  /// [google.spanner.admin.database.v1.Backup]:
593  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
594  ///
595  future<StatusOr<google::spanner::admin::database::v1::Backup>> CreateBackup(
596  std::string const& parent,
597  google::spanner::admin::database::v1::Backup const& backup,
598  std::string const& backup_id, Options opts = {});
599 
600  ///
601  /// Starts creating a new Cloud Spanner Backup.
602  /// The returned backup [long-running operation][google.longrunning.Operation]
603  /// will have a name of the format
604  /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
605  /// and can be used to track creation of the backup. The
606  /// [metadata][google.longrunning.Operation.metadata] field type is
607  /// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
608  /// The [response][google.longrunning.Operation.response] field type is
609  /// [Backup][google.spanner.admin.database.v1.Backup], if successful.
610  /// Cancelling the returned operation will stop the creation and delete the
611  /// backup. There can be only one pending backup creation per database. Backup
612  /// creation of different databases can run concurrently.
613  ///
614  /// @param request
615  /// @googleapis_link{google::spanner::admin::database::v1::CreateBackupRequest,google/spanner/admin/database/v1/backup.proto#L146}
616  /// @param opts Optional. Override the class-level options, such as retry and
617  /// backoff policies.
618  /// @return
619  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
620  ///
621  /// [google.spanner.admin.database.v1.CreateBackupRequest]:
622  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L146}
623  /// [google.spanner.admin.database.v1.Backup]:
624  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
625  ///
626  future<StatusOr<google::spanner::admin::database::v1::Backup>> CreateBackup(
627  google::spanner::admin::database::v1::CreateBackupRequest const& request,
628  Options opts = {});
629 
630  ///
631  /// Starts copying a Cloud Spanner Backup.
632  /// The returned backup [long-running operation][google.longrunning.Operation]
633  /// will have a name of the format
634  /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
635  /// and can be used to track copying of the backup. The operation is
636  /// associated with the destination backup. The
637  /// [metadata][google.longrunning.Operation.metadata] field type is
638  /// [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
639  /// The [response][google.longrunning.Operation.response] field type is
640  /// [Backup][google.spanner.admin.database.v1.Backup], if successful.
641  /// Cancelling the returned operation will stop the copying and delete the
642  /// backup. Concurrent CopyBackup requests can run on the same source backup.
643  ///
644  /// @param parent Required. The name of the destination instance that will
645  /// contain the backup copy.
646  /// Values are of the form: `projects/<project>/instances/<instance>`.
647  /// @param backup_id Required. The id of the backup copy.
648  /// The `backup_id` appended to `parent` forms the full backup_uri of the
649  /// form `projects/<project>/instances/<instance>/backups/<backup>`.
650  /// @param source_backup Required. The source backup to be copied.
651  /// The source backup needs to be in READY state for it to be copied.
652  /// Once CopyBackup is in progress, the source backup cannot be deleted or
653  /// cleaned up on expiration until CopyBackup is finished.
654  /// Values are of the form:
655  /// `projects/<project>/instances/<instance>/backups/<backup>`.
656  /// @param expire_time Required. The expiration time of the backup in
657  /// microsecond granularity.
658  /// The expiration time must be at least 6 hours and at most 366 days
659  /// from the `create_time` of the source backup. Once the `expire_time` has
660  /// passed, the backup is eligible to be automatically deleted by Cloud
661  /// Spanner to free the resources used by the backup.
662  /// @param opts Optional. Override the class-level options, such as retry and
663  /// backoff policies.
664  /// @return
665  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
666  ///
667  /// [google.spanner.admin.database.v1.CopyBackupRequest]:
668  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L209}
669  /// [google.spanner.admin.database.v1.Backup]:
670  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
671  ///
672  future<StatusOr<google::spanner::admin::database::v1::Backup>> CopyBackup(
673  std::string const& parent, std::string const& backup_id,
674  std::string const& source_backup,
675  google::protobuf::Timestamp const& expire_time, Options opts = {});
676 
677  ///
678  /// Starts copying a Cloud Spanner Backup.
679  /// The returned backup [long-running operation][google.longrunning.Operation]
680  /// will have a name of the format
681  /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
682  /// and can be used to track copying of the backup. The operation is
683  /// associated with the destination backup. The
684  /// [metadata][google.longrunning.Operation.metadata] field type is
685  /// [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
686  /// The [response][google.longrunning.Operation.response] field type is
687  /// [Backup][google.spanner.admin.database.v1.Backup], if successful.
688  /// Cancelling the returned operation will stop the copying and delete the
689  /// backup. Concurrent CopyBackup requests can run on the same source backup.
690  ///
691  /// @param request
692  /// @googleapis_link{google::spanner::admin::database::v1::CopyBackupRequest,google/spanner/admin/database/v1/backup.proto#L209}
693  /// @param opts Optional. Override the class-level options, such as retry and
694  /// backoff policies.
695  /// @return
696  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
697  ///
698  /// [google.spanner.admin.database.v1.CopyBackupRequest]:
699  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L209}
700  /// [google.spanner.admin.database.v1.Backup]:
701  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
702  ///
703  future<StatusOr<google::spanner::admin::database::v1::Backup>> CopyBackup(
704  google::spanner::admin::database::v1::CopyBackupRequest const& request,
705  Options opts = {});
706 
707  ///
708  /// Gets metadata on a pending or completed
709  /// [Backup][google.spanner.admin.database.v1.Backup].
710  ///
711  /// @param name Required. Name of the backup.
712  /// Values are of the form
713  /// `projects/<project>/instances/<instance>/backups/<backup>`.
714  /// @param opts Optional. Override the class-level options, such as retry and
715  /// backoff policies.
716  /// @return
717  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
718  ///
719  /// [google.spanner.admin.database.v1.GetBackupRequest]:
720  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L305}
721  /// [google.spanner.admin.database.v1.Backup]:
722  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
723  ///
724  StatusOr<google::spanner::admin::database::v1::Backup> GetBackup(
725  std::string const& name, Options opts = {});
726 
727  ///
728  /// Gets metadata on a pending or completed
729  /// [Backup][google.spanner.admin.database.v1.Backup].
730  ///
731  /// @param request
732  /// @googleapis_link{google::spanner::admin::database::v1::GetBackupRequest,google/spanner/admin/database/v1/backup.proto#L305}
733  /// @param opts Optional. Override the class-level options, such as retry and
734  /// backoff policies.
735  /// @return
736  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
737  ///
738  /// [google.spanner.admin.database.v1.GetBackupRequest]:
739  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L305}
740  /// [google.spanner.admin.database.v1.Backup]:
741  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
742  ///
743  StatusOr<google::spanner::admin::database::v1::Backup> GetBackup(
744  google::spanner::admin::database::v1::GetBackupRequest const& request,
745  Options opts = {});
746 
747  ///
748  /// Updates a pending or completed
749  /// [Backup][google.spanner.admin.database.v1.Backup].
750  ///
751  /// @param backup Required. The backup to update. `backup.name`, and the
752  /// fields to be updated
753  /// as specified by `update_mask` are required. Other fields are ignored.
754  /// Update is only supported for the following fields:
755  /// * `backup.expire_time`.
756  /// @param update_mask Required. A mask specifying which fields (e.g.
757  /// `expire_time`) in the
758  /// Backup resource should be updated. This mask is relative to the Backup
759  /// resource, not to the request message. The field mask must always be
760  /// specified; this prevents any future fields from being erased accidentally
761  /// by clients that do not know about them.
762  /// @param opts Optional. Override the class-level options, such as retry and
763  /// backoff policies.
764  /// @return
765  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
766  ///
767  /// [google.spanner.admin.database.v1.UpdateBackupRequest]:
768  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L289}
769  /// [google.spanner.admin.database.v1.Backup]:
770  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
771  ///
772  StatusOr<google::spanner::admin::database::v1::Backup> UpdateBackup(
773  google::spanner::admin::database::v1::Backup const& backup,
774  google::protobuf::FieldMask const& update_mask, Options opts = {});
775 
776  ///
777  /// Updates a pending or completed
778  /// [Backup][google.spanner.admin.database.v1.Backup].
779  ///
780  /// @param request
781  /// @googleapis_link{google::spanner::admin::database::v1::UpdateBackupRequest,google/spanner/admin/database/v1/backup.proto#L289}
782  /// @param opts Optional. Override the class-level options, such as retry and
783  /// backoff policies.
784  /// @return
785  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
786  ///
787  /// [google.spanner.admin.database.v1.UpdateBackupRequest]:
788  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L289}
789  /// [google.spanner.admin.database.v1.Backup]:
790  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
791  ///
792  StatusOr<google::spanner::admin::database::v1::Backup> UpdateBackup(
793  google::spanner::admin::database::v1::UpdateBackupRequest const& request,
794  Options opts = {});
795 
796  ///
797  /// Deletes a pending or completed
798  /// [Backup][google.spanner.admin.database.v1.Backup].
799  ///
800  /// @param name Required. Name of the backup to delete.
801  /// Values are of the form
802  /// `projects/<project>/instances/<instance>/backups/<backup>`.
803  /// @param opts Optional. Override the class-level options, such as retry and
804  /// backoff policies.
805  ///
806  /// [google.spanner.admin.database.v1.DeleteBackupRequest]:
807  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L318}
808  ///
809  Status DeleteBackup(std::string const& name, Options opts = {});
810 
811  ///
812  /// Deletes a pending or completed
813  /// [Backup][google.spanner.admin.database.v1.Backup].
814  ///
815  /// @param request
816  /// @googleapis_link{google::spanner::admin::database::v1::DeleteBackupRequest,google/spanner/admin/database/v1/backup.proto#L318}
817  /// @param opts Optional. Override the class-level options, such as retry and
818  /// backoff policies.
819  ///
820  /// [google.spanner.admin.database.v1.DeleteBackupRequest]:
821  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L318}
822  ///
824  google::spanner::admin::database::v1::DeleteBackupRequest const& request,
825  Options opts = {});
826 
827  ///
828  /// Lists completed and pending backups.
829  /// Backups returned are ordered by `create_time` in descending order,
830  /// starting from the most recent `create_time`.
831  ///
832  /// @param parent Required. The instance to list backups from. Values are of
833  /// the
834  /// form `projects/<project>/instances/<instance>`.
835  /// @param opts Optional. Override the class-level options, such as retry and
836  /// backoff policies.
837  /// @return
838  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
839  ///
840  /// [google.spanner.admin.database.v1.ListBackupsRequest]:
841  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L331}
842  /// [google.spanner.admin.database.v1.Backup]:
843  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
844  ///
845  StreamRange<google::spanner::admin::database::v1::Backup> ListBackups(
846  std::string const& parent, Options opts = {});
847 
848  ///
849  /// Lists completed and pending backups.
850  /// Backups returned are ordered by `create_time` in descending order,
851  /// starting from the most recent `create_time`.
852  ///
853  /// @param request
854  /// @googleapis_link{google::spanner::admin::database::v1::ListBackupsRequest,google/spanner/admin/database/v1/backup.proto#L331}
855  /// @param opts Optional. Override the class-level options, such as retry and
856  /// backoff policies.
857  /// @return
858  /// @googleapis_link{google::spanner::admin::database::v1::Backup,google/spanner/admin/database/v1/backup.proto#L35}
859  ///
860  /// [google.spanner.admin.database.v1.ListBackupsRequest]:
861  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L331}
862  /// [google.spanner.admin.database.v1.Backup]:
863  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L35}
864  ///
865  StreamRange<google::spanner::admin::database::v1::Backup> ListBackups(
866  google::spanner::admin::database::v1::ListBackupsRequest request,
867  Options opts = {});
868 
869  ///
870  /// Create a new database by restoring from a completed backup. The new
871  /// database must be in the same project and in an instance with the same
872  /// instance configuration as the instance containing
873  /// the backup. The returned database [long-running
874  /// operation][google.longrunning.Operation] has a name of the format
875  /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
876  /// and can be used to track the progress of the operation, and to cancel it.
877  /// The [metadata][google.longrunning.Operation.metadata] field type is
878  /// [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
879  /// The [response][google.longrunning.Operation.response] type
880  /// is [Database][google.spanner.admin.database.v1.Database], if
881  /// successful. Cancelling the returned operation will stop the restore and
882  /// delete the database.
883  /// There can be only one database being restored into an instance at a time.
884  /// Once the restore operation completes, a new restore operation can be
885  /// initiated, without waiting for the optimize operation associated with the
886  /// first restore to complete.
887  ///
888  /// @param parent Required. The name of the instance in which to create the
889  /// restored database. This instance must be in the same project and
890  /// have the same instance configuration as the instance containing
891  /// the source backup. Values are of the form
892  /// `projects/<project>/instances/<instance>`.
893  /// @param database_id Required. The id of the database to create and restore
894  /// to. This
895  /// database must not already exist. The `database_id` appended to
896  /// `parent` forms the full database name of the form
897  /// `projects/<project>/instances/<instance>/databases/<database_id>`.
898  /// @param backup Name of the backup from which to restore. Values are of
899  /// the form
900  /// `projects/<project>/instances/<instance>/backups/<backup>`.
901  /// @param opts Optional. Override the class-level options, such as retry and
902  /// backoff policies.
903  /// @return
904  /// @googleapis_link{google::spanner::admin::database::v1::Database,google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
905  ///
906  /// [google.spanner.admin.database.v1.RestoreDatabaseRequest]:
907  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L739}
908  /// [google.spanner.admin.database.v1.Database]:
909  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
910  ///
911  future<StatusOr<google::spanner::admin::database::v1::Database>>
912  RestoreDatabase(std::string const& parent, std::string const& database_id,
913  std::string const& backup, Options opts = {});
914 
915  ///
916  /// Create a new database by restoring from a completed backup. The new
917  /// database must be in the same project and in an instance with the same
918  /// instance configuration as the instance containing
919  /// the backup. The returned database [long-running
920  /// operation][google.longrunning.Operation] has a name of the format
921  /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
922  /// and can be used to track the progress of the operation, and to cancel it.
923  /// The [metadata][google.longrunning.Operation.metadata] field type is
924  /// [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
925  /// The [response][google.longrunning.Operation.response] type
926  /// is [Database][google.spanner.admin.database.v1.Database], if
927  /// successful. Cancelling the returned operation will stop the restore and
928  /// delete the database.
929  /// There can be only one database being restored into an instance at a time.
930  /// Once the restore operation completes, a new restore operation can be
931  /// initiated, without waiting for the optimize operation associated with the
932  /// first restore to complete.
933  ///
934  /// @param request
935  /// @googleapis_link{google::spanner::admin::database::v1::RestoreDatabaseRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L739}
936  /// @param opts Optional. Override the class-level options, such as retry and
937  /// backoff policies.
938  /// @return
939  /// @googleapis_link{google::spanner::admin::database::v1::Database,google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
940  ///
941  /// [google.spanner.admin.database.v1.RestoreDatabaseRequest]:
942  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L739}
943  /// [google.spanner.admin.database.v1.Database]:
944  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L365}
945  ///
946  future<StatusOr<google::spanner::admin::database::v1::Database>>
948  google::spanner::admin::database::v1::RestoreDatabaseRequest const&
949  request,
950  Options opts = {});
951 
952  ///
953  /// Lists database [longrunning-operations][google.longrunning.Operation].
954  /// A database operation has a name of the form
955  /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
956  /// The long-running operation
957  /// [metadata][google.longrunning.Operation.metadata] field type
958  /// `metadata.type_url` describes the type of the metadata. Operations
959  /// returned include those that have completed/failed/canceled within the last
960  /// 7 days, and pending operations.
961  ///
962  /// @param parent Required. The instance of the database operations.
963  /// Values are of the form `projects/<project>/instances/<instance>`.
964  /// @param opts Optional. Override the class-level options, such as retry and
965  /// backoff policies.
966  /// @return
967  /// @googleapis_link{google::longrunning::Operation,google/longrunning/operations.proto#L128}
968  ///
969  /// [google.spanner.admin.database.v1.ListDatabaseOperationsRequest]:
970  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L656}
971  /// [google.longrunning.Operation]:
972  /// @googleapis_reference_link{google/longrunning/operations.proto#L128}
973  ///
974  StreamRange<google::longrunning::Operation> ListDatabaseOperations(
975  std::string const& parent, Options opts = {});
976 
977  ///
978  /// Lists database [longrunning-operations][google.longrunning.Operation].
979  /// A database operation has a name of the form
980  /// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
981  /// The long-running operation
982  /// [metadata][google.longrunning.Operation.metadata] field type
983  /// `metadata.type_url` describes the type of the metadata. Operations
984  /// returned include those that have completed/failed/canceled within the last
985  /// 7 days, and pending operations.
986  ///
987  /// @param request
988  /// @googleapis_link{google::spanner::admin::database::v1::ListDatabaseOperationsRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L656}
989  /// @param opts Optional. Override the class-level options, such as retry and
990  /// backoff policies.
991  /// @return
992  /// @googleapis_link{google::longrunning::Operation,google/longrunning/operations.proto#L128}
993  ///
994  /// [google.spanner.admin.database.v1.ListDatabaseOperationsRequest]:
995  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L656}
996  /// [google.longrunning.Operation]:
997  /// @googleapis_reference_link{google/longrunning/operations.proto#L128}
998  ///
999  StreamRange<google::longrunning::Operation> ListDatabaseOperations(
1000  google::spanner::admin::database::v1::ListDatabaseOperationsRequest
1001  request,
1002  Options opts = {});
1003 
1004  ///
1005  /// Lists the backup [long-running operations][google.longrunning.Operation]
1006  /// in the given instance. A backup operation has a name of the form
1007  /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
1008  /// The long-running operation
1009  /// [metadata][google.longrunning.Operation.metadata] field type
1010  /// `metadata.type_url` describes the type of the metadata. Operations
1011  /// returned include those that have completed/failed/canceled within the last
1012  /// 7 days, and pending operations. Operations returned are ordered by
1013  /// `operation.metadata.value.progress.start_time` in descending order
1014  /// starting from the most recently started operation.
1015  ///
1016  /// @param parent Required. The instance of the backup operations. Values are
1017  /// of
1018  /// the form `projects/<project>/instances/<instance>`.
1019  /// @param opts Optional. Override the class-level options, such as retry and
1020  /// backoff policies.
1021  /// @return
1022  /// @googleapis_link{google::longrunning::Operation,google/longrunning/operations.proto#L128}
1023  ///
1024  /// [google.spanner.admin.database.v1.ListBackupOperationsRequest]:
1025  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L403}
1026  /// [google.longrunning.Operation]:
1027  /// @googleapis_reference_link{google/longrunning/operations.proto#L128}
1028  ///
1029  StreamRange<google::longrunning::Operation> ListBackupOperations(
1030  std::string const& parent, Options opts = {});
1031 
1032  ///
1033  /// Lists the backup [long-running operations][google.longrunning.Operation]
1034  /// in the given instance. A backup operation has a name of the form
1035  /// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
1036  /// The long-running operation
1037  /// [metadata][google.longrunning.Operation.metadata] field type
1038  /// `metadata.type_url` describes the type of the metadata. Operations
1039  /// returned include those that have completed/failed/canceled within the last
1040  /// 7 days, and pending operations. Operations returned are ordered by
1041  /// `operation.metadata.value.progress.start_time` in descending order
1042  /// starting from the most recently started operation.
1043  ///
1044  /// @param request
1045  /// @googleapis_link{google::spanner::admin::database::v1::ListBackupOperationsRequest,google/spanner/admin/database/v1/backup.proto#L403}
1046  /// @param opts Optional. Override the class-level options, such as retry and
1047  /// backoff policies.
1048  /// @return
1049  /// @googleapis_link{google::longrunning::Operation,google/longrunning/operations.proto#L128}
1050  ///
1051  /// [google.spanner.admin.database.v1.ListBackupOperationsRequest]:
1052  /// @googleapis_reference_link{google/spanner/admin/database/v1/backup.proto#L403}
1053  /// [google.longrunning.Operation]:
1054  /// @googleapis_reference_link{google/longrunning/operations.proto#L128}
1055  ///
1056  StreamRange<google::longrunning::Operation> ListBackupOperations(
1057  google::spanner::admin::database::v1::ListBackupOperationsRequest request,
1058  Options opts = {});
1059 
1060  ///
1061  /// Lists Cloud Spanner database roles.
1062  ///
1063  /// @param parent Required. The database whose roles should be listed.
1064  /// Values are of the form
1065  /// `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
1066  /// @param opts Optional. Override the class-level options, such as retry and
1067  /// backoff policies.
1068  /// @return
1069  /// @googleapis_link{google::spanner::admin::database::v1::DatabaseRole,google/spanner/admin/database/v1/spanner_database_admin.proto#L885}
1070  ///
1071  /// [google.spanner.admin.database.v1.ListDatabaseRolesRequest]:
1072  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L900}
1073  /// [google.spanner.admin.database.v1.DatabaseRole]:
1074  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L885}
1075  ///
1076  StreamRange<google::spanner::admin::database::v1::DatabaseRole>
1077  ListDatabaseRoles(std::string const& parent, Options opts = {});
1078 
1079  ///
1080  /// Lists Cloud Spanner database roles.
1081  ///
1082  /// @param request
1083  /// @googleapis_link{google::spanner::admin::database::v1::ListDatabaseRolesRequest,google/spanner/admin/database/v1/spanner_database_admin.proto#L900}
1084  /// @param opts Optional. Override the class-level options, such as retry and
1085  /// backoff policies.
1086  /// @return
1087  /// @googleapis_link{google::spanner::admin::database::v1::DatabaseRole,google/spanner/admin/database/v1/spanner_database_admin.proto#L885}
1088  ///
1089  /// [google.spanner.admin.database.v1.ListDatabaseRolesRequest]:
1090  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L900}
1091  /// [google.spanner.admin.database.v1.DatabaseRole]:
1092  /// @googleapis_reference_link{google/spanner/admin/database/v1/spanner_database_admin.proto#L885}
1093  ///
1094  StreamRange<google::spanner::admin::database::v1::DatabaseRole>
1096  google::spanner::admin::database::v1::ListDatabaseRolesRequest request,
1097  Options opts = {});
1098 
1099  private:
1100  std::shared_ptr<DatabaseAdminConnection> connection_;
1101  Options options_;
1102 };
1103 
1105 namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
1106 } // namespace spanner_admin
1107 } // namespace cloud
1108 } // namespace google
1109 
1110 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_DATABASE_ADMIN_CLIENT_H