diff --git a/src/publisher/trans_validation.rs b/src/publisher/trans_validation.rs index dfc48d7..e26fb42 100644 --- a/src/publisher/trans_validation.rs +++ b/src/publisher/trans_validation.rs @@ -15,6 +15,8 @@ use thanix_client::{types::WritableDeviceWithConfigContextRequest, util::ThanixC use crate::{configuration::config_parser::ConfigData, Machine}; +use super::publisher_exceptions::PayloadValidationError; + /// Validate the system information found in the config file. /// /// Checks that parameters such as IDs and other system parameters entered in the config file @@ -41,15 +43,19 @@ use crate::{configuration::config_parser::ConfigData, Machine}; /// Validate the `Device` Payload. /// /// # Parameters -/// * payload: `WritableDeviceWithConfigContextRequest` - The struct to validate. +/// +/// * payload: `&WritableDeviceWithConfigContextRequest` - The struct to validate. /// /// # Returns /// /// - Ok(()) -fn validate_device_payload(payload: WritableDeviceWithConfigContextRequest) -> bool { +/// +/// # Panics +/// +/// This function panics if the connection to NetBox fails. +pub fn validate_device_payload(state: &ThanixClient, payload: &WritableDeviceWithConfigContextRequest) -> Result<(), PayloadValidationError> { println!("Validating device payload..."); - - todo!("Device payload validation not implemented yet!"); - - false + + todo!("Device Payload validation not yet implemented!") } +