// Code generated by mockery v2.53.3. DO NOT EDIT.

package mock

import (
	context "context"

	blob "github.com/tidbcloud/dataflow-service/pkg/blob"

	mock "github.com/stretchr/testify/mock"

	storage "github.com/pingcap/tidb/br/pkg/storage"
)

// Storage is an autogenerated mock type for the Storage type
type Storage struct {
	mock.Mock
}

// Close provides a mock function with no fields
func (_m *Storage) Close() {
	_m.Called()
}

// Create provides a mock function with given fields: ctx, path, option
func (_m *Storage) Create(ctx context.Context, path string, option *storage.WriterOption) (storage.ExternalFileWriter, error) {
	ret := _m.Called(ctx, path, option)

	if len(ret) == 0 {
		panic("no return value specified for Create")
	}

	var r0 storage.ExternalFileWriter
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, *storage.WriterOption) (storage.ExternalFileWriter, error)); ok {
		return rf(ctx, path, option)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, *storage.WriterOption) storage.ExternalFileWriter); ok {
		r0 = rf(ctx, path, option)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(storage.ExternalFileWriter)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, string, *storage.WriterOption) error); ok {
		r1 = rf(ctx, path, option)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// DeleteFile provides a mock function with given fields: ctx, name
func (_m *Storage) DeleteFile(ctx context.Context, name string) error {
	ret := _m.Called(ctx, name)

	if len(ret) == 0 {
		panic("no return value specified for DeleteFile")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
		r0 = rf(ctx, name)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// DeleteFiles provides a mock function with given fields: ctx, names
func (_m *Storage) DeleteFiles(ctx context.Context, names []string) error {
	ret := _m.Called(ctx, names)

	if len(ret) == 0 {
		panic("no return value specified for DeleteFiles")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, []string) error); ok {
		r0 = rf(ctx, names)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// DeleteSubDir provides a mock function with given fields: ctx, subDir, opt
func (_m *Storage) DeleteSubDir(ctx context.Context, subDir string, opt *blob.DeleteOption) error {
	ret := _m.Called(ctx, subDir, opt)

	if len(ret) == 0 {
		panic("no return value specified for DeleteSubDir")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, *blob.DeleteOption) error); ok {
		r0 = rf(ctx, subDir, opt)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// FileExists provides a mock function with given fields: ctx, name
func (_m *Storage) FileExists(ctx context.Context, name string) (bool, error) {
	ret := _m.Called(ctx, name)

	if len(ret) == 0 {
		panic("no return value specified for FileExists")
	}

	var r0 bool
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok {
		return rf(ctx, name)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok {
		r0 = rf(ctx, name)
	} else {
		r0 = ret.Get(0).(bool)
	}

	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = rf(ctx, name)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Open provides a mock function with given fields: ctx, path, option
func (_m *Storage) Open(ctx context.Context, path string, option *storage.ReaderOption) (storage.ExternalFileReader, error) {
	ret := _m.Called(ctx, path, option)

	if len(ret) == 0 {
		panic("no return value specified for Open")
	}

	var r0 storage.ExternalFileReader
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, *storage.ReaderOption) (storage.ExternalFileReader, error)); ok {
		return rf(ctx, path, option)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, *storage.ReaderOption) storage.ExternalFileReader); ok {
		r0 = rf(ctx, path, option)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(storage.ExternalFileReader)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, string, *storage.ReaderOption) error); ok {
		r1 = rf(ctx, path, option)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ReadFile provides a mock function with given fields: ctx, name
func (_m *Storage) ReadFile(ctx context.Context, name string) ([]byte, error) {
	ret := _m.Called(ctx, name)

	if len(ret) == 0 {
		panic("no return value specified for ReadFile")
	}

	var r0 []byte
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
		return rf(ctx, name)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
		r0 = rf(ctx, name)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]byte)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = rf(ctx, name)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Rename provides a mock function with given fields: ctx, oldFileName, newFileName
func (_m *Storage) Rename(ctx context.Context, oldFileName string, newFileName string) error {
	ret := _m.Called(ctx, oldFileName, newFileName)

	if len(ret) == 0 {
		panic("no return value specified for Rename")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
		r0 = rf(ctx, oldFileName, newFileName)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// URI provides a mock function with no fields
func (_m *Storage) URI() string {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for URI")
	}

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// WalkDir provides a mock function with given fields: ctx, opt, fn
func (_m *Storage) WalkDir(ctx context.Context, opt *storage.WalkOption, fn func(string, int64) error) error {
	ret := _m.Called(ctx, opt, fn)

	if len(ret) == 0 {
		panic("no return value specified for WalkDir")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *storage.WalkOption, func(string, int64) error) error); ok {
		r0 = rf(ctx, opt, fn)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// WriteFile provides a mock function with given fields: ctx, name, data
func (_m *Storage) WriteFile(ctx context.Context, name string, data []byte) error {
	ret := _m.Called(ctx, name, data)

	if len(ret) == 0 {
		panic("no return value specified for WriteFile")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok {
		r0 = rf(ctx, name, data)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewStorage(t interface {
	mock.TestingT
	Cleanup(func())
}) *Storage {
	mock := &Storage{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
