From a91ee6ff6467d131c76151fb18ca2c55345db188 Mon Sep 17 00:00:00 2001 From: "Carpenter, Adam (CORP)" Date: Fri, 10 Dec 2021 10:11:27 -0500 Subject: feat: impl deprov runner queueing from requests --- angelsharkd/src/routes/extensions/simple_deprov.rs | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/angelsharkd/src/routes/extensions/simple_deprov.rs b/angelsharkd/src/routes/extensions/simple_deprov.rs index de45d9b..eb6f04b 100644 --- a/angelsharkd/src/routes/extensions/simple_deprov.rs +++ b/angelsharkd/src/routes/extensions/simple_deprov.rs @@ -15,7 +15,22 @@ pub fn filter(runner: AcmRunner) -> impl Filter Result { +async fn remove_entries(entries: Entries, mut runner: AcmRunner) -> Result { + for entry in entries { + match entry { + Entry::StationUser { acm, ext } => { + runner.queue_input(&acm, &Message::new(&format!("clear amw all {}", ext))); + runner.queue_input(&acm, &Message::new(&format!("remove station {}", ext))); + } + Entry::AgentLoginId { acm, ext } => { + runner.queue_input( + &acm, + &Message::new(&format!("remove agent-loginID {}", ext)), + ); + } + } + } + dbg!(&runner); Ok("") } @@ -28,16 +43,3 @@ enum Entry { #[serde(rename(deserialize = "agent-loginid"))] AgentLoginId { acm: String, ext: String }, } - -impl From for Vec { - fn from(entry: Entry) -> Self { - match entry { - Entry::StationUser { acm, ext } => { - vec![Message::new(&format!("clear amw all {}", ext))] - } - Entry::AgentLoginId { acm, ext } => { - todo!() - } - } - } -} -- cgit v1.2.3