from eolymp.runtime import RuntimeServiceClient, ListRuntimesInput

from peolymp.abstract import AbstractAPI


class RuntimeAPI(AbstractAPI):

    def __init__(self, space):
        super(RuntimeAPI, self).__init__(space)
        self.runtime_client = RuntimeServiceClient(self.http_client, url=self.get_url())

    def get_runtimes(self):
        return self.runtime_client.ListRuntimes(ListRuntimesInput())