// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.0
// - protoc             (unknown)
// source: protocol/file_replication.proto

package protocol

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 (
	FileReplicationService_PauseFileActivity_FullMethodName  = "/clusterapi.FileReplicationService/PauseFileActivity"
	FileReplicationService_ResumeFileActivity_FullMethodName = "/clusterapi.FileReplicationService/ResumeFileActivity"
	FileReplicationService_ListFiles_FullMethodName          = "/clusterapi.FileReplicationService/ListFiles"
	FileReplicationService_GetFileMetadata_FullMethodName    = "/clusterapi.FileReplicationService/GetFileMetadata"
	FileReplicationService_GetFile_FullMethodName            = "/clusterapi.FileReplicationService/GetFile"
)

// FileReplicationServiceClient is the client API for FileReplicationService 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 FileReplicationServiceClient interface {
	PauseFileActivity(ctx context.Context, in *PauseFileActivityRequest, opts ...grpc.CallOption) (*PauseFileActivityResponse, error)
	ResumeFileActivity(ctx context.Context, in *ResumeFileActivityRequest, opts ...grpc.CallOption) (*ResumeFileActivityResponse, error)
	ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
	GetFileMetadata(ctx context.Context, in *GetFileMetadataRequest, opts ...grpc.CallOption) (*FileMetadata, error)
	GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileChunk], error)
}

type fileReplicationServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewFileReplicationServiceClient(cc grpc.ClientConnInterface) FileReplicationServiceClient {
	return &fileReplicationServiceClient{cc}
}

func (c *fileReplicationServiceClient) PauseFileActivity(ctx context.Context, in *PauseFileActivityRequest, opts ...grpc.CallOption) (*PauseFileActivityResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PauseFileActivityResponse)
	err := c.cc.Invoke(ctx, FileReplicationService_PauseFileActivity_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileReplicationServiceClient) ResumeFileActivity(ctx context.Context, in *ResumeFileActivityRequest, opts ...grpc.CallOption) (*ResumeFileActivityResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResumeFileActivityResponse)
	err := c.cc.Invoke(ctx, FileReplicationService_ResumeFileActivity_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileReplicationServiceClient) ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListFilesResponse)
	err := c.cc.Invoke(ctx, FileReplicationService_ListFiles_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileReplicationServiceClient) GetFileMetadata(ctx context.Context, in *GetFileMetadataRequest, opts ...grpc.CallOption) (*FileMetadata, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(FileMetadata)
	err := c.cc.Invoke(ctx, FileReplicationService_GetFileMetadata_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileReplicationServiceClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileChunk], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &FileReplicationService_ServiceDesc.Streams[0], FileReplicationService_GetFile_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[GetFileRequest, FileChunk]{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 FileReplicationService_GetFileClient = grpc.ServerStreamingClient[FileChunk]

// FileReplicationServiceServer is the server API for FileReplicationService service.
// All implementations should embed UnimplementedFileReplicationServiceServer
// for forward compatibility.
type FileReplicationServiceServer interface {
	PauseFileActivity(context.Context, *PauseFileActivityRequest) (*PauseFileActivityResponse, error)
	ResumeFileActivity(context.Context, *ResumeFileActivityRequest) (*ResumeFileActivityResponse, error)
	ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error)
	GetFileMetadata(context.Context, *GetFileMetadataRequest) (*FileMetadata, error)
	GetFile(*GetFileRequest, grpc.ServerStreamingServer[FileChunk]) error
}

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

func (UnimplementedFileReplicationServiceServer) PauseFileActivity(context.Context, *PauseFileActivityRequest) (*PauseFileActivityResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method PauseFileActivity not implemented")
}
func (UnimplementedFileReplicationServiceServer) ResumeFileActivity(context.Context, *ResumeFileActivityRequest) (*ResumeFileActivityResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ResumeFileActivity not implemented")
}
func (UnimplementedFileReplicationServiceServer) ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListFiles not implemented")
}
func (UnimplementedFileReplicationServiceServer) GetFileMetadata(context.Context, *GetFileMetadataRequest) (*FileMetadata, error) {
	return nil, status.Error(codes.Unimplemented, "method GetFileMetadata not implemented")
}
func (UnimplementedFileReplicationServiceServer) GetFile(*GetFileRequest, grpc.ServerStreamingServer[FileChunk]) error {
	return status.Error(codes.Unimplemented, "method GetFile not implemented")
}
func (UnimplementedFileReplicationServiceServer) testEmbeddedByValue() {}

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

func RegisterFileReplicationServiceServer(s grpc.ServiceRegistrar, srv FileReplicationServiceServer) {
	// If the following call panics, it indicates UnimplementedFileReplicationServiceServer 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(&FileReplicationService_ServiceDesc, srv)
}

func _FileReplicationService_PauseFileActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PauseFileActivityRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileReplicationServiceServer).PauseFileActivity(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FileReplicationService_PauseFileActivity_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileReplicationServiceServer).PauseFileActivity(ctx, req.(*PauseFileActivityRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileReplicationService_ResumeFileActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResumeFileActivityRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileReplicationServiceServer).ResumeFileActivity(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FileReplicationService_ResumeFileActivity_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileReplicationServiceServer).ResumeFileActivity(ctx, req.(*ResumeFileActivityRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileReplicationService_ListFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListFilesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileReplicationServiceServer).ListFiles(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FileReplicationService_ListFiles_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileReplicationServiceServer).ListFiles(ctx, req.(*ListFilesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileReplicationService_GetFileMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetFileMetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileReplicationServiceServer).GetFileMetadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FileReplicationService_GetFileMetadata_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileReplicationServiceServer).GetFileMetadata(ctx, req.(*GetFileMetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileReplicationService_GetFile_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetFileRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(FileReplicationServiceServer).GetFile(m, &grpc.GenericServerStream[GetFileRequest, FileChunk]{ServerStream: stream})
}

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

// FileReplicationService_ServiceDesc is the grpc.ServiceDesc for FileReplicationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FileReplicationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "clusterapi.FileReplicationService",
	HandlerType: (*FileReplicationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PauseFileActivity",
			Handler:    _FileReplicationService_PauseFileActivity_Handler,
		},
		{
			MethodName: "ResumeFileActivity",
			Handler:    _FileReplicationService_ResumeFileActivity_Handler,
		},
		{
			MethodName: "ListFiles",
			Handler:    _FileReplicationService_ListFiles_Handler,
		},
		{
			MethodName: "GetFileMetadata",
			Handler:    _FileReplicationService_GetFileMetadata_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetFile",
			Handler:       _FileReplicationService_GetFile_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "protocol/file_replication.proto",
}
