// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.15.8
// source: event.proto

package core

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
)

// 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

// EventServiceClient is the client API for EventService 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 EventServiceClient interface {
	CreateEvent(ctx context.Context, in *CreateEventRequest, opts ...grpc.CallOption) (*ProcheEvent, error)
	GetEvent(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (EventService_GetEventClient, error)
	GetEventByUser(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (EventService_GetEventByUserClient, error)
	GetEventsByLocation(ctx context.Context, in *CommonAddress, opts ...grpc.CallOption) (EventService_GetEventsByLocationClient, error)
	ListEvents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (EventService_ListEventsClient, error)
	UpdateEvent(ctx context.Context, in *ProcheEvent, opts ...grpc.CallOption) (*ProcheEvent, error)
	DeleteEvent(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// candidates
	GetCandidatesForEvent(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (EventService_GetCandidatesForEventClient, error)
}

type eventServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient {
	return &eventServiceClient{cc}
}

func (c *eventServiceClient) CreateEvent(ctx context.Context, in *CreateEventRequest, opts ...grpc.CallOption) (*ProcheEvent, error) {
	out := new(ProcheEvent)
	err := c.cc.Invoke(ctx, "/event.EventService/create_event", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *eventServiceClient) GetEvent(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (EventService_GetEventClient, error) {
	stream, err := c.cc.NewStream(ctx, &EventService_ServiceDesc.Streams[0], "/event.EventService/get_event", opts...)
	if err != nil {
		return nil, err
	}
	x := &eventServiceGetEventClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type EventService_GetEventClient interface {
	Recv() (*ProcheEvent, error)
	grpc.ClientStream
}

type eventServiceGetEventClient struct {
	grpc.ClientStream
}

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

func (c *eventServiceClient) GetEventByUser(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (EventService_GetEventByUserClient, error) {
	stream, err := c.cc.NewStream(ctx, &EventService_ServiceDesc.Streams[1], "/event.EventService/get_event_by_user", opts...)
	if err != nil {
		return nil, err
	}
	x := &eventServiceGetEventByUserClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type EventService_GetEventByUserClient interface {
	Recv() (*ProcheEventList, error)
	grpc.ClientStream
}

type eventServiceGetEventByUserClient struct {
	grpc.ClientStream
}

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

func (c *eventServiceClient) GetEventsByLocation(ctx context.Context, in *CommonAddress, opts ...grpc.CallOption) (EventService_GetEventsByLocationClient, error) {
	stream, err := c.cc.NewStream(ctx, &EventService_ServiceDesc.Streams[2], "/event.EventService/get_events_by_location", opts...)
	if err != nil {
		return nil, err
	}
	x := &eventServiceGetEventsByLocationClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type EventService_GetEventsByLocationClient interface {
	Recv() (*ProcheEventList, error)
	grpc.ClientStream
}

type eventServiceGetEventsByLocationClient struct {
	grpc.ClientStream
}

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

func (c *eventServiceClient) ListEvents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (EventService_ListEventsClient, error) {
	stream, err := c.cc.NewStream(ctx, &EventService_ServiceDesc.Streams[3], "/event.EventService/list_events", opts...)
	if err != nil {
		return nil, err
	}
	x := &eventServiceListEventsClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type EventService_ListEventsClient interface {
	Recv() (*ProcheEventList, error)
	grpc.ClientStream
}

type eventServiceListEventsClient struct {
	grpc.ClientStream
}

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

func (c *eventServiceClient) UpdateEvent(ctx context.Context, in *ProcheEvent, opts ...grpc.CallOption) (*ProcheEvent, error) {
	out := new(ProcheEvent)
	err := c.cc.Invoke(ctx, "/event.EventService/update_event", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *eventServiceClient) DeleteEvent(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/event.EventService/delete_event", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *eventServiceClient) GetCandidatesForEvent(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (EventService_GetCandidatesForEventClient, error) {
	stream, err := c.cc.NewStream(ctx, &EventService_ServiceDesc.Streams[4], "/event.EventService/get_candidates_for_event", opts...)
	if err != nil {
		return nil, err
	}
	x := &eventServiceGetCandidatesForEventClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type EventService_GetCandidatesForEventClient interface {
	Recv() (*EventCandidateList, error)
	grpc.ClientStream
}

type eventServiceGetCandidatesForEventClient struct {
	grpc.ClientStream
}

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

// EventServiceServer is the server API for EventService service.
// All implementations must embed UnimplementedEventServiceServer
// for forward compatibility
type EventServiceServer interface {
	CreateEvent(context.Context, *CreateEventRequest) (*ProcheEvent, error)
	GetEvent(*wrapperspb.StringValue, EventService_GetEventServer) error
	GetEventByUser(*wrapperspb.StringValue, EventService_GetEventByUserServer) error
	GetEventsByLocation(*CommonAddress, EventService_GetEventsByLocationServer) error
	ListEvents(*emptypb.Empty, EventService_ListEventsServer) error
	UpdateEvent(context.Context, *ProcheEvent) (*ProcheEvent, error)
	DeleteEvent(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
	// candidates
	GetCandidatesForEvent(*wrapperspb.StringValue, EventService_GetCandidatesForEventServer) error
	mustEmbedUnimplementedEventServiceServer()
}

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

func (UnimplementedEventServiceServer) CreateEvent(context.Context, *CreateEventRequest) (*ProcheEvent, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateEvent not implemented")
}
func (UnimplementedEventServiceServer) GetEvent(*wrapperspb.StringValue, EventService_GetEventServer) error {
	return status.Errorf(codes.Unimplemented, "method GetEvent not implemented")
}
func (UnimplementedEventServiceServer) GetEventByUser(*wrapperspb.StringValue, EventService_GetEventByUserServer) error {
	return status.Errorf(codes.Unimplemented, "method GetEventByUser not implemented")
}
func (UnimplementedEventServiceServer) GetEventsByLocation(*CommonAddress, EventService_GetEventsByLocationServer) error {
	return status.Errorf(codes.Unimplemented, "method GetEventsByLocation not implemented")
}
func (UnimplementedEventServiceServer) ListEvents(*emptypb.Empty, EventService_ListEventsServer) error {
	return status.Errorf(codes.Unimplemented, "method ListEvents not implemented")
}
func (UnimplementedEventServiceServer) UpdateEvent(context.Context, *ProcheEvent) (*ProcheEvent, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateEvent not implemented")
}
func (UnimplementedEventServiceServer) DeleteEvent(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteEvent not implemented")
}
func (UnimplementedEventServiceServer) GetCandidatesForEvent(*wrapperspb.StringValue, EventService_GetCandidatesForEventServer) error {
	return status.Errorf(codes.Unimplemented, "method GetCandidatesForEvent not implemented")
}
func (UnimplementedEventServiceServer) mustEmbedUnimplementedEventServiceServer() {}

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

func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer) {
	s.RegisterService(&EventService_ServiceDesc, srv)
}

func _EventService_CreateEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateEventRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(EventServiceServer).CreateEvent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/event.EventService/create_event",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(EventServiceServer).CreateEvent(ctx, req.(*CreateEventRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _EventService_GetEvent_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(wrapperspb.StringValue)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(EventServiceServer).GetEvent(m, &eventServiceGetEventServer{stream})
}

type EventService_GetEventServer interface {
	Send(*ProcheEvent) error
	grpc.ServerStream
}

type eventServiceGetEventServer struct {
	grpc.ServerStream
}

func (x *eventServiceGetEventServer) Send(m *ProcheEvent) error {
	return x.ServerStream.SendMsg(m)
}

func _EventService_GetEventByUser_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(wrapperspb.StringValue)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(EventServiceServer).GetEventByUser(m, &eventServiceGetEventByUserServer{stream})
}

type EventService_GetEventByUserServer interface {
	Send(*ProcheEventList) error
	grpc.ServerStream
}

type eventServiceGetEventByUserServer struct {
	grpc.ServerStream
}

func (x *eventServiceGetEventByUserServer) Send(m *ProcheEventList) error {
	return x.ServerStream.SendMsg(m)
}

func _EventService_GetEventsByLocation_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(CommonAddress)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(EventServiceServer).GetEventsByLocation(m, &eventServiceGetEventsByLocationServer{stream})
}

type EventService_GetEventsByLocationServer interface {
	Send(*ProcheEventList) error
	grpc.ServerStream
}

type eventServiceGetEventsByLocationServer struct {
	grpc.ServerStream
}

func (x *eventServiceGetEventsByLocationServer) Send(m *ProcheEventList) error {
	return x.ServerStream.SendMsg(m)
}

func _EventService_ListEvents_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(emptypb.Empty)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(EventServiceServer).ListEvents(m, &eventServiceListEventsServer{stream})
}

type EventService_ListEventsServer interface {
	Send(*ProcheEventList) error
	grpc.ServerStream
}

type eventServiceListEventsServer struct {
	grpc.ServerStream
}

func (x *eventServiceListEventsServer) Send(m *ProcheEventList) error {
	return x.ServerStream.SendMsg(m)
}

func _EventService_UpdateEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ProcheEvent)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(EventServiceServer).UpdateEvent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/event.EventService/update_event",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(EventServiceServer).UpdateEvent(ctx, req.(*ProcheEvent))
	}
	return interceptor(ctx, in, info, handler)
}

func _EventService_DeleteEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(wrapperspb.StringValue)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(EventServiceServer).DeleteEvent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/event.EventService/delete_event",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(EventServiceServer).DeleteEvent(ctx, req.(*wrapperspb.StringValue))
	}
	return interceptor(ctx, in, info, handler)
}

func _EventService_GetCandidatesForEvent_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(wrapperspb.StringValue)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(EventServiceServer).GetCandidatesForEvent(m, &eventServiceGetCandidatesForEventServer{stream})
}

type EventService_GetCandidatesForEventServer interface {
	Send(*EventCandidateList) error
	grpc.ServerStream
}

type eventServiceGetCandidatesForEventServer struct {
	grpc.ServerStream
}

func (x *eventServiceGetCandidatesForEventServer) Send(m *EventCandidateList) error {
	return x.ServerStream.SendMsg(m)
}

// EventService_ServiceDesc is the grpc.ServiceDesc for EventService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var EventService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "event.EventService",
	HandlerType: (*EventServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "create_event",
			Handler:    _EventService_CreateEvent_Handler,
		},
		{
			MethodName: "update_event",
			Handler:    _EventService_UpdateEvent_Handler,
		},
		{
			MethodName: "delete_event",
			Handler:    _EventService_DeleteEvent_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "get_event",
			Handler:       _EventService_GetEvent_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "get_event_by_user",
			Handler:       _EventService_GetEventByUser_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "get_events_by_location",
			Handler:       _EventService_GetEventsByLocation_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "list_events",
			Handler:       _EventService_ListEvents_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "get_candidates_for_event",
			Handler:       _EventService_GetCandidatesForEvent_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "event.proto",
}
