{% import "utils.inc.jinja" as utils %}
{{- utils.do_not_edit() }}
// This file was generated from {{ proto.source_file }}
#pragma once

{# DO NOT ADD NEW INCLUDES HERE! Add them inside codegen_declarations.hpp instead #}
#include <userver/ugrpc/server/impl/codegen_declarations.hpp>

#include "{{ proto.source_file_without_ext }}.pb.h"

{% call utils.optional_namespace(proto.namespace) %}
{% for service in proto.services %}

// Service interface for {{service.name}}
class {{service.name}}Base
    : public USERVER_NAMESPACE::ugrpc::server::ServiceBase {
 public:
  using Component = USERVER_NAMESPACE::ugrpc::server::impl::ServiceComponentBase<
      {{service.name}}Base>;

  {% for method in service.method %}
  {% if method.client_streaming and method.server_streaming %}

  using {{method.name}}ReaderWriter = USERVER_NAMESPACE::ugrpc::server::ReaderWriter<
      {{ method.input_type | grpc_to_cpp_name }}, {{ method.output_type | grpc_to_cpp_name }}>;
  using {{method.name}}Result = USERVER_NAMESPACE::ugrpc::server::StreamingResult<
      {{ method.output_type | grpc_to_cpp_name }}>;
  virtual {{method.name}}Result {{method.name}}(CallContext& context, {{method.name}}ReaderWriter& stream);

  {% elif method.client_streaming %}

  using {{method.name}}Reader = USERVER_NAMESPACE::ugrpc::server::Reader<
      {{ method.input_type | grpc_to_cpp_name }}>;
  using {{method.name}}Result = USERVER_NAMESPACE::ugrpc::server::Result<
      {{ method.output_type | grpc_to_cpp_name }}>;
  virtual {{method.name}}Result {{method.name}}(CallContext& context, {{method.name}}Reader& reader);

  {% elif method.server_streaming %}

  using {{method.name}}Writer = USERVER_NAMESPACE::ugrpc::server::Writer<
      {{ method.output_type | grpc_to_cpp_name }}>;
  using {{method.name}}Result = USERVER_NAMESPACE::ugrpc::server::StreamingResult<
      {{ method.output_type | grpc_to_cpp_name }}>;
  virtual {{method.name}}Result {{method.name}}(CallContext& context,
                                                {{ method.input_type | grpc_to_cpp_name }}&& request,
                                                {{method.name}}Writer& writer);

  {% else %}

  using {{method.name}}Result = USERVER_NAMESPACE::ugrpc::server::Result<
      {{ method.output_type | grpc_to_cpp_name }}>;
  virtual {{method.name}}Result {{method.name}}(CallContext& context, {{ method.input_type | grpc_to_cpp_name }}&& request);

  {% endif %}
  {% endfor %}

 private:
  std::unique_ptr<USERVER_NAMESPACE::ugrpc::server::impl::ServiceWorker>
  MakeWorker(USERVER_NAMESPACE::ugrpc::server::impl::ServiceSettings&& settings) final;
};
{% endfor %}
{% endcall %} {# utils.optional_namespace #}
