stephb9959
2023-07-12 07:31:33 -07:00
parent c75689800e
commit fd02712159
14 changed files with 571 additions and 5 deletions

View File

@@ -171,6 +171,31 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj, "lastModified", LastModified);
}
void DefaultFirmware::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "name", Name);
field_to_json(Obj, "description", Description);
field_to_json(Obj, "modelIds", Models);
field_to_json(Obj, "uri", uri);
field_to_json(Obj, "imageCreationDate", imageCreationDate);
field_to_json(Obj, "created", Created);
field_to_json(Obj, "lastModified", LastModified);
}
bool DefaultFirmware::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj, "name", Name);
field_from_json(Obj, "description", Description);
field_from_json(Obj, "modelIds", Models);
field_from_json(Obj, "uri", uri);
field_from_json(Obj, "imageCreationDate", imageCreationDate);
field_from_json(Obj, "created", Created);
field_from_json(Obj, "lastModified", LastModified);
return true;
} catch (const Poco::Exception &E) {
}
return false;
}
void CommandDetails::to_json(Poco::JSON::Object &Obj) const {
EmbedDocument("details", Obj, Details);
EmbedDocument("results", Obj, Results);