1#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct OperationProgress {
5 #[prost(int32, tag="1")]
8 pub progress_percent: i32,
9 #[prost(message, optional, tag="2")]
11 pub start_time: ::std::option::Option<::prost_types::Timestamp>,
12 #[prost(message, optional, tag="3")]
15 pub end_time: ::std::option::Option<::prost_types::Timestamp>,
16}
17#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct Backup {
20 #[prost(string, tag="2")]
26 pub database: std::string::String,
27 #[prost(message, optional, tag="3")]
34 pub expire_time: ::std::option::Option<::prost_types::Timestamp>,
35 #[prost(string, tag="1")]
49 pub name: std::string::String,
50 #[prost(message, optional, tag="4")]
55 pub create_time: ::std::option::Option<::prost_types::Timestamp>,
56 #[prost(int64, tag="5")]
58 pub size_bytes: i64,
59 #[prost(enumeration="backup::State", tag="6")]
61 pub state: i32,
62 #[prost(string, repeated, tag="7")]
70 pub referencing_databases: ::std::vec::Vec<std::string::String>,
71}
72pub mod backup {
73 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
75 #[repr(i32)]
76 pub enum State {
77 Unspecified = 0,
79 Creating = 1,
82 Ready = 2,
84 }
85}
86#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct CreateBackupRequest {
89 #[prost(string, tag="1")]
96 pub parent: std::string::String,
97 #[prost(string, tag="2")]
101 pub backup_id: std::string::String,
102 #[prost(message, optional, tag="3")]
104 pub backup: ::std::option::Option<Backup>,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct CreateBackupMetadata {
110 #[prost(string, tag="1")]
112 pub name: std::string::String,
113 #[prost(string, tag="2")]
115 pub database: std::string::String,
116 #[prost(message, optional, tag="3")]
119 pub progress: ::std::option::Option<OperationProgress>,
120 #[prost(message, optional, tag="4")]
132 pub cancel_time: ::std::option::Option<::prost_types::Timestamp>,
133}
134#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct UpdateBackupRequest {
137 #[prost(message, optional, tag="1")]
142 pub backup: ::std::option::Option<Backup>,
143 #[prost(message, optional, tag="2")]
149 pub update_mask: ::std::option::Option<::prost_types::FieldMask>,
150}
151#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct GetBackupRequest {
154 #[prost(string, tag="1")]
158 pub name: std::string::String,
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct DeleteBackupRequest {
163 #[prost(string, tag="1")]
167 pub name: std::string::String,
168}
169#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct ListBackupsRequest {
172 #[prost(string, tag="1")]
175 pub parent: std::string::String,
176 #[prost(string, tag="2")]
211 pub filter: std::string::String,
212 #[prost(int32, tag="3")]
215 pub page_size: i32,
216 #[prost(string, tag="4")]
221 pub page_token: std::string::String,
222}
223#[derive(Clone, PartialEq, ::prost::Message)]
225pub struct ListBackupsResponse {
226 #[prost(message, repeated, tag="1")]
229 pub backups: ::std::vec::Vec<Backup>,
230 #[prost(string, tag="2")]
234 pub next_page_token: std::string::String,
235}
236#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct ListBackupOperationsRequest {
240 #[prost(string, tag="1")]
243 pub parent: std::string::String,
244 #[prost(string, tag="2")]
283 pub filter: std::string::String,
284 #[prost(int32, tag="3")]
287 pub page_size: i32,
288 #[prost(string, tag="4")]
293 pub page_token: std::string::String,
294}
295#[derive(Clone, PartialEq, ::prost::Message)]
298pub struct ListBackupOperationsResponse {
299 #[prost(message, repeated, tag="1")]
309 pub operations: ::std::vec::Vec<super::super::super::super::longrunning::Operation>,
310 #[prost(string, tag="2")]
314 pub next_page_token: std::string::String,
315}
316#[derive(Clone, PartialEq, ::prost::Message)]
318pub struct BackupInfo {
319 #[prost(string, tag="1")]
321 pub backup: std::string::String,
322 #[prost(message, optional, tag="2")]
325 pub create_time: ::std::option::Option<::prost_types::Timestamp>,
326 #[prost(string, tag="3")]
328 pub source_database: std::string::String,
329}
330#[derive(Clone, PartialEq, ::prost::Message)]
332pub struct RestoreInfo {
333 #[prost(enumeration="RestoreSourceType", tag="1")]
335 pub source_type: i32,
336 #[prost(oneof="restore_info::SourceInfo", tags="2")]
338 pub source_info: ::std::option::Option<restore_info::SourceInfo>,
339}
340pub mod restore_info {
341 #[derive(Clone, PartialEq, ::prost::Oneof)]
343 pub enum SourceInfo {
344 #[prost(message, tag="2")]
347 BackupInfo(super::BackupInfo),
348 }
349}
350#[derive(Clone, PartialEq, ::prost::Message)]
352pub struct Database {
353 #[prost(string, tag="1")]
359 pub name: std::string::String,
360 #[prost(enumeration="database::State", tag="2")]
362 pub state: i32,
363 #[prost(message, optional, tag="3")]
365 pub create_time: ::std::option::Option<::prost_types::Timestamp>,
366 #[prost(message, optional, tag="4")]
369 pub restore_info: ::std::option::Option<RestoreInfo>,
370}
371pub mod database {
372 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
374 #[repr(i32)]
375 pub enum State {
376 Unspecified = 0,
378 Creating = 1,
381 Ready = 2,
383 ReadyOptimizing = 3,
392 }
393}
394#[derive(Clone, PartialEq, ::prost::Message)]
396pub struct ListDatabasesRequest {
397 #[prost(string, tag="1")]
400 pub parent: std::string::String,
401 #[prost(int32, tag="3")]
404 pub page_size: i32,
405 #[prost(string, tag="4")]
409 pub page_token: std::string::String,
410}
411#[derive(Clone, PartialEq, ::prost::Message)]
413pub struct ListDatabasesResponse {
414 #[prost(message, repeated, tag="1")]
416 pub databases: ::std::vec::Vec<Database>,
417 #[prost(string, tag="2")]
421 pub next_page_token: std::string::String,
422}
423#[derive(Clone, PartialEq, ::prost::Message)]
425pub struct CreateDatabaseRequest {
426 #[prost(string, tag="1")]
429 pub parent: std::string::String,
430 #[prost(string, tag="2")]
436 pub create_statement: std::string::String,
437 #[prost(string, repeated, tag="3")]
442 pub extra_statements: ::std::vec::Vec<std::string::String>,
443}
444#[derive(Clone, PartialEq, ::prost::Message)]
447pub struct CreateDatabaseMetadata {
448 #[prost(string, tag="1")]
450 pub database: std::string::String,
451}
452#[derive(Clone, PartialEq, ::prost::Message)]
454pub struct GetDatabaseRequest {
455 #[prost(string, tag="1")]
458 pub name: std::string::String,
459}
460#[derive(Clone, PartialEq, ::prost::Message)]
477pub struct UpdateDatabaseDdlRequest {
478 #[prost(string, tag="1")]
480 pub database: std::string::String,
481 #[prost(string, repeated, tag="2")]
483 pub statements: ::std::vec::Vec<std::string::String>,
484 #[prost(string, tag="3")]
504 pub operation_id: std::string::String,
505}
506#[derive(Clone, PartialEq, ::prost::Message)]
509pub struct UpdateDatabaseDdlMetadata {
510 #[prost(string, tag="1")]
512 pub database: std::string::String,
513 #[prost(string, repeated, tag="2")]
516 pub statements: ::std::vec::Vec<std::string::String>,
517 #[prost(message, repeated, tag="3")]
521 pub commit_timestamps: ::std::vec::Vec<::prost_types::Timestamp>,
522}
523#[derive(Clone, PartialEq, ::prost::Message)]
525pub struct DropDatabaseRequest {
526 #[prost(string, tag="1")]
528 pub database: std::string::String,
529}
530#[derive(Clone, PartialEq, ::prost::Message)]
532pub struct GetDatabaseDdlRequest {
533 #[prost(string, tag="1")]
535 pub database: std::string::String,
536}
537#[derive(Clone, PartialEq, ::prost::Message)]
539pub struct GetDatabaseDdlResponse {
540 #[prost(string, repeated, tag="1")]
543 pub statements: ::std::vec::Vec<std::string::String>,
544}
545#[derive(Clone, PartialEq, ::prost::Message)]
548pub struct ListDatabaseOperationsRequest {
549 #[prost(string, tag="1")]
552 pub parent: std::string::String,
553 #[prost(string, tag="2")]
594 pub filter: std::string::String,
595 #[prost(int32, tag="3")]
598 pub page_size: i32,
599 #[prost(string, tag="4")]
604 pub page_token: std::string::String,
605}
606#[derive(Clone, PartialEq, ::prost::Message)]
609pub struct ListDatabaseOperationsResponse {
610 #[prost(message, repeated, tag="1")]
616 pub operations: ::std::vec::Vec<super::super::super::super::longrunning::Operation>,
617 #[prost(string, tag="2")]
621 pub next_page_token: std::string::String,
622}
623#[derive(Clone, PartialEq, ::prost::Message)]
626pub struct RestoreDatabaseRequest {
627 #[prost(string, tag="1")]
633 pub parent: std::string::String,
634 #[prost(string, tag="2")]
639 pub database_id: std::string::String,
640 #[prost(oneof="restore_database_request::Source", tags="3")]
642 pub source: ::std::option::Option<restore_database_request::Source>,
643}
644pub mod restore_database_request {
645 #[derive(Clone, PartialEq, ::prost::Oneof)]
647 pub enum Source {
648 #[prost(string, tag="3")]
651 Backup(std::string::String),
652 }
653}
654#[derive(Clone, PartialEq, ::prost::Message)]
657pub struct RestoreDatabaseMetadata {
658 #[prost(string, tag="1")]
660 pub name: std::string::String,
661 #[prost(enumeration="RestoreSourceType", tag="2")]
663 pub source_type: i32,
664 #[prost(message, optional, tag="4")]
668 pub progress: ::std::option::Option<OperationProgress>,
669 #[prost(message, optional, tag="5")]
681 pub cancel_time: ::std::option::Option<::prost_types::Timestamp>,
682 #[prost(string, tag="6")]
694 pub optimize_database_operation_name: std::string::String,
695 #[prost(oneof="restore_database_metadata::SourceInfo", tags="3")]
698 pub source_info: ::std::option::Option<restore_database_metadata::SourceInfo>,
699}
700pub mod restore_database_metadata {
701 #[derive(Clone, PartialEq, ::prost::Oneof)]
704 pub enum SourceInfo {
705 #[prost(message, tag="3")]
707 BackupInfo(super::BackupInfo),
708 }
709}
710#[derive(Clone, PartialEq, ::prost::Message)]
715pub struct OptimizeRestoredDatabaseMetadata {
716 #[prost(string, tag="1")]
718 pub name: std::string::String,
719 #[prost(message, optional, tag="2")]
721 pub progress: ::std::option::Option<OperationProgress>,
722}
723#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
725#[repr(i32)]
726pub enum RestoreSourceType {
727 TypeUnspecified = 0,
729 Backup = 1,
731}
732# [ doc = r" Generated client implementations." ] pub mod database_admin_client { # ! [ allow ( unused_variables , dead_code , missing_docs ) ] use tonic :: codegen :: * ; # [ doc = " Cloud Spanner Database Admin API" ] # [ doc = "" ] # [ doc = " The Cloud Spanner Database Admin API can be used to create, drop, and" ] # [ doc = " list databases. It also enables updating the schema of pre-existing" ] # [ doc = " databases. It can be also used to create, delete and list backups for a" ] # [ doc = " database and to restore from an existing backup." ] pub struct DatabaseAdminClient < T > { inner : tonic :: client :: Grpc < T > , } impl < T > DatabaseAdminClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new ( inner : T ) -> Self { let inner = tonic :: client :: Grpc :: new ( inner ) ; Self { inner } } pub fn with_interceptor ( inner : T , interceptor : impl Into < tonic :: Interceptor > ) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor ( inner , interceptor ) ; Self { inner } } # [ doc = " Lists Cloud Spanner databases." ] pub async fn list_databases ( & mut self , request : impl tonic :: IntoRequest < super :: ListDatabasesRequest > , ) -> Result < tonic :: Response < super :: ListDatabasesResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabases" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Creates a new Cloud Spanner database and starts to prepare it for serving." ] # [ doc = " The returned [long-running operation][google.longrunning.Operation] will" ] # [ doc = " have a name of the format `<database_name>/operations/<operation_id>` and" ] # [ doc = " can be used to track preparation of the database. The" ] # [ doc = " [metadata][google.longrunning.Operation.metadata] field type is" ] # [ doc = " [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The" ] # [ doc = " [response][google.longrunning.Operation.response] field type is" ] # [ doc = " [Database][google.spanner.admin.database.v1.Database], if successful." ] pub async fn create_database ( & mut self , request : impl tonic :: IntoRequest < super :: CreateDatabaseRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: super :: longrunning :: Operation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/CreateDatabase" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Gets the state of a Cloud Spanner database." ] pub async fn get_database ( & mut self , request : impl tonic :: IntoRequest < super :: GetDatabaseRequest > , ) -> Result < tonic :: Response < super :: Database > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabase" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates the schema of a Cloud Spanner database by" ] # [ doc = " creating/altering/dropping tables, columns, indexes, etc. The returned" ] # [ doc = " [long-running operation][google.longrunning.Operation] will have a name of" ] # [ doc = " the format `<database_name>/operations/<operation_id>` and can be used to" ] # [ doc = " track execution of the schema change(s). The" ] # [ doc = " [metadata][google.longrunning.Operation.metadata] field type is" ] # [ doc = " [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response." ] pub async fn update_database_ddl ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateDatabaseDdlRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: super :: longrunning :: Operation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/UpdateDatabaseDdl" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Drops (aka deletes) a Cloud Spanner database." ] # [ doc = " Completed backups for the database will be retained according to their" ] # [ doc = " `expire_time`." ] pub async fn drop_database ( & mut self , request : impl tonic :: IntoRequest < super :: DropDatabaseRequest > , ) -> Result < tonic :: Response < ( ) > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/DropDatabase" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Returns the schema of a Cloud Spanner database as a list of formatted" ] # [ doc = " DDL statements. This method does not show pending schema updates, those may" ] # [ doc = " be queried using the [Operations][google.longrunning.Operations] API." ] pub async fn get_database_ddl ( & mut self , request : impl tonic :: IntoRequest < super :: GetDatabaseDdlRequest > , ) -> Result < tonic :: Response < super :: GetDatabaseDdlResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabaseDdl" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Sets the access control policy on a database or backup resource." ] # [ doc = " Replaces any existing policy." ] # [ doc = "" ] # [ doc = " Authorization requires `spanner.databases.setIamPolicy`" ] # [ doc = " permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]." ] # [ doc = " For backups, authorization requires `spanner.backups.setIamPolicy`" ] # [ doc = " permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]." ] pub async fn set_iam_policy ( & mut self , request : impl tonic :: IntoRequest < super :: super :: super :: super :: super :: iam :: v1 :: SetIamPolicyRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: super :: iam :: v1 :: Policy > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/SetIamPolicy" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Gets the access control policy for a database or backup resource." ] # [ doc = " Returns an empty policy if a database or backup exists but does not have a" ] # [ doc = " policy set." ] # [ doc = "" ] # [ doc = " Authorization requires `spanner.databases.getIamPolicy` permission on" ] # [ doc = " [resource][google.iam.v1.GetIamPolicyRequest.resource]." ] # [ doc = " For backups, authorization requires `spanner.backups.getIamPolicy`" ] # [ doc = " permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]." ] pub async fn get_iam_policy ( & mut self , request : impl tonic :: IntoRequest < super :: super :: super :: super :: super :: iam :: v1 :: GetIamPolicyRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: super :: iam :: v1 :: Policy > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/GetIamPolicy" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Returns permissions that the caller has on the specified database or backup" ] # [ doc = " resource." ] # [ doc = "" ] # [ doc = " Attempting this RPC on a non-existent Cloud Spanner database will" ] # [ doc = " result in a NOT_FOUND error if the user has" ] # [ doc = " `spanner.databases.list` permission on the containing Cloud" ] # [ doc = " Spanner instance. Otherwise returns an empty set of permissions." ] # [ doc = " Calling this method on a backup that does not exist will" ] # [ doc = " result in a NOT_FOUND error if the user has" ] # [ doc = " `spanner.backups.list` permission on the containing instance." ] pub async fn test_iam_permissions ( & mut self , request : impl tonic :: IntoRequest < super :: super :: super :: super :: super :: iam :: v1 :: TestIamPermissionsRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: super :: iam :: v1 :: TestIamPermissionsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/TestIamPermissions" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Starts creating a new Cloud Spanner Backup." ] # [ doc = " The returned backup [long-running operation][google.longrunning.Operation]" ] # [ doc = " will have a name of the format" ] # [ doc = " `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`" ] # [ doc = " and can be used to track creation of the backup. The" ] # [ doc = " [metadata][google.longrunning.Operation.metadata] field type is" ] # [ doc = " [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The" ] # [ doc = " [response][google.longrunning.Operation.response] field type is" ] # [ doc = " [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the" ] # [ doc = " creation and delete the backup." ] # [ doc = " There can be only one pending backup creation per database. Backup creation" ] # [ doc = " of different databases can run concurrently." ] pub async fn create_backup ( & mut self , request : impl tonic :: IntoRequest < super :: CreateBackupRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: super :: longrunning :: Operation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/CreateBackup" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]." ] pub async fn get_backup ( & mut self , request : impl tonic :: IntoRequest < super :: GetBackupRequest > , ) -> Result < tonic :: Response < super :: Backup > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/GetBackup" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]." ] pub async fn update_backup ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateBackupRequest > , ) -> Result < tonic :: Response < super :: Backup > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/UpdateBackup" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]." ] pub async fn delete_backup ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteBackupRequest > , ) -> Result < tonic :: Response < ( ) > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/DeleteBackup" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists completed and pending backups." ] # [ doc = " Backups returned are ordered by `create_time` in descending order," ] # [ doc = " starting from the most recent `create_time`." ] pub async fn list_backups ( & mut self , request : impl tonic :: IntoRequest < super :: ListBackupsRequest > , ) -> Result < tonic :: Response < super :: ListBackupsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/ListBackups" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Create a new database by restoring from a completed backup. The new" ] # [ doc = " database must be in the same project and in an instance with the same" ] # [ doc = " instance configuration as the instance containing" ] # [ doc = " the backup. The returned database [long-running" ] # [ doc = " operation][google.longrunning.Operation] has a name of the format" ] # [ doc = " `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`," ] # [ doc = " and can be used to track the progress of the operation, and to cancel it." ] # [ doc = " The [metadata][google.longrunning.Operation.metadata] field type is" ] # [ doc = " [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]." ] # [ doc = " The [response][google.longrunning.Operation.response] type" ] # [ doc = " is [Database][google.spanner.admin.database.v1.Database], if" ] # [ doc = " successful. Cancelling the returned operation will stop the restore and" ] # [ doc = " delete the database." ] # [ doc = " There can be only one database being restored into an instance at a time." ] # [ doc = " Once the restore operation completes, a new restore operation can be" ] # [ doc = " initiated, without waiting for the optimize operation associated with the" ] # [ doc = " first restore to complete." ] pub async fn restore_database ( & mut self , request : impl tonic :: IntoRequest < super :: RestoreDatabaseRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: super :: longrunning :: Operation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/RestoreDatabase" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists database [longrunning-operations][google.longrunning.Operation]." ] # [ doc = " A database operation has a name of the form" ] # [ doc = " `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`." ] # [ doc = " The long-running operation" ] # [ doc = " [metadata][google.longrunning.Operation.metadata] field type" ] # [ doc = " `metadata.type_url` describes the type of the metadata. Operations returned" ] # [ doc = " include those that have completed/failed/canceled within the last 7 days," ] # [ doc = " and pending operations." ] pub async fn list_database_operations ( & mut self , request : impl tonic :: IntoRequest < super :: ListDatabaseOperationsRequest > , ) -> Result < tonic :: Response < super :: ListDatabaseOperationsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabaseOperations" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists the backup [long-running operations][google.longrunning.Operation] in" ] # [ doc = " the given instance. A backup operation has a name of the form" ] # [ doc = " `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`." ] # [ doc = " The long-running operation" ] # [ doc = " [metadata][google.longrunning.Operation.metadata] field type" ] # [ doc = " `metadata.type_url` describes the type of the metadata. Operations returned" ] # [ doc = " include those that have completed/failed/canceled within the last 7 days," ] # [ doc = " and pending operations. Operations returned are ordered by" ] # [ doc = " `operation.metadata.value.progress.start_time` in descending order starting" ] # [ doc = " from the most recently started operation." ] pub async fn list_backup_operations ( & mut self , request : impl tonic :: IntoRequest < super :: ListBackupOperationsRequest > , ) -> Result < tonic :: Response < super :: ListBackupOperationsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.spanner.admin.database.v1.DatabaseAdmin/ListBackupOperations" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } } impl < T : Clone > Clone for DatabaseAdminClient < T > { fn clone ( & self ) -> Self { Self { inner : self . inner . clone ( ) , } } } impl < T > std :: fmt :: Debug for DatabaseAdminClient < T > { fn fmt ( & self , f : & mut std :: fmt :: Formatter < '_ > ) -> std :: fmt :: Result { write ! ( f , "DatabaseAdminClient {{ ... }}" ) } } }use serde :: { Serialize , Deserialize } ;