// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v5.27.1
// source: file.proto

package api

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// FileServiceClient is the client API for FileService 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 FileServiceClient interface {
	// pre sign a file url for user get it
	PreSignGet(ctx context.Context, in *PreSignGetRequest, opts ...grpc.CallOption) (*PreSignGetResponse, error)
	// pre sign a file url for user put it
	PreSignPut(ctx context.Context, in *PreSignPutRequest, opts ...grpc.CallOption) (*PreSignPutResponse, error)
	// report a file has been uploaded
	ReportUploaded(ctx context.Context, in *ReportUploadedRequest, opts ...grpc.CallOption) (*ReportUploadedResponse, error)
	// pre sign a file url for user put it with slicing
	PreSignSlicingPut(ctx context.Context, in *PreSignSlicingPutRequest, opts ...grpc.CallOption) (*PreSignSlicingPutResponse, error)
	// get upload progress rate for slicing put
	GetProgressRate4SlicingPut(ctx context.Context, in *GetProgressRate4SlicingPutRequest, opts ...grpc.CallOption) (*GetProgressRate4SlicingPutResponse, error)
	// merge a slicing uploading file
	MergeFileParts(ctx context.Context, in *MergeFilePartsRequest, opts ...grpc.CallOption) (*MergeFilePartsResponse, error)
	// remove a file
	RemoveFile(ctx context.Context, in *RemoveFileRequest, opts ...grpc.CallOption) (*RemoveFileResponse, error)
	GetFileInfoById(ctx context.Context, in *GetFileInfoByIdRequest, opts ...grpc.CallOption) (*GetFileInfoByIdResponse, error)
}

type fileServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewFileServiceClient(cc grpc.ClientConnInterface) FileServiceClient {
	return &fileServiceClient{cc}
}

