// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: hefur.proto
// Protobuf C++ Version: 7.35.1

#ifndef hefur_2eproto_2epb_2eh
#define hefur_2eproto_2epb_2eh

#include <limits>
#include <string>
#include <type_traits>
#include <utility>

// clang-format off
#include "google/protobuf/runtime_version.h"
#if PROTOBUF_VERSION != 7035001
#error "Protobuf C++ gencode is built with an incompatible version of"
#error "Protobuf C++ headers/runtime. See"
#error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
#endif
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
#include "google/protobuf/arenastring.h"
#include "google/protobuf/generated_message_bases.h"
#include "google/protobuf/generated_message_tctable_decl.h"
#include "google/protobuf/generated_message_util.h"
#include "google/protobuf/metadata_lite.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/message.h"
#include "google/protobuf/message_lite.h"
#include "google/protobuf/repeated_field.h"  // IWYU pragma: export
#include "google/protobuf/extension_set.h"  // IWYU pragma: export
#include "google/protobuf/generated_enum_reflection.h"
#include "google/protobuf/unknown_field_set.h"
#include <memory>

#include <mimosa/http/handler.hh>
#include <mimosa/http/error-handler.hh>
#include <mimosa/rpc/service.hh>
#include <mimosa/rpc/call.hh>
#include <mimosa/rpc/channel.hh>
#include <mimosa/rpc/json.hh>
#include <mimosa/rpc/exception.hh>
#include <mimosa/rpc/http-call.hh>
// @@protoc_insertion_point(includes)

// Must be included last.
#include "google/protobuf/port_def.inc"

#define PROTOBUF_INTERNAL_EXPORT_hefur_2eproto

namespace google {
namespace protobuf {
namespace internal {
template <typename T>
::absl::string_view GetAnyMessageName();
}  // namespace internal
}  // namespace protobuf
}  // namespace google

// Internal implementation detail -- do not use these members.
struct TableStruct_hefur_2eproto {
  static const ::uint32_t offsets[];
};
extern "C" {
extern const ::google::protobuf::internal::DescriptorTable descriptor_table_hefur_2eproto;
}  // extern "C"
namespace hefur {
namespace pb {
enum Status : int;
extern const uint32_t Status_internal_data_[];
class StatusMsg;
struct StatusMsgGlobalsTypeInternal;
#ifndef PROTOBUF_MESSAGE_GLOBALS
extern StatusMsgGlobalsTypeInternal StatusMsg_globals_;
extern const ::google::protobuf::internal::ClassDataFull StatusMsg_class_data_;
#else
extern const StatusMsgGlobalsTypeInternal StatusMsg_globals_;
#endif  // PROTOBUF_MESSAGE_GLOBALS
class Void;
struct VoidGlobalsTypeInternal;
#ifndef PROTOBUF_MESSAGE_GLOBALS
extern VoidGlobalsTypeInternal Void_globals_;
extern const ::google::protobuf::internal::ClassDataFull Void_class_data_;
#else
extern const VoidGlobalsTypeInternal Void_globals_;
#endif  // PROTOBUF_MESSAGE_GLOBALS
}  // namespace pb
}  // namespace hefur
namespace google {
namespace protobuf {
template <>
internal::EnumTraitsT<::hefur::pb::Status_internal_data_>
    internal::EnumTraitsImpl::value<::hefur::pb::Status>;
}  // namespace protobuf
}  // namespace google

