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

1/// An SQL Server backup resource.
2///
3/// For more information, see the \[Backup\](/docs/managed-sqlserver/concepts/backup) section in the documentation.
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct Backup {
7    /// ID of the backup.
8    #[prost(string, tag = "1")]
9    pub id: ::prost::alloc::string::String,
10    /// ID of the folder that the backup belongs to.
11    #[prost(string, tag = "2")]
12    pub folder_id: ::prost::alloc::string::String,
13    /// Time 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 SQL Server 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    /// List of databases included in the backup.
23    #[prost(string, repeated, tag = "6")]
24    pub databases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
25}
26#[allow(clippy::derive_partial_eq_without_eq)]
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct GetBackupRequest {
29    /// ID of the backup to return information about.
30    ///
31    /// To get the backup ID, use a \[ClusterService.ListBackups\] request.
32    #[prost(string, tag = "1")]
33    pub backup_id: ::prost::alloc::string::String,
34}
35#[allow(clippy::derive_partial_eq_without_eq)]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct ListBackupsRequest {
38    /// ID of the folder to list backups in.
39    ///
40    /// To get the folder ID, use a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
41    #[prost(string, tag = "1")]
42    pub folder_id: ::prost::alloc::string::String,
43    /// The maximum number of results per page to return.
44    ///
45    /// If the number of available results is larger than \[page_size\], the service returns a \[ListBackupsResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
46    #[prost(int64, tag = "2")]
47    pub page_size: i64,
48    /// Page token. To get the next page of results, set \[page_token\] to the \[ListBackupsResponse.next_page_token\] returned by the previous list request.
49    #[prost(string, tag = "3")]
50    pub page_token: ::prost::alloc::string::String,
51}
52#[allow(clippy::derive_partial_eq_without_eq)]
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct ListBackupsResponse {
55    /// List of SQL Server backups.
56    #[prost(message, repeated, tag = "1")]
57    pub backups: ::prost::alloc::vec::Vec<Backup>,
58    /// This token allows you to get the next page of results for ListBackups requests.
59    ///
60    /// If the number of results is larger than \[ListBackupsRequest.page_size\], use the \[next_page_token\] as the value for the \[ListBackupsRequest.page_token\] parameter in the next ListBackups request.
61    ///
62    /// Each subsequent ListBackups request has its own \[next_page_token\] to continue paging through the results.
63    #[prost(string, tag = "2")]
64    pub next_page_token: ::prost::alloc::string::String,
65}
66/// Generated client implementations.
67pub mod backup_service_client {
68    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
69    use tonic::codegen::*;
70    use tonic::codegen::http::Uri;
71    /// A set of methods for managing SQL Server backups.
72    #[derive(Debug, Clone)]
73    pub struct BackupServiceClient<T> {
74        inner: tonic::client::Grpc<T>,
75    }
76    impl BackupServiceClient<tonic::transport::Channel> {
77        /// Attempt to create a new client by connecting to a given endpoint.
78        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
79        where
80            D: TryInto<tonic::transport::Endpoint>,
81            D::Error: Into<StdError>,
82        {
83            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
84            Ok(Self::new(conn))
85        }
86    }
87    impl<T> BackupServiceClient<T>
88    where
89        T: tonic::client::GrpcService<tonic::body::BoxBody>,
90        T::Error: Into<StdError>,
91        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
92        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
93    {
94        pub fn new(inner: T) -> Self {
95            let inner = tonic::client::Grpc::new(inner);
96            Self { inner }
97        }
98        pub fn with_origin(inner: T, origin: Uri) -> Self {
99            let inner = tonic::client::Grpc::with_origin(inner, origin);
100            Self { inner }
101        }
102        pub fn with_interceptor<F>(
103            inner: T,
104            interceptor: F,
105        ) -> BackupServiceClient<InterceptedService<T, F>>
106        where
107            F: tonic::service::Interceptor,
108            T::ResponseBody: Default,
109            T: tonic::codegen::Service<
110                http::Request<tonic::body::BoxBody>,
111                Response = http::Response<
112                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
113                >,
114            >,
115            <T as tonic::codegen::Service<
116                http::Request<tonic::body::BoxBody>,
117            >>::Error: Into<StdError> + Send + Sync,
118        {
119            BackupServiceClient::new(InterceptedService::new(inner, interceptor))
120        }
121        /// Compress requests with the given encoding.
122        ///
123        /// This requires the server to support it otherwise it might respond with an
124        /// error.
125        #[must_use]
126        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
127            self.inner = self.inner.send_compressed(encoding);
128            self
129        }
130        /// Enable decompressing responses.
131        #[must_use]
132        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
133            self.inner = self.inner.accept_compressed(encoding);
134            self
135        }
136        /// Limits the maximum size of a decoded message.
137        ///
138        /// Default: `4MB`
139        #[must_use]
140        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
141            self.inner = self.inner.max_decoding_message_size(limit);
142            self
143        }
144        /// Limits the maximum size of an encoded message.
145        ///
146        /// Default: `usize::MAX`
147        #[must_use]
148        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
149            self.inner = self.inner.max_encoding_message_size(limit);
150            self
151        }
152        /// Returns the specified SQL Server backup.
153        ///
154        /// To get the list of available SQL Server backups, make a [List] request.
155        pub async fn get(
156            &mut self,
157            request: impl tonic::IntoRequest<super::GetBackupRequest>,
158        ) -> std::result::Result<tonic::Response<super::Backup>, tonic::Status> {
159            self.inner
160                .ready()
161                .await
162                .map_err(|e| {
163                    tonic::Status::new(
164                        tonic::Code::Unknown,
165                        format!("Service was not ready: {}", e.into()),
166                    )
167                })?;
168            let codec = tonic::codec::ProstCodec::default();
169            let path = http::uri::PathAndQuery::from_static(
170                "/yandex.cloud.mdb.sqlserver.v1.BackupService/Get",
171            );
172            let mut req = request.into_request();
173            req.extensions_mut()
174                .insert(
175                    GrpcMethod::new("yandex.cloud.mdb.sqlserver.v1.BackupService", "Get"),
176                );
177            self.inner.unary(req, path, codec).await
178        }
179        /// Retrieves the list of SQL Server backups available for the specified folder.
180        pub async fn list(
181            &mut self,
182            request: impl tonic::IntoRequest<super::ListBackupsRequest>,
183        ) -> std::result::Result<
184            tonic::Response<super::ListBackupsResponse>,
185            tonic::Status,
186        > {
187            self.inner
188                .ready()
189                .await
190                .map_err(|e| {
191                    tonic::Status::new(
192                        tonic::Code::Unknown,
193                        format!("Service was not ready: {}", e.into()),
194                    )
195                })?;
196            let codec = tonic::codec::ProstCodec::default();
197            let path = http::uri::PathAndQuery::from_static(
198                "/yandex.cloud.mdb.sqlserver.v1.BackupService/List",
199            );
200            let mut req = request.into_request();
201            req.extensions_mut()
202                .insert(
203                    GrpcMethod::new(
204                        "yandex.cloud.mdb.sqlserver.v1.BackupService",
205                        "List",
206                    ),
207                );
208            self.inner.unary(req, path, codec).await
209        }
210    }
211}
212/// An SQL Server cluster.
213///
214/// For more information, see the \[Concepts\](/docs/managed-sqlserver/concepts) section of the documentation.
215#[allow(clippy::derive_partial_eq_without_eq)]
216#[derive(Clone, PartialEq, ::prost::Message)]
217pub struct Cluster {
218    /// ID of the SQL Server cluster.
219    ///
220    /// This ID is assigned by Managed Service for SQL Server at the moment of creation.
221    #[prost(string, tag = "1")]
222    pub id: ::prost::alloc::string::String,
223    /// ID of the folder the SQL Server cluster belongs to.
224    #[prost(string, tag = "2")]
225    pub folder_id: ::prost::alloc::string::String,
226    /// Time when SQL Server cluster was created.
227    #[prost(message, optional, tag = "3")]
228    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
229    /// Name of the SQL Server cluster.
230    ///
231    /// The name must be unique within the folder, comply with [RFC 1035](<https://www.ietf.org/rfc/rfc1035.txt>) and be 1-63 characters long.
232    ///
233    #[prost(string, tag = "4")]
234    pub name: ::prost::alloc::string::String,
235    /// Description of the SQL Server cluster.
236    ///
237    /// Must be 0-256 characters long.
238    #[prost(string, tag = "5")]
239    pub description: ::prost::alloc::string::String,
240    /// Custom labels for the SQL Server cluster as `key:value` pairs.
241    ///
242    /// Maximum 64 per resource.
243    #[prost(map = "string, string", tag = "6")]
244    pub labels: ::std::collections::HashMap<
245        ::prost::alloc::string::String,
246        ::prost::alloc::string::String,
247    >,
248    /// Deployment environment of the SQL Server cluster.
249    #[prost(enumeration = "cluster::Environment", tag = "7")]
250    pub environment: i32,
251    /// Description of monitoring systems relevant to the SQL Server cluster.
252    #[prost(message, repeated, tag = "8")]
253    pub monitoring: ::prost::alloc::vec::Vec<Monitoring>,
254    /// Configuration of the SQL Server cluster.
255    #[prost(message, optional, tag = "9")]
256    pub config: ::core::option::Option<ClusterConfig>,
257    /// ID of the network that the cluster belongs to.
258    #[prost(string, tag = "10")]
259    pub network_id: ::prost::alloc::string::String,
260    /// Aggregated cluster health.
261    #[prost(enumeration = "cluster::Health", tag = "11")]
262    pub health: i32,
263    /// Current state of the cluster.
264    #[prost(enumeration = "cluster::Status", tag = "12")]
265    pub status: i32,
266    /// User security groups.
267    #[prost(string, repeated, tag = "13")]
268    pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
269    /// Determines whether the cluster is protected from being deleted.
270    #[prost(bool, tag = "14")]
271    pub deletion_protection: bool,
272    /// SQL Server Collation.
273    #[prost(string, tag = "15")]
274    pub sqlcollation: ::prost::alloc::string::String,
275    /// Host groups hosting VMs of the cluster.
276    #[prost(string, repeated, tag = "16")]
277    pub host_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
278    /// ID of the service account which is used for access to Object Storage.
279    #[prost(string, tag = "17")]
280    pub service_account_id: ::prost::alloc::string::String,
281}
282/// Nested message and enum types in `Cluster`.
283pub mod cluster {
284    #[derive(
285        Clone,
286        Copy,
287        Debug,
288        PartialEq,
289        Eq,
290        Hash,
291        PartialOrd,
292        Ord,
293        ::prost::Enumeration
294    )]
295    #[repr(i32)]
296    pub enum Environment {
297        Unspecified = 0,
298        /// Stable environment with a conservative update policy: only hotfixes are applied during regular maintenance.
299        Production = 1,
300        /// Environment with more aggressive update policy: new versions are rolled out irrespective of backward compatibility.
301        Prestable = 2,
302    }
303    impl Environment {
304        /// String value of the enum field names used in the ProtoBuf definition.
305        ///
306        /// The values are not transformed in any way and thus are considered stable
307        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
308        pub fn as_str_name(&self) -> &'static str {
309            match self {
310                Environment::Unspecified => "ENVIRONMENT_UNSPECIFIED",
311                Environment::Production => "PRODUCTION",
312                Environment::Prestable => "PRESTABLE",
313            }
314        }
315        /// Creates an enum from field names used in the ProtoBuf definition.
316        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
317            match value {
318                "ENVIRONMENT_UNSPECIFIED" => Some(Self::Unspecified),
319                "PRODUCTION" => Some(Self::Production),
320                "PRESTABLE" => Some(Self::Prestable),
321                _ => None,
322            }
323        }
324    }
325    #[derive(
326        Clone,
327        Copy,
328        Debug,
329        PartialEq,
330        Eq,
331        Hash,
332        PartialOrd,
333        Ord,
334        ::prost::Enumeration
335    )]
336    #[repr(i32)]
337    pub enum Health {
338        /// State of the cluster is unknown (\[Host.health\] of all hosts in the cluster is `UNKNOWN`).
339        Unknown = 0,
340        /// Cluster is alive and works well (\[Host.health\] of all hosts in the cluster is `ALIVE`).
341        Alive = 1,
342        /// Cluster is inoperable (\[Host.health\] of all hosts in the cluster is `DEAD`).
343        Dead = 2,
344        /// Cluster is in degraded state (\[Host.health\] of at least one of the hosts in the cluster is not `ALIVE`).
345        Degraded = 3,
346    }
347    impl Health {
348        /// String value of the enum field names used in the ProtoBuf definition.
349        ///
350        /// The values are not transformed in any way and thus are considered stable
351        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
352        pub fn as_str_name(&self) -> &'static str {
353            match self {
354                Health::Unknown => "HEALTH_UNKNOWN",
355                Health::Alive => "ALIVE",
356                Health::Dead => "DEAD",
357                Health::Degraded => "DEGRADED",
358            }
359        }
360        /// Creates an enum from field names used in the ProtoBuf definition.
361        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
362            match value {
363                "HEALTH_UNKNOWN" => Some(Self::Unknown),
364                "ALIVE" => Some(Self::Alive),
365                "DEAD" => Some(Self::Dead),
366                "DEGRADED" => Some(Self::Degraded),
367                _ => None,
368            }
369        }
370    }
371    #[derive(
372        Clone,
373        Copy,
374        Debug,
375        PartialEq,
376        Eq,
377        Hash,
378        PartialOrd,
379        Ord,
380        ::prost::Enumeration
381    )]
382    #[repr(i32)]
383    pub enum Status {
384        /// Cluster state is unknown.
385        Unknown = 0,
386        /// Cluster is being created.
387        Creating = 1,
388        /// Cluster is running normally.
389        Running = 2,
390        /// Cluster encountered a problem and cannot operate.
391        Error = 3,
392        /// Cluster is being updated.
393        Updating = 4,
394        /// Cluster is stopping.
395        Stopping = 5,
396        /// Cluster stopped.
397        Stopped = 6,
398        /// Cluster is starting.
399        Starting = 7,
400    }
401    impl Status {
402        /// String value of the enum field names used in the ProtoBuf definition.
403        ///
404        /// The values are not transformed in any way and thus are considered stable
405        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
406        pub fn as_str_name(&self) -> &'static str {
407            match self {
408                Status::Unknown => "STATUS_UNKNOWN",
409                Status::Creating => "CREATING",
410                Status::Running => "RUNNING",
411                Status::Error => "ERROR",
412                Status::Updating => "UPDATING",
413                Status::Stopping => "STOPPING",
414                Status::Stopped => "STOPPED",
415                Status::Starting => "STARTING",
416            }
417        }
418        /// Creates an enum from field names used in the ProtoBuf definition.
419        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
420            match value {
421                "STATUS_UNKNOWN" => Some(Self::Unknown),
422                "CREATING" => Some(Self::Creating),
423                "RUNNING" => Some(Self::Running),
424                "ERROR" => Some(Self::Error),
425                "UPDATING" => Some(Self::Updating),
426                "STOPPING" => Some(Self::Stopping),
427                "STOPPED" => Some(Self::Stopped),
428                "STARTING" => Some(Self::Starting),
429                _ => None,
430            }
431        }
432    }
433}
434#[allow(clippy::derive_partial_eq_without_eq)]
435#[derive(Clone, PartialEq, ::prost::Message)]
436pub struct Monitoring {
437    /// Name of the monitoring system.
438    #[prost(string, tag = "1")]
439    pub name: ::prost::alloc::string::String,
440    /// Description of the monitoring system.
441    #[prost(string, tag = "2")]
442    pub description: ::prost::alloc::string::String,
443    /// Link to the monitoring system charts for the SQL Server cluster.
444    #[prost(string, tag = "3")]
445    pub link: ::prost::alloc::string::String,
446}
447#[allow(clippy::derive_partial_eq_without_eq)]
448#[derive(Clone, PartialEq, ::prost::Message)]
449pub struct ClusterConfig {
450    /// Version of the SQL Server.
451    #[prost(string, tag = "1")]
452    pub version: ::prost::alloc::string::String,
453    /// Resources allocated to SQL Server hosts.
454    #[prost(message, optional, tag = "3")]
455    pub resources: ::core::option::Option<Resources>,
456    /// Start time for the daily backup in UTC timezone.
457    ///
458    #[prost(message, optional, tag = "4")]
459    pub backup_window_start: ::core::option::Option<
460        super::super::super::super::super::google::r#type::TimeOfDay,
461    >,
462    /// Database access policy.
463    #[prost(message, optional, tag = "6")]
464    pub access: ::core::option::Option<Access>,
465    /// Secondary replicas connection mode
466    #[prost(enumeration = "cluster_config::SecondaryConnections", tag = "7")]
467    pub secondary_connections: i32,
468    /// Configuration of the SQL Server instances in the cluster.
469    #[prost(oneof = "cluster_config::SqlserverConfig", tags = "2, 5, 8, 9, 10, 11")]
470    pub sqlserver_config: ::core::option::Option<cluster_config::SqlserverConfig>,
471}
472/// Nested message and enum types in `ClusterConfig`.
473pub mod cluster_config {
474    #[derive(
475        Clone,
476        Copy,
477        Debug,
478        PartialEq,
479        Eq,
480        Hash,
481        PartialOrd,
482        Ord,
483        ::prost::Enumeration
484    )]
485    #[repr(i32)]
486    pub enum SecondaryConnections {
487        Unspecified = 0,
488        /// Connections to secondary replicas are prohibited
489        Off = 1,
490        /// Secondary replicas are read-only
491        ReadOnly = 2,
492    }
493    impl SecondaryConnections {
494        /// String value of the enum field names used in the ProtoBuf definition.
495        ///
496        /// The values are not transformed in any way and thus are considered stable
497        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
498        pub fn as_str_name(&self) -> &'static str {
499            match self {
500                SecondaryConnections::Unspecified => "SECONDARY_CONNECTIONS_UNSPECIFIED",
501                SecondaryConnections::Off => "SECONDARY_CONNECTIONS_OFF",
502                SecondaryConnections::ReadOnly => "SECONDARY_CONNECTIONS_READ_ONLY",
503            }
504        }
505        /// Creates an enum from field names used in the ProtoBuf definition.
506        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
507            match value {
508                "SECONDARY_CONNECTIONS_UNSPECIFIED" => Some(Self::Unspecified),
509                "SECONDARY_CONNECTIONS_OFF" => Some(Self::Off),
510                "SECONDARY_CONNECTIONS_READ_ONLY" => Some(Self::ReadOnly),
511                _ => None,
512            }
513        }
514    }
515    /// Configuration of the SQL Server instances in the cluster.
516    #[allow(clippy::derive_partial_eq_without_eq)]
517    #[derive(Clone, PartialEq, ::prost::Oneof)]
518    pub enum SqlserverConfig {
519        /// Configuration of the SQL Server 2016sp2 standard edition instance.
520        #[prost(message, tag = "2")]
521        SqlserverConfig2016sp2std(super::config::SqlServerConfigSet2016sp2std),
522        /// Configuration of the SQL Server 2016sp2 enterprise edition instance.
523        #[prost(message, tag = "5")]
524        SqlserverConfig2016sp2ent(super::config::SqlServerConfigSet2016sp2ent),
525        /// Configuration of the SQL Server 2017 standard edition instance.
526        #[prost(message, tag = "8")]
527        SqlserverConfig2017std(super::config::SqlServerConfigSet2017std),
528        /// Configuration of the SQL Server 2017 enterprise edition instance.
529        #[prost(message, tag = "9")]
530        SqlserverConfig2017ent(super::config::SqlServerConfigSet2017ent),
531        /// Configuration of the SQL Server 2019 standard edition instance.
532        #[prost(message, tag = "10")]
533        SqlserverConfig2019std(super::config::SqlServerConfigSet2019std),
534        /// Configuration of the SQL Server 2019 enterprise edition instance.
535        #[prost(message, tag = "11")]
536        SqlserverConfig2019ent(super::config::SqlServerConfigSet2019ent),
537    }
538}
539#[allow(clippy::derive_partial_eq_without_eq)]
540#[derive(Clone, PartialEq, ::prost::Message)]
541pub struct Host {
542    /// Name of the SQL Server host.
543    ///
544    /// The host name is assigned by Managed Service for SQL Server at the moment of creation and cannot be changed. 1-63 characters long.
545    ///
546    /// The name is unique across all database hosts that exist on the platform as it defines the FQDN of the host.
547    #[prost(string, tag = "1")]
548    pub name: ::prost::alloc::string::String,
549    /// ID of the SQL Server host.
550    ///
551    /// The ID is assigned by Managed Service for SQL Server at the moment of creation.
552    #[prost(string, tag = "2")]
553    pub cluster_id: ::prost::alloc::string::String,
554    /// ID of the availability zone where the SQL Server host resides.
555    #[prost(string, tag = "3")]
556    pub zone_id: ::prost::alloc::string::String,
557    /// Resources allocated to the host.
558    #[prost(message, optional, tag = "4")]
559    pub resources: ::core::option::Option<Resources>,
560    /// Role of the host in the cluster.
561    #[prost(enumeration = "host::Role", tag = "5")]
562    pub role: i32,
563    /// Status code of the aggregated health of the host.
564    #[prost(enumeration = "host::Health", tag = "6")]
565    pub health: i32,
566    /// Services provided by the host.
567    #[prost(message, repeated, tag = "7")]
568    pub services: ::prost::alloc::vec::Vec<Service>,
569    /// ID of the subnet that the host belongs to.
570    #[prost(string, tag = "8")]
571    pub subnet_id: ::prost::alloc::string::String,
572    /// Flag showing public IP assignment status to this host.
573    #[prost(bool, tag = "9")]
574    pub assign_public_ip: bool,
575}
576/// Nested message and enum types in `Host`.
577pub mod host {
578    #[derive(
579        Clone,
580        Copy,
581        Debug,
582        PartialEq,
583        Eq,
584        Hash,
585        PartialOrd,
586        Ord,
587        ::prost::Enumeration
588    )]
589    #[repr(i32)]
590    pub enum Role {
591        /// Role of the host in the cluster is unknown.
592        Unknown = 0,
593        /// Host is the master SQL Server instance in the cluster.
594        Master = 1,
595        /// Host is a replica SQL Server instance in the cluster.
596        Replica = 2,
597    }
598    impl Role {
599        /// String value of the enum field names used in the ProtoBuf definition.
600        ///
601        /// The values are not transformed in any way and thus are considered stable
602        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
603        pub fn as_str_name(&self) -> &'static str {
604            match self {
605                Role::Unknown => "ROLE_UNKNOWN",
606                Role::Master => "MASTER",
607                Role::Replica => "REPLICA",
608            }
609        }
610        /// Creates an enum from field names used in the ProtoBuf definition.
611        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
612            match value {
613                "ROLE_UNKNOWN" => Some(Self::Unknown),
614                "MASTER" => Some(Self::Master),
615                "REPLICA" => Some(Self::Replica),
616                _ => None,
617            }
618        }
619    }
620    #[derive(
621        Clone,
622        Copy,
623        Debug,
624        PartialEq,
625        Eq,
626        Hash,
627        PartialOrd,
628        Ord,
629        ::prost::Enumeration
630    )]
631    #[repr(i32)]
632    pub enum Health {
633        /// Health of the host is unknown.
634        Unknown = 0,
635        /// The host is performing all its functions normally.
636        Alive = 1,
637        /// The host is inoperable and cannot perform any of its essential functions.
638        Dead = 2,
639        /// The host is degraded and can perform only some of its essential functions.
640        Degraded = 3,
641    }
642    impl Health {
643        /// String value of the enum field names used in the ProtoBuf definition.
644        ///
645        /// The values are not transformed in any way and thus are considered stable
646        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
647        pub fn as_str_name(&self) -> &'static str {
648            match self {
649                Health::Unknown => "HEALTH_UNKNOWN",
650                Health::Alive => "ALIVE",
651                Health::Dead => "DEAD",
652                Health::Degraded => "DEGRADED",
653            }
654        }
655        /// Creates an enum from field names used in the ProtoBuf definition.
656        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
657            match value {
658                "HEALTH_UNKNOWN" => Some(Self::Unknown),
659                "ALIVE" => Some(Self::Alive),
660                "DEAD" => Some(Self::Dead),
661                "DEGRADED" => Some(Self::Degraded),
662                _ => None,
663            }
664        }
665    }
666}
667#[allow(clippy::derive_partial_eq_without_eq)]
668#[derive(Clone, PartialEq, ::prost::Message)]
669pub struct Service {
670    /// Type of the service provided by the host.
671    #[prost(enumeration = "service::Type", tag = "1")]
672    pub r#type: i32,
673    /// Status code of server availability.
674    #[prost(enumeration = "service::Health", tag = "2")]
675    pub health: i32,
676}
677/// Nested message and enum types in `Service`.
678pub mod service {
679    #[derive(
680        Clone,
681        Copy,
682        Debug,
683        PartialEq,
684        Eq,
685        Hash,
686        PartialOrd,
687        Ord,
688        ::prost::Enumeration
689    )]
690    #[repr(i32)]
691    pub enum Type {
692        Unspecified = 0,
693        /// SQL Server service.
694        Sqlserver = 1,
695    }
696    impl Type {
697        /// String value of the enum field names used in the ProtoBuf definition.
698        ///
699        /// The values are not transformed in any way and thus are considered stable
700        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
701        pub fn as_str_name(&self) -> &'static str {
702            match self {
703                Type::Unspecified => "TYPE_UNSPECIFIED",
704                Type::Sqlserver => "SQLSERVER",
705            }
706        }
707        /// Creates an enum from field names used in the ProtoBuf definition.
708        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
709            match value {
710                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
711                "SQLSERVER" => Some(Self::Sqlserver),
712                _ => None,
713            }
714        }
715    }
716    #[derive(
717        Clone,
718        Copy,
719        Debug,
720        PartialEq,
721        Eq,
722        Hash,
723        PartialOrd,
724        Ord,
725        ::prost::Enumeration
726    )]
727    #[repr(i32)]
728    pub enum Health {
729        /// Health of the server is unknown.
730        Unknown = 0,
731        /// The server is working normally.
732        Alive = 1,
733        /// The server is dead or unresponsive.
734        Dead = 2,
735    }
736    impl Health {
737        /// String value of the enum field names used in the ProtoBuf definition.
738        ///
739        /// The values are not transformed in any way and thus are considered stable
740        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
741        pub fn as_str_name(&self) -> &'static str {
742            match self {
743                Health::Unknown => "HEALTH_UNKNOWN",
744                Health::Alive => "ALIVE",
745                Health::Dead => "DEAD",
746            }
747        }
748        /// Creates an enum from field names used in the ProtoBuf definition.
749        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
750            match value {
751                "HEALTH_UNKNOWN" => Some(Self::Unknown),
752                "ALIVE" => Some(Self::Alive),
753                "DEAD" => Some(Self::Dead),
754                _ => None,
755            }
756        }
757    }
758}
759#[allow(clippy::derive_partial_eq_without_eq)]
760#[derive(Clone, PartialEq, ::prost::Message)]
761pub struct Resources {
762    /// ID of the preset for computational resources available to a host (CPU, memory, etc.).
763    ///
764    /// All available presets are listed in the \[documentation\](/docs/managed-sqlserver/concepts/instance-types).
765    #[prost(string, tag = "1")]
766    pub resource_preset_id: ::prost::alloc::string::String,
767    /// Volume of the storage available to a host.
768    #[prost(int64, tag = "2")]
769    pub disk_size: i64,
770    /// Type of the storage environment for the host.
771    ///
772    /// Possible values:
773    /// * `network-hdd` - network HDD drive;
774    /// * `network-ssd` - network SSD drive;
775    /// * `local-ssd` - local SSD storage.
776    #[prost(string, tag = "3")]
777    pub disk_type_id: ::prost::alloc::string::String,
778}
779#[allow(clippy::derive_partial_eq_without_eq)]
780#[derive(Clone, PartialEq, ::prost::Message)]
781pub struct Access {
782    /// Allows access for DataLens.
783    #[prost(bool, tag = "1")]
784    pub data_lens: bool,
785    /// Allows access for Web SQL.
786    #[prost(bool, tag = "2")]
787    pub web_sql: bool,
788}
789/// An SQL Server database.
790///
791/// For more information, see the \[Concepts\](/docs/managed-sqlserver/concepts) section of the documentation.
792#[allow(clippy::derive_partial_eq_without_eq)]
793#[derive(Clone, PartialEq, ::prost::Message)]
794pub struct Database {
795    /// Name of the database.
796    #[prost(string, tag = "1")]
797    pub name: ::prost::alloc::string::String,
798    /// ID of the SQL Server cluster that the database belongs to.
799    #[prost(string, tag = "2")]
800    pub cluster_id: ::prost::alloc::string::String,
801}
802#[allow(clippy::derive_partial_eq_without_eq)]
803#[derive(Clone, PartialEq, ::prost::Message)]
804pub struct DatabaseSpec {
805    /// Name of the database.
806    #[prost(string, tag = "1")]
807    pub name: ::prost::alloc::string::String,
808}
809/// An SQL Server user.
810#[allow(clippy::derive_partial_eq_without_eq)]
811#[derive(Clone, PartialEq, ::prost::Message)]
812pub struct User {
813    /// Name of the SQL Server user.
814    #[prost(string, tag = "1")]
815    pub name: ::prost::alloc::string::String,
816    /// ID of the SQL Server cluster the user belongs to.
817    #[prost(string, tag = "2")]
818    pub cluster_id: ::prost::alloc::string::String,
819    /// Set of permissions granted to the user.
820    #[prost(message, repeated, tag = "3")]
821    pub permissions: ::prost::alloc::vec::Vec<Permission>,
822    /// Set of server roles granted to the login.
823    #[prost(enumeration = "ServerRole", repeated, tag = "4")]
824    pub server_roles: ::prost::alloc::vec::Vec<i32>,
825}
826#[allow(clippy::derive_partial_eq_without_eq)]
827#[derive(Clone, PartialEq, ::prost::Message)]
828pub struct Permission {
829    /// Name of the database the permission grants access to.
830    #[prost(string, tag = "1")]
831    pub database_name: ::prost::alloc::string::String,
832    /// Roles granted to the user within the database.
833    #[prost(enumeration = "permission::Role", repeated, packed = "false", tag = "2")]
834    pub roles: ::prost::alloc::vec::Vec<i32>,
835}
836/// Nested message and enum types in `Permission`.
837pub mod permission {
838    /// Role granted to the user within the database.
839    #[derive(
840        Clone,
841        Copy,
842        Debug,
843        PartialEq,
844        Eq,
845        Hash,
846        PartialOrd,
847        Ord,
848        ::prost::Enumeration
849    )]
850    #[repr(i32)]
851    pub enum Role {
852        Unspecified = 0,
853        /// Members of this fixed database role can perform all configuration and maintenance activities on a database and can also drop a database in SQL Server.
854        DbOwner = 1,
855        /// Members of this fixed database role can modify role membership for custom roles only and manage permissions. They can potentially elevate their privileges and their actions should be monitored.
856        DbSecurityadmin = 2,
857        /// Members of this fixed database role can add or remove access to a database for Windows logins, Windows groups, and SQL Server logins.
858        DbAccessadmin = 3,
859        /// Members of this fixed database role can back up the database.
860        DbBackupoperator = 4,
861        /// Members of this fixed database role can run any Data Definition Language (DDL) command in a database.
862        DbDdladmin = 5,
863        /// Members of this fixed database role can add, delete, or change data in all user tables.
864        DbDatawriter = 6,
865        /// Members of this fixed database role can read all data from all user tables.
866        DbDatareader = 7,
867        /// Members of this fixed database role cannot add, modify, or delete any data in the user tables within a database. A denial has a higher priority than a grant, so you can use this role to quickly restrict one's privileges without explicitly revoking permissions or roles.
868        DbDenydatawriter = 8,
869        /// Members of this fixed database role cannot read any data in the user tables within a database. A denial has a higher priority than a grant, so you can use this role to quickly restrict one's privileges without explicitly revoking permissions or roles.
870        DbDenydatareader = 9,
871    }
872    impl Role {
873        /// String value of the enum field names used in the ProtoBuf definition.
874        ///
875        /// The values are not transformed in any way and thus are considered stable
876        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
877        pub fn as_str_name(&self) -> &'static str {
878            match self {
879                Role::Unspecified => "ROLE_UNSPECIFIED",
880                Role::DbOwner => "DB_OWNER",
881                Role::DbSecurityadmin => "DB_SECURITYADMIN",
882                Role::DbAccessadmin => "DB_ACCESSADMIN",
883                Role::DbBackupoperator => "DB_BACKUPOPERATOR",
884                Role::DbDdladmin => "DB_DDLADMIN",
885                Role::DbDatawriter => "DB_DATAWRITER",
886                Role::DbDatareader => "DB_DATAREADER",
887                Role::DbDenydatawriter => "DB_DENYDATAWRITER",
888                Role::DbDenydatareader => "DB_DENYDATAREADER",
889            }
890        }
891        /// Creates an enum from field names used in the ProtoBuf definition.
892        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
893            match value {
894                "ROLE_UNSPECIFIED" => Some(Self::Unspecified),
895                "DB_OWNER" => Some(Self::DbOwner),
896                "DB_SECURITYADMIN" => Some(Self::DbSecurityadmin),
897                "DB_ACCESSADMIN" => Some(Self::DbAccessadmin),
898                "DB_BACKUPOPERATOR" => Some(Self::DbBackupoperator),
899                "DB_DDLADMIN" => Some(Self::DbDdladmin),
900                "DB_DATAWRITER" => Some(Self::DbDatawriter),
901                "DB_DATAREADER" => Some(Self::DbDatareader),
902                "DB_DENYDATAWRITER" => Some(Self::DbDenydatawriter),
903                "DB_DENYDATAREADER" => Some(Self::DbDenydatareader),
904                _ => None,
905            }
906        }
907    }
908}
909#[allow(clippy::derive_partial_eq_without_eq)]
910#[derive(Clone, PartialEq, ::prost::Message)]
911pub struct UserSpec {
912    /// Name of the SQL Server user.
913    #[prost(string, tag = "1")]
914    pub name: ::prost::alloc::string::String,
915    /// Password of the SQL Server user.
916    #[prost(string, tag = "2")]
917    pub password: ::prost::alloc::string::String,
918    /// Set of permissions to grant to the user.
919    #[prost(message, repeated, tag = "3")]
920    pub permissions: ::prost::alloc::vec::Vec<Permission>,
921    /// Set of server roles.
922    #[prost(enumeration = "ServerRole", repeated, tag = "4")]
923    pub server_roles: ::prost::alloc::vec::Vec<i32>,
924}
925/// Set of server roles.
926#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
927#[repr(i32)]
928pub enum ServerRole {
929    Unspecified = 0,
930    /// Effectively grants VIEW SERVER STATE to the login.
931    ///
932    /// That gives an ability to use various dynamic management views to monitor server state, including Activity Monitor tool that is built-in into SSMS.
933    ///
934    /// No intrusive actions are allowed, so this is pretty safe to grant.
935    MdbMonitor = 1,
936}
937impl ServerRole {
938    /// String value of the enum field names used in the ProtoBuf definition.
939    ///
940    /// The values are not transformed in any way and thus are considered stable
941    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
942    pub fn as_str_name(&self) -> &'static str {
943        match self {
944            ServerRole::Unspecified => "SERVER_ROLE_UNSPECIFIED",
945            ServerRole::MdbMonitor => "MDB_MONITOR",
946        }
947    }
948    /// Creates an enum from field names used in the ProtoBuf definition.
949    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
950        match value {
951            "SERVER_ROLE_UNSPECIFIED" => Some(Self::Unspecified),
952            "MDB_MONITOR" => Some(Self::MdbMonitor),
953            _ => None,
954        }
955    }
956}
957#[allow(clippy::derive_partial_eq_without_eq)]
958#[derive(Clone, PartialEq, ::prost::Message)]
959pub struct GetClusterRequest {
960    /// ID of the SQL Server cluster to return.
961    ///
962    /// To get the cluster ID, use a \[ClusterService.List\] request.
963    #[prost(string, tag = "1")]
964    pub cluster_id: ::prost::alloc::string::String,
965}
966#[allow(clippy::derive_partial_eq_without_eq)]
967#[derive(Clone, PartialEq, ::prost::Message)]
968pub struct ListClustersRequest {
969    /// ID of the folder to list SQL Server clusters in.
970    ///
971    /// To get the folder ID, use a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
972    #[prost(string, tag = "1")]
973    pub folder_id: ::prost::alloc::string::String,
974    /// The maximum number of results per page to return.
975    ///
976    /// If the number of available results is larger than \[page_size\], the service returns a \[ListClustersResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
977    #[prost(int64, tag = "2")]
978    pub page_size: i64,
979    /// Page token. To get the next page of results, set \[page_token\] to the \[ListClustersResponse.next_page_token\] returned by the previous list request.
980    #[prost(string, tag = "3")]
981    pub page_token: ::prost::alloc::string::String,
982    /// A filter expression that filters resources listed in the response.
983    ///
984    /// The expression must specify:
985    ///
986    /// 1. A field name to filter by. Currently you can only use filtering with the \[Cluster.name\] field.
987    /// 2. A conditional operator. Can be either `=` or `!=` for single values, `IN` or `NOT IN` for lists of values.
988    /// 3. A value. Must be 1-63 characters long and match the regular expression `\[a-zA-Z0-9_-\]+`.
989    ///
990    /// Example of a filter expression: `name NOT IN 'test,beta'`.
991    ///
992    #[prost(string, tag = "4")]
993    pub filter: ::prost::alloc::string::String,
994}
995#[allow(clippy::derive_partial_eq_without_eq)]
996#[derive(Clone, PartialEq, ::prost::Message)]
997pub struct ListClustersResponse {
998    /// List of SQL Server clusters.
999    #[prost(message, repeated, tag = "1")]
1000    pub clusters: ::prost::alloc::vec::Vec<Cluster>,
1001    /// Token that allows you to get the next page of results for list requests.
1002    ///
1003    /// If the number of results is larger than \[ListClustersRequest.page_size\], use the `next_page_token` as the value for the \[ListClustersRequest.page_token\] parameter in the next list request. Each subsequent list request has its own `next_page_token` to continue paging through the results.
1004    #[prost(string, tag = "2")]
1005    pub next_page_token: ::prost::alloc::string::String,
1006}
1007#[allow(clippy::derive_partial_eq_without_eq)]
1008#[derive(Clone, PartialEq, ::prost::Message)]
1009pub struct CreateClusterRequest {
1010    /// ID of the folder to create the SQL Server cluster in.
1011    ///
1012    /// To get the folder ID, use a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
1013    #[prost(string, tag = "1")]
1014    pub folder_id: ::prost::alloc::string::String,
1015    /// Name of the SQL Server cluster. The name must be unique within the folder.
1016    #[prost(string, tag = "2")]
1017    pub name: ::prost::alloc::string::String,
1018    /// Description of the SQL Server cluster.
1019    #[prost(string, tag = "3")]
1020    pub description: ::prost::alloc::string::String,
1021    /// Custom labels for the SQL Server cluster as `key:value` pairs.
1022    /// For example, "project":"mvp" or "source":"dictionary".
1023    #[prost(map = "string, string", tag = "4")]
1024    pub labels: ::std::collections::HashMap<
1025        ::prost::alloc::string::String,
1026        ::prost::alloc::string::String,
1027    >,
1028    /// Deployment environment of the SQL Server cluster.
1029    #[prost(enumeration = "cluster::Environment", tag = "5")]
1030    pub environment: i32,
1031    /// Configurations of SQL Server and hosts of the cluster.
1032    #[prost(message, optional, tag = "6")]
1033    pub config_spec: ::core::option::Option<ConfigSpec>,
1034    /// One or more configurations of databases to be created in the SQL Server cluster.
1035    #[prost(message, repeated, tag = "7")]
1036    pub database_specs: ::prost::alloc::vec::Vec<DatabaseSpec>,
1037    /// One or more configurations of database users to be created in the SQL Server cluster.
1038    #[prost(message, repeated, tag = "8")]
1039    pub user_specs: ::prost::alloc::vec::Vec<UserSpec>,
1040    /// One or more configurations of hosts to be created in the SQL Server cluster.
1041    #[prost(message, repeated, tag = "9")]
1042    pub host_specs: ::prost::alloc::vec::Vec<HostSpec>,
1043    /// ID of the network to create the SQL Server cluster in.
1044    #[prost(string, tag = "10")]
1045    pub network_id: ::prost::alloc::string::String,
1046    /// User security groups.
1047    #[prost(string, repeated, tag = "11")]
1048    pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1049    /// Determines whether the cluster is protected from being deleted.
1050    #[prost(bool, tag = "12")]
1051    pub deletion_protection: bool,
1052    /// Name of SQL Collation that cluster will be created with.
1053    #[prost(string, tag = "13")]
1054    pub sqlcollation: ::prost::alloc::string::String,
1055    /// Host groups hosting VMs of the cluster.
1056    #[prost(string, repeated, tag = "14")]
1057    pub host_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1058    /// ID of the service account used for access to Object Storage.
1059    #[prost(string, tag = "15")]
1060    pub service_account_id: ::prost::alloc::string::String,
1061}
1062#[allow(clippy::derive_partial_eq_without_eq)]
1063#[derive(Clone, PartialEq, ::prost::Message)]
1064pub struct CreateClusterMetadata {
1065    /// ID of the SQL Server cluster being created.
1066    #[prost(string, tag = "1")]
1067    pub cluster_id: ::prost::alloc::string::String,
1068}
1069#[allow(clippy::derive_partial_eq_without_eq)]
1070#[derive(Clone, PartialEq, ::prost::Message)]
1071pub struct UpdateClusterRequest {
1072    /// ID of the SQL Server cluster to update.
1073    ///
1074    /// To get the SQL Server cluster ID, use a \[ClusterService.List\] request.
1075    #[prost(string, tag = "1")]
1076    pub cluster_id: ::prost::alloc::string::String,
1077    /// Field mask that specifies which fields of the SQL Server cluster should be updated.
1078    #[prost(message, optional, tag = "2")]
1079    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
1080    /// New description of the SQL Server cluster.
1081    #[prost(string, tag = "3")]
1082    pub description: ::prost::alloc::string::String,
1083    /// Custom labels for the SQL Server cluster as `key:value` pairs.
1084    ///
1085    /// For example, `"project":"mvp"` or `"source":"dictionary"`.
1086    ///
1087    /// The new set of labels completely replaces the old one.
1088    ///
1089    /// To add a label, request the current set with the \[ClusterService.Get\] method, then send an \[ClusterService.Update\] request with the new label added to the set.
1090    #[prost(map = "string, string", tag = "4")]
1091    pub labels: ::std::collections::HashMap<
1092        ::prost::alloc::string::String,
1093        ::prost::alloc::string::String,
1094    >,
1095    /// New configuration and resources for hosts in the SQL Server cluster.
1096    #[prost(message, optional, tag = "5")]
1097    pub config_spec: ::core::option::Option<ConfigSpec>,
1098    /// New name for the SQL Server cluster.
1099    #[prost(string, tag = "6")]
1100    pub name: ::prost::alloc::string::String,
1101    /// User security groups.
1102    #[prost(string, repeated, tag = "7")]
1103    pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1104    /// Determines whether the cluster is protected from being deleted.
1105    #[prost(bool, tag = "8")]
1106    pub deletion_protection: bool,
1107    /// ID of the service account used for access to Object Storage.
1108    #[prost(string, tag = "9")]
1109    pub service_account_id: ::prost::alloc::string::String,
1110}
1111#[allow(clippy::derive_partial_eq_without_eq)]
1112#[derive(Clone, PartialEq, ::prost::Message)]
1113pub struct UpdateClusterMetadata {
1114    /// ID of the SQL Server cluster being updated.
1115    #[prost(string, tag = "1")]
1116    pub cluster_id: ::prost::alloc::string::String,
1117}
1118#[allow(clippy::derive_partial_eq_without_eq)]
1119#[derive(Clone, PartialEq, ::prost::Message)]
1120pub struct DeleteClusterRequest {
1121    /// ID of the SQL Server cluster to delete.
1122    ///
1123    /// To get the SQL Server cluster ID, use a \[ClusterService.List\] request.
1124    #[prost(string, tag = "1")]
1125    pub cluster_id: ::prost::alloc::string::String,
1126}
1127#[allow(clippy::derive_partial_eq_without_eq)]
1128#[derive(Clone, PartialEq, ::prost::Message)]
1129pub struct DeleteClusterMetadata {
1130    /// ID of the SQL Server cluster being deleted.
1131    #[prost(string, tag = "1")]
1132    pub cluster_id: ::prost::alloc::string::String,
1133}
1134#[allow(clippy::derive_partial_eq_without_eq)]
1135#[derive(Clone, PartialEq, ::prost::Message)]
1136pub struct BackupClusterRequest {
1137    /// ID of the SQL Server cluster to back up.
1138    ///
1139    /// To get the SQL Server cluster ID, use a \[ClusterService.List\] request.
1140    #[prost(string, tag = "1")]
1141    pub cluster_id: ::prost::alloc::string::String,
1142}
1143#[allow(clippy::derive_partial_eq_without_eq)]
1144#[derive(Clone, PartialEq, ::prost::Message)]
1145pub struct BackupClusterMetadata {
1146    /// ID of the SQL Server cluster being backed up.
1147    #[prost(string, tag = "1")]
1148    pub cluster_id: ::prost::alloc::string::String,
1149}
1150#[allow(clippy::derive_partial_eq_without_eq)]
1151#[derive(Clone, PartialEq, ::prost::Message)]
1152pub struct RestoreClusterRequest {
1153    /// ID of the backup to create a new cluster from.
1154    ///
1155    /// To get the backup ID, use a \[ClusterService.ListBackups\] request.
1156    #[prost(string, tag = "1")]
1157    pub backup_id: ::prost::alloc::string::String,
1158    /// Timestamp of the moment to which the SQL Server cluster should be restored.
1159    #[prost(message, optional, tag = "2")]
1160    pub time: ::core::option::Option<::prost_types::Timestamp>,
1161    /// Name of the new SQL Server cluster to be created from the backup. The name must be unique within the folder.
1162    #[prost(string, tag = "4")]
1163    pub name: ::prost::alloc::string::String,
1164    /// Description of the new SQL Server cluster to be created from the backup.
1165    #[prost(string, tag = "5")]
1166    pub description: ::prost::alloc::string::String,
1167    /// Custom labels for the new SQL Server cluster to be created from the backup as `key:value` pairs.
1168    ///
1169    /// For example, `"project":"mvp"` or `"source":"dictionary"`.
1170    #[prost(map = "string, string", tag = "6")]
1171    pub labels: ::std::collections::HashMap<
1172        ::prost::alloc::string::String,
1173        ::prost::alloc::string::String,
1174    >,
1175    /// Deployment environment of the new SQL Server cluster to be created from the backup.
1176    #[prost(enumeration = "cluster::Environment", tag = "7")]
1177    pub environment: i32,
1178    /// Configuration for the new SQL Server cluster to be created from the backup.
1179    #[prost(message, optional, tag = "8")]
1180    pub config_spec: ::core::option::Option<ConfigSpec>,
1181    /// Configurations for SQL Server hosts that should be added to the cluster being created from the backup.
1182    #[prost(message, repeated, tag = "9")]
1183    pub host_specs: ::prost::alloc::vec::Vec<HostSpec>,
1184    /// ID of the network to create the SQL Server cluster in.
1185    #[prost(string, tag = "10")]
1186    pub network_id: ::prost::alloc::string::String,
1187    /// ID of the folder to create the SQL Server cluster in.
1188    ///
1189    /// To get the folder ID, use a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
1190    #[prost(string, tag = "11")]
1191    pub folder_id: ::prost::alloc::string::String,
1192    /// User security groups.
1193    #[prost(string, repeated, tag = "12")]
1194    pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1195    /// Determines whether the cluster is protected from being deleted.
1196    #[prost(bool, tag = "13")]
1197    pub deletion_protection: bool,
1198    /// Host groups hosting VMs of the cluster.
1199    #[prost(string, repeated, tag = "14")]
1200    pub host_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1201    /// ID of the service account used for access to Object Storage.
1202    #[prost(string, tag = "15")]
1203    pub service_account_id: ::prost::alloc::string::String,
1204}
1205#[allow(clippy::derive_partial_eq_without_eq)]
1206#[derive(Clone, PartialEq, ::prost::Message)]
1207pub struct RestoreClusterMetadata {
1208    /// ID of the new SQL Server cluster being created from a backup.
1209    #[prost(string, tag = "1")]
1210    pub cluster_id: ::prost::alloc::string::String,
1211    /// ID of the backup being used for creating a cluster.
1212    #[prost(string, tag = "2")]
1213    pub backup_id: ::prost::alloc::string::String,
1214}
1215#[allow(clippy::derive_partial_eq_without_eq)]
1216#[derive(Clone, PartialEq, ::prost::Message)]
1217pub struct StartClusterFailoverRequest {
1218    /// ID of SQL Server cluster.
1219    #[prost(string, tag = "1")]
1220    pub cluster_id: ::prost::alloc::string::String,
1221    /// Host name to switch master role to.
1222    ///
1223    /// To get this name, make a \[ClusterService.ListHosts\] request.
1224    #[prost(string, tag = "2")]
1225    pub host_name: ::prost::alloc::string::String,
1226}
1227#[allow(clippy::derive_partial_eq_without_eq)]
1228#[derive(Clone, PartialEq, ::prost::Message)]
1229pub struct StartClusterFailoverMetadata {
1230    /// ID of the SQL Server cluster being failovered.
1231    #[prost(string, tag = "1")]
1232    pub cluster_id: ::prost::alloc::string::String,
1233}
1234#[allow(clippy::derive_partial_eq_without_eq)]
1235#[derive(Clone, PartialEq, ::prost::Message)]
1236pub struct LogRecord {
1237    /// Log record timestamp.
1238    #[prost(message, optional, tag = "1")]
1239    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1240    /// Contents of the log record.
1241    #[prost(map = "string, string", tag = "2")]
1242    pub message: ::std::collections::HashMap<
1243        ::prost::alloc::string::String,
1244        ::prost::alloc::string::String,
1245    >,
1246}
1247#[allow(clippy::derive_partial_eq_without_eq)]
1248#[derive(Clone, PartialEq, ::prost::Message)]
1249pub struct ListClusterLogsRequest {
1250    /// ID of the SQL Server cluster to request logs for.
1251    ///
1252    /// To get the SQL Server cluster ID, use a \[ClusterService.List\] request.
1253    #[prost(string, tag = "1")]
1254    pub cluster_id: ::prost::alloc::string::String,
1255    /// Columns from the logs table to request.
1256    ///
1257    /// If no columns are specified, entire log records are returned.
1258    #[prost(string, repeated, tag = "2")]
1259    pub column_filter: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1260    /// Type of the service to request logs about.
1261    ///
1262    #[prost(enumeration = "list_cluster_logs_request::ServiceType", tag = "3")]
1263    pub service_type: i32,
1264    /// Specifies a moment that the logs are requested from.
1265    #[prost(message, optional, tag = "4")]
1266    pub from_time: ::core::option::Option<::prost_types::Timestamp>,
1267    /// Specifies a moment that the logs are requested till.
1268    #[prost(message, optional, tag = "5")]
1269    pub to_time: ::core::option::Option<::prost_types::Timestamp>,
1270    /// The maximum number of results per page to return.
1271    ///
1272    /// If the number of available results is larger than \[page_size\], the service returns a \[ListClusterLogsResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
1273    #[prost(int64, tag = "6")]
1274    pub page_size: i64,
1275    /// Page token. To get the next page of results, set \[page_token\] to the \[ListClusterLogsResponse.next_page_token\] returned by the previous list request.
1276    #[prost(string, tag = "7")]
1277    pub page_token: ::prost::alloc::string::String,
1278    /// The service returns \[next_page_token\] even if the current page is empty.
1279    #[prost(bool, tag = "8")]
1280    pub always_next_page_token: bool,
1281    /// A filter expression that filters resources listed in the response.
1282    ///
1283    /// The expression must specify:
1284    ///
1285    /// 1. A field name to filter by. Currently filtering can be applied to the \[LogRecord.logs.message.hostname\] field only.
1286    /// 2. A conditional operator. Can be either `=` or `!=` for single values, `IN` or `NOT IN` for lists of values.
1287    /// 3. A value. Must be 1-63 characters long and match the regular expression `\[a-z0-9.-\]{1,61}`.
1288    ///
1289    /// Example of a filter: `message.hostname='node1.db.cloud.yandex.net'`.
1290    ///
1291    #[prost(string, tag = "9")]
1292    pub filter: ::prost::alloc::string::String,
1293}
1294/// Nested message and enum types in `ListClusterLogsRequest`.
1295pub mod list_cluster_logs_request {
1296    #[derive(
1297        Clone,
1298        Copy,
1299        Debug,
1300        PartialEq,
1301        Eq,
1302        Hash,
1303        PartialOrd,
1304        Ord,
1305        ::prost::Enumeration
1306    )]
1307    #[repr(i32)]
1308    pub enum ServiceType {
1309        Unspecified = 0,
1310        /// SQL Server error log.
1311        SqlserverError = 1,
1312        /// SQL Server application log.
1313        SqlserverApplication = 2,
1314    }
1315    impl ServiceType {
1316        /// String value of the enum field names used in the ProtoBuf definition.
1317        ///
1318        /// The values are not transformed in any way and thus are considered stable
1319        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1320        pub fn as_str_name(&self) -> &'static str {
1321            match self {
1322                ServiceType::Unspecified => "SERVICE_TYPE_UNSPECIFIED",
1323                ServiceType::SqlserverError => "SQLSERVER_ERROR",
1324                ServiceType::SqlserverApplication => "SQLSERVER_APPLICATION",
1325            }
1326        }
1327        /// Creates an enum from field names used in the ProtoBuf definition.
1328        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1329            match value {
1330                "SERVICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1331                "SQLSERVER_ERROR" => Some(Self::SqlserverError),
1332                "SQLSERVER_APPLICATION" => Some(Self::SqlserverApplication),
1333                _ => None,
1334            }
1335        }
1336    }
1337}
1338#[allow(clippy::derive_partial_eq_without_eq)]
1339#[derive(Clone, PartialEq, ::prost::Message)]
1340pub struct ListClusterLogsResponse {
1341    /// Requested log records.
1342    #[prost(message, repeated, tag = "1")]
1343    pub logs: ::prost::alloc::vec::Vec<LogRecord>,
1344    /// Token that allows you to get the next page of results for list requests.
1345    ///
1346    /// If the number of results is larger than \[ListClusterLogsRequest.page_size\], use the \[next_page_token\] as the value for the \[ListClusterLogsRequest.page_token\] query parameter in the next list request.
1347    ///
1348    /// Each subsequent list request has its own \[next_page_token\] to continue paging through the results.
1349    #[prost(string, tag = "2")]
1350    pub next_page_token: ::prost::alloc::string::String,
1351}
1352#[allow(clippy::derive_partial_eq_without_eq)]
1353#[derive(Clone, PartialEq, ::prost::Message)]
1354pub struct ListClusterOperationsRequest {
1355    /// ID of the SQL Server cluster to list operations for.
1356    ///
1357    /// To get the cluster ID, use a \[ClusterService.List\] request.
1358    #[prost(string, tag = "1")]
1359    pub cluster_id: ::prost::alloc::string::String,
1360    /// The maximum number of results per page to return.
1361    ///
1362    /// If the number of available results is larger than \[page_size\], the service returns a \[ListClusterOperationsResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
1363    #[prost(int64, tag = "2")]
1364    pub page_size: i64,
1365    /// Page token. To get the next page of results, set \[page_token\] to the \[ListClusterOperationsResponse.next_page_token\] returned by the previous list request.
1366    #[prost(string, tag = "3")]
1367    pub page_token: ::prost::alloc::string::String,
1368}
1369#[allow(clippy::derive_partial_eq_without_eq)]
1370#[derive(Clone, PartialEq, ::prost::Message)]
1371pub struct ListClusterOperationsResponse {
1372    /// List of operations for the specified SQL Server cluster.
1373    #[prost(message, repeated, tag = "1")]
1374    pub operations: ::prost::alloc::vec::Vec<super::super::super::operation::Operation>,
1375    /// Token that allows you to get the next page of results for list requests.
1376    ///
1377    /// If the number of results is larger than \[ListClusterOperationsRequest.page_size\], use the \[next_page_token\] as the value for the \[ListClusterOperationsRequest.page_token\] query parameter in the next list request.
1378    ///
1379    /// Each subsequent list request has its own \[next_page_token\] to continue paging through the results.
1380    #[prost(string, tag = "2")]
1381    pub next_page_token: ::prost::alloc::string::String,
1382}
1383#[allow(clippy::derive_partial_eq_without_eq)]
1384#[derive(Clone, PartialEq, ::prost::Message)]
1385pub struct ListClusterBackupsRequest {
1386    /// ID of the SQL Server cluster.
1387    ///
1388    /// To get the SQL Server cluster ID, use a \[ClusterService.List\] request.
1389    #[prost(string, tag = "1")]
1390    pub cluster_id: ::prost::alloc::string::String,
1391    /// The maximum number of results per page to return.
1392    ///
1393    /// If the number of available results is larger than \[page_size\], the service returns a \[ListClusterBackupsResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
1394    ///
1395    #[prost(int64, tag = "2")]
1396    pub page_size: i64,
1397    /// Page token. To get the next page of results, set \[page_token\] to the \[ListClusterBackupsResponse.next_page_token\] returned by the previous list request.
1398    ///
1399    #[prost(string, tag = "3")]
1400    pub page_token: ::prost::alloc::string::String,
1401}
1402#[allow(clippy::derive_partial_eq_without_eq)]
1403#[derive(Clone, PartialEq, ::prost::Message)]
1404pub struct ListClusterBackupsResponse {
1405    /// List of SQL Server backups.
1406    #[prost(message, repeated, tag = "1")]
1407    pub backups: ::prost::alloc::vec::Vec<Backup>,
1408    /// Token that allows you to get the next page of results for list requests.
1409    ///
1410    /// If the number of results is larger than \[ListClusterBackupsRequest.page_size\], use the \[next_page_token\] as the value for the \[ListClusterBackupsRequest.page_token\] query parameter in the next list request.
1411    ///
1412    /// Each subsequent list request has its own \[next_page_token\] to continue paging through the results.
1413    #[prost(string, tag = "2")]
1414    pub next_page_token: ::prost::alloc::string::String,
1415}
1416#[allow(clippy::derive_partial_eq_without_eq)]
1417#[derive(Clone, PartialEq, ::prost::Message)]
1418pub struct ListClusterHostsRequest {
1419    /// ID of the SQL Server cluster.
1420    ///
1421    /// To get the SQL Server cluster ID, use a \[ClusterService.List\] request.
1422    #[prost(string, tag = "1")]
1423    pub cluster_id: ::prost::alloc::string::String,
1424    /// The maximum number of results per page to return.
1425    ///
1426    /// If the number of available results is larger than \[page_size\], the service returns a \[ListClusterHostsResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
1427    ///
1428    #[prost(int64, tag = "2")]
1429    pub page_size: i64,
1430    /// Page token. To get the next page of results, set \[page_token\] to the \[ListClusterHostsResponse.next_page_token\] returned by the previous list request.
1431    ///
1432    #[prost(string, tag = "3")]
1433    pub page_token: ::prost::alloc::string::String,
1434}
1435#[allow(clippy::derive_partial_eq_without_eq)]
1436#[derive(Clone, PartialEq, ::prost::Message)]
1437pub struct ListClusterHostsResponse {
1438    /// List of SQL Server hosts.
1439    #[prost(message, repeated, tag = "1")]
1440    pub hosts: ::prost::alloc::vec::Vec<Host>,
1441    /// Token that allows you to get the next page of results for list requests.
1442    ///
1443    /// If the number of results is larger than \[ListClusterHostsRequest.page_size\], use the \[next_page_token\] as the value for the \[ListClusterHostsRequest.page_token\] query parameter in the next list request.
1444    ///
1445    /// Each subsequent list request has its own \[next_page_token\] to continue paging through the results.
1446    #[prost(string, tag = "2")]
1447    pub next_page_token: ::prost::alloc::string::String,
1448}
1449#[allow(clippy::derive_partial_eq_without_eq)]
1450#[derive(Clone, PartialEq, ::prost::Message)]
1451pub struct StartClusterRequest {
1452    /// ID of the SQL Server cluster to start.
1453    ///
1454    /// To get the cluster ID, use a \[ClusterService.List\] request.
1455    #[prost(string, tag = "1")]
1456    pub cluster_id: ::prost::alloc::string::String,
1457}
1458#[allow(clippy::derive_partial_eq_without_eq)]
1459#[derive(Clone, PartialEq, ::prost::Message)]
1460pub struct StartClusterMetadata {
1461    /// ID of the SQL Server cluster being started.
1462    #[prost(string, tag = "1")]
1463    pub cluster_id: ::prost::alloc::string::String,
1464}
1465#[allow(clippy::derive_partial_eq_without_eq)]
1466#[derive(Clone, PartialEq, ::prost::Message)]
1467pub struct StopClusterRequest {
1468    /// ID of the SQL Server cluster to stop.
1469    ///
1470    /// To get the cluster ID, use a \[ClusterService.List\] request.
1471    #[prost(string, tag = "1")]
1472    pub cluster_id: ::prost::alloc::string::String,
1473}
1474#[allow(clippy::derive_partial_eq_without_eq)]
1475#[derive(Clone, PartialEq, ::prost::Message)]
1476pub struct StopClusterMetadata {
1477    /// ID of the SQL Server cluster being stopped.
1478    #[prost(string, tag = "1")]
1479    pub cluster_id: ::prost::alloc::string::String,
1480}
1481#[allow(clippy::derive_partial_eq_without_eq)]
1482#[derive(Clone, PartialEq, ::prost::Message)]
1483pub struct MoveClusterRequest {
1484    /// ID of the SQL Server cluster to move.
1485    ///
1486    /// To get the cluster ID, use a \[ClusterService.List\] request.
1487    #[prost(string, tag = "1")]
1488    pub cluster_id: ::prost::alloc::string::String,
1489    /// ID of the destination folder.
1490    ///
1491    /// To get the folder ID, use a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
1492    #[prost(string, tag = "2")]
1493    pub destination_folder_id: ::prost::alloc::string::String,
1494}
1495#[allow(clippy::derive_partial_eq_without_eq)]
1496#[derive(Clone, PartialEq, ::prost::Message)]
1497pub struct MoveClusterMetadata {
1498    /// ID of the SQL Server cluster being moved.
1499    #[prost(string, tag = "1")]
1500    pub cluster_id: ::prost::alloc::string::String,
1501    /// ID of the source folder.
1502    #[prost(string, tag = "2")]
1503    pub source_folder_id: ::prost::alloc::string::String,
1504    /// ID of the destination folder.
1505    #[prost(string, tag = "3")]
1506    pub destination_folder_id: ::prost::alloc::string::String,
1507}
1508#[allow(clippy::derive_partial_eq_without_eq)]
1509#[derive(Clone, PartialEq, ::prost::Message)]
1510pub struct UpdateClusterHostsMetadata {
1511    /// ID of the SQL Server cluster to update hosts in.
1512    #[prost(string, tag = "1")]
1513    pub cluster_id: ::prost::alloc::string::String,
1514    /// Names of the hosts being updated.
1515    #[prost(string, repeated, tag = "2")]
1516    pub host_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1517}
1518#[allow(clippy::derive_partial_eq_without_eq)]
1519#[derive(Clone, PartialEq, ::prost::Message)]
1520pub struct HostSpec {
1521    /// ID of the availability zone where the host resides.
1522    ///
1523    /// To get the list of available zones, use the \[yandex.cloud.compute.v1.ZoneService.List\] request.
1524    ///
1525    #[prost(string, tag = "1")]
1526    pub zone_id: ::prost::alloc::string::String,
1527    /// ID of the subnet that the host should belong to. This subnet should be a part of the network that the cluster belongs to.
1528    ///
1529    /// The ID of the network is set in the field \[Cluster.network_id\].
1530    #[prost(string, tag = "2")]
1531    pub subnet_id: ::prost::alloc::string::String,
1532    /// Determines whether the host gets a public IP address on creation.
1533    ///
1534    /// After a host has been created, this setting cannot be changed. To remove an assigned public IP, or to assign a public IP to a host without one, recreate the host with \[assign_public_ip\] set as needed.
1535    ///
1536    /// Possible values:
1537    /// * `false` - do not assign a public IP to the host;
1538    /// * `true` - assign a public IP to the host.
1539    #[prost(bool, tag = "3")]
1540    pub assign_public_ip: bool,
1541}
1542#[allow(clippy::derive_partial_eq_without_eq)]
1543#[derive(Clone, PartialEq, ::prost::Message)]
1544pub struct UpdateHostSpec {
1545    /// Name of the host to update.
1546    ///
1547    /// To get the SQL Server host name, use a \[ClusterService.ListHosts\] request.
1548    #[prost(string, tag = "1")]
1549    pub host_name: ::prost::alloc::string::String,
1550    /// Field mask that specifies which fields of the SQL Server host should be updated.
1551    #[prost(message, optional, tag = "2")]
1552    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
1553    /// Determines whether the host gets a public IP address on creation.
1554    #[prost(bool, tag = "3")]
1555    pub assign_public_ip: bool,
1556}
1557#[allow(clippy::derive_partial_eq_without_eq)]
1558#[derive(Clone, PartialEq, ::prost::Message)]
1559pub struct UpdateClusterHostsRequest {
1560    /// ID of the SQL Server cluster to update hosts in.
1561    /// To get the SQL Server cluster ID, use a \[ClusterService.List\] request.
1562    #[prost(string, tag = "1")]
1563    pub cluster_id: ::prost::alloc::string::String,
1564    /// New configurations to apply to hosts.
1565    #[prost(message, repeated, tag = "2")]
1566    pub update_host_specs: ::prost::alloc::vec::Vec<UpdateHostSpec>,
1567}
1568#[allow(clippy::derive_partial_eq_without_eq)]
1569#[derive(Clone, PartialEq, ::prost::Message)]
1570pub struct ConfigSpec {
1571    /// Version of SQL Server used in the cluster.
1572    ///
1573    /// Possible values:
1574    /// * 2016sp2std,
1575    /// * 2016sp2ent,
1576    /// * 2017std,
1577    /// * 2017ent,
1578    /// * 2019std,
1579    /// * 2019ent.
1580    ///
1581    /// No formal validation, a list of supported versions should suffice.
1582    #[prost(string, tag = "1")]
1583    pub version: ::prost::alloc::string::String,
1584    /// Resources allocated to SQL Server hosts.
1585    #[prost(message, optional, tag = "3")]
1586    pub resources: ::core::option::Option<Resources>,
1587    /// Start time for the daily backup in UTC timezone.
1588    ///
1589    #[prost(message, optional, tag = "4")]
1590    pub backup_window_start: ::core::option::Option<
1591        super::super::super::super::super::google::r#type::TimeOfDay,
1592    >,
1593    /// Database access policy.
1594    #[prost(message, optional, tag = "6")]
1595    pub access: ::core::option::Option<Access>,
1596    /// Secondary replicas connection mode
1597    #[prost(enumeration = "cluster_config::SecondaryConnections", tag = "7")]
1598    pub secondary_connections: i32,
1599    /// Configuration of an SQL Server cluster.
1600    #[prost(oneof = "config_spec::SqlserverConfig", tags = "2, 5, 8, 9, 10, 11")]
1601    pub sqlserver_config: ::core::option::Option<config_spec::SqlserverConfig>,
1602}
1603/// Nested message and enum types in `ConfigSpec`.
1604pub mod config_spec {
1605    /// Configuration of an SQL Server cluster.
1606    #[allow(clippy::derive_partial_eq_without_eq)]
1607    #[derive(Clone, PartialEq, ::prost::Oneof)]
1608    pub enum SqlserverConfig {
1609        /// Configuration for an SQL Server 2016 SP2 Standard edition cluster.
1610        #[prost(message, tag = "2")]
1611        SqlserverConfig2016sp2std(super::config::SqlServerConfig2016sp2std),
1612        /// Configuration for an SQL Server 2016 SP2 Enterprise edition cluster.
1613        #[prost(message, tag = "5")]
1614        SqlserverConfig2016sp2ent(super::config::SqlServerConfig2016sp2ent),
1615        /// Configuration for an SQL Server 2017 Standard edition cluster.
1616        #[prost(message, tag = "8")]
1617        SqlserverConfig2017std(super::config::SqlServerConfig2017std),
1618        /// Configuration for an SQL Server 2017 Enterprise edition cluster.
1619        #[prost(message, tag = "9")]
1620        SqlserverConfig2017ent(super::config::SqlServerConfig2017ent),
1621        /// Configuration for an SQL Server 2019 Standard edition cluster.
1622        #[prost(message, tag = "10")]
1623        SqlserverConfig2019std(super::config::SqlServerConfig2019std),
1624        /// Configuration for an SQL Server 2019 Enterprise edition cluster.
1625        #[prost(message, tag = "11")]
1626        SqlserverConfig2019ent(super::config::SqlServerConfig2019ent),
1627    }
1628}
1629/// Generated client implementations.
1630pub mod cluster_service_client {
1631    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1632    use tonic::codegen::*;
1633    use tonic::codegen::http::Uri;
1634    /// A set of methods for managing SQL Server clusters.
1635    #[derive(Debug, Clone)]
1636    pub struct ClusterServiceClient<T> {
1637        inner: tonic::client::Grpc<T>,
1638    }
1639    impl ClusterServiceClient<tonic::transport::Channel> {
1640        /// Attempt to create a new client by connecting to a given endpoint.
1641        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1642        where
1643            D: TryInto<tonic::transport::Endpoint>,
1644            D::Error: Into<StdError>,
1645        {
1646            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1647            Ok(Self::new(conn))
1648        }
1649    }
1650    impl<T> ClusterServiceClient<T>
1651    where
1652        T: tonic::client::GrpcService<tonic::body::BoxBody>,
1653        T::Error: Into<StdError>,
1654        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
1655        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
1656    {
1657        pub fn new(inner: T) -> Self {
1658            let inner = tonic::client::Grpc::new(inner);
1659            Self { inner }
1660        }
1661        pub fn with_origin(inner: T, origin: Uri) -> Self {
1662            let inner = tonic::client::Grpc::with_origin(inner, origin);
1663            Self { inner }
1664        }
1665        pub fn with_interceptor<F>(
1666            inner: T,
1667            interceptor: F,
1668        ) -> ClusterServiceClient<InterceptedService<T, F>>
1669        where
1670            F: tonic::service::Interceptor,
1671            T::ResponseBody: Default,
1672            T: tonic::codegen::Service<
1673                http::Request<tonic::body::BoxBody>,
1674                Response = http::Response<
1675                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1676                >,
1677            >,
1678            <T as tonic::codegen::Service<
1679                http::Request<tonic::body::BoxBody>,
1680            >>::Error: Into<StdError> + Send + Sync,
1681        {
1682            ClusterServiceClient::new(InterceptedService::new(inner, interceptor))
1683        }
1684        /// Compress requests with the given encoding.
1685        ///
1686        /// This requires the server to support it otherwise it might respond with an
1687        /// error.
1688        #[must_use]
1689        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1690            self.inner = self.inner.send_compressed(encoding);
1691            self
1692        }
1693        /// Enable decompressing responses.
1694        #[must_use]
1695        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1696            self.inner = self.inner.accept_compressed(encoding);
1697            self
1698        }
1699        /// Limits the maximum size of a decoded message.
1700        ///
1701        /// Default: `4MB`
1702        #[must_use]
1703        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1704            self.inner = self.inner.max_decoding_message_size(limit);
1705            self
1706        }
1707        /// Limits the maximum size of an encoded message.
1708        ///
1709        /// Default: `usize::MAX`
1710        #[must_use]
1711        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1712            self.inner = self.inner.max_encoding_message_size(limit);
1713            self
1714        }
1715        /// Returns the specified SQL Server cluster.
1716        ///
1717        /// To get the list of available SQL Server clusters, make a [List] request.
1718        pub async fn get(
1719            &mut self,
1720            request: impl tonic::IntoRequest<super::GetClusterRequest>,
1721        ) -> std::result::Result<tonic::Response<super::Cluster>, tonic::Status> {
1722            self.inner
1723                .ready()
1724                .await
1725                .map_err(|e| {
1726                    tonic::Status::new(
1727                        tonic::Code::Unknown,
1728                        format!("Service was not ready: {}", e.into()),
1729                    )
1730                })?;
1731            let codec = tonic::codec::ProstCodec::default();
1732            let path = http::uri::PathAndQuery::from_static(
1733                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Get",
1734            );
1735            let mut req = request.into_request();
1736            req.extensions_mut()
1737                .insert(
1738                    GrpcMethod::new(
1739                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1740                        "Get",
1741                    ),
1742                );
1743            self.inner.unary(req, path, codec).await
1744        }
1745        /// Retrieves the list of SQL Server clusters that belong to the specified folder.
1746        pub async fn list(
1747            &mut self,
1748            request: impl tonic::IntoRequest<super::ListClustersRequest>,
1749        ) -> std::result::Result<
1750            tonic::Response<super::ListClustersResponse>,
1751            tonic::Status,
1752        > {
1753            self.inner
1754                .ready()
1755                .await
1756                .map_err(|e| {
1757                    tonic::Status::new(
1758                        tonic::Code::Unknown,
1759                        format!("Service was not ready: {}", e.into()),
1760                    )
1761                })?;
1762            let codec = tonic::codec::ProstCodec::default();
1763            let path = http::uri::PathAndQuery::from_static(
1764                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/List",
1765            );
1766            let mut req = request.into_request();
1767            req.extensions_mut()
1768                .insert(
1769                    GrpcMethod::new(
1770                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1771                        "List",
1772                    ),
1773                );
1774            self.inner.unary(req, path, codec).await
1775        }
1776        /// Creates an SQL Server cluster in the specified folder.
1777        pub async fn create(
1778            &mut self,
1779            request: impl tonic::IntoRequest<super::CreateClusterRequest>,
1780        ) -> std::result::Result<
1781            tonic::Response<super::super::super::super::operation::Operation>,
1782            tonic::Status,
1783        > {
1784            self.inner
1785                .ready()
1786                .await
1787                .map_err(|e| {
1788                    tonic::Status::new(
1789                        tonic::Code::Unknown,
1790                        format!("Service was not ready: {}", e.into()),
1791                    )
1792                })?;
1793            let codec = tonic::codec::ProstCodec::default();
1794            let path = http::uri::PathAndQuery::from_static(
1795                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Create",
1796            );
1797            let mut req = request.into_request();
1798            req.extensions_mut()
1799                .insert(
1800                    GrpcMethod::new(
1801                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1802                        "Create",
1803                    ),
1804                );
1805            self.inner.unary(req, path, codec).await
1806        }
1807        /// Modifies the specified SQL Server cluster.
1808        pub async fn update(
1809            &mut self,
1810            request: impl tonic::IntoRequest<super::UpdateClusterRequest>,
1811        ) -> std::result::Result<
1812            tonic::Response<super::super::super::super::operation::Operation>,
1813            tonic::Status,
1814        > {
1815            self.inner
1816                .ready()
1817                .await
1818                .map_err(|e| {
1819                    tonic::Status::new(
1820                        tonic::Code::Unknown,
1821                        format!("Service was not ready: {}", e.into()),
1822                    )
1823                })?;
1824            let codec = tonic::codec::ProstCodec::default();
1825            let path = http::uri::PathAndQuery::from_static(
1826                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Update",
1827            );
1828            let mut req = request.into_request();
1829            req.extensions_mut()
1830                .insert(
1831                    GrpcMethod::new(
1832                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1833                        "Update",
1834                    ),
1835                );
1836            self.inner.unary(req, path, codec).await
1837        }
1838        /// Deletes the specified SQL Server cluster.
1839        pub async fn delete(
1840            &mut self,
1841            request: impl tonic::IntoRequest<super::DeleteClusterRequest>,
1842        ) -> std::result::Result<
1843            tonic::Response<super::super::super::super::operation::Operation>,
1844            tonic::Status,
1845        > {
1846            self.inner
1847                .ready()
1848                .await
1849                .map_err(|e| {
1850                    tonic::Status::new(
1851                        tonic::Code::Unknown,
1852                        format!("Service was not ready: {}", e.into()),
1853                    )
1854                })?;
1855            let codec = tonic::codec::ProstCodec::default();
1856            let path = http::uri::PathAndQuery::from_static(
1857                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Delete",
1858            );
1859            let mut req = request.into_request();
1860            req.extensions_mut()
1861                .insert(
1862                    GrpcMethod::new(
1863                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1864                        "Delete",
1865                    ),
1866                );
1867            self.inner.unary(req, path, codec).await
1868        }
1869        /// Starts the specified SQL Server cluster.
1870        pub async fn start(
1871            &mut self,
1872            request: impl tonic::IntoRequest<super::StartClusterRequest>,
1873        ) -> std::result::Result<
1874            tonic::Response<super::super::super::super::operation::Operation>,
1875            tonic::Status,
1876        > {
1877            self.inner
1878                .ready()
1879                .await
1880                .map_err(|e| {
1881                    tonic::Status::new(
1882                        tonic::Code::Unknown,
1883                        format!("Service was not ready: {}", e.into()),
1884                    )
1885                })?;
1886            let codec = tonic::codec::ProstCodec::default();
1887            let path = http::uri::PathAndQuery::from_static(
1888                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Start",
1889            );
1890            let mut req = request.into_request();
1891            req.extensions_mut()
1892                .insert(
1893                    GrpcMethod::new(
1894                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1895                        "Start",
1896                    ),
1897                );
1898            self.inner.unary(req, path, codec).await
1899        }
1900        /// Stops the specified SQL Server cluster.
1901        pub async fn stop(
1902            &mut self,
1903            request: impl tonic::IntoRequest<super::StopClusterRequest>,
1904        ) -> std::result::Result<
1905            tonic::Response<super::super::super::super::operation::Operation>,
1906            tonic::Status,
1907        > {
1908            self.inner
1909                .ready()
1910                .await
1911                .map_err(|e| {
1912                    tonic::Status::new(
1913                        tonic::Code::Unknown,
1914                        format!("Service was not ready: {}", e.into()),
1915                    )
1916                })?;
1917            let codec = tonic::codec::ProstCodec::default();
1918            let path = http::uri::PathAndQuery::from_static(
1919                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Stop",
1920            );
1921            let mut req = request.into_request();
1922            req.extensions_mut()
1923                .insert(
1924                    GrpcMethod::new(
1925                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1926                        "Stop",
1927                    ),
1928                );
1929            self.inner.unary(req, path, codec).await
1930        }
1931        /// Moves the specified SQL Server cluster to the specified folder.
1932        pub async fn r#move(
1933            &mut self,
1934            request: impl tonic::IntoRequest<super::MoveClusterRequest>,
1935        ) -> std::result::Result<
1936            tonic::Response<super::super::super::super::operation::Operation>,
1937            tonic::Status,
1938        > {
1939            self.inner
1940                .ready()
1941                .await
1942                .map_err(|e| {
1943                    tonic::Status::new(
1944                        tonic::Code::Unknown,
1945                        format!("Service was not ready: {}", e.into()),
1946                    )
1947                })?;
1948            let codec = tonic::codec::ProstCodec::default();
1949            let path = http::uri::PathAndQuery::from_static(
1950                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Move",
1951            );
1952            let mut req = request.into_request();
1953            req.extensions_mut()
1954                .insert(
1955                    GrpcMethod::new(
1956                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1957                        "Move",
1958                    ),
1959                );
1960            self.inner.unary(req, path, codec).await
1961        }
1962        /// Creates a backup for the specified SQL Server cluster.
1963        pub async fn backup(
1964            &mut self,
1965            request: impl tonic::IntoRequest<super::BackupClusterRequest>,
1966        ) -> std::result::Result<
1967            tonic::Response<super::super::super::super::operation::Operation>,
1968            tonic::Status,
1969        > {
1970            self.inner
1971                .ready()
1972                .await
1973                .map_err(|e| {
1974                    tonic::Status::new(
1975                        tonic::Code::Unknown,
1976                        format!("Service was not ready: {}", e.into()),
1977                    )
1978                })?;
1979            let codec = tonic::codec::ProstCodec::default();
1980            let path = http::uri::PathAndQuery::from_static(
1981                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Backup",
1982            );
1983            let mut req = request.into_request();
1984            req.extensions_mut()
1985                .insert(
1986                    GrpcMethod::new(
1987                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
1988                        "Backup",
1989                    ),
1990                );
1991            self.inner.unary(req, path, codec).await
1992        }
1993        /// Creates a new SQL Server cluster using the specified backup.
1994        pub async fn restore(
1995            &mut self,
1996            request: impl tonic::IntoRequest<super::RestoreClusterRequest>,
1997        ) -> std::result::Result<
1998            tonic::Response<super::super::super::super::operation::Operation>,
1999            tonic::Status,
2000        > {
2001            self.inner
2002                .ready()
2003                .await
2004                .map_err(|e| {
2005                    tonic::Status::new(
2006                        tonic::Code::Unknown,
2007                        format!("Service was not ready: {}", e.into()),
2008                    )
2009                })?;
2010            let codec = tonic::codec::ProstCodec::default();
2011            let path = http::uri::PathAndQuery::from_static(
2012                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/Restore",
2013            );
2014            let mut req = request.into_request();
2015            req.extensions_mut()
2016                .insert(
2017                    GrpcMethod::new(
2018                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
2019                        "Restore",
2020                    ),
2021                );
2022            self.inner.unary(req, path, codec).await
2023        }
2024        /// Starts a manual failover for a cluster.
2025        pub async fn start_failover(
2026            &mut self,
2027            request: impl tonic::IntoRequest<super::StartClusterFailoverRequest>,
2028        ) -> std::result::Result<
2029            tonic::Response<super::super::super::super::operation::Operation>,
2030            tonic::Status,
2031        > {
2032            self.inner
2033                .ready()
2034                .await
2035                .map_err(|e| {
2036                    tonic::Status::new(
2037                        tonic::Code::Unknown,
2038                        format!("Service was not ready: {}", e.into()),
2039                    )
2040                })?;
2041            let codec = tonic::codec::ProstCodec::default();
2042            let path = http::uri::PathAndQuery::from_static(
2043                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/StartFailover",
2044            );
2045            let mut req = request.into_request();
2046            req.extensions_mut()
2047                .insert(
2048                    GrpcMethod::new(
2049                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
2050                        "StartFailover",
2051                    ),
2052                );
2053            self.inner.unary(req, path, codec).await
2054        }
2055        /// Retrieves logs for the specified SQL Server cluster.
2056        ///
2057        /// For more information about logs, see the [Logs](/docs/managed-sqlserver/operations/cluster-logs) section in the documentation.
2058        pub async fn list_logs(
2059            &mut self,
2060            request: impl tonic::IntoRequest<super::ListClusterLogsRequest>,
2061        ) -> std::result::Result<
2062            tonic::Response<super::ListClusterLogsResponse>,
2063            tonic::Status,
2064        > {
2065            self.inner
2066                .ready()
2067                .await
2068                .map_err(|e| {
2069                    tonic::Status::new(
2070                        tonic::Code::Unknown,
2071                        format!("Service was not ready: {}", e.into()),
2072                    )
2073                })?;
2074            let codec = tonic::codec::ProstCodec::default();
2075            let path = http::uri::PathAndQuery::from_static(
2076                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/ListLogs",
2077            );
2078            let mut req = request.into_request();
2079            req.extensions_mut()
2080                .insert(
2081                    GrpcMethod::new(
2082                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
2083                        "ListLogs",
2084                    ),
2085                );
2086            self.inner.unary(req, path, codec).await
2087        }
2088        /// Retrieves the list of operations for the specified SQL Server cluster.
2089        pub async fn list_operations(
2090            &mut self,
2091            request: impl tonic::IntoRequest<super::ListClusterOperationsRequest>,
2092        ) -> std::result::Result<
2093            tonic::Response<super::ListClusterOperationsResponse>,
2094            tonic::Status,
2095        > {
2096            self.inner
2097                .ready()
2098                .await
2099                .map_err(|e| {
2100                    tonic::Status::new(
2101                        tonic::Code::Unknown,
2102                        format!("Service was not ready: {}", e.into()),
2103                    )
2104                })?;
2105            let codec = tonic::codec::ProstCodec::default();
2106            let path = http::uri::PathAndQuery::from_static(
2107                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/ListOperations",
2108            );
2109            let mut req = request.into_request();
2110            req.extensions_mut()
2111                .insert(
2112                    GrpcMethod::new(
2113                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
2114                        "ListOperations",
2115                    ),
2116                );
2117            self.inner.unary(req, path, codec).await
2118        }
2119        /// Retrieves the list of available backups for the specified SQL Server cluster.
2120        pub async fn list_backups(
2121            &mut self,
2122            request: impl tonic::IntoRequest<super::ListClusterBackupsRequest>,
2123        ) -> std::result::Result<
2124            tonic::Response<super::ListClusterBackupsResponse>,
2125            tonic::Status,
2126        > {
2127            self.inner
2128                .ready()
2129                .await
2130                .map_err(|e| {
2131                    tonic::Status::new(
2132                        tonic::Code::Unknown,
2133                        format!("Service was not ready: {}", e.into()),
2134                    )
2135                })?;
2136            let codec = tonic::codec::ProstCodec::default();
2137            let path = http::uri::PathAndQuery::from_static(
2138                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/ListBackups",
2139            );
2140            let mut req = request.into_request();
2141            req.extensions_mut()
2142                .insert(
2143                    GrpcMethod::new(
2144                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
2145                        "ListBackups",
2146                    ),
2147                );
2148            self.inner.unary(req, path, codec).await
2149        }
2150        /// Retrieves the list of hosts for the specified SQL Server cluster.
2151        pub async fn list_hosts(
2152            &mut self,
2153            request: impl tonic::IntoRequest<super::ListClusterHostsRequest>,
2154        ) -> std::result::Result<
2155            tonic::Response<super::ListClusterHostsResponse>,
2156            tonic::Status,
2157        > {
2158            self.inner
2159                .ready()
2160                .await
2161                .map_err(|e| {
2162                    tonic::Status::new(
2163                        tonic::Code::Unknown,
2164                        format!("Service was not ready: {}", e.into()),
2165                    )
2166                })?;
2167            let codec = tonic::codec::ProstCodec::default();
2168            let path = http::uri::PathAndQuery::from_static(
2169                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/ListHosts",
2170            );
2171            let mut req = request.into_request();
2172            req.extensions_mut()
2173                .insert(
2174                    GrpcMethod::new(
2175                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
2176                        "ListHosts",
2177                    ),
2178                );
2179            self.inner.unary(req, path, codec).await
2180        }
2181        /// Updates the specified hosts.
2182        pub async fn update_hosts(
2183            &mut self,
2184            request: impl tonic::IntoRequest<super::UpdateClusterHostsRequest>,
2185        ) -> std::result::Result<
2186            tonic::Response<super::super::super::super::operation::Operation>,
2187            tonic::Status,
2188        > {
2189            self.inner
2190                .ready()
2191                .await
2192                .map_err(|e| {
2193                    tonic::Status::new(
2194                        tonic::Code::Unknown,
2195                        format!("Service was not ready: {}", e.into()),
2196                    )
2197                })?;
2198            let codec = tonic::codec::ProstCodec::default();
2199            let path = http::uri::PathAndQuery::from_static(
2200                "/yandex.cloud.mdb.sqlserver.v1.ClusterService/UpdateHosts",
2201            );
2202            let mut req = request.into_request();
2203            req.extensions_mut()
2204                .insert(
2205                    GrpcMethod::new(
2206                        "yandex.cloud.mdb.sqlserver.v1.ClusterService",
2207                        "UpdateHosts",
2208                    ),
2209                );
2210            self.inner.unary(req, path, codec).await
2211        }
2212    }
2213}
2214#[allow(clippy::derive_partial_eq_without_eq)]
2215#[derive(Clone, PartialEq, ::prost::Message)]
2216pub struct GetDatabaseRequest {
2217    /// ID of the SQL Server cluster the database belongs to.
2218    ///
2219    /// To get the cluster ID, use a \[ClusterService.List\] request.
2220    #[prost(string, tag = "1")]
2221    pub cluster_id: ::prost::alloc::string::String,
2222    /// Name of the SQL Server database to return.
2223    ///
2224    /// To get the name of the database use a \[DatabaseService.List\] request.
2225    #[prost(string, tag = "2")]
2226    pub database_name: ::prost::alloc::string::String,
2227}
2228#[allow(clippy::derive_partial_eq_without_eq)]
2229#[derive(Clone, PartialEq, ::prost::Message)]
2230pub struct ListDatabasesRequest {
2231    /// ID of the SQL Server cluster to list databases in.
2232    ///
2233    /// To get the cluster ID, use a \[ClusterService.List\] request.
2234    #[prost(string, tag = "1")]
2235    pub cluster_id: ::prost::alloc::string::String,
2236    /// The maximum number of results per page to return.
2237    ///
2238    /// If the number of available results is larger than \[page_size\], the service returns a \[ListDatabasesResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
2239    #[prost(int64, tag = "2")]
2240    pub page_size: i64,
2241    /// Page token. To get the next page of results, set \[page_token\] to the \[ListDatabasesResponse.next_page_token\] returned by the previous list request.
2242    #[prost(string, tag = "3")]
2243    pub page_token: ::prost::alloc::string::String,
2244}
2245#[allow(clippy::derive_partial_eq_without_eq)]
2246#[derive(Clone, PartialEq, ::prost::Message)]
2247pub struct ListDatabasesResponse {
2248    /// List of SQL Server databases.
2249    #[prost(message, repeated, tag = "1")]
2250    pub databases: ::prost::alloc::vec::Vec<Database>,
2251    /// Token that allows you to get the next page of results for list requests.
2252    ///
2253    /// If the number of results is larger than \[ListDatabasesRequest.page_size\], use the \[next_page_token\] as the value for the \[ListDatabasesRequest.page_token\] parameter in the next list request.
2254    ///
2255    /// Each subsequent list request has its own \[next_page_token\] to continue paging through the results.
2256    #[prost(string, tag = "2")]
2257    pub next_page_token: ::prost::alloc::string::String,
2258}
2259#[allow(clippy::derive_partial_eq_without_eq)]
2260#[derive(Clone, PartialEq, ::prost::Message)]
2261pub struct CreateDatabaseRequest {
2262    /// ID of the SQL Server cluster to create a database in.
2263    ///
2264    /// To get the cluster ID, use a \[ClusterService.List\] request.
2265    #[prost(string, tag = "1")]
2266    pub cluster_id: ::prost::alloc::string::String,
2267    /// Configuration of the database to create.
2268    #[prost(message, optional, tag = "2")]
2269    pub database_spec: ::core::option::Option<DatabaseSpec>,
2270}
2271#[allow(clippy::derive_partial_eq_without_eq)]
2272#[derive(Clone, PartialEq, ::prost::Message)]
2273pub struct CreateDatabaseMetadata {
2274    /// ID of the SQL Server cluster where the database is being created.
2275    #[prost(string, tag = "1")]
2276    pub cluster_id: ::prost::alloc::string::String,
2277    /// Name of the SQL Server database being created.
2278    #[prost(string, tag = "2")]
2279    pub database_name: ::prost::alloc::string::String,
2280}
2281#[allow(clippy::derive_partial_eq_without_eq)]
2282#[derive(Clone, PartialEq, ::prost::Message)]
2283pub struct DeleteDatabaseRequest {
2284    /// ID of the SQL Server cluster to delete a database in.
2285    ///
2286    /// To get the cluster ID, use a \[ClusterService.List\] request.
2287    #[prost(string, tag = "1")]
2288    pub cluster_id: ::prost::alloc::string::String,
2289    /// Name of the database to delete.
2290    ///
2291    /// To get the name of the database, use a \[DatabaseService.List\] request.
2292    #[prost(string, tag = "2")]
2293    pub database_name: ::prost::alloc::string::String,
2294}
2295#[allow(clippy::derive_partial_eq_without_eq)]
2296#[derive(Clone, PartialEq, ::prost::Message)]
2297pub struct DeleteDatabaseMetadata {
2298    /// ID of the SQL Server cluster where the database is being deleted.
2299    #[prost(string, tag = "1")]
2300    pub cluster_id: ::prost::alloc::string::String,
2301    /// Name of the SQL Server database being deleted.
2302    #[prost(string, tag = "2")]
2303    pub database_name: ::prost::alloc::string::String,
2304}
2305#[allow(clippy::derive_partial_eq_without_eq)]
2306#[derive(Clone, PartialEq, ::prost::Message)]
2307pub struct RestoreDatabaseRequest {
2308    /// ID of the SQL Server cluster to restore a database in.
2309    ///
2310    /// To get the cluster ID, use a \[ClusterService.List\] request.
2311    #[prost(string, tag = "1")]
2312    pub cluster_id: ::prost::alloc::string::String,
2313    /// Name of the SQL Server database that is being restored.
2314    #[prost(string, tag = "2")]
2315    pub database_name: ::prost::alloc::string::String,
2316    /// Name of the database which backup is used to restore the database.
2317    #[prost(string, tag = "3")]
2318    pub from_database: ::prost::alloc::string::String,
2319    /// ID of a backup to be used.
2320    #[prost(string, tag = "4")]
2321    pub backup_id: ::prost::alloc::string::String,
2322    /// Timestamp which is used for Point-in-Time recovery.
2323    #[prost(message, optional, tag = "6")]
2324    pub time: ::core::option::Option<::prost_types::Timestamp>,
2325}
2326#[allow(clippy::derive_partial_eq_without_eq)]
2327#[derive(Clone, PartialEq, ::prost::Message)]
2328pub struct RestoreDatabaseMetadata {
2329    /// ID of the SQL Server cluster where a database is being created.
2330    #[prost(string, tag = "1")]
2331    pub cluster_id: ::prost::alloc::string::String,
2332    /// Name of an SQL Server database that is being created.
2333    #[prost(string, tag = "2")]
2334    pub database_name: ::prost::alloc::string::String,
2335    /// Name of the database which backup is used to restore the database.
2336    #[prost(string, tag = "3")]
2337    pub from_database: ::prost::alloc::string::String,
2338    /// ID of a backup to be used.
2339    #[prost(string, tag = "4")]
2340    pub backup_id: ::prost::alloc::string::String,
2341}
2342#[allow(clippy::derive_partial_eq_without_eq)]
2343#[derive(Clone, PartialEq, ::prost::Message)]
2344pub struct ImportDatabaseBackupRequest {
2345    /// ID of the SQL Server cluster to import a database in.
2346    ///
2347    /// To get the cluster ID, use a \[ClusterService.List\] request.
2348    #[prost(string, tag = "1")]
2349    pub cluster_id: ::prost::alloc::string::String,
2350    /// Name of the SQL Server database that is being imported.
2351    #[prost(string, tag = "2")]
2352    pub database_name: ::prost::alloc::string::String,
2353    /// Name of object storage bucket to import backups from.
2354    #[prost(string, tag = "3")]
2355    pub s3_bucket: ::prost::alloc::string::String,
2356    /// Path in object storage bucket to import backups from.
2357    #[prost(string, tag = "4")]
2358    pub s3_path: ::prost::alloc::string::String,
2359    /// List of .bak files in bucket containing database backup.
2360    #[prost(string, repeated, tag = "5")]
2361    pub files: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2362}
2363#[allow(clippy::derive_partial_eq_without_eq)]
2364#[derive(Clone, PartialEq, ::prost::Message)]
2365pub struct ImportDatabaseBackupMetadata {
2366    /// ID of the SQL Server cluster where a database is being imported.
2367    #[prost(string, tag = "1")]
2368    pub cluster_id: ::prost::alloc::string::String,
2369    /// Name of the SQL Server database that is being imported.
2370    #[prost(string, tag = "2")]
2371    pub database_name: ::prost::alloc::string::String,
2372    /// Name of object storage bucket to import backups from.
2373    #[prost(string, tag = "3")]
2374    pub s3_bucket: ::prost::alloc::string::String,
2375    /// Path in object storage bucket to import backups from.
2376    #[prost(string, tag = "4")]
2377    pub s3_path: ::prost::alloc::string::String,
2378}
2379#[allow(clippy::derive_partial_eq_without_eq)]
2380#[derive(Clone, PartialEq, ::prost::Message)]
2381pub struct ExportDatabaseBackupRequest {
2382    /// ID of the SQL Server cluster to export a database from.
2383    ///
2384    /// To get the cluster ID, use a \[ClusterService.List\] request.
2385    #[prost(string, tag = "1")]
2386    pub cluster_id: ::prost::alloc::string::String,
2387    /// Name of the SQL Server database that is being exported.
2388    #[prost(string, tag = "2")]
2389    pub database_name: ::prost::alloc::string::String,
2390    /// Name of object storage bucket to export backups to.
2391    #[prost(string, tag = "3")]
2392    pub s3_bucket: ::prost::alloc::string::String,
2393    /// Path in object storage bucket to export backups to.
2394    #[prost(string, tag = "4")]
2395    pub s3_path: ::prost::alloc::string::String,
2396    /// Prefix for .bak files to export.
2397    #[prost(string, tag = "5")]
2398    pub prefix: ::prost::alloc::string::String,
2399}
2400#[allow(clippy::derive_partial_eq_without_eq)]
2401#[derive(Clone, PartialEq, ::prost::Message)]
2402pub struct ExportDatabaseBackupMetadata {
2403    /// ID of the SQL Server cluster where a database is being exported.
2404    #[prost(string, tag = "1")]
2405    pub cluster_id: ::prost::alloc::string::String,
2406    /// Name of the SQL Server database that is being exported.
2407    #[prost(string, tag = "2")]
2408    pub database_name: ::prost::alloc::string::String,
2409    /// Name of object storage bucket to export backups to.
2410    #[prost(string, tag = "3")]
2411    pub s3_bucket: ::prost::alloc::string::String,
2412    /// Path in object storage bucket to export backups to.
2413    #[prost(string, tag = "4")]
2414    pub s3_path: ::prost::alloc::string::String,
2415}
2416/// Generated client implementations.
2417pub mod database_service_client {
2418    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2419    use tonic::codegen::*;
2420    use tonic::codegen::http::Uri;
2421    /// A set of methods for managing SQL Server databases.
2422    #[derive(Debug, Clone)]
2423    pub struct DatabaseServiceClient<T> {
2424        inner: tonic::client::Grpc<T>,
2425    }
2426    impl DatabaseServiceClient<tonic::transport::Channel> {
2427        /// Attempt to create a new client by connecting to a given endpoint.
2428        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2429        where
2430            D: TryInto<tonic::transport::Endpoint>,
2431            D::Error: Into<StdError>,
2432        {
2433            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2434            Ok(Self::new(conn))
2435        }
2436    }
2437    impl<T> DatabaseServiceClient<T>
2438    where
2439        T: tonic::client::GrpcService<tonic::body::BoxBody>,
2440        T::Error: Into<StdError>,
2441        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2442        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2443    {
2444        pub fn new(inner: T) -> Self {
2445            let inner = tonic::client::Grpc::new(inner);
2446            Self { inner }
2447        }
2448        pub fn with_origin(inner: T, origin: Uri) -> Self {
2449            let inner = tonic::client::Grpc::with_origin(inner, origin);
2450            Self { inner }
2451        }
2452        pub fn with_interceptor<F>(
2453            inner: T,
2454            interceptor: F,
2455        ) -> DatabaseServiceClient<InterceptedService<T, F>>
2456        where
2457            F: tonic::service::Interceptor,
2458            T::ResponseBody: Default,
2459            T: tonic::codegen::Service<
2460                http::Request<tonic::body::BoxBody>,
2461                Response = http::Response<
2462                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2463                >,
2464            >,
2465            <T as tonic::codegen::Service<
2466                http::Request<tonic::body::BoxBody>,
2467            >>::Error: Into<StdError> + Send + Sync,
2468        {
2469            DatabaseServiceClient::new(InterceptedService::new(inner, interceptor))
2470        }
2471        /// Compress requests with the given encoding.
2472        ///
2473        /// This requires the server to support it otherwise it might respond with an
2474        /// error.
2475        #[must_use]
2476        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2477            self.inner = self.inner.send_compressed(encoding);
2478            self
2479        }
2480        /// Enable decompressing responses.
2481        #[must_use]
2482        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2483            self.inner = self.inner.accept_compressed(encoding);
2484            self
2485        }
2486        /// Limits the maximum size of a decoded message.
2487        ///
2488        /// Default: `4MB`
2489        #[must_use]
2490        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2491            self.inner = self.inner.max_decoding_message_size(limit);
2492            self
2493        }
2494        /// Limits the maximum size of an encoded message.
2495        ///
2496        /// Default: `usize::MAX`
2497        #[must_use]
2498        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2499            self.inner = self.inner.max_encoding_message_size(limit);
2500            self
2501        }
2502        /// Returns the specified SQL Server database.
2503        ///
2504        /// To get the list of available SQL Server databases, make a [List] request.
2505        pub async fn get(
2506            &mut self,
2507            request: impl tonic::IntoRequest<super::GetDatabaseRequest>,
2508        ) -> std::result::Result<tonic::Response<super::Database>, tonic::Status> {
2509            self.inner
2510                .ready()
2511                .await
2512                .map_err(|e| {
2513                    tonic::Status::new(
2514                        tonic::Code::Unknown,
2515                        format!("Service was not ready: {}", e.into()),
2516                    )
2517                })?;
2518            let codec = tonic::codec::ProstCodec::default();
2519            let path = http::uri::PathAndQuery::from_static(
2520                "/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Get",
2521            );
2522            let mut req = request.into_request();
2523            req.extensions_mut()
2524                .insert(
2525                    GrpcMethod::new(
2526                        "yandex.cloud.mdb.sqlserver.v1.DatabaseService",
2527                        "Get",
2528                    ),
2529                );
2530            self.inner.unary(req, path, codec).await
2531        }
2532        /// Retrieves the list of SQL Server databases in the specified cluster.
2533        pub async fn list(
2534            &mut self,
2535            request: impl tonic::IntoRequest<super::ListDatabasesRequest>,
2536        ) -> std::result::Result<
2537            tonic::Response<super::ListDatabasesResponse>,
2538            tonic::Status,
2539        > {
2540            self.inner
2541                .ready()
2542                .await
2543                .map_err(|e| {
2544                    tonic::Status::new(
2545                        tonic::Code::Unknown,
2546                        format!("Service was not ready: {}", e.into()),
2547                    )
2548                })?;
2549            let codec = tonic::codec::ProstCodec::default();
2550            let path = http::uri::PathAndQuery::from_static(
2551                "/yandex.cloud.mdb.sqlserver.v1.DatabaseService/List",
2552            );
2553            let mut req = request.into_request();
2554            req.extensions_mut()
2555                .insert(
2556                    GrpcMethod::new(
2557                        "yandex.cloud.mdb.sqlserver.v1.DatabaseService",
2558                        "List",
2559                    ),
2560                );
2561            self.inner.unary(req, path, codec).await
2562        }
2563        /// Creates a new SQL Server database in the specified cluster.
2564        pub async fn create(
2565            &mut self,
2566            request: impl tonic::IntoRequest<super::CreateDatabaseRequest>,
2567        ) -> std::result::Result<
2568            tonic::Response<super::super::super::super::operation::Operation>,
2569            tonic::Status,
2570        > {
2571            self.inner
2572                .ready()
2573                .await
2574                .map_err(|e| {
2575                    tonic::Status::new(
2576                        tonic::Code::Unknown,
2577                        format!("Service was not ready: {}", e.into()),
2578                    )
2579                })?;
2580            let codec = tonic::codec::ProstCodec::default();
2581            let path = http::uri::PathAndQuery::from_static(
2582                "/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Create",
2583            );
2584            let mut req = request.into_request();
2585            req.extensions_mut()
2586                .insert(
2587                    GrpcMethod::new(
2588                        "yandex.cloud.mdb.sqlserver.v1.DatabaseService",
2589                        "Create",
2590                    ),
2591                );
2592            self.inner.unary(req, path, codec).await
2593        }
2594        /// Creates a new SQL Server database in the specified cluster from a backup.
2595        pub async fn restore(
2596            &mut self,
2597            request: impl tonic::IntoRequest<super::RestoreDatabaseRequest>,
2598        ) -> std::result::Result<
2599            tonic::Response<super::super::super::super::operation::Operation>,
2600            tonic::Status,
2601        > {
2602            self.inner
2603                .ready()
2604                .await
2605                .map_err(|e| {
2606                    tonic::Status::new(
2607                        tonic::Code::Unknown,
2608                        format!("Service was not ready: {}", e.into()),
2609                    )
2610                })?;
2611            let codec = tonic::codec::ProstCodec::default();
2612            let path = http::uri::PathAndQuery::from_static(
2613                "/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Restore",
2614            );
2615            let mut req = request.into_request();
2616            req.extensions_mut()
2617                .insert(
2618                    GrpcMethod::new(
2619                        "yandex.cloud.mdb.sqlserver.v1.DatabaseService",
2620                        "Restore",
2621                    ),
2622                );
2623            self.inner.unary(req, path, codec).await
2624        }
2625        /// Imports a new SQL Server database from an external backup.
2626        pub async fn import_backup(
2627            &mut self,
2628            request: impl tonic::IntoRequest<super::ImportDatabaseBackupRequest>,
2629        ) -> std::result::Result<
2630            tonic::Response<super::super::super::super::operation::Operation>,
2631            tonic::Status,
2632        > {
2633            self.inner
2634                .ready()
2635                .await
2636                .map_err(|e| {
2637                    tonic::Status::new(
2638                        tonic::Code::Unknown,
2639                        format!("Service was not ready: {}", e.into()),
2640                    )
2641                })?;
2642            let codec = tonic::codec::ProstCodec::default();
2643            let path = http::uri::PathAndQuery::from_static(
2644                "/yandex.cloud.mdb.sqlserver.v1.DatabaseService/ImportBackup",
2645            );
2646            let mut req = request.into_request();
2647            req.extensions_mut()
2648                .insert(
2649                    GrpcMethod::new(
2650                        "yandex.cloud.mdb.sqlserver.v1.DatabaseService",
2651                        "ImportBackup",
2652                    ),
2653                );
2654            self.inner.unary(req, path, codec).await
2655        }
2656        /// Exports the last database backup to an external backup.
2657        pub async fn export_backup(
2658            &mut self,
2659            request: impl tonic::IntoRequest<super::ExportDatabaseBackupRequest>,
2660        ) -> std::result::Result<
2661            tonic::Response<super::super::super::super::operation::Operation>,
2662            tonic::Status,
2663        > {
2664            self.inner
2665                .ready()
2666                .await
2667                .map_err(|e| {
2668                    tonic::Status::new(
2669                        tonic::Code::Unknown,
2670                        format!("Service was not ready: {}", e.into()),
2671                    )
2672                })?;
2673            let codec = tonic::codec::ProstCodec::default();
2674            let path = http::uri::PathAndQuery::from_static(
2675                "/yandex.cloud.mdb.sqlserver.v1.DatabaseService/ExportBackup",
2676            );
2677            let mut req = request.into_request();
2678            req.extensions_mut()
2679                .insert(
2680                    GrpcMethod::new(
2681                        "yandex.cloud.mdb.sqlserver.v1.DatabaseService",
2682                        "ExportBackup",
2683                    ),
2684                );
2685            self.inner.unary(req, path, codec).await
2686        }
2687        /// Deletes the specified SQL Server database.
2688        pub async fn delete(
2689            &mut self,
2690            request: impl tonic::IntoRequest<super::DeleteDatabaseRequest>,
2691        ) -> std::result::Result<
2692            tonic::Response<super::super::super::super::operation::Operation>,
2693            tonic::Status,
2694        > {
2695            self.inner
2696                .ready()
2697                .await
2698                .map_err(|e| {
2699                    tonic::Status::new(
2700                        tonic::Code::Unknown,
2701                        format!("Service was not ready: {}", e.into()),
2702                    )
2703                })?;
2704            let codec = tonic::codec::ProstCodec::default();
2705            let path = http::uri::PathAndQuery::from_static(
2706                "/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Delete",
2707            );
2708            let mut req = request.into_request();
2709            req.extensions_mut()
2710                .insert(
2711                    GrpcMethod::new(
2712                        "yandex.cloud.mdb.sqlserver.v1.DatabaseService",
2713                        "Delete",
2714                    ),
2715                );
2716            self.inner.unary(req, path, codec).await
2717        }
2718    }
2719}
2720/// A preset of resources for hardware configuration of SQL Server hosts.
2721#[allow(clippy::derive_partial_eq_without_eq)]
2722#[derive(Clone, PartialEq, ::prost::Message)]
2723pub struct ResourcePreset {
2724    /// ID of the resource preset.
2725    #[prost(string, tag = "1")]
2726    pub id: ::prost::alloc::string::String,
2727    /// IDs of availability zones where the resource preset is available.
2728    #[prost(string, repeated, tag = "2")]
2729    pub zone_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2730    /// Number of CPU cores for an SQL Server host created with the preset.
2731    #[prost(int64, tag = "3")]
2732    pub cores: i64,
2733    /// RAM volume for an SQL Server host created with the preset, in bytes.
2734    #[prost(int64, tag = "4")]
2735    pub memory: i64,
2736}
2737#[allow(clippy::derive_partial_eq_without_eq)]
2738#[derive(Clone, PartialEq, ::prost::Message)]
2739pub struct GetResourcePresetRequest {
2740    /// ID of the resource preset to return.
2741    ///
2742    /// To get the resource preset ID, use a \[ResourcePresetService.List\] request.
2743    #[prost(string, tag = "1")]
2744    pub resource_preset_id: ::prost::alloc::string::String,
2745}
2746#[allow(clippy::derive_partial_eq_without_eq)]
2747#[derive(Clone, PartialEq, ::prost::Message)]
2748pub struct ListResourcePresetsRequest {
2749    /// The maximum number of results per page to return.
2750    ///
2751    /// If the number of available results is larger than \[page_size\], the service returns a \[ListResourcePresetsResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
2752    #[prost(int64, tag = "2")]
2753    pub page_size: i64,
2754    /// Page token. To get the next page of results, set \[page_token\] to the \[ListResourcePresetsResponse.next_page_token\] returned by the previous list request.
2755    #[prost(string, tag = "3")]
2756    pub page_token: ::prost::alloc::string::String,
2757}
2758#[allow(clippy::derive_partial_eq_without_eq)]
2759#[derive(Clone, PartialEq, ::prost::Message)]
2760pub struct ListResourcePresetsResponse {
2761    /// List of resource presets.
2762    #[prost(message, repeated, tag = "1")]
2763    pub resource_presets: ::prost::alloc::vec::Vec<ResourcePreset>,
2764    /// Token that allows you to get the next page of results for list requests.
2765    ///
2766    /// If the number of results is larger than \[ListResourcePresetsRequest.page_size\], use the \[next_page_token\] as the value for the \[ListResourcePresetsRequest.page_token\] parameter in the next list request.
2767    ///
2768    /// Each subsequent list request has its own \[next_page_token\] to continue paging through the results.
2769    #[prost(string, tag = "2")]
2770    pub next_page_token: ::prost::alloc::string::String,
2771}
2772/// Generated client implementations.
2773pub mod resource_preset_service_client {
2774    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2775    use tonic::codegen::*;
2776    use tonic::codegen::http::Uri;
2777    /// A set of methods for managing resource presets.
2778    #[derive(Debug, Clone)]
2779    pub struct ResourcePresetServiceClient<T> {
2780        inner: tonic::client::Grpc<T>,
2781    }
2782    impl ResourcePresetServiceClient<tonic::transport::Channel> {
2783        /// Attempt to create a new client by connecting to a given endpoint.
2784        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2785        where
2786            D: TryInto<tonic::transport::Endpoint>,
2787            D::Error: Into<StdError>,
2788        {
2789            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2790            Ok(Self::new(conn))
2791        }
2792    }
2793    impl<T> ResourcePresetServiceClient<T>
2794    where
2795        T: tonic::client::GrpcService<tonic::body::BoxBody>,
2796        T::Error: Into<StdError>,
2797        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2798        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2799    {
2800        pub fn new(inner: T) -> Self {
2801            let inner = tonic::client::Grpc::new(inner);
2802            Self { inner }
2803        }
2804        pub fn with_origin(inner: T, origin: Uri) -> Self {
2805            let inner = tonic::client::Grpc::with_origin(inner, origin);
2806            Self { inner }
2807        }
2808        pub fn with_interceptor<F>(
2809            inner: T,
2810            interceptor: F,
2811        ) -> ResourcePresetServiceClient<InterceptedService<T, F>>
2812        where
2813            F: tonic::service::Interceptor,
2814            T::ResponseBody: Default,
2815            T: tonic::codegen::Service<
2816                http::Request<tonic::body::BoxBody>,
2817                Response = http::Response<
2818                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2819                >,
2820            >,
2821            <T as tonic::codegen::Service<
2822                http::Request<tonic::body::BoxBody>,
2823            >>::Error: Into<StdError> + Send + Sync,
2824        {
2825            ResourcePresetServiceClient::new(InterceptedService::new(inner, interceptor))
2826        }
2827        /// Compress requests with the given encoding.
2828        ///
2829        /// This requires the server to support it otherwise it might respond with an
2830        /// error.
2831        #[must_use]
2832        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2833            self.inner = self.inner.send_compressed(encoding);
2834            self
2835        }
2836        /// Enable decompressing responses.
2837        #[must_use]
2838        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2839            self.inner = self.inner.accept_compressed(encoding);
2840            self
2841        }
2842        /// Limits the maximum size of a decoded message.
2843        ///
2844        /// Default: `4MB`
2845        #[must_use]
2846        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2847            self.inner = self.inner.max_decoding_message_size(limit);
2848            self
2849        }
2850        /// Limits the maximum size of an encoded message.
2851        ///
2852        /// Default: `usize::MAX`
2853        #[must_use]
2854        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2855            self.inner = self.inner.max_encoding_message_size(limit);
2856            self
2857        }
2858        /// Returns the specified resource preset.
2859        ///
2860        /// To get the list of available resource presets, make a [List] request.
2861        pub async fn get(
2862            &mut self,
2863            request: impl tonic::IntoRequest<super::GetResourcePresetRequest>,
2864        ) -> std::result::Result<tonic::Response<super::ResourcePreset>, tonic::Status> {
2865            self.inner
2866                .ready()
2867                .await
2868                .map_err(|e| {
2869                    tonic::Status::new(
2870                        tonic::Code::Unknown,
2871                        format!("Service was not ready: {}", e.into()),
2872                    )
2873                })?;
2874            let codec = tonic::codec::ProstCodec::default();
2875            let path = http::uri::PathAndQuery::from_static(
2876                "/yandex.cloud.mdb.sqlserver.v1.ResourcePresetService/Get",
2877            );
2878            let mut req = request.into_request();
2879            req.extensions_mut()
2880                .insert(
2881                    GrpcMethod::new(
2882                        "yandex.cloud.mdb.sqlserver.v1.ResourcePresetService",
2883                        "Get",
2884                    ),
2885                );
2886            self.inner.unary(req, path, codec).await
2887        }
2888        /// Retrieves the list of available resource presets.
2889        pub async fn list(
2890            &mut self,
2891            request: impl tonic::IntoRequest<super::ListResourcePresetsRequest>,
2892        ) -> std::result::Result<
2893            tonic::Response<super::ListResourcePresetsResponse>,
2894            tonic::Status,
2895        > {
2896            self.inner
2897                .ready()
2898                .await
2899                .map_err(|e| {
2900                    tonic::Status::new(
2901                        tonic::Code::Unknown,
2902                        format!("Service was not ready: {}", e.into()),
2903                    )
2904                })?;
2905            let codec = tonic::codec::ProstCodec::default();
2906            let path = http::uri::PathAndQuery::from_static(
2907                "/yandex.cloud.mdb.sqlserver.v1.ResourcePresetService/List",
2908            );
2909            let mut req = request.into_request();
2910            req.extensions_mut()
2911                .insert(
2912                    GrpcMethod::new(
2913                        "yandex.cloud.mdb.sqlserver.v1.ResourcePresetService",
2914                        "List",
2915                    ),
2916                );
2917            self.inner.unary(req, path, codec).await
2918        }
2919    }
2920}
2921#[allow(clippy::derive_partial_eq_without_eq)]
2922#[derive(Clone, PartialEq, ::prost::Message)]
2923pub struct GetUserRequest {
2924    /// ID of the SQL Server cluster the user belongs to.
2925    ///
2926    /// To get the cluster ID, use a \[ClusterService.List\] request.
2927    #[prost(string, tag = "1")]
2928    pub cluster_id: ::prost::alloc::string::String,
2929    /// Name of the SQL Server user to return.
2930    ///
2931    /// To get the name of the user use a \[DatabaseService.List\] request.
2932    #[prost(string, tag = "2")]
2933    pub user_name: ::prost::alloc::string::String,
2934}
2935#[allow(clippy::derive_partial_eq_without_eq)]
2936#[derive(Clone, PartialEq, ::prost::Message)]
2937pub struct ListUsersRequest {
2938    /// ID of the cluster to list SQL Server users in.
2939    ///
2940    /// To get the cluster ID, use a \[ClusterService.List\] request.
2941    #[prost(string, tag = "1")]
2942    pub cluster_id: ::prost::alloc::string::String,
2943    /// The maximum number of results per page to return.
2944    ///
2945    /// If the number of available results is larger than \[page_size\], the service returns a \[ListUsersResponse.next_page_token\] that can be used to get the next page of results in subsequent list requests.
2946    #[prost(int64, tag = "2")]
2947    pub page_size: i64,
2948    /// Page token. To get the next page of results, set \[page_token\] to the \[ListUsersResponse.next_page_token\] returned by the previous list request.
2949    #[prost(string, tag = "3")]
2950    pub page_token: ::prost::alloc::string::String,
2951}
2952#[allow(clippy::derive_partial_eq_without_eq)]
2953#[derive(Clone, PartialEq, ::prost::Message)]
2954pub struct ListUsersResponse {
2955    /// Requested list of SQL Server users.
2956    #[prost(message, repeated, tag = "1")]
2957    pub users: ::prost::alloc::vec::Vec<User>,
2958    /// Token that allows you to get the next page of results for list requests.
2959    ///
2960    /// If the number of results is larger than \[ListUsersRequest.page_size\], use the \[next_page_token\] as the value for the \[ListUsersRequest.page_token\] parameter in the next list request.
2961    ///
2962    /// Each subsequent list request has its own \[next_page_token\] to continue paging through the results.
2963    #[prost(string, tag = "2")]
2964    pub next_page_token: ::prost::alloc::string::String,
2965}
2966#[allow(clippy::derive_partial_eq_without_eq)]
2967#[derive(Clone, PartialEq, ::prost::Message)]
2968pub struct CreateUserRequest {
2969    /// ID of the SQL Server cluster to create a user for.
2970    ///
2971    /// To get the cluster ID, use a \[ClusterService.List\] request.
2972    #[prost(string, tag = "1")]
2973    pub cluster_id: ::prost::alloc::string::String,
2974    /// Properties of the user to be created.
2975    #[prost(message, optional, tag = "2")]
2976    pub user_spec: ::core::option::Option<UserSpec>,
2977}
2978#[allow(clippy::derive_partial_eq_without_eq)]
2979#[derive(Clone, PartialEq, ::prost::Message)]
2980pub struct CreateUserMetadata {
2981    /// ID of the SQL Server cluster the user is being created for.
2982    #[prost(string, tag = "1")]
2983    pub cluster_id: ::prost::alloc::string::String,
2984    /// Name of the user being created.
2985    #[prost(string, tag = "2")]
2986    pub user_name: ::prost::alloc::string::String,
2987}
2988#[allow(clippy::derive_partial_eq_without_eq)]
2989#[derive(Clone, PartialEq, ::prost::Message)]
2990pub struct UpdateUserRequest {
2991    /// ID of the SQL Server cluster the user belongs to.
2992    ///
2993    /// To get the cluster ID, use a \[ClusterService.List\] request.
2994    #[prost(string, tag = "1")]
2995    pub cluster_id: ::prost::alloc::string::String,
2996    /// Name of the user to be updated.
2997    ///
2998    /// To get the name of the user use a \[UserService.List\] request.
2999    #[prost(string, tag = "2")]
3000    pub user_name: ::prost::alloc::string::String,
3001    /// Field mask that specifies which fields of the SQL Server user should be updated.
3002    #[prost(message, optional, tag = "3")]
3003    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
3004    /// New password for the user.
3005    #[prost(string, tag = "4")]
3006    pub password: ::prost::alloc::string::String,
3007    /// New set of permissions for the user.
3008    #[prost(message, repeated, tag = "5")]
3009    pub permissions: ::prost::alloc::vec::Vec<Permission>,
3010    /// New set of server roles granted to the login.
3011    #[prost(enumeration = "ServerRole", repeated, tag = "6")]
3012    pub server_roles: ::prost::alloc::vec::Vec<i32>,
3013}
3014#[allow(clippy::derive_partial_eq_without_eq)]
3015#[derive(Clone, PartialEq, ::prost::Message)]
3016pub struct UpdateUserMetadata {
3017    /// ID of the SQL Server cluster the user belongs to.
3018    #[prost(string, tag = "1")]
3019    pub cluster_id: ::prost::alloc::string::String,
3020    /// Name of the user being updated.
3021    #[prost(string, tag = "2")]
3022    pub user_name: ::prost::alloc::string::String,
3023}
3024#[allow(clippy::derive_partial_eq_without_eq)]
3025#[derive(Clone, PartialEq, ::prost::Message)]
3026pub struct DeleteUserRequest {
3027    /// ID of the SQL Server cluster the user belongs to.
3028    ///
3029    /// To get the cluster ID, use a \[ClusterService.List\] request.
3030    #[prost(string, tag = "1")]
3031    pub cluster_id: ::prost::alloc::string::String,
3032    /// Name of the user to delete.
3033    ///
3034    /// To get the name of the user, use a \[UserService.List\] request.
3035    #[prost(string, tag = "2")]
3036    pub user_name: ::prost::alloc::string::String,
3037}
3038#[allow(clippy::derive_partial_eq_without_eq)]
3039#[derive(Clone, PartialEq, ::prost::Message)]
3040pub struct DeleteUserMetadata {
3041    /// ID of the SQL Server cluster the user belongs to.
3042    #[prost(string, tag = "1")]
3043    pub cluster_id: ::prost::alloc::string::String,
3044    /// Name of the user being deleted.
3045    #[prost(string, tag = "2")]
3046    pub user_name: ::prost::alloc::string::String,
3047}
3048#[allow(clippy::derive_partial_eq_without_eq)]
3049#[derive(Clone, PartialEq, ::prost::Message)]
3050pub struct GrantUserPermissionRequest {
3051    /// ID of the SQL Server cluster the user belongs to.
3052    ///
3053    /// To get the cluster ID, use a \[ClusterService.List\] request.
3054    #[prost(string, tag = "1")]
3055    pub cluster_id: ::prost::alloc::string::String,
3056    /// Name of the user to grant the permission to.
3057    ///
3058    /// To get the name of the user, use a \[UserService.List\] request.
3059    #[prost(string, tag = "2")]
3060    pub user_name: ::prost::alloc::string::String,
3061    /// Permission that should be granted to the specified user.
3062    #[prost(message, optional, tag = "3")]
3063    pub permission: ::core::option::Option<Permission>,
3064}
3065#[allow(clippy::derive_partial_eq_without_eq)]
3066#[derive(Clone, PartialEq, ::prost::Message)]
3067pub struct GrantUserPermissionMetadata {
3068    /// ID of the SQL Server cluster the user belongs to.
3069    ///
3070    /// To get the cluster ID, use a \[ClusterService.List\] request.
3071    #[prost(string, tag = "1")]
3072    pub cluster_id: ::prost::alloc::string::String,
3073    /// Name of the user being granted a permission.
3074    #[prost(string, tag = "2")]
3075    pub user_name: ::prost::alloc::string::String,
3076}
3077#[allow(clippy::derive_partial_eq_without_eq)]
3078#[derive(Clone, PartialEq, ::prost::Message)]
3079pub struct RevokeUserPermissionRequest {
3080    /// ID of the SQL Server cluster the user belongs to.
3081    ///
3082    /// To get the cluster ID, use a \[ClusterService.List\] request.
3083    #[prost(string, tag = "1")]
3084    pub cluster_id: ::prost::alloc::string::String,
3085    /// Name of the user to revoke a permission from.
3086    ///
3087    /// To get the name of the user, use a \[UserService.List\] request.
3088    #[prost(string, tag = "2")]
3089    pub user_name: ::prost::alloc::string::String,
3090    /// Permission that should be revoked from the specified user.
3091    #[prost(message, optional, tag = "3")]
3092    pub permission: ::core::option::Option<Permission>,
3093}
3094#[allow(clippy::derive_partial_eq_without_eq)]
3095#[derive(Clone, PartialEq, ::prost::Message)]
3096pub struct RevokeUserPermissionMetadata {
3097    /// ID of the SQL Server cluster the user belongs to.
3098    #[prost(string, tag = "1")]
3099    pub cluster_id: ::prost::alloc::string::String,
3100    /// Name of the user whose permission is being revoked.
3101    #[prost(string, tag = "2")]
3102    pub user_name: ::prost::alloc::string::String,
3103}
3104/// Generated client implementations.
3105pub mod user_service_client {
3106    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
3107    use tonic::codegen::*;
3108    use tonic::codegen::http::Uri;
3109    /// A set of methods for managing SQL Server users.
3110    #[derive(Debug, Clone)]
3111    pub struct UserServiceClient<T> {
3112        inner: tonic::client::Grpc<T>,
3113    }
3114    impl UserServiceClient<tonic::transport::Channel> {
3115        /// Attempt to create a new client by connecting to a given endpoint.
3116        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3117        where
3118            D: TryInto<tonic::transport::Endpoint>,
3119            D::Error: Into<StdError>,
3120        {
3121            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3122            Ok(Self::new(conn))
3123        }
3124    }
3125    impl<T> UserServiceClient<T>
3126    where
3127        T: tonic::client::GrpcService<tonic::body::BoxBody>,
3128        T::Error: Into<StdError>,
3129        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
3130        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
3131    {
3132        pub fn new(inner: T) -> Self {
3133            let inner = tonic::client::Grpc::new(inner);
3134            Self { inner }
3135        }
3136        pub fn with_origin(inner: T, origin: Uri) -> Self {
3137            let inner = tonic::client::Grpc::with_origin(inner, origin);
3138            Self { inner }
3139        }
3140        pub fn with_interceptor<F>(
3141            inner: T,
3142            interceptor: F,
3143        ) -> UserServiceClient<InterceptedService<T, F>>
3144        where
3145            F: tonic::service::Interceptor,
3146            T::ResponseBody: Default,
3147            T: tonic::codegen::Service<
3148                http::Request<tonic::body::BoxBody>,
3149                Response = http::Response<
3150                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
3151                >,
3152            >,
3153            <T as tonic::codegen::Service<
3154                http::Request<tonic::body::BoxBody>,
3155            >>::Error: Into<StdError> + Send + Sync,
3156        {
3157            UserServiceClient::new(InterceptedService::new(inner, interceptor))
3158        }
3159        /// Compress requests with the given encoding.
3160        ///
3161        /// This requires the server to support it otherwise it might respond with an
3162        /// error.
3163        #[must_use]
3164        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3165            self.inner = self.inner.send_compressed(encoding);
3166            self
3167        }
3168        /// Enable decompressing responses.
3169        #[must_use]
3170        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3171            self.inner = self.inner.accept_compressed(encoding);
3172            self
3173        }
3174        /// Limits the maximum size of a decoded message.
3175        ///
3176        /// Default: `4MB`
3177        #[must_use]
3178        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3179            self.inner = self.inner.max_decoding_message_size(limit);
3180            self
3181        }
3182        /// Limits the maximum size of an encoded message.
3183        ///
3184        /// Default: `usize::MAX`
3185        #[must_use]
3186        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3187            self.inner = self.inner.max_encoding_message_size(limit);
3188            self
3189        }
3190        /// Returns the specified SQL Server user.
3191        ///
3192        /// To get the list of available SQL Server users, make a [List] request.
3193        pub async fn get(
3194            &mut self,
3195            request: impl tonic::IntoRequest<super::GetUserRequest>,
3196        ) -> std::result::Result<tonic::Response<super::User>, tonic::Status> {
3197            self.inner
3198                .ready()
3199                .await
3200                .map_err(|e| {
3201                    tonic::Status::new(
3202                        tonic::Code::Unknown,
3203                        format!("Service was not ready: {}", e.into()),
3204                    )
3205                })?;
3206            let codec = tonic::codec::ProstCodec::default();
3207            let path = http::uri::PathAndQuery::from_static(
3208                "/yandex.cloud.mdb.sqlserver.v1.UserService/Get",
3209            );
3210            let mut req = request.into_request();
3211            req.extensions_mut()
3212                .insert(
3213                    GrpcMethod::new("yandex.cloud.mdb.sqlserver.v1.UserService", "Get"),
3214                );
3215            self.inner.unary(req, path, codec).await
3216        }
3217        /// Retrieves a list of SQL Server users in the specified cluster.
3218        pub async fn list(
3219            &mut self,
3220            request: impl tonic::IntoRequest<super::ListUsersRequest>,
3221        ) -> std::result::Result<
3222            tonic::Response<super::ListUsersResponse>,
3223            tonic::Status,
3224        > {
3225            self.inner
3226                .ready()
3227                .await
3228                .map_err(|e| {
3229                    tonic::Status::new(
3230                        tonic::Code::Unknown,
3231                        format!("Service was not ready: {}", e.into()),
3232                    )
3233                })?;
3234            let codec = tonic::codec::ProstCodec::default();
3235            let path = http::uri::PathAndQuery::from_static(
3236                "/yandex.cloud.mdb.sqlserver.v1.UserService/List",
3237            );
3238            let mut req = request.into_request();
3239            req.extensions_mut()
3240                .insert(
3241                    GrpcMethod::new("yandex.cloud.mdb.sqlserver.v1.UserService", "List"),
3242                );
3243            self.inner.unary(req, path, codec).await
3244        }
3245        /// Creates an SQL Server user in the specified cluster.
3246        pub async fn create(
3247            &mut self,
3248            request: impl tonic::IntoRequest<super::CreateUserRequest>,
3249        ) -> std::result::Result<
3250            tonic::Response<super::super::super::super::operation::Operation>,
3251            tonic::Status,
3252        > {
3253            self.inner
3254                .ready()
3255                .await
3256                .map_err(|e| {
3257                    tonic::Status::new(
3258                        tonic::Code::Unknown,
3259                        format!("Service was not ready: {}", e.into()),
3260                    )
3261                })?;
3262            let codec = tonic::codec::ProstCodec::default();
3263            let path = http::uri::PathAndQuery::from_static(
3264                "/yandex.cloud.mdb.sqlserver.v1.UserService/Create",
3265            );
3266            let mut req = request.into_request();
3267            req.extensions_mut()
3268                .insert(
3269                    GrpcMethod::new(
3270                        "yandex.cloud.mdb.sqlserver.v1.UserService",
3271                        "Create",
3272                    ),
3273                );
3274            self.inner.unary(req, path, codec).await
3275        }
3276        /// Modifies the specified SQL Server user.
3277        pub async fn update(
3278            &mut self,
3279            request: impl tonic::IntoRequest<super::UpdateUserRequest>,
3280        ) -> std::result::Result<
3281            tonic::Response<super::super::super::super::operation::Operation>,
3282            tonic::Status,
3283        > {
3284            self.inner
3285                .ready()
3286                .await
3287                .map_err(|e| {
3288                    tonic::Status::new(
3289                        tonic::Code::Unknown,
3290                        format!("Service was not ready: {}", e.into()),
3291                    )
3292                })?;
3293            let codec = tonic::codec::ProstCodec::default();
3294            let path = http::uri::PathAndQuery::from_static(
3295                "/yandex.cloud.mdb.sqlserver.v1.UserService/Update",
3296            );
3297            let mut req = request.into_request();
3298            req.extensions_mut()
3299                .insert(
3300                    GrpcMethod::new(
3301                        "yandex.cloud.mdb.sqlserver.v1.UserService",
3302                        "Update",
3303                    ),
3304                );
3305            self.inner.unary(req, path, codec).await
3306        }
3307        /// Deletes the specified SQL Server user.
3308        pub async fn delete(
3309            &mut self,
3310            request: impl tonic::IntoRequest<super::DeleteUserRequest>,
3311        ) -> std::result::Result<
3312            tonic::Response<super::super::super::super::operation::Operation>,
3313            tonic::Status,
3314        > {
3315            self.inner
3316                .ready()
3317                .await
3318                .map_err(|e| {
3319                    tonic::Status::new(
3320                        tonic::Code::Unknown,
3321                        format!("Service was not ready: {}", e.into()),
3322                    )
3323                })?;
3324            let codec = tonic::codec::ProstCodec::default();
3325            let path = http::uri::PathAndQuery::from_static(
3326                "/yandex.cloud.mdb.sqlserver.v1.UserService/Delete",
3327            );
3328            let mut req = request.into_request();
3329            req.extensions_mut()
3330                .insert(
3331                    GrpcMethod::new(
3332                        "yandex.cloud.mdb.sqlserver.v1.UserService",
3333                        "Delete",
3334                    ),
3335                );
3336            self.inner.unary(req, path, codec).await
3337        }
3338        /// Grants a permission to the specified SQL Server user.
3339        pub async fn grant_permission(
3340            &mut self,
3341            request: impl tonic::IntoRequest<super::GrantUserPermissionRequest>,
3342        ) -> std::result::Result<
3343            tonic::Response<super::super::super::super::operation::Operation>,
3344            tonic::Status,
3345        > {
3346            self.inner
3347                .ready()
3348                .await
3349                .map_err(|e| {
3350                    tonic::Status::new(
3351                        tonic::Code::Unknown,
3352                        format!("Service was not ready: {}", e.into()),
3353                    )
3354                })?;
3355            let codec = tonic::codec::ProstCodec::default();
3356            let path = http::uri::PathAndQuery::from_static(
3357                "/yandex.cloud.mdb.sqlserver.v1.UserService/GrantPermission",
3358            );
3359            let mut req = request.into_request();
3360            req.extensions_mut()
3361                .insert(
3362                    GrpcMethod::new(
3363                        "yandex.cloud.mdb.sqlserver.v1.UserService",
3364                        "GrantPermission",
3365                    ),
3366                );
3367            self.inner.unary(req, path, codec).await
3368        }
3369        /// Revokes a permission from the specified SQL Server user.
3370        pub async fn revoke_permission(
3371            &mut self,
3372            request: impl tonic::IntoRequest<super::RevokeUserPermissionRequest>,
3373        ) -> std::result::Result<
3374            tonic::Response<super::super::super::super::operation::Operation>,
3375            tonic::Status,
3376        > {
3377            self.inner
3378                .ready()
3379                .await
3380                .map_err(|e| {
3381                    tonic::Status::new(
3382                        tonic::Code::Unknown,
3383                        format!("Service was not ready: {}", e.into()),
3384                    )
3385                })?;
3386            let codec = tonic::codec::ProstCodec::default();
3387            let path = http::uri::PathAndQuery::from_static(
3388                "/yandex.cloud.mdb.sqlserver.v1.UserService/RevokePermission",
3389            );
3390            let mut req = request.into_request();
3391            req.extensions_mut()
3392                .insert(
3393                    GrpcMethod::new(
3394                        "yandex.cloud.mdb.sqlserver.v1.UserService",
3395                        "RevokePermission",
3396                    ),
3397                );
3398            self.inner.unary(req, path, codec).await
3399        }
3400    }
3401}