// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             (unknown)
// source: opencloud/services/eventhistory/v0/eventhistory.proto

package v0

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	EventHistoryService_GetEvents_FullMethodName        = "/opencloud.services.eventhistory.v0.EventHistoryService/GetEvents"
	EventHistoryService_GetEventsForUser_FullMethodName = "/opencloud.services.eventhistory.v0.EventHistoryService/GetEventsForUser"
)

// EventHistoryServiceClient is the client API for EventHistoryService 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.
//
// A Service for storing events
type EventHistoryServiceClient interface {
	// returns the specified events
	GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
	// returns all events for the specified userID
	GetEventsForUser(ctx context.Context, in *GetEventsForUserRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
}

type eventHistoryServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewEventHistoryServiceClient(cc grpc.ClientConnInterface) EventHistoryServiceClient {
	return &eventHistoryServiceClient{cc}
}

func (c *eventHistoryServiceClient) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetEventsResponse)
	err := c.cc.Invoke(ctx, EventHistoryService_GetEvents_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *eventHistoryServiceClient) GetEventsForUser(ctx context.Context, in *GetEventsForUserRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetEventsResponse)
	err := c.cc.Invoke(ctx, EventHistoryService_GetEventsForUser_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// EventHistoryServiceServer is the server API for EventHistoryService service.
// All implementations must embed UnimplementedEventHistoryServiceServer
// for forward compatibility.
//
// A Service for storing events
type EventHistoryServiceServer interface {
	// returns the specified events
	GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error)
	// returns all events for the specified userID
	GetEventsForUser(context.Context, *GetEventsForUserRequest) (*GetEventsResponse, error)
	mustEmbedUnimplementedEventHistoryServiceServer()
}

// UnimplementedEventHistoryServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedEventHistoryServiceServer struct{}

func (UnimplementedEventHistoryServiceServer) GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method GetEvents not implemented")
}
func (UnimplementedEventHistoryServiceServer) GetEventsForUser(context.Context, *GetEventsForUserRequest) (*GetEventsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method GetEventsForUser not implemented")
}
func (UnimplementedEventHistoryServiceServer) mustEmbedUnimplementedEventHistoryServiceServer() {}
func (UnimplementedEventHistoryServiceServer) testEmbeddedByValue()                             {}

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

func RegisterEventHistoryServiceServer(s grpc.ServiceRegistrar, srv EventHistoryServiceServer) {
	// If the following call panics, it indicates UnimplementedEventHistoryServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&EventHistoryService_ServiceDesc, srv)
}

func _EventHistoryService_GetEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetEventsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(EventHistoryServiceServer).GetEvents(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: EventHistoryService_GetEvents_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(EventHistoryServiceServer).GetEvents(ctx, req.(*GetEventsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _EventHistoryService_GetEventsForUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetEventsForUserRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(EventHistoryServiceServer).GetEventsForUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: EventHistoryService_GetEventsForUser_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(EventHistoryServiceServer).GetEventsForUser(ctx, req.(*GetEventsForUserRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// EventHistoryService_ServiceDesc is the grpc.ServiceDesc for EventHistoryService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var EventHistoryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "opencloud.services.eventhistory.v0.EventHistoryService",
	HandlerType: (*EventHistoryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetEvents",
			Handler:    _EventHistoryService_GetEvents_Handler,
		},
		{
			MethodName: "GetEventsForUser",
			Handler:    _EventHistoryService_GetEventsForUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "opencloud/services/eventhistory/v0/eventhistory.proto",
}
