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

    def ListClients(self, request, **kwargs):
        path = "/auth/clients"

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

    def DescribeClient(self, request, **kwargs):
        path = "/auth/clients/"+urllib.parse.quote(request.client_id)

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

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

    def CreateClient(self, request, **kwargs):
        path = "/auth/clients"

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

    def UpdateClient(self, request, **kwargs):
        path = "/auth/clients/"+urllib.parse.quote(request.client_id)

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

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

    def DeleteClient(self, request, **kwargs):
        path = "/auth/clients/"+urllib.parse.quote(request.client_id)

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

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

    def ResetClientSecret(self, request, **kwargs):
        path = "/auth/clients/"+urllib.parse.quote(request.client_id)+"/reset-secret"

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

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

    def RegisterClient(self, request, **kwargs):
        path = "/auth/clients:register"

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

