// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc             v3.20.3
// source: files.proto

package files

import (
	context "context"
	protocol "dubbo.apache.org/dubbo-go/v3/protocol"
	dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
	invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
	grpc_go "github.com/dubbogo/grpc-go"
	codes "github.com/dubbogo/grpc-go/codes"
	metadata "github.com/dubbogo/grpc-go/metadata"
	status "github.com/dubbogo/grpc-go/status"
	common "github.com/dubbogo/triple/pkg/common"
	constant "github.com/dubbogo/triple/pkg/common/constant"
	triple "github.com/dubbogo/triple/pkg/triple"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc_go.SupportPackageIsVersion7

// FileClient is the client API for File 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 FileClient interface {
	List(ctx context.Context, in *FileListReq, opts ...grpc_go.CallOption) (*FileListResp, common.ErrorWithAttachment)
	Info(ctx context.Context, in *FileInfoReq, opts ...grpc_go.CallOption) (*FileInfoResp, common.ErrorWithAttachment)
	Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment)
	Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment)
	Search(ctx context.Context, in *SearchReq, opts ...grpc_go.CallOption) (*SearchResp, common.ErrorWithAttachment)
	Upload(ctx context.Context, in *UploadReq, opts ...grpc_go.CallOption) (*UploadResp, common.ErrorWithAttachment)
	TusCreate(ctx context.Context, in *TusCreateReq, opts ...grpc_go.CallOption) (*TusCreateResp, common.ErrorWithAttachment)
	TusUpload(ctx context.Context, in *TusUploadReq, opts ...grpc_go.CallOption) (*TusUploadResp, common.ErrorWithAttachment)
	ResumableTransfer(ctx context.Context, in *ResumableTransferReq, opts ...grpc_go.CallOption) (*ResumableTransferResp, common.ErrorWithAttachment)
}

type fileClient struct {
	cc *triple.TripleConn
}

type FileClientImpl struct {
	List              func(ctx context.Context, in *FileListReq) (*FileListResp, error)
	Info              func(ctx context.Context, in *FileInfoReq) (*FileInfoResp, error)
	Create            func(ctx context.Context, in *CreateReq) (*CreateResp, error)
	Delete            func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
	Search            func(ctx context.Context, in *SearchReq) (*SearchResp, error)
	Upload            func(ctx context.Context, in *UploadReq) (*UploadResp, error)
	TusCreate         func(ctx context.Context, in *TusCreateReq) (*TusCreateResp, error)
	TusUpload         func(ctx context.Context, in *TusUploadReq) (*TusUploadResp, error)
	ResumableTransfer func(ctx context.Context, in *ResumableTransferReq) (*ResumableTransferResp, error)
}

func (c *FileClientImpl) GetDubboStub(cc *triple.TripleConn) FileClient {
	return NewFileClient(cc)
}

func (c *FileClientImpl) XXX_InterfaceName() string {
	return "files.File"
}

func NewFileClient(cc *triple.TripleConn) FileClient {
	return &fileClient{cc}
}

func (c *fileClient) List(ctx context.Context, in *FileListReq, opts ...grpc_go.CallOption) (*FileListResp, common.ErrorWithAttachment) {
	out := new(FileListResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out)
}

