use std::path::PathBuf;
use crate::backend::Command;
use crate::options::Secret;
#[derive(Debug, Clone, PartialEq, bon::Builder)]
#[builder(
on(String, into),
on(PathBuf, into),
on(Secret, into),
on(bool, default)
)]
pub struct RegistryLogin {
#[builder(start_fn)]
pub host: String,
pub username: Option<String>,
pub password: Option<Secret>,
pub cert_file: Option<PathBuf>,
pub key_file: Option<PathBuf>,
pub ca_file: Option<PathBuf>,
pub insecure: bool,
pub plain_http: bool,
}
impl RegistryLogin {
#[must_use]
pub fn new(host: impl Into<String>) -> Self {
Self::builder(host).build()
}
}
impl Command for RegistryLogin {
type Output = ();
}
#[derive(Debug, Clone, PartialEq, Eq, bon::Builder)]
#[builder(on(String, into))]
pub struct RegistryLogout {
#[builder(start_fn)]
pub host: String,
}
impl RegistryLogout {
#[must_use]
pub fn new(host: impl Into<String>) -> Self {
Self::builder(host).build()
}
}
impl Command for RegistryLogout {
type Output = ();
}