namespace hefur {
namespace pb {
enum Status : int {
  kOk = 0,
  kInternalError = 1,
};

extern const uint32_t Status_internal_data_[];
inline constexpr Status Status_MIN =
    static_cast<Status>(0);
inline constexpr Status Status_MAX =
    static_cast<Status>(1);
[[nodiscard]] inline bool Status_IsValid(int value) {
  return 0 <= value && value <= 1;
}
inline constexpr int Status_ARRAYSIZE = 1 + 1;
[[nodiscard]] const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL
Status_descriptor();
[[nodiscard]] inline auto ProtobufInternalGetEnumDescriptor(Status) {
  return Status_descriptor();
}
template <typename T>
[[nodiscard]] const ::std::string& Status_Name(T value) {
  static_assert(::std::is_same<T, Status>::value ||
                    ::std::is_integral<T>::value,
                "Incorrect type passed to Status_Name().");
  return Status_Name(static_cast<Status>(value));
}
template <>
[[nodiscard]] inline const ::std::string& Status_Name(Status value) {
  return ::google::protobuf::internal::NameOfDenseEnum<Status_descriptor, 0, 1>(
      static_cast<int>(value));
}
[[nodiscard]] inline bool Status_Parse(
    ::absl::string_view name, Status* PROTOBUF_NONNULL value) {
  return ::google::protobuf::internal::ParseNamedEnum<Status>(Status_descriptor(), name,
                                           value);
}
using ::google::protobuf::internal::generated_enum::AbslParseFlag;
using ::google::protobuf::internal::generated_enum::AbslUnparseFlag;

// ===================================================================


// -------------------------------------------------------------------

class  PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED Void final : public ::google::protobuf::internal::ZeroFieldsBase
/* @@protoc_insertion_point(class_definition:hefur.pb.Void) */ {
 public:
  inline Void() : Void(nullptr) {}

#if defined(PROTOBUF_CUSTOM_VTABLE)
  void operator delete(Void* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) {
    SharedDtor(*msg);
    ::google::protobuf::internal::SizedDelete(msg, sizeof(Void));
  }
#endif

  template <typename = void>
  explicit constexpr Void(::google::protobuf::internal::ConstantInitialized,
                           const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
                               class_data);

  inline Void(const Void& from) : Void(nullptr, from) {}
  inline Void(Void&& from) noexcept : Void(nullptr, ::std::move(from)) {}
  inline Void& operator=(const Void& from) {
    CopyFrom(from);
    return *this;
  }
  inline Void& operator=(Void&& from) noexcept {
    if (this == &from) return *this;
    if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) {
      InternalSwap(&from);
    } else {
      CopyFrom(from);
    }
    return *this;
  }

