summaryrefslogtreecommitdiffstats
path: root/crates/core
diff options
context:
space:
mode:
authorRina Fujino <18257209+rina23q@users.noreply.github.com>2022-05-09 14:33:05 +0200
committerRina Fujino <18257209+rina23q@users.noreply.github.com>2022-05-17 14:21:50 +0200
commit60373061fc66f2362eaa6b52c78df4f40f62119d (patch)
tree2ff4320c993f5b08ab14b531dc21d6245d3d1d3c /crates/core
parent29473a8b9912be60bfdad22684d97301c2e80960 (diff)
Add type support on the plugin configuration
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
Diffstat (limited to 'crates/core')
-rw-r--r--crates/core/c8y_api/src/http_proxy.rs8
-rw-r--r--crates/core/c8y_smartrest/src/smartrest_deserializer.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/core/c8y_api/src/http_proxy.rs b/crates/core/c8y_api/src/http_proxy.rs
index ac0423da..fa9d5a4d 100644
--- a/crates/core/c8y_api/src/http_proxy.rs
+++ b/crates/core/c8y_api/src/http_proxy.rs
@@ -8,7 +8,7 @@ use c8y_smartrest::{error::SMCumulocityMapperError, smartrest_deserializer::Smar
use mockall::automock;
use mqtt_channel::{Connection, PubChannel, StreamExt, Topic, TopicFilter};
use reqwest::Url;
-use std::{collections::HashMap, path::Path, time::Duration};
+use std::{collections::HashMap, time::Duration};
use tedge_config::{
C8yUrlSetting, ConfigSettingAccessor, ConfigSettingAccessorStringExt, DeviceIdSetting,
MqttBindAddressSetting, MqttPortSetting, TEdgeConfig,
@@ -46,7 +46,7 @@ pub trait C8YHttpProxy: Send + Sync {
async fn upload_config_file(
&mut self,
- config_path: &Path,
+ config_type: &str,
config_content: &str,
) -> Result<String, SMCumulocityMapperError>;
}
@@ -403,12 +403,12 @@ impl C8YHttpProxy for JwtAuthHttpProxy {
async fn upload_config_file(
&mut self,
- config_path: &Path,
+ config_type: &str,
config_content: &str,
) -> Result<String, SMCumulocityMapperError> {
let token = self.get_jwt_token().await?;
- let config_file_event = self.create_event(config_path.display().to_string(), None, None);
+ let config_file_event = self.create_event(config_type.to_string(), None, None);
let event_response_id = self.send_event_internal(config_file_event).await?;
let binary_upload_event_url = self
.end_point
diff --git a/crates/core/c8y_smartrest/src/smartrest_deserializer.rs b/crates/core/c8y_smartrest/src/smartrest_deserializer.rs
index 5d28fac0..b5aa5b46 100644
--- a/crates/core/c8y_smartrest/src/smartrest_deserializer.rs
+++ b/crates/core/c8y_smartrest/src/smartrest_deserializer.rs
@@ -244,7 +244,7 @@ pub struct SmartRestConfigUploadRequest {
impl SmartRestRequestGeneric for SmartRestConfigUploadRequest {}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, PartialEq, Clone)]
pub struct SmartRestConfigDownloadRequest {
pub message_id: String,
pub device: String,