// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v3.21.12
// source: remote.proto

package remote

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 (
	Remoting_Receive_FullMethodName               = "/remote.Remoting/Receive"
	Remoting_ListProcesses_FullMethodName         = "/remote.Remoting/ListProcesses"
	Remoting_GetProcessDiagnostics_FullMethodName = "/remote.Remoting/GetProcessDiagnostics"
)

// RemotingClient is the client API for Remoting 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 RemotingClient interface {
	Receive(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[RemoteMessage, RemoteMessage], error)
	ListProcesses(ctx context.Context, in *ListProcessesRequest, opts ...grpc.CallOption) (*ListProcessesResponse, error)
	GetProcessDiagnostics(ctx context.Context, in *GetProcessDiagnosticsRequest, opts ...grpc.CallOption) (*GetProcessDiagnosticsResponse, error)
}

type remotingClient struct {
	cc grpc.ClientConnInterface
}

func NewRemotingClient(cc grpc.ClientConnInterface) RemotingClient {
	return &remotingClient{cc}
}

func (c *remotingClient) Receive(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[RemoteMessage, RemoteMessage], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Remoting_ServiceDesc.Streams[0], Remoting_Receive_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[RemoteMessage, RemoteMessage]{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 Remoting_ReceiveClient = grpc.BidiStreamingClient[RemoteMessage, RemoteMessage]

func (c *remotingClient) ListProcesses(ctx context.Context, in *ListProcessesRequest, opts ...grpc.CallOption) (*ListProcessesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListProcessesResponse)
	err := c.cc.Invoke(ctx, Remoting_ListProcesses_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *remotingClient) GetProcessDiagnostics(ctx context.Context, in *GetProcessDiagnosticsRequest, opts ...grpc.CallOption) (*GetProcessDiagnosticsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetProcessDiagnosticsResponse)
	err := c.cc.Invoke(ctx, Remoting_GetProcessDiagnostics_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RemotingServer is the server API for Remoting service.
// All implementations must embed UnimplementedRemotingServer
// for forward compatibility.
type RemotingServer interface {
	Receive(grpc.BidiStreamingServer[RemoteMessage, RemoteMessage]) error
	ListProcesses(context.Context, *ListProcessesRequest) (*ListProcessesResponse, error)
	GetProcessDiagnostics(context.Context, *GetProcessDiagnosticsRequest) (*GetProcessDiagnosticsResponse, error)
	mustEmbedUnimplementedRemotingServer()
}

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

func (UnimplementedRemotingServer) Receive(grpc.BidiStreamingServer[RemoteMessage, RemoteMessage]) error {
	return status.Errorf(codes.Unimplemented, "method Receive not implemented")
}
func (UnimplementedRemotingServer) ListProcesses(context.Context, *ListProcessesRequest) (*ListProcessesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListProcesses not implemented")
}
func (UnimplementedRemotingServer) GetProcessDiagnostics(context.Context, *GetProcessDiagnosticsRequest) (*GetProcessDiagnosticsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetProcessDiagnostics not implemented")
}
func (UnimplementedRemotingServer) mustEmbedUnimplementedRemotingServer() {}
func (UnimplementedRemotingServer) testEmbeddedByValue()                  {}

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

func RegisterRemotingServer(s grpc.ServiceRegistrar, srv RemotingServer) {
	// If the following call pancis, it indicates UnimplementedRemotingServer 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(&Remoting_ServiceDesc, srv)
}

func _Remoting_Receive_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(RemotingServer).Receive(&grpc.GenericServerStream[RemoteMessage, RemoteMessage]{ServerStream: stream})
}

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

func _Remoting_ListProcesses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListProcessesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RemotingServer).ListProcesses(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Remoting_ListProcesses_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RemotingServer).ListProcesses(ctx, req.(*ListProcessesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Remoting_GetProcessDiagnostics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetProcessDiagnosticsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RemotingServer).GetProcessDiagnostics(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Remoting_GetProcessDiagnostics_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RemotingServer).GetProcessDiagnostics(ctx, req.(*GetProcessDiagnosticsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Remoting_ServiceDesc is the grpc.ServiceDesc for Remoting service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Remoting_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "remote.Remoting",
	HandlerType: (*RemotingServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListProcesses",
			Handler:    _Remoting_ListProcesses_Handler,
		},
		{
			MethodName: "GetProcessDiagnostics",
			Handler:    _Remoting_GetProcessDiagnostics_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Receive",
			Handler:       _Remoting_Receive_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "remote.proto",
}
