use std::collections::BTreeMap;
use crate::copy::constants::{DESTINATION_PASSWORD_VARIABLE, SOURCE_PASSWORD_VARIABLE};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CopyProject {
pub text: String,
pub printed: String,
pub variables: BTreeMap<String, String>,
pub warnings: Vec<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Role {
Source,
Destination,
}
impl Role {
pub fn password_variable(self) -> &'static str {
match self {
Self::Source => SOURCE_PASSWORD_VARIABLE,
Self::Destination => DESTINATION_PASSWORD_VARIABLE,
}
}
pub fn label(self) -> &'static str {
match self {
Self::Source => "source",
Self::Destination => "destination",
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub struct Endpoint {
pub connection: String,
pub named: bool,
pub settings: toml::Table,
pub locator: String,
pub secret: Option<(String, String)>,
pub shown: String,
pub described: String,
}
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct CopyRequest {
pub source: String,
pub destination: String,
pub write_strategy: Option<String>,
pub unique_key: Vec<String>,
pub cursor_column: Option<String>,
pub format: Option<String>,
}