|
46 | 46 | #include "linglong/api/types/v1/PackageManager1GetRepoInfoResult.hpp" |
47 | 47 | #include "linglong/api/types/v1/PackageManager1GetRepoInfoResultRepoInfo.hpp" |
48 | 48 | #include "linglong/api/types/v1/PackageInfoV2.hpp" |
| 49 | +#include "linglong/api/types/v1/PackageInfoDisplay.hpp" |
49 | 50 | #include "linglong/api/types/v1/PackageInfo.hpp" |
50 | 51 | #include "linglong/api/types/v1/OciConfigurationPatch.hpp" |
51 | 52 | #include "linglong/api/types/v1/LayerInfo.hpp" |
@@ -164,6 +165,9 @@ void to_json(json & j, const OciConfigurationPatch & x); |
164 | 165 | void from_json(const json & j, PackageInfo & x); |
165 | 166 | void to_json(json & j, const PackageInfo & x); |
166 | 167 |
|
| 168 | +void from_json(const json & j, PackageInfoDisplay & x); |
| 169 | +void to_json(json & j, const PackageInfoDisplay & x); |
| 170 | + |
167 | 171 | void from_json(const json & j, PackageInfoV2 & x); |
168 | 172 | void to_json(json & j, const PackageInfoV2 & x); |
169 | 173 |
|
@@ -730,6 +734,69 @@ j["size"] = x.size; |
730 | 734 | j["version"] = x.version; |
731 | 735 | } |
732 | 736 |
|
| 737 | +inline void from_json(const json & j, PackageInfoDisplay& x) { |
| 738 | +x.arch = j.at("arch").get<std::vector<std::string>>(); |
| 739 | +x.base = j.at("base").get<std::string>(); |
| 740 | +x.channel = j.at("channel").get<std::string>(); |
| 741 | +x.command = get_stack_optional<std::vector<std::string>>(j, "command"); |
| 742 | +x.compatibleVersion = get_stack_optional<std::string>(j, "compatible_version"); |
| 743 | +x.description = get_stack_optional<std::string>(j, "description"); |
| 744 | +x.extImpl = get_stack_optional<ExtensionImpl>(j, "ext_impl"); |
| 745 | +x.extensions = get_stack_optional<std::vector<ExtensionDefine>>(j, "extensions"); |
| 746 | +x.id = j.at("id").get<std::string>(); |
| 747 | +x.kind = j.at("kind").get<std::string>(); |
| 748 | +x.packageInfoDisplayModule = j.at("module").get<std::string>(); |
| 749 | +x.name = j.at("name").get<std::string>(); |
| 750 | +x.permissions = get_stack_optional<ApplicationConfigurationPermissions>(j, "permissions"); |
| 751 | +x.runtime = get_stack_optional<std::string>(j, "runtime"); |
| 752 | +x.schemaVersion = j.at("schema_version").get<std::string>(); |
| 753 | +x.size = j.at("size").get<int64_t>(); |
| 754 | +x.uuid = get_stack_optional<std::string>(j, "uuid"); |
| 755 | +x.version = j.at("version").get<std::string>(); |
| 756 | +x.installTime = get_stack_optional<int64_t>(j, "install_time"); |
| 757 | +} |
| 758 | + |
| 759 | +inline void to_json(json & j, const PackageInfoDisplay & x) { |
| 760 | +j = json::object(); |
| 761 | +j["arch"] = x.arch; |
| 762 | +j["base"] = x.base; |
| 763 | +j["channel"] = x.channel; |
| 764 | +if (x.command) { |
| 765 | +j["command"] = x.command; |
| 766 | +} |
| 767 | +if (x.compatibleVersion) { |
| 768 | +j["compatible_version"] = x.compatibleVersion; |
| 769 | +} |
| 770 | +if (x.description) { |
| 771 | +j["description"] = x.description; |
| 772 | +} |
| 773 | +if (x.extImpl) { |
| 774 | +j["ext_impl"] = x.extImpl; |
| 775 | +} |
| 776 | +if (x.extensions) { |
| 777 | +j["extensions"] = x.extensions; |
| 778 | +} |
| 779 | +j["id"] = x.id; |
| 780 | +j["kind"] = x.kind; |
| 781 | +j["module"] = x.packageInfoDisplayModule; |
| 782 | +j["name"] = x.name; |
| 783 | +if (x.permissions) { |
| 784 | +j["permissions"] = x.permissions; |
| 785 | +} |
| 786 | +if (x.runtime) { |
| 787 | +j["runtime"] = x.runtime; |
| 788 | +} |
| 789 | +j["schema_version"] = x.schemaVersion; |
| 790 | +j["size"] = x.size; |
| 791 | +if (x.uuid) { |
| 792 | +j["uuid"] = x.uuid; |
| 793 | +} |
| 794 | +j["version"] = x.version; |
| 795 | +if (x.installTime) { |
| 796 | +j["install_time"] = x.installTime; |
| 797 | +} |
| 798 | +} |
| 799 | + |
733 | 800 | inline void from_json(const json & j, PackageInfoV2& x) { |
734 | 801 | x.arch = j.at("arch").get<std::vector<std::string>>(); |
735 | 802 | x.base = j.at("base").get<std::string>(); |
@@ -1169,6 +1236,7 @@ x.interactionRequest = get_stack_optional<InteractionRequest>(j, "InteractionReq |
1169 | 1236 | x.layerInfo = get_stack_optional<LayerInfo>(j, "LayerInfo"); |
1170 | 1237 | x.ociConfigurationPatch = get_stack_optional<OciConfigurationPatch>(j, "OCIConfigurationPatch"); |
1171 | 1238 | x.packageInfo = get_stack_optional<PackageInfo>(j, "PackageInfo"); |
| 1239 | +x.packageInfoDisplay = get_stack_optional<PackageInfoDisplay>(j, "PackageInfoDisplay"); |
1172 | 1240 | x.packageInfoV2 = get_stack_optional<PackageInfoV2>(j, "PackageInfoV2"); |
1173 | 1241 | x.packageManager1GetRepoInfoResult = get_stack_optional<PackageManager1GetRepoInfoResult>(j, "PackageManager1GetRepoInfoResult"); |
1174 | 1242 | x.packageManager1InstallLayerFDResult = get_stack_optional<CommonResult>(j, "PackageManager1InstallLayerFDResult"); |
@@ -1260,6 +1328,9 @@ j["OCIConfigurationPatch"] = x.ociConfigurationPatch; |
1260 | 1328 | if (x.packageInfo) { |
1261 | 1329 | j["PackageInfo"] = x.packageInfo; |
1262 | 1330 | } |
| 1331 | +if (x.packageInfoDisplay) { |
| 1332 | +j["PackageInfoDisplay"] = x.packageInfoDisplay; |
| 1333 | +} |
1263 | 1334 | if (x.packageInfoV2) { |
1264 | 1335 | j["PackageInfoV2"] = x.packageInfoV2; |
1265 | 1336 | } |
|
0 commit comments