#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackupSchedule {
#[prost(message, optional, tag = "3")]
pub next_execute_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "backup_schedule::Policy", tags = "1, 2, 4")]
pub policy: ::core::option::Option<backup_schedule::Policy>,
}
pub mod backup_schedule {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Policy {
#[prost(message, tag = "1")]
DailyBackupSchedule(super::DailyBackupSchedule),
#[prost(message, tag = "2")]
WeeklyBackupSchedule(super::WeeklyBackupSchedule),
#[prost(message, tag = "4")]
RecurringBackupSchedule(super::RecurringBackupSchedule),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecurringBackupSchedule {
#[prost(message, optional, tag = "1")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "2")]
pub recurrence: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DaysOfWeekBackupSchedule {
#[prost(
enumeration = "super::super::super::super::google::r#type::DayOfWeek",
repeated,
packed = "false",
tag = "1"
)]
pub days: ::prost::alloc::vec::Vec<i32>,
#[prost(message, optional, tag = "2")]
pub execute_time: ::core::option::Option<
super::super::super::super::google::r#type::TimeOfDay,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WeeklyBackupSchedule {
#[prost(message, repeated, tag = "1")]
pub days_of_week: ::prost::alloc::vec::Vec<DaysOfWeekBackupSchedule>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DailyBackupSchedule {
#[prost(message, optional, tag = "1")]
pub execute_time: ::core::option::Option<
super::super::super::super::google::r#type::TimeOfDay,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackupSettings {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub backup_schedule: ::core::option::Option<BackupSchedule>,
#[prost(message, optional, tag = "4")]
pub backup_time_to_live: ::core::option::Option<::prost_types::Duration>,
#[prost(string, repeated, tag = "5")]
pub source_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "6")]
pub source_paths_to_exclude: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
#[prost(enumeration = "backup_settings::Type", tag = "7")]
pub r#type: i32,
#[prost(enumeration = "backup_settings::StorageClass", tag = "8")]
pub storage_class: i32,
}
pub mod backup_settings {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Unspecified = 0,
System = 1,
User = 2,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Unspecified => "TYPE_UNSPECIFIED",
Type::System => "SYSTEM",
Type::User => "USER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SYSTEM" => Some(Self::System),
"USER" => Some(Self::User),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum StorageClass {
Unspecified = 0,
Standard = 1,
ReducedRedundancy = 2,
StandardIa = 3,
OnezoneIa = 4,
IntelligentTiering = 5,
Glacier = 6,
DeepArchive = 7,
Outposts = 8,
}
impl StorageClass {
pub fn as_str_name(&self) -> &'static str {
match self {
StorageClass::Unspecified => "STORAGE_CLASS_UNSPECIFIED",
StorageClass::Standard => "STANDARD",
StorageClass::ReducedRedundancy => "REDUCED_REDUNDANCY",
StorageClass::StandardIa => "STANDARD_IA",
StorageClass::OnezoneIa => "ONEZONE_IA",
StorageClass::IntelligentTiering => "INTELLIGENT_TIERING",
StorageClass::Glacier => "GLACIER",
StorageClass::DeepArchive => "DEEP_ARCHIVE",
StorageClass::Outposts => "OUTPOSTS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STORAGE_CLASS_UNSPECIFIED" => Some(Self::Unspecified),
"STANDARD" => Some(Self::Standard),
"REDUCED_REDUNDANCY" => Some(Self::ReducedRedundancy),
"STANDARD_IA" => Some(Self::StandardIa),
"ONEZONE_IA" => Some(Self::OnezoneIa),
"INTELLIGENT_TIERING" => Some(Self::IntelligentTiering),
"GLACIER" => Some(Self::Glacier),
"DEEP_ARCHIVE" => Some(Self::DeepArchive),
"OUTPOSTS" => Some(Self::Outposts),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackupConfig {
#[prost(message, repeated, tag = "1")]
pub backup_settings: ::prost::alloc::vec::Vec<BackupSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Backup {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub started_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub completed_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "backup::Status", tag = "9")]
pub status: i32,
#[prost(message, optional, tag = "10")]
pub backup_settings: ::core::option::Option<BackupSettings>,
#[prost(enumeration = "backup::Type", tag = "11")]
pub r#type: i32,
#[prost(int64, tag = "12")]
pub size: i64,
}
pub mod backup {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
Unspecified = 0,
Creating = 1,
Ready = 2,
Error = 3,
Cancelled = 4,
}
impl Status {
pub fn as_str_name(&self) -> &'static str {
match self {
Status::Unspecified => "STATUS_UNSPECIFIED",
Status::Creating => "CREATING",
Status::Ready => "READY",
Status::Error => "ERROR",
Status::Cancelled => "CANCELLED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"CREATING" => Some(Self::Creating),
"READY" => Some(Self::Ready),
"ERROR" => Some(Self::Error),
"CANCELLED" => Some(Self::Cancelled),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Unspecified = 0,
System = 1,
User = 2,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Unspecified => "TYPE_UNSPECIFIED",
Type::System => "SYSTEM",
Type::User => "USER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SYSTEM" => Some(Self::System),
"USER" => Some(Self::User),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPathsRequest {
#[prost(string, tag = "1")]
pub backup_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub page_size: i64,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPathsResponse {
#[prost(string, repeated, tag = "1")]
pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBackupRequest {
#[prost(string, tag = "1")]
pub backup_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBackupsRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub page_size: i64,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBackupsResponse {
#[prost(message, repeated, tag = "1")]
pub backups: ::prost::alloc::vec::Vec<Backup>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteBackupRequest {
#[prost(string, tag = "1")]
pub backup_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteBackupMetadata {
#[prost(string, tag = "1")]
pub backup_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_id: ::prost::alloc::string::String,
}
pub mod backup_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct BackupServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl BackupServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> BackupServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> BackupServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
BackupServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetBackupRequest>,
) -> std::result::Result<tonic::Response<super::Backup>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.BackupService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.BackupService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn list_paths(
&mut self,
request: impl tonic::IntoRequest<super::ListPathsRequest>,
) -> std::result::Result<
tonic::Response<super::ListPathsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.BackupService/ListPaths",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.BackupService", "ListPaths"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListBackupsRequest>,
) -> std::result::Result<
tonic::Response<super::ListBackupsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.BackupService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.BackupService", "List"));
self.inner.unary(req, path, codec).await
}
pub async fn list_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::ListAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::access::ListAccessBindingsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.BackupService/ListAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ydb.v1.BackupService",
"ListAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn set_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::SetAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.BackupService/SetAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ydb.v1.BackupService",
"SetAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::UpdateAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.BackupService/UpdateAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ydb.v1.BackupService",
"UpdateAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteBackupRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.BackupService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.BackupService", "Delete"));
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Database {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub folder_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
#[prost(enumeration = "database::Status", tag = "6")]
pub status: i32,
#[prost(string, tag = "8")]
pub endpoint: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub resource_preset_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "10")]
pub storage_config: ::core::option::Option<StorageConfig>,
#[prost(message, optional, tag = "11")]
pub scale_policy: ::core::option::Option<ScalePolicy>,
#[prost(string, tag = "12")]
pub network_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "13")]
pub subnet_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag = "16")]
pub assign_public_ips: bool,
#[prost(string, tag = "17")]
pub location_id: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "20")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "21")]
pub backup_config: ::core::option::Option<BackupConfig>,
#[prost(string, tag = "22")]
pub document_api_endpoint: ::prost::alloc::string::String,
#[prost(string, tag = "23")]
pub kinesis_api_endpoint: ::prost::alloc::string::String,
#[prost(string, tag = "26")]
pub kafka_api_endpoint: ::prost::alloc::string::String,
#[prost(message, optional, tag = "24")]
pub monitoring_config: ::core::option::Option<MonitoringConfig>,
#[prost(bool, tag = "25")]
pub deletion_protection: bool,
#[prost(string, repeated, tag = "27")]
pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(oneof = "database::DatabaseType", tags = "14, 15, 18, 19")]
pub database_type: ::core::option::Option<database::DatabaseType>,
}
pub mod database {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
Unspecified = 0,
Provisioning = 1,
Running = 2,
Updating = 4,
Error = 5,
Deleting = 6,
Starting = 7,
Stopped = 8,
}
impl Status {
pub fn as_str_name(&self) -> &'static str {
match self {
Status::Unspecified => "STATUS_UNSPECIFIED",
Status::Provisioning => "PROVISIONING",
Status::Running => "RUNNING",
Status::Updating => "UPDATING",
Status::Error => "ERROR",
Status::Deleting => "DELETING",
Status::Starting => "STARTING",
Status::Stopped => "STOPPED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"PROVISIONING" => Some(Self::Provisioning),
"RUNNING" => Some(Self::Running),
"UPDATING" => Some(Self::Updating),
"ERROR" => Some(Self::Error),
"DELETING" => Some(Self::Deleting),
"STARTING" => Some(Self::Starting),
"STOPPED" => Some(Self::Stopped),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum DatabaseType {
#[prost(message, tag = "14")]
ZonalDatabase(super::ZonalDatabase),
#[prost(message, tag = "15")]
RegionalDatabase(super::RegionalDatabase),
#[prost(message, tag = "18")]
DedicatedDatabase(super::DedicatedDatabase),
#[prost(message, tag = "19")]
ServerlessDatabase(super::ServerlessDatabase),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlertParameter {
#[prost(oneof = "alert_parameter::Parameter", tags = "1, 2, 3, 4, 5")]
pub parameter: ::core::option::Option<alert_parameter::Parameter>,
}
pub mod alert_parameter {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DoubleParameterValue {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(double, tag = "2")]
pub value: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IntegerParameterValue {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub value: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextParameterValue {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextListParameterValue {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LabelListParameterValue {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Parameter {
#[prost(message, tag = "1")]
DoubleParameterValue(DoubleParameterValue),
#[prost(message, tag = "2")]
IntegerParameterValue(IntegerParameterValue),
#[prost(message, tag = "3")]
TextParameterValue(TextParameterValue),
#[prost(message, tag = "4")]
TextListParameterValue(TextListParameterValue),
#[prost(message, tag = "5")]
LabelListParameterValue(LabelListParameterValue),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotificationChannel {
#[prost(string, tag = "1")]
pub notification_channel_id: ::prost::alloc::string::String,
#[prost(enumeration = "AlertEvaluationStatus", repeated, tag = "2")]
pub notify_about_statuses: ::prost::alloc::vec::Vec<i32>,
#[prost(int64, tag = "3")]
pub repeate_notify_delay_ms: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Alert {
#[prost(string, tag = "1")]
pub alert_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alert_template_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub description: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "5")]
pub notification_channels: ::prost::alloc::vec::Vec<NotificationChannel>,
#[prost(message, repeated, tag = "6")]
pub alert_parameters: ::prost::alloc::vec::Vec<AlertParameter>,
#[prost(message, repeated, tag = "7")]
pub alert_thresholds: ::prost::alloc::vec::Vec<AlertParameter>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MonitoringConfig {
#[prost(message, repeated, tag = "1")]
pub alerts: ::prost::alloc::vec::Vec<Alert>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DedicatedDatabase {
#[prost(string, tag = "1")]
pub resource_preset_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub storage_config: ::core::option::Option<StorageConfig>,
#[prost(message, optional, tag = "3")]
pub scale_policy: ::core::option::Option<ScalePolicy>,
#[prost(string, tag = "4")]
pub network_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "5")]
pub subnet_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag = "6")]
pub assign_public_ips: bool,
#[prost(string, repeated, tag = "7")]
pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerlessDatabase {
#[prost(int64, tag = "1")]
pub throttling_rcu_limit: i64,
#[prost(int64, tag = "2")]
pub storage_size_limit: i64,
#[prost(bool, tag = "3")]
pub enable_throttling_rcu_limit: bool,
#[prost(int64, tag = "4")]
pub provisioned_rcu_limit: i64,
#[prost(int64, tag = "5")]
pub topic_write_quota: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZonalDatabase {
#[prost(string, tag = "1")]
pub zone_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegionalDatabase {
#[prost(string, tag = "1")]
pub region_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScalePolicy {
#[prost(oneof = "scale_policy::ScaleType", tags = "1, 2")]
pub scale_type: ::core::option::Option<scale_policy::ScaleType>,
}
pub mod scale_policy {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FixedScale {
#[prost(int64, tag = "1")]
pub size: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AutoScale {
#[prost(int64, tag = "1")]
pub min_size: i64,
#[prost(int64, tag = "2")]
pub max_size: i64,
#[prost(oneof = "auto_scale::AutoScaleType", tags = "3")]
pub auto_scale_type: ::core::option::Option<auto_scale::AutoScaleType>,
}
pub mod auto_scale {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TargetTracking {
#[prost(oneof = "target_tracking::Target", tags = "1")]
pub target: ::core::option::Option<target_tracking::Target>,
}
pub mod target_tracking {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
#[prost(int64, tag = "1")]
CpuUtilizationPercent(i64),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum AutoScaleType {
#[prost(message, tag = "3")]
TargetTracking(TargetTracking),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ScaleType {
#[prost(message, tag = "1")]
FixedScale(FixedScale),
#[prost(message, tag = "2")]
AutoScale(AutoScale),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StorageConfig {
#[prost(message, repeated, tag = "1")]
pub storage_options: ::prost::alloc::vec::Vec<StorageOption>,
#[prost(int64, tag = "2")]
pub storage_size_limit: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StorageOption {
#[prost(string, tag = "1")]
pub storage_type_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub group_count: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AlertEvaluationStatus {
Unspecified = 0,
Ok = 1,
NoData = 2,
Error = 3,
Alarm = 4,
Warn = 5,
}
impl AlertEvaluationStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
AlertEvaluationStatus::Unspecified => "ALERT_EVALUATION_STATUS_UNSPECIFIED",
AlertEvaluationStatus::Ok => "ALERT_EVALUATION_STATUS_OK",
AlertEvaluationStatus::NoData => "ALERT_EVALUATION_STATUS_NO_DATA",
AlertEvaluationStatus::Error => "ALERT_EVALUATION_STATUS_ERROR",
AlertEvaluationStatus::Alarm => "ALERT_EVALUATION_STATUS_ALARM",
AlertEvaluationStatus::Warn => "ALERT_EVALUATION_STATUS_WARN",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ALERT_EVALUATION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"ALERT_EVALUATION_STATUS_OK" => Some(Self::Ok),
"ALERT_EVALUATION_STATUS_NO_DATA" => Some(Self::NoData),
"ALERT_EVALUATION_STATUS_ERROR" => Some(Self::Error),
"ALERT_EVALUATION_STATUS_ALARM" => Some(Self::Alarm),
"ALERT_EVALUATION_STATUS_WARN" => Some(Self::Warn),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveDatabaseRequest {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub destination_folder_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveDatabaseMetadata {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreBackupRequest {
#[prost(string, tag = "1")]
pub backup_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub paths_to_restore: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "4")]
pub target_path: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreBackupMetadata {
#[prost(string, tag = "1")]
pub backup_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackupDatabaseRequest {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub backup_settings: ::core::option::Option<BackupSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackupDatabaseMetadata {
#[prost(string, tag = "1")]
pub backup_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartDatabaseRequest {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartDatabaseMetadata {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopDatabaseRequest {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopDatabaseMetadata {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDatabaseRequest {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDatabasesRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub page_size: i64,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDatabasesResponse {
#[prost(message, repeated, tag = "1")]
pub databases: ::prost::alloc::vec::Vec<Database>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateDatabaseRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub resource_preset_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub storage_config: ::core::option::Option<StorageConfig>,
#[prost(message, optional, tag = "6")]
pub scale_policy: ::core::option::Option<ScalePolicy>,
#[prost(string, tag = "7")]
pub network_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "8")]
pub subnet_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag = "11")]
pub assign_public_ips: bool,
#[prost(string, tag = "12")]
pub location_id: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "15")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "16")]
pub backup_config: ::core::option::Option<BackupConfig>,
#[prost(message, optional, tag = "17")]
pub monitoring_config: ::core::option::Option<MonitoringConfig>,
#[prost(bool, tag = "18")]
pub deletion_protection: bool,
#[prost(string, repeated, tag = "19")]
pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(oneof = "create_database_request::DatabaseType", tags = "9, 10, 13, 14")]
pub database_type: ::core::option::Option<create_database_request::DatabaseType>,
}
pub mod create_database_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum DatabaseType {
#[prost(message, tag = "9")]
ZonalDatabase(super::ZonalDatabase),
#[prost(message, tag = "10")]
RegionalDatabase(super::RegionalDatabase),
#[prost(message, tag = "13")]
DedicatedDatabase(super::DedicatedDatabase),
#[prost(message, tag = "14")]
ServerlessDatabase(super::ServerlessDatabase),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateDatabaseMetadata {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateDatabaseRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(string, tag = "3")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub resource_preset_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub storage_config: ::core::option::Option<StorageConfig>,
#[prost(message, optional, tag = "8")]
pub scale_policy: ::core::option::Option<ScalePolicy>,
#[prost(string, tag = "9")]
pub network_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "10")]
pub subnet_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag = "13")]
pub assign_public_ips: bool,
#[prost(string, tag = "14")]
pub location_id: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "17")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "18")]
pub backup_config: ::core::option::Option<BackupConfig>,
#[prost(message, optional, tag = "19")]
pub monitoring_config: ::core::option::Option<MonitoringConfig>,
#[prost(bool, tag = "20")]
pub deletion_protection: bool,
#[prost(string, repeated, tag = "21")]
pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(oneof = "update_database_request::DatabaseType", tags = "11, 12, 15, 16")]
pub database_type: ::core::option::Option<update_database_request::DatabaseType>,
}
pub mod update_database_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum DatabaseType {
#[prost(message, tag = "11")]
ZonalDatabase(super::ZonalDatabase),
#[prost(message, tag = "12")]
RegionalDatabase(super::RegionalDatabase),
#[prost(message, tag = "15")]
DedicatedDatabase(super::DedicatedDatabase),
#[prost(message, tag = "16")]
ServerlessDatabase(super::ServerlessDatabase),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateDatabaseMetadata {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteDatabaseRequest {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteDatabaseMetadata {
#[prost(string, tag = "1")]
pub database_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub database_name: ::prost::alloc::string::String,
}
pub mod database_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct DatabaseServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DatabaseServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DatabaseServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DatabaseServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
DatabaseServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetDatabaseRequest>,
) -> std::result::Result<tonic::Response<super::Database>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListDatabasesRequest>,
) -> std::result::Result<
tonic::Response<super::ListDatabasesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "List"));
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateDatabaseRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Create"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateDatabaseRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Update"),
);
self.inner.unary(req, path, codec).await
}
pub async fn start(
&mut self,
request: impl tonic::IntoRequest<super::StartDatabaseRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Start",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Start"));
self.inner.unary(req, path, codec).await
}
pub async fn stop(
&mut self,
request: impl tonic::IntoRequest<super::StopDatabaseRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Stop",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Stop"));
self.inner.unary(req, path, codec).await
}
pub async fn r#move(
&mut self,
request: impl tonic::IntoRequest<super::MoveDatabaseRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Move",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Move"));
self.inner.unary(req, path, codec).await
}
pub async fn list_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::ListAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::access::ListAccessBindingsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/ListAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ydb.v1.DatabaseService",
"ListAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn set_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::SetAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/SetAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ydb.v1.DatabaseService",
"SetAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::UpdateAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/UpdateAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ydb.v1.DatabaseService",
"UpdateAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteDatabaseRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
pub async fn restore(
&mut self,
request: impl tonic::IntoRequest<super::RestoreBackupRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Restore",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Restore"),
);
self.inner.unary(req, path, codec).await
}
pub async fn backup(
&mut self,
request: impl tonic::IntoRequest<super::BackupDatabaseRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.DatabaseService/Backup",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.DatabaseService", "Backup"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Location {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLocationRequest {
#[prost(string, tag = "1")]
pub location_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocationsRequest {
#[prost(int64, tag = "1")]
pub page_size: i64,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocationsResponse {
#[prost(message, repeated, tag = "1")]
pub locations: ::prost::alloc::vec::Vec<Location>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
pub mod location_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct LocationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LocationServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> LocationServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> LocationServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
LocationServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetLocationRequest>,
) -> std::result::Result<tonic::Response<super::Location>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.LocationService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.LocationService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListLocationsRequest>,
) -> std::result::Result<
tonic::Response<super::ListLocationsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.LocationService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ydb.v1.LocationService", "List"));
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourcePreset {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub cores: i64,
#[prost(int64, tag = "3")]
pub memory: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetResourcePresetRequest {
#[prost(string, tag = "1")]
pub resource_preset_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourcePresetsRequest {
#[prost(int64, tag = "1")]
pub page_size: i64,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourcePresetsResponse {
#[prost(message, repeated, tag = "1")]
pub resource_presets: ::prost::alloc::vec::Vec<ResourcePreset>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
pub mod resource_preset_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ResourcePresetServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ResourcePresetServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ResourcePresetServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ResourcePresetServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
ResourcePresetServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetResourcePresetRequest>,
) -> std::result::Result<tonic::Response<super::ResourcePreset>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.ResourcePresetService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.ResourcePresetService", "Get"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListResourcePresetsRequest>,
) -> std::result::Result<
tonic::Response<super::ListResourcePresetsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.ResourcePresetService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.ResourcePresetService", "List"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StorageType {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub device_type: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub redundancy_type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetStorageTypeRequest {
#[prost(string, tag = "1")]
pub storage_type_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListStorageTypesRequest {
#[prost(int64, tag = "1")]
pub page_size: i64,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListStorageTypesResponse {
#[prost(message, repeated, tag = "1")]
pub storage_types: ::prost::alloc::vec::Vec<StorageType>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
pub mod storage_type_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct StorageTypeServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl StorageTypeServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> StorageTypeServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> StorageTypeServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
StorageTypeServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetStorageTypeRequest>,
) -> std::result::Result<tonic::Response<super::StorageType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.StorageTypeService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.StorageTypeService", "Get"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListStorageTypesRequest>,
) -> std::result::Result<
tonic::Response<super::ListStorageTypesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ydb.v1.StorageTypeService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ydb.v1.StorageTypeService", "List"),
);
self.inner.unary(req, path, codec).await
}
}
}