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

    def CreateDataset(self, request, **kwargs):
        path = "/datasets"

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

    def DeleteDataset(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)

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

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

    def UpdateDataset(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)

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

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

    def DescribeDataset(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)

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

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

    def ListDatasets(self, request, **kwargs):
        path = "/datasets"

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

    def CreateEntry(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)+"/items"

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

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

    def DeleteEntry(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)+"/items/"+urllib.parse.quote(request.entry_id)

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

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

    def UpdateEntry(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)+"/items/"+urllib.parse.quote(request.entry_id)

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

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

    def DescribeEntry(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)+"/items/"+urllib.parse.quote(request.entry_id)

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

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

    def ListEntries(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)+"/items"

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

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

    def TranslateEntry(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)+"/items/"+urllib.parse.quote(request.entry_id)+"/translations/"+urllib.parse.quote(request.locale)

        # Cleanup URL parameters to avoid any ambiguity
        request.dataset_id = ""
        request.entry_id = ""
        request.locale = ""

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

    def DeleteTranslation(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)+"/items/"+urllib.parse.quote(request.entry_id)+"/translations/"+urllib.parse.quote(request.locale)

        # Cleanup URL parameters to avoid any ambiguity
        request.dataset_id = ""
        request.entry_id = ""
        request.locale = ""

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

    def ListTranslations(self, request, **kwargs):
        path = "/datasets/"+urllib.parse.quote(request.dataset_id)+"/items/"+urllib.parse.quote(request.entry_id)+"/translations"

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

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

