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

    def CreateRankingEvent(self, request, **kwargs):
        path = "/ranking-events"

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

    def UpdateRankingEvent(self, request, **kwargs):
        path = "/ranking-events/"+urllib.parse.quote(request.event_id)

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

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

    def DeleteRankingEvent(self, request, **kwargs):
        path = "/ranking-events/"+urllib.parse.quote(request.event_id)

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

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

    def DescribeRankingEvent(self, request, **kwargs):
        path = "/ranking-events/"+urllib.parse.quote(request.event_id)

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

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

    def ListRankingEvents(self, request, **kwargs):
        path = "/ranking-events"

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

    def UpdateRankingPoint(self, request, **kwargs):
        path = "/ranking-series/"+urllib.parse.quote(request.member_id)+"/points/"+urllib.parse.quote(request.event_id)

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

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

    def DeleteRankingPoint(self, request, **kwargs):
        path = "/ranking-series/"+urllib.parse.quote(request.member_id)+"/points/"+urllib.parse.quote(request.event_id)

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

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

    def DescribeRankingPoint(self, request, **kwargs):
        path = "/ranking-series/"+urllib.parse.quote(request.member_id)+"/points/"+urllib.parse.quote(request.event_id)

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

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

    def ListRankingPoints(self, request, **kwargs):
        path = "/ranking-series/"+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.community.ListRankingPointsOutput"),
            **kwargs,
        )

