// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.32.1
// source: service.proto

package microtraffic

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 (
	Service_NewSession_FullMethodName               = "/micro_traffic_sim.Service/NewSession"
	Service_InfoSession_FullMethodName              = "/micro_traffic_sim.Service/InfoSession"
	Service_PushSessionGrid_FullMethodName          = "/micro_traffic_sim.Service/PushSessionGrid"
	Service_PushSessionTrip_FullMethodName          = "/micro_traffic_sim.Service/PushSessionTrip"
	Service_SimulationStepSession_FullMethodName    = "/micro_traffic_sim.Service/SimulationStepSession"
	Service_PushSessionTLS_FullMethodName           = "/micro_traffic_sim.Service/PushSessionTLS"
	Service_PushSessionConflictZones_FullMethodName = "/micro_traffic_sim.Service/PushSessionConflictZones"
)

// ServiceClient is the client API for Service 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 ServiceClient interface {
	// Create a new computation session
	NewSession(ctx context.Context, in *SessionReq, opts ...grpc.CallOption) (*NewSessionResponse, error)
	// Get session info
	InfoSession(ctx context.Context, in *UUIDv4, opts ...grpc.CallOption) (*InfoSessionResponse, error)
	// Set grid cell data for the given session (bidirectional streaming)
	PushSessionGrid(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionGrid, SessionGridResponse], error)
	// Set trip data for the given session (bidirectional streaming)
	PushSessionTrip(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionTrip, SessionTripResponse], error)
	// Run one simulation step for the given session (bidirectional streaming)
	SimulationStepSession(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionStep, SessionStepResponse], error)
	// Set traffic light data for the given session (bidirectional streaming)
	PushSessionTLS(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionTLS, SessionTLSResponse], error)
	// Set conflict zones for the given session (bidirectional streaming)
	PushSessionConflictZones(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionConflictZones, SessionConflictZonesResponse], error)
}

type serviceClient struct {
	cc grpc.ClientConnInterface
}

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient {
	return &serviceClient{cc}
}

