#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Endpoint {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub folder_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(map = "string, string", tag = "6")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "52")]
pub settings: ::core::option::Option<EndpointSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndpointSettings {
#[prost(
oneof = "endpoint_settings::Settings",
tags = "1, 2, 3, 7, 8, 9, 16, 101, 102, 104, 105, 110, 111, 146, 150"
)]
pub settings: ::core::option::Option<endpoint_settings::Settings>,
}
pub mod endpoint_settings {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Settings {
#[prost(message, tag = "1")]
MysqlSource(super::endpoint::MysqlSource),
#[prost(message, tag = "2")]
PostgresSource(super::endpoint::PostgresSource),
#[prost(message, tag = "3")]
YdbSource(super::endpoint::YdbSource),
#[prost(message, tag = "7")]
YdsSource(super::endpoint::YdsSource),
#[prost(message, tag = "8")]
KafkaSource(super::endpoint::KafkaSource),
#[prost(message, tag = "9")]
MongoSource(super::endpoint::MongoSource),
#[prost(message, tag = "16")]
ClickhouseSource(super::endpoint::ClickhouseSource),
#[prost(message, tag = "101")]
MysqlTarget(super::endpoint::MysqlTarget),
#[prost(message, tag = "102")]
PostgresTarget(super::endpoint::PostgresTarget),
#[prost(message, tag = "104")]
ClickhouseTarget(super::endpoint::ClickhouseTarget),
#[prost(message, tag = "105")]
YdbTarget(super::endpoint::YdbTarget),
#[prost(message, tag = "110")]
KafkaTarget(super::endpoint::KafkaTarget),
#[prost(message, tag = "111")]
MongoTarget(super::endpoint::MongoTarget),
#[prost(message, tag = "146")]
MetrikaSource(super::endpoint::MetrikaSource),
#[prost(message, tag = "150")]
YdsTarget(super::endpoint::YdsTarget),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEndpointRequest {
#[prost(string, tag = "1")]
pub endpoint_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEndpointsRequest {
#[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 ListEndpointsResponse {
#[prost(message, repeated, tag = "1")]
pub endpoints: ::prost::alloc::vec::Vec<Endpoint>,
#[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 CreateEndpointRequest {
#[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(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "52")]
pub settings: ::core::option::Option<EndpointSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateEndpointMetadata {
#[prost(string, tag = "1")]
pub endpoint_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateEndpointRequest {
#[prost(string, tag = "10")]
pub endpoint_id: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "13")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "52")]
pub settings: ::core::option::Option<EndpointSettings>,
#[prost(message, optional, tag = "60")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateEndpointMetadata {
#[prost(string, tag = "1")]
pub endpoint_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteEndpointRequest {
#[prost(string, tag = "1")]
pub endpoint_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteEndpointMetadata {
#[prost(string, tag = "1")]
pub endpoint_id: ::prost::alloc::string::String,
}
pub mod endpoint_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 EndpointServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl EndpointServiceClient<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> EndpointServiceClient<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,
) -> EndpointServiceClient<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,
{
EndpointServiceClient::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::GetEndpointRequest>,
) -> std::result::Result<tonic::Response<super::Endpoint>, 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.datatransfer.v1.EndpointService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.EndpointService",
"Get",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListEndpointsRequest>,
) -> std::result::Result<
tonic::Response<super::ListEndpointsResponse>,
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.datatransfer.v1.EndpointService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.EndpointService",
"List",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateEndpointRequest>,
) -> 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.datatransfer.v1.EndpointService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.EndpointService",
"Create",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateEndpointRequest>,
) -> 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.datatransfer.v1.EndpointService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.EndpointService",
"Update",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteEndpointRequest>,
) -> 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.datatransfer.v1.EndpointService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.EndpointService",
"Delete",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transfer {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub folder_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(map = "string, string", tag = "6")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "7")]
pub source: ::core::option::Option<Endpoint>,
#[prost(message, optional, tag = "8")]
pub target: ::core::option::Option<Endpoint>,
#[prost(message, optional, tag = "9")]
pub runtime: ::core::option::Option<Runtime>,
#[prost(enumeration = "TransferStatus", tag = "10")]
pub status: i32,
#[prost(enumeration = "TransferType", tag = "12")]
pub r#type: i32,
#[prost(string, tag = "15")]
pub warning: ::prost::alloc::string::String,
#[prost(message, optional, tag = "17")]
pub transformation: ::core::option::Option<Transformation>,
#[prost(message, optional, tag = "19")]
pub data_objects: ::core::option::Option<DataObjects>,
#[prost(bool, tag = "22")]
pub prestable: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Runtime {
#[prost(oneof = "runtime::Runtime", tags = "4")]
pub runtime: ::core::option::Option<runtime::Runtime>,
}
pub mod runtime {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Runtime {
#[prost(message, tag = "4")]
YcRuntime(super::YcRuntime),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShardingUploadParams {
#[prost(int64, tag = "1")]
pub job_count: i64,
#[prost(int64, tag = "2")]
pub process_count: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct YcRuntime {
#[prost(int64, tag = "1")]
pub job_count: i64,
#[prost(message, optional, tag = "8")]
pub upload_shard_params: ::core::option::Option<ShardingUploadParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaskFunction {
#[prost(oneof = "mask_function::MaskFunction", tags = "1")]
pub mask_function: ::core::option::Option<mask_function::MaskFunction>,
}
pub mod mask_function {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum MaskFunction {
#[prost(message, tag = "1")]
MaskFunctionHash(super::MaskFunctionHash),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaskFunctionHash {
#[prost(string, tag = "1")]
pub user_defined_salt: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TablesFilter {
#[prost(string, repeated, tag = "1")]
pub include_tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub exclude_tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnsFilter {
#[prost(string, repeated, tag = "1")]
pub include_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub exclude_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaskFieldTransformer {
#[prost(message, optional, tag = "1")]
pub tables: ::core::option::Option<TablesFilter>,
#[prost(string, repeated, tag = "2")]
pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub function: ::core::option::Option<MaskFunction>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilterColumnsTransformer {
#[prost(message, optional, tag = "1")]
pub tables: ::core::option::Option<TablesFilter>,
#[prost(message, optional, tag = "2")]
pub columns: ::core::option::Option<ColumnsFilter>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Table {
#[prost(string, tag = "1")]
pub name_space: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RenameTable {
#[prost(message, optional, tag = "1")]
pub original_name: ::core::option::Option<Table>,
#[prost(message, optional, tag = "2")]
pub new_name: ::core::option::Option<Table>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RenameTablesTransformer {
#[prost(message, repeated, tag = "1")]
pub rename_tables: ::prost::alloc::vec::Vec<RenameTable>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplacePrimaryKeyTransformer {
#[prost(message, optional, tag = "1")]
pub tables: ::core::option::Option<TablesFilter>,
#[prost(string, repeated, tag = "2")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToStringTransformer {
#[prost(message, optional, tag = "1")]
pub tables: ::core::option::Option<TablesFilter>,
#[prost(message, optional, tag = "2")]
pub columns: ::core::option::Option<ColumnsFilter>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SharderTransformer {
#[prost(message, optional, tag = "1")]
pub tables: ::core::option::Option<TablesFilter>,
#[prost(message, optional, tag = "2")]
pub columns: ::core::option::Option<ColumnsFilter>,
#[prost(int64, tag = "3")]
pub shards_count: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableSplitterTransformer {
#[prost(message, optional, tag = "1")]
pub tables: ::core::option::Option<TablesFilter>,
#[prost(string, repeated, tag = "2")]
pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub splitter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilterRowsTransformer {
#[prost(message, optional, tag = "1")]
pub tables: ::core::option::Option<TablesFilter>,
#[deprecated]
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub filters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transformer {
#[prost(oneof = "transformer::Transformer", tags = "1, 2, 4, 6, 7, 9, 13, 14")]
pub transformer: ::core::option::Option<transformer::Transformer>,
}
pub mod transformer {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Transformer {
#[prost(message, tag = "1")]
MaskField(super::MaskFieldTransformer),
#[prost(message, tag = "2")]
FilterColumns(super::FilterColumnsTransformer),
#[prost(message, tag = "4")]
RenameTables(super::RenameTablesTransformer),
#[prost(message, tag = "6")]
ReplacePrimaryKey(super::ReplacePrimaryKeyTransformer),
#[prost(message, tag = "7")]
ConvertToString(super::ToStringTransformer),
#[prost(message, tag = "9")]
SharderTransformer(super::SharderTransformer),
#[prost(message, tag = "13")]
TableSplitterTransformer(super::TableSplitterTransformer),
#[prost(message, tag = "14")]
FilterRows(super::FilterRowsTransformer),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transformation {
#[prost(message, repeated, tag = "1")]
pub transformers: ::prost::alloc::vec::Vec<Transformer>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataObjects {
#[prost(string, repeated, tag = "1")]
pub include_objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TransferType {
Unspecified = 0,
SnapshotAndIncrement = 1,
SnapshotOnly = 2,
IncrementOnly = 3,
}
impl TransferType {
pub fn as_str_name(&self) -> &'static str {
match self {
TransferType::Unspecified => "TRANSFER_TYPE_UNSPECIFIED",
TransferType::SnapshotAndIncrement => "SNAPSHOT_AND_INCREMENT",
TransferType::SnapshotOnly => "SNAPSHOT_ONLY",
TransferType::IncrementOnly => "INCREMENT_ONLY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSFER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SNAPSHOT_AND_INCREMENT" => Some(Self::SnapshotAndIncrement),
"SNAPSHOT_ONLY" => Some(Self::SnapshotOnly),
"INCREMENT_ONLY" => Some(Self::IncrementOnly),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TransferStatus {
Unspecified = 0,
Creating = 1,
Created = 2,
Running = 3,
Stopping = 4,
Stopped = 5,
Error = 6,
Snapshotting = 7,
Done = 8,
}
impl TransferStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
TransferStatus::Unspecified => "TRANSFER_STATUS_UNSPECIFIED",
TransferStatus::Creating => "CREATING",
TransferStatus::Created => "CREATED",
TransferStatus::Running => "RUNNING",
TransferStatus::Stopping => "STOPPING",
TransferStatus::Stopped => "STOPPED",
TransferStatus::Error => "ERROR",
TransferStatus::Snapshotting => "SNAPSHOTTING",
TransferStatus::Done => "DONE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSFER_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"CREATING" => Some(Self::Creating),
"CREATED" => Some(Self::Created),
"RUNNING" => Some(Self::Running),
"STOPPING" => Some(Self::Stopping),
"STOPPED" => Some(Self::Stopped),
"ERROR" => Some(Self::Error),
"SNAPSHOTTING" => Some(Self::Snapshotting),
"DONE" => Some(Self::Done),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTransferRequest {
#[prost(string, tag = "1")]
pub source_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub target_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub folder_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub runtime: ::core::option::Option<Runtime>,
#[prost(enumeration = "TransferType", tag = "6")]
pub r#type: i32,
#[prost(string, tag = "7")]
pub name: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "8")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "10")]
pub transformation: ::core::option::Option<Transformation>,
#[prost(message, optional, tag = "12")]
pub data_objects: ::core::option::Option<DataObjects>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTransferMetadata {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTransferRequest {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub runtime: ::core::option::Option<Runtime>,
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(map = "string, string", tag = "6")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "8")]
pub transformation: ::core::option::Option<Transformation>,
#[prost(message, optional, tag = "10")]
pub data_objects: ::core::option::Option<DataObjects>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTransferMetadata {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTransferRequest {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTransferMetadata {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTransfersRequest {
#[prost(string, tag = "2")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub page_size: i64,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTransfersResponse {
#[prost(message, repeated, tag = "1")]
pub transfers: ::prost::alloc::vec::Vec<Transfer>,
#[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 GetTransferRequest {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeactivateTransferRequest {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeactivateTransferMetadata {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateTransferRequest {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateTransferMetadata {
#[prost(string, tag = "1")]
pub transfer_id: ::prost::alloc::string::String,
}
pub mod transfer_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 TransferServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl TransferServiceClient<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> TransferServiceClient<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,
) -> TransferServiceClient<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,
{
TransferServiceClient::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 create(
&mut self,
request: impl tonic::IntoRequest<super::CreateTransferRequest>,
) -> 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.datatransfer.v1.TransferService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.TransferService",
"Create",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateTransferRequest>,
) -> 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.datatransfer.v1.TransferService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.TransferService",
"Update",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTransferRequest>,
) -> 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.datatransfer.v1.TransferService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.TransferService",
"Delete",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListTransfersRequest>,
) -> std::result::Result<
tonic::Response<super::ListTransfersResponse>,
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.datatransfer.v1.TransferService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.TransferService",
"List",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetTransferRequest>,
) -> std::result::Result<tonic::Response<super::Transfer>, 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.datatransfer.v1.TransferService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.TransferService",
"Get",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn deactivate(
&mut self,
request: impl tonic::IntoRequest<super::DeactivateTransferRequest>,
) -> 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.datatransfer.v1.TransferService/Deactivate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.TransferService",
"Deactivate",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn activate(
&mut self,
request: impl tonic::IntoRequest<super::ActivateTransferRequest>,
) -> 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.datatransfer.v1.TransferService/Activate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.datatransfer.v1.TransferService",
"Activate",
),
);
self.inner.unary(req, path, codec).await
}
}
}