diff --git a/crates/core/c8y_api/src/json_c8y_deserializer.rs b/crates/core/c8y_api/src/json_c8y_deserializer.rs index bb43ad4c1bb..249707ee60b 100644 --- a/crates/core/c8y_api/src/json_c8y_deserializer.rs +++ b/crates/core/c8y_api/src/json_c8y_deserializer.rs @@ -216,16 +216,19 @@ impl TryFrom for SoftwareInfo { update_list: Vec::new(), }; - for module in value.modules() { + for module in value.lists { let plugin_type = module .get_module_version_and_type() .1 .unwrap_or_else(SoftwareModule::default_type); + let version = module.get_module_version_and_type().0; + let url = module.get_url(); + let item = SoftwareModuleItem { - name: module.name.clone(), - version: module.get_module_version_and_type().0, - url: module.get_url(), + name: module.name, + version, + url, action: match module.action.clone().try_into()? { C8ySoftwareUpdateAction::Install => Some(SoftwareModuleAction::Install), C8ySoftwareUpdateAction::Delete => Some(SoftwareModuleAction::Remove), @@ -448,8 +451,8 @@ pub struct C8yDownloadConfigFile { impl From for ConfigInfo { fn from(value: C8yDownloadConfigFile) -> Self { ConfigInfo { - config_type: value.config_type.clone(), - remote_url: Some(value.url.clone()), + config_type: value.config_type, + remote_url: Some(value.url), } } } @@ -481,9 +484,9 @@ pub struct C8yFirmware { impl From for FirmwareInfo { fn from(value: C8yFirmware) -> Self { FirmwareInfo { - name: Some(value.name.clone()), - version: Some(value.version.clone()), - remote_url: Some(value.url.clone()), + name: Some(value.name), + version: Some(value.version), + remote_url: Some(value.url), } } }