# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# See https://github.com/eolymp/contracts/tree/main/cmd/protoc-gen-python-esdk for more details.
"""Generated protocol buffer code."""

import urllib.parse
from google.protobuf import symbol_database as _symbol_database

_sym_db = _symbol_database.Default()


class ExecutorClient:
    def __init__(self, transport, url="https://api.eolymp.com"):
        self.transport = transport
        self.url = url

    def DescribeLanguage(self, request, **kwargs):
        path = "/exec/languages/"+urllib.parse.quote(request.language_id)

        # Cleanup URL parameters to avoid any ambiguity
        request.language_id = ""

        return self.transport.request(
            method="GET",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.executor.DescribeLanguageOutput"),
            **kwargs,
        )

    def ListLanguages(self, request, **kwargs):
        path = "/exec/languages"

        return self.transport.request(
            method="GET",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.executor.ListLanguagesOutput"),
            **kwargs,
        )

    def DescribeRuntime(self, request, **kwargs):
        path = "/exec/runtime/"+urllib.parse.quote(request.runtime_id)

        # Cleanup URL parameters to avoid any ambiguity
        request.runtime_id = ""

        return self.transport.request(
            method="GET",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.executor.DescribeRuntimeOutput"),
            **kwargs,
        )

    def ListRuntime(self, request, **kwargs):
        path = "/exec/runtime"

        return self.transport.request(
            method="GET",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.executor.ListRuntimeOutput"),
            **kwargs,
        )

    def DescribeCodeTemplate(self, request, **kwargs):
        path = "/exec/runtime/"+urllib.parse.quote(request.runtime_id)+"/template"

        # Cleanup URL parameters to avoid any ambiguity
        request.runtime_id = ""

        return self.transport.request(
            method="GET",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.executor.DescribeCodeTemplateOutput"),
            **kwargs,
        )