func (c *serviceClient) NewSession(ctx context.Context, in *SessionReq, opts ...grpc.CallOption) (*NewSessionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(NewSessionResponse)
	err := c.cc.Invoke(ctx, Service_NewSession_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serviceClient) InfoSession(ctx context.Context, in *UUIDv4, opts ...grpc.CallOption) (*InfoSessionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(InfoSessionResponse)
	err := c.cc.Invoke(ctx, Service_InfoSession_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serviceClient) PushSessionGrid(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionGrid, SessionGridResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[0], Service_PushSessionGrid_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[SessionGrid, SessionGridResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_PushSessionGridClient = grpc.BidiStreamingClient[SessionGrid, SessionGridResponse]

func (c *serviceClient) PushSessionTrip(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionTrip, SessionTripResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[1], Service_PushSessionTrip_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[SessionTrip, SessionTripResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_PushSessionTripClient = grpc.BidiStreamingClient[SessionTrip, SessionTripResponse]

func (c *serviceClient) SimulationStepSession(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionStep, SessionStepResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[2], Service_SimulationStepSession_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[SessionStep, SessionStepResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_SimulationStepSessionClient = grpc.BidiStreamingClient[SessionStep, SessionStepResponse]

func (c *serviceClient) PushSessionTLS(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionTLS, SessionTLSResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[3], Service_PushSessionTLS_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[SessionTLS, SessionTLSResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_PushSessionTLSClient = grpc.BidiStreamingClient[SessionTLS, SessionTLSResponse]

func (c *serviceClient) PushSessionConflictZones(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SessionConflictZones, SessionConflictZonesResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[4], Service_PushSessionConflictZones_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[SessionConflictZones, SessionConflictZonesResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_PushSessionConflictZonesClient = grpc.BidiStreamingClient[SessionConflictZones, SessionConflictZonesResponse]

// ServiceServer is the server API for Service service.
// All implementations must embed UnimplementedServiceServer
// for forward compatibility.
type ServiceServer interface {
	// Create a new computation session
	NewSession(context.Context, *SessionReq) (*NewSessionResponse, error)
	// Get session info
	InfoSession(context.Context, *UUIDv4) (*InfoSessionResponse, error)
	// Set grid cell data for the given session (bidirectional streaming)
	PushSessionGrid(grpc.BidiStreamingServer[SessionGrid, SessionGridResponse]) error
	// Set trip data for the given session (bidirectional streaming)
	PushSessionTrip(grpc.BidiStreamingServer[SessionTrip, SessionTripResponse]) error
	// Run one simulation step for the given session (bidirectional streaming)
	SimulationStepSession(grpc.BidiStreamingServer[SessionStep, SessionStepResponse]) error
	// Set traffic light data for the given session (bidirectional streaming)
	PushSessionTLS(grpc.BidiStreamingServer[SessionTLS, SessionTLSResponse]) error
	// Set conflict zones for the given session (bidirectional streaming)
	PushSessionConflictZones(grpc.BidiStreamingServer[SessionConflictZones, SessionConflictZonesResponse]) error
	mustEmbedUnimplementedServiceServer()
}

// UnimplementedServiceServer 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 UnimplementedServiceServer struct{}

func (UnimplementedServiceServer) NewSession(context.Context, *SessionReq) (*NewSessionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method NewSession not implemented")
}
func (UnimplementedServiceServer) InfoSession(context.Context, *UUIDv4) (*InfoSessionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method InfoSession not implemented")
}
func (UnimplementedServiceServer) PushSessionGrid(grpc.BidiStreamingServer[SessionGrid, SessionGridResponse]) error {
	return status.Errorf(codes.Unimplemented, "method PushSessionGrid not implemented")
}
func (UnimplementedServiceServer) PushSessionTrip(grpc.BidiStreamingServer[SessionTrip, SessionTripResponse]) error {
	return status.Errorf(codes.Unimplemented, "method PushSessionTrip not implemented")
}
func (UnimplementedServiceServer) SimulationStepSession(grpc.BidiStreamingServer[SessionStep, SessionStepResponse]) error {
	return status.Errorf(codes.Unimplemented, "method SimulationStepSession not implemented")
}
func (UnimplementedServiceServer) PushSessionTLS(grpc.BidiStreamingServer[SessionTLS, SessionTLSResponse]) error {
	return status.Errorf(codes.Unimplemented, "method PushSessionTLS not implemented")
}
func (UnimplementedServiceServer) PushSessionConflictZones(grpc.BidiStreamingServer[SessionConflictZones, SessionConflictZonesResponse]) error {
	return status.Errorf(codes.Unimplemented, "method PushSessionConflictZones not implemented")
}
func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {}
func (UnimplementedServiceServer) testEmbeddedByValue()                 {}

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

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) {
	// If the following call pancis, it indicates UnimplementedServiceServer 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(&Service_ServiceDesc, srv)
}

func _Service_NewSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SessionReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceServer).NewSession(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Service_NewSession_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceServer).NewSession(ctx, req.(*SessionReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Service_InfoSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UUIDv4)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceServer).InfoSession(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Service_InfoSession_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceServer).InfoSession(ctx, req.(*UUIDv4))
	}
	return interceptor(ctx, in, info, handler)
}

func _Service_PushSessionGrid_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(ServiceServer).PushSessionGrid(&grpc.GenericServerStream[SessionGrid, SessionGridResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_PushSessionGridServer = grpc.BidiStreamingServer[SessionGrid, SessionGridResponse]

func _Service_PushSessionTrip_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(ServiceServer).PushSessionTrip(&grpc.GenericServerStream[SessionTrip, SessionTripResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_PushSessionTripServer = grpc.BidiStreamingServer[SessionTrip, SessionTripResponse]

func _Service_SimulationStepSession_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(ServiceServer).SimulationStepSession(&grpc.GenericServerStream[SessionStep, SessionStepResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_SimulationStepSessionServer = grpc.BidiStreamingServer[SessionStep, SessionStepResponse]

func _Service_PushSessionTLS_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(ServiceServer).PushSessionTLS(&grpc.GenericServerStream[SessionTLS, SessionTLSResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_PushSessionTLSServer = grpc.BidiStreamingServer[SessionTLS, SessionTLSResponse]

func _Service_PushSessionConflictZones_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(ServiceServer).PushSessionConflictZones(&grpc.GenericServerStream[SessionConflictZones, SessionConflictZonesResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Service_PushSessionConflictZonesServer = grpc.BidiStreamingServer[SessionConflictZones, SessionConflictZonesResponse]

// Service_ServiceDesc is the grpc.ServiceDesc for Service service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "micro_traffic_sim.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "NewSession",
			Handler:    _Service_NewSession_Handler,
		},
		{
			MethodName: "InfoSession",
			Handler:    _Service_InfoSession_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "PushSessionGrid",
			Handler:       _Service_PushSessionGrid_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "PushSessionTrip",
			Handler:       _Service_PushSessionTrip_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "SimulationStepSession",
			Handler:       _Service_SimulationStepSession_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "PushSessionTLS",
			Handler:       _Service_PushSessionTLS_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "PushSessionConflictZones",
			Handler:       _Service_PushSessionConflictZones_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "service.proto",
}
