Skip to content

Commit

Permalink
Extract operation submodule from supported_operations module
Browse files Browse the repository at this point in the history
The `supported_operations` module is divided into 2 parts:

- loading, updating, managing the supported operation set, matching on
  this set, etc. basically managing the collection
- new `supported_operations::operation` contains the functions and types
  related to reading and parsing single operation files from the
  filesystem

Signed-off-by: Marcel Guzik <[email protected]>
  • Loading branch information
Bravo555 committed Dec 3, 2024
1 parent 839aad4 commit 71a68b1
Show file tree
Hide file tree
Showing 5 changed files with 605 additions and 580 deletions.
8 changes: 4 additions & 4 deletions crates/extensions/c8y_mapper_ext/src/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ use crate::error::MessageConversionError;
use crate::json;
use crate::operations;
use crate::operations::OperationHandler;
use crate::supported_operations::get_child_ops;
use crate::supported_operations::Operation;
use crate::supported_operations::operation::get_child_ops;
use crate::supported_operations::operation::Operation;
use crate::supported_operations::operation::ResultFormat;
use crate::supported_operations::Operations;
use crate::supported_operations::OperationsError;
use crate::supported_operations::ResultFormat;
use crate::supported_operations::SupportedOperations;
use anyhow::anyhow;
use anyhow::Context;
Expand Down Expand Up @@ -1674,7 +1674,7 @@ pub(crate) mod tests {
use crate::actor::IdUploadResult;
use crate::config::BridgeConfig;
use crate::config::C8yMapperConfig;
use crate::supported_operations::ResultFormat;
use crate::supported_operations::operation::ResultFormat;
use crate::Capabilities;
use anyhow::Result;
use assert_json_diff::assert_json_include;
Expand Down
2 changes: 1 addition & 1 deletion crates/extensions/c8y_mapper_ext/src/dynamic_discovery.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::supported_operations::is_valid_operation_name;
use crate::supported_operations::operation::is_valid_operation_name;
use serde::Deserialize;
use serde::Serialize;
use std::path::Path;
Expand Down
2 changes: 1 addition & 1 deletion crates/extensions/c8y_mapper_ext/src/operations/convert.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Converting Cumulocity Smartrest operation messages into local thin-edge operation messages.
use crate::supported_operations::Operation;
use crate::supported_operations::operation::Operation;
use c8y_api::json_c8y_deserializer::C8yDeviceProfile;
use c8y_api::json_c8y_deserializer::C8yDownloadConfigFile;
use c8y_api::json_c8y_deserializer::C8yFirmware;
Expand Down
Loading

0 comments on commit 71a68b1

Please sign in to comment.