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

    def CreateClass(self, request, **kwargs):
        path = "/classes"

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

    def UpdateClass(self, request, **kwargs):
        path = "/classes/"+urllib.parse.quote(request.group_id)

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

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

    def DeleteClass(self, request, **kwargs):
        path = "/classes/"+urllib.parse.quote(request.group_id)

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

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

    def DescribeClass(self, request, **kwargs):
        path = "/classes/"+urllib.parse.quote(request.group_id)

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

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

    def ListClasses(self, request, **kwargs):
        path = "/classes"

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

    def ListClassAssignments(self, request, **kwargs):
        path = "/classes/"+urllib.parse.quote(request.group_id)+"/assignments"

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

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

    def UpdateClassAssignment(self, request, **kwargs):
        path = "/classes/"+urllib.parse.quote(request.group_id)+"/assignments"

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

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

    def DeleteClassAssignment(self, request, **kwargs):
        path = "/classes/"+urllib.parse.quote(request.group_id)+"/assignments"

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

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