func (c *fileClient) Info(ctx context.Context, in *FileInfoReq, opts ...grpc_go.CallOption) (*FileInfoResp, common.ErrorWithAttachment) {
	out := new(FileInfoResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Info", in, out)
}

func (c *fileClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
	out := new(CreateResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out)
}

func (c *fileClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) {
	out := new(DeleteResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out)
}

func (c *fileClient) Search(ctx context.Context, in *SearchReq, opts ...grpc_go.CallOption) (*SearchResp, common.ErrorWithAttachment) {
	out := new(SearchResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Search", in, out)
}

func (c *fileClient) Upload(ctx context.Context, in *UploadReq, opts ...grpc_go.CallOption) (*UploadResp, common.ErrorWithAttachment) {
	out := new(UploadResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Upload", in, out)
}

func (c *fileClient) TusCreate(ctx context.Context, in *TusCreateReq, opts ...grpc_go.CallOption) (*TusCreateResp, common.ErrorWithAttachment) {
	out := new(TusCreateResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/TusCreate", in, out)
}

func (c *fileClient) TusUpload(ctx context.Context, in *TusUploadReq, opts ...grpc_go.CallOption) (*TusUploadResp, common.ErrorWithAttachment) {
	out := new(TusUploadResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/TusUpload", in, out)
}

func (c *fileClient) ResumableTransfer(ctx context.Context, in *ResumableTransferReq, opts ...grpc_go.CallOption) (*ResumableTransferResp, common.ErrorWithAttachment) {
	out := new(ResumableTransferResp)
	interfaceKey := ctx.Value(constant.InterfaceKey).(string)
	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ResumableTransfer", in, out)
}

// FileServer is the server API for File service.
// All implementations must embed UnimplementedFileServer
// for forward compatibility
type FileServer interface {
	List(context.Context, *FileListReq) (*FileListResp, error)
	Info(context.Context, *FileInfoReq) (*FileInfoResp, error)
	Create(context.Context, *CreateReq) (*CreateResp, error)
	Delete(context.Context, *DeleteReq) (*DeleteResp, error)
	Search(context.Context, *SearchReq) (*SearchResp, error)
	Upload(context.Context, *UploadReq) (*UploadResp, error)
	TusCreate(context.Context, *TusCreateReq) (*TusCreateResp, error)
	TusUpload(context.Context, *TusUploadReq) (*TusUploadResp, error)
	ResumableTransfer(context.Context, *ResumableTransferReq) (*ResumableTransferResp, error)
	mustEmbedUnimplementedFileServer()
}

// UnimplementedFileServer must be embedded to have forward compatible implementations.
type UnimplementedFileServer struct {
	proxyImpl protocol.Invoker
}

func (UnimplementedFileServer) List(context.Context, *FileListReq) (*FileListResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedFileServer) Info(context.Context, *FileInfoReq) (*FileInfoResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
}
func (UnimplementedFileServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedFileServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedFileServer) Search(context.Context, *SearchReq) (*SearchResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedFileServer) Upload(context.Context, *UploadReq) (*UploadResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
}
func (UnimplementedFileServer) TusCreate(context.Context, *TusCreateReq) (*TusCreateResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TusCreate not implemented")
}
func (UnimplementedFileServer) TusUpload(context.Context, *TusUploadReq) (*TusUploadResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TusUpload not implemented")
}
func (UnimplementedFileServer) ResumableTransfer(context.Context, *ResumableTransferReq) (*ResumableTransferResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ResumableTransfer not implemented")
}
func (s *UnimplementedFileServer) XXX_SetProxyImpl(impl protocol.Invoker) {
	s.proxyImpl = impl
}

func (s *UnimplementedFileServer) XXX_GetProxyImpl() protocol.Invoker {
	return s.proxyImpl
}

func (s *UnimplementedFileServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
	return &File_ServiceDesc
}
func (s *UnimplementedFileServer) XXX_InterfaceName() string {
	return "files.File"
}

func (UnimplementedFileServer) mustEmbedUnimplementedFileServer() {}

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

func RegisterFileServer(s grpc_go.ServiceRegistrar, srv FileServer) {
	s.RegisterService(&File_ServiceDesc, srv)
}

func _File_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(FileListReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("List", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

func _File_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(FileInfoReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("Info", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

func _File_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("Create", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

func _File_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("Delete", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

func _File_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(SearchReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("Search", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

func _File_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(UploadReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("Upload", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

func _File_TusCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(TusCreateReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("TusCreate", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

func _File_TusUpload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(TusUploadReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("TusUpload", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

func _File_ResumableTransfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResumableTransferReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	base := srv.(dubbo3.Dubbo3GrpcService)
	args := []interface{}{}
	args = append(args, in)
	md, _ := metadata.FromIncomingContext(ctx)
	invAttachment := make(map[string]interface{}, len(md))
	for k, v := range md {
		invAttachment[k] = v
	}
	invo := invocation.NewRPCInvocation("ResumableTransfer", args, invAttachment)
	if interceptor == nil {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	info := &grpc_go.UnaryServerInfo{
		Server:     srv,
		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
		return result, result.Error()
	}
	return interceptor(ctx, in, info, handler)
}

// File_ServiceDesc is the grpc_go.ServiceDesc for File service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var File_ServiceDesc = grpc_go.ServiceDesc{
	ServiceName: "files.File",
	HandlerType: (*FileServer)(nil),
	Methods: []grpc_go.MethodDesc{
		{
			MethodName: "List",
			Handler:    _File_List_Handler,
		},
		{
			MethodName: "Info",
			Handler:    _File_Info_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _File_Create_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _File_Delete_Handler,
		},
		{
			MethodName: "Search",
			Handler:    _File_Search_Handler,
		},
		{
			MethodName: "Upload",
			Handler:    _File_Upload_Handler,
		},
		{
			MethodName: "TusCreate",
			Handler:    _File_TusCreate_Handler,
		},
		{
			MethodName: "TusUpload",
			Handler:    _File_TusUpload_Handler,
		},
		{
			MethodName: "ResumableTransfer",
			Handler:    _File_ResumableTransfer_Handler,
		},
	},
	Streams:  []grpc_go.StreamDesc{},
	Metadata: "files.proto",
}