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

    def CreateStudent(self, request, **kwargs):
        path = "/students"

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

    def UpdateStudent(self, request, **kwargs):
        path = "/students/"+urllib.parse.quote(request.member_id)

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

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

    def DeleteStudent(self, request, **kwargs):
        path = "/students/"+urllib.parse.quote(request.member_id)

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

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

    def DescribeStudent(self, request, **kwargs):
        path = "/students/"+urllib.parse.quote(request.member_id)

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

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

    def ListStudents(self, request, **kwargs):
        path = "/students"

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

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

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

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

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

    def ListStudentAssignments(self, request, **kwargs):
        path = "/students/"+urllib.parse.quote(request.member_id)+"/assignments"

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

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

    def UpdateStudentAssignment(self, request, **kwargs):
        path = "/students/"+urllib.parse.quote(request.member_id)+"/assignments"

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

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

    def DeleteStudentAssignment(self, request, **kwargs):
        path = "/students/"+urllib.parse.quote(request.member_id)+"/assignments"

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

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

    def ListStudentGrades(self, request, **kwargs):
        path = "/students/"+urllib.parse.quote(request.member_id)+"/grades"

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

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

    def ListModuleGrades(self, request, **kwargs):
        path = "/students/"+urllib.parse.quote(request.member_id)+"/grades/"+urllib.parse.quote(request.module_id)

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

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

