package proto

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

const _ = grpc.SupportPackageIsVersion7

type GraderHubServiceClient interface {
	RegisterGrader(ctx context.Context, in *RegisterGraderRequest, opts ...grpc.CallOption) (*RegisterGraderResponse, error)
	Grade(ctx context.Context, in *GradeRequest, opts ...grpc.CallOption) (*GradeCallbackResponse, error)
	GraderHeartbeat(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_GraderHeartbeatClient, error)
	GradeCallback(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_GradeCallbackClient, error)
	GetMetadata(ctx context.Context, in *GetMetadataRequest, opts ...grpc.CallOption) (*GetMetadataResponse, error)
	PutMetadata(ctx context.Context, in *PutMetadataRequest, opts ...grpc.CallOption) (*PutMetadataResponse, error)
	GetAllMetadata(ctx context.Context, in *GetAllMetadataRequest, opts ...grpc.CallOption) (*GetAllMetadataResponse, error)
	StreamLogCallback(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_StreamLogCallbackClient, error)
}

type graderHubServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewGraderHubServiceClient(cc grpc.ClientConnInterface) GraderHubServiceClient {
	return &graderHubServiceClient{cc}
}

func (c *graderHubServiceClient) RegisterGrader(ctx context.Context, in *RegisterGraderRequest, opts ...grpc.CallOption) (*RegisterGraderResponse, error) {
	out := new(RegisterGraderResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/RegisterGrader", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) Grade(ctx context.Context, in *GradeRequest, opts ...grpc.CallOption) (*GradeCallbackResponse, error) {
	out := new(GradeCallbackResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/Grade", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) GraderHeartbeat(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_GraderHeartbeatClient, error) {
	stream, err := c.cc.NewStream(ctx, &GraderHubService_ServiceDesc.Streams[0], "/GraderHubService/GraderHeartbeat", opts...)
	if err != nil {
		return nil, err
	}
	x := &graderHubServiceGraderHeartbeatClient{stream}
	return x, nil
}

type GraderHubService_GraderHeartbeatClient interface {
	Send(*GraderHeartbeatRequest) error
	Recv() (*GraderHeartbeatResponse, error)
	grpc.ClientStream
}

type graderHubServiceGraderHeartbeatClient struct {
	grpc.ClientStream
}

func (x *graderHubServiceGraderHeartbeatClient) Send(m *GraderHeartbeatRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *graderHubServiceGraderHeartbeatClient) Recv() (*GraderHeartbeatResponse, error) {
	m := new(GraderHeartbeatResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *graderHubServiceClient) GradeCallback(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_GradeCallbackClient, error) {
	stream, err := c.cc.NewStream(ctx, &GraderHubService_ServiceDesc.Streams[1], "/GraderHubService/GradeCallback", opts...)
	if err != nil {
		return nil, err
	}
	x := &graderHubServiceGradeCallbackClient{stream}
	return x, nil
}

type GraderHubService_GradeCallbackClient interface {
	Send(*GradeResponse) error
	CloseAndRecv() (*GradeCallbackResponse, error)
	grpc.ClientStream
}

type graderHubServiceGradeCallbackClient struct {
	grpc.ClientStream
}

func (x *graderHubServiceGradeCallbackClient) Send(m *GradeResponse) error {
	return x.ClientStream.SendMsg(m)
}

func (x *graderHubServiceGradeCallbackClient) CloseAndRecv() (*GradeCallbackResponse, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(GradeCallbackResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *graderHubServiceClient) GetMetadata(ctx context.Context, in *GetMetadataRequest, opts ...grpc.CallOption) (*GetMetadataResponse, error) {
	out := new(GetMetadataResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/GetMetadata", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) PutMetadata(ctx context.Context, in *PutMetadataRequest, opts ...grpc.CallOption) (*PutMetadataResponse, error) {
	out := new(PutMetadataResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/PutMetadata", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) GetAllMetadata(ctx context.Context, in *GetAllMetadataRequest, opts ...grpc.CallOption) (*GetAllMetadataResponse, error) {
	out := new(GetAllMetadataResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/GetAllMetadata", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) StreamLogCallback(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_StreamLogCallbackClient, error) {
	stream, err := c.cc.NewStream(ctx, &GraderHubService_ServiceDesc.Streams[2], "/GraderHubService/StreamLogCallback", opts...)
	if err != nil {
		return nil, err
	}
	x := &graderHubServiceStreamLogCallbackClient{stream}
	return x, nil
}

type GraderHubService_StreamLogCallbackClient interface {
	Send(*StreamLogResponse) error
	CloseAndRecv() (*StreamLogCallbackResponse, error)
	grpc.ClientStream
}

type graderHubServiceStreamLogCallbackClient struct {
	grpc.ClientStream
}

func (x *graderHubServiceStreamLogCallbackClient) Send(m *StreamLogResponse) error {
	return x.ClientStream.SendMsg(m)
}

func (x *graderHubServiceStreamLogCallbackClient) CloseAndRecv() (*StreamLogCallbackResponse, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(StreamLogCallbackResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

type GraderHubServiceServer interface {
	RegisterGrader(context.Context, *RegisterGraderRequest) (*RegisterGraderResponse, error)
	Grade(context.Context, *GradeRequest) (*GradeCallbackResponse, error)
	GraderHeartbeat(GraderHubService_GraderHeartbeatServer) error
	GradeCallback(GraderHubService_GradeCallbackServer) error
	GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error)
	PutMetadata(context.Context, *PutMetadataRequest) (*PutMetadataResponse, error)
	GetAllMetadata(context.Context, *GetAllMetadataRequest) (*GetAllMetadataResponse, error)
	StreamLogCallback(GraderHubService_StreamLogCallbackServer) error
	mustEmbedUnimplementedGraderHubServiceServer()
}

type UnimplementedGraderHubServiceServer struct {
}

func (UnimplementedGraderHubServiceServer) RegisterGrader(context.Context, *RegisterGraderRequest) (*RegisterGraderResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RegisterGrader not implemented")
}
func (UnimplementedGraderHubServiceServer) Grade(context.Context, *GradeRequest) (*GradeCallbackResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Grade not implemented")
}
func (UnimplementedGraderHubServiceServer) GraderHeartbeat(GraderHubService_GraderHeartbeatServer) error {
	return status.Errorf(codes.Unimplemented, "method GraderHeartbeat not implemented")
}
func (UnimplementedGraderHubServiceServer) GradeCallback(GraderHubService_GradeCallbackServer) error {
	return status.Errorf(codes.Unimplemented, "method GradeCallback not implemented")
}
func (UnimplementedGraderHubServiceServer) GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetMetadata not implemented")
}
func (UnimplementedGraderHubServiceServer) PutMetadata(context.Context, *PutMetadataRequest) (*PutMetadataResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PutMetadata not implemented")
}
func (UnimplementedGraderHubServiceServer) GetAllMetadata(context.Context, *GetAllMetadataRequest) (*GetAllMetadataResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetAllMetadata not implemented")
}
func (UnimplementedGraderHubServiceServer) StreamLogCallback(GraderHubService_StreamLogCallbackServer) error {
	return status.Errorf(codes.Unimplemented, "method StreamLogCallback not implemented")
}
func (UnimplementedGraderHubServiceServer) mustEmbedUnimplementedGraderHubServiceServer() {}

type UnsafeGraderHubServiceServer interface {
	mustEmbedUnimplementedGraderHubServiceServer()
}

func RegisterGraderHubServiceServer(s grpc.ServiceRegistrar, srv GraderHubServiceServer) {
	s.RegisterService(&GraderHubService_ServiceDesc, srv)
}

func _GraderHubService_RegisterGrader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RegisterGraderRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).RegisterGrader(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/RegisterGrader",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).RegisterGrader(ctx, req.(*RegisterGraderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_Grade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GradeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).Grade(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/Grade",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).Grade(ctx, req.(*GradeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_GraderHeartbeat_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GraderHubServiceServer).GraderHeartbeat(&graderHubServiceGraderHeartbeatServer{stream})
}

type GraderHubService_GraderHeartbeatServer interface {
	Send(*GraderHeartbeatResponse) error
	Recv() (*GraderHeartbeatRequest, error)
	grpc.ServerStream
}

type graderHubServiceGraderHeartbeatServer struct {
	grpc.ServerStream
}

func (x *graderHubServiceGraderHeartbeatServer) Send(m *GraderHeartbeatResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *graderHubServiceGraderHeartbeatServer) Recv() (*GraderHeartbeatRequest, error) {
	m := new(GraderHeartbeatRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _GraderHubService_GradeCallback_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GraderHubServiceServer).GradeCallback(&graderHubServiceGradeCallbackServer{stream})
}

type GraderHubService_GradeCallbackServer interface {
	SendAndClose(*GradeCallbackResponse) error
	Recv() (*GradeResponse, error)
	grpc.ServerStream
}

type graderHubServiceGradeCallbackServer struct {
	grpc.ServerStream
}

func (x *graderHubServiceGradeCallbackServer) SendAndClose(m *GradeCallbackResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *graderHubServiceGradeCallbackServer) Recv() (*GradeResponse, error) {
	m := new(GradeResponse)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _GraderHubService_GetMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetMetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).GetMetadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/GetMetadata",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).GetMetadata(ctx, req.(*GetMetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_PutMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PutMetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).PutMetadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/PutMetadata",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).PutMetadata(ctx, req.(*PutMetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_GetAllMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAllMetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).GetAllMetadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/GetAllMetadata",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).GetAllMetadata(ctx, req.(*GetAllMetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_StreamLogCallback_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GraderHubServiceServer).StreamLogCallback(&graderHubServiceStreamLogCallbackServer{stream})
}

type GraderHubService_StreamLogCallbackServer interface {
	SendAndClose(*StreamLogCallbackResponse) error
	Recv() (*StreamLogResponse, error)
	grpc.ServerStream
}

type graderHubServiceStreamLogCallbackServer struct {
	grpc.ServerStream
}

func (x *graderHubServiceStreamLogCallbackServer) SendAndClose(m *StreamLogCallbackResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *graderHubServiceStreamLogCallbackServer) Recv() (*StreamLogResponse, error) {
	m := new(StreamLogResponse)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

var GraderHubService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "GraderHubService",
	HandlerType: (*GraderHubServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterGrader",
			Handler:    _GraderHubService_RegisterGrader_Handler,
		},
		{
			MethodName: "Grade",
			Handler:    _GraderHubService_Grade_Handler,
		},
		{
			MethodName: "GetMetadata",
			Handler:    _GraderHubService_GetMetadata_Handler,
		},
		{
			MethodName: "PutMetadata",
			Handler:    _GraderHubService_PutMetadata_Handler,
		},
		{
			MethodName: "GetAllMetadata",
			Handler:    _GraderHubService_GetAllMetadata_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GraderHeartbeat",
			Handler:       _GraderHubService_GraderHeartbeat_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "GradeCallback",
			Handler:       _GraderHubService_GradeCallback_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "StreamLogCallback",
			Handler:       _GraderHubService_StreamLogCallback_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "grader.proto",
}
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.19.4
// source: grader.proto

package proto

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// GraderHubServiceClient is the client API for GraderHubService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type GraderHubServiceClient interface {
	RegisterGrader(ctx context.Context, in *RegisterGraderRequest, opts ...grpc.CallOption) (*RegisterGraderResponse, error)
	Grade(ctx context.Context, in *GradeRequest, opts ...grpc.CallOption) (*GradeCallbackResponse, error)
	GraderHeartbeat(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_GraderHeartbeatClient, error)
	GradeCallback(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_GradeCallbackClient, error)
	GetMetadata(ctx context.Context, in *GetMetadataRequest, opts ...grpc.CallOption) (*GetMetadataResponse, error)
	PutMetadata(ctx context.Context, in *PutMetadataRequest, opts ...grpc.CallOption) (*PutMetadataResponse, error)
	GetAllMetadata(ctx context.Context, in *GetAllMetadataRequest, opts ...grpc.CallOption) (*GetAllMetadataResponse, error)
	StreamLogCallback(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_StreamLogCallbackClient, error)
}

type graderHubServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewGraderHubServiceClient(cc grpc.ClientConnInterface) GraderHubServiceClient {
	return &graderHubServiceClient{cc}
}

func (c *graderHubServiceClient) RegisterGrader(ctx context.Context, in *RegisterGraderRequest, opts ...grpc.CallOption) (*RegisterGraderResponse, error) {
	out := new(RegisterGraderResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/RegisterGrader", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) Grade(ctx context.Context, in *GradeRequest, opts ...grpc.CallOption) (*GradeCallbackResponse, error) {
	out := new(GradeCallbackResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/Grade", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) GraderHeartbeat(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_GraderHeartbeatClient, error) {
	stream, err := c.cc.NewStream(ctx, &GraderHubService_ServiceDesc.Streams[0], "/GraderHubService/GraderHeartbeat", opts...)
	if err != nil {
		return nil, err
	}
	x := &graderHubServiceGraderHeartbeatClient{stream}
	return x, nil
}

type GraderHubService_GraderHeartbeatClient interface {
	Send(*GraderHeartbeatRequest) error
	Recv() (*GraderHeartbeatResponse, error)
	grpc.ClientStream
}

type graderHubServiceGraderHeartbeatClient struct {
	grpc.ClientStream
}

func (x *graderHubServiceGraderHeartbeatClient) Send(m *GraderHeartbeatRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *graderHubServiceGraderHeartbeatClient) Recv() (*GraderHeartbeatResponse, error) {
	m := new(GraderHeartbeatResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *graderHubServiceClient) GradeCallback(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_GradeCallbackClient, error) {
	stream, err := c.cc.NewStream(ctx, &GraderHubService_ServiceDesc.Streams[1], "/GraderHubService/GradeCallback", opts...)
	if err != nil {
		return nil, err
	}
	x := &graderHubServiceGradeCallbackClient{stream}
	return x, nil
}

type GraderHubService_GradeCallbackClient interface {
	Send(*GradeResponse) error
	CloseAndRecv() (*GradeCallbackResponse, error)
	grpc.ClientStream
}

type graderHubServiceGradeCallbackClient struct {
	grpc.ClientStream
}

func (x *graderHubServiceGradeCallbackClient) Send(m *GradeResponse) error {
	return x.ClientStream.SendMsg(m)
}

func (x *graderHubServiceGradeCallbackClient) CloseAndRecv() (*GradeCallbackResponse, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(GradeCallbackResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *graderHubServiceClient) GetMetadata(ctx context.Context, in *GetMetadataRequest, opts ...grpc.CallOption) (*GetMetadataResponse, error) {
	out := new(GetMetadataResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/GetMetadata", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) PutMetadata(ctx context.Context, in *PutMetadataRequest, opts ...grpc.CallOption) (*PutMetadataResponse, error) {
	out := new(PutMetadataResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/PutMetadata", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) GetAllMetadata(ctx context.Context, in *GetAllMetadataRequest, opts ...grpc.CallOption) (*GetAllMetadataResponse, error) {
	out := new(GetAllMetadataResponse)
	err := c.cc.Invoke(ctx, "/GraderHubService/GetAllMetadata", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *graderHubServiceClient) StreamLogCallback(ctx context.Context, opts ...grpc.CallOption) (GraderHubService_StreamLogCallbackClient, error) {
	stream, err := c.cc.NewStream(ctx, &GraderHubService_ServiceDesc.Streams[2], "/GraderHubService/StreamLogCallback", opts...)
	if err != nil {
		return nil, err
	}
	x := &graderHubServiceStreamLogCallbackClient{stream}
	return x, nil
}

type GraderHubService_StreamLogCallbackClient interface {
	Send(*StreamLogResponse) error
	CloseAndRecv() (*StreamLogCallbackResponse, error)
	grpc.ClientStream
}

type graderHubServiceStreamLogCallbackClient struct {
	grpc.ClientStream
}

func (x *graderHubServiceStreamLogCallbackClient) Send(m *StreamLogResponse) error {
	return x.ClientStream.SendMsg(m)
}

func (x *graderHubServiceStreamLogCallbackClient) CloseAndRecv() (*StreamLogCallbackResponse, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(StreamLogCallbackResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// GraderHubServiceServer is the server API for GraderHubService service.
// All implementations must embed UnimplementedGraderHubServiceServer
// for forward compatibility
type GraderHubServiceServer interface {
	RegisterGrader(context.Context, *RegisterGraderRequest) (*RegisterGraderResponse, error)
	Grade(context.Context, *GradeRequest) (*GradeCallbackResponse, error)
	GraderHeartbeat(GraderHubService_GraderHeartbeatServer) error
	GradeCallback(GraderHubService_GradeCallbackServer) error
	GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error)
	PutMetadata(context.Context, *PutMetadataRequest) (*PutMetadataResponse, error)
	GetAllMetadata(context.Context, *GetAllMetadataRequest) (*GetAllMetadataResponse, error)
	StreamLogCallback(GraderHubService_StreamLogCallbackServer) error
	mustEmbedUnimplementedGraderHubServiceServer()
}

// UnimplementedGraderHubServiceServer must be embedded to have forward compatible implementations.
type UnimplementedGraderHubServiceServer struct {
}

func (UnimplementedGraderHubServiceServer) RegisterGrader(context.Context, *RegisterGraderRequest) (*RegisterGraderResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RegisterGrader not implemented")
}
func (UnimplementedGraderHubServiceServer) Grade(context.Context, *GradeRequest) (*GradeCallbackResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Grade not implemented")
}
func (UnimplementedGraderHubServiceServer) GraderHeartbeat(GraderHubService_GraderHeartbeatServer) error {
	return status.Errorf(codes.Unimplemented, "method GraderHeartbeat not implemented")
}
func (UnimplementedGraderHubServiceServer) GradeCallback(GraderHubService_GradeCallbackServer) error {
	return status.Errorf(codes.Unimplemented, "method GradeCallback not implemented")
}
func (UnimplementedGraderHubServiceServer) GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetMetadata not implemented")
}
func (UnimplementedGraderHubServiceServer) PutMetadata(context.Context, *PutMetadataRequest) (*PutMetadataResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PutMetadata not implemented")
}
func (UnimplementedGraderHubServiceServer) GetAllMetadata(context.Context, *GetAllMetadataRequest) (*GetAllMetadataResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetAllMetadata not implemented")
}
func (UnimplementedGraderHubServiceServer) StreamLogCallback(GraderHubService_StreamLogCallbackServer) error {
	return status.Errorf(codes.Unimplemented, "method StreamLogCallback not implemented")
}
func (UnimplementedGraderHubServiceServer) mustEmbedUnimplementedGraderHubServiceServer() {}

// UnsafeGraderHubServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GraderHubServiceServer will
// result in compilation errors.
type UnsafeGraderHubServiceServer interface {
	mustEmbedUnimplementedGraderHubServiceServer()
}

func RegisterGraderHubServiceServer(s grpc.ServiceRegistrar, srv GraderHubServiceServer) {
	s.RegisterService(&GraderHubService_ServiceDesc, srv)
}

func _GraderHubService_RegisterGrader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RegisterGraderRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).RegisterGrader(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/RegisterGrader",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).RegisterGrader(ctx, req.(*RegisterGraderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_Grade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GradeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).Grade(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/Grade",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).Grade(ctx, req.(*GradeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_GraderHeartbeat_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GraderHubServiceServer).GraderHeartbeat(&graderHubServiceGraderHeartbeatServer{stream})
}

type GraderHubService_GraderHeartbeatServer interface {
	Send(*GraderHeartbeatResponse) error
	Recv() (*GraderHeartbeatRequest, error)
	grpc.ServerStream
}

type graderHubServiceGraderHeartbeatServer struct {
	grpc.ServerStream
}

func (x *graderHubServiceGraderHeartbeatServer) Send(m *GraderHeartbeatResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *graderHubServiceGraderHeartbeatServer) Recv() (*GraderHeartbeatRequest, error) {
	m := new(GraderHeartbeatRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _GraderHubService_GradeCallback_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GraderHubServiceServer).GradeCallback(&graderHubServiceGradeCallbackServer{stream})
}

type GraderHubService_GradeCallbackServer interface {
	SendAndClose(*GradeCallbackResponse) error
	Recv() (*GradeResponse, error)
	grpc.ServerStream
}

type graderHubServiceGradeCallbackServer struct {
	grpc.ServerStream
}

func (x *graderHubServiceGradeCallbackServer) SendAndClose(m *GradeCallbackResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *graderHubServiceGradeCallbackServer) Recv() (*GradeResponse, error) {
	m := new(GradeResponse)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _GraderHubService_GetMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetMetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).GetMetadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/GetMetadata",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).GetMetadata(ctx, req.(*GetMetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_PutMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PutMetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).PutMetadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/PutMetadata",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).PutMetadata(ctx, req.(*PutMetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_GetAllMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAllMetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GraderHubServiceServer).GetAllMetadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/GraderHubService/GetAllMetadata",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GraderHubServiceServer).GetAllMetadata(ctx, req.(*GetAllMetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GraderHubService_StreamLogCallback_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GraderHubServiceServer).StreamLogCallback(&graderHubServiceStreamLogCallbackServer{stream})
}

type GraderHubService_StreamLogCallbackServer interface {
	SendAndClose(*StreamLogCallbackResponse) error
	Recv() (*StreamLogResponse, error)
	grpc.ServerStream
}

type graderHubServiceStreamLogCallbackServer struct {
	grpc.ServerStream
}

func (x *graderHubServiceStreamLogCallbackServer) SendAndClose(m *StreamLogCallbackResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *graderHubServiceStreamLogCallbackServer) Recv() (*StreamLogResponse, error) {
	m := new(StreamLogResponse)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// GraderHubService_ServiceDesc is the grpc.ServiceDesc for GraderHubService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GraderHubService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "GraderHubService",
	HandlerType: (*GraderHubServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterGrader",
			Handler:    _GraderHubService_RegisterGrader_Handler,
		},
		{
			MethodName: "Grade",
			Handler:    _GraderHubService_Grade_Handler,
		},
		{
			MethodName: "GetMetadata",
			Handler:    _GraderHubService_GetMetadata_Handler,
		},
		{
			MethodName: "PutMetadata",
			Handler:    _GraderHubService_PutMetadata_Handler,
		},
		{
			MethodName: "GetAllMetadata",
			Handler:    _GraderHubService_GetAllMetadata_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GraderHeartbeat",
			Handler:       _GraderHubService_GraderHeartbeat_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "GradeCallback",
			Handler:       _GraderHubService_GradeCallback_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "StreamLogCallback",
			Handler:       _GraderHubService_StreamLogCallback_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "grader.proto",
}
