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

    def CreateContest(self, request, **kwargs):
        path = "/contests"

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

    def DeleteContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)

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

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

    def UpdateContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)

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

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

    def CopyContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)+"/copy"

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

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

    def DescribeContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)

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

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

    def ListContests(self, request, **kwargs):
        path = "/contests"

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

    def OpenContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)+"/open"

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

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

    def CloseContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)+"/close"

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

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

    def SuspendContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)+"/suspend"

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

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

    def FreezeContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)+"/freeze"

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

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

    def ResumeContest(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)+"/resume"

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

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

    def ListActivities(self, request, **kwargs):
        path = "/contests/"+urllib.parse.quote(request.contest_id)+"/activities"

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

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

    def DescribeContestUsage(self, request, **kwargs):
        path = "/usage/contests"

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

