//deployer Service implementation
// Copyright (C) 2024 Jean-Cloud
// GNU General Public License v3

#include "Service.h"

//constructor and destructor defined inline

//public methods
int Service::getUserID () const
{
    return userID;
}
string Service::getUsername() const
{
    return username;
}
list<string> Service::getServers() const
{
    return servers;
}

//operator == override
bool Service::operator == (const Service & service) const
{
    if (service.getServers()==servers && service.getUserID()==userID && service.getUsername()==username){
        return true;
    }else{
        return false;
    }
}

//operator << override
ostream & operator << (ostream & out, const Service & s)
{
    out << "userID: " << s.userID << endl << "username: " << s.username << endl << "servers: ";
    for (string server : s.servers){
        out << server << " " << endl;
    }
    return out;
}