// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v4.25.4
// source: archive/archive.proto

package archive

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 (
	ArchiveService_Check_FullMethodName = "/vorpal.archive.ArchiveService/Check"
	ArchiveService_Pull_FullMethodName  = "/vorpal.archive.ArchiveService/Pull"
	ArchiveService_Push_FullMethodName  = "/vorpal.archive.ArchiveService/Push"
)

// ArchiveServiceClient is the client API for ArchiveService 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 ArchiveServiceClient interface {
	Check(ctx context.Context, in *ArchivePullRequest, opts ...grpc.CallOption) (*ArchiveResponse, error)
	Pull(ctx context.Context, in *ArchivePullRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ArchivePullResponse], error)
	Push(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ArchivePushRequest, ArchiveResponse], error)
}

type archiveServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewArchiveServiceClient(cc grpc.ClientConnInterface) ArchiveServiceClient {
	return &archiveServiceClient{cc}
}

func (c *archiveServiceClient) Check(ctx context.Context, in *ArchivePullRequest, opts ...grpc.CallOption) (*ArchiveResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ArchiveResponse)
	err := c.cc.Invoke(ctx, ArchiveService_Check_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *archiveServiceClient) Pull(ctx context.Context, in *ArchivePullRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ArchivePullResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &ArchiveService_ServiceDesc.Streams[0], ArchiveService_Pull_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[ArchivePullRequest, ArchivePullResponse]{ClientStream: 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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ArchiveService_PullClient = grpc.ServerStreamingClient[ArchivePullResponse]

func (c *archiveServiceClient) Push(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ArchivePushRequest, ArchiveResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &ArchiveService_ServiceDesc.Streams[1], ArchiveService_Push_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[ArchivePushRequest, ArchiveResponse]{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 ArchiveService_PushClient = grpc.ClientStreamingClient[ArchivePushRequest, ArchiveResponse]

// ArchiveServiceServer is the server API for ArchiveService service.
// All implementations must embed UnimplementedArchiveServiceServer
// for forward compatibility.
type ArchiveServiceServer interface {
	Check(context.Context, *ArchivePullRequest) (*ArchiveResponse, error)
	Pull(*ArchivePullRequest, grpc.ServerStreamingServer[ArchivePullResponse]) error
	Push(grpc.ClientStreamingServer[ArchivePushRequest, ArchiveResponse]) error
	mustEmbedUnimplementedArchiveServiceServer()
}

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

func (UnimplementedArchiveServiceServer) Check(context.Context, *ArchivePullRequest) (*ArchiveResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
}
func (UnimplementedArchiveServiceServer) Pull(*ArchivePullRequest, grpc.ServerStreamingServer[ArchivePullResponse]) error {
	return status.Errorf(codes.Unimplemented, "method Pull not implemented")
}
func (UnimplementedArchiveServiceServer) Push(grpc.ClientStreamingServer[ArchivePushRequest, ArchiveResponse]) error {
	return status.Errorf(codes.Unimplemented, "method Push not implemented")
}
func (UnimplementedArchiveServiceServer) mustEmbedUnimplementedArchiveServiceServer() {}
func (UnimplementedArchiveServiceServer) testEmbeddedByValue()                        {}

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

func RegisterArchiveServiceServer(s grpc.ServiceRegistrar, srv ArchiveServiceServer) {
	// If the following call panics, it indicates UnimplementedArchiveServiceServer 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(&ArchiveService_ServiceDesc, srv)
}

func _ArchiveService_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ArchivePullRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ArchiveServiceServer).Check(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ArchiveService_Check_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ArchiveServiceServer).Check(ctx, req.(*ArchivePullRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ArchiveService_Pull_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(ArchivePullRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ArchiveServiceServer).Pull(m, &grpc.GenericServerStream[ArchivePullRequest, ArchivePullResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ArchiveService_PullServer = grpc.ServerStreamingServer[ArchivePullResponse]

func _ArchiveService_Push_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(ArchiveServiceServer).Push(&grpc.GenericServerStream[ArchivePushRequest, ArchiveResponse]{ServerStream: stream})
}

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

// ArchiveService_ServiceDesc is the grpc.ServiceDesc for ArchiveService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ArchiveService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "vorpal.archive.ArchiveService",
	HandlerType: (*ArchiveServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Check",
			Handler:    _ArchiveService_Check_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Pull",
			Handler:       _ArchiveService_Pull_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Push",
			Handler:       _ArchiveService_Push_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "archive/archive.proto",
}
