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

    def CreateAssignment(self, request, **kwargs):
        path = "/assignments"

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

    def DeleteAssignment(self, request, **kwargs):
        path = "/assignments/"+urllib.parse.quote(request.module_id)

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

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

    def StartAssignment(self, request, **kwargs):
        path = "/assignments/"+urllib.parse.quote(request.module_id)+"/start"

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

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

    def ListAssignments(self, request, **kwargs):
        path = "/assignments"

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

    def ListAssignmentItems(self, request, **kwargs):
        path = "/assignments/"+urllib.parse.quote(request.module_id)+"/items"

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

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

    def DescribeAssignmentItem(self, request, **kwargs):
        path = "/assignments/"+urllib.parse.quote(request.module_id)+"/items/"+urllib.parse.quote(request.item_id)

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

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

    def UpdateAssignmentItem(self, request, **kwargs):
        path = "/assignments/"+urllib.parse.quote(request.module_id)+"/items/"+urllib.parse.quote(request.item_id)

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

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

    def ResetAssignmentItem(self, request, **kwargs):
        path = "/assignments/"+urllib.parse.quote(request.module_id)+"/items/"+urllib.parse.quote(request.item_id)+"/reset"

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

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

