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

    def CreateEditorial(self, request, **kwargs):
        path = "/editorials"

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

    def UpdateEditorial(self, request, **kwargs):
        path = "/editorials/"+urllib.parse.quote(request.editorial_id)

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

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

    def DeleteEditorial(self, request, **kwargs):
        path = "/editorials/"+urllib.parse.quote(request.editorial_id)

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

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

    def DescribeEditorial(self, request, **kwargs):
        path = "/editorials/"+urllib.parse.quote(request.editorial_id)

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

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

    def LookupEditorial(self, request, **kwargs):
        path = "/editorial"

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

    def PreviewEditorial(self, request, **kwargs):
        path = "/editorial/preview"

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

    def ListEditorials(self, request, **kwargs):
        path = "/editorials"

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

    def TranslateEditorials(self, request, **kwargs):
        path = "/editorials:translate"

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

