# -*- 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 ParticipantServiceClient:
    def __init__(self, transport, url="https://api.eolymp.com"):
        self.transport = transport
        self.url = url

    def AssignParticipant(self, request, **kwargs):
        path = "/participants"

        return self.transport.request(
            method="POST",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.judge.AssignParticipantOutput"),
            **kwargs,
        )

    def EnableParticipant(self, request, **kwargs):
        path = "/participants/"+urllib.parse.quote(request.participant_id)+"/enable"

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

        return self.transport.request(
            method="POST",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.judge.EnableParticipantOutput"),
            **kwargs,
        )

    def DisableParticipant(self, request, **kwargs):
        path = "/participants/"+urllib.parse.quote(request.participant_id)+"/disable"

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

        return self.transport.request(
            method="POST",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.judge.DisableParticipantOutput"),
            **kwargs,
        )

    def UpdateParticipant(self, request, **kwargs):
        path = "/participants/"+urllib.parse.quote(request.participant_id)

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

        return self.transport.request(
            method="PUT",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.judge.UpdateParticipantOutput"),
            **kwargs,
        )

    def DisqualifyParticipant(self, request, **kwargs):
        path = "/participants/"+urllib.parse.quote(request.participant_id)+"/disqualify"

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

        return self.transport.request(
            method="POST",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.judge.DisqualifyParticipantOutput"),
            **kwargs,
        )

    def DeleteParticipant(self, request, **kwargs):
        path = "/participants/"+urllib.parse.quote(request.participant_id)

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

        return self.transport.request(
            method="DELETE",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.judge.DeleteParticipantOutput"),
            **kwargs,
        )

    def DescribeParticipant(self, request, **kwargs):
        path = "/participants/"+urllib.parse.quote(request.participant_id)

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

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

    def ListParticipants(self, request, **kwargs):
        path = "/participants"

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

    def DescribeViewer(self, request, **kwargs):
        path = "/introspect"

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

    def JoinContest(self, request, **kwargs):
        path = "/join"

        return self.transport.request(
            method="POST",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.judge.JoinContestOutput"),
            **kwargs,
        )

    def StartContest(self, request, **kwargs):
        path = "/start"

        return self.transport.request(
            method="POST",
            url=self.url+path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.judge.StartContestOutput"),
            **kwargs,
        )

