Skip to content

Commit

Permalink
add device payload validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed Apr 23, 2024
1 parent 9dd86c5 commit 68590c9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/publisher/trans_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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!")
}

0 comments on commit 68590c9

Please sign in to comment.