add bones for change activations
This commit is contained in:
parent
ae7643193a
commit
96402420c1
44
src/api/activations.rs
Normal file
44
src/api/activations.rs
Normal file
@ -0,0 +1,44 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{ApiClient, Client, Result};
|
||||
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
|
||||
pub struct ChangeActivation;
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
|
||||
pub struct PendingChange;
|
||||
|
||||
impl From<&Client> for ApiClient<ChangeActivation> {
|
||||
fn from(value: &Client) -> Self {
|
||||
Self::new(value)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
|
||||
pub struct ActivateChangeRequest {
|
||||
redirect: bool,
|
||||
sites: Vec<String>,
|
||||
force_foreign_changes: bool
|
||||
}
|
||||
|
||||
impl ApiClient<ChangeActivation> {
|
||||
pub async fn activate(&self) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
pub async fn await_activation(&self, activation_id: &str) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
pub async fn read_current_activations(&self) -> Result<Vec<ChangeActivation>> {
|
||||
todo!()
|
||||
}
|
||||
pub async fn bulk_read_pending_changes(&self) -> Result<Vec<PendingChange>> {
|
||||
todo!()
|
||||
}
|
||||
pub async fn read_activation_status(&self, activation_id: &str) -> Result<ChangeActivation> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
pub mod activations;
|
||||
pub mod folders;
|
||||
pub mod hosts;
|
||||
pub mod groups;
|
||||
|
||||
@ -125,11 +125,11 @@ impl TagUpdateRequest {
|
||||
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
|
||||
pub struct TagDeleteQuery {
|
||||
repair: bool,
|
||||
mode: TagDeleteMode
|
||||
mode: Option<TagDeleteMode>
|
||||
}
|
||||
|
||||
impl TagDeleteQuery {
|
||||
pub fn new(repair: bool, mode: TagDeleteMode) -> Self {
|
||||
pub fn new(repair: bool, mode: Option<TagDeleteMode>) -> Self {
|
||||
Self { repair, mode }
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,6 @@ pub enum TagDeleteMode {
|
||||
Abort,
|
||||
#[default] Delete,
|
||||
Remove,
|
||||
Null
|
||||
}
|
||||
|
||||
impl DomainExtension for TagGroup {
|
||||
|
||||
@ -433,20 +433,26 @@ impl Display for BulkAction {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ApiClient<D: DomainExtension> {
|
||||
pub struct ApiClient<D> {
|
||||
pub(crate) inner: Arc<InnerClient>,
|
||||
_marker: PhantomData<D>,
|
||||
}
|
||||
|
||||
impl<D: DomainExtension> From<&Client> for ApiClient<D> {
|
||||
fn from(value: &Client) -> Self {
|
||||
impl <D> ApiClient<D> {
|
||||
pub(crate) fn new(inner: &Client) -> Self {
|
||||
Self {
|
||||
inner: value.0.clone(),
|
||||
inner: inner.0.clone(),
|
||||
_marker: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: DomainExtension> From<&Client> for ApiClient<D> {
|
||||
fn from(value: &Client) -> Self {
|
||||
Self::new(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: DomainExtension> ApiClient<D> {
|
||||
pub async fn create(
|
||||
&self,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user