diff --git a/Cargo.toml b/Cargo.toml index ed31f2b..59ec966 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,45 @@ members = [ "onvif", "schema", + "transport", + "validate", + "xsd_rs/common", + "xsd_rs/metadatastream", + "xsd_rs/onvif_xsd", + "xsd_rs/radiometry", + "xsd_rs/rules", + "xsd_rs/soap_envelope", + "xsd_rs/types", + "xsd_rs/xmlmime", + "xsd_rs/xop", + "wsdl_rs/accesscontrol", + "wsdl_rs/accessrules", + "wsdl_rs/actionengine", + "wsdl_rs/advancedsecurity", + "wsdl_rs/analytics", + "wsdl_rs/authenticationbehavior", + "wsdl_rs/b_2", + "wsdl_rs/bf_2", + "wsdl_rs/credential", + "wsdl_rs/deviceio", + "wsdl_rs/devicemgmt", + "wsdl_rs/display", + "wsdl_rs/doorcontrol", + "wsdl_rs/event", + "wsdl_rs/imaging", + "wsdl_rs/media", + "wsdl_rs/media2", + "wsdl_rs/provisioning", + "wsdl_rs/ptz", + "wsdl_rs/receiver", + "wsdl_rs/recording", + "wsdl_rs/replay", + "wsdl_rs/schedule", + "wsdl_rs/search", + "wsdl_rs/t_1", + "wsdl_rs/thermal", + "wsdl_rs/uplink", + "wsdl_rs/ws_addr", + "wsdl_rs/ws_discovery", + "wsdl_rs/xml_xsd", ] diff --git a/onvif/Cargo.toml b/onvif/Cargo.toml index f3b7117..0af5268 100644 --- a/onvif/Cargo.toml +++ b/onvif/Cargo.toml @@ -24,7 +24,7 @@ futures-core = "0.3.8" futures-util = "0.3.8" num-bigint = "0.4.2" reqwest = { version = "0.11.0", default-features = false } -schema = { version = "0.1.0", path = "../schema" } +schema = { version = "0.1.0", path = "../schema", default-features = false, features = ["analytics", "devicemgmt", "event", "media", "ptz"] } sha1 = "0.6.0" thiserror = "1.0" tokio = { version = "1.0.1", features = ["time"] } diff --git a/onvif/examples/camera.rs b/onvif/examples/camera.rs index 01b4dfc..e0f38ef 100644 --- a/onvif/examples/camera.rs +++ b/onvif/examples/camera.rs @@ -1,5 +1,5 @@ -use crate::schema::transport; -use onvif::{schema, soap}; +use onvif::soap; +use schema::{self, transport}; use structopt::StructOpt; use tracing::debug; use url::Url; diff --git a/onvif/src/discovery/mod.rs b/onvif/src/discovery/mod.rs index cf4412d..0b4a499 100644 --- a/onvif/src/discovery/mod.rs +++ b/onvif/src/discovery/mod.rs @@ -2,10 +2,8 @@ use crate::soap; use async_stream::stream; use futures_core::stream::Stream; use futures_util::{future::ready, stream::FuturesUnordered, StreamExt}; -use schema::{ - transport::Error as TransportError, - ws_discovery::{probe, probe_matches}, -}; +use schema::transport::Error as TransportError; +use schema::ws_discovery::{probe, probe_matches}; use std::{ future::Future, iter, diff --git a/onvif/src/lib.rs b/onvif/src/lib.rs index 87706ac..126c0d5 100644 --- a/onvif/src/lib.rs +++ b/onvif/src/lib.rs @@ -4,6 +4,5 @@ extern crate yaserde_derive; pub mod discovery; pub mod soap; -pub use schema; mod utils; diff --git a/schema/Cargo.toml b/schema/Cargo.toml index f2bf07f..1e06535 100644 --- a/schema/Cargo.toml +++ b/schema/Cargo.toml @@ -6,19 +6,63 @@ edition = "2018" license = "MIT" [dependencies] -async-trait = "0.1.42" bigdecimal = "0.3.0" chrono = "0.4.19" num-bigint = "0.4.2" percent-encoding = "2.1.0" -thiserror = "1.0.23" +transport = { path = "../transport" } url = "2.2.1" +validate = { path = "../validate" } xml-rs = "0.8.3" xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } -yaserde = "0.7.1" -yaserde_derive = "0.7.1" + +# xsd +common = { path = "../xsd_rs/common" } +metadatastream = { path = "../xsd_rs/metadatastream", optional = true } +onvif = { package = "onvif-xsd", path = "../xsd_rs/onvif_xsd" } +radiometry = { path = "../xsd_rs/radiometry", optional = true } +rules = { path = "../xsd_rs/rules", optional = true } +soap_envelope = { path = "../xsd_rs/soap_envelope" } +types = { path = "../xsd_rs/types" } +xmlmime = { path = "../xsd_rs/xmlmime" } +xop = { path = "../xsd_rs/xop" } + +# wsdl +accesscontrol = { path = "../wsdl_rs/accesscontrol" , optional = true} +accessrules = { path = "../wsdl_rs/accessrules" , optional = true} +actionengine = { path = "../wsdl_rs/actionengine" , optional = true} +advancedsecurity = { path = "../wsdl_rs/advancedsecurity" , optional = true} +analytics = { path = "../wsdl_rs/analytics" , optional = true} +authenticationbehavior = { path = "../wsdl_rs/authenticationbehavior" , optional = true} +b_2 = { path = "../wsdl_rs/b_2" } +bf_2 = { path = "../wsdl_rs/bf_2" , optional = true} +credential = { path = "../wsdl_rs/credential" , optional = true} +deviceio = { path = "../wsdl_rs/deviceio" , optional = true} +devicemgmt = { path = "../wsdl_rs/devicemgmt" , optional = true} +display = { path = "../wsdl_rs/display" , optional = true} +doorcontrol = { path = "../wsdl_rs/doorcontrol" , optional = true} +event = { path = "../wsdl_rs/event" , optional = true} +imaging = { path = "../wsdl_rs/imaging" , optional = true} +media = { path = "../wsdl_rs/media" , optional = true} +media2 = { path = "../wsdl_rs/media2" , optional = true} +provisioning = { path = "../wsdl_rs/provisioning" , optional = true} +ptz = { path = "../wsdl_rs/ptz" , optional = true} +receiver = { path = "../wsdl_rs/receiver" , optional = true} +recording = { path = "../wsdl_rs/recording" , optional = true} +replay = { path = "../wsdl_rs/replay" , optional = true} +schedule = { path = "../wsdl_rs/schedule" , optional = true} +search = { path = "../wsdl_rs/search" , optional = true} +t_1 = { path = "../wsdl_rs/t_1" } +thermal = { path = "../wsdl_rs/thermal" , optional = true} +uplink = { path = "../wsdl_rs/uplink" , optional = true} +ws_addr = { path = "../wsdl_rs/ws_addr" } +ws_discovery = { path = "../wsdl_rs/ws_discovery" } +xml_xsd = { path = "../wsdl_rs/xml_xsd" } [dev-dependencies] assert_approx_eq = "1.1.0" +async-trait = "0.1.42" tokio = { version = "1.0.1", features = ["full"] } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/lib.rs b/schema/src/lib.rs index 82810cb..c3c2505 100644 --- a/schema/src/lib.rs +++ b/schema/src/lib.rs @@ -3,56 +3,78 @@ // This issue is being tracked at . #![allow(clippy::upper_case_acronyms)] -#[macro_use] -extern crate yaserde_derive; - -pub mod transport; -pub mod validate; +pub use transport; // xsd: -pub mod common; -#[allow(clippy::large_enum_variant)] -pub mod metadatastream; -pub mod onvif; -pub mod radiometry; -pub mod rules; -pub mod soap_envelope; -pub mod types; -pub mod xmlmime; -pub mod xop; +pub use common; +#[cfg(feature = "metadatastream")] +pub use metadatastream; +pub use onvif; +#[cfg(feature = "radiometry")] +pub use radiometry; +#[cfg(feature = "rules")] +pub use rules; +pub use soap_envelope; +pub use types; +pub use xmlmime; +pub use xop; // wsdl: -pub mod accesscontrol; -pub mod accessrules; -pub mod actionengine; -pub mod advancedsecurity; -pub mod analytics; -pub mod authenticationbehavior; -pub mod b_2; -pub mod bf_2; -pub mod credential; -pub mod deviceio; -pub mod devicemgmt; -pub mod display; -pub mod doorcontrol; -pub mod event; -pub mod imaging; -pub mod media; -pub mod media2; -pub mod provisioning; -pub mod ptz; -pub mod receiver; -pub mod recording; -pub mod replay; -pub mod schedule; -pub mod search; -pub mod t_1; -pub mod thermal; -pub mod uplink; -pub mod ws_addr; -pub mod ws_discovery; -pub mod xml_xsd; +#[cfg(feature = "accesscontrol")] +pub use accesscontrol; +#[cfg(feature = "accessrules")] +pub use accessrules; +#[cfg(feature = "actionengine")] +pub use actionengine; +#[cfg(feature = "advancedsecurity")] +pub use advancedsecurity; +#[cfg(feature = "analytics")] +pub use analytics; +#[cfg(feature = "authenticationbehavior")] +pub use authenticationbehavior; +pub use b_2; +#[cfg(feature = "bf_2")] +pub use bf_2; +#[cfg(feature = "credential")] +pub use credential; +#[cfg(feature = "deviceio")] +pub use deviceio; +#[cfg(feature = "devicemgmt")] +pub use devicemgmt; +#[cfg(feature = "display")] +pub use display; +#[cfg(feature = "doorcontrol")] +pub use doorcontrol; +#[cfg(feature = "event")] +pub use event; +#[cfg(feature = "imaging")] +pub use imaging; +#[cfg(feature = "media")] +pub use media; +#[cfg(feature = "media2")] +pub use media2; +#[cfg(feature = "provisioning")] +pub use provisioning; +#[cfg(feature = "ptz")] +pub use ptz; +#[cfg(feature = "receiver")] +pub use receiver; +#[cfg(feature = "recording")] +pub use recording; +#[cfg(feature = "replay")] +pub use replay; +#[cfg(feature = "schedule")] +pub use schedule; +#[cfg(feature = "search")] +pub use search; +pub use t_1; +#[cfg(feature = "thermal")] +pub use thermal; +#[cfg(feature = "uplink")] +pub use uplink; +pub use ws_addr; +pub use ws_discovery; +pub use xml_xsd; #[cfg(test)] mod tests; -mod utils; diff --git a/schema/src/tests.rs b/schema/src/tests.rs index 885b044..40da2da 100644 --- a/schema/src/tests.rs +++ b/schema/src/tests.rs @@ -1,12 +1,13 @@ use super::*; -use crate::transport; -use crate::utils::xml_eq::assert_xml_eq; use assert_approx_eq::assert_approx_eq; use async_trait::async_trait; use onvif as tt; +use utils::assert_xml_eq; use xsd_types::types as xs; +mod utils; + pub struct FakeTransport { pub response: String, } diff --git a/schema/src/utils/xml_eq.rs b/schema/src/tests/utils.rs similarity index 100% rename from schema/src/utils/xml_eq.rs rename to schema/src/tests/utils.rs diff --git a/schema/src/utils/mod.rs b/schema/src/utils/mod.rs deleted file mode 100644 index 8a509c9..0000000 --- a/schema/src/utils/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(test)] -pub mod xml_eq; diff --git a/transport/Cargo.toml b/transport/Cargo.toml new file mode 100644 index 0000000..d645337 --- /dev/null +++ b/transport/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "transport" +version = "0.1.0" +edition = "2021" + +[dependencies] +async-trait = "0.1.42" +thiserror = "1.0.23" +yaserde = "0.7.1" diff --git a/schema/src/transport.rs b/transport/src/lib.rs similarity index 100% rename from schema/src/transport.rs rename to transport/src/lib.rs diff --git a/validate/Cargo.toml b/validate/Cargo.toml new file mode 100644 index 0000000..674b8df --- /dev/null +++ b/validate/Cargo.toml @@ -0,0 +1,4 @@ +[package] +name = "validate" +version = "0.1.0" +edition = "2021" diff --git a/schema/src/validate.rs b/validate/src/lib.rs similarity index 100% rename from schema/src/validate.rs rename to validate/src/lib.rs diff --git a/wsdl_rs/accesscontrol/Cargo.toml b/wsdl_rs/accesscontrol/Cargo.toml new file mode 100644 index 0000000..c38b81a --- /dev/null +++ b/wsdl_rs/accesscontrol/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "accesscontrol" +version = "0.1.0" +edition = "2021" + +[dependencies] +transport = { path = "../../transport" } +types = { path = "../../xsd_rs/types" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/accesscontrol.rs b/wsdl_rs/accesscontrol/src/lib.rs similarity index 99% rename from schema/src/accesscontrol.rs rename to wsdl_rs/accesscontrol/src/lib.rs index c08146f..baf7268 100644 --- a/schema/src/accesscontrol.rs +++ b/wsdl_rs/accesscontrol/src/lib.rs @@ -1,6 +1,6 @@ -use crate::transport; -use crate::types as pt; -use crate::validate::Validate; +use types as pt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; // The service capabilities reflect optional functionality of a service. // The information is static and does not change during device operation. diff --git a/wsdl_rs/accessrules/Cargo.toml b/wsdl_rs/accessrules/Cargo.toml new file mode 100644 index 0000000..cb9b6d4 --- /dev/null +++ b/wsdl_rs/accessrules/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "accessrules" +version = "0.1.0" +edition = "2021" + +[dependencies] +transport = { path = "../../transport" } +types = { path = "../../xsd_rs/types" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/accessrules.rs b/wsdl_rs/accessrules/src/lib.rs similarity index 99% rename from schema/src/accessrules.rs rename to wsdl_rs/accessrules/src/lib.rs index 48577a7..c3ee2d7 100644 --- a/schema/src/accessrules.rs +++ b/wsdl_rs/accessrules/src/lib.rs @@ -1,6 +1,6 @@ -use crate::transport; -use crate::types as pt; -use crate::validate::Validate; +use types as pt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; // The service capabilities reflect optional functionality of a service. The // information is static diff --git a/wsdl_rs/actionengine/Cargo.toml b/wsdl_rs/actionengine/Cargo.toml new file mode 100644 index 0000000..825c950 --- /dev/null +++ b/wsdl_rs/actionengine/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "actionengine" +version = "0.1.0" +edition = "2021" + +[dependencies] +b_2 = { path = "../../wsdl_rs/b_2" } +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/actionengine.rs b/wsdl_rs/actionengine/src/lib.rs similarity index 99% rename from schema/src/actionengine.rs rename to wsdl_rs/actionengine/src/lib.rs index bb880ab..4bac8bc 100644 --- a/schema/src/actionengine.rs +++ b/wsdl_rs/actionengine/src/lib.rs @@ -1,7 +1,8 @@ -use crate::transport; -use crate::validate::Validate; -use crate::{b_2 as wsnt, onvif as tt}; +use b_2 as wsnt; +use onvif as tt; +use validate::Validate; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/advancedsecurity/Cargo.toml b/wsdl_rs/advancedsecurity/Cargo.toml new file mode 100644 index 0000000..db48704 --- /dev/null +++ b/wsdl_rs/advancedsecurity/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "advancedsecurity" +version = "0.1.0" +edition = "2021" + +[dependencies] +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/advancedsecurity.rs b/wsdl_rs/advancedsecurity/src/lib.rs similarity index 99% rename from schema/src/advancedsecurity.rs rename to wsdl_rs/advancedsecurity/src/lib.rs index bae5e83..e618575 100644 --- a/schema/src/advancedsecurity.rs +++ b/wsdl_rs/advancedsecurity/src/lib.rs @@ -1,8 +1,8 @@ -use crate::transport; -use crate::validate::Validate; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; // Unique identifier for keys in the keystore. #[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] diff --git a/wsdl_rs/analytics/Cargo.toml b/wsdl_rs/analytics/Cargo.toml new file mode 100644 index 0000000..55dd5e4 --- /dev/null +++ b/wsdl_rs/analytics/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "analytics" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/analytics.rs b/wsdl_rs/analytics/src/lib.rs similarity index 99% rename from schema/src/analytics.rs rename to wsdl_rs/analytics/src/lib.rs index 9b9a47a..214c341 100644 --- a/schema/src/analytics.rs +++ b/wsdl_rs/analytics/src/lib.rs @@ -1,6 +1,6 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/authenticationbehavior/Cargo.toml b/wsdl_rs/authenticationbehavior/Cargo.toml new file mode 100644 index 0000000..122ad44 --- /dev/null +++ b/wsdl_rs/authenticationbehavior/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "authenticationbehavior" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +transport = { path = "../../transport" } +types = { path = "../../xsd_rs/types" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/authenticationbehavior.rs b/wsdl_rs/authenticationbehavior/src/lib.rs similarity index 99% rename from schema/src/authenticationbehavior.rs rename to wsdl_rs/authenticationbehavior/src/lib.rs index 06dfea6..340e610 100644 --- a/schema/src/authenticationbehavior.rs +++ b/wsdl_rs/authenticationbehavior/src/lib.rs @@ -1,6 +1,7 @@ -use crate::transport; -use crate::validate::Validate; -use crate::{onvif as tt, types as pt}; +use onvif as tt; +use types as pt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; // The service capabilities reflect optional functionality of a service. The // information is static diff --git a/wsdl_rs/b_2/Cargo.toml b/wsdl_rs/b_2/Cargo.toml new file mode 100644 index 0000000..519deee --- /dev/null +++ b/wsdl_rs/b_2/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "b_2" +version = "0.1.0" +edition = "2021" + +[dependencies] +t_1 = { path = "../t_1" } +validate = { path = "../../validate" } +ws_addr = { path = "../ws_addr" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/b_2.rs b/wsdl_rs/b_2/src/lib.rs similarity index 99% rename from schema/src/b_2.rs rename to wsdl_rs/b_2/src/lib.rs index aa6bac3..dbf099b 100644 --- a/schema/src/b_2.rs +++ b/wsdl_rs/b_2/src/lib.rs @@ -1,7 +1,9 @@ -pub use crate::common::*; -use crate::{t_1 as wstop, validate::Validate, ws_addr as wsa}; +use t_1 as wstop; +use validate::Validate; +use ws_addr as wsa; use xsd_macro_utils::*; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/bf_2/Cargo.toml b/wsdl_rs/bf_2/Cargo.toml new file mode 100644 index 0000000..0c1058f --- /dev/null +++ b/wsdl_rs/bf_2/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "bf_2" +version = "0.1.0" +edition = "2021" + +[dependencies] +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" +ws_addr = { path = "../../wsdl_rs/ws_addr" } +xml_xsd = { path = "../../wsdl_rs/xml_xsd" } diff --git a/schema/src/bf_2.rs b/wsdl_rs/bf_2/src/lib.rs similarity index 94% rename from schema/src/bf_2.rs rename to wsdl_rs/bf_2/src/lib.rs index e6c6d18..c2aab8c 100644 --- a/schema/src/bf_2.rs +++ b/wsdl_rs/bf_2/src/lib.rs @@ -1,6 +1,8 @@ -pub use crate::common::*; -use crate::{validate::Validate, ws_addr as wsa, xml_xsd as xml}; +use validate::Validate; +use ws_addr as wsa; +use xml_xsd as xml; use xsd_types::types as xsd; +use yaserde_derive::{YaDeserialize, YaSerialize}; // pub type BaseFault = BaseFaultType; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] diff --git a/wsdl_rs/credential/Cargo.toml b/wsdl_rs/credential/Cargo.toml new file mode 100644 index 0000000..c8df036 --- /dev/null +++ b/wsdl_rs/credential/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "credential" +version = "0.1.0" +edition = "2021" + +[dependencies] +transport = { path = "../../transport" } +types = { path = "../../xsd_rs/types" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/credential.rs b/wsdl_rs/credential/src/lib.rs similarity index 99% rename from schema/src/credential.rs rename to wsdl_rs/credential/src/lib.rs index a0c11c5..0e1c7d0 100644 --- a/schema/src/credential.rs +++ b/wsdl_rs/credential/src/lib.rs @@ -1,9 +1,9 @@ -use crate::transport; -use crate::types as pt; -use crate::validate::Validate; use std::str::FromStr; +use types as pt; +use validate::Validate; use xsd_macro_utils::*; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; // The service capabilities reflect optional functionality of a service. The // information is static diff --git a/wsdl_rs/deviceio/Cargo.toml b/wsdl_rs/deviceio/Cargo.toml new file mode 100644 index 0000000..c3cadc7 --- /dev/null +++ b/wsdl_rs/deviceio/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "deviceio" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +devicemgmt = { path = "../../wsdl_rs/devicemgmt" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/deviceio.rs b/wsdl_rs/deviceio/src/lib.rs similarity index 99% rename from schema/src/deviceio.rs rename to wsdl_rs/deviceio/src/lib.rs index 17631ae..cc9544c 100644 --- a/schema/src/deviceio.rs +++ b/wsdl_rs/deviceio/src/lib.rs @@ -1,9 +1,10 @@ -use crate::transport; -use crate::validate::Validate; -use crate::{devicemgmt as tds, onvif as tt}; +use devicemgmt as tds; +use onvif as tt; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/devicemgmt/Cargo.toml b/wsdl_rs/devicemgmt/Cargo.toml new file mode 100644 index 0000000..b1fe43b --- /dev/null +++ b/wsdl_rs/devicemgmt/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "devicemgmt" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/devicemgmt.rs b/wsdl_rs/devicemgmt/src/lib.rs similarity index 99% rename from schema/src/devicemgmt.rs rename to wsdl_rs/devicemgmt/src/lib.rs index 1aefa9a..e75f125 100644 --- a/schema/src/devicemgmt.rs +++ b/wsdl_rs/devicemgmt/src/lib.rs @@ -1,9 +1,9 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/display/Cargo.toml b/wsdl_rs/display/Cargo.toml new file mode 100644 index 0000000..f63df95 --- /dev/null +++ b/wsdl_rs/display/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "display" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/display.rs b/wsdl_rs/display/src/lib.rs similarity index 99% rename from schema/src/display.rs rename to wsdl_rs/display/src/lib.rs index 932cc91..5502615 100644 --- a/schema/src/display.rs +++ b/wsdl_rs/display/src/lib.rs @@ -1,6 +1,6 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/doorcontrol/Cargo.toml b/wsdl_rs/doorcontrol/Cargo.toml new file mode 100644 index 0000000..7308b34 --- /dev/null +++ b/wsdl_rs/doorcontrol/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "doorcontrol" +version = "0.1.0" +edition = "2021" + +[dependencies] +transport = { path = "../../transport" } +types = { path = "../../xsd_rs/types" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/doorcontrol.rs b/wsdl_rs/doorcontrol/src/lib.rs similarity index 99% rename from schema/src/doorcontrol.rs rename to wsdl_rs/doorcontrol/src/lib.rs index 24a1109..e5d3734 100644 --- a/schema/src/doorcontrol.rs +++ b/wsdl_rs/doorcontrol/src/lib.rs @@ -1,7 +1,7 @@ -use crate::transport; -use crate::types as pt; -use crate::validate::Validate; +use types as pt; +use validate::Validate; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; // ServiceCapabilities structure reflects optional functionality of a service. // The information is static and does not change during device operation. diff --git a/wsdl_rs/event/Cargo.toml b/wsdl_rs/event/Cargo.toml new file mode 100644 index 0000000..68a1d29 --- /dev/null +++ b/wsdl_rs/event/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "event" +version = "0.1.0" +edition = "2021" + +[dependencies] +b_2 = { path = "../../wsdl_rs/b_2" } +t_1 = { path = "../../wsdl_rs/t_1" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" +ws_addr = { path = "../../wsdl_rs/ws_addr" } diff --git a/schema/src/event.rs b/wsdl_rs/event/src/lib.rs similarity index 99% rename from schema/src/event.rs rename to wsdl_rs/event/src/lib.rs index 7e55369..4894de9 100644 --- a/schema/src/event.rs +++ b/wsdl_rs/event/src/lib.rs @@ -1,7 +1,9 @@ -use crate::transport; -use crate::validate::Validate; -use crate::{b_2 as wsnt, t_1 as wstop, ws_addr as wsa}; +use b_2 as wsnt; +use t_1 as wstop; +use validate::Validate; +use ws_addr as wsa; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/imaging/Cargo.toml b/wsdl_rs/imaging/Cargo.toml new file mode 100644 index 0000000..4ec01dc --- /dev/null +++ b/wsdl_rs/imaging/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "imaging" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/imaging.rs b/wsdl_rs/imaging/src/lib.rs similarity index 99% rename from schema/src/imaging.rs rename to wsdl_rs/imaging/src/lib.rs index 77f21dd..0791b0c 100644 --- a/schema/src/imaging.rs +++ b/wsdl_rs/imaging/src/lib.rs @@ -1,8 +1,8 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/media/Cargo.toml b/wsdl_rs/media/Cargo.toml new file mode 100644 index 0000000..4903d86 --- /dev/null +++ b/wsdl_rs/media/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "media" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/media.rs b/wsdl_rs/media/src/lib.rs similarity index 99% rename from schema/src/media.rs rename to wsdl_rs/media/src/lib.rs index 99ba48a..21e5682 100644 --- a/schema/src/media.rs +++ b/wsdl_rs/media/src/lib.rs @@ -1,8 +1,8 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/media2/Cargo.toml b/wsdl_rs/media2/Cargo.toml new file mode 100644 index 0000000..cda0abd --- /dev/null +++ b/wsdl_rs/media2/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "media2" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/media2.rs b/wsdl_rs/media2/src/lib.rs similarity index 99% rename from schema/src/media2.rs rename to wsdl_rs/media2/src/lib.rs index 51f4c0c..4d717ce 100644 --- a/schema/src/media2.rs +++ b/wsdl_rs/media2/src/lib.rs @@ -1,8 +1,8 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/provisioning/Cargo.toml b/wsdl_rs/provisioning/Cargo.toml new file mode 100644 index 0000000..ef2613b --- /dev/null +++ b/wsdl_rs/provisioning/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "provisioning" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/provisioning.rs b/wsdl_rs/provisioning/src/lib.rs similarity index 99% rename from schema/src/provisioning.rs rename to wsdl_rs/provisioning/src/lib.rs index e1123cd..566bd07 100644 --- a/schema/src/provisioning.rs +++ b/wsdl_rs/provisioning/src/lib.rs @@ -1,7 +1,7 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; +use validate::Validate; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; // The direction for PanMove to move the device. #[derive(PartialEq, Debug, YaSerialize, YaDeserialize)] diff --git a/wsdl_rs/ptz/Cargo.toml b/wsdl_rs/ptz/Cargo.toml new file mode 100644 index 0000000..bf0b723 --- /dev/null +++ b/wsdl_rs/ptz/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "ptz" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/ptz.rs b/wsdl_rs/ptz/src/lib.rs similarity index 99% rename from schema/src/ptz.rs rename to wsdl_rs/ptz/src/lib.rs index dc76a2b..3edab6f 100644 --- a/schema/src/ptz.rs +++ b/wsdl_rs/ptz/src/lib.rs @@ -1,7 +1,7 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; +use validate::Validate; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/receiver/Cargo.toml b/wsdl_rs/receiver/Cargo.toml new file mode 100644 index 0000000..b3cb2fd --- /dev/null +++ b/wsdl_rs/receiver/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "receiver" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/receiver.rs b/wsdl_rs/receiver/src/lib.rs similarity index 99% rename from schema/src/receiver.rs rename to wsdl_rs/receiver/src/lib.rs index 6cce043..768c30d 100644 --- a/schema/src/receiver.rs +++ b/wsdl_rs/receiver/src/lib.rs @@ -1,6 +1,6 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/recording/Cargo.toml b/wsdl_rs/recording/Cargo.toml new file mode 100644 index 0000000..8098f52 --- /dev/null +++ b/wsdl_rs/recording/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "recording" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/recording.rs b/wsdl_rs/recording/src/lib.rs similarity index 99% rename from schema/src/recording.rs rename to wsdl_rs/recording/src/lib.rs index 496319f..8fd6f42 100644 --- a/schema/src/recording.rs +++ b/wsdl_rs/recording/src/lib.rs @@ -1,9 +1,9 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/replay/Cargo.toml b/wsdl_rs/replay/Cargo.toml new file mode 100644 index 0000000..f2535dd --- /dev/null +++ b/wsdl_rs/replay/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "replay" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { path = "../../xsd_rs/common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/replay.rs b/wsdl_rs/replay/src/lib.rs similarity index 98% rename from schema/src/replay.rs rename to wsdl_rs/replay/src/lib.rs index c2bea4b..1205aae 100644 --- a/schema/src/replay.rs +++ b/wsdl_rs/replay/src/lib.rs @@ -1,6 +1,6 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/schedule/Cargo.toml b/wsdl_rs/schedule/Cargo.toml new file mode 100644 index 0000000..e95a956 --- /dev/null +++ b/wsdl_rs/schedule/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "schedule" +version = "0.1.0" +edition = "2021" + +[dependencies] +transport = { path = "../../transport" } +types = { path = "../../xsd_rs/types" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/schedule.rs b/wsdl_rs/schedule/src/lib.rs similarity index 99% rename from schema/src/schedule.rs rename to wsdl_rs/schedule/src/lib.rs index 7bbe9fb..3432d42 100644 --- a/schema/src/schedule.rs +++ b/wsdl_rs/schedule/src/lib.rs @@ -1,7 +1,7 @@ -use crate::transport; -use crate::types as pt; -use crate::validate::Validate; +use types as pt; +use validate::Validate; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; // The service capabilities reflect optional functionality of a service. // The information is static and does not change during device operation. diff --git a/wsdl_rs/search/Cargo.toml b/wsdl_rs/search/Cargo.toml new file mode 100644 index 0000000..4d95855 --- /dev/null +++ b/wsdl_rs/search/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "search" +version = "0.1.0" +edition = "2021" + +[dependencies] +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/search.rs b/wsdl_rs/search/src/lib.rs similarity index 99% rename from schema/src/search.rs rename to wsdl_rs/search/src/lib.rs index 6792bb9..a23be8c 100644 --- a/schema/src/search.rs +++ b/wsdl_rs/search/src/lib.rs @@ -1,7 +1,7 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; +use validate::Validate; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/t_1/Cargo.toml b/wsdl_rs/t_1/Cargo.toml new file mode 100644 index 0000000..f4064a9 --- /dev/null +++ b/wsdl_rs/t_1/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "t_1" +version = "0.1.0" +edition = "2021" + +[dependencies] +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/t_1.rs b/wsdl_rs/t_1/src/lib.rs similarity index 98% rename from schema/src/t_1.rs rename to wsdl_rs/t_1/src/lib.rs index 0116263..7bb56f4 100644 --- a/schema/src/t_1.rs +++ b/wsdl_rs/t_1/src/lib.rs @@ -1,6 +1,7 @@ -use crate::validate::Validate; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/thermal/Cargo.toml b/wsdl_rs/thermal/Cargo.toml new file mode 100644 index 0000000..9265291 --- /dev/null +++ b/wsdl_rs/thermal/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "thermal" +version = "0.1.0" +edition = "2021" + +[dependencies] +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/thermal.rs b/wsdl_rs/thermal/src/lib.rs similarity index 99% rename from schema/src/thermal.rs rename to wsdl_rs/thermal/src/lib.rs index 059d703..722cfd4 100644 --- a/schema/src/thermal.rs +++ b/wsdl_rs/thermal/src/lib.rs @@ -1,6 +1,6 @@ -use crate::onvif as tt; -use crate::transport; -use crate::validate::Validate; +use onvif as tt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(PartialEq, Debug, YaSerialize, YaDeserialize)] pub enum Polarity { diff --git a/wsdl_rs/uplink/Cargo.toml b/wsdl_rs/uplink/Cargo.toml new file mode 100644 index 0000000..0c6c3bf --- /dev/null +++ b/wsdl_rs/uplink/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "uplink" +version = "0.1.0" +edition = "2021" + +[dependencies] +transport = { path = "../../transport" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/uplink.rs b/wsdl_rs/uplink/src/lib.rs similarity index 98% rename from schema/src/uplink.rs rename to wsdl_rs/uplink/src/lib.rs index ba0d1a7..c853857 100644 --- a/schema/src/uplink.rs +++ b/wsdl_rs/uplink/src/lib.rs @@ -1,5 +1,5 @@ -use crate::transport; -use crate::validate::Validate; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/ws_addr/Cargo.toml b/wsdl_rs/ws_addr/Cargo.toml new file mode 100644 index 0000000..272719c --- /dev/null +++ b/wsdl_rs/ws_addr/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "ws_addr" +version = "0.1.0" +edition = "2021" + +[dependencies] +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/ws_addr.rs b/wsdl_rs/ws_addr/src/lib.rs similarity index 98% rename from schema/src/ws_addr.rs rename to wsdl_rs/ws_addr/src/lib.rs index 1618e94..e98c42f 100644 --- a/schema/src/ws_addr.rs +++ b/wsdl_rs/ws_addr/src/lib.rs @@ -1,7 +1,7 @@ -pub use crate::common::*; -use crate::validate::Validate; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; +use yaserde_derive::{YaDeserialize, YaSerialize}; pub type EndpointReference = EndpointReferenceType; diff --git a/wsdl_rs/ws_discovery/Cargo.toml b/wsdl_rs/ws_discovery/Cargo.toml new file mode 100644 index 0000000..db8de75 --- /dev/null +++ b/wsdl_rs/ws_discovery/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "ws_discovery" +version = "0.1.0" +edition = "2021" + +[dependencies] +percent-encoding = "2.1.0" +url = "2.2.1" +xml-rs = "0.8.3" +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/ws_discovery.rs b/wsdl_rs/ws_discovery/src/lib.rs similarity index 98% rename from schema/src/ws_discovery.rs rename to wsdl_rs/ws_discovery/src/lib.rs index 079bf5b..1659494 100644 --- a/schema/src/ws_discovery.rs +++ b/wsdl_rs/ws_discovery/src/lib.rs @@ -1,4 +1,7 @@ pub mod probe { + + use yaserde_derive::YaSerialize; + #[derive(Default, PartialEq, Debug, YaSerialize)] #[yaserde( prefix = "d", @@ -54,8 +57,10 @@ pub mod probe { } pub mod probe_matches { + use percent_encoding::percent_decode_str; use url::Url; + use yaserde_derive::YaDeserialize; #[derive(Default, PartialEq, Debug, YaDeserialize)] #[yaserde( diff --git a/wsdl_rs/xml_xsd/Cargo.toml b/wsdl_rs/xml_xsd/Cargo.toml new file mode 100644 index 0000000..3c042f9 --- /dev/null +++ b/wsdl_rs/xml_xsd/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "xml_xsd" +version = "0.1.0" +edition = "2021" + +[dependencies] +xml-rs = "0.8.3" +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/xml_xsd.rs b/wsdl_rs/xml_xsd/src/lib.rs similarity index 73% rename from schema/src/xml_xsd.rs rename to wsdl_rs/xml_xsd/src/lib.rs index d0223f2..65b19a7 100644 --- a/schema/src/xml_xsd.rs +++ b/wsdl_rs/xml_xsd/src/lib.rs @@ -1,3 +1,5 @@ +use yaserde_derive::{YaDeserialize, YaSerialize}; + // TODO: replace with actual types generated from .xsd #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] diff --git a/xsd_rs/common/Cargo.toml b/xsd_rs/common/Cargo.toml new file mode 100644 index 0000000..82fef0d --- /dev/null +++ b/xsd_rs/common/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "common" +version = "0.1.0" +edition = "2021" + +[dependencies] +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/common.rs b/xsd_rs/common/src/lib.rs similarity index 99% rename from schema/src/common.rs rename to xsd_rs/common/src/lib.rs index c2a0dd4..bf686d1 100644 --- a/schema/src/common.rs +++ b/xsd_rs/common/src/lib.rs @@ -1,7 +1,8 @@ -use crate::validate::Validate; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; // Unique identifier for a physical or logical resource. // Tokens should be assigned such that they are unique within a device. Tokens diff --git a/xsd_rs/metadatastream/Cargo.toml b/xsd_rs/metadatastream/Cargo.toml new file mode 100644 index 0000000..53cce20 --- /dev/null +++ b/xsd_rs/metadatastream/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "metadatastream" +version = "0.1.0" +edition = "2021" + +[dependencies] +b_2 = { path = "../../wsdl_rs/b_2" } +common = { path = "../common" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/metadatastream.rs b/xsd_rs/metadatastream/src/lib.rs similarity index 99% rename from schema/src/metadatastream.rs rename to xsd_rs/metadatastream/src/lib.rs index 0be743a..c81f4c8 100644 --- a/schema/src/metadatastream.rs +++ b/xsd_rs/metadatastream/src/lib.rs @@ -1,7 +1,10 @@ -use crate::b_2 as wsnt; -pub use crate::common::*; -use crate::validate::Validate; +#![allow(clippy::large_enum_variant)] + +use b_2 as wsnt; +use common::*; +use validate::Validate; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tt", namespace = "tt: http://www.onvif.org/ver10/schema")] diff --git a/xsd_rs/onvif_xsd/Cargo.toml b/xsd_rs/onvif_xsd/Cargo.toml new file mode 100644 index 0000000..655964c --- /dev/null +++ b/xsd_rs/onvif_xsd/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "onvif-xsd" +version = "0.1.0" +edition = "2021" + +[dependencies] +b_2 = { path = "../../wsdl_rs/b_2" } +common = { path = "../common" } +soap_envelope = { path = "../../xsd_rs/soap_envelope" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xmlmime = { path = "../../xsd_rs/xmlmime" } +xop = { path = "../../xsd_rs/xop" } +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/onvif.rs b/xsd_rs/onvif_xsd/src/lib.rs similarity index 99% rename from schema/src/onvif.rs rename to xsd_rs/onvif_xsd/src/lib.rs index 4112901..cbfb5be 100644 --- a/schema/src/onvif.rs +++ b/xsd_rs/onvif_xsd/src/lib.rs @@ -1,9 +1,13 @@ -use crate::{b_2 as wsnt, soap_envelope as soapenv, validate::Validate, xmlmime as xmime, xop}; +use b_2 as wsnt; +use soap_envelope as soapenv; use std::str::FromStr; +use validate::Validate; +use xmlmime as xmime; use xsd_macro_utils::*; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; -pub use crate::common::*; +pub use common::*; // Base class for physical entities like inputs and outputs. #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] diff --git a/xsd_rs/radiometry/Cargo.toml b/xsd_rs/radiometry/Cargo.toml new file mode 100644 index 0000000..8a6b708 --- /dev/null +++ b/xsd_rs/radiometry/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "radiometry" +version = "0.1.0" +edition = "2021" + +[dependencies] +b_2 = { path = "../../wsdl_rs/b_2" } +common = { path = "../common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +soap_envelope = { path = "../../xsd_rs/soap_envelope" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xmlmime = { path = "../../xsd_rs/xmlmime" } +xop = { path = "../../xsd_rs/xop" } +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/radiometry.rs b/xsd_rs/radiometry/src/lib.rs similarity index 99% rename from schema/src/radiometry.rs rename to xsd_rs/radiometry/src/lib.rs index 91ecd4a..21c9c7b 100644 --- a/schema/src/radiometry.rs +++ b/xsd_rs/radiometry/src/lib.rs @@ -1,6 +1,7 @@ -pub use crate::common::*; -use crate::{onvif as tt, validate::Validate}; +use onvif as tt; +use validate::Validate; use xsd_types::types as xs; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/xsd_rs/rules/Cargo.toml b/xsd_rs/rules/Cargo.toml new file mode 100644 index 0000000..485cdc2 --- /dev/null +++ b/xsd_rs/rules/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "rules" +version = "0.1.0" +edition = "2021" + +[dependencies] +b_2 = { path = "../../wsdl_rs/b_2" } +common = { path = "../common" } +onvif = { package = "onvif-xsd", path = "../../xsd_rs/onvif_xsd" } +soap_envelope = { path = "../../xsd_rs/soap_envelope" } +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xmlmime = { path = "../../xsd_rs/xmlmime" } +xop = { path = "../../xsd_rs/xop" } +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/rules.rs b/xsd_rs/rules/src/lib.rs similarity index 97% rename from schema/src/rules.rs rename to xsd_rs/rules/src/lib.rs index 76d6330..f3ea763 100644 --- a/schema/src/rules.rs +++ b/xsd_rs/rules/src/lib.rs @@ -1,5 +1,6 @@ -pub use crate::common::*; -use crate::{onvif as tt, validate::Validate}; +use onvif as tt; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/xsd_rs/soap_envelope/Cargo.toml b/xsd_rs/soap_envelope/Cargo.toml new file mode 100644 index 0000000..2dc73f5 --- /dev/null +++ b/xsd_rs/soap_envelope/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "soap_envelope" +version = "0.1.0" +edition = "2021" + +[dependencies] +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/soap_envelope.rs b/xsd_rs/soap_envelope/src/lib.rs similarity index 98% rename from schema/src/soap_envelope.rs rename to xsd_rs/soap_envelope/src/lib.rs index fd02f48..ec18e6e 100644 --- a/schema/src/soap_envelope.rs +++ b/xsd_rs/soap_envelope/src/lib.rs @@ -1,7 +1,7 @@ -pub use crate::common::*; -use crate::validate::Validate; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( diff --git a/xsd_rs/types/Cargo.toml b/xsd_rs/types/Cargo.toml new file mode 100644 index 0000000..faba8f9 --- /dev/null +++ b/xsd_rs/types/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "types" +version = "0.1.0" +edition = "2021" + +[dependencies] +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/types.rs b/xsd_rs/types/src/lib.rs similarity index 98% rename from schema/src/types.rs rename to xsd_rs/types/src/lib.rs index 02b1270..4f5d2bd 100644 --- a/schema/src/types.rs +++ b/xsd_rs/types/src/lib.rs @@ -1,7 +1,7 @@ -pub use crate::common::*; -use crate::validate::Validate; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; +use yaserde_derive::{YaDeserialize, YaSerialize}; // Type used to reference logical and physical entities. // Token may be extended by intermediate terminal with adding prefix to make it diff --git a/xsd_rs/xmlmime/Cargo.toml b/xsd_rs/xmlmime/Cargo.toml new file mode 100644 index 0000000..b528780 --- /dev/null +++ b/xsd_rs/xmlmime/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "xmlmime" +version = "0.1.0" +edition = "2021" + +[dependencies] +validate = { path = "../../validate" } +xml-rs = "0.8.3" +xsd-macro-utils = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +xsd-types = { git = "https://github.com/lumeohq/xsd-parser-rs", rev = "7f3d433" } +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/xmlmime.rs b/xsd_rs/xmlmime/src/lib.rs similarity index 94% rename from schema/src/xmlmime.rs rename to xsd_rs/xmlmime/src/lib.rs index 3bc1c83..b87b312 100644 --- a/schema/src/xmlmime.rs +++ b/xsd_rs/xmlmime/src/lib.rs @@ -1,6 +1,7 @@ -use crate::validate::Validate; use std::str::FromStr; +use validate::Validate; use xsd_macro_utils::*; +use yaserde_derive::{YaDeserialize, YaSerialize}; #[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct ContentType(pub String); diff --git a/xsd_rs/xop/Cargo.toml b/xsd_rs/xop/Cargo.toml new file mode 100644 index 0000000..fba3893 --- /dev/null +++ b/xsd_rs/xop/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "xop" +version = "0.1.0" +edition = "2021" + +[dependencies] +validate = { path = "../../validate" } +xml-rs = "0.8.3" +yaserde = "0.7.1" +yaserde_derive = "0.7.1" diff --git a/schema/src/xop/include.rs b/xsd_rs/xop/src/include.rs similarity index 80% rename from schema/src/xop/include.rs rename to xsd_rs/xop/src/include.rs index 5aaff95..9028d4d 100644 --- a/schema/src/xop/include.rs +++ b/xsd_rs/xop/src/include.rs @@ -1,4 +1,5 @@ -use crate::validate::Validate; +use validate::Validate; +use yaserde_derive::{YaDeserialize, YaSerialize}; // pub type Include = Include; #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] diff --git a/schema/src/xop/mod.rs b/xsd_rs/xop/src/lib.rs similarity index 100% rename from schema/src/xop/mod.rs rename to xsd_rs/xop/src/lib.rs