5050#include " linglong/api/types/v1/PackageInfoDisplay.hpp"
5151#include " linglong/api/types/v1/PackageInfo.hpp"
5252#include " linglong/api/types/v1/OciConfigurationPatch.hpp"
53+ #include " linglong/api/types/v1/Mount.hpp"
5354#include " linglong/api/types/v1/LayerInfo.hpp"
5455#include " linglong/api/types/v1/InteractionRequest.hpp"
5556#include " linglong/api/types/v1/InteractionReply.hpp"
@@ -173,6 +174,9 @@ void to_json(json & j, const InteractionRequest & x);
173174void from_json (const json & j, LayerInfo & x);
174175void to_json (json & j, const LayerInfo & x);
175176
177+ void from_json (const json & j, Mount & x);
178+ void to_json (json & j, const Mount & x);
179+
176180void from_json (const json & j, OciConfigurationPatch & x);
177181void to_json (json & j, const OciConfigurationPatch & x);
178182
@@ -753,6 +757,23 @@ j["info"] = x.info;
753757j[" version" ] = x.version ;
754758}
755759
760+ inline void from_json (const json & j, Mount& x) {
761+ x.destination = j.at (" destination" ).get <std::string>();
762+ x.options = get_stack_optional<std::vector<std::string>>(j, " options" );
763+ x.source = j.at (" source" ).get <std::string>();
764+ x.type = j.at (" type" ).get <std::string>();
765+ }
766+
767+ inline void to_json (json & j, const Mount & x) {
768+ j = json::object ();
769+ j[" destination" ] = x.destination ;
770+ if (x.options ) {
771+ j[" options" ] = x.options ;
772+ }
773+ j[" source" ] = x.source ;
774+ j[" type" ] = x.type ;
775+ }
776+
756777inline void from_json (const json & j, OciConfigurationPatch& x) {
757778x.ociVersion = j.at (" ociVersion" ).get <std::string>();
758779x.patch = j.at (" patch" ).get <std::vector<nlohmann::json>>();
@@ -1244,6 +1265,8 @@ x.app = get_stack_optional<std::string>(j, "app");
12441265x.base = get_stack_optional<std::string>(j, " base" );
12451266x.cdiDevices = get_stack_optional<std::vector<CdiDeviceEntry>>(j, " cdiDevices" );
12461267x.extensions = get_stack_optional<std::map<std::string, std::vector<std::string>>>(j, " extensions" );
1268+ x.instance = get_stack_optional<std::string>(j, " instance" );
1269+ x.mounts = get_stack_optional<std::vector<Mount>>(j, " mounts" );
12471270x.overlayfs = get_stack_optional<std::string>(j, " overlayfs" );
12481271x.runtime = get_stack_optional<std::string>(j, " runtime" );
12491272x.timezone = get_stack_optional<std::string>(j, " timezone" );
@@ -1264,6 +1287,12 @@ j["cdiDevices"] = x.cdiDevices;
12641287if (x.extensions ) {
12651288j[" extensions" ] = x.extensions ;
12661289}
1290+ if (x.instance ) {
1291+ j[" instance" ] = x.instance ;
1292+ }
1293+ if (x.mounts ) {
1294+ j[" mounts" ] = x.mounts ;
1295+ }
12671296if (x.overlayfs ) {
12681297j[" overlayfs" ] = x.overlayfs ;
12691298}
@@ -1281,6 +1310,8 @@ x.deviceMode = get_stack_optional<std::vector<DeviceOption>>(j, "device_mode");
12811310x.disableXdp = get_stack_optional<bool >(j, " disable_xdp" );
12821311x.env = get_stack_optional<std::map<std::string, std::string>>(j, " env" );
12831312x.extDefs = get_stack_optional<std::map<std::string, std::vector<ExtensionDefine>>>(j, " ext_defs" );
1313+ x.instances = get_stack_optional<std::map<std::string, RuntimeConfigure>>(j, " instances" );
1314+ x.mounts = get_stack_optional<std::vector<Mount>>(j, " mounts" );
12841315}
12851316
12861317inline void to_json (json & j, const RuntimeConfigure & x) {
@@ -1297,6 +1328,12 @@ j["env"] = x.env;
12971328if (x.extDefs ) {
12981329j[" ext_defs" ] = x.extDefs ;
12991330}
1331+ if (x.instances ) {
1332+ j[" instances" ] = x.instances ;
1333+ }
1334+ if (x.mounts ) {
1335+ j[" mounts" ] = x.mounts ;
1336+ }
13001337}
13011338
13021339inline void from_json (const json & j, UabLayer& x) {
@@ -1380,6 +1417,7 @@ x.interactionMessageType = get_stack_optional<InteractionMessageType>(j, "Intera
13801417x.interactionReply = get_stack_optional<InteractionReply>(j, " InteractionReply" );
13811418x.interactionRequest = get_stack_optional<InteractionRequest>(j, " InteractionRequest" );
13821419x.layerInfo = get_stack_optional<LayerInfo>(j, " LayerInfo" );
1420+ x.mount = get_stack_optional<Mount>(j, " Mount" );
13831421x.ociConfigurationPatch = get_stack_optional<OciConfigurationPatch>(j, " OCIConfigurationPatch" );
13841422x.packageInfo = get_stack_optional<PackageInfo>(j, " PackageInfo" );
13851423x.packageInfoDisplay = get_stack_optional<PackageInfoDisplay>(j, " PackageInfoDisplay" );
@@ -1478,6 +1516,9 @@ j["InteractionRequest"] = x.interactionRequest;
14781516if (x.layerInfo ) {
14791517j[" LayerInfo" ] = x.layerInfo ;
14801518}
1519+ if (x.mount ) {
1520+ j[" Mount" ] = x.mount ;
1521+ }
14811522if (x.ociConfigurationPatch ) {
14821523j[" OCIConfigurationPatch" ] = x.ociConfigurationPatch ;
14831524}
0 commit comments