  [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
      ABSL_ATTRIBUTE_LIFETIME_BOUND {
    return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
  }
  [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL
  mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND {
    return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
  }

  [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() {
    return GetDescriptor();
  }
  [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL
  GetDescriptor() {
    return default_instance().GetMetadata().descriptor;
  }
  [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() {
    return default_instance().GetMetadata().reflection;
  }
  [[nodiscard]] static const Void& default_instance() {
    return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<Void>(&Void_globals_);
  }
  static constexpr int kIndexInFileMessages = 1;
  friend void swap(Void& a, Void& b) { a.Swap(&b); }
  inline void Swap(Void* PROTOBUF_NONNULL other) {
    if (other == this) return;
    if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) {
      InternalSwap(other);
    } else {
      ::google::protobuf::internal::GenericSwap(this, other);
    }
  }
  void UnsafeArenaSwap(Void* PROTOBUF_NONNULL other) {
    if (other == this) return;
    ABSL_DCHECK(GetArena() == other->GetArena());
    InternalSwap(other);
  }

  // implements Message ----------------------------------------------

  [[nodiscard]] Void* PROTOBUF_NONNULL
  New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const {
    return ::google::protobuf::internal::ZeroFieldsBase::DefaultConstruct<Void>(arena);
  }
  using ::google::protobuf::internal::ZeroFieldsBase::CopyFrom;
  inline void CopyFrom(const Void& from) { ::google::protobuf::internal::ZeroFieldsBase::CopyImpl(*this, from); }
  using ::google::protobuf::internal::ZeroFieldsBase::MergeFrom;
  void MergeFrom(const Void& from) { ::google::protobuf::internal::ZeroFieldsBase::MergeImpl(*this, from); }

  public:
  [[nodiscard]] bool IsInitialized() const {
    return true;
  }
 private:
  template <typename T>
  friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)();
  static ::absl::string_view FullMessageName() { return "hefur.pb.Void"; }

  explicit Void(::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
  Void(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Void& from);
  Void(
      ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Void&& from) noexcept
      : Void(arena) {
    *this = ::std::move(from);
  }
  const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL;
  static void* PROTOBUF_NONNULL PlacementNew_(
      const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
      ::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
  static constexpr auto InternalNewImpl_();

 public:
  static constexpr auto InternalGenerateClassData_(
      const MessageLite& prototype,
      const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr);

  [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const;
  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------
  // @@protoc_insertion_point(class_scope:hefur.pb.Void)
 private:
  class _Internal;
  using ParseTableT_ =
      ::google::protobuf::internal::TcParseTable<0, 0,
                          0, 0,
                          2>;
  static constexpr ParseTableT_ InternalGenerateParseTable_(
      const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data);
  friend class ::google::protobuf::internal::TcParser;
  #ifndef PROTOBUF_MESSAGE_GLOBALS
  static const ParseTableT_ _table_;
  #endif

  friend class ::google::protobuf::MessageLite;
  friend class ::google::protobuf::Arena;
  friend ::google::protobuf::internal::PrivateAccess;
  template <typename T>
  friend class ::google::protobuf::Arena::InternalHelper;
  using InternalArenaConstructable_ = void;
  using DestructorSkippable_ = void;
  friend struct ::TableStruct_hefur_2eproto;
};
// -------------------------------------------------------------------

class  PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED StatusMsg final : public ::google::protobuf::Message
/* @@protoc_insertion_point(class_definition:hefur.pb.StatusMsg) */ {
 public:
  inline StatusMsg() : StatusMsg(nullptr) {}
  ~StatusMsg() PROTOBUF_FINAL;

#if defined(PROTOBUF_CUSTOM_VTABLE)
  void operator delete(StatusMsg* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) {
    SharedDtor(*msg);
    ::google::protobuf::internal::SizedDelete(msg, sizeof(StatusMsg));
  }
#endif

  template <typename = void>
  explicit constexpr StatusMsg(::google::protobuf::internal::ConstantInitialized,
                           const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
                               class_data);

  inline StatusMsg(const StatusMsg& from) : StatusMsg(nullptr, from) {}
  inline StatusMsg(StatusMsg&& from) noexcept : StatusMsg(nullptr, ::std::move(from)) {}
  inline StatusMsg& operator=(const StatusMsg& from) {
    CopyFrom(from);
    return *this;
  }
  inline StatusMsg& operator=(StatusMsg&& from) noexcept {
    if (this == &from) return *this;
    if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) {
      InternalSwap(&from);
    } else {
      CopyFrom(from);
    }
    return *this;
  }

  [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
      ABSL_ATTRIBUTE_LIFETIME_BOUND {
    return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
  }
  [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL
  mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND {
    return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
  }

  [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() {
    return GetDescriptor();
  }
  [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL
  GetDescriptor() {
    return default_instance().GetMetadata().descriptor;
  }
  [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() {
    return default_instance().GetMetadata().reflection;
  }
  [[nodiscard]] static const StatusMsg& default_instance() {
    return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<StatusMsg>(&StatusMsg_globals_);
  }
  static constexpr int kIndexInFileMessages = 0;
  friend void swap(StatusMsg& a, StatusMsg& b) { a.Swap(&b); }
  inline void Swap(StatusMsg* PROTOBUF_NONNULL other) {
    if (other == this) return;
    if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) {
      InternalSwap(other);
    } else {
      ::google::protobuf::internal::GenericSwap(this, other);
    }
  }
  void UnsafeArenaSwap(StatusMsg* PROTOBUF_NONNULL other) {
    if (other == this) return;
    ABSL_DCHECK(GetArena() == other->GetArena());
    InternalSwap(other);
  }

  // implements Message ----------------------------------------------

  [[nodiscard]] StatusMsg* PROTOBUF_NONNULL
  New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const {
    return ::google::protobuf::Message::DefaultConstruct<StatusMsg>(arena);
  }
  using ::google::protobuf::Message::CopyFrom;
  void CopyFrom(const StatusMsg& from);
  using ::google::protobuf::Message::MergeFrom;
  void MergeFrom(const StatusMsg& from) { StatusMsg::MergeImpl(*this, from); }

  private:
  static void MergeImpl(::google::protobuf::MessageLite& to_msg,
                        const ::google::protobuf::MessageLite& from_msg);

  public:
  [[nodiscard]] bool IsInitialized() const {
    return IsInitializedImpl(*this);
  }

  private:
  static bool IsInitializedImpl(const MessageLite& msg);

  public:
  ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
  #if defined(PROTOBUF_CUSTOM_VTABLE)
  private:
  [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
  [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize(
      const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target,
      ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream);

  public:
  [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
  [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize(
      ::uint8_t* PROTOBUF_NONNULL target,
      ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const {
    return _InternalSerialize(*this, target, stream);
  }
  #else   // PROTOBUF_CUSTOM_VTABLE
  [[nodiscard]] ::size_t ByteSizeLong() const final;
  [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize(
      ::uint8_t* PROTOBUF_NONNULL target,
      ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final;
  #endif  // PROTOBUF_CUSTOM_VTABLE
  [[nodiscard]] int GetCachedSize() const {
    return _impl_._cached_size_.Get();
  }

  private:
  void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
  static void SharedDtor(MessageLite& self);
  void InternalSwap(StatusMsg* PROTOBUF_NONNULL other);
 private:
  template <typename T>
  friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)();
  static ::absl::string_view FullMessageName() { return "hefur.pb.StatusMsg"; }

  explicit StatusMsg(::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
  StatusMsg(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const StatusMsg& from);
  StatusMsg(
      ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, StatusMsg&& from) noexcept
      : StatusMsg(arena) {
    *this = ::std::move(from);
  }
  const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL;
  static void* PROTOBUF_NONNULL PlacementNew_(
      const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
      ::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
  static constexpr auto InternalNewImpl_();

 public:
  static constexpr auto InternalGenerateClassData_(
      const MessageLite& prototype,
      const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr);

  [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const;
  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------
  enum : int {
    kStatusFieldNumber = 1,
  };
  // required .hefur.pb.Status status = 1 [json_name = "status"];
  [[nodiscard]] bool has_status()
      const;
  void clear_status() ;
  [[nodiscard]] ::hefur::pb::Status status() const;
  void set_status(::hefur::pb::Status value);

  private:
  ::hefur::pb::Status _internal_status() const;
  void _internal_set_status(::hefur::pb::Status value);

  public:
  // @@protoc_insertion_point(class_scope:hefur.pb.StatusMsg)
 private:
  class _Internal;
  using ParseTableT_ =
      ::google::protobuf::internal::TcParseTable<0, 1,
                          1, 0,
                          2>;
  static constexpr ParseTableT_ InternalGenerateParseTable_(
      const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data);
  friend class ::google::protobuf::internal::TcParser;
  #ifndef PROTOBUF_MESSAGE_GLOBALS
  static const ParseTableT_ _table_;
  #endif

  friend class ::google::protobuf::MessageLite;
  friend class ::google::protobuf::Arena;
  friend ::google::protobuf::internal::PrivateAccess;
  template <typename T>
  friend class ::google::protobuf::Arena::InternalHelper;
  using InternalArenaConstructable_ = void;
  using DestructorSkippable_ = void;
  struct Impl_ {
    inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility,
                                    ::google::protobuf::internal::ConstantInitialized) noexcept;
    inline explicit Impl_(
        ::google::protobuf::internal::InternalVisibility visibility,
        ::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
    inline explicit Impl_(
        ::google::protobuf::internal::InternalVisibility visibility,
        ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
        const StatusMsg& from_msg);
    ::google::protobuf::internal::HasBits<1> _has_bits_;
    ::google::protobuf::internal::CachedSize _cached_size_;
    int status_;
    PROTOBUF_TSAN_DECLARE_MEMBER
  };
  union { Impl_ _impl_; };
  friend struct ::TableStruct_hefur_2eproto;
};

// ===================================================================




// ===================================================================


#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif  // __GNUC__
// -------------------------------------------------------------------

// StatusMsg

// required .hefur.pb.Status status = 1 [json_name = "status"];
inline bool StatusMsg::has_status() const {
  bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U);
  return value;
}
inline void StatusMsg::clear_status() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  _impl_.status_ = 0;
  ClearHasBit(_impl_._has_bits_[0], 0x00000001U);
}
inline ::hefur::pb::Status StatusMsg::status() const {
  // @@protoc_insertion_point(field_get:hefur.pb.StatusMsg.status)
  return _internal_status();
}
inline void StatusMsg::set_status(::hefur::pb::Status value) {
  _internal_set_status(value);
  SetHasBit(_impl_._has_bits_[0], 0x00000001U);
  // @@protoc_insertion_point(field_set:hefur.pb.StatusMsg.status)
}
inline ::hefur::pb::Status StatusMsg::_internal_status() const {
  ::google::protobuf::internal::TSanRead(&_impl_);
  return static_cast<::hefur::pb::Status>(_impl_.status_);
}
inline void StatusMsg::_internal_set_status(::hefur::pb::Status value) {
  ::google::protobuf::internal::TSanWrite(&_impl_);

                                          assert(::google::protobuf::internal::ValidateEnum(
                                              value, ::hefur::pb::Status_internal_data_));
                                          _impl_.status_ = value;
}

// -------------------------------------------------------------------

// Void

#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif  // __GNUC__

class Control_Client;
class Control_Server;
class ControlHttpHandler;
class ControlHttpClient;
class Control : public ::mimosa::rpc::Service
{
public:
  MIMOSA_DEF_PTR(Control);
  typedef Control_Client Client;
  typedef Control_Server Server;
  typedef ControlHttpHandler HttpHandler;
  typedef ControlHttpClient HttpClient;
  inline virtual uint32_t id() const { return 3475342384UL; }
  inline virtual const char * name() const { return "hefur.pb.Control"; }
};

class Control_Server : public Control
{
public:
  MIMOSA_DEF_PTR(Control_Server);

  // You have to implement the following rpc methods
  virtual bool releaseLogs(
    ::hefur::pb::Void & request,
    ::hefur::pb::StatusMsg & response) = 0;

  virtual bool quit(
    ::hefur::pb::Void & request,
    ::hefur::pb::StatusMsg & response) = 0;
  // End of rpc methods

protected:
  inline virtual ::mimosa::rpc::Service::CallMethodStatus callMethod(
    ::mimosa::rpc::BasicCall::Ptr basic_call,
    const char *                  request_data,
    uint32_t                      request_size)
  {
    switch (basic_call->methodId())
    {
    case 1476870136UL: // releaseLogs()
    {
      ::mimosa::rpc::Call< ::hefur::pb::Void,
                           ::hefur::pb::StatusMsg>::Ptr call(
        reinterpret_cast< ::mimosa::rpc::Call< ::hefur::pb::Void,
                                               ::hefur::pb::StatusMsg> *> (basic_call.get()));
      call->allocateMessages();
      if (!call->request().ParseFromArray(request_data, request_size))
        return ::mimosa::rpc::Service::kInvalidMsg;
      if (!releaseLogs(call->request(), call->response()))
        call->cancel();
      return ::mimosa::rpc::Service::kSucceed;
    }
    case 1135269781UL: // quit()
    {
      ::mimosa::rpc::Call< ::hefur::pb::Void,
                           ::hefur::pb::StatusMsg>::Ptr call(
        reinterpret_cast< ::mimosa::rpc::Call< ::hefur::pb::Void,
                                               ::hefur::pb::StatusMsg> *> (basic_call.get()));
      call->allocateMessages();
      if (!call->request().ParseFromArray(request_data, request_size))
        return ::mimosa::rpc::Service::kInvalidMsg;
      if (!quit(call->request(), call->response()))
        call->cancel();
      return ::mimosa::rpc::Service::kSucceed;
    }
    default:
      return ::mimosa::rpc::Service::kMethodNotFound;
    }
  }
}; // End of service

class Control_Client : public Control
{
public:
  MIMOSA_DEF_PTR(Control_Client);
  inline Control_Client(::mimosa::rpc::Channel::Ptr channel)
    : channel_(channel)
  {
  }

  inline ::mimosa::rpc::Channel::Ptr channel() const { return channel_; }

  // Rpc methods
  inline ::mimosa::rpc::Call< ::hefur::pb::Void,
                              ::hefur::pb::StatusMsg>::Ptr
  releaseLogs(::hefur::pb::Void * request)
  {
    ::mimosa::rpc::Call< ::hefur::pb::Void,
                         ::hefur::pb::StatusMsg>::Ptr call(
      new ::mimosa::rpc::Call< ::hefur::pb::Void,
                               ::hefur::pb::StatusMsg>(request));
    call->setServiceId(3475342384UL);
    call->setMethodId(1476870136UL);
    channel_->sendCall(call.get());
    return call;
  }

  inline ::mimosa::rpc::Call< ::hefur::pb::Void,
                              ::hefur::pb::StatusMsg>::Ptr
  quit(::hefur::pb::Void * request)
  {
    ::mimosa::rpc::Call< ::hefur::pb::Void,
                         ::hefur::pb::StatusMsg>::Ptr call(
      new ::mimosa::rpc::Call< ::hefur::pb::Void,
                               ::hefur::pb::StatusMsg>(request));
    call->setServiceId(3475342384UL);
    call->setMethodId(1135269781UL);
    channel_->sendCall(call.get());
    return call;
  }

  // End of rpc methods
protected:
  ::mimosa::rpc::Channel::Ptr channel_;
}; // End of service's client

class ControlHttpHandler : public ::mimosa::http::Handler
{
public:
  MIMOSA_DEF_PTR(ControlHttpHandler);
  inline
  ControlHttpHandler(Control::Server::Ptr service, const char * start_url)
    : service_(service),
      start_url_(start_url)
  {
  }

  inline virtual bool
  handle(::mimosa::http::RequestReader & request,
         ::mimosa::http::ResponseWriter & response) const override
  {
    if (request.method() != ::mimosa::http::kMethodPost)
      return ::mimosa::http::ErrorHandler::basicResponse(
        request, response, ::mimosa::http::kStatusMethodNotAllowed);

    if (request.location().size() < start_url_.size() ||
        strncmp(request.location().c_str(), start_url_.c_str(), start_url_.size()))
      return ::mimosa::http::ErrorHandler::basicResponse(
        request, response, ::mimosa::http::kStatusInternalServerError);

    const std::string method_name(request.location().substr(start_url_.size()));

    try {
      if (method_name == "releaseLogs")
      {
        std::unique_ptr< ::hefur::pb::Void> rq(new ::hefur::pb::Void);
        std::unique_ptr< ::hefur::pb::StatusMsg> rp(new ::hefur::pb::StatusMsg);
        ::mimosa::rpc::jsonDecode(&request, rq.get());
        if (!service_->releaseLogs(*rq, *rp))
          return ::mimosa::http::ErrorHandler::basicResponse(
            request, response, ::mimosa::http::kStatusServiceUnavailable);
        ::mimosa::rpc::jsonEncode(&response, *rp);
        return true;
      }
      if (method_name == "quit")
      {
        std::unique_ptr< ::hefur::pb::Void> rq(new ::hefur::pb::Void);
        std::unique_ptr< ::hefur::pb::StatusMsg> rp(new ::hefur::pb::StatusMsg);
        ::mimosa::rpc::jsonDecode(&request, rq.get());
        if (!service_->quit(*rq, *rp))
          return ::mimosa::http::ErrorHandler::basicResponse(
            request, response, ::mimosa::http::kStatusServiceUnavailable);
        ::mimosa::rpc::jsonEncode(&response, *rp);
        return true;
      }
    } catch (::mimosa::json::Decoder::ReadError e) {
      response.write("Read error", 10);
      response.setStatus(::mimosa::http::kStatusBadRequest);
      return true;
    } catch (::mimosa::json::Decoder::PrematureEof e) {
      response.write("Premature end of file", 21);
      response.setStatus(::mimosa::http::kStatusBadRequest);
      return true;
    } catch (::mimosa::json::Decoder::SyntaxError e) {
      response.write("Syntax error", 12);
      response.setStatus(::mimosa::http::kStatusBadRequest);
      return true;
    } catch (::mimosa::rpc::InvalidFormat e) {
      response.write("Invalid format", 14);
      response.setStatus(::mimosa::http::kStatusBadRequest);
      return true;
    } catch (::mimosa::rpc::MissingRequiredField e) {
      response.write("Missing required field", 22);
      response.setStatus(::mimosa::http::kStatusBadRequest);
      return true;
    } catch (::mimosa::rpc::FieldAlreadySet e) {
      response.write("Field already set", 17);
      response.setStatus(::mimosa::http::kStatusBadRequest);
      return true;
    } catch (::mimosa::rpc::InvalidEnumValue e) {
      response.write("invalid enum value", 18);
      response.setStatus(::mimosa::http::kStatusBadRequest);
      return true;
    } catch (const ::google::protobuf::Message & e) {
      ::mimosa::rpc::jsonEncode(&response, e);
      return true;
    } catch (...) {
      return ::mimosa::http::ErrorHandler::basicResponse(
        request, response, ::mimosa::http::kStatusInternalServerError);
    }

    return ::mimosa::http::ErrorHandler::basicResponse(
      request, response, ::mimosa::http::kStatusNotFound);
  }

private:
  Control::Server::Ptr service_;
  std::string start_url_;
};

class ControlHttpClient : public ::mimosa::RefCountable<ControlHttpClient>
{
public:
  MIMOSA_DEF_PTR(ControlHttpClient);
  inline
  ControlHttpClient(const std::string &base_url)
    : base_url_(base_url)
  {
  }

      bool releaseLogs(const ::hefur::pb::Void &request,
        ::hefur::pb::StatusMsg *response) const
      {
        return ::mimosa::rpc::httpCall(base_url_ + "releaseLogs", request, response);
      }
      bool quit(const ::hefur::pb::Void &request,
        ::hefur::pb::StatusMsg *response) const
      {
        return ::mimosa::rpc::httpCall(base_url_ + "quit", request, response);
      }

private:
  std::string base_url_;
};

// @@protoc_insertion_point(namespace_scope)
}  // namespace pb
}  // namespace hefur


namespace google {
namespace protobuf {

template <>
struct is_proto_enum<::hefur::pb::Status> : std::true_type {};
template <>
inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::hefur::pb::Status>() {
  return ::hefur::pb::Status_descriptor();
}

}  // namespace protobuf
}  // namespace google

// @@protoc_insertion_point(global_scope)

#include "google/protobuf/port_undef.inc"
// clang-format on

#endif  // hefur_2eproto_2epb_2eh
