Description
Is your refactoring request related to a problem? Please describe.
This request is originated by #2421 (comment)
the need to create a different representations with
externalSource
for JSON over MQTT andsource
for HTTP. We should only be needing just one struct where that source field can be an enum of eitherexternalSource
orsource
. If this isn't trivial, you may address that refactoring in a different PR.
C8yCreateEvent
is used for both cases, creating an event via JSON over MQTT and HTTP.
For HTTP, source
holds the internal ID of a device, and for MQTT, extras
holds the external ID of a device as externalSource
.
The current implementation is not clear what the caller of the API needs to provide to the struct.
thin-edge.io/crates/core/c8y_api/src/json_c8y.rs
Lines 26 to 40 in 9b1ce24
Describe the solution you'd like
Describe alternatives you've considered
Additional context