aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml1
-rw-r--r--src/response/nameserver.rs39
2 files changed, 0 insertions, 40 deletions
diff --git a/Cargo.toml b/Cargo.toml
index d456e79..93f7413 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-iso8601 = "0.4.0"
reqwest = { version = "0.11", features = ["blocking", "cookies"] }
url = "2.2.2"
xmlrpc = "0.15.1"
diff --git a/src/response/nameserver.rs b/src/response/nameserver.rs
index e9ff8db..68dab8c 100644
--- a/src/response/nameserver.rs
+++ b/src/response/nameserver.rs
@@ -5,8 +5,6 @@ use crate::{Error, Result};
use std::collections::BTreeMap;
use std::fmt;
-use iso8601::DateTime;
-
fn get_str(map: &BTreeMap<String, xmlrpc::Value>, key: &'static str) -> Result<String> {
let value = map
.get(key)
@@ -37,16 +35,6 @@ fn get_bool(map: &BTreeMap<String, xmlrpc::Value>, key: &'static str) -> Result<
Ok(value)
}
-fn get_datetime(map: &BTreeMap<String, xmlrpc::Value>, key: &'static str) -> Result<DateTime> {
- let value = map
- .get(key)
- .ok_or(Error::Inexistent(key))?
- .as_datetime()
- .ok_or_else(|| Error::Type(key, "DateTime", map.get(key).unwrap().clone()))?;
-
- Ok(value)
-}
-
fn get_array(
map: &BTreeMap<String, xmlrpc::Value>,
key: &'static str,
@@ -60,19 +48,6 @@ fn get_array(
Ok(value.to_vec())
}
-fn get_map(
- map: &BTreeMap<String, xmlrpc::Value>,
- key: &'static str,
-) -> Result<BTreeMap<String, xmlrpc::Value>> {
- let value = map
- .get(key)
- .ok_or(Error::Inexistent(key))?
- .as_struct()
- .ok_or_else(|| Error::Type(key, "Struct", map.get(key).unwrap().clone()))?;
-
- Ok(value.to_owned())
-}
-
/// The domain type. Can be master or slave.
#[derive(Clone, Debug)]
pub enum DomainType {
@@ -197,13 +172,6 @@ impl TryFrom<xmlrpc::Value> for Record {
/// The records that match a search.
#[derive(Clone, Debug)]
pub struct RecordInfo {
- pub domain_id: i32,
- pub domain_name: String,
- pub domain_type: DomainType,
- pub master_address: String,
- pub last_zone_check: DateTime,
- pub slave_dns: SlaveDns,
- pub soa_serial: String,
pub records: Vec<Record>,
}
@@ -211,13 +179,6 @@ impl TryFrom<Response> for RecordInfo {
type Error = Error;
fn try_from(resp: Response) -> Result<Self> {
let info = Self {
- domain_id: get_i32(&resp.data, "roId")?,
- domain_name: get_str(&resp.data, "domain")?,
- domain_type: get_str(&resp.data, "type")?.try_into()?,
- master_address: get_str(&resp.data, "masterIp")?,
- last_zone_check: get_datetime(&resp.data, "lastZoneCheck")?,
- slave_dns: get_map(&resp.data, "slaveDns")?.try_into()?,
- soa_serial: get_str(&resp.data, "SOAserial")?,
records: get_array(&resp.data, "record")?
.iter()
.filter_map(|v| v.to_owned().try_into().ok())