func (c *fileServiceClient) PreSignGet(ctx context.Context, in *PreSignGetRequest, opts ...grpc.CallOption) (*PreSignGetResponse, error) {
	out := new(PreSignGetResponse)
	err := c.cc.Invoke(ctx, "/api.FileService/PreSignGet", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileServiceClient) PreSignPut(ctx context.Context, in *PreSignPutRequest, opts ...grpc.CallOption) (*PreSignPutResponse, error) {
	out := new(PreSignPutResponse)
	err := c.cc.Invoke(ctx, "/api.FileService/PreSignPut", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileServiceClient) ReportUploaded(ctx context.Context, in *ReportUploadedRequest, opts ...grpc.CallOption) (*ReportUploadedResponse, error) {
	out := new(ReportUploadedResponse)
	err := c.cc.Invoke(ctx, "/api.FileService/ReportUploaded", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileServiceClient) PreSignSlicingPut(ctx context.Context, in *PreSignSlicingPutRequest, opts ...grpc.CallOption) (*PreSignSlicingPutResponse, error) {
	out := new(PreSignSlicingPutResponse)
	err := c.cc.Invoke(ctx, "/api.FileService/PreSignSlicingPut", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileServiceClient) GetProgressRate4SlicingPut(ctx context.Context, in *GetProgressRate4SlicingPutRequest, opts ...grpc.CallOption) (*GetProgressRate4SlicingPutResponse, error) {
	out := new(GetProgressRate4SlicingPutResponse)
	err := c.cc.Invoke(ctx, "/api.FileService/GetProgressRate4SlicingPut", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileServiceClient) MergeFileParts(ctx context.Context, in *MergeFilePartsRequest, opts ...grpc.CallOption) (*MergeFilePartsResponse, error) {
	out := new(MergeFilePartsResponse)
	err := c.cc.Invoke(ctx, "/api.FileService/MergeFileParts", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileServiceClient) RemoveFile(ctx context.Context, in *RemoveFileRequest, opts ...grpc.CallOption) (*RemoveFileResponse, error) {
	out := new(RemoveFileResponse)
	err := c.cc.Invoke(ctx, "/api.FileService/RemoveFile", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *fileServiceClient) GetFileInfoById(ctx context.Context, in *GetFileInfoByIdRequest, opts ...grpc.CallOption) (*GetFileInfoByIdResponse, error) {
	out := new(GetFileInfoByIdResponse)
	err := c.cc.Invoke(ctx, "/api.FileService/GetFileInfoById", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// FileServiceServer is the server API for FileService service.
// All implementations should embed UnimplementedFileServiceServer
// for forward compatibility
type FileServiceServer interface {
	// pre sign a file url for user get it
	PreSignGet(context.Context, *PreSignGetRequest) (*PreSignGetResponse, error)
	// pre sign a file url for user put it
	PreSignPut(context.Context, *PreSignPutRequest) (*PreSignPutResponse, error)
	// report a file has been uploaded
	ReportUploaded(context.Context, *ReportUploadedRequest) (*ReportUploadedResponse, error)
	// pre sign a file url for user put it with slicing
	PreSignSlicingPut(context.Context, *PreSignSlicingPutRequest) (*PreSignSlicingPutResponse, error)
	// get upload progress rate for slicing put
	GetProgressRate4SlicingPut(context.Context, *GetProgressRate4SlicingPutRequest) (*GetProgressRate4SlicingPutResponse, error)
	// merge a slicing uploading file
	MergeFileParts(context.Context, *MergeFilePartsRequest) (*MergeFilePartsResponse, error)
	// remove a file
	RemoveFile(context.Context, *RemoveFileRequest) (*RemoveFileResponse, error)
	GetFileInfoById(context.Context, *GetFileInfoByIdRequest) (*GetFileInfoByIdResponse, error)
}

// UnimplementedFileServiceServer should be embedded to have forward compatible implementations.
type UnimplementedFileServiceServer struct {
}

func (UnimplementedFileServiceServer) PreSignGet(context.Context, *PreSignGetRequest) (*PreSignGetResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PreSignGet not implemented")
}
func (UnimplementedFileServiceServer) PreSignPut(context.Context, *PreSignPutRequest) (*PreSignPutResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PreSignPut not implemented")
}
func (UnimplementedFileServiceServer) ReportUploaded(context.Context, *ReportUploadedRequest) (*ReportUploadedResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ReportUploaded not implemented")
}
func (UnimplementedFileServiceServer) PreSignSlicingPut(context.Context, *PreSignSlicingPutRequest) (*PreSignSlicingPutResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PreSignSlicingPut not implemented")
}
func (UnimplementedFileServiceServer) GetProgressRate4SlicingPut(context.Context, *GetProgressRate4SlicingPutRequest) (*GetProgressRate4SlicingPutResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetProgressRate4SlicingPut not implemented")
}
func (UnimplementedFileServiceServer) MergeFileParts(context.Context, *MergeFilePartsRequest) (*MergeFilePartsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method MergeFileParts not implemented")
}
func (UnimplementedFileServiceServer) RemoveFile(context.Context, *RemoveFileRequest) (*RemoveFileResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RemoveFile not implemented")
}
func (UnimplementedFileServiceServer) GetFileInfoById(context.Context, *GetFileInfoByIdRequest) (*GetFileInfoByIdResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetFileInfoById not implemented")
}

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

func RegisterFileServiceServer(s grpc.ServiceRegistrar, srv FileServiceServer) {
	s.RegisterService(&FileService_ServiceDesc, srv)
}

func _FileService_PreSignGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PreSignGetRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileServiceServer).PreSignGet(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.FileService/PreSignGet",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileServiceServer).PreSignGet(ctx, req.(*PreSignGetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileService_PreSignPut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PreSignPutRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileServiceServer).PreSignPut(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.FileService/PreSignPut",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileServiceServer).PreSignPut(ctx, req.(*PreSignPutRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileService_ReportUploaded_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ReportUploadedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileServiceServer).ReportUploaded(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.FileService/ReportUploaded",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileServiceServer).ReportUploaded(ctx, req.(*ReportUploadedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileService_PreSignSlicingPut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PreSignSlicingPutRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileServiceServer).PreSignSlicingPut(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.FileService/PreSignSlicingPut",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileServiceServer).PreSignSlicingPut(ctx, req.(*PreSignSlicingPutRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileService_GetProgressRate4SlicingPut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetProgressRate4SlicingPutRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileServiceServer).GetProgressRate4SlicingPut(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.FileService/GetProgressRate4SlicingPut",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileServiceServer).GetProgressRate4SlicingPut(ctx, req.(*GetProgressRate4SlicingPutRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileService_MergeFileParts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(MergeFilePartsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileServiceServer).MergeFileParts(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.FileService/MergeFileParts",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileServiceServer).MergeFileParts(ctx, req.(*MergeFilePartsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileService_RemoveFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RemoveFileRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileServiceServer).RemoveFile(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.FileService/RemoveFile",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileServiceServer).RemoveFile(ctx, req.(*RemoveFileRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FileService_GetFileInfoById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetFileInfoByIdRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FileServiceServer).GetFileInfoById(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.FileService/GetFileInfoById",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FileServiceServer).GetFileInfoById(ctx, req.(*GetFileInfoByIdRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// FileService_ServiceDesc is the grpc.ServiceDesc for FileService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FileService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.FileService",
	HandlerType: (*FileServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PreSignGet",
			Handler:    _FileService_PreSignGet_Handler,
		},
		{
			MethodName: "PreSignPut",
			Handler:    _FileService_PreSignPut_Handler,
		},
		{
			MethodName: "ReportUploaded",
			Handler:    _FileService_ReportUploaded_Handler,
		},
		{
			MethodName: "PreSignSlicingPut",
			Handler:    _FileService_PreSignSlicingPut_Handler,
		},
		{
			MethodName: "GetProgressRate4SlicingPut",
			Handler:    _FileService_GetProgressRate4SlicingPut_Handler,
		},
		{
			MethodName: "MergeFileParts",
			Handler:    _FileService_MergeFileParts_Handler,
		},
		{
			MethodName: "RemoveFile",
			Handler:    _FileService_RemoveFile_Handler,
		},
		{
			MethodName: "GetFileInfoById",
			Handler:    _FileService_GetFileInfoById_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "file.proto",
}
