# -*- coding: utf-8 -*-
# Generated by https://github.com/verloop/twirpy/protoc-gen-twirpy.  DO NOT EDIT!
# source: valutes_proto/get_dollar_rate.proto

from google.protobuf import symbol_database as _symbol_database

from twirp.base import Endpoint
from twirp.server import TwirpServer
from twirp.client import TwirpClient

_sym_db = _symbol_database.Default()

class GetRateServer(TwirpServer):

	def __init__(self, *args, service, server_path_prefix="/twirp"):
		super().__init__(service=service)
		self._prefix = F"{server_path_prefix}/.GetRate"
		self._endpoints = {
			"GetDollarRate": Endpoint(
				service_name="GetRate",
				name="GetDollarRate",
				function=getattr(service, "GetDollarRate"),
				input=_sym_db.GetSymbol("GetDollarRateRequest"),
				output=_sym_db.GetSymbol("GetDollarRateResponse"),
			),
		}

class GetRateClient(TwirpClient):

	def GetDollarRate(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/.GetRate/GetDollarRate",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("GetDollarRateResponse"),
			**kwargs,
		)
