// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: greptime/v1/meta/lock.proto

#include "greptime/v1/meta/lock.pb.h"
#include "greptime/v1/meta/lock.grpc.pb.h"

#include <functional>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/impl/channel_interface.h>
#include <grpcpp/impl/client_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/codegen/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/sync_stream.h>
namespace greptime {
namespace v1 {
namespace meta {

static const char* Lock_method_names[] = {
  "/greptime.v1.meta.Lock/Lock",
  "/greptime.v1.meta.Lock/Unlock",
};

std::unique_ptr< Lock::Stub> Lock::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
  (void)options;
  std::unique_ptr< Lock::Stub> stub(new Lock::Stub(channel, options));
  return stub;
}

Lock::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options)
  : channel_(channel), rpcmethod_Lock_(Lock_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
  , rpcmethod_Unlock_(Lock_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
  {}

::grpc::Status Lock::Stub::Lock(::grpc::ClientContext* context, const ::greptime::v1::meta::LockRequest& request, ::greptime::v1::meta::LockResponse* response) {
  return ::grpc::internal::BlockingUnaryCall< ::greptime::v1::meta::LockRequest, ::greptime::v1::meta::LockResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Lock_, context, request, response);
}

void Lock::Stub::async::Lock(::grpc::ClientContext* context, const ::greptime::v1::meta::LockRequest* request, ::greptime::v1::meta::LockResponse* response, std::function<void(::grpc::Status)> f) {
  ::grpc::internal::CallbackUnaryCall< ::greptime::v1::meta::LockRequest, ::greptime::v1::meta::LockResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Lock_, context, request, response, std::move(f));
}

void Lock::Stub::async::Lock(::grpc::ClientContext* context, const ::greptime::v1::meta::LockRequest* request, ::greptime::v1::meta::LockResponse* response, ::grpc::ClientUnaryReactor* reactor) {
  ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Lock_, context, request, response, reactor);
}

::grpc::ClientAsyncResponseReader< ::greptime::v1::meta::LockResponse>* Lock::Stub::PrepareAsyncLockRaw(::grpc::ClientContext* context, const ::greptime::v1::meta::LockRequest& request, ::grpc::CompletionQueue* cq) {
  return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::greptime::v1::meta::LockResponse, ::greptime::v1::meta::LockRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Lock_, context, request);
}

::grpc::ClientAsyncResponseReader< ::greptime::v1::meta::LockResponse>* Lock::Stub::AsyncLockRaw(::grpc::ClientContext* context, const ::greptime::v1::meta::LockRequest& request, ::grpc::CompletionQueue* cq) {
  auto* result =
    this->PrepareAsyncLockRaw(context, request, cq);
  result->StartCall();
  return result;
}

::grpc::Status Lock::Stub::Unlock(::grpc::ClientContext* context, const ::greptime::v1::meta::UnlockRequest& request, ::greptime::v1::meta::UnlockResponse* response) {
  return ::grpc::internal::BlockingUnaryCall< ::greptime::v1::meta::UnlockRequest, ::greptime::v1::meta::UnlockResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Unlock_, context, request, response);
}

void Lock::Stub::async::Unlock(::grpc::ClientContext* context, const ::greptime::v1::meta::UnlockRequest* request, ::greptime::v1::meta::UnlockResponse* response, std::function<void(::grpc::Status)> f) {
  ::grpc::internal::CallbackUnaryCall< ::greptime::v1::meta::UnlockRequest, ::greptime::v1::meta::UnlockResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Unlock_, context, request, response, std::move(f));
}

void Lock::Stub::async::Unlock(::grpc::ClientContext* context, const ::greptime::v1::meta::UnlockRequest* request, ::greptime::v1::meta::UnlockResponse* response, ::grpc::ClientUnaryReactor* reactor) {
  ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Unlock_, context, request, response, reactor);
}

::grpc::ClientAsyncResponseReader< ::greptime::v1::meta::UnlockResponse>* Lock::Stub::PrepareAsyncUnlockRaw(::grpc::ClientContext* context, const ::greptime::v1::meta::UnlockRequest& request, ::grpc::CompletionQueue* cq) {
  return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::greptime::v1::meta::UnlockResponse, ::greptime::v1::meta::UnlockRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Unlock_, context, request);
}

::grpc::ClientAsyncResponseReader< ::greptime::v1::meta::UnlockResponse>* Lock::Stub::AsyncUnlockRaw(::grpc::ClientContext* context, const ::greptime::v1::meta::UnlockRequest& request, ::grpc::CompletionQueue* cq) {
  auto* result =
    this->PrepareAsyncUnlockRaw(context, request, cq);
  result->StartCall();
  return result;
}

Lock::Service::Service() {
  AddMethod(new ::grpc::internal::RpcServiceMethod(
      Lock_method_names[0],
      ::grpc::internal::RpcMethod::NORMAL_RPC,
      new ::grpc::internal::RpcMethodHandler< Lock::Service, ::greptime::v1::meta::LockRequest, ::greptime::v1::meta::LockResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
          [](Lock::Service* service,
             ::grpc::ServerContext* ctx,
             const ::greptime::v1::meta::LockRequest* req,
             ::greptime::v1::meta::LockResponse* resp) {
               return service->Lock(ctx, req, resp);
             }, this)));
  AddMethod(new ::grpc::internal::RpcServiceMethod(
      Lock_method_names[1],
      ::grpc::internal::RpcMethod::NORMAL_RPC,
      new ::grpc::internal::RpcMethodHandler< Lock::Service, ::greptime::v1::meta::UnlockRequest, ::greptime::v1::meta::UnlockResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
          [](Lock::Service* service,
             ::grpc::ServerContext* ctx,
             const ::greptime::v1::meta::UnlockRequest* req,
             ::greptime::v1::meta::UnlockResponse* resp) {
               return service->Unlock(ctx, req, resp);
             }, this)));
}

Lock::Service::~Service() {
}

::grpc::Status Lock::Service::Lock(::grpc::ServerContext* context, const ::greptime::v1::meta::LockRequest* request, ::greptime::v1::meta::LockResponse* response) {
  (void) context;
  (void) request;
  (void) response;
  return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}

::grpc::Status Lock::Service::Unlock(::grpc::ServerContext* context, const ::greptime::v1::meta::UnlockRequest* request, ::greptime::v1::meta::UnlockResponse* response) {
  (void) context;
  (void) request;
  (void) response;
  return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}


}  // namespace greptime
}  // namespace v1
}  // namespace meta

