#pragma once 


#include "nlohmann/json_fwd.hpp"
#include <cstddef>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <nlohmann/json.hpp>

namespace SimControl 
{
    struct PodListItem
    {
        std::string Uuid;
        std::string Image;
        std::string Ip;
        std::string Component;
        std::string Status;
        std::string PartOf;
        std::vector<std::pair<std::string,std::shared_ptr<PodListItem>>> relatedPods;

        bool operator==(PodListItem const &rhs )
        {
            if (Uuid == rhs.Uuid) {
                return true;
            }
            return false;
        }
    };





    class PodList
    {
        public:
            PodList();
            PodList(std::string jsonstring);


            void addPodToList(std::shared_ptr<PodListItem> pod);
            void addPodToList(std::string respond);

            std::shared_ptr<PodListItem> getPod(std::string uuid);

            bool removePod(std::string uuid);

            std::vector<std::string> getPodsUUID();

            nlohmann::json getPodTree(std::string uuid);

            size_t size();

        private: 

            void addPodsFromString(std::string respond);

            std::map<std::string, std::shared_ptr<PodListItem>> podList_;

    };
}