yandex_cloud/
yandex.cloud.mdb.postgresql.v1.rs

1/// A PostgreSQL Backup resource. For more information, see
2/// the [Developer's Guide](/docs/managed-postgresql/concepts/backup).
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct Backup {
6    /// Required. ID of the backup.
7    #[prost(string, tag = "1")]
8    pub id: ::prost::alloc::string::String,
9    /// ID of the folder that the backup belongs to.
10    #[prost(string, tag = "2")]
11    pub folder_id: ::prost::alloc::string::String,
12    /// Creation timestamp in \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format
13    /// (i.e. when the backup operation was completed).
14    #[prost(message, optional, tag = "3")]
15    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
16    /// ID of the PostgreSQL cluster that the backup was created for.
17    #[prost(string, tag = "4")]
18    pub source_cluster_id: ::prost::alloc::string::String,
19    /// Time when the backup operation was started.
20    #[prost(message, optional, tag = "5")]
21    pub started_at: ::core::option::Option<::prost_types::Timestamp>,
22    /// Size of backup, in bytes
23    #[prost(int64, tag = "6")]
24    pub size: i64,
25    /// How this backup was created (manual/automatic/etc...)
26    #[prost(enumeration = "backup::BackupCreationType", tag = "7")]
27    pub r#type: i32,
28    /// Method of backup creation
29    #[prost(enumeration = "backup::BackupMethod", tag = "8")]
30    pub method: i32,
31    /// Size of the journal associated with backup, in bytes
32    #[prost(int64, tag = "9")]
33    pub journal_size: i64,
34    /// Status of backup
35    #[prost(enumeration = "backup::BackupStatus", tag = "10")]
36    pub status: i32,
37}
38/// Nested message and enum types in `Backup`.
39pub mod backup {
40    #[derive(
41        Clone,
42        Copy,
43        Debug,
44        PartialEq,
45        Eq,
46        Hash,
47        PartialOrd,
48        Ord,
49        ::prost::Enumeration
50    )]
51    #[repr(i32)]
52    pub enum BackupMethod {
53        Unspecified = 0,
54        /// Base backup
55        Base = 1,
56        /// Delta (incremental) PostgreSQL backup
57        Incremental = 2,
58    }
59    impl BackupMethod {
60        /// String value of the enum field names used in the ProtoBuf definition.
61        ///
62        /// The values are not transformed in any way and thus are considered stable
63        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
64        pub fn as_str_name(&self) -> &'static str {
65            match self {
66                BackupMethod::Unspecified => "BACKUP_METHOD_UNSPECIFIED",
67                BackupMethod::Base => "BASE",
68                BackupMethod::Incremental => "INCREMENTAL",
69            }
70        }
71        /// Creates an enum from field names used in the ProtoBuf definition.
72        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
73            match value {
74                "BACKUP_METHOD_UNSPECIFIED" => Some(Self::Unspecified),
75                "BASE" => Some(Self::Base),
76                "INCREMENTAL" => Some(Self::Incremental),
77                _ => None,
78            }
79        }
80    }
81    #[derive(
82        Clone,
83        Copy,
84        Debug,
85        PartialEq,
86        Eq,
87        Hash,
88        PartialOrd,
89        Ord,
90        ::prost::Enumeration
91    )]
92    #[repr(i32)]
93    pub enum BackupCreationType {
94        Unspecified = 0,
95        /// Backup created by automated daily schedule
96        Automated = 1,
97        /// Backup created by user request
98        Manual = 2,
99    }
100    impl BackupCreationType {
101        /// String value of the enum field names used in the ProtoBuf definition.
102        ///
103        /// The values are not transformed in any way and thus are considered stable
104        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
105        pub fn as_str_name(&self) -> &'static str {
106            match self {
107                BackupCreationType::Unspecified => "BACKUP_CREATION_TYPE_UNSPECIFIED",
108                BackupCreationType::Automated => "AUTOMATED",
109                BackupCreationType::Manual => "MANUAL",
110            }
111        }
112        /// Creates an enum from field names used in the ProtoBuf definition.
113        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
114            match value {
115                "BACKUP_CREATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
116                "AUTOMATED" => Some(Self::Automated),
117                "MANUAL" => Some(Self::Manual),
118                _ => None,
119            }
120        }
121    }
122    #[derive(
123        Clone,
124        Copy,
125        Debug,
126        PartialEq,
127        Eq,
128        Hash,
129        PartialOrd,
130        Ord,
131        ::prost::Enumeration
132    )]
133    #[repr(i32)]
134    pub enum BackupStatus {
135        Unspecified = 0,
136        /// Backup is done
137        Done = 1,
138        /// Backup is creating
139        Creating = 2,
140    }
141    impl BackupStatus {
142        /// String value of the enum field names used in the ProtoBuf definition.
143        ///
144        /// The values are not transformed in any way and thus are considered stable
145        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
146        pub fn as_str_name(&self) -> &'static str {
147            match self {
148                BackupStatus::Unspecified => "BACKUP_STATUS_UNSPECIFIED",
149                BackupStatus::Done => "DONE",
150                BackupStatus::Creating => "CREATING",
151            }
152        }
153        /// Creates an enum from field names used in the ProtoBuf definition.
154        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
155            match value {
156                "BACKUP_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
157                "DONE" => Some(Self::Done),
158                "CREATING" => Some(Self::Creating),
159                _ => None,
160            }
161        }
162    }
163}
164/// Message to describe a crontab schedule.
165#[allow(clippy::derive_partial_eq_without_eq)]
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct CronTab {
168    #[prost(string, tag = "3")]
169    pub day_of_month: ::prost::alloc::string::String,
170    #[prost(string, tag = "4")]
171    pub month: ::prost::alloc::string::String,
172    #[prost(string, tag = "5")]
173    pub day_of_week: ::prost::alloc::string::String,
174}
175/// Message to describe a retention policy for cluster backups.
176#[allow(clippy::derive_partial_eq_without_eq)]
177#[derive(Clone, PartialEq, ::prost::Message)]
178pub struct BackupRetentionPolicy {
179    /// Required. Policy ID.
180    #[prost(string, tag = "1")]
181    pub policy_id: ::prost::alloc::string::String,
182    /// PostgreSQL cluster ID.
183    #[prost(string, tag = "2")]
184    pub cluster_id: ::prost::alloc::string::String,
185    /// Required. Policy name.
186    #[prost(string, tag = "3")]
187    pub policy_name: ::prost::alloc::string::String,
188    /// Creation timestamp in \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format.
189    #[prost(message, optional, tag = "4")]
190    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
191    /// CronTab schedule.
192    #[prost(message, optional, tag = "5")]
193    pub cron: ::core::option::Option<CronTab>,
194    /// Retention duration.
195    #[prost(int64, tag = "6")]
196    pub retain_for_days: i64,
197    /// Human-readable description.
198    #[prost(string, tag = "7")]
199    pub description: ::prost::alloc::string::String,
200}
201#[allow(clippy::derive_partial_eq_without_eq)]
202#[derive(Clone, PartialEq, ::prost::Message)]
203pub struct ListBackupRetentionPoliciesRequest {
204    /// ID of the PostgreSQL cluster.
205    /// To get the PostgreSQL cluster ID use a \[ClusterService.List\] request.
206    #[prost(string, tag = "1")]
207    pub cluster_id: ::prost::alloc::string::String,
208    /// The maximum number of results per page to return. If the number of available
209    /// results is larger than \[page_size\], the service returns a \[ListBackupRetentionPoliciesResponse.next_page_token\]
210    /// that can be used to get the next page of results in subsequent list requests.
211    #[prost(int64, tag = "2")]
212    pub page_size: i64,
213    /// Page token. To get the next page of results, set \[page_token\]
214    /// to the \[ListBackupRetentionPoliciesResponse.next_page_token\] returned by the previous list request.
215    #[prost(string, tag = "3")]
216    pub page_token: ::prost::alloc::string::String,
217}
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct ListBackupRetentionPoliciesResponse {
221    /// List of \[BackupRetentionPolicy\] associated with the cluster.
222    #[prost(message, repeated, tag = "1")]
223    pub policies: ::prost::alloc::vec::Vec<BackupRetentionPolicy>,
224    /// This token allows you to get the next page of results for list requests. If the number of results
225    /// is larger than \[ListBackupRetentionPoliciesRequest.page_size\], use the \[next_page_token\] as the value
226    /// for the \[ListBackupRetentionPoliciesRequest.page_token\] query parameter in the next list request.
227    /// Each subsequent list request will have its own \[next_page_token\] to continue paging through the results.
228    #[prost(string, tag = "2")]
229    pub next_page_token: ::prost::alloc::string::String,
230}
231#[allow(clippy::derive_partial_eq_without_eq)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct CreateBackupRetentionPolicyRequest {
234    /// ID of the PostgreSQL cluster.
235    /// To get the PostgreSQL cluster ID use a \[ClusterService.List\] request.
236    #[prost(string, tag = "1")]
237    pub cluster_id: ::prost::alloc::string::String,
238    /// CronTab schedule.
239    #[prost(message, optional, tag = "2")]
240    pub cron: ::core::option::Option<CronTab>,
241    /// Retention duration.
242    #[prost(int64, tag = "3")]
243    pub retain_for_days: i64,
244    /// Policy description.
245    #[prost(string, tag = "4")]
246    pub description: ::prost::alloc::string::String,
247    /// Required. Policy name.
248    #[prost(string, tag = "5")]
249    pub policy_name: ::prost::alloc::string::String,
250}
251#[allow(clippy::derive_partial_eq_without_eq)]
252#[derive(Clone, PartialEq, ::prost::Message)]
253pub struct CreateBackupRetentionPolicyResponse {
254    /// Newly created \[BackupRetentionPolicy\].
255    #[prost(message, optional, tag = "1")]
256    pub policy: ::core::option::Option<BackupRetentionPolicy>,
257}
258#[allow(clippy::derive_partial_eq_without_eq)]
259#[derive(Clone, PartialEq, ::prost::Message)]
260pub struct DeleteBackupRetentionPolicyRequest {
261    /// Unique identifier for the \[BackupRetentionPolicy\].
262    #[prost(string, tag = "1")]
263    pub policy_id: ::prost::alloc::string::String,
264    /// ID of the PostgreSQL cluster.
265    /// To get the PostgreSQL cluster ID use a \[ClusterService.List\] request.
266    #[prost(string, tag = "2")]
267    pub cluster_id: ::prost::alloc::string::String,
268}
269#[allow(clippy::derive_partial_eq_without_eq)]
270#[derive(Clone, PartialEq, ::prost::Message)]
271pub struct DeleteBackupRetentionPolicyResponse {}
272/// Generated client implementations.
273pub mod backup_retention_policy_service_client {
274    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
275    use tonic::codegen::*;
276    use tonic::codegen::http::Uri;
277    /// A set of methods for managing PostgreSQL Cluster backup retention policies.
278    #[derive(Debug, Clone)]
279    pub struct BackupRetentionPolicyServiceClient<T> {
280        inner: tonic::client::Grpc<T>,
281    }
282    impl BackupRetentionPolicyServiceClient<tonic::transport::Channel> {
283        /// Attempt to create a new client by connecting to a given endpoint.
284        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
285        where
286            D: TryInto<tonic::transport::Endpoint>,
287            D::Error: Into<StdError>,
288        {
289            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
290            Ok(Self::new(conn))
291        }
292    }
293    impl<T> BackupRetentionPolicyServiceClient<T>
294    where
295        T: tonic::client::GrpcService<tonic::body::BoxBody>,
296        T::Error: Into<StdError>,
297        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
298        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
299    {
300        pub fn new(inner: T) -> Self {
301            let inner = tonic::client::Grpc::new(inner);
302            Self { inner }
303        }
304        pub fn with_origin(inner: T, origin: Uri) -> Self {
305            let inner = tonic::client::Grpc::with_origin(inner, origin);
306            Self { inner }
307        }
308        pub fn with_interceptor<F>(
309            inner: T,
310            interceptor: F,
311        ) -> BackupRetentionPolicyServiceClient<InterceptedService<T, F>>
312        where
313            F: tonic::service::Interceptor,
314            T::ResponseBody: Default,
315            T: tonic::codegen::Service<
316                http::Request<tonic::body::BoxBody>,
317                Response = http::Response<
318                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
319                >,
320            >,
321            <T as tonic::codegen::Service<
322                http::Request<tonic::body::BoxBody>,
323            >>::Error: Into<StdError> + Send + Sync,
324        {
325            BackupRetentionPolicyServiceClient::new(
326                InterceptedService::new(inner, interceptor),
327            )
328        }
329        /// Compress requests with the given encoding.
330        ///
331        /// This requires the server to support it otherwise it might respond with an
332        /// error.
333        #[must_use]
334        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
335            self.inner = self.inner.send_compressed(encoding);
336            self
337        }
338        /// Enable decompressing responses.
339        #[must_use]
340        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
341            self.inner = self.inner.accept_compressed(encoding);
342            self
343        }
344        /// Limits the maximum size of a decoded message.
345        ///
346        /// Default: `4MB`
347        #[must_use]
348        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
349            self.inner = self.inner.max_decoding_message_size(limit);
350            self
351        }
352        /// Limits the maximum size of an encoded message.
353        ///
354        /// Default: `usize::MAX`
355        #[must_use]
356        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
357            self.inner = self.inner.max_encoding_message_size(limit);
358            self
359        }
360        /// List all retention policies.
361        pub async fn list(
362            &mut self,
363            request: impl tonic::IntoRequest<super::ListBackupRetentionPoliciesRequest>,
364        ) -> std::result::Result<
365            tonic::Response<super::ListBackupRetentionPoliciesResponse>,
366            tonic::Status,
367        > {
368            self.inner
369                .ready()
370                .await
371                .map_err(|e| {
372                    tonic::Status::new(
373                        tonic::Code::Unknown,
374                        format!("Service was not ready: {}", e.into()),
375                    )
376                })?;
377            let codec = tonic::codec::ProstCodec::default();
378            let path = http::uri::PathAndQuery::from_static(
379                "/yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService/List",
380            );
381            let mut req = request.into_request();
382            req.extensions_mut()
383                .insert(
384                    GrpcMethod::new(
385                        "yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService",
386                        "List",
387                    ),
388                );
389            self.inner.unary(req, path, codec).await
390        }
391        /// Add a new retention policy.
392        pub async fn create(
393            &mut self,
394            request: impl tonic::IntoRequest<super::CreateBackupRetentionPolicyRequest>,
395        ) -> std::result::Result<
396            tonic::Response<super::CreateBackupRetentionPolicyResponse>,
397            tonic::Status,
398        > {
399            self.inner
400                .ready()
401                .await
402                .map_err(|e| {
403                    tonic::Status::new(
404                        tonic::Code::Unknown,
405                        format!("Service was not ready: {}", e.into()),
406                    )
407                })?;
408            let codec = tonic::codec::ProstCodec::default();
409            let path = http::uri::PathAndQuery::from_static(
410                "/yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService/Create",
411            );
412            let mut req = request.into_request();
413            req.extensions_mut()
414                .insert(
415                    GrpcMethod::new(
416                        "yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService",
417                        "Create",
418                    ),
419                );
420            self.inner.unary(req, path, codec).await
421        }
422        /// Delete retention policy.
423        pub async fn delete(
424            &mut self,
425            request: impl tonic::IntoRequest<super::DeleteBackupRetentionPolicyRequest>,
426        ) -> std::result::Result<
427            tonic::Response<super::DeleteBackupRetentionPolicyResponse>,
428            tonic::Status,
429        > {
430            self.inner
431                .ready()
432                .await
433                .map_err(|e| {
434                    tonic::Status::new(
435                        tonic::Code::Unknown,
436                        format!("Service was not ready: {}", e.into()),
437                    )
438                })?;
439            let codec = tonic::codec::ProstCodec::default();
440            let path = http::uri::PathAndQuery::from_static(
441                "/yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService/Delete",
442            );
443            let mut req = request.into_request();
444            req.extensions_mut()
445                .insert(
446                    GrpcMethod::new(
447                        "yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService",
448                        "Delete",
449                    ),
450                );
451            self.inner.unary(req, path, codec).await
452        }
453    }
454}
455#[allow(clippy::derive_partial_eq_without_eq)]
456#[derive(Clone, PartialEq, ::prost::Message)]
457pub struct GetBackupRequest {
458    /// ID of the backup to return information about.
459    /// To get the backup ID, use a \[ClusterService.ListBackups\] request.
460    #[prost(string, tag = "1")]
461    pub backup_id: ::prost::alloc::string::String,
462}
463#[allow(clippy::derive_partial_eq_without_eq)]
464#[derive(Clone, PartialEq, ::prost::Message)]
465pub struct ListBackupsRequest {
466    /// ID of the folder to list backups in.
467    /// To get the folder ID, use a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
468    #[prost(string, tag = "1")]
469    pub folder_id: ::prost::alloc::string::String,
470    /// The maximum number of results per page to return. If the number of available
471    /// results is larger than \[page_size\], the service returns a \[ListBackupsResponse.next_page_token\]
472    /// that can be used to get the next page of results in subsequent list requests.
473    #[prost(int64, tag = "2")]
474    pub page_size: i64,
475    /// Page token.  To get the next page of results, Set \[page_token\] to the \[ListBackupsResponse.next_page_token\]
476    /// returned by the previous list request.
477    #[prost(string, tag = "3")]
478    pub page_token: ::prost::alloc::string::String,
479}
480#[allow(clippy::derive_partial_eq_without_eq)]
481#[derive(Clone, PartialEq, ::prost::Message)]
482pub struct ListBackupsResponse {
483    /// List of PostgreSQL Backup resources.
484    #[prost(message, repeated, tag = "1")]
485    pub backups: ::prost::alloc::vec::Vec<Backup>,
486    /// This token allows you to get the next page of results for list requests. If the number of results
487    /// is larger than \[ListBackupsRequest.page_size\], use the \[next_page_token\] as the value
488    /// for the \[ListBackupsRequest.page_token\] parameter in the next list request. Each subsequent
489    /// list request will have its own \[next_page_token\] to continue paging through the results.
490    #[prost(string, tag = "2")]
491    pub next_page_token: ::prost::alloc::string::String,
492}
493#[allow(clippy::derive_partial_eq_without_eq)]
494#[derive(Clone, PartialEq, ::prost::Message)]
495pub struct DeleteBackupRequest {
496    /// Required. ID of the backup to delete.
497    #[prost(string, tag = "1")]
498    pub backup_id: ::prost::alloc::string::String,
499}
500#[allow(clippy::derive_partial_eq_without_eq)]
501#[derive(Clone, PartialEq, ::prost::Message)]
502pub struct DeleteBackupMetadata {
503    /// Required. ID of the PostgreSQL backup that is currently being deleted.
504    #[prost(string, tag = "1")]
505    pub backup_id: ::prost::alloc::string::String,
506    /// ID of the cluster which backup belonged to.
507    #[prost(string, tag = "2")]
508    pub cluster_id: ::prost::alloc::string::String,
509}
510/// Generated client implementations.
511pub mod backup_service_client {
512    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
513    use tonic::codegen::*;
514    use tonic::codegen::http::Uri;
515    /// A set of methods for managing PostgreSQL Backup resources.
516    #[derive(Debug, Clone)]
517    pub struct BackupServiceClient<T> {
518        inner: tonic::client::Grpc<T>,
519    }
520    impl BackupServiceClient<tonic::transport::Channel> {
521        /// Attempt to create a new client by connecting to a given endpoint.
522        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
523        where
524            D: TryInto<tonic::transport::Endpoint>,
525            D::Error: Into<StdError>,
526        {
527            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
528            Ok(Self::new(conn))
529        }
530    }
531    impl<T> BackupServiceClient<T>
532    where
533        T: tonic::client::GrpcService<tonic::body::BoxBody>,
534        T::Error: Into<StdError>,
535        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
536        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
537    {
538        pub fn new(inner: T) -> Self {
539            let inner = tonic::client::Grpc::new(inner);
540            Self { inner }
541        }
542        pub fn with_origin(inner: T, origin: Uri) -> Self {
543            let inner = tonic::client::Grpc::with_origin(inner, origin);
544            Self { inner }
545        }
546        pub fn with_interceptor<F>(
547            inner: T,
548            interceptor: F,
549        ) -> BackupServiceClient<InterceptedService<T, F>>
550        where
551            F: tonic::service::Interceptor,
552            T::ResponseBody: Default,
553            T: tonic::codegen::Service<
554                http::Request<tonic::body::BoxBody>,
555                Response = http::Response<
556                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
557                >,
558            >,
559            <T as tonic::codegen::Service<
560                http::Request<tonic::body::BoxBody>,
561            >>::Error: Into<StdError> + Send + Sync,
562        {
563            BackupServiceClient::new(InterceptedService::new(inner, interceptor))
564        }
565        /// Compress requests with the given encoding.
566        ///
567        /// This requires the server to support it otherwise it might respond with an
568        /// error.
569        #[must_use]
570        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
571            self.inner = self.inner.send_compressed(encoding);
572            self
573        }
574        /// Enable decompressing responses.
575        #[must_use]
576        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
577            self.inner = self.inner.accept_compressed(encoding);
578            self
579        }
580        /// Limits the maximum size of a decoded message.
581        ///
582        /// Default: `4MB`
583        #[must_use]
584        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
585            self.inner = self.inner.max_decoding_message_size(limit);
586            self
587        }
588        /// Limits the maximum size of an encoded message.
589        ///
590        /// Default: `usize::MAX`
591        #[must_use]
592        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
593            self.inner = self.inner.max_encoding_message_size(limit);
594            self
595        }
596        /// Returns the specified PostgreSQL Backup resource.
597        ///
598        /// To get the list of available PostgreSQL Backup resources, make a [List] request.
599        pub async fn get(
600            &mut self,
601            request: impl tonic::IntoRequest<super::GetBackupRequest>,
602        ) -> std::result::Result<tonic::Response<super::Backup>, tonic::Status> {
603            self.inner
604                .ready()
605                .await
606                .map_err(|e| {
607                    tonic::Status::new(
608                        tonic::Code::Unknown,
609                        format!("Service was not ready: {}", e.into()),
610                    )
611                })?;
612            let codec = tonic::codec::ProstCodec::default();
613            let path = http::uri::PathAndQuery::from_static(
614                "/yandex.cloud.mdb.postgresql.v1.BackupService/Get",
615            );
616            let mut req = request.into_request();
617            req.extensions_mut()
618                .insert(
619                    GrpcMethod::new(
620                        "yandex.cloud.mdb.postgresql.v1.BackupService",
621                        "Get",
622                    ),
623                );
624            self.inner.unary(req, path, codec).await
625        }
626        /// Retrieves the list of Backup resources available for the specified folder.
627        pub async fn list(
628            &mut self,
629            request: impl tonic::IntoRequest<super::ListBackupsRequest>,
630        ) -> std::result::Result<
631            tonic::Response<super::ListBackupsResponse>,
632            tonic::Status,
633        > {
634            self.inner
635                .ready()
636                .await
637                .map_err(|e| {
638                    tonic::Status::new(
639                        tonic::Code::Unknown,
640                        format!("Service was not ready: {}", e.into()),
641                    )
642                })?;
643            let codec = tonic::codec::ProstCodec::default();
644            let path = http::uri::PathAndQuery::from_static(
645                "/yandex.cloud.mdb.postgresql.v1.BackupService/List",
646            );
647            let mut req = request.into_request();
648            req.extensions_mut()
649                .insert(
650                    GrpcMethod::new(
651                        "yandex.cloud.mdb.postgresql.v1.BackupService",
652                        "List",
653                    ),
654                );
655            self.inner.unary(req, path, codec).await
656        }
657        /// Deletes the specified PostgreSQL cluster backup.
658        pub async fn delete(
659            &mut self,
660            request: impl tonic::IntoRequest<super::DeleteBackupRequest>,
661        ) -> std::result::Result<
662            tonic::Response<super::super::super::super::operation::Operation>,
663            tonic::Status,
664        > {
665            self.inner
666                .ready()
667                .await
668                .map_err(|e| {
669                    tonic::Status::new(
670                        tonic::Code::Unknown,
671                        format!("Service was not ready: {}", e.into()),
672                    )
673                })?;
674            let codec = tonic::codec::ProstCodec::default();
675            let path = http::uri::PathAndQuery::from_static(
676                "/yandex.cloud.mdb.postgresql.v1.BackupService/Delete",
677            );
678            let mut req = request.into_request();
679            req.extensions_mut()
680                .insert(
681                    GrpcMethod::new(
682                        "yandex.cloud.mdb.postgresql.v1.BackupService",
683                        "Delete",
684                    ),
685                );
686            self.inner.unary(req, path, codec).await
687        }
688    }
689}
690/// A maintenance window settings.
691#[allow(clippy::derive_partial_eq_without_eq)]
692#[derive(Clone, PartialEq, ::prost::Message)]
693pub struct MaintenanceWindow {
694    /// The maintenance policy in effect.
695    #[prost(oneof = "maintenance_window::Policy", tags = "1, 2")]
696    pub policy: ::core::option::Option<maintenance_window::Policy>,
697}
698/// Nested message and enum types in `MaintenanceWindow`.
699pub mod maintenance_window {
700    /// The maintenance policy in effect.
701    #[allow(clippy::derive_partial_eq_without_eq)]
702    #[derive(Clone, PartialEq, ::prost::Oneof)]
703    pub enum Policy {
704        /// Maintenance operation can be scheduled anytime.
705        #[prost(message, tag = "1")]
706        Anytime(super::AnytimeMaintenanceWindow),
707        /// Maintenance operation can be scheduled on a weekly basis.
708        #[prost(message, tag = "2")]
709        WeeklyMaintenanceWindow(super::WeeklyMaintenanceWindow),
710    }
711}
712#[allow(clippy::derive_partial_eq_without_eq)]
713#[derive(Clone, PartialEq, ::prost::Message)]
714pub struct AnytimeMaintenanceWindow {}
715/// Weelky maintenance window settings.
716#[allow(clippy::derive_partial_eq_without_eq)]
717#[derive(Clone, PartialEq, ::prost::Message)]
718pub struct WeeklyMaintenanceWindow {
719    /// Day of the week (in `DDD` format).
720    #[prost(enumeration = "weekly_maintenance_window::WeekDay", tag = "1")]
721    pub day: i32,
722    /// Hour of the day in UTC (in `HH` format).
723    #[prost(int64, tag = "2")]
724    pub hour: i64,
725}
726/// Nested message and enum types in `WeeklyMaintenanceWindow`.
727pub mod weekly_maintenance_window {
728    #[derive(
729        Clone,
730        Copy,
731        Debug,
732        PartialEq,
733        Eq,
734        Hash,
735        PartialOrd,
736        Ord,
737        ::prost::Enumeration
738    )]
739    #[repr(i32)]
740    pub enum WeekDay {
741        Unspecified = 0,
742        Mon = 1,
743        Tue = 2,
744        Wed = 3,
745        Thu = 4,
746        Fri = 5,
747        Sat = 6,
748        Sun = 7,
749    }
750    impl WeekDay {
751        /// String value of the enum field names used in the ProtoBuf definition.
752        ///
753        /// The values are not transformed in any way and thus are considered stable
754        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
755        pub fn as_str_name(&self) -> &'static str {
756            match self {
757                WeekDay::Unspecified => "WEEK_DAY_UNSPECIFIED",
758                WeekDay::Mon => "MON",
759                WeekDay::Tue => "TUE",
760                WeekDay::Wed => "WED",
761                WeekDay::Thu => "THU",
762                WeekDay::Fri => "FRI",
763                WeekDay::Sat => "SAT",
764                WeekDay::Sun => "SUN",
765            }
766        }
767        /// Creates an enum from field names used in the ProtoBuf definition.
768        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
769            match value {
770                "WEEK_DAY_UNSPECIFIED" => Some(Self::Unspecified),
771                "MON" => Some(Self::Mon),
772                "TUE" => Some(Self::Tue),
773                "WED" => Some(Self::Wed),
774                "THU" => Some(Self::Thu),
775                "FRI" => Some(Self::Fri),
776                "SAT" => Some(Self::Sat),
777                "SUN" => Some(Self::Sun),
778                _ => None,
779            }
780        }
781    }
782}
783/// A planned maintenance operation.
784#[allow(clippy::derive_partial_eq_without_eq)]
785#[derive(Clone, PartialEq, ::prost::Message)]
786pub struct MaintenanceOperation {
787    /// Information about this maintenance operation.
788    #[prost(string, tag = "1")]
789    pub info: ::prost::alloc::string::String,
790    /// Time until which this maintenance operation is delayed.
791    #[prost(message, optional, tag = "2")]
792    pub delayed_until: ::core::option::Option<::prost_types::Timestamp>,
793}
794/// A PostgreSQL Cluster resource. For more information, see
795/// the \[Concepts\](/docs/managed-postgresql/concepts) section of the documentation.
796#[allow(clippy::derive_partial_eq_without_eq)]
797#[derive(Clone, PartialEq, ::prost::Message)]
798pub struct Cluster {
799    /// ID of the PostgreSQL cluster.
800    /// This ID is assigned by MDB at creation time.
801    #[prost(string, tag = "1")]
802    pub id: ::prost::alloc::string::String,
803    /// ID of the folder that the PostgreSQL cluster belongs to.
804    #[prost(string, tag = "2")]
805    pub folder_id: ::prost::alloc::string::String,
806    /// Creation timestamp in \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format.
807    #[prost(message, optional, tag = "3")]
808    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
809    /// Name of the PostgreSQL cluster.
810    /// The name is unique within the folder. 1-63 characters long.
811    #[prost(string, tag = "4")]
812    pub name: ::prost::alloc::string::String,
813    /// Description of the PostgreSQL cluster. 0-256 characters long.
814    #[prost(string, tag = "5")]
815    pub description: ::prost::alloc::string::String,
816    /// Custom labels for the PostgreSQL cluster as `` key:value `` pairs.
817    /// Maximum 64 per resource.
818    #[prost(map = "string, string", tag = "6")]
819    pub labels: ::std::collections::HashMap<
820        ::prost::alloc::string::String,
821        ::prost::alloc::string::String,
822    >,
823    /// Deployment environment of the PostgreSQL cluster.
824    #[prost(enumeration = "cluster::Environment", tag = "7")]
825    pub environment: i32,
826    /// Description of monitoring systems relevant to the PostgreSQL cluster.
827    #[prost(message, repeated, tag = "8")]
828    pub monitoring: ::prost::alloc::vec::Vec<Monitoring>,
829    /// Configuration of the PostgreSQL cluster.
830    #[prost(message, optional, tag = "9")]
831    pub config: ::core::option::Option<ClusterConfig>,
832    /// ID of the network that the cluster belongs to.
833    #[prost(string, tag = "10")]
834    pub network_id: ::prost::alloc::string::String,
835    /// Aggregated cluster health.
836    #[prost(enumeration = "cluster::Health", tag = "11")]
837    pub health: i32,
838    /// Current state of the cluster.
839    #[prost(enumeration = "cluster::Status", tag = "12")]
840    pub status: i32,
841    /// Maintenance window for the cluster.
842    #[prost(message, optional, tag = "13")]
843    pub maintenance_window: ::core::option::Option<MaintenanceWindow>,
844    /// Planned maintenance operation to be started for the cluster within the nearest \[maintenance_window\].
845    #[prost(message, optional, tag = "14")]
846    pub planned_operation: ::core::option::Option<MaintenanceOperation>,
847    /// User security groups
848    #[prost(string, repeated, tag = "15")]
849    pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
850    /// Deletion Protection inhibits deletion of the cluster
851    #[prost(bool, tag = "16")]
852    pub deletion_protection: bool,
853    /// Host groups hosting VMs of the cluster.
854    #[prost(string, repeated, tag = "17")]
855    pub host_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
856}
857/// Nested message and enum types in `Cluster`.
858pub mod cluster {
859    #[derive(
860        Clone,
861        Copy,
862        Debug,
863        PartialEq,
864        Eq,
865        Hash,
866        PartialOrd,
867        Ord,
868        ::prost::Enumeration
869    )]
870    #[repr(i32)]
871    pub enum Environment {
872        Unspecified = 0,
873        /// Stable environment with a conservative update policy:
874        /// only hotfixes are applied during regular maintenance.
875        Production = 1,
876        /// Environment with more aggressive update policy: new versions
877        /// are rolled out irrespective of backward compatibility.
878        Prestable = 2,
879    }
880    impl Environment {
881        /// String value of the enum field names used in the ProtoBuf definition.
882        ///
883        /// The values are not transformed in any way and thus are considered stable
884        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
885        pub fn as_str_name(&self) -> &'static str {
886            match self {
887                Environment::Unspecified => "ENVIRONMENT_UNSPECIFIED",
888                Environment::Production => "PRODUCTION",
889                Environment::Prestable => "PRESTABLE",
890            }
891        }
892        /// Creates an enum from field names used in the ProtoBuf definition.
893        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
894            match value {
895                "ENVIRONMENT_UNSPECIFIED" => Some(Self::Unspecified),
896                "PRODUCTION" => Some(Self::Production),
897                "PRESTABLE" => Some(Self::Prestable),
898                _ => None,
899            }
900        }
901    }
902    #[derive(
903        Clone,
904        Copy,
905        Debug,
906        PartialEq,
907        Eq,
908        Hash,
909        PartialOrd,
910        Ord,
911        ::prost::Enumeration
912    )]
913    #[repr(i32)]
914    pub enum Health {
915        /// State of the cluster is unknown (\[Host.health\] for every host in the cluster is UNKNOWN).
916        Unknown = 0,
917        /// Cluster is alive and well (\[Host.health\] for every host in the cluster is ALIVE).
918        Alive = 1,
919        /// Cluster is inoperable (\[Host.health\] for every host in the cluster is DEAD).
920        Dead = 2,
921        /// Cluster is working below capacity (\[Host.health\] for at least one host in the cluster is not ALIVE).
922        Degraded = 3,
923    }
924    impl Health {
925        /// String value of the enum field names used in the ProtoBuf definition.
926        ///
927        /// The values are not transformed in any way and thus are considered stable
928        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
929        pub fn as_str_name(&self) -> &'static str {
930            match self {
931                Health::Unknown => "HEALTH_UNKNOWN",
932                Health::Alive => "ALIVE",
933                Health::Dead => "DEAD",
934                Health::Degraded => "DEGRADED",
935            }
936        }
937        /// Creates an enum from field names used in the ProtoBuf definition.
938        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
939            match value {
940                "HEALTH_UNKNOWN" => Some(Self::Unknown),
941                "ALIVE" => Some(Self::Alive),
942                "DEAD" => Some(Self::Dead),
943                "DEGRADED" => Some(Self::Degraded),
944                _ => None,
945            }
946        }
947    }
948    #[derive(
949        Clone,
950        Copy,
951        Debug,
952        PartialEq,
953        Eq,
954        Hash,
955        PartialOrd,
956        Ord,
957        ::prost::Enumeration
958    )]
959    #[repr(i32)]
960    pub enum Status {
961        /// Cluster state is unknown.
962        Unknown = 0,
963        /// Cluster is being created.
964        Creating = 1,
965        /// Cluster is running normally.
966        Running = 2,
967        /// Cluster encountered a problem and cannot operate.
968        Error = 3,
969        /// Cluster is being updated.
970        Updating = 4,
971        /// Cluster is stopping.
972        Stopping = 5,
973        /// Cluster stopped.
974        Stopped = 6,
975        /// Cluster is starting.
976        Starting = 7,
977    }
978    impl Status {
979        /// String value of the enum field names used in the ProtoBuf definition.
980        ///
981        /// The values are not transformed in any way and thus are considered stable
982        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
983        pub fn as_str_name(&self) -> &'static str {
984            match self {
985                Status::Unknown => "STATUS_UNKNOWN",
986                Status::Creating => "CREATING",
987                Status::Running => "RUNNING",
988                Status::Error => "ERROR",
989                Status::Updating => "UPDATING",
990                Status::Stopping => "STOPPING",
991                Status::Stopped => "STOPPED",
992                Status::Starting => "STARTING",
993            }
994        }
995        /// Creates an enum from field names used in the ProtoBuf definition.
996        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
997            match value {
998                "STATUS_UNKNOWN" => Some(Self::Unknown),
999                "CREATING" => Some(Self::Creating),
1000                "RUNNING" => Some(Self::Running),
1001                "ERROR" => Some(Self::Error),
1002                "UPDATING" => Some(Self::Updating),
1003                "STOPPING" => Some(Self::Stopping),
1004                "STOPPED" => Some(Self::Stopped),
1005                "STARTING" => Some(Self::Starting),
1006                _ => None,
1007            }
1008        }
1009    }
1010}
1011/// Monitoring system.
1012#[allow(clippy::derive_partial_eq_without_eq)]
1013#[derive(Clone, PartialEq, ::prost::Message)]
1014pub struct Monitoring {
1015    /// Name of the monitoring system.
1016    #[prost(string, tag = "1")]
1017    pub name: ::prost::alloc::string::String,
1018    /// Description of the monitoring system.
1019    #[prost(string, tag = "2")]
1020    pub description: ::prost::alloc::string::String,
1021    /// Link to the monitoring system charts for the PostgreSQL cluster.
1022    #[prost(string, tag = "3")]
1023    pub link: ::prost::alloc::string::String,
1024}
1025#[allow(clippy::derive_partial_eq_without_eq)]
1026#[derive(Clone, PartialEq, ::prost::Message)]
1027pub struct ClusterConfig {
1028    /// Version of PostgreSQL server software.
1029    #[prost(string, tag = "1")]
1030    pub version: ::prost::alloc::string::String,
1031    /// Configuration of the connection pooler.
1032    #[prost(message, optional, tag = "4")]
1033    pub pooler_config: ::core::option::Option<ConnectionPoolerConfig>,
1034    /// Resources allocated to PostgreSQL hosts.
1035    #[prost(message, optional, tag = "5")]
1036    pub resources: ::core::option::Option<Resources>,
1037    /// Configuration setting which enables/disables autofailover in cluster.
1038    #[prost(message, optional, tag = "6")]
1039    pub autofailover: ::core::option::Option<bool>,
1040    /// Time to start the daily backup, in the UTC timezone.
1041    #[prost(message, optional, tag = "7")]
1042    pub backup_window_start: ::core::option::Option<
1043        super::super::super::super::super::google::r#type::TimeOfDay,
1044    >,
1045    /// Retention policy of automated backups.
1046    #[prost(message, optional, tag = "17")]
1047    pub backup_retain_period_days: ::core::option::Option<i64>,
1048    /// Access policy to DB
1049    #[prost(message, optional, tag = "9")]
1050    pub access: ::core::option::Option<Access>,
1051    /// Configuration of the performance diagnostics service.
1052    #[prost(message, optional, tag = "12")]
1053    pub performance_diagnostics: ::core::option::Option<PerformanceDiagnostics>,
1054    /// Disk size autoscaling
1055    #[prost(message, optional, tag = "23")]
1056    pub disk_size_autoscaling: ::core::option::Option<DiskSizeAutoscaling>,
1057    /// Configuration for PostgreSQL servers in the cluster.
1058    #[prost(
1059        oneof = "cluster_config::PostgresqlConfig",
1060        tags = "2, 10, 3, 8, 13, 11, 14, 15, 18, 16, 19, 21, 22, 24, 25, 27, 28"
1061    )]
1062    pub postgresql_config: ::core::option::Option<cluster_config::PostgresqlConfig>,
1063}
1064/// Nested message and enum types in `ClusterConfig`.
1065pub mod cluster_config {
1066    /// Configuration for PostgreSQL servers in the cluster.
1067    #[allow(clippy::derive_partial_eq_without_eq)]
1068    #[derive(Clone, PartialEq, ::prost::Oneof)]
1069    pub enum PostgresqlConfig {
1070        /// Configuration of a PostgreSQL 9.6 server.
1071        #[prost(message, tag = "2")]
1072        PostgresqlConfig96(super::config::PostgresqlConfigSet96),
1073        /// Configuration of a PostgreSQL 10 1C server.
1074        #[prost(message, tag = "10")]
1075        PostgresqlConfig101c(super::config::PostgresqlConfigSet101c),
1076        /// Configuration of a PostgreSQL 10 server.
1077        #[prost(message, tag = "3")]
1078        PostgresqlConfig10(super::config::PostgresqlConfigSet10),
1079        /// Configuration of a PostgreSQL 11 server.
1080        #[prost(message, tag = "8")]
1081        PostgresqlConfig11(super::config::PostgresqlConfigSet11),
1082        /// Configuration of a PostgreSQL 11 1C server.
1083        #[prost(message, tag = "13")]
1084        PostgresqlConfig111c(super::config::PostgresqlConfigSet111c),
1085        /// Configuration of a PostgreSQL 12 server.
1086        #[prost(message, tag = "11")]
1087        PostgresqlConfig12(super::config::PostgresqlConfigSet12),
1088        /// Configuration of a PostgreSQL 12 1C server.
1089        #[prost(message, tag = "14")]
1090        PostgresqlConfig121c(super::config::PostgresqlConfigSet121c),
1091        /// Configuration of a PostgreSQL 13 server.
1092        #[prost(message, tag = "15")]
1093        PostgresqlConfig13(super::config::PostgresqlConfigSet13),
1094        /// Configuration of a PostgreSQL 13 1C server.
1095        #[prost(message, tag = "18")]
1096        PostgresqlConfig131c(super::config::PostgresqlConfigSet131c),
1097        /// Configuration of a PostgreSQL 14 server.
1098        #[prost(message, tag = "16")]
1099        PostgresqlConfig14(super::config::PostgresqlConfigSet14),
1100        /// Configuration of a PostgreSQL 14 1C server.
1101        #[prost(message, tag = "19")]
1102        PostgresqlConfig141c(super::config::PostgresqlConfigSet141c),
1103        /// Configuration of a PostgreSQL 15 server.
1104        #[prost(message, tag = "21")]
1105        PostgresqlConfig15(super::config::PostgresqlConfigSet15),
1106        /// Configuration of a PostgreSQL 15 1C server.
1107        #[prost(message, tag = "22")]
1108        PostgresqlConfig151c(super::config::PostgresqlConfigSet151c),
1109        /// Configuration of a PostgreSQL 16 server.
1110        #[prost(message, tag = "24")]
1111        PostgresqlConfig16(super::config::PostgresqlConfigSet16),
1112        /// Configuration of a PostgreSQL 16 1C server.
1113        #[prost(message, tag = "25")]
1114        PostgresqlConfig161c(super::config::PostgresqlConfigSet161c),
1115        /// Configuration of a PostgreSQL 17 server.
1116        #[prost(message, tag = "27")]
1117        PostgresqlConfig17(super::config::PostgresqlConfigSet17),
1118        /// Configuration of a PostgreSQL 17 1C server.
1119        #[prost(message, tag = "28")]
1120        PostgresqlConfig171c(super::config::PostgresqlConfigSet171c),
1121    }
1122}
1123#[allow(clippy::derive_partial_eq_without_eq)]
1124#[derive(Clone, PartialEq, ::prost::Message)]
1125pub struct ConnectionPoolerConfig {
1126    /// Mode that the connection pooler is working in.
1127    /// See descriptions of all modes in the [documentation for PgBouncer](<https://pgbouncer.github.io/usage>).
1128    #[prost(enumeration = "connection_pooler_config::PoolingMode", tag = "1")]
1129    pub pooling_mode: i32,
1130    /// Setting `server_reset_query_always` parameter in PgBouncer.
1131    #[prost(message, optional, tag = "2")]
1132    pub pool_discard: ::core::option::Option<bool>,
1133}
1134/// Nested message and enum types in `ConnectionPoolerConfig`.
1135pub mod connection_pooler_config {
1136    #[derive(
1137        Clone,
1138        Copy,
1139        Debug,
1140        PartialEq,
1141        Eq,
1142        Hash,
1143        PartialOrd,
1144        Ord,
1145        ::prost::Enumeration
1146    )]
1147    #[repr(i32)]
1148    pub enum PoolingMode {
1149        Unspecified = 0,
1150        /// Session pooling mode.
1151        Session = 1,
1152        /// Transaction pooling mode.
1153        Transaction = 2,
1154        /// Statement pooling mode.
1155        Statement = 3,
1156    }
1157    impl PoolingMode {
1158        /// String value of the enum field names used in the ProtoBuf definition.
1159        ///
1160        /// The values are not transformed in any way and thus are considered stable
1161        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1162        pub fn as_str_name(&self) -> &'static str {
1163            match self {
1164                PoolingMode::Unspecified => "POOLING_MODE_UNSPECIFIED",
1165                PoolingMode::Session => "SESSION",
1166                PoolingMode::Transaction => "TRANSACTION",
1167                PoolingMode::Statement => "STATEMENT",
1168            }
1169        }
1170        /// Creates an enum from field names used in the ProtoBuf definition.
1171        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1172            match value {
1173                "POOLING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
1174                "SESSION" => Some(Self::Session),
1175                "TRANSACTION" => Some(Self::Transaction),
1176                "STATEMENT" => Some(Self::Statement),
1177                _ => None,
1178            }
1179        }
1180    }
1181}
1182#[allow(clippy::derive_partial_eq_without_eq)]
1183#[derive(Clone, PartialEq, ::prost::Message)]
1184pub struct Host {
1185    /// Name of the PostgreSQL host. The host name is assigned by MDB at creation time, and cannot be changed.
1186    /// 1-63 characters long.
1187    ///
1188    /// The name is unique across all MDB hosts that exist on the platform, as it defines the FQDN of the host.
1189    #[prost(string, tag = "1")]
1190    pub name: ::prost::alloc::string::String,
1191    /// ID of the PostgreSQL host. The ID is assigned by MDB at creation time.
1192    #[prost(string, tag = "2")]
1193    pub cluster_id: ::prost::alloc::string::String,
1194    /// ID of the availability zone where the PostgreSQL host resides.
1195    #[prost(string, tag = "3")]
1196    pub zone_id: ::prost::alloc::string::String,
1197    /// Resources allocated to the PostgreSQL host.
1198    #[prost(message, optional, tag = "4")]
1199    pub resources: ::core::option::Option<Resources>,
1200    /// Role of the host in the cluster. If the field has default value, it is not returned in the response.
1201    #[prost(enumeration = "host::Role", tag = "5")]
1202    pub role: i32,
1203    /// Aggregated health of the host. If the field has default value, it is not returned in the response.
1204    #[prost(enumeration = "host::Health", tag = "6")]
1205    pub health: i32,
1206    /// Services provided by the host.
1207    #[prost(message, repeated, tag = "7")]
1208    pub services: ::prost::alloc::vec::Vec<Service>,
1209    /// ID of the subnet that the host belongs to.
1210    #[prost(string, tag = "8")]
1211    pub subnet_id: ::prost::alloc::string::String,
1212    /// Name of the host to be used as the replication source for cascading replication.
1213    #[prost(string, tag = "9")]
1214    pub replication_source: ::prost::alloc::string::String,
1215    /// Priority of the host as a replica. Higher value means higher priority.
1216    ///
1217    /// The host with the highest priority is the synchronous replica. All others are asynchronous.
1218    /// The synchronous replica replaces the master when needed.
1219    ///
1220    /// When a replica becomes the master, its priority is ignored.
1221    #[prost(message, optional, tag = "10")]
1222    pub priority: ::core::option::Option<i64>,
1223    /// Configuration of a PostgreSQL server for the host.
1224    #[prost(message, optional, tag = "11")]
1225    pub config: ::core::option::Option<HostConfig>,
1226    /// Flag showing public IP assignment status to this host.
1227    #[prost(bool, tag = "12")]
1228    pub assign_public_ip: bool,
1229    #[prost(enumeration = "host::ReplicaType", tag = "13")]
1230    pub replica_type: i32,
1231}
1232/// Nested message and enum types in `Host`.
1233pub mod host {
1234    #[derive(
1235        Clone,
1236        Copy,
1237        Debug,
1238        PartialEq,
1239        Eq,
1240        Hash,
1241        PartialOrd,
1242        Ord,
1243        ::prost::Enumeration
1244    )]
1245    #[repr(i32)]
1246    pub enum Role {
1247        /// Role of the host in the cluster is unknown. Default value.
1248        Unknown = 0,
1249        /// Host is the master PostgreSQL server in the cluster.
1250        Master = 1,
1251        /// Host is a replica (standby) PostgreSQL server in the cluster.
1252        Replica = 2,
1253    }
1254    impl Role {
1255        /// String value of the enum field names used in the ProtoBuf definition.
1256        ///
1257        /// The values are not transformed in any way and thus are considered stable
1258        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1259        pub fn as_str_name(&self) -> &'static str {
1260            match self {
1261                Role::Unknown => "ROLE_UNKNOWN",
1262                Role::Master => "MASTER",
1263                Role::Replica => "REPLICA",
1264            }
1265        }
1266        /// Creates an enum from field names used in the ProtoBuf definition.
1267        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1268            match value {
1269                "ROLE_UNKNOWN" => Some(Self::Unknown),
1270                "MASTER" => Some(Self::Master),
1271                "REPLICA" => Some(Self::Replica),
1272                _ => None,
1273            }
1274        }
1275    }
1276    #[derive(
1277        Clone,
1278        Copy,
1279        Debug,
1280        PartialEq,
1281        Eq,
1282        Hash,
1283        PartialOrd,
1284        Ord,
1285        ::prost::Enumeration
1286    )]
1287    #[repr(i32)]
1288    pub enum ReplicaType {
1289        /// Replica type is unknown (we have no data) or it's master
1290        Unknown = 0,
1291        Async = 1,
1292        Sync = 2,
1293        Quorum = 3,
1294    }
1295    impl ReplicaType {
1296        /// String value of the enum field names used in the ProtoBuf definition.
1297        ///
1298        /// The values are not transformed in any way and thus are considered stable
1299        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1300        pub fn as_str_name(&self) -> &'static str {
1301            match self {
1302                ReplicaType::Unknown => "REPLICA_TYPE_UNKNOWN",
1303                ReplicaType::Async => "ASYNC",
1304                ReplicaType::Sync => "SYNC",
1305                ReplicaType::Quorum => "QUORUM",
1306            }
1307        }
1308        /// Creates an enum from field names used in the ProtoBuf definition.
1309        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1310            match value {
1311                "REPLICA_TYPE_UNKNOWN" => Some(Self::Unknown),
1312                "ASYNC" => Some(Self::Async),
1313                "SYNC" => Some(Self::Sync),
1314                "QUORUM" => Some(Self::Quorum),
1315                _ => None,
1316            }
1317        }
1318    }
1319    #[derive(
1320        Clone,
1321        Copy,
1322        Debug,
1323        PartialEq,
1324        Eq,
1325        Hash,
1326        PartialOrd,
1327        Ord,
1328        ::prost::Enumeration
1329    )]
1330    #[repr(i32)]
1331    pub enum Health {
1332        /// Health of the host is unknown. Default value.
1333        Unknown = 0,
1334        /// The host is performing all its functions normally.
1335        Alive = 1,
1336        /// The host is inoperable, and cannot perform any of its essential functions.
1337        Dead = 2,
1338        /// The host is degraded, and can perform only some of its essential functions.
1339        Degraded = 3,
1340        /// The host is alive, but in read-only mode.
1341        Readonly = 4,
1342    }
1343    impl Health {
1344        /// String value of the enum field names used in the ProtoBuf definition.
1345        ///
1346        /// The values are not transformed in any way and thus are considered stable
1347        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1348        pub fn as_str_name(&self) -> &'static str {
1349            match self {
1350                Health::Unknown => "HEALTH_UNKNOWN",
1351                Health::Alive => "ALIVE",
1352                Health::Dead => "DEAD",
1353                Health::Degraded => "DEGRADED",
1354                Health::Readonly => "READONLY",
1355            }
1356        }
1357        /// Creates an enum from field names used in the ProtoBuf definition.
1358        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1359            match value {
1360                "HEALTH_UNKNOWN" => Some(Self::Unknown),
1361                "ALIVE" => Some(Self::Alive),
1362                "DEAD" => Some(Self::Dead),
1363                "DEGRADED" => Some(Self::Degraded),
1364                "READONLY" => Some(Self::Readonly),
1365                _ => None,
1366            }
1367        }
1368    }
1369}
1370#[allow(clippy::derive_partial_eq_without_eq)]
1371#[derive(Clone, PartialEq, ::prost::Message)]
1372pub struct HostConfig {
1373    /// Configuration of a PostgreSQL server for the host.
1374    #[prost(
1375        oneof = "host_config::PostgresqlConfig",
1376        tags = "1, 4, 2, 3, 6, 5, 7, 8, 10, 9, 11, 12, 13, 14, 15, 16, 17"
1377    )]
1378    pub postgresql_config: ::core::option::Option<host_config::PostgresqlConfig>,
1379}
1380/// Nested message and enum types in `HostConfig`.
1381pub mod host_config {
1382    /// Configuration of a PostgreSQL server for the host.
1383    #[allow(clippy::derive_partial_eq_without_eq)]
1384    #[derive(Clone, PartialEq, ::prost::Oneof)]
1385    pub enum PostgresqlConfig {
1386        /// Configuration for a host with PostgreSQL 9.6 server deployed.
1387        #[prost(message, tag = "1")]
1388        PostgresqlConfig96(super::config::PostgresqlHostConfig96),
1389        /// Configuration for a host with PostgreSQL 10 1C server deployed.
1390        #[prost(message, tag = "4")]
1391        PostgresqlConfig101c(super::config::PostgresqlHostConfig101c),
1392        /// Configuration for a host with PostgreSQL 10 server deployed.
1393        #[prost(message, tag = "2")]
1394        PostgresqlConfig10(super::config::PostgresqlHostConfig10),
1395        /// Configuration for a host with PostgreSQL 11 server deployed.
1396        #[prost(message, tag = "3")]
1397        PostgresqlConfig11(super::config::PostgresqlHostConfig11),
1398        /// Configuration for a host with PostgreSQL 11 1C server deployed.
1399        #[prost(message, tag = "6")]
1400        PostgresqlConfig111c(super::config::PostgresqlHostConfig111c),
1401        /// Configuration for a host with PostgreSQL 12 server deployed.
1402        #[prost(message, tag = "5")]
1403        PostgresqlConfig12(super::config::PostgresqlHostConfig12),
1404        /// Configuration for a host with PostgreSQL 12 1C server deployed.
1405        #[prost(message, tag = "7")]
1406        PostgresqlConfig121c(super::config::PostgresqlHostConfig121c),
1407        /// Configuration for a host with PostgreSQL 13 server deployed.
1408        #[prost(message, tag = "8")]
1409        PostgresqlConfig13(super::config::PostgresqlHostConfig13),
1410        /// Configuration for a host with PostgreSQL 13 1C server deployed.
1411        #[prost(message, tag = "10")]
1412        PostgresqlConfig131c(super::config::PostgresqlHostConfig131c),
1413        /// Configuration for a host with PostgreSQL 14 server deployed.
1414        #[prost(message, tag = "9")]
1415        PostgresqlConfig14(super::config::PostgresqlHostConfig14),
1416        /// Configuration for a host with PostgreSQL 14 1C server deployed.
1417        #[prost(message, tag = "11")]
1418        PostgresqlConfig141c(super::config::PostgresqlHostConfig141c),
1419        /// Configuration for a host with PostgreSQL 15 server deployed.
1420        #[prost(message, tag = "12")]
1421        PostgresqlConfig15(super::config::PostgresqlHostConfig15),
1422        /// Configuration for a host with PostgreSQL 15 1C server deployed.
1423        #[prost(message, tag = "13")]
1424        PostgresqlConfig151c(super::config::PostgresqlHostConfig151c),
1425        /// Configuration for a host with PostgreSQL 16 server deployed.
1426        #[prost(message, tag = "14")]
1427        PostgresqlConfig16(super::config::PostgresqlHostConfig16),
1428        /// Configuration for a host with PostgreSQL 16 1C server deployed.
1429        #[prost(message, tag = "15")]
1430        PostgresqlConfig161c(super::config::PostgresqlHostConfig161c),
1431        /// Configuration for a host with PostgreSQL 17 server deployed.
1432        #[prost(message, tag = "16")]
1433        PostgresqlConfig17(super::config::PostgresqlHostConfig17),
1434        /// Configuration for a host with PostgreSQL 17 1C server deployed.
1435        #[prost(message, tag = "17")]
1436        PostgresqlConfig171c(super::config::PostgresqlHostConfig171c),
1437    }
1438}
1439#[allow(clippy::derive_partial_eq_without_eq)]
1440#[derive(Clone, PartialEq, ::prost::Message)]
1441pub struct Service {
1442    /// Type of the service provided by the host. If the field has default value, it is not returned in the response.
1443    #[prost(enumeration = "service::Type", tag = "1")]
1444    pub r#type: i32,
1445    /// Aggregated health of the service. If the field has default value, it is not returned in the response.
1446    #[prost(enumeration = "service::Health", tag = "2")]
1447    pub health: i32,
1448}
1449/// Nested message and enum types in `Service`.
1450pub mod service {
1451    #[derive(
1452        Clone,
1453        Copy,
1454        Debug,
1455        PartialEq,
1456        Eq,
1457        Hash,
1458        PartialOrd,
1459        Ord,
1460        ::prost::Enumeration
1461    )]
1462    #[repr(i32)]
1463    pub enum Type {
1464        /// Service type of the host is unspecified. Default value.
1465        Unspecified = 0,
1466        /// The host is a PostgreSQL server.
1467        Postgresql = 1,
1468        /// The host is a PgBouncer server.
1469        Pooler = 2,
1470    }
1471    impl Type {
1472        /// String value of the enum field names used in the ProtoBuf definition.
1473        ///
1474        /// The values are not transformed in any way and thus are considered stable
1475        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1476        pub fn as_str_name(&self) -> &'static str {
1477            match self {
1478                Type::Unspecified => "TYPE_UNSPECIFIED",
1479                Type::Postgresql => "POSTGRESQL",
1480                Type::Pooler => "POOLER",
1481            }
1482        }
1483        /// Creates an enum from field names used in the ProtoBuf definition.
1484        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1485            match value {
1486                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1487                "POSTGRESQL" => Some(Self::Postgresql),
1488                "POOLER" => Some(Self::Pooler),
1489                _ => None,
1490            }
1491        }
1492    }
1493    #[derive(
1494        Clone,
1495        Copy,
1496        Debug,
1497        PartialEq,
1498        Eq,
1499        Hash,
1500        PartialOrd,
1501        Ord,
1502        ::prost::Enumeration
1503    )]
1504    #[repr(i32)]
1505    pub enum Health {
1506        /// Health of the server is unknown. Default value.
1507        Unknown = 0,
1508        /// The server is working normally.
1509        Alive = 1,
1510        /// The server is dead or unresponsive.
1511        Dead = 2,
1512        /// The server is in read-only mode.
1513        Readonly = 3,
1514    }
1515    impl Health {
1516        /// String value of the enum field names used in the ProtoBuf definition.
1517        ///
1518        /// The values are not transformed in any way and thus are considered stable
1519        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1520        pub fn as_str_name(&self) -> &'static str {
1521            match self {
1522                Health::Unknown => "HEALTH_UNKNOWN",
1523                Health::Alive => "ALIVE",
1524                Health::Dead => "DEAD",
1525                Health::Readonly => "READONLY",
1526            }
1527        }
1528        /// Creates an enum from field names used in the ProtoBuf definition.
1529        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1530            match value {
1531                "HEALTH_UNKNOWN" => Some(Self::Unknown),
1532                "ALIVE" => Some(Self::Alive),
1533                "DEAD" => Some(Self::Dead),
1534                "READONLY" => Some(Self::Readonly),
1535                _ => None,
1536            }
1537        }
1538    }
1539}
1540#[allow(clippy::derive_partial_eq_without_eq)]
1541#[derive(Clone, PartialEq, ::prost::Message)]
1542pub struct Resources {
1543    /// ID of the preset for computational resources available to a host (CPU, memory etc.).
1544    /// All available presets are listed in the \[documentation\](/docs/managed-postgresql/concepts/instance-types).
1545    #[prost(string, tag = "1")]
1546    pub resource_preset_id: ::prost::alloc::string::String,
1547    /// Volume of the storage available to a host, in bytes.
1548    #[prost(int64, tag = "2")]
1549    pub disk_size: i64,
1550    /// Type of the storage environment for the host.
1551    /// Possible values:
1552    /// * network-hdd - network HDD drive,
1553    /// * network-ssd - network SSD drive,
1554    /// * local-ssd - local SSD storage.
1555    #[prost(string, tag = "3")]
1556    pub disk_type_id: ::prost::alloc::string::String,
1557}
1558#[allow(clippy::derive_partial_eq_without_eq)]
1559#[derive(Clone, PartialEq, ::prost::Message)]
1560pub struct Access {
1561    /// Allow access for DataLens
1562    #[prost(bool, tag = "1")]
1563    pub data_lens: bool,
1564    /// Allow SQL queries to the cluster databases from the management console.
1565    ///
1566    /// See [SQL queries in the management console](/docs/managed-postgresql/operations/web-sql-query) for more details.
1567    #[prost(bool, tag = "2")]
1568    pub web_sql: bool,
1569    /// Allow access for Serverless
1570    #[prost(bool, tag = "3")]
1571    pub serverless: bool,
1572    /// Allow access for DataTransfer.
1573    #[prost(bool, tag = "4")]
1574    pub data_transfer: bool,
1575    /// Allow access for YandexQuery.
1576    #[prost(bool, tag = "5")]
1577    pub yandex_query: bool,
1578}
1579#[allow(clippy::derive_partial_eq_without_eq)]
1580#[derive(Clone, PartialEq, ::prost::Message)]
1581pub struct PerformanceDiagnostics {
1582    /// Configuration setting which enables/disables performance diagnostics service in cluster.
1583    #[prost(bool, tag = "1")]
1584    pub enabled: bool,
1585    /// Interval (in seconds) for pg_stat_activity sampling
1586    #[prost(int64, tag = "2")]
1587    pub sessions_sampling_interval: i64,
1588    /// Interval (in seconds) for pg_stat_statements sampling
1589    #[prost(int64, tag = "3")]
1590    pub statements_sampling_interval: i64,
1591}
1592#[allow(clippy::derive_partial_eq_without_eq)]
1593#[derive(Clone, PartialEq, ::prost::Message)]
1594pub struct DiskSizeAutoscaling {
1595    /// Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold.
1596    #[prost(int64, tag = "1")]
1597    pub planned_usage_threshold: i64,
1598    /// Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold.
1599    #[prost(int64, tag = "2")]
1600    pub emergency_usage_threshold: i64,
1601    /// New storage size (in bytes) that is set when one of the thresholds is achieved.
1602    #[prost(int64, tag = "3")]
1603    pub disk_size_limit: i64,
1604}
1605/// A PostgreSQL Database resource. For more information, see
1606/// the [Developer's Guide](/docs/managed-postgresql/concepts).
1607#[allow(clippy::derive_partial_eq_without_eq)]
1608#[derive(Clone, PartialEq, ::prost::Message)]
1609pub struct Database {
1610    /// Name of the database.
1611    #[prost(string, tag = "1")]
1612    pub name: ::prost::alloc::string::String,
1613    /// ID of the PostgreSQL cluster that the database belongs to.
1614    #[prost(string, tag = "2")]
1615    pub cluster_id: ::prost::alloc::string::String,
1616    /// Name of the user assigned as the owner of the database.
1617    #[prost(string, tag = "3")]
1618    pub owner: ::prost::alloc::string::String,
1619    /// POSIX locale for string sorting order.
1620    /// Can only be set at creation time.
1621    #[prost(string, tag = "4")]
1622    pub lc_collate: ::prost::alloc::string::String,
1623    /// POSIX locale for character classification.
1624    /// Can only be set at creation time.
1625    #[prost(string, tag = "5")]
1626    pub lc_ctype: ::prost::alloc::string::String,
1627    /// PostgreSQL extensions enabled for the database.
1628    #[prost(message, repeated, tag = "6")]
1629    pub extensions: ::prost::alloc::vec::Vec<Extension>,
1630    /// Name of the database template.
1631    #[prost(string, tag = "7")]
1632    pub template_db: ::prost::alloc::string::String,
1633    /// Deletion Protection inhibits deletion of the database
1634    ///
1635    /// Default value: `unspecified` (inherits cluster's deletion_protection)
1636    #[prost(message, optional, tag = "8")]
1637    pub deletion_protection: ::core::option::Option<bool>,
1638}
1639#[allow(clippy::derive_partial_eq_without_eq)]
1640#[derive(Clone, PartialEq, ::prost::Message)]
1641pub struct Extension {
1642    /// Name of the extension, e.g. `pg_trgm` or `pg_btree`.
1643    /// Extensions supported by Managed Service for PostgreSQL are [listed in the Developer's Guide](/docs/managed-postgresql/operations/extensions/cluster-extensions).
1644    #[prost(string, tag = "1")]
1645    pub name: ::prost::alloc::string::String,
1646    /// Version of the extension.
1647    #[prost(string, tag = "2")]
1648    pub version: ::prost::alloc::string::String,
1649}
1650#[allow(clippy::derive_partial_eq_without_eq)]
1651#[derive(Clone, PartialEq, ::prost::Message)]
1652pub struct DatabaseSpec {
1653    /// Name of the PostgreSQL database. 1-63 characters long.
1654    #[prost(string, tag = "1")]
1655    pub name: ::prost::alloc::string::String,
1656    /// Name of the user to be assigned as the owner of the database.
1657    /// To get the list of available PostgreSQL users, make a \[UserService.List\] request.
1658    #[prost(string, tag = "2")]
1659    pub owner: ::prost::alloc::string::String,
1660    /// POSIX locale for string sorting order.
1661    /// Can only be set at creation time.
1662    #[prost(string, tag = "3")]
1663    pub lc_collate: ::prost::alloc::string::String,
1664    /// POSIX locale for character classification.
1665    /// Can only be set at creation time.
1666    #[prost(string, tag = "4")]
1667    pub lc_ctype: ::prost::alloc::string::String,
1668    /// PostgreSQL extensions to be enabled for the database.
1669    #[prost(message, repeated, tag = "5")]
1670    pub extensions: ::prost::alloc::vec::Vec<Extension>,
1671    /// Name of the PostgreSQL database template.
1672    #[prost(string, tag = "6")]
1673    pub template_db: ::prost::alloc::string::String,
1674    /// Deletion Protection inhibits deletion of the database
1675    ///
1676    /// Default value: `unspecified` (inherits cluster's deletion_protection)
1677    #[prost(message, optional, tag = "7")]
1678    pub deletion_protection: ::core::option::Option<bool>,
1679}
1680/// A PostgreSQL User resource. For more information, see
1681/// the [Developer's Guide](/docs/managed-postgresql/concepts).
1682#[allow(clippy::derive_partial_eq_without_eq)]
1683#[derive(Clone, PartialEq, ::prost::Message)]
1684pub struct User {
1685    /// Name of the PostgreSQL user.
1686    #[prost(string, tag = "1")]
1687    pub name: ::prost::alloc::string::String,
1688    /// ID of the PostgreSQL cluster the user belongs to.
1689    #[prost(string, tag = "2")]
1690    pub cluster_id: ::prost::alloc::string::String,
1691    /// Set of permissions granted to the user to access specific databases.
1692    #[prost(message, repeated, tag = "3")]
1693    pub permissions: ::prost::alloc::vec::Vec<Permission>,
1694    /// Maximum number of database connections available to the user.
1695    ///
1696    /// When used in session pooling, this setting limits the number of connections to every single host in PostgreSQL cluster. In this case, the setting's value must be greater than the total number of connections that backend services can open to access the PostgreSQL cluster. The setting's value should not exceed the value of the \[Cluster.config.postgresql_config_12.effective_config.max_connections\] setting.
1697    ///
1698    /// When used in transaction pooling, this setting limits the number of user's active transactions; therefore, in this mode user can open thousands of connections, but only `N` concurrent connections will be opened, where `N` is the value of the setting.
1699    ///
1700    /// Minimum value: `10` (default: `50`), when used in session pooling.
1701    #[prost(int64, tag = "4")]
1702    pub conn_limit: i64,
1703    #[prost(message, optional, tag = "5")]
1704    pub settings: ::core::option::Option<UserSettings>,
1705    /// This flag defines whether the user can login to a PostgreSQL database.
1706    ///
1707    /// Default value: `true` (login is allowed).
1708    #[prost(message, optional, tag = "6")]
1709    pub login: ::core::option::Option<bool>,
1710    /// A set of roles and privileges that are granted to the user.
1711    ///
1712    /// For more information, see [the documentation](/docs/managed-postgresql/operations/grant).
1713    #[prost(string, repeated, tag = "7")]
1714    pub grants: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1715    /// Determines whether the user deletion protection is enabled.
1716    ///
1717    /// The default value is `unspecified`. In this case, the user configuration inherits the cluster's deletion protection settings.
1718    #[prost(message, optional, tag = "8")]
1719    pub deletion_protection: ::core::option::Option<bool>,
1720    /// Password-based authentication method for user.
1721    /// Possible values are `` USER_PASSWORD_ENCRYPTION_MD5 `` or `` USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``.
1722    /// The default is `` password_encryption `` setting for cluster.
1723    #[prost(enumeration = "UserPasswordEncryption", tag = "9")]
1724    pub user_password_encryption: i32,
1725    /// Connection Manager Connection and settings associated with user. Read only field.
1726    #[prost(message, optional, tag = "10")]
1727    pub connection_manager: ::core::option::Option<ConnectionManager>,
1728}
1729#[allow(clippy::derive_partial_eq_without_eq)]
1730#[derive(Clone, PartialEq, ::prost::Message)]
1731pub struct Permission {
1732    /// Name of the database that the permission grants access to.
1733    #[prost(string, tag = "1")]
1734    pub database_name: ::prost::alloc::string::String,
1735}
1736#[allow(clippy::derive_partial_eq_without_eq)]
1737#[derive(Clone, PartialEq, ::prost::Message)]
1738pub struct ConnectionManager {
1739    /// ID of Connection Manager Connection
1740    #[prost(string, tag = "1")]
1741    pub connection_id: ::prost::alloc::string::String,
1742}
1743#[allow(clippy::derive_partial_eq_without_eq)]
1744#[derive(Clone, PartialEq, ::prost::Message)]
1745pub struct UserSpec {
1746    /// Name of the PostgreSQL user.
1747    #[prost(string, tag = "1")]
1748    pub name: ::prost::alloc::string::String,
1749    /// Password of the PostgreSQL user.
1750    #[prost(string, tag = "2")]
1751    pub password: ::prost::alloc::string::String,
1752    /// Set of permissions to grant to the user to access specific databases.
1753    #[prost(message, repeated, tag = "3")]
1754    pub permissions: ::prost::alloc::vec::Vec<Permission>,
1755    /// Maximum number of database connections that should be available to the user.
1756    ///
1757    /// When used in session pooling, this setting limits the number of connections to every single host in PostgreSQL cluster. In this case, the setting's value must be greater than the total number of connections that backend services can open to access the PostgreSQL cluster. The setting's value should not exceed the value of the \[Cluster.config.postgresql_config_12.effective_config.max_connections\] setting.
1758    ///
1759    /// When used in transaction pooling, this setting limits the number of user's active transactions; therefore, in this mode user can open thousands of connections, but only `N` concurrent connections will be opened, where `N` is the value of the setting.
1760    ///
1761    /// Minimum value: `10` (default: `50`), when used in session pooling.
1762    #[prost(message, optional, tag = "4")]
1763    pub conn_limit: ::core::option::Option<i64>,
1764    /// PostgreSQL settings for the user.
1765    #[prost(message, optional, tag = "5")]
1766    pub settings: ::core::option::Option<UserSettings>,
1767    /// This flag defines whether the user can login to a PostgreSQL database.
1768    ///
1769    /// Default value: `true` (login is allowed).
1770    #[prost(message, optional, tag = "6")]
1771    pub login: ::core::option::Option<bool>,
1772    /// A set of roles and privileges that are granted to the user.
1773    ///
1774    /// For more information, see [the documentation](/docs/managed-postgresql/operations/grant).
1775    #[prost(string, repeated, tag = "7")]
1776    pub grants: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1777    /// Deletion Protection inhibits deletion of the user
1778    ///
1779    /// Default value: `unspecified` (inherits cluster's deletion_protection)
1780    #[prost(message, optional, tag = "8")]
1781    pub deletion_protection: ::core::option::Option<bool>,
1782    /// Password-based authentication method for user.
1783    /// Possible values are `` USER_PASSWORD_ENCRYPTION_MD5 `` or `` USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``.
1784    /// The default is `` password_encryption `` setting for cluster.
1785    #[prost(enumeration = "UserPasswordEncryption", tag = "9")]
1786    pub user_password_encryption: i32,
1787    /// Generate password using Connection Manager.
1788    #[prost(message, optional, tag = "10")]
1789    pub generate_password: ::core::option::Option<bool>,
1790}
1791#[allow(clippy::derive_partial_eq_without_eq)]
1792#[derive(Clone, PartialEq, ::prost::Message)]
1793pub struct PgAuditSettings {
1794    /// Defines which user queries will be written to the audit log. Corresponds to the [Pg audit log](<https://yandex.cloud/en/docs/managed-postgresql/concepts/settings-list#setting-pg-audit-log>) user setting.
1795    ///
1796    /// The possible values are the following:
1797    ///
1798    /// * PG_AUDIT_SETTINGS_LOG_READ: `SELECT` and `COPY` queries are logged if the data source is a relation or query.
1799    /// * PG_AUDIT_SETTINGS_LOG_WRITE: `INSERT`, `UPDATE`, `DELETE`, `TRUNCATE`, and `COPY` queries are logged if the data target is a relation.
1800    /// * PG_AUDIT_SETTINGS_LOG_FUNCTION: Function invocations and `DO` sections are logged.
1801    /// * PG_AUDIT_SETTINGS_LOG_ROLE: Statements related to role and privilege management, such as `GRANT`, `REVOKE`, or `CREATE/ALTER/DROP ROLE`, are logged.
1802    /// * PG_AUDIT_SETTINGS_LOG_DDL: Any `DDL` statements that do not belong to the `ROLE` class are logged.
1803    /// * PG_AUDIT_SETTINGS_LOG_MISC: Miscellaneous commands, such as `DISCARD`, `FETCH`, `CHECKPOINT`, `VACUUM`, and `SET`, are logged.
1804    /// * PG_AUDIT_SETTINGS_LOG_MISC_SET: Miscellaneous `SET` commands, e.g., `SET ROLE`, are logged.
1805    ///
1806    /// The default value is PG_AUDIT_SETTINGS_LOG_UNSPECIFIED. In this case, the parameter is not configured.
1807    #[prost(enumeration = "pg_audit_settings::PgAuditSettingsLog", repeated, tag = "1")]
1808    pub log: ::prost::alloc::vec::Vec<i32>,
1809}
1810/// Nested message and enum types in `PGAuditSettings`.
1811pub mod pg_audit_settings {
1812    #[derive(
1813        Clone,
1814        Copy,
1815        Debug,
1816        PartialEq,
1817        Eq,
1818        Hash,
1819        PartialOrd,
1820        Ord,
1821        ::prost::Enumeration
1822    )]
1823    #[repr(i32)]
1824    pub enum PgAuditSettingsLog {
1825        Unspecified = 0,
1826        Read = 1,
1827        Write = 2,
1828        Function = 3,
1829        Role = 4,
1830        Ddl = 5,
1831        Misc = 6,
1832        MiscSet = 7,
1833    }
1834    impl PgAuditSettingsLog {
1835        /// String value of the enum field names used in the ProtoBuf definition.
1836        ///
1837        /// The values are not transformed in any way and thus are considered stable
1838        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1839        pub fn as_str_name(&self) -> &'static str {
1840            match self {
1841                PgAuditSettingsLog::Unspecified => "PG_AUDIT_SETTINGS_LOG_UNSPECIFIED",
1842                PgAuditSettingsLog::Read => "PG_AUDIT_SETTINGS_LOG_READ",
1843                PgAuditSettingsLog::Write => "PG_AUDIT_SETTINGS_LOG_WRITE",
1844                PgAuditSettingsLog::Function => "PG_AUDIT_SETTINGS_LOG_FUNCTION",
1845                PgAuditSettingsLog::Role => "PG_AUDIT_SETTINGS_LOG_ROLE",
1846                PgAuditSettingsLog::Ddl => "PG_AUDIT_SETTINGS_LOG_DDL",
1847                PgAuditSettingsLog::Misc => "PG_AUDIT_SETTINGS_LOG_MISC",
1848                PgAuditSettingsLog::MiscSet => "PG_AUDIT_SETTINGS_LOG_MISC_SET",
1849            }
1850        }
1851        /// Creates an enum from field names used in the ProtoBuf definition.
1852        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1853            match value {
1854                "PG_AUDIT_SETTINGS_LOG_UNSPECIFIED" => Some(Self::Unspecified),
1855                "PG_AUDIT_SETTINGS_LOG_READ" => Some(Self::Read),
1856                "PG_AUDIT_SETTINGS_LOG_WRITE" => Some(Self::Write),
1857                "PG_AUDIT_SETTINGS_LOG_FUNCTION" => Some(Self::Function),
1858                "PG_AUDIT_SETTINGS_LOG_ROLE" => Some(Self::Role),
1859                "PG_AUDIT_SETTINGS_LOG_DDL" => Some(Self::Ddl),
1860                "PG_AUDIT_SETTINGS_LOG_MISC" => Some(Self::Misc),
1861                "PG_AUDIT_SETTINGS_LOG_MISC_SET" => Some(Self::MiscSet),
1862                _ => None,
1863            }
1864        }
1865    }
1866}
1867/// PostgreSQL user settings.
1868#[allow(clippy::derive_partial_eq_without_eq)]
1869#[derive(Clone, PartialEq, ::prost::Message)]
1870pub struct UserSettings {
1871    /// SQL sets an isolation level for each transaction.
1872    /// This setting defines the default isolation level to be set for all new SQL transactions.
1873    ///
1874    /// For more information, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/transaction-iso.html>).
1875    #[prost(enumeration = "user_settings::TransactionIsolation", tag = "1")]
1876    pub default_transaction_isolation: i32,
1877    /// The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object.
1878    /// If the wait time is longer than the specified amount, then this statement is aborted.
1879    ///
1880    /// Default value: `0` (no control is enforced, a statement waiting time is unlimited).
1881    #[prost(message, optional, tag = "2")]
1882    pub lock_timeout: ::core::option::Option<i64>,
1883    /// This setting controls logging of the duration of statements.
1884    ///
1885    /// The duration of each completed statement will be logged if the statement ran for at least the specified amount of time (in milliseconds).
1886    /// E.g., if this setting's value is set to `500`, a statement that took 300 milliseconds to complete will not be logged; on the other hand, the one that took 2000 milliseconds to complete, will be logged.
1887    ///
1888    /// Value of `0` forces PostgreSQL to log the duration of all statements.
1889    ///
1890    /// Value of `-1` (default) disables logging of the duration of statements.
1891    ///
1892    /// For more information, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/runtime-config-logging.html>).
1893    #[prost(message, optional, tag = "3")]
1894    pub log_min_duration_statement: ::core::option::Option<i64>,
1895    /// This setting defines whether DBMS will commit transaction in a synchronous way.
1896    ///
1897    /// When synchronization is enabled, cluster waits for the synchronous operations to be completed prior to reporting `success` to the client.
1898    /// These operations guarantee different levels of the data safety and visibility in the cluster.
1899    ///
1900    /// For more information, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT>).
1901    #[prost(enumeration = "user_settings::SynchronousCommit", tag = "4")]
1902    pub synchronous_commit: i32,
1903    /// The maximum storage space size (in kilobytes) that a single process can use to create temporary files.
1904    /// If a transaction exceeds this limit during execution, it will be aborted.
1905    ///
1906    /// A huge query may not fit into a server's RAM, therefore PostgreSQL will use some storage to store and execute such a query. Too big queries can make excessive use of the storage system, effectively making other quieries to run slow. This setting prevents execution of a big queries that can influence other queries by limiting size of temporary files.
1907    #[prost(message, optional, tag = "5")]
1908    pub temp_file_limit: ::core::option::Option<i64>,
1909    /// This setting specifies which SQL statements should be logged (on the user level).
1910    ///
1911    /// For more information, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/runtime-config-logging.html>).
1912    #[prost(enumeration = "user_settings::LogStatement", tag = "6")]
1913    pub log_statement: i32,
1914    /// Mode that the connection pooler is working in with specified user.
1915    ///
1916    /// For more information, see the [Odyssey documentation](<https://github.com/yandex/odyssey/blob/master/documentation/configuration.md#pool-string>).
1917    #[prost(enumeration = "user_settings::PoolingMode", tag = "7")]
1918    pub pool_mode: i32,
1919    /// User can use prepared statements with transaction pooling.
1920    ///
1921    /// For more information, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/sql-prepare.html>).
1922    #[prost(message, optional, tag = "8")]
1923    pub prepared_statements_pooling: ::core::option::Option<bool>,
1924    /// The connection pooler setting. It determines the maximum allowed replication lag (in seconds).
1925    /// Pooler will reject connections to the replica with a lag above this threshold.
1926    /// It can be useful to prevent application from reading stale data.
1927    ///
1928    /// Default value: 0
1929    ///
1930    /// Value of `0` disables this mechanism
1931    #[prost(message, optional, tag = "9")]
1932    pub catchup_timeout: ::core::option::Option<i64>,
1933    /// The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+)
1934    /// Terminate replication connections that are inactive for longer than this amount of time.
1935    ///
1936    /// Default value: `60000` (60 seconds).
1937    ///
1938    /// Value of `0` disables the timeout mechanism.
1939    ///
1940    /// For more information, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/runtime-config-replication.html>).
1941    #[prost(message, optional, tag = "10")]
1942    pub wal_sender_timeout: ::core::option::Option<i64>,
1943    /// Sets the maximum allowed idle time, in milliseconds, between queries while in a transaction.
1944    ///
1945    /// The default value is `0`, which disables the timeout.
1946    ///
1947    /// For more information, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/runtime-config-client.html>).
1948    ///
1949    /// in milliseconds.
1950    #[prost(message, optional, tag = "11")]
1951    pub idle_in_transaction_session_timeout: ::core::option::Option<i64>,
1952    /// The maximum time (in milliseconds) to wait for statement.
1953    /// The timeout is measured from the time a command arrives at the server until it is completed by the server.
1954    ///
1955    /// If `log_min_error_statement` is set to ERROR or lower, the statement that timed out will also be logged.
1956    ///
1957    /// Value of `0` (default) disables the timeout
1958    ///
1959    /// For more information, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/runtime-config-client.html>).
1960    #[prost(message, optional, tag = "12")]
1961    pub statement_timeout: ::core::option::Option<i64>,
1962    /// Settings of the [PostgreSQL Audit Extension](<https://www.pgaudit.org/>) (pgaudit).
1963    #[prost(message, optional, tag = "13")]
1964    pub pgaudit: ::core::option::Option<PgAuditSettings>,
1965}
1966/// Nested message and enum types in `UserSettings`.
1967pub mod user_settings {
1968    #[derive(
1969        Clone,
1970        Copy,
1971        Debug,
1972        PartialEq,
1973        Eq,
1974        Hash,
1975        PartialOrd,
1976        Ord,
1977        ::prost::Enumeration
1978    )]
1979    #[repr(i32)]
1980    pub enum SynchronousCommit {
1981        Unspecified = 0,
1982        /// Success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server. Default value.
1983        On = 1,
1984        /// Success is reported to the client even if the data is not in WAL.
1985        /// There is no synchronous write operation, data may be loss in case of storage subsystem failure.
1986        Off = 2,
1987        /// Success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server.
1988        /// The transaction may be lost due to storage subsystem failure on the master server.
1989        Local = 3,
1990        /// Success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system.
1991        /// The transaction may be lost due to simultaneous storage subsystem failure on the master and operating system's failure on the synchronous standby.
1992        RemoteWrite = 4,
1993        /// Success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it.
1994        /// The transaction may be lost due to irrecoverably failure of both the master and its synchronous standby.
1995        RemoteApply = 5,
1996    }
1997    impl SynchronousCommit {
1998        /// String value of the enum field names used in the ProtoBuf definition.
1999        ///
2000        /// The values are not transformed in any way and thus are considered stable
2001        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2002        pub fn as_str_name(&self) -> &'static str {
2003            match self {
2004                SynchronousCommit::Unspecified => "SYNCHRONOUS_COMMIT_UNSPECIFIED",
2005                SynchronousCommit::On => "SYNCHRONOUS_COMMIT_ON",
2006                SynchronousCommit::Off => "SYNCHRONOUS_COMMIT_OFF",
2007                SynchronousCommit::Local => "SYNCHRONOUS_COMMIT_LOCAL",
2008                SynchronousCommit::RemoteWrite => "SYNCHRONOUS_COMMIT_REMOTE_WRITE",
2009                SynchronousCommit::RemoteApply => "SYNCHRONOUS_COMMIT_REMOTE_APPLY",
2010            }
2011        }
2012        /// Creates an enum from field names used in the ProtoBuf definition.
2013        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2014            match value {
2015                "SYNCHRONOUS_COMMIT_UNSPECIFIED" => Some(Self::Unspecified),
2016                "SYNCHRONOUS_COMMIT_ON" => Some(Self::On),
2017                "SYNCHRONOUS_COMMIT_OFF" => Some(Self::Off),
2018                "SYNCHRONOUS_COMMIT_LOCAL" => Some(Self::Local),
2019                "SYNCHRONOUS_COMMIT_REMOTE_WRITE" => Some(Self::RemoteWrite),
2020                "SYNCHRONOUS_COMMIT_REMOTE_APPLY" => Some(Self::RemoteApply),
2021                _ => None,
2022            }
2023        }
2024    }
2025    #[derive(
2026        Clone,
2027        Copy,
2028        Debug,
2029        PartialEq,
2030        Eq,
2031        Hash,
2032        PartialOrd,
2033        Ord,
2034        ::prost::Enumeration
2035    )]
2036    #[repr(i32)]
2037    pub enum LogStatement {
2038        Unspecified = 0,
2039        /// Logs none of SQL statements. Default value.
2040        None = 1,
2041        /// Logs all data definition statements (such as `CREATE`, `ALTER`, `DROP` and others).
2042        Ddl = 2,
2043        /// Logs all statements that fall in the `LOG_STATEMENT_DDL` category plus data-modifying statements (such as `INSERT`, `UPDATE` and others).
2044        Mod = 3,
2045        /// Logs all SQL statements.
2046        All = 4,
2047    }
2048    impl LogStatement {
2049        /// String value of the enum field names used in the ProtoBuf definition.
2050        ///
2051        /// The values are not transformed in any way and thus are considered stable
2052        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2053        pub fn as_str_name(&self) -> &'static str {
2054            match self {
2055                LogStatement::Unspecified => "LOG_STATEMENT_UNSPECIFIED",
2056                LogStatement::None => "LOG_STATEMENT_NONE",
2057                LogStatement::Ddl => "LOG_STATEMENT_DDL",
2058                LogStatement::Mod => "LOG_STATEMENT_MOD",
2059                LogStatement::All => "LOG_STATEMENT_ALL",
2060            }
2061        }
2062        /// Creates an enum from field names used in the ProtoBuf definition.
2063        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2064            match value {
2065                "LOG_STATEMENT_UNSPECIFIED" => Some(Self::Unspecified),
2066                "LOG_STATEMENT_NONE" => Some(Self::None),
2067                "LOG_STATEMENT_DDL" => Some(Self::Ddl),
2068                "LOG_STATEMENT_MOD" => Some(Self::Mod),
2069                "LOG_STATEMENT_ALL" => Some(Self::All),
2070                _ => None,
2071            }
2072        }
2073    }
2074    #[derive(
2075        Clone,
2076        Copy,
2077        Debug,
2078        PartialEq,
2079        Eq,
2080        Hash,
2081        PartialOrd,
2082        Ord,
2083        ::prost::Enumeration
2084    )]
2085    #[repr(i32)]
2086    pub enum TransactionIsolation {
2087        Unspecified = 0,
2088        /// This level behaves like `TRANSACTION_ISOLATION_READ_COMMITTED` in PostgreSQL.
2089        ReadUncommitted = 1,
2090        /// On this level query sees only data committed before the query began. Default value.
2091        ReadCommitted = 2,
2092        /// On this level all subsequent queries in a transaction will see the same rows, that were read by the first `SELECT` or `INSERT` query in this transaction, unchanged (these rows are locked during the first query).
2093        RepeatableRead = 3,
2094        /// This level provides the strictest transaction isolation.
2095        /// All queries in the current transaction see only the rows that were fixed prior to execution of the first `SELECT` or `INSERT` query in this transaction.
2096        /// If read and write operations in a concurrent set of serializable transactions overlap and this may cause an inconsistency that is not possible during the serial transaction execution, then one of the transaction will be rolled back, triggering a serialization failure.
2097        Serializable = 4,
2098    }
2099    impl TransactionIsolation {
2100        /// String value of the enum field names used in the ProtoBuf definition.
2101        ///
2102        /// The values are not transformed in any way and thus are considered stable
2103        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2104        pub fn as_str_name(&self) -> &'static str {
2105            match self {
2106                TransactionIsolation::Unspecified => "TRANSACTION_ISOLATION_UNSPECIFIED",
2107                TransactionIsolation::ReadUncommitted => {
2108                    "TRANSACTION_ISOLATION_READ_UNCOMMITTED"
2109                }
2110                TransactionIsolation::ReadCommitted => {
2111                    "TRANSACTION_ISOLATION_READ_COMMITTED"
2112                }
2113                TransactionIsolation::RepeatableRead => {
2114                    "TRANSACTION_ISOLATION_REPEATABLE_READ"
2115                }
2116                TransactionIsolation::Serializable => {
2117                    "TRANSACTION_ISOLATION_SERIALIZABLE"
2118                }
2119            }
2120        }
2121        /// Creates an enum from field names used in the ProtoBuf definition.
2122        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2123            match value {
2124                "TRANSACTION_ISOLATION_UNSPECIFIED" => Some(Self::Unspecified),
2125                "TRANSACTION_ISOLATION_READ_UNCOMMITTED" => Some(Self::ReadUncommitted),
2126                "TRANSACTION_ISOLATION_READ_COMMITTED" => Some(Self::ReadCommitted),
2127                "TRANSACTION_ISOLATION_REPEATABLE_READ" => Some(Self::RepeatableRead),
2128                "TRANSACTION_ISOLATION_SERIALIZABLE" => Some(Self::Serializable),
2129                _ => None,
2130            }
2131        }
2132    }
2133    #[derive(
2134        Clone,
2135        Copy,
2136        Debug,
2137        PartialEq,
2138        Eq,
2139        Hash,
2140        PartialOrd,
2141        Ord,
2142        ::prost::Enumeration
2143    )]
2144    #[repr(i32)]
2145    pub enum PoolingMode {
2146        Unspecified = 0,
2147        /// Server connection will be assigned to it for the whole duration the client stays connected. Default value.
2148        Session = 1,
2149        /// Server connection is assigned to a client only during a transaction.
2150        Transaction = 2,
2151        /// Server connection will be put back into the pool immediately after a query completes.
2152        Statement = 3,
2153    }
2154    impl PoolingMode {
2155        /// String value of the enum field names used in the ProtoBuf definition.
2156        ///
2157        /// The values are not transformed in any way and thus are considered stable
2158        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2159        pub fn as_str_name(&self) -> &'static str {
2160            match self {
2161                PoolingMode::Unspecified => "POOLING_MODE_UNSPECIFIED",
2162                PoolingMode::Session => "SESSION",
2163                PoolingMode::Transaction => "TRANSACTION",
2164                PoolingMode::Statement => "STATEMENT",
2165            }
2166        }
2167        /// Creates an enum from field names used in the ProtoBuf definition.
2168        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2169            match value {
2170                "POOLING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
2171                "SESSION" => Some(Self::Session),
2172                "TRANSACTION" => Some(Self::Transaction),
2173                "STATEMENT" => Some(Self::Statement),
2174                _ => None,
2175            }
2176        }
2177    }
2178}
2179#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2180#[repr(i32)]
2181pub enum UserPasswordEncryption {
2182    Unspecified = 0,
2183    Md5 = 1,
2184    ScramSha256 = 2,
2185}
2186impl UserPasswordEncryption {
2187    /// String value of the enum field names used in the ProtoBuf definition.
2188    ///
2189    /// The values are not transformed in any way and thus are considered stable
2190    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2191    pub fn as_str_name(&self) -> &'static str {
2192        match self {
2193            UserPasswordEncryption::Unspecified => "USER_PASSWORD_ENCRYPTION_UNSPECIFIED",
2194            UserPasswordEncryption::Md5 => "USER_PASSWORD_ENCRYPTION_MD5",
2195            UserPasswordEncryption::ScramSha256 => {
2196                "USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256"
2197            }
2198        }
2199    }
2200    /// Creates an enum from field names used in the ProtoBuf definition.
2201    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2202        match value {
2203            "USER_PASSWORD_ENCRYPTION_UNSPECIFIED" => Some(Self::Unspecified),
2204            "USER_PASSWORD_ENCRYPTION_MD5" => Some(Self::Md5),
2205            "USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256" => Some(Self::ScramSha256),
2206            _ => None,
2207        }
2208    }
2209}
2210#[allow(clippy::derive_partial_eq_without_eq)]
2211#[derive(Clone, PartialEq, ::prost::Message)]
2212pub struct GetClusterRequest {
2213    /// ID of the PostgreSQL Cluster resource to return.
2214    /// To get the cluster ID use a \[ClusterService.List\] request.
2215    #[prost(string, tag = "1")]
2216    pub cluster_id: ::prost::alloc::string::String,
2217}
2218#[allow(clippy::derive_partial_eq_without_eq)]
2219#[derive(Clone, PartialEq, ::prost::Message)]
2220pub struct ListClustersRequest {
2221    /// ID of the folder to list PostgreSQL clusters in.
2222    /// To get the folder ID, use a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
2223    #[prost(string, tag = "1")]
2224    pub folder_id: ::prost::alloc::string::String,
2225    /// The maximum number of results per page to return. If the number of available
2226    /// results is larger than \[page_size\], the service returns a \[ListClustersResponse.next_page_token\]
2227    /// that can be used to get the next page of results in subsequent list requests.
2228    #[prost(int64, tag = "2")]
2229    pub page_size: i64,
2230    /// Page token. To get the next page of results, set \[page_token\] to the \[ListClustersResponse.next_page_token\]
2231    /// returned by the previous list request.
2232    #[prost(string, tag = "3")]
2233    pub page_token: ::prost::alloc::string::String,
2234    /// A filter expression that filters resources listed in the response.
2235    /// The expression must specify:
2236    /// 1. The field name. Currently you can only use filtering with the \[Cluster.name\] field.
2237    /// 2. An `=` operator.
2238    /// 3. The value in double quotes (`"`). Must be 1-63 characters long and match the regular expression `\[a-zA-Z0-9_-\]+`.
2239    #[prost(string, tag = "4")]
2240    pub filter: ::prost::alloc::string::String,
2241}
2242#[allow(clippy::derive_partial_eq_without_eq)]
2243#[derive(Clone, PartialEq, ::prost::Message)]
2244pub struct ListClustersResponse {
2245    /// List of PostgreSQL Cluster resources.
2246    #[prost(message, repeated, tag = "1")]
2247    pub clusters: ::prost::alloc::vec::Vec<Cluster>,
2248    /// This token allows you to get the next page of results for list requests. If the number of results
2249    /// is larger than \[ListClustersRequest.page_size\], use the \[next_page_token\] as the value
2250    /// for the \[ListClustersRequest.page_token\] parameter in the next list request. Each subsequent
2251    /// list request will have its own \[next_page_token\] to continue paging through the results.
2252    #[prost(string, tag = "2")]
2253    pub next_page_token: ::prost::alloc::string::String,
2254}
2255/// Message to describe a new retention policy for cluster backups.
2256#[allow(clippy::derive_partial_eq_without_eq)]
2257#[derive(Clone, PartialEq, ::prost::Message)]
2258pub struct BackupRetentionPolicySpec {
2259    /// Required. Policy name.
2260    #[prost(string, tag = "1")]
2261    pub policy_name: ::prost::alloc::string::String,
2262    /// CronTab schedule.
2263    #[prost(message, optional, tag = "2")]
2264    pub cron: ::core::option::Option<CronTab>,
2265    /// Retention duration.
2266    #[prost(int64, tag = "3")]
2267    pub retain_for_days: i64,
2268    /// Human-readable description.
2269    #[prost(string, tag = "4")]
2270    pub description: ::prost::alloc::string::String,
2271}
2272#[allow(clippy::derive_partial_eq_without_eq)]
2273#[derive(Clone, PartialEq, ::prost::Message)]
2274pub struct CreateClusterRequest {
2275    /// ID of the folder to create the PostgreSQL cluster in.
2276    #[prost(string, tag = "1")]
2277    pub folder_id: ::prost::alloc::string::String,
2278    /// Name of the PostgreSQL cluster. The name must be unique within the folder.
2279    #[prost(string, tag = "2")]
2280    pub name: ::prost::alloc::string::String,
2281    /// Description of the PostgreSQL cluster.
2282    #[prost(string, tag = "3")]
2283    pub description: ::prost::alloc::string::String,
2284    /// Custom labels for the PostgreSQL cluster as `` key:value `` pairs. Maximum 64 per resource.
2285    /// For example, "project": "mvp" or "source": "dictionary".
2286    #[prost(map = "string, string", tag = "4")]
2287    pub labels: ::std::collections::HashMap<
2288        ::prost::alloc::string::String,
2289        ::prost::alloc::string::String,
2290    >,
2291    /// Deployment environment of the PostgreSQL cluster.
2292    #[prost(enumeration = "cluster::Environment", tag = "5")]
2293    pub environment: i32,
2294    /// Configuration and resources for hosts that should be created for the PostgreSQL cluster.
2295    #[prost(message, optional, tag = "6")]
2296    pub config_spec: ::core::option::Option<ConfigSpec>,
2297    /// Descriptions of databases to be created in the PostgreSQL cluster.
2298    #[prost(message, repeated, tag = "7")]
2299    pub database_specs: ::prost::alloc::vec::Vec<DatabaseSpec>,
2300    /// Descriptions of database users to be created in the PostgreSQL cluster.
2301    #[prost(message, repeated, tag = "8")]
2302    pub user_specs: ::prost::alloc::vec::Vec<UserSpec>,
2303    /// Individual configurations for hosts that should be created for the PostgreSQL cluster.
2304    #[prost(message, repeated, tag = "9")]
2305    pub host_specs: ::prost::alloc::vec::Vec<HostSpec>,
2306    /// ID of the network to create the cluster in.
2307    #[prost(string, tag = "10")]
2308    pub network_id: ::prost::alloc::string::String,
2309    /// User security groups
2310    #[prost(string, repeated, tag = "11")]
2311    pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2312    /// Deletion Protection inhibits deletion of the cluster
2313    #[prost(bool, tag = "12")]
2314    pub deletion_protection: bool,
2315    /// Host groups hosting VMs of the cluster.
2316    #[prost(string, repeated, tag = "13")]
2317    pub host_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2318    /// Window of maintenance operations.
2319    #[prost(message, optional, tag = "14")]
2320    pub maintenance_window: ::core::option::Option<MaintenanceWindow>,
2321    /// Backup long-term retention policies setting.
2322    #[prost(message, repeated, tag = "15")]
2323    pub retention_policies: ::prost::alloc::vec::Vec<BackupRetentionPolicySpec>,
2324}
2325#[allow(clippy::derive_partial_eq_without_eq)]
2326#[derive(Clone, PartialEq, ::prost::Message)]
2327pub struct CreateClusterMetadata {
2328    /// ID of the PostgreSQL cluster that is being created.
2329    #[prost(string, tag = "1")]
2330    pub cluster_id: ::prost::alloc::string::String,
2331}
2332#[allow(clippy::derive_partial_eq_without_eq)]
2333#[derive(Clone, PartialEq, ::prost::Message)]
2334pub struct UpdateClusterRequest {
2335    /// ID of the PostgreSQL Cluster resource to update.
2336    /// To get the PostgreSQL cluster ID, use a \[ClusterService.List\] request.
2337    #[prost(string, tag = "1")]
2338    pub cluster_id: ::prost::alloc::string::String,
2339    /// Field mask that specifies which fields of the PostgreSQL Cluster resource should be updated.
2340    #[prost(message, optional, tag = "2")]
2341    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
2342    /// New description of the PostgreSQL cluster.
2343    #[prost(string, tag = "3")]
2344    pub description: ::prost::alloc::string::String,
2345    /// Custom labels for the PostgreSQL cluster as `` key:value `` pairs. Maximum 64 per resource.
2346    /// For example, "project": "mvp" or "source": "dictionary".
2347    ///
2348    /// The new set of labels will completely replace the old ones. To add a label, request the current
2349    /// set with the \[ClusterService.Get\] method, then send an \[ClusterService.Update\] request with the new label added to the set.
2350    #[prost(map = "string, string", tag = "4")]
2351    pub labels: ::std::collections::HashMap<
2352        ::prost::alloc::string::String,
2353        ::prost::alloc::string::String,
2354    >,
2355    /// New configuration and resources for hosts in the cluster.
2356    #[prost(message, optional, tag = "5")]
2357    pub config_spec: ::core::option::Option<ConfigSpec>,
2358    /// New name for the cluster.
2359    #[prost(string, tag = "6")]
2360    pub name: ::prost::alloc::string::String,
2361    /// New maintenance window settings for the cluster.
2362    #[prost(message, optional, tag = "7")]
2363    pub maintenance_window: ::core::option::Option<MaintenanceWindow>,
2364    /// User security groups
2365    #[prost(string, repeated, tag = "8")]
2366    pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2367    /// Deletion Protection inhibits deletion of the cluster
2368    #[prost(bool, tag = "9")]
2369    pub deletion_protection: bool,
2370    /// ID of the network to move the cluster to.
2371    #[prost(string, tag = "11")]
2372    pub network_id: ::prost::alloc::string::String,
2373}
2374#[allow(clippy::derive_partial_eq_without_eq)]
2375#[derive(Clone, PartialEq, ::prost::Message)]
2376pub struct UpdateClusterMetadata {
2377    /// ID of the PostgreSQL Cluster resource that is being updated.
2378    #[prost(string, tag = "1")]
2379    pub cluster_id: ::prost::alloc::string::String,
2380}
2381#[allow(clippy::derive_partial_eq_without_eq)]
2382#[derive(Clone, PartialEq, ::prost::Message)]
2383pub struct DeleteClusterRequest {
2384    /// ID of the PostgreSQL cluster to delete.
2385    /// To get the PostgreSQL cluster ID, use a \[ClusterService.List\] request.
2386    #[prost(string, tag = "1")]
2387    pub cluster_id: ::prost::alloc::string::String,
2388}
2389#[allow(clippy::derive_partial_eq_without_eq)]
2390#[derive(Clone, PartialEq, ::prost::Message)]
2391pub struct DeleteClusterMetadata {
2392    /// ID of the PostgreSQL cluster that is being deleted.
2393    #[prost(string, tag = "1")]
2394    pub cluster_id: ::prost::alloc::string::String,
2395}
2396#[allow(clippy::derive_partial_eq_without_eq)]
2397#[derive(Clone, PartialEq, ::prost::Message)]
2398pub struct StartClusterRequest {
2399    /// ID of the PostgreSQL cluster to start.
2400    #[prost(string, tag = "1")]
2401    pub cluster_id: ::prost::alloc::string::String,
2402}
2403#[allow(clippy::derive_partial_eq_without_eq)]
2404#[derive(Clone, PartialEq, ::prost::Message)]
2405pub struct StartClusterMetadata {
2406    /// ID of the PostgreSQL cluster.
2407    #[prost(string, tag = "1")]
2408    pub cluster_id: ::prost::alloc::string::String,
2409}
2410#[allow(clippy::derive_partial_eq_without_eq)]
2411#[derive(Clone, PartialEq, ::prost::Message)]
2412pub struct StopClusterRequest {
2413    /// ID of the PostgreSQL cluster to stop.
2414    #[prost(string, tag = "1")]
2415    pub cluster_id: ::prost::alloc::string::String,
2416}
2417#[allow(clippy::derive_partial_eq_without_eq)]
2418#[derive(Clone, PartialEq, ::prost::Message)]
2419pub struct StopClusterMetadata {
2420    /// ID of the PostgreSQL cluster.
2421    #[prost(string, tag = "1")]
2422    pub cluster_id: ::prost::alloc::string::String,
2423}
2424#[allow(clippy::derive_partial_eq_without_eq)]
2425#[derive(Clone, PartialEq, ::prost::Message)]
2426pub struct MoveClusterRequest {
2427    /// ID of the PostgreSQL cluster to move.
2428    #[prost(string, tag = "1")]
2429    pub cluster_id: ::prost::alloc::string::String,
2430    /// ID of the destination folder.
2431    #[prost(string, tag = "2")]
2432    pub destination_folder_id: ::prost::alloc::string::String,
2433}
2434#[allow(clippy::derive_partial_eq_without_eq)]
2435#[derive(Clone, PartialEq, ::prost::Message)]
2436pub struct MoveClusterMetadata {
2437    /// ID of the PostgreSQL cluster being moved.
2438    #[prost(string, tag = "1")]
2439    pub cluster_id: ::prost::alloc::string::String,
2440    /// ID of the source folder.
2441    #[prost(string, tag = "2")]
2442    pub source_folder_id: ::prost::alloc::string::String,
2443    /// ID of the destnation folder.
2444    #[prost(string, tag = "3")]
2445    pub destination_folder_id: ::prost::alloc::string::String,
2446}
2447#[allow(clippy::derive_partial_eq_without_eq)]
2448#[derive(Clone, PartialEq, ::prost::Message)]
2449pub struct BackupClusterRequest {
2450    /// ID of the PostgreSQL cluster to back up.
2451    /// To get the PostgreSQL cluster ID, use a \[ClusterService.List\] request.
2452    #[prost(string, tag = "1")]
2453    pub cluster_id: ::prost::alloc::string::String,
2454}
2455#[allow(clippy::derive_partial_eq_without_eq)]
2456#[derive(Clone, PartialEq, ::prost::Message)]
2457pub struct BackupClusterMetadata {
2458    /// ID of the PostgreSQL cluster that is being backed up.
2459    #[prost(string, tag = "1")]
2460    pub cluster_id: ::prost::alloc::string::String,
2461    /// ID of the PostgreSQL backup that is being created.
2462    #[prost(string, tag = "2")]
2463    pub backup_id: ::prost::alloc::string::String,
2464}
2465#[allow(clippy::derive_partial_eq_without_eq)]
2466#[derive(Clone, PartialEq, ::prost::Message)]
2467pub struct RestoreClusterRequest {
2468    /// ID of the backup to create a cluster from.
2469    /// To get the backup ID, use a \[ClusterService.ListBackups\] request.
2470    #[prost(string, tag = "1")]
2471    pub backup_id: ::prost::alloc::string::String,
2472    /// Timestamp of the moment to which the PostgreSQL cluster should be restored.
2473    #[prost(message, optional, tag = "2")]
2474    pub time: ::core::option::Option<::prost_types::Timestamp>,
2475    /// Flag that indicates whether a database should be restored to the first backup point
2476    /// available just after the timestamp specified in the \[time\] field instead of just before.
2477    ///
2478    /// Possible values:
2479    /// * false (default) - the restore point refers to the first backup moment before \[time\].
2480    /// * true - the restore point refers to the first backup point after \[time\].
2481    #[prost(bool, tag = "3")]
2482    pub time_inclusive: bool,
2483    /// Name of the new PostgreSQL cluster. The name must be unique within the folder.
2484    #[prost(string, tag = "4")]
2485    pub name: ::prost::alloc::string::String,
2486    /// Description of the new PostgreSQL cluster.
2487    #[prost(string, tag = "5")]
2488    pub description: ::prost::alloc::string::String,
2489    /// Custom labels for the PostgreSQL cluster as `` key:value `` pairs. Maximum 64 per resource.
2490    /// For example, "project": "mvp" or "source": "dictionary".
2491    #[prost(map = "string, string", tag = "6")]
2492    pub labels: ::std::collections::HashMap<
2493        ::prost::alloc::string::String,
2494        ::prost::alloc::string::String,
2495    >,
2496    /// Deployment environment of the new PostgreSQL cluster.
2497    #[prost(enumeration = "cluster::Environment", tag = "7")]
2498    pub environment: i32,
2499    /// Configuration for the PostgreSQL cluster to be created.
2500    #[prost(message, optional, tag = "8")]
2501    pub config_spec: ::core::option::Option<ConfigSpec>,
2502    /// Configurations for PostgreSQL hosts that should be created for
2503    /// the cluster that is being created from the backup.
2504    #[prost(message, repeated, tag = "9")]
2505    pub host_specs: ::prost::alloc::vec::Vec<HostSpec>,
2506    /// ID of the network to create the PostgreSQL cluster in.
2507    #[prost(string, tag = "10")]
2508    pub network_id: ::prost::alloc::string::String,
2509    /// ID of the folder to create the PostgreSQL cluster in.
2510    #[prost(string, tag = "11")]
2511    pub folder_id: ::prost::alloc::string::String,
2512    /// User security groups
2513    #[prost(string, repeated, tag = "12")]
2514    pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2515    /// Deletion Protection inhibits deletion of the cluster
2516    #[prost(bool, tag = "13")]
2517    pub deletion_protection: bool,
2518    /// Host groups hosting VMs of the cluster.
2519    #[prost(string, repeated, tag = "14")]
2520    pub host_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2521}
2522#[allow(clippy::derive_partial_eq_without_eq)]
2523#[derive(Clone, PartialEq, ::prost::Message)]
2524pub struct RestoreClusterMetadata {
2525    /// ID of the new PostgreSQL cluster that is being created from a backup.
2526    #[prost(string, tag = "1")]
2527    pub cluster_id: ::prost::alloc::string::String,
2528    /// ID of the backup that is being used for creating a cluster.
2529    #[prost(string, tag = "2")]
2530    pub backup_id: ::prost::alloc::string::String,
2531}
2532#[allow(clippy::derive_partial_eq_without_eq)]
2533#[derive(Clone, PartialEq, ::prost::Message)]
2534pub struct StartClusterFailoverRequest {
2535    /// ID of PostgreSQL cluster.
2536    #[prost(string, tag = "1")]
2537    pub cluster_id: ::prost::alloc::string::String,
2538    /// New master host. Switch to the most up-to-date replica if not provided.
2539    #[prost(string, tag = "2")]
2540    pub host_name: ::prost::alloc::string::String,
2541}
2542#[allow(clippy::derive_partial_eq_without_eq)]
2543#[derive(Clone, PartialEq, ::prost::Message)]
2544pub struct StartClusterFailoverMetadata {
2545    /// ID of the PostgreSQL cluster being failovered.
2546    #[prost(string, tag = "1")]
2547    pub cluster_id: ::prost::alloc::string::String,
2548}
2549#[allow(clippy::derive_partial_eq_without_eq)]
2550#[derive(Clone, PartialEq, ::prost::Message)]
2551pub struct RescheduleMaintenanceRequest {
2552    /// ID of the PostgreSQL cluster to reschedule the maintenance operation for.
2553    #[prost(string, tag = "1")]
2554    pub cluster_id: ::prost::alloc::string::String,
2555    /// The type of reschedule request.
2556    #[prost(enumeration = "reschedule_maintenance_request::RescheduleType", tag = "2")]
2557    pub reschedule_type: i32,
2558    /// The time until which this maintenance operation should be delayed. The value should be ahead of the first time when the maintenance operation has been scheduled for no more than two weeks. The value can also point to the past moment of time if \[reschedule_type.IMMEDIATE\] reschedule type is chosen.
2559    #[prost(message, optional, tag = "3")]
2560    pub delayed_until: ::core::option::Option<::prost_types::Timestamp>,
2561}
2562/// Nested message and enum types in `RescheduleMaintenanceRequest`.
2563pub mod reschedule_maintenance_request {
2564    #[derive(
2565        Clone,
2566        Copy,
2567        Debug,
2568        PartialEq,
2569        Eq,
2570        Hash,
2571        PartialOrd,
2572        Ord,
2573        ::prost::Enumeration
2574    )]
2575    #[repr(i32)]
2576    pub enum RescheduleType {
2577        Unspecified = 0,
2578        /// Start the maintenance operation immediately.
2579        Immediate = 1,
2580        /// Start the maintenance operation within the next available maintenance window.
2581        NextAvailableWindow = 2,
2582        /// Start the maintenance operation at the specific time.
2583        SpecificTime = 3,
2584    }
2585    impl RescheduleType {
2586        /// String value of the enum field names used in the ProtoBuf definition.
2587        ///
2588        /// The values are not transformed in any way and thus are considered stable
2589        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2590        pub fn as_str_name(&self) -> &'static str {
2591            match self {
2592                RescheduleType::Unspecified => "RESCHEDULE_TYPE_UNSPECIFIED",
2593                RescheduleType::Immediate => "IMMEDIATE",
2594                RescheduleType::NextAvailableWindow => "NEXT_AVAILABLE_WINDOW",
2595                RescheduleType::SpecificTime => "SPECIFIC_TIME",
2596            }
2597        }
2598        /// Creates an enum from field names used in the ProtoBuf definition.
2599        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2600            match value {
2601                "RESCHEDULE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2602                "IMMEDIATE" => Some(Self::Immediate),
2603                "NEXT_AVAILABLE_WINDOW" => Some(Self::NextAvailableWindow),
2604                "SPECIFIC_TIME" => Some(Self::SpecificTime),
2605                _ => None,
2606            }
2607        }
2608    }
2609}
2610/// Rescheduled maintenance operation metadata.
2611#[allow(clippy::derive_partial_eq_without_eq)]
2612#[derive(Clone, PartialEq, ::prost::Message)]
2613pub struct RescheduleMaintenanceMetadata {
2614    /// Required. ID of the PostgreSQL cluster.
2615    #[prost(string, tag = "1")]
2616    pub cluster_id: ::prost::alloc::string::String,
2617    /// Required. The time until which this maintenance operation is to be delayed.
2618    #[prost(message, optional, tag = "4")]
2619    pub delayed_until: ::core::option::Option<::prost_types::Timestamp>,
2620}
2621#[allow(clippy::derive_partial_eq_without_eq)]
2622#[derive(Clone, PartialEq, ::prost::Message)]
2623pub struct LogRecord {
2624    /// Log record timestamp in \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format.
2625    #[prost(message, optional, tag = "1")]
2626    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2627    /// Contents of the log record.
2628    #[prost(map = "string, string", tag = "2")]
2629    pub message: ::std::collections::HashMap<
2630        ::prost::alloc::string::String,
2631        ::prost::alloc::string::String,
2632    >,
2633}
2634#[allow(clippy::derive_partial_eq_without_eq)]
2635#[derive(Clone, PartialEq, ::prost::Message)]
2636pub struct ListClusterLogsRequest {
2637    /// ID of the PostgreSQL cluster to request logs for.
2638    /// To get the PostgreSQL cluster ID use a \[ClusterService.List\] request.
2639    #[prost(string, tag = "1")]
2640    pub cluster_id: ::prost::alloc::string::String,
2641    /// Columns from the logs table to request.
2642    /// If no columns are specified, entire log records are returned.
2643    #[prost(string, repeated, tag = "2")]
2644    pub column_filter: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2645    /// Type of the service to request logs about.
2646    #[prost(enumeration = "list_cluster_logs_request::ServiceType", tag = "3")]
2647    pub service_type: i32,
2648    /// Start timestamp for the logs request, in \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format.
2649    #[prost(message, optional, tag = "4")]
2650    pub from_time: ::core::option::Option<::prost_types::Timestamp>,
2651    /// End timestamp for the logs request, in \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format.
2652    #[prost(message, optional, tag = "5")]
2653    pub to_time: ::core::option::Option<::prost_types::Timestamp>,
2654    /// The maximum number of results per page to return. If the number of available
2655    /// results is larger than \[page_size\], the service returns a \[ListClusterLogsResponse.next_page_token\]
2656    /// that can be used to get the next page of results in subsequent list requests.
2657    #[prost(int64, tag = "6")]
2658    pub page_size: i64,
2659    /// Page token. To get the next page of results, set \[page_token\] to the
2660    /// \[ListClusterLogsResponse.next_page_token\] returned by the previous list request.
2661    #[prost(string, tag = "7")]
2662    pub page_token: ::prost::alloc::string::String,
2663    /// Always return `next_page_token`, even if current page is empty.
2664    #[prost(bool, tag = "8")]
2665    pub always_next_page_token: bool,
2666}
2667/// Nested message and enum types in `ListClusterLogsRequest`.
2668pub mod list_cluster_logs_request {
2669    #[derive(
2670        Clone,
2671        Copy,
2672        Debug,
2673        PartialEq,
2674        Eq,
2675        Hash,
2676        PartialOrd,
2677        Ord,
2678        ::prost::Enumeration
2679    )]
2680    #[repr(i32)]
2681    pub enum ServiceType {
2682        Unspecified = 0,
2683        /// Logs of PostgreSQL activity.
2684        Postgresql = 1,
2685        /// Logs of connection pooler activity.
2686        Pooler = 2,
2687    }
2688    impl ServiceType {
2689        /// String value of the enum field names used in the ProtoBuf definition.
2690        ///
2691        /// The values are not transformed in any way and thus are considered stable
2692        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2693        pub fn as_str_name(&self) -> &'static str {
2694            match self {
2695                ServiceType::Unspecified => "SERVICE_TYPE_UNSPECIFIED",
2696                ServiceType::Postgresql => "POSTGRESQL",
2697                ServiceType::Pooler => "POOLER",
2698            }
2699        }
2700        /// Creates an enum from field names used in the ProtoBuf definition.
2701        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2702            match value {
2703                "SERVICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2704                "POSTGRESQL" => Some(Self::Postgresql),
2705                "POOLER" => Some(Self::Pooler),
2706                _ => None,
2707            }
2708        }
2709    }
2710}
2711#[allow(clippy::derive_partial_eq_without_eq)]
2712#[derive(Clone, PartialEq, ::prost::Message)]
2713pub struct ListClusterLogsResponse {
2714    /// Requested log records.
2715    #[prost(message, repeated, tag = "1")]
2716    pub logs: ::prost::alloc::vec::Vec<LogRecord>,
2717    /// This token allows you to get the next page of results for list requests. If the number of results
2718    /// is larger than \[ListClusterLogsRequest.page_size\], use the \[next_page_token\] as the value
2719    /// for the \[ListClusterLogsRequest.page_token\] query parameter in the next list request.
2720    /// Each subsequent list request will have its own \[next_page_token\] to continue paging through the results.
2721    /// This value is interchangeable with `next_record_token` from StreamLogs method.
2722    #[prost(string, tag = "2")]
2723    pub next_page_token: ::prost::alloc::string::String,
2724}
2725#[allow(clippy::derive_partial_eq_without_eq)]
2726#[derive(Clone, PartialEq, ::prost::Message)]
2727pub struct StreamLogRecord {
2728    /// One of the requested log records.
2729    #[prost(message, optional, tag = "1")]
2730    pub record: ::core::option::Option<LogRecord>,
2731    /// This token allows you to continue streaming logs starting from the exact
2732    /// same record. To continue streaming, specify value of `next_record_token`
2733    /// as value for `record_token` parameter in the next StreamLogs request.
2734    /// This value is interchangeable with `next_page_token` from ListLogs method.
2735    #[prost(string, tag = "2")]
2736    pub next_record_token: ::prost::alloc::string::String,
2737}
2738#[allow(clippy::derive_partial_eq_without_eq)]
2739#[derive(Clone, PartialEq, ::prost::Message)]
2740pub struct StreamClusterLogsRequest {
2741    /// Required. ID of the PostgreSQL cluster.
2742    #[prost(string, tag = "1")]
2743    pub cluster_id: ::prost::alloc::string::String,
2744    /// Columns from logs table to get in the response.
2745    #[prost(string, repeated, tag = "2")]
2746    pub column_filter: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2747    #[prost(enumeration = "stream_cluster_logs_request::ServiceType", tag = "3")]
2748    pub service_type: i32,
2749    /// Start timestamp for the logs request.
2750    #[prost(message, optional, tag = "4")]
2751    pub from_time: ::core::option::Option<::prost_types::Timestamp>,
2752    /// End timestamp for the logs request.
2753    /// If this field is not set, all existing logs will be sent and then the new ones as
2754    /// they appear. In essence it has 'tail -f' semantics.
2755    #[prost(message, optional, tag = "5")]
2756    pub to_time: ::core::option::Option<::prost_types::Timestamp>,
2757    /// Record token. Set `record_token` to the `next_record_token` returned by a previous StreamLogs
2758    /// request to start streaming from next log record.
2759    #[prost(string, tag = "6")]
2760    pub record_token: ::prost::alloc::string::String,
2761    /// A filter expression that filters resources listed in the response.
2762    /// The expression must specify:
2763    /// 1. The field name. Currently filtering can be applied to the \[LogRecord.logs.message.hostname\],
2764    /// \[LogRecord.logs.message.error_severity\] (for POSTGRESQL service), \[LogRecord.logs.message.level\] (for POOLER service) fields.
2765    /// 2. An `=` operator.
2766    /// 3. The value in double quotes (`"`). Must be 1-63 characters long and match the regular expression `\[a-z0-9.-\]{1,61}`.
2767    /// Examples of a filter:
2768    /// `message.hostname='node1.db.cloud.yandex.net'`
2769    /// `message.error_severity IN ("ERROR", "FATAL", "PANIC") AND message.hostname = "node1.db.cloud.yandex.net"`
2770    #[prost(string, tag = "7")]
2771    pub filter: ::prost::alloc::string::String,
2772}
2773/// Nested message and enum types in `StreamClusterLogsRequest`.
2774pub mod stream_cluster_logs_request {
2775    #[derive(
2776        Clone,
2777        Copy,
2778        Debug,
2779        PartialEq,
2780        Eq,
2781        Hash,
2782        PartialOrd,
2783        Ord,
2784        ::prost::Enumeration
2785    )]
2786    #[repr(i32)]
2787    pub enum ServiceType {
2788        Unspecified = 0,
2789        /// Logs of PostgreSQL activity.
2790        Postgresql = 1,
2791        /// Logs of connection pooler activity.
2792        Pooler = 2,
2793    }
2794    impl ServiceType {
2795        /// String value of the enum field names used in the ProtoBuf definition.
2796        ///
2797        /// The values are not transformed in any way and thus are considered stable
2798        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2799        pub fn as_str_name(&self) -> &'static str {
2800            match self {
2801                ServiceType::Unspecified => "SERVICE_TYPE_UNSPECIFIED",
2802                ServiceType::Postgresql => "POSTGRESQL",
2803                ServiceType::Pooler => "POOLER",
2804            }
2805        }
2806        /// Creates an enum from field names used in the ProtoBuf definition.
2807        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2808            match value {
2809                "SERVICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2810                "POSTGRESQL" => Some(Self::Postgresql),
2811                "POOLER" => Some(Self::Pooler),
2812                _ => None,
2813            }
2814        }
2815    }
2816}
2817#[allow(clippy::derive_partial_eq_without_eq)]
2818#[derive(Clone, PartialEq, ::prost::Message)]
2819pub struct ListClusterOperationsRequest {
2820    /// ID of the PostgreSQL Cluster resource to list operations for.
2821    #[prost(string, tag = "1")]
2822    pub cluster_id: ::prost::alloc::string::String,
2823    /// The maximum number of results per page to return. If the number of available
2824    /// results is larger than \[page_size\], the service returns a \[ListClusterOperationsResponse.next_page_token\]
2825    /// that can be used to get the next page of results in subsequent list requests.
2826    #[prost(int64, tag = "2")]
2827    pub page_size: i64,
2828    /// Page token.  To get the next page of results, set \[page_token\] to the \[ListClusterOperationsResponse.next_page_token\]
2829    /// returned by the previous list request.
2830    #[prost(string, tag = "3")]
2831    pub page_token: ::prost::alloc::string::String,
2832}
2833#[allow(clippy::derive_partial_eq_without_eq)]
2834#[derive(Clone, PartialEq, ::prost::Message)]
2835pub struct ListClusterOperationsResponse {
2836    /// List of Operation resources for the specified PostgreSQL cluster.
2837    #[prost(message, repeated, tag = "1")]
2838    pub operations: ::prost::alloc::vec::Vec<super::super::super::operation::Operation>,
2839    /// This token allows you to get the next page of results for list requests. If the number of results
2840    /// is larger than \[ListClusterOperationsRequest.page_size\], use the \[next_page_token\] as the value
2841    /// for the \[ListClusterOperationsRequest.page_token\] query parameter in the next list request.
2842    /// Each subsequent list request will have its own \[next_page_token\] to continue paging through the results.
2843    #[prost(string, tag = "2")]
2844    pub next_page_token: ::prost::alloc::string::String,
2845}
2846#[allow(clippy::derive_partial_eq_without_eq)]
2847#[derive(Clone, PartialEq, ::prost::Message)]
2848pub struct ListClusterBackupsRequest {
2849    /// ID of the PostgreSQL cluster.
2850    /// To get the PostgreSQL cluster ID use a \[ClusterService.List\] request.
2851    #[prost(string, tag = "1")]
2852    pub cluster_id: ::prost::alloc::string::String,
2853    /// The maximum number of results per page to return. If the number of available
2854    /// results is larger than \[page_size\], the service returns a \[ListClusterBackupsResponse.next_page_token\]
2855    /// that can be used to get the next page of results in subsequent list requests.
2856    #[prost(int64, tag = "2")]
2857    pub page_size: i64,
2858    /// Page token.  To get the next page of results, set \[page_token\] to the \[ListClusterBackupsResponse.next_page_token\]
2859    /// returned by the previous list request.
2860    #[prost(string, tag = "3")]
2861    pub page_token: ::prost::alloc::string::String,
2862}
2863#[allow(clippy::derive_partial_eq_without_eq)]
2864#[derive(Clone, PartialEq, ::prost::Message)]
2865pub struct ListClusterBackupsResponse {
2866    /// List of PostgreSQL Backup resources.
2867    #[prost(message, repeated, tag = "1")]
2868    pub backups: ::prost::alloc::vec::Vec<Backup>,
2869    /// This token allows you to get the next page of results for list requests. If the number of results
2870    /// is larger than \[ListClusterBackupsRequest.page_size\], use the \[next_page_token\] as the value
2871    /// for the \[ListClusterBackupsRequest.page_token\] query parameter in the next list request.
2872    /// Each subsequent list request will have its own \[next_page_token\] to continue paging through the results.
2873    #[prost(string, tag = "2")]
2874    pub next_page_token: ::prost::alloc::string::String,
2875}
2876#[allow(clippy::derive_partial_eq_without_eq)]
2877#[derive(Clone, PartialEq, ::prost::Message)]
2878pub struct ListClusterHostsRequest {
2879    /// ID of the PostgreSQL cluster.
2880    /// To get the PostgreSQL cluster ID use a \[ClusterService.List\] request.
2881    #[prost(string, tag = "1")]
2882    pub cluster_id: ::prost::alloc::string::String,
2883    /// The maximum number of results per page to return. If the number of available
2884    /// results is larger than \[page_size\], the service returns a \[ListClusterHostsResponse.next_page_token\]
2885    /// that can be used to get the next page of results in subsequent list requests.
2886    #[prost(int64, tag = "2")]
2887    pub page_size: i64,
2888    /// Page token.  To get the next page of results, set \[page_token\] to the \[ListClusterHostsResponse.next_page_token\]
2889    /// returned by the previous list request.
2890    #[prost(string, tag = "3")]
2891    pub page_token: ::prost::alloc::string::String,
2892}
2893#[allow(clippy::derive_partial_eq_without_eq)]
2894#[derive(Clone, PartialEq, ::prost::Message)]
2895pub struct ListClusterHostsResponse {
2896    /// List of Host resources.
2897    #[prost(message, repeated, tag = "1")]
2898    pub hosts: ::prost::alloc::vec::Vec<Host>,
2899    /// This token allows you to get the next page of results for list requests. If the number of results
2900    /// is larger than \[ListClusterHostsRequest.page_size\], use the \[next_page_token\] as the value
2901    /// for the \[ListClusterHostsRequest.page_token\] query parameter in the next list request.
2902    /// Each subsequent list request will have its own \[next_page_token\] to continue paging through the results.
2903    #[prost(string, tag = "2")]
2904    pub next_page_token: ::prost::alloc::string::String,
2905}
2906#[allow(clippy::derive_partial_eq_without_eq)]
2907#[derive(Clone, PartialEq, ::prost::Message)]
2908pub struct AddClusterHostsRequest {
2909    /// ID of the PostgreSQL cluster to add hosts to.
2910    /// To get the PostgreSQL cluster ID, use a \[ClusterService.List\] request.
2911    #[prost(string, tag = "1")]
2912    pub cluster_id: ::prost::alloc::string::String,
2913    /// Configurations for PostgreSQL hosts that should be added to the cluster.
2914    #[prost(message, repeated, tag = "2")]
2915    pub host_specs: ::prost::alloc::vec::Vec<HostSpec>,
2916}
2917#[allow(clippy::derive_partial_eq_without_eq)]
2918#[derive(Clone, PartialEq, ::prost::Message)]
2919pub struct AddClusterHostsMetadata {
2920    /// ID of the PostgreSQL cluster to which the hosts are being added.
2921    #[prost(string, tag = "1")]
2922    pub cluster_id: ::prost::alloc::string::String,
2923    /// Names of hosts that are being added to the cluster.
2924    #[prost(string, repeated, tag = "2")]
2925    pub host_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2926}
2927#[allow(clippy::derive_partial_eq_without_eq)]
2928#[derive(Clone, PartialEq, ::prost::Message)]
2929pub struct DeleteClusterHostsRequest {
2930    /// ID of the PostgreSQL cluster to remove hosts from.
2931    /// To get the PostgreSQL cluster ID, use a \[ClusterService.List\] request.
2932    #[prost(string, tag = "1")]
2933    pub cluster_id: ::prost::alloc::string::String,
2934    /// Names of hosts to delete.
2935    #[prost(string, repeated, tag = "2")]
2936    pub host_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2937}
2938#[allow(clippy::derive_partial_eq_without_eq)]
2939#[derive(Clone, PartialEq, ::prost::Message)]
2940pub struct DeleteClusterHostsMetadata {
2941    /// ID of the PostgreSQL cluster to remove hosts from.
2942    #[prost(string, tag = "1")]
2943    pub cluster_id: ::prost::alloc::string::String,
2944    /// Names of hosts that are being deleted.
2945    #[prost(string, repeated, tag = "2")]
2946    pub host_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2947}
2948#[allow(clippy::derive_partial_eq_without_eq)]
2949#[derive(Clone, PartialEq, ::prost::Message)]
2950pub struct UpdateClusterHostsRequest {
2951    /// ID of the PostgreSQL cluster to update hosts in.
2952    /// To get the PostgreSQL cluster ID, use a \[ClusterService.List\] request.
2953    #[prost(string, tag = "1")]
2954    pub cluster_id: ::prost::alloc::string::String,
2955    /// New configurations to apply to hosts.
2956    #[prost(message, repeated, tag = "2")]
2957    pub update_host_specs: ::prost::alloc::vec::Vec<UpdateHostSpec>,
2958}
2959#[allow(clippy::derive_partial_eq_without_eq)]
2960#[derive(Clone, PartialEq, ::prost::Message)]
2961pub struct UpdateClusterHostsMetadata {
2962    /// ID of the PostgreSQL cluster to update hosts in.
2963    #[prost(string, tag = "1")]
2964    pub cluster_id: ::prost::alloc::string::String,
2965    /// Names of hosts that are being updated.
2966    #[prost(string, repeated, tag = "2")]
2967    pub host_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2968}
2969#[allow(clippy::derive_partial_eq_without_eq)]
2970#[derive(Clone, PartialEq, ::prost::Message)]
2971pub struct UpdateHostSpec {
2972    /// Name of the host to update.
2973    /// To get the PostgreSQL host name, use a \[ClusterService.ListHosts\] request.
2974    #[prost(string, tag = "1")]
2975    pub host_name: ::prost::alloc::string::String,
2976    /// \[Host.name\] of the host to be used as the replication source (for cascading replication).
2977    /// To get the PostgreSQL host name, use a \[ClusterService.ListHosts\] request.
2978    #[prost(string, tag = "2")]
2979    pub replication_source: ::prost::alloc::string::String,
2980    /// The host with the highest priority is the synchronous replica. All others are asynchronous.
2981    /// The synchronous replica replaces the master when needed.
2982    ///
2983    /// When a replica becomes the master, its priority is ignored.
2984    #[prost(message, optional, tag = "3")]
2985    pub priority: ::core::option::Option<i64>,
2986    /// Configuration of a PostgreSQL server for the host.
2987    #[prost(message, optional, tag = "4")]
2988    pub config_spec: ::core::option::Option<ConfigHostSpec>,
2989    /// Field mask that specifies which fields of the PostgreSQL host should be updated.
2990    #[prost(message, optional, tag = "5")]
2991    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
2992    /// Whether the host should get a public IP address on creation.
2993    #[prost(bool, tag = "6")]
2994    pub assign_public_ip: bool,
2995}
2996#[allow(clippy::derive_partial_eq_without_eq)]
2997#[derive(Clone, PartialEq, ::prost::Message)]
2998pub struct HostSpec {
2999    /// ID of the availability zone where the host resides.
3000    /// To get a list of available zones, use the \[yandex.cloud.compute.v1.ZoneService.List\] request.
3001    #[prost(string, tag = "1")]
3002    pub zone_id: ::prost::alloc::string::String,
3003    /// ID of the subnet that the host should belong to. This subnet should be a part
3004    /// of the network that the cluster belongs to.
3005    /// The ID of the network is set in the field \[Cluster.network_id\].
3006    #[prost(string, tag = "2")]
3007    pub subnet_id: ::prost::alloc::string::String,
3008    /// Whether the host should get a public IP address on creation.
3009    ///
3010    /// After a host has been created, this setting cannot be changed. To remove an assigned public IP, or to assign
3011    /// a public IP to a host without one, recreate the host with \[assign_public_ip\] set as needed.
3012    ///
3013    /// Possible values:
3014    /// * false - don't assign a public IP to the host.
3015    /// * true - the host should have a public IP address.
3016    #[prost(bool, tag = "3")]
3017    pub assign_public_ip: bool,
3018    /// \[Host.name\] of the host to be used as the replication source (for cascading replication).
3019    #[prost(string, tag = "4")]
3020    pub replication_source: ::prost::alloc::string::String,
3021    /// Priority of the host as a replica. A higher value corresponds to higher priority.
3022    ///
3023    /// The host with the highest priority is the synchronous replica. All others are asynchronous.
3024    /// The synchronous replica replaces the master when needed.
3025    ///
3026    /// When a replica becomes the master, its priority is ignored.
3027    #[prost(message, optional, tag = "5")]
3028    pub priority: ::core::option::Option<i64>,
3029    /// Configuration of a PostgreSQL server for the host.
3030    #[prost(message, optional, tag = "6")]
3031    pub config_spec: ::core::option::Option<ConfigHostSpec>,
3032}
3033#[allow(clippy::derive_partial_eq_without_eq)]
3034#[derive(Clone, PartialEq, ::prost::Message)]
3035pub struct ConfigSpec {
3036    /// Version of PostgreSQL used in the cluster.
3037    /// Possible values: `9.6`, `10`, `10_1c`, `11`, `12`, `13`, `14`, `15`, `16`, `17`
3038    #[prost(string, tag = "1")]
3039    pub version: ::prost::alloc::string::String,
3040    /// Configuration of the connection pooler.
3041    #[prost(message, optional, tag = "4")]
3042    pub pooler_config: ::core::option::Option<ConnectionPoolerConfig>,
3043    /// Resources allocated to PostgreSQL hosts.
3044    #[prost(message, optional, tag = "5")]
3045    pub resources: ::core::option::Option<Resources>,
3046    /// Configuration setting which enables/disables autofailover in cluster.
3047    #[prost(message, optional, tag = "6")]
3048    pub autofailover: ::core::option::Option<bool>,
3049    /// Time to start the daily backup, in the UTC timezone.
3050    #[prost(message, optional, tag = "8")]
3051    pub backup_window_start: ::core::option::Option<
3052        super::super::super::super::super::google::r#type::TimeOfDay,
3053    >,
3054    /// Retention policy of automated backups.
3055    #[prost(message, optional, tag = "17")]
3056    pub backup_retain_period_days: ::core::option::Option<i64>,
3057    /// Access policy to DB
3058    #[prost(message, optional, tag = "9")]
3059    pub access: ::core::option::Option<Access>,
3060    /// Configuration of the performance diagnostics service.
3061    #[prost(message, optional, tag = "12")]
3062    pub performance_diagnostics: ::core::option::Option<PerformanceDiagnostics>,
3063    /// Disk size autoscaling
3064    #[prost(message, optional, tag = "23")]
3065    pub disk_size_autoscaling: ::core::option::Option<DiskSizeAutoscaling>,
3066    /// Configuration of a PostgreSQL cluster.
3067    #[prost(
3068        oneof = "config_spec::PostgresqlConfig",
3069        tags = "2, 10, 3, 7, 13, 11, 14, 15, 18, 16, 19, 21, 22, 24, 25, 27, 28"
3070    )]
3071    pub postgresql_config: ::core::option::Option<config_spec::PostgresqlConfig>,
3072}
3073/// Nested message and enum types in `ConfigSpec`.
3074pub mod config_spec {
3075    /// Configuration of a PostgreSQL cluster.
3076    #[allow(clippy::derive_partial_eq_without_eq)]
3077    #[derive(Clone, PartialEq, ::prost::Oneof)]
3078    pub enum PostgresqlConfig {
3079        /// Configuration for a PostgreSQL 9.6 cluster.
3080        #[prost(message, tag = "2")]
3081        PostgresqlConfig96(super::config::PostgresqlConfig96),
3082        /// Configuration for a PostgreSQL 10 1C cluster.
3083        #[prost(message, tag = "10")]
3084        PostgresqlConfig101c(super::config::PostgresqlConfig101c),
3085        /// Configuration for a PostgreSQL 10 cluster.
3086        #[prost(message, tag = "3")]
3087        PostgresqlConfig10(super::config::PostgresqlConfig10),
3088        /// Configuration for a PostgreSQL 11 cluster.
3089        #[prost(message, tag = "7")]
3090        PostgresqlConfig11(super::config::PostgresqlConfig11),
3091        /// Configuration for a PostgreSQL 11 1C cluster.
3092        #[prost(message, tag = "13")]
3093        PostgresqlConfig111c(super::config::PostgresqlConfig111c),
3094        /// Configuration for a PostgreSQL 12 cluster.
3095        #[prost(message, tag = "11")]
3096        PostgresqlConfig12(super::config::PostgresqlConfig12),
3097        /// Configuration for a PostgreSQL 12 1C cluster.
3098        #[prost(message, tag = "14")]
3099        PostgresqlConfig121c(super::config::PostgresqlConfig121c),
3100        /// Configuration for a PostgreSQL 13 cluster.
3101        #[prost(message, tag = "15")]
3102        PostgresqlConfig13(super::config::PostgresqlConfig13),
3103        /// Configuration for a PostgreSQL 13 1C cluster.
3104        #[prost(message, tag = "18")]
3105        PostgresqlConfig131c(super::config::PostgresqlConfig131c),
3106        /// Configuration for a PostgreSQL 14 cluster.
3107        #[prost(message, tag = "16")]
3108        PostgresqlConfig14(super::config::PostgresqlConfig14),
3109        /// Configuration for a PostgreSQL 14 1C cluster.
3110        #[prost(message, tag = "19")]
3111        PostgresqlConfig141c(super::config::PostgresqlConfig141c),
3112        /// Configuration for a PostgreSQL 15 cluster.
3113        #[prost(message, tag = "21")]
3114        PostgresqlConfig15(super::config::PostgresqlConfig15),
3115        /// Configuration for a PostgreSQL 15 1C cluster.
3116        #[prost(message, tag = "22")]
3117        PostgresqlConfig151c(super::config::PostgresqlConfig151c),
3118        /// Configuration for a PostgreSQL 16 cluster.
3119        #[prost(message, tag = "24")]
3120        PostgresqlConfig16(super::config::PostgresqlConfig16),
3121        /// Configuration for a PostgreSQL 16 1C cluster.
3122        #[prost(message, tag = "25")]
3123        PostgresqlConfig161c(super::config::PostgresqlConfig161c),
3124        /// Configuration for a PostgreSQL 17 cluster.
3125        #[prost(message, tag = "27")]
3126        PostgresqlConfig17(super::config::PostgresqlConfig17),
3127        /// Configuration for a PostgreSQL 17 1C cluster.
3128        #[prost(message, tag = "28")]
3129        PostgresqlConfig171c(super::config::PostgresqlConfig171c),
3130    }
3131}
3132#[allow(clippy::derive_partial_eq_without_eq)]
3133#[derive(Clone, PartialEq, ::prost::Message)]
3134pub struct ConfigHostSpec {
3135    #[prost(
3136        oneof = "config_host_spec::PostgresqlConfig",
3137        tags = "1, 4, 2, 3, 6, 5, 7, 8, 10, 9, 11, 12, 13, 14, 15, 16, 17"
3138    )]
3139    pub postgresql_config: ::core::option::Option<config_host_spec::PostgresqlConfig>,
3140}
3141/// Nested message and enum types in `ConfigHostSpec`.
3142pub mod config_host_spec {
3143    #[allow(clippy::derive_partial_eq_without_eq)]
3144    #[derive(Clone, PartialEq, ::prost::Oneof)]
3145    pub enum PostgresqlConfig {
3146        /// Configuration for a host with PostgreSQL 9.6 server deployed.
3147        #[prost(message, tag = "1")]
3148        PostgresqlConfig96(super::config::PostgresqlHostConfig96),
3149        /// Configuration for a host with PostgreSQL 10 1C server deployed.
3150        #[prost(message, tag = "4")]
3151        PostgresqlConfig101c(super::config::PostgresqlHostConfig101c),
3152        /// Configuration for a host with PostgreSQL 10 server deployed.
3153        #[prost(message, tag = "2")]
3154        PostgresqlConfig10(super::config::PostgresqlHostConfig10),
3155        /// Configuration for a host with PostgreSQL 11 server deployed.
3156        #[prost(message, tag = "3")]
3157        PostgresqlConfig11(super::config::PostgresqlHostConfig11),
3158        /// Configuration for a host with PostgreSQL 11 1C server deployed.
3159        #[prost(message, tag = "6")]
3160        PostgresqlConfig111c(super::config::PostgresqlHostConfig111c),
3161        /// Configuration for a host with PostgreSQL 12 server deployed.
3162        #[prost(message, tag = "5")]
3163        PostgresqlConfig12(super::config::PostgresqlHostConfig12),
3164        /// Configuration for a host with PostgreSQL 12 1C server deployed.
3165        #[prost(message, tag = "7")]
3166        PostgresqlConfig121c(super::config::PostgresqlHostConfig121c),
3167        /// Configuration for a host with PostgreSQL 13 server deployed.
3168        #[prost(message, tag = "8")]
3169        PostgresqlConfig13(super::config::PostgresqlHostConfig13),
3170        /// Configuration for a host with PostgreSQL 13 1C server deployed.
3171        #[prost(message, tag = "10")]
3172        PostgresqlConfig131c(super::config::PostgresqlHostConfig131c),
3173        /// Configuration for a host with PostgreSQL 14 server deployed.
3174        #[prost(message, tag = "9")]
3175        PostgresqlConfig14(super::config::PostgresqlHostConfig14),
3176        /// Configuration for a host with PostgreSQL 14 1C server deployed.
3177        #[prost(message, tag = "11")]
3178        PostgresqlConfig141c(super::config::PostgresqlHostConfig141c),
3179        /// Configuration for a host with PostgreSQL 15 server deployed.
3180        #[prost(message, tag = "12")]
3181        PostgresqlConfig15(super::config::PostgresqlHostConfig15),
3182        /// Configuration for a host with PostgreSQL 15 1C server deployed.
3183        #[prost(message, tag = "13")]
3184        PostgresqlConfig151c(super::config::PostgresqlHostConfig151c),
3185        /// Configuration for a host with PostgreSQL 16 server deployed.
3186        #[prost(message, tag = "14")]
3187        PostgresqlConfig16(super::config::PostgresqlHostConfig16),
3188        /// Configuration for a host with PostgreSQL 16 1C server deployed.
3189        #[prost(message, tag = "15")]
3190        PostgresqlConfig161c(super::config::PostgresqlHostConfig161c),
3191        /// Configuration for a host with PostgreSQL 17 1C server deployed.
3192        #[prost(message, tag = "16")]
3193        PostgresqlConfig17(super::config::PostgresqlHostConfig17),
3194        /// Configuration for a host with PostgreSQL 17 1C server deployed.
3195        #[prost(message, tag = "17")]
3196        PostgresqlConfig171c(super::config::PostgresqlHostConfig171c),
3197    }
3198}
3199/// Generated client implementations.
3200pub mod cluster_service_client {
3201    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
3202    use tonic::codegen::*;
3203    use tonic::codegen::http::Uri;
3204    /// A set of methods for managing PostgreSQL Cluster resources.
3205    #[derive(Debug, Clone)]
3206    pub struct ClusterServiceClient<T> {
3207        inner: tonic::client::Grpc<T>,
3208    }
3209    impl ClusterServiceClient<tonic::transport::Channel> {
3210        /// Attempt to create a new client by connecting to a given endpoint.
3211        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3212        where
3213            D: TryInto<tonic::transport::Endpoint>,
3214            D::Error: Into<StdError>,
3215        {
3216            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3217            Ok(Self::new(conn))
3218        }
3219    }
3220    impl<T> ClusterServiceClient<T>
3221    where
3222        T: tonic::client::GrpcService<tonic::body::BoxBody>,
3223        T::Error: Into<StdError>,
3224        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
3225        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
3226    {
3227        pub fn new(inner: T) -> Self {
3228            let inner = tonic::client::Grpc::new(inner);
3229            Self { inner }
3230        }
3231        pub fn with_origin(inner: T, origin: Uri) -> Self {
3232            let inner = tonic::client::Grpc::with_origin(inner, origin);
3233            Self { inner }
3234        }
3235        pub fn with_interceptor<F>(
3236            inner: T,
3237            interceptor: F,
3238        ) -> ClusterServiceClient<InterceptedService<T, F>>
3239        where
3240            F: tonic::service::Interceptor,
3241            T::ResponseBody: Default,
3242            T: tonic::codegen::Service<
3243                http::Request<tonic::body::BoxBody>,
3244                Response = http::Response<
3245                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
3246                >,
3247            >,
3248            <T as tonic::codegen::Service<
3249                http::Request<tonic::body::BoxBody>,
3250            >>::Error: Into<StdError> + Send + Sync,
3251        {
3252            ClusterServiceClient::new(InterceptedService::new(inner, interceptor))
3253        }
3254        /// Compress requests with the given encoding.
3255        ///
3256        /// This requires the server to support it otherwise it might respond with an
3257        /// error.
3258        #[must_use]
3259        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3260            self.inner = self.inner.send_compressed(encoding);
3261            self
3262        }
3263        /// Enable decompressing responses.
3264        #[must_use]
3265        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3266            self.inner = self.inner.accept_compressed(encoding);
3267            self
3268        }
3269        /// Limits the maximum size of a decoded message.
3270        ///
3271        /// Default: `4MB`
3272        #[must_use]
3273        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3274            self.inner = self.inner.max_decoding_message_size(limit);
3275            self
3276        }
3277        /// Limits the maximum size of an encoded message.
3278        ///
3279        /// Default: `usize::MAX`
3280        #[must_use]
3281        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3282            self.inner = self.inner.max_encoding_message_size(limit);
3283            self
3284        }
3285        /// Returns the specified PostgreSQL Cluster resource.
3286        ///
3287        /// To get the list of available PostgreSQL Cluster resources, make a [List] request.
3288        pub async fn get(
3289            &mut self,
3290            request: impl tonic::IntoRequest<super::GetClusterRequest>,
3291        ) -> std::result::Result<tonic::Response<super::Cluster>, tonic::Status> {
3292            self.inner
3293                .ready()
3294                .await
3295                .map_err(|e| {
3296                    tonic::Status::new(
3297                        tonic::Code::Unknown,
3298                        format!("Service was not ready: {}", e.into()),
3299                    )
3300                })?;
3301            let codec = tonic::codec::ProstCodec::default();
3302            let path = http::uri::PathAndQuery::from_static(
3303                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Get",
3304            );
3305            let mut req = request.into_request();
3306            req.extensions_mut()
3307                .insert(
3308                    GrpcMethod::new(
3309                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3310                        "Get",
3311                    ),
3312                );
3313            self.inner.unary(req, path, codec).await
3314        }
3315        /// Retrieves the list of PostgreSQL Cluster resources that belong
3316        /// to the specified folder.
3317        pub async fn list(
3318            &mut self,
3319            request: impl tonic::IntoRequest<super::ListClustersRequest>,
3320        ) -> std::result::Result<
3321            tonic::Response<super::ListClustersResponse>,
3322            tonic::Status,
3323        > {
3324            self.inner
3325                .ready()
3326                .await
3327                .map_err(|e| {
3328                    tonic::Status::new(
3329                        tonic::Code::Unknown,
3330                        format!("Service was not ready: {}", e.into()),
3331                    )
3332                })?;
3333            let codec = tonic::codec::ProstCodec::default();
3334            let path = http::uri::PathAndQuery::from_static(
3335                "/yandex.cloud.mdb.postgresql.v1.ClusterService/List",
3336            );
3337            let mut req = request.into_request();
3338            req.extensions_mut()
3339                .insert(
3340                    GrpcMethod::new(
3341                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3342                        "List",
3343                    ),
3344                );
3345            self.inner.unary(req, path, codec).await
3346        }
3347        /// Creates a PostgreSQL cluster in the specified folder.
3348        pub async fn create(
3349            &mut self,
3350            request: impl tonic::IntoRequest<super::CreateClusterRequest>,
3351        ) -> std::result::Result<
3352            tonic::Response<super::super::super::super::operation::Operation>,
3353            tonic::Status,
3354        > {
3355            self.inner
3356                .ready()
3357                .await
3358                .map_err(|e| {
3359                    tonic::Status::new(
3360                        tonic::Code::Unknown,
3361                        format!("Service was not ready: {}", e.into()),
3362                    )
3363                })?;
3364            let codec = tonic::codec::ProstCodec::default();
3365            let path = http::uri::PathAndQuery::from_static(
3366                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Create",
3367            );
3368            let mut req = request.into_request();
3369            req.extensions_mut()
3370                .insert(
3371                    GrpcMethod::new(
3372                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3373                        "Create",
3374                    ),
3375                );
3376            self.inner.unary(req, path, codec).await
3377        }
3378        /// Updates the specified PostgreSQL cluster.
3379        pub async fn update(
3380            &mut self,
3381            request: impl tonic::IntoRequest<super::UpdateClusterRequest>,
3382        ) -> std::result::Result<
3383            tonic::Response<super::super::super::super::operation::Operation>,
3384            tonic::Status,
3385        > {
3386            self.inner
3387                .ready()
3388                .await
3389                .map_err(|e| {
3390                    tonic::Status::new(
3391                        tonic::Code::Unknown,
3392                        format!("Service was not ready: {}", e.into()),
3393                    )
3394                })?;
3395            let codec = tonic::codec::ProstCodec::default();
3396            let path = http::uri::PathAndQuery::from_static(
3397                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Update",
3398            );
3399            let mut req = request.into_request();
3400            req.extensions_mut()
3401                .insert(
3402                    GrpcMethod::new(
3403                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3404                        "Update",
3405                    ),
3406                );
3407            self.inner.unary(req, path, codec).await
3408        }
3409        /// Deletes the specified PostgreSQL cluster.
3410        pub async fn delete(
3411            &mut self,
3412            request: impl tonic::IntoRequest<super::DeleteClusterRequest>,
3413        ) -> std::result::Result<
3414            tonic::Response<super::super::super::super::operation::Operation>,
3415            tonic::Status,
3416        > {
3417            self.inner
3418                .ready()
3419                .await
3420                .map_err(|e| {
3421                    tonic::Status::new(
3422                        tonic::Code::Unknown,
3423                        format!("Service was not ready: {}", e.into()),
3424                    )
3425                })?;
3426            let codec = tonic::codec::ProstCodec::default();
3427            let path = http::uri::PathAndQuery::from_static(
3428                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Delete",
3429            );
3430            let mut req = request.into_request();
3431            req.extensions_mut()
3432                .insert(
3433                    GrpcMethod::new(
3434                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3435                        "Delete",
3436                    ),
3437                );
3438            self.inner.unary(req, path, codec).await
3439        }
3440        /// Start the specified PostgreSQL cluster.
3441        pub async fn start(
3442            &mut self,
3443            request: impl tonic::IntoRequest<super::StartClusterRequest>,
3444        ) -> std::result::Result<
3445            tonic::Response<super::super::super::super::operation::Operation>,
3446            tonic::Status,
3447        > {
3448            self.inner
3449                .ready()
3450                .await
3451                .map_err(|e| {
3452                    tonic::Status::new(
3453                        tonic::Code::Unknown,
3454                        format!("Service was not ready: {}", e.into()),
3455                    )
3456                })?;
3457            let codec = tonic::codec::ProstCodec::default();
3458            let path = http::uri::PathAndQuery::from_static(
3459                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Start",
3460            );
3461            let mut req = request.into_request();
3462            req.extensions_mut()
3463                .insert(
3464                    GrpcMethod::new(
3465                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3466                        "Start",
3467                    ),
3468                );
3469            self.inner.unary(req, path, codec).await
3470        }
3471        /// Stop the specified PostgreSQL cluster.
3472        pub async fn stop(
3473            &mut self,
3474            request: impl tonic::IntoRequest<super::StopClusterRequest>,
3475        ) -> std::result::Result<
3476            tonic::Response<super::super::super::super::operation::Operation>,
3477            tonic::Status,
3478        > {
3479            self.inner
3480                .ready()
3481                .await
3482                .map_err(|e| {
3483                    tonic::Status::new(
3484                        tonic::Code::Unknown,
3485                        format!("Service was not ready: {}", e.into()),
3486                    )
3487                })?;
3488            let codec = tonic::codec::ProstCodec::default();
3489            let path = http::uri::PathAndQuery::from_static(
3490                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Stop",
3491            );
3492            let mut req = request.into_request();
3493            req.extensions_mut()
3494                .insert(
3495                    GrpcMethod::new(
3496                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3497                        "Stop",
3498                    ),
3499                );
3500            self.inner.unary(req, path, codec).await
3501        }
3502        /// Moves the specified PostgreSQL cluster to the specified folder.
3503        pub async fn r#move(
3504            &mut self,
3505            request: impl tonic::IntoRequest<super::MoveClusterRequest>,
3506        ) -> std::result::Result<
3507            tonic::Response<super::super::super::super::operation::Operation>,
3508            tonic::Status,
3509        > {
3510            self.inner
3511                .ready()
3512                .await
3513                .map_err(|e| {
3514                    tonic::Status::new(
3515                        tonic::Code::Unknown,
3516                        format!("Service was not ready: {}", e.into()),
3517                    )
3518                })?;
3519            let codec = tonic::codec::ProstCodec::default();
3520            let path = http::uri::PathAndQuery::from_static(
3521                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Move",
3522            );
3523            let mut req = request.into_request();
3524            req.extensions_mut()
3525                .insert(
3526                    GrpcMethod::new(
3527                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3528                        "Move",
3529                    ),
3530                );
3531            self.inner.unary(req, path, codec).await
3532        }
3533        /// Creates a backup for the specified PostgreSQL cluster.
3534        pub async fn backup(
3535            &mut self,
3536            request: impl tonic::IntoRequest<super::BackupClusterRequest>,
3537        ) -> std::result::Result<
3538            tonic::Response<super::super::super::super::operation::Operation>,
3539            tonic::Status,
3540        > {
3541            self.inner
3542                .ready()
3543                .await
3544                .map_err(|e| {
3545                    tonic::Status::new(
3546                        tonic::Code::Unknown,
3547                        format!("Service was not ready: {}", e.into()),
3548                    )
3549                })?;
3550            let codec = tonic::codec::ProstCodec::default();
3551            let path = http::uri::PathAndQuery::from_static(
3552                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Backup",
3553            );
3554            let mut req = request.into_request();
3555            req.extensions_mut()
3556                .insert(
3557                    GrpcMethod::new(
3558                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3559                        "Backup",
3560                    ),
3561                );
3562            self.inner.unary(req, path, codec).await
3563        }
3564        /// Creates a new PostgreSQL cluster using the specified backup.
3565        pub async fn restore(
3566            &mut self,
3567            request: impl tonic::IntoRequest<super::RestoreClusterRequest>,
3568        ) -> std::result::Result<
3569            tonic::Response<super::super::super::super::operation::Operation>,
3570            tonic::Status,
3571        > {
3572            self.inner
3573                .ready()
3574                .await
3575                .map_err(|e| {
3576                    tonic::Status::new(
3577                        tonic::Code::Unknown,
3578                        format!("Service was not ready: {}", e.into()),
3579                    )
3580                })?;
3581            let codec = tonic::codec::ProstCodec::default();
3582            let path = http::uri::PathAndQuery::from_static(
3583                "/yandex.cloud.mdb.postgresql.v1.ClusterService/Restore",
3584            );
3585            let mut req = request.into_request();
3586            req.extensions_mut()
3587                .insert(
3588                    GrpcMethod::new(
3589                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3590                        "Restore",
3591                    ),
3592                );
3593            self.inner.unary(req, path, codec).await
3594        }
3595        /// Reschedules planned maintenance operation.
3596        pub async fn reschedule_maintenance(
3597            &mut self,
3598            request: impl tonic::IntoRequest<super::RescheduleMaintenanceRequest>,
3599        ) -> std::result::Result<
3600            tonic::Response<super::super::super::super::operation::Operation>,
3601            tonic::Status,
3602        > {
3603            self.inner
3604                .ready()
3605                .await
3606                .map_err(|e| {
3607                    tonic::Status::new(
3608                        tonic::Code::Unknown,
3609                        format!("Service was not ready: {}", e.into()),
3610                    )
3611                })?;
3612            let codec = tonic::codec::ProstCodec::default();
3613            let path = http::uri::PathAndQuery::from_static(
3614                "/yandex.cloud.mdb.postgresql.v1.ClusterService/RescheduleMaintenance",
3615            );
3616            let mut req = request.into_request();
3617            req.extensions_mut()
3618                .insert(
3619                    GrpcMethod::new(
3620                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3621                        "RescheduleMaintenance",
3622                    ),
3623                );
3624            self.inner.unary(req, path, codec).await
3625        }
3626        /// Start a manual failover on the specified PostgreSQL cluster.
3627        pub async fn start_failover(
3628            &mut self,
3629            request: impl tonic::IntoRequest<super::StartClusterFailoverRequest>,
3630        ) -> std::result::Result<
3631            tonic::Response<super::super::super::super::operation::Operation>,
3632            tonic::Status,
3633        > {
3634            self.inner
3635                .ready()
3636                .await
3637                .map_err(|e| {
3638                    tonic::Status::new(
3639                        tonic::Code::Unknown,
3640                        format!("Service was not ready: {}", e.into()),
3641                    )
3642                })?;
3643            let codec = tonic::codec::ProstCodec::default();
3644            let path = http::uri::PathAndQuery::from_static(
3645                "/yandex.cloud.mdb.postgresql.v1.ClusterService/StartFailover",
3646            );
3647            let mut req = request.into_request();
3648            req.extensions_mut()
3649                .insert(
3650                    GrpcMethod::new(
3651                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3652                        "StartFailover",
3653                    ),
3654                );
3655            self.inner.unary(req, path, codec).await
3656        }
3657        /// Retrieves logs for the specified PostgreSQL cluster.
3658        pub async fn list_logs(
3659            &mut self,
3660            request: impl tonic::IntoRequest<super::ListClusterLogsRequest>,
3661        ) -> std::result::Result<
3662            tonic::Response<super::ListClusterLogsResponse>,
3663            tonic::Status,
3664        > {
3665            self.inner
3666                .ready()
3667                .await
3668                .map_err(|e| {
3669                    tonic::Status::new(
3670                        tonic::Code::Unknown,
3671                        format!("Service was not ready: {}", e.into()),
3672                    )
3673                })?;
3674            let codec = tonic::codec::ProstCodec::default();
3675            let path = http::uri::PathAndQuery::from_static(
3676                "/yandex.cloud.mdb.postgresql.v1.ClusterService/ListLogs",
3677            );
3678            let mut req = request.into_request();
3679            req.extensions_mut()
3680                .insert(
3681                    GrpcMethod::new(
3682                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3683                        "ListLogs",
3684                    ),
3685                );
3686            self.inner.unary(req, path, codec).await
3687        }
3688        /// Same as ListLogs but using server-side streaming. Also allows for 'tail -f' semantics.
3689        pub async fn stream_logs(
3690            &mut self,
3691            request: impl tonic::IntoRequest<super::StreamClusterLogsRequest>,
3692        ) -> std::result::Result<
3693            tonic::Response<tonic::codec::Streaming<super::StreamLogRecord>>,
3694            tonic::Status,
3695        > {
3696            self.inner
3697                .ready()
3698                .await
3699                .map_err(|e| {
3700                    tonic::Status::new(
3701                        tonic::Code::Unknown,
3702                        format!("Service was not ready: {}", e.into()),
3703                    )
3704                })?;
3705            let codec = tonic::codec::ProstCodec::default();
3706            let path = http::uri::PathAndQuery::from_static(
3707                "/yandex.cloud.mdb.postgresql.v1.ClusterService/StreamLogs",
3708            );
3709            let mut req = request.into_request();
3710            req.extensions_mut()
3711                .insert(
3712                    GrpcMethod::new(
3713                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3714                        "StreamLogs",
3715                    ),
3716                );
3717            self.inner.server_streaming(req, path, codec).await
3718        }
3719        /// Retrieves the list of Operation resources for the specified cluster.
3720        pub async fn list_operations(
3721            &mut self,
3722            request: impl tonic::IntoRequest<super::ListClusterOperationsRequest>,
3723        ) -> std::result::Result<
3724            tonic::Response<super::ListClusterOperationsResponse>,
3725            tonic::Status,
3726        > {
3727            self.inner
3728                .ready()
3729                .await
3730                .map_err(|e| {
3731                    tonic::Status::new(
3732                        tonic::Code::Unknown,
3733                        format!("Service was not ready: {}", e.into()),
3734                    )
3735                })?;
3736            let codec = tonic::codec::ProstCodec::default();
3737            let path = http::uri::PathAndQuery::from_static(
3738                "/yandex.cloud.mdb.postgresql.v1.ClusterService/ListOperations",
3739            );
3740            let mut req = request.into_request();
3741            req.extensions_mut()
3742                .insert(
3743                    GrpcMethod::new(
3744                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3745                        "ListOperations",
3746                    ),
3747                );
3748            self.inner.unary(req, path, codec).await
3749        }
3750        /// Retrieves the list of available backups for the specified PostgreSQL cluster.
3751        pub async fn list_backups(
3752            &mut self,
3753            request: impl tonic::IntoRequest<super::ListClusterBackupsRequest>,
3754        ) -> std::result::Result<
3755            tonic::Response<super::ListClusterBackupsResponse>,
3756            tonic::Status,
3757        > {
3758            self.inner
3759                .ready()
3760                .await
3761                .map_err(|e| {
3762                    tonic::Status::new(
3763                        tonic::Code::Unknown,
3764                        format!("Service was not ready: {}", e.into()),
3765                    )
3766                })?;
3767            let codec = tonic::codec::ProstCodec::default();
3768            let path = http::uri::PathAndQuery::from_static(
3769                "/yandex.cloud.mdb.postgresql.v1.ClusterService/ListBackups",
3770            );
3771            let mut req = request.into_request();
3772            req.extensions_mut()
3773                .insert(
3774                    GrpcMethod::new(
3775                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3776                        "ListBackups",
3777                    ),
3778                );
3779            self.inner.unary(req, path, codec).await
3780        }
3781        /// Retrieves a list of hosts for the specified cluster.
3782        pub async fn list_hosts(
3783            &mut self,
3784            request: impl tonic::IntoRequest<super::ListClusterHostsRequest>,
3785        ) -> std::result::Result<
3786            tonic::Response<super::ListClusterHostsResponse>,
3787            tonic::Status,
3788        > {
3789            self.inner
3790                .ready()
3791                .await
3792                .map_err(|e| {
3793                    tonic::Status::new(
3794                        tonic::Code::Unknown,
3795                        format!("Service was not ready: {}", e.into()),
3796                    )
3797                })?;
3798            let codec = tonic::codec::ProstCodec::default();
3799            let path = http::uri::PathAndQuery::from_static(
3800                "/yandex.cloud.mdb.postgresql.v1.ClusterService/ListHosts",
3801            );
3802            let mut req = request.into_request();
3803            req.extensions_mut()
3804                .insert(
3805                    GrpcMethod::new(
3806                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3807                        "ListHosts",
3808                    ),
3809                );
3810            self.inner.unary(req, path, codec).await
3811        }
3812        /// Creates new hosts for a cluster.
3813        pub async fn add_hosts(
3814            &mut self,
3815            request: impl tonic::IntoRequest<super::AddClusterHostsRequest>,
3816        ) -> std::result::Result<
3817            tonic::Response<super::super::super::super::operation::Operation>,
3818            tonic::Status,
3819        > {
3820            self.inner
3821                .ready()
3822                .await
3823                .map_err(|e| {
3824                    tonic::Status::new(
3825                        tonic::Code::Unknown,
3826                        format!("Service was not ready: {}", e.into()),
3827                    )
3828                })?;
3829            let codec = tonic::codec::ProstCodec::default();
3830            let path = http::uri::PathAndQuery::from_static(
3831                "/yandex.cloud.mdb.postgresql.v1.ClusterService/AddHosts",
3832            );
3833            let mut req = request.into_request();
3834            req.extensions_mut()
3835                .insert(
3836                    GrpcMethod::new(
3837                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3838                        "AddHosts",
3839                    ),
3840                );
3841            self.inner.unary(req, path, codec).await
3842        }
3843        /// Deletes the specified hosts for a cluster.
3844        pub async fn delete_hosts(
3845            &mut self,
3846            request: impl tonic::IntoRequest<super::DeleteClusterHostsRequest>,
3847        ) -> std::result::Result<
3848            tonic::Response<super::super::super::super::operation::Operation>,
3849            tonic::Status,
3850        > {
3851            self.inner
3852                .ready()
3853                .await
3854                .map_err(|e| {
3855                    tonic::Status::new(
3856                        tonic::Code::Unknown,
3857                        format!("Service was not ready: {}", e.into()),
3858                    )
3859                })?;
3860            let codec = tonic::codec::ProstCodec::default();
3861            let path = http::uri::PathAndQuery::from_static(
3862                "/yandex.cloud.mdb.postgresql.v1.ClusterService/DeleteHosts",
3863            );
3864            let mut req = request.into_request();
3865            req.extensions_mut()
3866                .insert(
3867                    GrpcMethod::new(
3868                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3869                        "DeleteHosts",
3870                    ),
3871                );
3872            self.inner.unary(req, path, codec).await
3873        }
3874        /// Updates the specified hosts.
3875        pub async fn update_hosts(
3876            &mut self,
3877            request: impl tonic::IntoRequest<super::UpdateClusterHostsRequest>,
3878        ) -> std::result::Result<
3879            tonic::Response<super::super::super::super::operation::Operation>,
3880            tonic::Status,
3881        > {
3882            self.inner
3883                .ready()
3884                .await
3885                .map_err(|e| {
3886                    tonic::Status::new(
3887                        tonic::Code::Unknown,
3888                        format!("Service was not ready: {}", e.into()),
3889                    )
3890                })?;
3891            let codec = tonic::codec::ProstCodec::default();
3892            let path = http::uri::PathAndQuery::from_static(
3893                "/yandex.cloud.mdb.postgresql.v1.ClusterService/UpdateHosts",
3894            );
3895            let mut req = request.into_request();
3896            req.extensions_mut()
3897                .insert(
3898                    GrpcMethod::new(
3899                        "yandex.cloud.mdb.postgresql.v1.ClusterService",
3900                        "UpdateHosts",
3901                    ),
3902                );
3903            self.inner.unary(req, path, codec).await
3904        }
3905    }
3906}
3907#[allow(clippy::derive_partial_eq_without_eq)]
3908#[derive(Clone, PartialEq, ::prost::Message)]
3909pub struct GetDatabaseRequest {
3910    /// ID of the PostgreSQL cluster that the database belongs to.
3911    /// To get the cluster ID use a \[ClusterService.List\] request.
3912    #[prost(string, tag = "1")]
3913    pub cluster_id: ::prost::alloc::string::String,
3914    /// Name of the PostgreSQL Database resource to return.
3915    /// To get the name of the database use a \[DatabaseService.List\] request.
3916    #[prost(string, tag = "2")]
3917    pub database_name: ::prost::alloc::string::String,
3918}
3919#[allow(clippy::derive_partial_eq_without_eq)]
3920#[derive(Clone, PartialEq, ::prost::Message)]
3921pub struct ListDatabasesRequest {
3922    /// ID of the PostgreSQL cluster to list databases in.
3923    /// To get the cluster ID use a \[ClusterService.List\] request.
3924    #[prost(string, tag = "1")]
3925    pub cluster_id: ::prost::alloc::string::String,
3926    /// The maximum number of results per page to return. If the number of available
3927    /// results is larger than \[page_size\], the service returns a \[ListDatabasesResponse.next_page_token\]
3928    /// that can be used to get the next page of results in subsequent list requests.
3929    #[prost(int64, tag = "2")]
3930    pub page_size: i64,
3931    /// Page token. To get the next page of results, Set \[page_token\] to the \[ListDatabasesResponse.next_page_token\]
3932    /// returned by the previous list request.
3933    #[prost(string, tag = "3")]
3934    pub page_token: ::prost::alloc::string::String,
3935}
3936#[allow(clippy::derive_partial_eq_without_eq)]
3937#[derive(Clone, PartialEq, ::prost::Message)]
3938pub struct ListDatabasesResponse {
3939    /// List of PostgreSQL Database resources.
3940    #[prost(message, repeated, tag = "1")]
3941    pub databases: ::prost::alloc::vec::Vec<Database>,
3942    /// This token allows you to get the next page of results for list requests. If the number of results
3943    /// is larger than \[ListDatabasesRequest.page_size\], use the \[next_page_token\] as the value
3944    /// for the \[ListDatabasesRequest.page_token\] parameter in the next list request. Each subsequent
3945    /// list request will have its own \[next_page_token\] to continue paging through the results.
3946    #[prost(string, tag = "2")]
3947    pub next_page_token: ::prost::alloc::string::String,
3948}
3949#[allow(clippy::derive_partial_eq_without_eq)]
3950#[derive(Clone, PartialEq, ::prost::Message)]
3951pub struct CreateDatabaseRequest {
3952    /// ID of the PostgreSQL cluster to create a database in.
3953    /// To get the cluster ID use a \[ClusterService.List\] request.
3954    #[prost(string, tag = "1")]
3955    pub cluster_id: ::prost::alloc::string::String,
3956    /// Configuration of the database to create.
3957    #[prost(message, optional, tag = "2")]
3958    pub database_spec: ::core::option::Option<DatabaseSpec>,
3959}
3960#[allow(clippy::derive_partial_eq_without_eq)]
3961#[derive(Clone, PartialEq, ::prost::Message)]
3962pub struct CreateDatabaseMetadata {
3963    /// ID of the PostgreSQL cluster where a database is being created.
3964    #[prost(string, tag = "1")]
3965    pub cluster_id: ::prost::alloc::string::String,
3966    /// Name of the PostgreSQL database that is being created.
3967    #[prost(string, tag = "2")]
3968    pub database_name: ::prost::alloc::string::String,
3969}
3970#[allow(clippy::derive_partial_eq_without_eq)]
3971#[derive(Clone, PartialEq, ::prost::Message)]
3972pub struct UpdateDatabaseRequest {
3973    /// ID of the PostgreSQL cluster to update a database in.
3974    /// To get the cluster ID use a \[ClusterService.List\] request.
3975    #[prost(string, tag = "1")]
3976    pub cluster_id: ::prost::alloc::string::String,
3977    /// Name of the database to update.
3978    /// To get the name of the database use a \[DatabaseService.List\] request.
3979    #[prost(string, tag = "2")]
3980    pub database_name: ::prost::alloc::string::String,
3981    /// Optional. New name of the database.
3982    #[prost(string, tag = "5")]
3983    pub new_database_name: ::prost::alloc::string::String,
3984    /// Field mask that specifies which fields of the Database resource should be updated.
3985    #[prost(message, optional, tag = "3")]
3986    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
3987    /// PostgreSQL extensions that should be enabled for the database.
3988    ///
3989    /// If the field is sent, the list of enabled extensions is rewritten entirely.
3990    /// Therefore, to disable an active extension you should simply send the list omitting this extension.
3991    #[prost(message, repeated, tag = "4")]
3992    pub extensions: ::prost::alloc::vec::Vec<Extension>,
3993    /// Deletion Protection inhibits deletion of the database
3994    ///
3995    /// Default value: `unspecified` (inherits cluster's deletion_protection)
3996    #[prost(message, optional, tag = "6")]
3997    pub deletion_protection: ::core::option::Option<bool>,
3998}
3999#[allow(clippy::derive_partial_eq_without_eq)]
4000#[derive(Clone, PartialEq, ::prost::Message)]
4001pub struct UpdateDatabaseMetadata {
4002    /// ID of the PostgreSQL cluster where a database is being updated.
4003    #[prost(string, tag = "1")]
4004    pub cluster_id: ::prost::alloc::string::String,
4005    /// Name of the PostgreSQL database that is being updated.
4006    #[prost(string, tag = "2")]
4007    pub database_name: ::prost::alloc::string::String,
4008}
4009#[allow(clippy::derive_partial_eq_without_eq)]
4010#[derive(Clone, PartialEq, ::prost::Message)]
4011pub struct DeleteDatabaseRequest {
4012    /// ID of the PostgreSQL cluster to delete a database in.
4013    /// To get the cluster ID, use a \[ClusterService.List\] request.
4014    #[prost(string, tag = "1")]
4015    pub cluster_id: ::prost::alloc::string::String,
4016    /// Name of the database to delete.
4017    /// To get the name of the database, use a \[DatabaseService.List\] request.
4018    #[prost(string, tag = "2")]
4019    pub database_name: ::prost::alloc::string::String,
4020}
4021#[allow(clippy::derive_partial_eq_without_eq)]
4022#[derive(Clone, PartialEq, ::prost::Message)]
4023pub struct DeleteDatabaseMetadata {
4024    /// ID of the PostgreSQL cluster where a database is being deleted.
4025    #[prost(string, tag = "1")]
4026    pub cluster_id: ::prost::alloc::string::String,
4027    /// Name of the PostgreSQL database that is being deleted.
4028    #[prost(string, tag = "2")]
4029    pub database_name: ::prost::alloc::string::String,
4030}
4031/// Generated client implementations.
4032pub mod database_service_client {
4033    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4034    use tonic::codegen::*;
4035    use tonic::codegen::http::Uri;
4036    /// A set of methods for managing PostgreSQL Database resources.
4037    #[derive(Debug, Clone)]
4038    pub struct DatabaseServiceClient<T> {
4039        inner: tonic::client::Grpc<T>,
4040    }
4041    impl DatabaseServiceClient<tonic::transport::Channel> {
4042        /// Attempt to create a new client by connecting to a given endpoint.
4043        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4044        where
4045            D: TryInto<tonic::transport::Endpoint>,
4046            D::Error: Into<StdError>,
4047        {
4048            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4049            Ok(Self::new(conn))
4050        }
4051    }
4052    impl<T> DatabaseServiceClient<T>
4053    where
4054        T: tonic::client::GrpcService<tonic::body::BoxBody>,
4055        T::Error: Into<StdError>,
4056        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
4057        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
4058    {
4059        pub fn new(inner: T) -> Self {
4060            let inner = tonic::client::Grpc::new(inner);
4061            Self { inner }
4062        }
4063        pub fn with_origin(inner: T, origin: Uri) -> Self {
4064            let inner = tonic::client::Grpc::with_origin(inner, origin);
4065            Self { inner }
4066        }
4067        pub fn with_interceptor<F>(
4068            inner: T,
4069            interceptor: F,
4070        ) -> DatabaseServiceClient<InterceptedService<T, F>>
4071        where
4072            F: tonic::service::Interceptor,
4073            T::ResponseBody: Default,
4074            T: tonic::codegen::Service<
4075                http::Request<tonic::body::BoxBody>,
4076                Response = http::Response<
4077                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
4078                >,
4079            >,
4080            <T as tonic::codegen::Service<
4081                http::Request<tonic::body::BoxBody>,
4082            >>::Error: Into<StdError> + Send + Sync,
4083        {
4084            DatabaseServiceClient::new(InterceptedService::new(inner, interceptor))
4085        }
4086        /// Compress requests with the given encoding.
4087        ///
4088        /// This requires the server to support it otherwise it might respond with an
4089        /// error.
4090        #[must_use]
4091        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4092            self.inner = self.inner.send_compressed(encoding);
4093            self
4094        }
4095        /// Enable decompressing responses.
4096        #[must_use]
4097        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4098            self.inner = self.inner.accept_compressed(encoding);
4099            self
4100        }
4101        /// Limits the maximum size of a decoded message.
4102        ///
4103        /// Default: `4MB`
4104        #[must_use]
4105        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4106            self.inner = self.inner.max_decoding_message_size(limit);
4107            self
4108        }
4109        /// Limits the maximum size of an encoded message.
4110        ///
4111        /// Default: `usize::MAX`
4112        #[must_use]
4113        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4114            self.inner = self.inner.max_encoding_message_size(limit);
4115            self
4116        }
4117        /// Returns the specified PostgreSQL Database resource.
4118        ///
4119        /// To get the list of available PostgreSQL Database resources, make a [List] request.
4120        pub async fn get(
4121            &mut self,
4122            request: impl tonic::IntoRequest<super::GetDatabaseRequest>,
4123        ) -> std::result::Result<tonic::Response<super::Database>, tonic::Status> {
4124            self.inner
4125                .ready()
4126                .await
4127                .map_err(|e| {
4128                    tonic::Status::new(
4129                        tonic::Code::Unknown,
4130                        format!("Service was not ready: {}", e.into()),
4131                    )
4132                })?;
4133            let codec = tonic::codec::ProstCodec::default();
4134            let path = http::uri::PathAndQuery::from_static(
4135                "/yandex.cloud.mdb.postgresql.v1.DatabaseService/Get",
4136            );
4137            let mut req = request.into_request();
4138            req.extensions_mut()
4139                .insert(
4140                    GrpcMethod::new(
4141                        "yandex.cloud.mdb.postgresql.v1.DatabaseService",
4142                        "Get",
4143                    ),
4144                );
4145            self.inner.unary(req, path, codec).await
4146        }
4147        /// Retrieves the list of PostgreSQL Database resources in the specified cluster.
4148        pub async fn list(
4149            &mut self,
4150            request: impl tonic::IntoRequest<super::ListDatabasesRequest>,
4151        ) -> std::result::Result<
4152            tonic::Response<super::ListDatabasesResponse>,
4153            tonic::Status,
4154        > {
4155            self.inner
4156                .ready()
4157                .await
4158                .map_err(|e| {
4159                    tonic::Status::new(
4160                        tonic::Code::Unknown,
4161                        format!("Service was not ready: {}", e.into()),
4162                    )
4163                })?;
4164            let codec = tonic::codec::ProstCodec::default();
4165            let path = http::uri::PathAndQuery::from_static(
4166                "/yandex.cloud.mdb.postgresql.v1.DatabaseService/List",
4167            );
4168            let mut req = request.into_request();
4169            req.extensions_mut()
4170                .insert(
4171                    GrpcMethod::new(
4172                        "yandex.cloud.mdb.postgresql.v1.DatabaseService",
4173                        "List",
4174                    ),
4175                );
4176            self.inner.unary(req, path, codec).await
4177        }
4178        /// Creates a new PostgreSQL database in the specified cluster.
4179        pub async fn create(
4180            &mut self,
4181            request: impl tonic::IntoRequest<super::CreateDatabaseRequest>,
4182        ) -> std::result::Result<
4183            tonic::Response<super::super::super::super::operation::Operation>,
4184            tonic::Status,
4185        > {
4186            self.inner
4187                .ready()
4188                .await
4189                .map_err(|e| {
4190                    tonic::Status::new(
4191                        tonic::Code::Unknown,
4192                        format!("Service was not ready: {}", e.into()),
4193                    )
4194                })?;
4195            let codec = tonic::codec::ProstCodec::default();
4196            let path = http::uri::PathAndQuery::from_static(
4197                "/yandex.cloud.mdb.postgresql.v1.DatabaseService/Create",
4198            );
4199            let mut req = request.into_request();
4200            req.extensions_mut()
4201                .insert(
4202                    GrpcMethod::new(
4203                        "yandex.cloud.mdb.postgresql.v1.DatabaseService",
4204                        "Create",
4205                    ),
4206                );
4207            self.inner.unary(req, path, codec).await
4208        }
4209        /// Updates the specified PostgreSQL database.
4210        pub async fn update(
4211            &mut self,
4212            request: impl tonic::IntoRequest<super::UpdateDatabaseRequest>,
4213        ) -> std::result::Result<
4214            tonic::Response<super::super::super::super::operation::Operation>,
4215            tonic::Status,
4216        > {
4217            self.inner
4218                .ready()
4219                .await
4220                .map_err(|e| {
4221                    tonic::Status::new(
4222                        tonic::Code::Unknown,
4223                        format!("Service was not ready: {}", e.into()),
4224                    )
4225                })?;
4226            let codec = tonic::codec::ProstCodec::default();
4227            let path = http::uri::PathAndQuery::from_static(
4228                "/yandex.cloud.mdb.postgresql.v1.DatabaseService/Update",
4229            );
4230            let mut req = request.into_request();
4231            req.extensions_mut()
4232                .insert(
4233                    GrpcMethod::new(
4234                        "yandex.cloud.mdb.postgresql.v1.DatabaseService",
4235                        "Update",
4236                    ),
4237                );
4238            self.inner.unary(req, path, codec).await
4239        }
4240        /// Deletes the specified PostgreSQL database.
4241        pub async fn delete(
4242            &mut self,
4243            request: impl tonic::IntoRequest<super::DeleteDatabaseRequest>,
4244        ) -> std::result::Result<
4245            tonic::Response<super::super::super::super::operation::Operation>,
4246            tonic::Status,
4247        > {
4248            self.inner
4249                .ready()
4250                .await
4251                .map_err(|e| {
4252                    tonic::Status::new(
4253                        tonic::Code::Unknown,
4254                        format!("Service was not ready: {}", e.into()),
4255                    )
4256                })?;
4257            let codec = tonic::codec::ProstCodec::default();
4258            let path = http::uri::PathAndQuery::from_static(
4259                "/yandex.cloud.mdb.postgresql.v1.DatabaseService/Delete",
4260            );
4261            let mut req = request.into_request();
4262            req.extensions_mut()
4263                .insert(
4264                    GrpcMethod::new(
4265                        "yandex.cloud.mdb.postgresql.v1.DatabaseService",
4266                        "Delete",
4267                    ),
4268                );
4269            self.inner.unary(req, path, codec).await
4270        }
4271    }
4272}
4273#[allow(clippy::derive_partial_eq_without_eq)]
4274#[derive(Clone, PartialEq, ::prost::Message)]
4275pub struct SessionState {
4276    /// Time of collecting statistics on sessions (in the \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format).
4277    #[prost(message, optional, tag = "1")]
4278    pub time: ::core::option::Option<::prost_types::Timestamp>,
4279    /// Host of the connected client.
4280    #[prost(string, tag = "2")]
4281    pub host: ::prost::alloc::string::String,
4282    /// Server process ID. For client connections, this is a client connection ID.
4283    #[prost(int64, tag = "3")]
4284    pub pid: i64,
4285    /// Database ID.
4286    #[prost(string, tag = "4")]
4287    pub database: ::prost::alloc::string::String,
4288    /// User ID.
4289    #[prost(string, tag = "5")]
4290    pub user: ::prost::alloc::string::String,
4291    /// Application name on the connected client.
4292    #[prost(string, tag = "6")]
4293    pub application_name: ::prost::alloc::string::String,
4294    /// Time when a given process was started. For client connections, this is the time when the client connected to the server.
4295    #[prost(message, optional, tag = "7")]
4296    pub backend_start: ::core::option::Option<::prost_types::Timestamp>,
4297    /// Time when a transaction of a given process was started. Returns \[NULL\] if no transaction is active.
4298    ///
4299    /// If the currently active query is the first of its transaction, the value of this parameter is equal to the value of the \[query_start\] parameter.
4300    #[prost(message, optional, tag = "8")]
4301    pub xact_start: ::core::option::Option<::prost_types::Timestamp>,
4302    /// Time when the currently active query was started.
4303    ///
4304    /// If the \[state\] parameter does not take the value \[active\], the parameter returns the time when the lastest query was started.
4305    #[prost(message, optional, tag = "9")]
4306    pub query_start: ::core::option::Option<::prost_types::Timestamp>,
4307    /// Time when the \[state\] parameter was last changed.
4308    #[prost(message, optional, tag = "10")]
4309    pub state_change: ::core::option::Option<::prost_types::Timestamp>,
4310    /// Type of event for which the backend is waiting. Such an event is called a wait event. A backend refers to the process that maintains the client connection.
4311    ///
4312    /// For the list of wait events, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-TABLE>). If the backend is not waiting for any event, the parameter returns \[NULL\].
4313    #[prost(string, tag = "11")]
4314    pub wait_event_type: ::prost::alloc::string::String,
4315    /// Wait event name.
4316    ///
4317    /// For the list of such names, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-ACTIVITY-TABLE>). If the backend is not waiting for any event, the parameter returns \[NULL\].
4318    #[prost(string, tag = "12")]
4319    pub wait_event: ::prost::alloc::string::String,
4320    /// Current backend state. For the list of possible values, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW>).
4321    #[prost(string, tag = "13")]
4322    pub state: ::prost::alloc::string::String,
4323    /// Text of the most recent query.
4324    ///
4325    /// If the \[state\] parameter takes the value \[active\], the parameter shows the currently executing query. For the rest of the states, the parameter shows the last query that was executed. By default, the query text is truncated to 1024 bytes.
4326    #[prost(string, tag = "14")]
4327    pub query: ::prost::alloc::string::String,
4328    /// Current backend type. For the list of possible values, see the [PostgreSQL documentation](<https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW>).
4329    #[prost(string, tag = "15")]
4330    pub backend_type: ::prost::alloc::string::String,
4331    /// IP address of the connected client.
4332    ///
4333    /// The parameter returns \[NULL\] in the following cases:
4334    /// - The client is connected via a Unix socket on the server.
4335    /// - A given process is internal (for example, autovacuum).
4336    #[prost(string, tag = "16")]
4337    pub client_addr: ::prost::alloc::string::String,
4338    /// Host name of the connected client (relevant for IP connections).
4339    #[prost(string, tag = "17")]
4340    pub client_hostname: ::prost::alloc::string::String,
4341    /// TCP port number that the client is using for communication with the server.
4342    ///
4343    /// Returns \[-1\] if the client is connected via a Unix socket on the server. Returns \[NULL\] if a given process is internal (for example, autovacuum).
4344    #[prost(int64, tag = "18")]
4345    pub client_port: i64,
4346    /// Top-level transaction ID, if any.
4347    #[prost(int64, tag = "19")]
4348    pub backend_xid: i64,
4349    /// Current [xmin horizon].
4350    #[prost(int64, tag = "20")]
4351    pub backend_xmin: i64,
4352    /// Process IDs that are blocking a given server process ID.
4353    #[prost(string, tag = "22")]
4354    pub blocking_pids: ::prost::alloc::string::String,
4355    /// Query ID.
4356    #[prost(string, tag = "23")]
4357    pub query_id: ::prost::alloc::string::String,
4358}
4359#[allow(clippy::derive_partial_eq_without_eq)]
4360#[derive(Clone, PartialEq, ::prost::Message)]
4361pub struct PrimaryKey {
4362    /// Host of the connected client.
4363    #[prost(string, tag = "1")]
4364    pub host: ::prost::alloc::string::String,
4365    /// User ID.
4366    #[prost(string, tag = "2")]
4367    pub user: ::prost::alloc::string::String,
4368    /// Database ID.
4369    #[prost(string, tag = "4")]
4370    pub database: ::prost::alloc::string::String,
4371    /// Returns \[true\] if a query is executed as a top-level SQL statement or if the \[pg_stat_statements.track\](<https://www.postgresql.org/docs/current/pgstatstatements.html#id-1.11.7.41.9>) parameter is set to the value \[top\].
4372    #[prost(bool, tag = "5")]
4373    pub toplevel: bool,
4374    /// Query ID.
4375    #[prost(string, tag = "6")]
4376    pub query_id: ::prost::alloc::string::String,
4377    /// Query planning ID.
4378    #[prost(string, tag = "7")]
4379    pub plan_id: ::prost::alloc::string::String,
4380}
4381#[allow(clippy::derive_partial_eq_without_eq)]
4382#[derive(Clone, PartialEq, ::prost::Message)]
4383pub struct QueryStats {
4384    /// Time of collecting statistics on planning and execution of queries.
4385    #[prost(message, optional, tag = "1")]
4386    pub time: ::core::option::Option<::prost_types::Timestamp>,
4387    /// Statement text.
4388    #[prost(string, tag = "2")]
4389    pub query: ::prost::alloc::string::String,
4390    /// Normalized query plan.
4391    #[prost(string, tag = "3")]
4392    pub normalized_plan: ::prost::alloc::string::String,
4393    /// Example of a query execution plan (without normalization).
4394    #[prost(string, tag = "4")]
4395    pub example_plan: ::prost::alloc::string::String,
4396    /// Number of times that a query was planned.
4397    ///
4398    /// The parameter returns a non-zero value if the \[pg_stat_statements.track_planning\](<https://www.postgresql.org/docs/current/pgstatstatements.html#id-1.11.7.41.9>) parameter is enabled.
4399    #[prost(int64, tag = "5")]
4400    pub plans: i64,
4401    /// Total time taken to plan a query, in milliseconds.
4402    ///
4403    /// The parameter returns a non-zero value if the \[pg_stat_statements.track_planning\] parameter is enabled.
4404    #[prost(double, tag = "6")]
4405    pub total_plan_time: f64,
4406    /// Minimum time taken to plan a query, in milliseconds.
4407    ///
4408    /// The parameter returns a non-zero value if the \[pg_stat_statements.track_planning\] parameter is enabled.
4409    #[prost(double, tag = "7")]
4410    pub min_plan_time: f64,
4411    /// Maximum time taken to plan a query, in milliseconds.
4412    ///
4413    /// The parameter returns a non-zero value if the \[pg_stat_statements.track_planning\] parameter is enabled.
4414    #[prost(double, tag = "8")]
4415    pub max_plan_time: f64,
4416    /// Average time taken to plan a query, in milliseconds.
4417    ///
4418    /// The parameter returns a non-zero value if the \[pg_stat_statements.track_planning\] parameter is enabled.
4419    #[prost(double, tag = "9")]
4420    pub mean_plan_time: f64,
4421    /// Population standard deviation of the time taken to plan a query, in milliseconds.
4422    ///
4423    /// The parameter returns a non-zero value if the \[pg_stat_statements.track_planning\] parameter is enabled.
4424    #[prost(double, tag = "10")]
4425    pub stddev_plan_time: f64,
4426    /// Number of times that a query was executed.
4427    #[prost(int64, tag = "11")]
4428    pub calls: i64,
4429    /// Total time taken to execute a query, in milliseconds.
4430    ///
4431    /// total_exec_time
4432    #[prost(double, tag = "12")]
4433    pub total_time: f64,
4434    /// Minimum time taken to execute a query, in milliseconds.
4435    ///
4436    /// min_exec_time
4437    #[prost(double, tag = "13")]
4438    pub min_time: f64,
4439    /// Maximum time taken to execute a query, in milliseconds.
4440    ///
4441    /// max_exec_time
4442    #[prost(double, tag = "14")]
4443    pub max_time: f64,
4444    /// Average time taken to execute a query, in milliseconds.
4445    ///
4446    /// mean_exec_time
4447    #[prost(double, tag = "15")]
4448    pub mean_time: f64,
4449    /// Population standard deviation of the time taken to execute a query, in milliseconds.
4450    ///
4451    /// stddev_exec_time
4452    #[prost(double, tag = "16")]
4453    pub stddev_time: f64,
4454    /// Number of retrieved or affected rows.
4455    #[prost(int64, tag = "17")]
4456    pub rows: i64,
4457    /// Number of shared blocks that are hit from cache.
4458    #[prost(int64, tag = "18")]
4459    pub shared_blks_hit: i64,
4460    /// Number of read shared blocks.
4461    #[prost(int64, tag = "19")]
4462    pub shared_blks_read: i64,
4463    /// Number of 'dirtied' shared blocks.
4464    #[prost(int64, tag = "20")]
4465    pub shared_blks_dirtied: i64,
4466    /// Number of written shared blocks.
4467    #[prost(int64, tag = "21")]
4468    pub shared_blks_written: i64,
4469    /// Number of local blocks that are hit from cache.
4470    #[prost(int64, tag = "22")]
4471    pub local_blks_hit: i64,
4472    /// Number of read local blocks.
4473    #[prost(int64, tag = "23")]
4474    pub local_blks_read: i64,
4475    /// Number of 'dirtied' local blocks.
4476    #[prost(int64, tag = "24")]
4477    pub local_blks_dirtied: i64,
4478    /// Number of written local blocks.
4479    #[prost(int64, tag = "25")]
4480    pub local_blks_written: i64,
4481    /// Number of read temporary blocks.
4482    #[prost(int64, tag = "26")]
4483    pub temp_blks_read: i64,
4484    /// Number of written temporary blocks.
4485    #[prost(int64, tag = "27")]
4486    pub temp_blks_written: i64,
4487    /// Time taken to read data blocks, in milliseconds.
4488    ///
4489    /// The parameter returns a non-zero value if the \[track_io_timing\](<https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-IO-TIMING>) parameter is enabled.
4490    #[prost(double, tag = "28")]
4491    pub blk_read_time: f64,
4492    /// Time taken to record data blocks, in milliseconds.
4493    ///
4494    /// The parameter returns a non-zero value if the \[track_io_timing\] parameter is enabled.
4495    #[prost(double, tag = "29")]
4496    pub blk_write_time: f64,
4497    /// Time taken to read temporary data blocks, in milliseconds.
4498    ///
4499    /// The parameter returns a non-zero value if the \[track_io_timing\] parameter is enabled.
4500    #[prost(double, tag = "30")]
4501    pub temp_blk_read_time: f64,
4502    /// Time taken to record temporary data blocks, in milliseconds.
4503    ///
4504    /// The parameter returns a non-zero value if the \[track_io_timing\] parameter is enabled.
4505    #[prost(double, tag = "31")]
4506    pub temp_blk_write_time: f64,
4507    /// Number of WAL records generated during a given period.
4508    #[prost(int64, tag = "32")]
4509    pub wal_records: i64,
4510    /// Number of WAL full page images generated during a given period.
4511    #[prost(int64, tag = "33")]
4512    pub wal_fpi: i64,
4513    /// Number of WAL logs generated during a given period, in bytes.
4514    #[prost(int64, tag = "34")]
4515    pub wal_bytes: i64,
4516    /// Number of JIT-compiled functions.
4517    #[prost(int64, tag = "35")]
4518    pub jit_functions: i64,
4519    /// Time taken to generate JIT code, in milliseconds.
4520    #[prost(double, tag = "36")]
4521    pub jit_generation_time: f64,
4522    /// Number of times that functions have been inlined.
4523    #[prost(int64, tag = "37")]
4524    pub jit_inlining_count: i64,
4525    /// Time taken to inline functions, in milliseconds.
4526    #[prost(double, tag = "38")]
4527    pub jit_inlining_time: f64,
4528    /// Number of times that a query was optimized.
4529    #[prost(int64, tag = "39")]
4530    pub jit_optimization_count: i64,
4531    /// Time taken to optimize a query, in milliseconds.
4532    #[prost(double, tag = "40")]
4533    pub jit_optimization_time: f64,
4534    /// Number of times that code was emitted.
4535    #[prost(int64, tag = "41")]
4536    pub jit_emission_count: i64,
4537    /// Time taken to emit code.
4538    #[prost(double, tag = "42")]
4539    pub jit_emission_time: f64,
4540    /// Cost of receiving a response to a query before the first row of the response is issued.
4541    #[prost(int64, tag = "43")]
4542    pub startup_cost: i64,
4543    /// Cost of receiving a response to a query when all the rows of the response are issued.
4544    #[prost(int64, tag = "44")]
4545    pub total_cost: i64,
4546    /// Expected number of rows that a given plan node should issue.
4547    #[prost(int64, tag = "45")]
4548    pub plan_rows: i64,
4549    /// Expected average size of rows that a given plan node should issue.
4550    #[prost(int64, tag = "46")]
4551    pub plan_width: i64,
4552    /// Number of bytes that the filesystem layer has read.
4553    #[prost(int64, tag = "47")]
4554    pub reads: i64,
4555    /// Number of bytes that the filesystem layer has written.
4556    #[prost(int64, tag = "48")]
4557    pub writes: i64,
4558    /// User CPU time used.
4559    #[prost(double, tag = "49")]
4560    pub user_time: f64,
4561    /// System CPU time used.
4562    #[prost(double, tag = "50")]
4563    pub system_time: f64,
4564}
4565#[allow(clippy::derive_partial_eq_without_eq)]
4566#[derive(Clone, PartialEq, ::prost::Message)]
4567pub struct QueryStatement {
4568    /// Primary keys in tables with the statistics on planning and execution of queries.
4569    #[prost(message, optional, tag = "1")]
4570    pub key: ::core::option::Option<PrimaryKey>,
4571    /// Statistics on planning and execution of queries.
4572    #[prost(message, optional, tag = "2")]
4573    pub stats: ::core::option::Option<QueryStats>,
4574}
4575#[allow(clippy::derive_partial_eq_without_eq)]
4576#[derive(Clone, PartialEq, ::prost::Message)]
4577pub struct ListRawStatementsRequest {
4578    /// ID of a PostgreSQL cluster to request query statistics for.
4579    ///
4580    /// To get a PostgreSQL cluster ID, use the \[ClusterService.List\] method.
4581    #[prost(string, tag = "1")]
4582    pub cluster_id: ::prost::alloc::string::String,
4583    /// Beginning of the period for which you need to request data (in the \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format).
4584    #[prost(message, optional, tag = "2")]
4585    pub from_time: ::core::option::Option<::prost_types::Timestamp>,
4586    /// End of the period for which you need to request data (in the \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format).
4587    #[prost(message, optional, tag = "3")]
4588    pub to_time: ::core::option::Option<::prost_types::Timestamp>,
4589    /// The maximum number of results per page to return. If the number of the results is larger than \[page_size\], the service returns \[ListRawStatementsResponse.next_page_token\]. You can use it to get the next page of the results in subsequent requests.
4590    #[prost(int64, tag = "4")]
4591    pub page_size: i64,
4592    /// Page token. To get the next page of results, set \[page_token\] to the \[ListRawStatementsResponse.next_page_token\] returned by the previous SQL statement list request.
4593    #[prost(string, tag = "5")]
4594    pub page_token: ::prost::alloc::string::String,
4595}
4596#[allow(clippy::derive_partial_eq_without_eq)]
4597#[derive(Clone, PartialEq, ::prost::Message)]
4598pub struct ListRawSessionStatesRequest {
4599    /// ID of a PostgreSQL cluster to request session statistics for.
4600    ///
4601    /// To get a PostgreSQL cluster ID, use the \[ClusterService.List\] request.
4602    #[prost(string, tag = "1")]
4603    pub cluster_id: ::prost::alloc::string::String,
4604    /// Beginning of the period for which you need to request data (in the \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format).
4605    #[prost(message, optional, tag = "2")]
4606    pub from_time: ::core::option::Option<::prost_types::Timestamp>,
4607    /// End of the period for which you need to request data (in the \[RFC3339\](<https://www.ietf.org/rfc/rfc3339.txt>) text format).
4608    #[prost(message, optional, tag = "3")]
4609    pub to_time: ::core::option::Option<::prost_types::Timestamp>,
4610    /// The maximum number of results per page to return. If the number of the results is larger than \[page_size\], the service returns \[ListRawSessionStatesResponse.next_page_token\]. You can use it to get the next page of the results in subsequent requests.
4611    #[prost(int64, tag = "4")]
4612    pub page_size: i64,
4613    /// Page token. To get the next page of results, set \[page_token\] to the \[ListRawSessionStatesResponse.next_page_token\] returned by the previous PostgreSQL session list request.
4614    #[prost(string, tag = "5")]
4615    pub page_token: ::prost::alloc::string::String,
4616}
4617#[allow(clippy::derive_partial_eq_without_eq)]
4618#[derive(Clone, PartialEq, ::prost::Message)]
4619pub struct ListRawSessionStatesResponse {
4620    /// List of PostgreSQL sessions.
4621    #[prost(message, repeated, tag = "1")]
4622    pub session_states: ::prost::alloc::vec::Vec<SessionState>,
4623    /// This token allows you to get the next page of results when requesting the PostgreSQL session list. If the number of the results is larger than \[ListRawSessionStatesRequest.page_size\], use the \[next_page_token\] as the value for the \[ListRawSessionStatesRequest.page_token\] parameter in the next request. Each subsequent request will have its own \[next_page_token\] to continue paging through the results.
4624    #[prost(string, tag = "2")]
4625    pub next_page_token: ::prost::alloc::string::String,
4626}
4627#[allow(clippy::derive_partial_eq_without_eq)]
4628#[derive(Clone, PartialEq, ::prost::Message)]
4629pub struct ListRawStatementsResponse {
4630    /// List of SQL statements (queries).
4631    #[prost(message, repeated, tag = "1")]
4632    pub statements: ::prost::alloc::vec::Vec<QueryStatement>,
4633    /// This token allows you to get the next page of results when requesting the PostgreSQL session list. If the number of the results is larger than \[ListRawStatementsRequest.page_size\], use the \[next_page_token\] as the value for the \[ListRawStatementsRequest.page_token\] parameter in the next request. Each subsequent request will have its own \[next_page_token\] to continue paging through the results.
4634    #[prost(string, tag = "2")]
4635    pub next_page_token: ::prost::alloc::string::String,
4636}
4637/// Generated client implementations.
4638pub mod performance_diagnostics_service_client {
4639    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4640    use tonic::codegen::*;
4641    use tonic::codegen::http::Uri;
4642    /// A set of methods for PostgreSQL performance diagnostics.
4643    #[derive(Debug, Clone)]
4644    pub struct PerformanceDiagnosticsServiceClient<T> {
4645        inner: tonic::client::Grpc<T>,
4646    }
4647    impl PerformanceDiagnosticsServiceClient<tonic::transport::Channel> {
4648        /// Attempt to create a new client by connecting to a given endpoint.
4649        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4650        where
4651            D: TryInto<tonic::transport::Endpoint>,
4652            D::Error: Into<StdError>,
4653        {
4654            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4655            Ok(Self::new(conn))
4656        }
4657    }
4658    impl<T> PerformanceDiagnosticsServiceClient<T>
4659    where
4660        T: tonic::client::GrpcService<tonic::body::BoxBody>,
4661        T::Error: Into<StdError>,
4662        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
4663        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
4664    {
4665        pub fn new(inner: T) -> Self {
4666            let inner = tonic::client::Grpc::new(inner);
4667            Self { inner }
4668        }
4669        pub fn with_origin(inner: T, origin: Uri) -> Self {
4670            let inner = tonic::client::Grpc::with_origin(inner, origin);
4671            Self { inner }
4672        }
4673        pub fn with_interceptor<F>(
4674            inner: T,
4675            interceptor: F,
4676        ) -> PerformanceDiagnosticsServiceClient<InterceptedService<T, F>>
4677        where
4678            F: tonic::service::Interceptor,
4679            T::ResponseBody: Default,
4680            T: tonic::codegen::Service<
4681                http::Request<tonic::body::BoxBody>,
4682                Response = http::Response<
4683                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
4684                >,
4685            >,
4686            <T as tonic::codegen::Service<
4687                http::Request<tonic::body::BoxBody>,
4688            >>::Error: Into<StdError> + Send + Sync,
4689        {
4690            PerformanceDiagnosticsServiceClient::new(
4691                InterceptedService::new(inner, interceptor),
4692            )
4693        }
4694        /// Compress requests with the given encoding.
4695        ///
4696        /// This requires the server to support it otherwise it might respond with an
4697        /// error.
4698        #[must_use]
4699        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4700            self.inner = self.inner.send_compressed(encoding);
4701            self
4702        }
4703        /// Enable decompressing responses.
4704        #[must_use]
4705        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4706            self.inner = self.inner.accept_compressed(encoding);
4707            self
4708        }
4709        /// Limits the maximum size of a decoded message.
4710        ///
4711        /// Default: `4MB`
4712        #[must_use]
4713        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4714            self.inner = self.inner.max_decoding_message_size(limit);
4715            self
4716        }
4717        /// Limits the maximum size of an encoded message.
4718        ///
4719        /// Default: `usize::MAX`
4720        #[must_use]
4721        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4722            self.inner = self.inner.max_encoding_message_size(limit);
4723            self
4724        }
4725        /// Retrieves raw statistics on sessions. Corresponds to the [pg_stat_activity view](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW).
4726        pub async fn list_raw_session_states(
4727            &mut self,
4728            request: impl tonic::IntoRequest<super::ListRawSessionStatesRequest>,
4729        ) -> std::result::Result<
4730            tonic::Response<super::ListRawSessionStatesResponse>,
4731            tonic::Status,
4732        > {
4733            self.inner
4734                .ready()
4735                .await
4736                .map_err(|e| {
4737                    tonic::Status::new(
4738                        tonic::Code::Unknown,
4739                        format!("Service was not ready: {}", e.into()),
4740                    )
4741                })?;
4742            let codec = tonic::codec::ProstCodec::default();
4743            let path = http::uri::PathAndQuery::from_static(
4744                "/yandex.cloud.mdb.postgresql.v1.PerformanceDiagnosticsService/ListRawSessionStates",
4745            );
4746            let mut req = request.into_request();
4747            req.extensions_mut()
4748                .insert(
4749                    GrpcMethod::new(
4750                        "yandex.cloud.mdb.postgresql.v1.PerformanceDiagnosticsService",
4751                        "ListRawSessionStates",
4752                    ),
4753                );
4754            self.inner.unary(req, path, codec).await
4755        }
4756        /// Retrieves statistics on planning and execution of SQL statements (queries).
4757        pub async fn list_raw_statements(
4758            &mut self,
4759            request: impl tonic::IntoRequest<super::ListRawStatementsRequest>,
4760        ) -> std::result::Result<
4761            tonic::Response<super::ListRawStatementsResponse>,
4762            tonic::Status,
4763        > {
4764            self.inner
4765                .ready()
4766                .await
4767                .map_err(|e| {
4768                    tonic::Status::new(
4769                        tonic::Code::Unknown,
4770                        format!("Service was not ready: {}", e.into()),
4771                    )
4772                })?;
4773            let codec = tonic::codec::ProstCodec::default();
4774            let path = http::uri::PathAndQuery::from_static(
4775                "/yandex.cloud.mdb.postgresql.v1.PerformanceDiagnosticsService/ListRawStatements",
4776            );
4777            let mut req = request.into_request();
4778            req.extensions_mut()
4779                .insert(
4780                    GrpcMethod::new(
4781                        "yandex.cloud.mdb.postgresql.v1.PerformanceDiagnosticsService",
4782                        "ListRawStatements",
4783                    ),
4784                );
4785            self.inner.unary(req, path, codec).await
4786        }
4787    }
4788}
4789/// A ResourcePreset resource for describing hardware configuration presets.
4790#[allow(clippy::derive_partial_eq_without_eq)]
4791#[derive(Clone, PartialEq, ::prost::Message)]
4792pub struct ResourcePreset {
4793    /// ID of the ResourcePreset resource.
4794    #[prost(string, tag = "1")]
4795    pub id: ::prost::alloc::string::String,
4796    /// IDs of availability zones where the resource preset is available.
4797    #[prost(string, repeated, tag = "2")]
4798    pub zone_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4799    /// Number of CPU cores for a PostgreSQL host created with the preset.
4800    #[prost(int64, tag = "3")]
4801    pub cores: i64,
4802    /// RAM volume for a PostgreSQL host created with the preset, in bytes.
4803    #[prost(int64, tag = "4")]
4804    pub memory: i64,
4805}
4806#[allow(clippy::derive_partial_eq_without_eq)]
4807#[derive(Clone, PartialEq, ::prost::Message)]
4808pub struct GetResourcePresetRequest {
4809    /// ID of the resource preset to return.
4810    /// To get the resource preset ID, use a \[ResourcePresetService.List\] request.
4811    #[prost(string, tag = "1")]
4812    pub resource_preset_id: ::prost::alloc::string::String,
4813}
4814#[allow(clippy::derive_partial_eq_without_eq)]
4815#[derive(Clone, PartialEq, ::prost::Message)]
4816pub struct ListResourcePresetsRequest {
4817    /// The maximum number of results per page to return. If the number of available
4818    /// results is larger than \[page_size\], the service returns a \[ListResourcePresetsResponse.next_page_token\]
4819    /// that can be used to get the next page of results in subsequent list requests.
4820    #[prost(int64, tag = "2")]
4821    pub page_size: i64,
4822    /// Page token. To get the next page of results, set \[page_token\] to the \[ListResourcePresetsResponse.next_page_token\]
4823    /// returned by the previous list request.
4824    #[prost(string, tag = "3")]
4825    pub page_token: ::prost::alloc::string::String,
4826}
4827#[allow(clippy::derive_partial_eq_without_eq)]
4828#[derive(Clone, PartialEq, ::prost::Message)]
4829pub struct ListResourcePresetsResponse {
4830    /// List of ResourcePreset resources.
4831    #[prost(message, repeated, tag = "1")]
4832    pub resource_presets: ::prost::alloc::vec::Vec<ResourcePreset>,
4833    /// This token allows you to get the next page of results for list requests. If the number of results
4834    /// is larger than \[ListResourcePresetsRequest.page_size\], use the \[next_page_token\] as the value
4835    /// for the \[ListResourcePresetsRequest.page_token\] parameter in the next list request. Each subsequent
4836    /// list request will have its own \[next_page_token\] to continue paging through the results.
4837    #[prost(string, tag = "2")]
4838    pub next_page_token: ::prost::alloc::string::String,
4839}
4840/// Generated client implementations.
4841pub mod resource_preset_service_client {
4842    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4843    use tonic::codegen::*;
4844    use tonic::codegen::http::Uri;
4845    /// A set of methods for managing ResourcePreset resources.
4846    #[derive(Debug, Clone)]
4847    pub struct ResourcePresetServiceClient<T> {
4848        inner: tonic::client::Grpc<T>,
4849    }
4850    impl ResourcePresetServiceClient<tonic::transport::Channel> {
4851        /// Attempt to create a new client by connecting to a given endpoint.
4852        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4853        where
4854            D: TryInto<tonic::transport::Endpoint>,
4855            D::Error: Into<StdError>,
4856        {
4857            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4858            Ok(Self::new(conn))
4859        }
4860    }
4861    impl<T> ResourcePresetServiceClient<T>
4862    where
4863        T: tonic::client::GrpcService<tonic::body::BoxBody>,
4864        T::Error: Into<StdError>,
4865        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
4866        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
4867    {
4868        pub fn new(inner: T) -> Self {
4869            let inner = tonic::client::Grpc::new(inner);
4870            Self { inner }
4871        }
4872        pub fn with_origin(inner: T, origin: Uri) -> Self {
4873            let inner = tonic::client::Grpc::with_origin(inner, origin);
4874            Self { inner }
4875        }
4876        pub fn with_interceptor<F>(
4877            inner: T,
4878            interceptor: F,
4879        ) -> ResourcePresetServiceClient<InterceptedService<T, F>>
4880        where
4881            F: tonic::service::Interceptor,
4882            T::ResponseBody: Default,
4883            T: tonic::codegen::Service<
4884                http::Request<tonic::body::BoxBody>,
4885                Response = http::Response<
4886                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
4887                >,
4888            >,
4889            <T as tonic::codegen::Service<
4890                http::Request<tonic::body::BoxBody>,
4891            >>::Error: Into<StdError> + Send + Sync,
4892        {
4893            ResourcePresetServiceClient::new(InterceptedService::new(inner, interceptor))
4894        }
4895        /// Compress requests with the given encoding.
4896        ///
4897        /// This requires the server to support it otherwise it might respond with an
4898        /// error.
4899        #[must_use]
4900        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4901            self.inner = self.inner.send_compressed(encoding);
4902            self
4903        }
4904        /// Enable decompressing responses.
4905        #[must_use]
4906        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4907            self.inner = self.inner.accept_compressed(encoding);
4908            self
4909        }
4910        /// Limits the maximum size of a decoded message.
4911        ///
4912        /// Default: `4MB`
4913        #[must_use]
4914        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4915            self.inner = self.inner.max_decoding_message_size(limit);
4916            self
4917        }
4918        /// Limits the maximum size of an encoded message.
4919        ///
4920        /// Default: `usize::MAX`
4921        #[must_use]
4922        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4923            self.inner = self.inner.max_encoding_message_size(limit);
4924            self
4925        }
4926        /// Returns the specified ResourcePreset resource.
4927        ///
4928        /// To get the list of available ResourcePreset resources, make a [List] request.
4929        pub async fn get(
4930            &mut self,
4931            request: impl tonic::IntoRequest<super::GetResourcePresetRequest>,
4932        ) -> std::result::Result<tonic::Response<super::ResourcePreset>, tonic::Status> {
4933            self.inner
4934                .ready()
4935                .await
4936                .map_err(|e| {
4937                    tonic::Status::new(
4938                        tonic::Code::Unknown,
4939                        format!("Service was not ready: {}", e.into()),
4940                    )
4941                })?;
4942            let codec = tonic::codec::ProstCodec::default();
4943            let path = http::uri::PathAndQuery::from_static(
4944                "/yandex.cloud.mdb.postgresql.v1.ResourcePresetService/Get",
4945            );
4946            let mut req = request.into_request();
4947            req.extensions_mut()
4948                .insert(
4949                    GrpcMethod::new(
4950                        "yandex.cloud.mdb.postgresql.v1.ResourcePresetService",
4951                        "Get",
4952                    ),
4953                );
4954            self.inner.unary(req, path, codec).await
4955        }
4956        /// Retrieves the list of available ResourcePreset resources.
4957        pub async fn list(
4958            &mut self,
4959            request: impl tonic::IntoRequest<super::ListResourcePresetsRequest>,
4960        ) -> std::result::Result<
4961            tonic::Response<super::ListResourcePresetsResponse>,
4962            tonic::Status,
4963        > {
4964            self.inner
4965                .ready()
4966                .await
4967                .map_err(|e| {
4968                    tonic::Status::new(
4969                        tonic::Code::Unknown,
4970                        format!("Service was not ready: {}", e.into()),
4971                    )
4972                })?;
4973            let codec = tonic::codec::ProstCodec::default();
4974            let path = http::uri::PathAndQuery::from_static(
4975                "/yandex.cloud.mdb.postgresql.v1.ResourcePresetService/List",
4976            );
4977            let mut req = request.into_request();
4978            req.extensions_mut()
4979                .insert(
4980                    GrpcMethod::new(
4981                        "yandex.cloud.mdb.postgresql.v1.ResourcePresetService",
4982                        "List",
4983                    ),
4984                );
4985            self.inner.unary(req, path, codec).await
4986        }
4987    }
4988}
4989#[allow(clippy::derive_partial_eq_without_eq)]
4990#[derive(Clone, PartialEq, ::prost::Message)]
4991pub struct GetUserRequest {
4992    /// ID of the PostgreSQL cluster the user belongs to.
4993    /// To get the cluster ID, use a \[ClusterService.List\] request.
4994    #[prost(string, tag = "1")]
4995    pub cluster_id: ::prost::alloc::string::String,
4996    /// Name of the PostgreSQL User resource to return.
4997    /// To get the name of the user, use a \[UserService.List\] request.
4998    #[prost(string, tag = "2")]
4999    pub user_name: ::prost::alloc::string::String,
5000}
5001#[allow(clippy::derive_partial_eq_without_eq)]
5002#[derive(Clone, PartialEq, ::prost::Message)]
5003pub struct ListUsersRequest {
5004    /// ID of the cluster to list PostgreSQL users in.
5005    /// To get the cluster ID, use a \[ClusterService.List\] request.
5006    #[prost(string, tag = "1")]
5007    pub cluster_id: ::prost::alloc::string::String,
5008    /// The maximum number of results per page to return. If the number of available
5009    /// results is larger than `page_size`, the service returns a \[ListUsersResponse.next_page_token\]
5010    /// that can be used to get the next page of results in subsequent list requests.
5011    #[prost(int64, tag = "2")]
5012    pub page_size: i64,
5013    /// Page token. To get the next page of results, set `page_token` to the \[ListUsersResponse.next_page_token\]
5014    /// returned by the previous list request.
5015    #[prost(string, tag = "3")]
5016    pub page_token: ::prost::alloc::string::String,
5017}
5018#[allow(clippy::derive_partial_eq_without_eq)]
5019#[derive(Clone, PartialEq, ::prost::Message)]
5020pub struct ListUsersResponse {
5021    /// List of PostgreSQL User resources.
5022    #[prost(message, repeated, tag = "1")]
5023    pub users: ::prost::alloc::vec::Vec<User>,
5024    /// This token allows you to get the next page of results for list requests. If the number of results
5025    /// is larger than \[ListUsersRequest.page_size\], use the `next_page_token` as the value
5026    /// for the \[ListUsersRequest.page_token\] parameter in the next list request. Each subsequent
5027    /// list request will have its own `next_page_token` to continue paging through the results.
5028    #[prost(string, tag = "2")]
5029    pub next_page_token: ::prost::alloc::string::String,
5030}
5031#[allow(clippy::derive_partial_eq_without_eq)]
5032#[derive(Clone, PartialEq, ::prost::Message)]
5033pub struct CreateUserRequest {
5034    /// ID of the PostgreSQL cluster to create a user in.
5035    /// To get the cluster ID, use a \[ClusterService.List\] request.
5036    #[prost(string, tag = "1")]
5037    pub cluster_id: ::prost::alloc::string::String,
5038    /// Properties of the user to be created.
5039    #[prost(message, optional, tag = "2")]
5040    pub user_spec: ::core::option::Option<UserSpec>,
5041}
5042#[allow(clippy::derive_partial_eq_without_eq)]
5043#[derive(Clone, PartialEq, ::prost::Message)]
5044pub struct CreateUserMetadata {
5045    /// ID of the PostgreSQL cluster the user is being created in.
5046    #[prost(string, tag = "1")]
5047    pub cluster_id: ::prost::alloc::string::String,
5048    /// Name of the user that is being created.
5049    #[prost(string, tag = "2")]
5050    pub user_name: ::prost::alloc::string::String,
5051}
5052#[allow(clippy::derive_partial_eq_without_eq)]
5053#[derive(Clone, PartialEq, ::prost::Message)]
5054pub struct UpdateUserRequest {
5055    /// ID of the PostgreSQL cluster the user belongs to.
5056    /// To get the cluster ID use a \[ClusterService.List\] request.
5057    #[prost(string, tag = "1")]
5058    pub cluster_id: ::prost::alloc::string::String,
5059    /// Name of the user to be updated.
5060    /// To get the name of the user use a \[UserService.List\] request.
5061    #[prost(string, tag = "2")]
5062    pub user_name: ::prost::alloc::string::String,
5063    /// Field mask that specifies which fields of the PostgreSQL User resource should be updated.
5064    #[prost(message, optional, tag = "3")]
5065    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
5066    /// New password for the user.
5067    #[prost(string, tag = "4")]
5068    pub password: ::prost::alloc::string::String,
5069    /// Set of permissions granted to the user to access specific databases.
5070    #[prost(message, repeated, tag = "5")]
5071    pub permissions: ::prost::alloc::vec::Vec<Permission>,
5072    /// Maximum number of database connections available to the user.
5073    ///
5074    /// When used in session pooling, this setting limits the number of connections to every single host in PostgreSQL cluster. In this case, the setting's value must be greater than the total number of connections that backend services can open to access the PostgreSQL cluster. The setting's value should not exceed the value of the \[Cluster.config.postgresql_config.max_connections\] setting.
5075    ///
5076    /// When used in transaction pooling, this setting limits the number of user's active transactions; therefore, in this mode user can open thousands of connections, but only `N` concurrent connections will be opened, where `N` is the value of the setting.
5077    ///
5078    /// Minimum value: `10` (default: `50`), when used in session pooling.
5079    #[prost(int64, tag = "6")]
5080    pub conn_limit: i64,
5081    #[prost(message, optional, tag = "7")]
5082    pub settings: ::core::option::Option<UserSettings>,
5083    /// This flag defines whether the user can login to a PostgreSQL database.
5084    ///
5085    /// Default value: `true` (login is allowed).
5086    #[prost(message, optional, tag = "8")]
5087    pub login: ::core::option::Option<bool>,
5088    /// A set of roles and privileges that are granted to the user.
5089    ///
5090    /// For more information, see [the documentation](/docs/managed-postgresql/operations/grant).
5091    #[prost(string, repeated, tag = "9")]
5092    pub grants: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
5093    /// Deletion Protection inhibits deletion of the user
5094    ///
5095    /// Default value: `unspecified` (inherits cluster's deletion_protection)
5096    #[prost(message, optional, tag = "10")]
5097    pub deletion_protection: ::core::option::Option<bool>,
5098    /// New password-based authentication method for user.
5099    /// Possible values are `` USER_PASSWORD_ENCRYPTION_MD5 `` or `` USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``.
5100    #[prost(enumeration = "UserPasswordEncryption", tag = "11")]
5101    pub user_password_encryption: i32,
5102    /// Generate password using Connection Manager.
5103    #[prost(message, optional, tag = "12")]
5104    pub generate_password: ::core::option::Option<bool>,
5105}
5106#[allow(clippy::derive_partial_eq_without_eq)]
5107#[derive(Clone, PartialEq, ::prost::Message)]
5108pub struct UpdateUserMetadata {
5109    /// ID of the PostgreSQL cluster the user belongs to.
5110    #[prost(string, tag = "1")]
5111    pub cluster_id: ::prost::alloc::string::String,
5112    /// Name of the user that is being updated.
5113    #[prost(string, tag = "2")]
5114    pub user_name: ::prost::alloc::string::String,
5115}
5116#[allow(clippy::derive_partial_eq_without_eq)]
5117#[derive(Clone, PartialEq, ::prost::Message)]
5118pub struct DeleteUserRequest {
5119    /// ID of the PostgreSQL cluster the user belongs to.
5120    /// To get the cluster ID, use a \[ClusterService.List\] request.
5121    #[prost(string, tag = "1")]
5122    pub cluster_id: ::prost::alloc::string::String,
5123    /// Name of the user to delete.
5124    /// To get the name of the user, use a \[UserService.List\] request.
5125    #[prost(string, tag = "2")]
5126    pub user_name: ::prost::alloc::string::String,
5127}
5128#[allow(clippy::derive_partial_eq_without_eq)]
5129#[derive(Clone, PartialEq, ::prost::Message)]
5130pub struct DeleteUserMetadata {
5131    /// ID of the PostgreSQL cluster the user belongs to.
5132    #[prost(string, tag = "1")]
5133    pub cluster_id: ::prost::alloc::string::String,
5134    /// Name of the user that is being deleted.
5135    #[prost(string, tag = "2")]
5136    pub user_name: ::prost::alloc::string::String,
5137}
5138#[allow(clippy::derive_partial_eq_without_eq)]
5139#[derive(Clone, PartialEq, ::prost::Message)]
5140pub struct GrantUserPermissionRequest {
5141    /// ID of the PostgreSQL cluster the user belongs to.
5142    /// To get the cluster ID, use a \[ClusterService.List\] request.
5143    #[prost(string, tag = "1")]
5144    pub cluster_id: ::prost::alloc::string::String,
5145    /// Name of the user to grant the permission to.
5146    /// To get the name of the user, use a \[UserService.List\] request.
5147    #[prost(string, tag = "2")]
5148    pub user_name: ::prost::alloc::string::String,
5149    /// Permission that should be granted to the specified user.
5150    #[prost(message, optional, tag = "3")]
5151    pub permission: ::core::option::Option<Permission>,
5152}
5153#[allow(clippy::derive_partial_eq_without_eq)]
5154#[derive(Clone, PartialEq, ::prost::Message)]
5155pub struct GrantUserPermissionMetadata {
5156    /// ID of the PostgreSQL cluster the user belongs to.
5157    /// To get the cluster ID, use a \[ClusterService.List\] request.
5158    #[prost(string, tag = "1")]
5159    pub cluster_id: ::prost::alloc::string::String,
5160    /// Name of the user that is being granted a permission.
5161    #[prost(string, tag = "2")]
5162    pub user_name: ::prost::alloc::string::String,
5163}
5164#[allow(clippy::derive_partial_eq_without_eq)]
5165#[derive(Clone, PartialEq, ::prost::Message)]
5166pub struct RevokeUserPermissionRequest {
5167    /// ID of the PostgreSQL cluster the user belongs to.
5168    /// To get the cluster ID, use a \[ClusterService.List\] request.
5169    #[prost(string, tag = "1")]
5170    pub cluster_id: ::prost::alloc::string::String,
5171    /// Name of the user to revoke a permission from.
5172    /// To get the name of the user, use a \[UserService.List\] request.
5173    #[prost(string, tag = "2")]
5174    pub user_name: ::prost::alloc::string::String,
5175    /// Name of the database that the user should lose access to.
5176    #[prost(string, tag = "3")]
5177    pub database_name: ::prost::alloc::string::String,
5178}
5179#[allow(clippy::derive_partial_eq_without_eq)]
5180#[derive(Clone, PartialEq, ::prost::Message)]
5181pub struct RevokeUserPermissionMetadata {
5182    /// ID of the PostgreSQL cluster the user belongs to.
5183    #[prost(string, tag = "1")]
5184    pub cluster_id: ::prost::alloc::string::String,
5185    /// Name of the user whose permission is being revoked.
5186    #[prost(string, tag = "2")]
5187    pub user_name: ::prost::alloc::string::String,
5188}
5189/// Generated client implementations.
5190pub mod user_service_client {
5191    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
5192    use tonic::codegen::*;
5193    use tonic::codegen::http::Uri;
5194    /// A set of methods for managing PostgreSQL User resources.
5195    #[derive(Debug, Clone)]
5196    pub struct UserServiceClient<T> {
5197        inner: tonic::client::Grpc<T>,
5198    }
5199    impl UserServiceClient<tonic::transport::Channel> {
5200        /// Attempt to create a new client by connecting to a given endpoint.
5201        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5202        where
5203            D: TryInto<tonic::transport::Endpoint>,
5204            D::Error: Into<StdError>,
5205        {
5206            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5207            Ok(Self::new(conn))
5208        }
5209    }
5210    impl<T> UserServiceClient<T>
5211    where
5212        T: tonic::client::GrpcService<tonic::body::BoxBody>,
5213        T::Error: Into<StdError>,
5214        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
5215        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
5216    {
5217        pub fn new(inner: T) -> Self {
5218            let inner = tonic::client::Grpc::new(inner);
5219            Self { inner }
5220        }
5221        pub fn with_origin(inner: T, origin: Uri) -> Self {
5222            let inner = tonic::client::Grpc::with_origin(inner, origin);
5223            Self { inner }
5224        }
5225        pub fn with_interceptor<F>(
5226            inner: T,
5227            interceptor: F,
5228        ) -> UserServiceClient<InterceptedService<T, F>>
5229        where
5230            F: tonic::service::Interceptor,
5231            T::ResponseBody: Default,
5232            T: tonic::codegen::Service<
5233                http::Request<tonic::body::BoxBody>,
5234                Response = http::Response<
5235                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
5236                >,
5237            >,
5238            <T as tonic::codegen::Service<
5239                http::Request<tonic::body::BoxBody>,
5240            >>::Error: Into<StdError> + Send + Sync,
5241        {
5242            UserServiceClient::new(InterceptedService::new(inner, interceptor))
5243        }
5244        /// Compress requests with the given encoding.
5245        ///
5246        /// This requires the server to support it otherwise it might respond with an
5247        /// error.
5248        #[must_use]
5249        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5250            self.inner = self.inner.send_compressed(encoding);
5251            self
5252        }
5253        /// Enable decompressing responses.
5254        #[must_use]
5255        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5256            self.inner = self.inner.accept_compressed(encoding);
5257            self
5258        }
5259        /// Limits the maximum size of a decoded message.
5260        ///
5261        /// Default: `4MB`
5262        #[must_use]
5263        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5264            self.inner = self.inner.max_decoding_message_size(limit);
5265            self
5266        }
5267        /// Limits the maximum size of an encoded message.
5268        ///
5269        /// Default: `usize::MAX`
5270        #[must_use]
5271        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5272            self.inner = self.inner.max_encoding_message_size(limit);
5273            self
5274        }
5275        /// Returns the specified PostgreSQL User resource.
5276        ///
5277        /// To get the list of available PostgreSQL User resources, make a [List] request.
5278        pub async fn get(
5279            &mut self,
5280            request: impl tonic::IntoRequest<super::GetUserRequest>,
5281        ) -> std::result::Result<tonic::Response<super::User>, tonic::Status> {
5282            self.inner
5283                .ready()
5284                .await
5285                .map_err(|e| {
5286                    tonic::Status::new(
5287                        tonic::Code::Unknown,
5288                        format!("Service was not ready: {}", e.into()),
5289                    )
5290                })?;
5291            let codec = tonic::codec::ProstCodec::default();
5292            let path = http::uri::PathAndQuery::from_static(
5293                "/yandex.cloud.mdb.postgresql.v1.UserService/Get",
5294            );
5295            let mut req = request.into_request();
5296            req.extensions_mut()
5297                .insert(
5298                    GrpcMethod::new("yandex.cloud.mdb.postgresql.v1.UserService", "Get"),
5299                );
5300            self.inner.unary(req, path, codec).await
5301        }
5302        /// Retrieves the list of PostgreSQL User resources in the specified cluster.
5303        pub async fn list(
5304            &mut self,
5305            request: impl tonic::IntoRequest<super::ListUsersRequest>,
5306        ) -> std::result::Result<
5307            tonic::Response<super::ListUsersResponse>,
5308            tonic::Status,
5309        > {
5310            self.inner
5311                .ready()
5312                .await
5313                .map_err(|e| {
5314                    tonic::Status::new(
5315                        tonic::Code::Unknown,
5316                        format!("Service was not ready: {}", e.into()),
5317                    )
5318                })?;
5319            let codec = tonic::codec::ProstCodec::default();
5320            let path = http::uri::PathAndQuery::from_static(
5321                "/yandex.cloud.mdb.postgresql.v1.UserService/List",
5322            );
5323            let mut req = request.into_request();
5324            req.extensions_mut()
5325                .insert(
5326                    GrpcMethod::new("yandex.cloud.mdb.postgresql.v1.UserService", "List"),
5327                );
5328            self.inner.unary(req, path, codec).await
5329        }
5330        /// Creates a PostgreSQL user in the specified cluster.
5331        pub async fn create(
5332            &mut self,
5333            request: impl tonic::IntoRequest<super::CreateUserRequest>,
5334        ) -> std::result::Result<
5335            tonic::Response<super::super::super::super::operation::Operation>,
5336            tonic::Status,
5337        > {
5338            self.inner
5339                .ready()
5340                .await
5341                .map_err(|e| {
5342                    tonic::Status::new(
5343                        tonic::Code::Unknown,
5344                        format!("Service was not ready: {}", e.into()),
5345                    )
5346                })?;
5347            let codec = tonic::codec::ProstCodec::default();
5348            let path = http::uri::PathAndQuery::from_static(
5349                "/yandex.cloud.mdb.postgresql.v1.UserService/Create",
5350            );
5351            let mut req = request.into_request();
5352            req.extensions_mut()
5353                .insert(
5354                    GrpcMethod::new(
5355                        "yandex.cloud.mdb.postgresql.v1.UserService",
5356                        "Create",
5357                    ),
5358                );
5359            self.inner.unary(req, path, codec).await
5360        }
5361        /// Updates the specified PostgreSQL user.
5362        pub async fn update(
5363            &mut self,
5364            request: impl tonic::IntoRequest<super::UpdateUserRequest>,
5365        ) -> std::result::Result<
5366            tonic::Response<super::super::super::super::operation::Operation>,
5367            tonic::Status,
5368        > {
5369            self.inner
5370                .ready()
5371                .await
5372                .map_err(|e| {
5373                    tonic::Status::new(
5374                        tonic::Code::Unknown,
5375                        format!("Service was not ready: {}", e.into()),
5376                    )
5377                })?;
5378            let codec = tonic::codec::ProstCodec::default();
5379            let path = http::uri::PathAndQuery::from_static(
5380                "/yandex.cloud.mdb.postgresql.v1.UserService/Update",
5381            );
5382            let mut req = request.into_request();
5383            req.extensions_mut()
5384                .insert(
5385                    GrpcMethod::new(
5386                        "yandex.cloud.mdb.postgresql.v1.UserService",
5387                        "Update",
5388                    ),
5389                );
5390            self.inner.unary(req, path, codec).await
5391        }
5392        /// Deletes the specified PostgreSQL user.
5393        pub async fn delete(
5394            &mut self,
5395            request: impl tonic::IntoRequest<super::DeleteUserRequest>,
5396        ) -> std::result::Result<
5397            tonic::Response<super::super::super::super::operation::Operation>,
5398            tonic::Status,
5399        > {
5400            self.inner
5401                .ready()
5402                .await
5403                .map_err(|e| {
5404                    tonic::Status::new(
5405                        tonic::Code::Unknown,
5406                        format!("Service was not ready: {}", e.into()),
5407                    )
5408                })?;
5409            let codec = tonic::codec::ProstCodec::default();
5410            let path = http::uri::PathAndQuery::from_static(
5411                "/yandex.cloud.mdb.postgresql.v1.UserService/Delete",
5412            );
5413            let mut req = request.into_request();
5414            req.extensions_mut()
5415                .insert(
5416                    GrpcMethod::new(
5417                        "yandex.cloud.mdb.postgresql.v1.UserService",
5418                        "Delete",
5419                    ),
5420                );
5421            self.inner.unary(req, path, codec).await
5422        }
5423        /// Grants permission to the specified PostgreSQL user.
5424        pub async fn grant_permission(
5425            &mut self,
5426            request: impl tonic::IntoRequest<super::GrantUserPermissionRequest>,
5427        ) -> std::result::Result<
5428            tonic::Response<super::super::super::super::operation::Operation>,
5429            tonic::Status,
5430        > {
5431            self.inner
5432                .ready()
5433                .await
5434                .map_err(|e| {
5435                    tonic::Status::new(
5436                        tonic::Code::Unknown,
5437                        format!("Service was not ready: {}", e.into()),
5438                    )
5439                })?;
5440            let codec = tonic::codec::ProstCodec::default();
5441            let path = http::uri::PathAndQuery::from_static(
5442                "/yandex.cloud.mdb.postgresql.v1.UserService/GrantPermission",
5443            );
5444            let mut req = request.into_request();
5445            req.extensions_mut()
5446                .insert(
5447                    GrpcMethod::new(
5448                        "yandex.cloud.mdb.postgresql.v1.UserService",
5449                        "GrantPermission",
5450                    ),
5451                );
5452            self.inner.unary(req, path, codec).await
5453        }
5454        /// Revokes permission from the specified PostgreSQL user.
5455        pub async fn revoke_permission(
5456            &mut self,
5457            request: impl tonic::IntoRequest<super::RevokeUserPermissionRequest>,
5458        ) -> std::result::Result<
5459            tonic::Response<super::super::super::super::operation::Operation>,
5460            tonic::Status,
5461        > {
5462            self.inner
5463                .ready()
5464                .await
5465                .map_err(|e| {
5466                    tonic::Status::new(
5467                        tonic::Code::Unknown,
5468                        format!("Service was not ready: {}", e.into()),
5469                    )
5470                })?;
5471            let codec = tonic::codec::ProstCodec::default();
5472            let path = http::uri::PathAndQuery::from_static(
5473                "/yandex.cloud.mdb.postgresql.v1.UserService/RevokePermission",
5474            );
5475            let mut req = request.into_request();
5476            req.extensions_mut()
5477                .insert(
5478                    GrpcMethod::new(
5479                        "yandex.cloud.mdb.postgresql.v1.UserService",
5480                        "RevokePermission",
5481                    ),
5482                );
5483            self.inner.unary(req, path, codec).await
5484        }
5485    }
5486}