github.com/haalcala/mattermost-server-change-repo/v5@v5.33.2/store/storetest/mocks/FileInfoStore.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  // Regenerate this file using `make store-mocks`.
     4  
     5  package mocks
     6  
     7  import (
     8  	model "github.com/mattermost/mattermost-server/v5/model"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // FileInfoStore is an autogenerated mock type for the FileInfoStore type
    13  type FileInfoStore struct {
    14  	mock.Mock
    15  }
    16  
    17  // AttachToPost provides a mock function with given fields: fileId, postId, creatorId
    18  func (_m *FileInfoStore) AttachToPost(fileId string, postId string, creatorId string) error {
    19  	ret := _m.Called(fileId, postId, creatorId)
    20  
    21  	var r0 error
    22  	if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
    23  		r0 = rf(fileId, postId, creatorId)
    24  	} else {
    25  		r0 = ret.Error(0)
    26  	}
    27  
    28  	return r0
    29  }
    30  
    31  // ClearCaches provides a mock function with given fields:
    32  func (_m *FileInfoStore) ClearCaches() {
    33  	_m.Called()
    34  }
    35  
    36  // DeleteForPost provides a mock function with given fields: postId
    37  func (_m *FileInfoStore) DeleteForPost(postId string) (string, error) {
    38  	ret := _m.Called(postId)
    39  
    40  	var r0 string
    41  	if rf, ok := ret.Get(0).(func(string) string); ok {
    42  		r0 = rf(postId)
    43  	} else {
    44  		r0 = ret.Get(0).(string)
    45  	}
    46  
    47  	var r1 error
    48  	if rf, ok := ret.Get(1).(func(string) error); ok {
    49  		r1 = rf(postId)
    50  	} else {
    51  		r1 = ret.Error(1)
    52  	}
    53  
    54  	return r0, r1
    55  }
    56  
    57  // Get provides a mock function with given fields: id
    58  func (_m *FileInfoStore) Get(id string) (*model.FileInfo, error) {
    59  	ret := _m.Called(id)
    60  
    61  	var r0 *model.FileInfo
    62  	if rf, ok := ret.Get(0).(func(string) *model.FileInfo); ok {
    63  		r0 = rf(id)
    64  	} else {
    65  		if ret.Get(0) != nil {
    66  			r0 = ret.Get(0).(*model.FileInfo)
    67  		}
    68  	}
    69  
    70  	var r1 error
    71  	if rf, ok := ret.Get(1).(func(string) error); ok {
    72  		r1 = rf(id)
    73  	} else {
    74  		r1 = ret.Error(1)
    75  	}
    76  
    77  	return r0, r1
    78  }
    79  
    80  // GetByIds provides a mock function with given fields: ids
    81  func (_m *FileInfoStore) GetByIds(ids []string) ([]*model.FileInfo, error) {
    82  	ret := _m.Called(ids)
    83  
    84  	var r0 []*model.FileInfo
    85  	if rf, ok := ret.Get(0).(func([]string) []*model.FileInfo); ok {
    86  		r0 = rf(ids)
    87  	} else {
    88  		if ret.Get(0) != nil {
    89  			r0 = ret.Get(0).([]*model.FileInfo)
    90  		}
    91  	}
    92  
    93  	var r1 error
    94  	if rf, ok := ret.Get(1).(func([]string) error); ok {
    95  		r1 = rf(ids)
    96  	} else {
    97  		r1 = ret.Error(1)
    98  	}
    99  
   100  	return r0, r1
   101  }
   102  
   103  // GetByPath provides a mock function with given fields: path
   104  func (_m *FileInfoStore) GetByPath(path string) (*model.FileInfo, error) {
   105  	ret := _m.Called(path)
   106  
   107  	var r0 *model.FileInfo
   108  	if rf, ok := ret.Get(0).(func(string) *model.FileInfo); ok {
   109  		r0 = rf(path)
   110  	} else {
   111  		if ret.Get(0) != nil {
   112  			r0 = ret.Get(0).(*model.FileInfo)
   113  		}
   114  	}
   115  
   116  	var r1 error
   117  	if rf, ok := ret.Get(1).(func(string) error); ok {
   118  		r1 = rf(path)
   119  	} else {
   120  		r1 = ret.Error(1)
   121  	}
   122  
   123  	return r0, r1
   124  }
   125  
   126  // GetForPost provides a mock function with given fields: postId, readFromMaster, includeDeleted, allowFromCache
   127  func (_m *FileInfoStore) GetForPost(postId string, readFromMaster bool, includeDeleted bool, allowFromCache bool) ([]*model.FileInfo, error) {
   128  	ret := _m.Called(postId, readFromMaster, includeDeleted, allowFromCache)
   129  
   130  	var r0 []*model.FileInfo
   131  	if rf, ok := ret.Get(0).(func(string, bool, bool, bool) []*model.FileInfo); ok {
   132  		r0 = rf(postId, readFromMaster, includeDeleted, allowFromCache)
   133  	} else {
   134  		if ret.Get(0) != nil {
   135  			r0 = ret.Get(0).([]*model.FileInfo)
   136  		}
   137  	}
   138  
   139  	var r1 error
   140  	if rf, ok := ret.Get(1).(func(string, bool, bool, bool) error); ok {
   141  		r1 = rf(postId, readFromMaster, includeDeleted, allowFromCache)
   142  	} else {
   143  		r1 = ret.Error(1)
   144  	}
   145  
   146  	return r0, r1
   147  }
   148  
   149  // GetForUser provides a mock function with given fields: userId
   150  func (_m *FileInfoStore) GetForUser(userId string) ([]*model.FileInfo, error) {
   151  	ret := _m.Called(userId)
   152  
   153  	var r0 []*model.FileInfo
   154  	if rf, ok := ret.Get(0).(func(string) []*model.FileInfo); ok {
   155  		r0 = rf(userId)
   156  	} else {
   157  		if ret.Get(0) != nil {
   158  			r0 = ret.Get(0).([]*model.FileInfo)
   159  		}
   160  	}
   161  
   162  	var r1 error
   163  	if rf, ok := ret.Get(1).(func(string) error); ok {
   164  		r1 = rf(userId)
   165  	} else {
   166  		r1 = ret.Error(1)
   167  	}
   168  
   169  	return r0, r1
   170  }
   171  
   172  // GetWithOptions provides a mock function with given fields: page, perPage, opt
   173  func (_m *FileInfoStore) GetWithOptions(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, error) {
   174  	ret := _m.Called(page, perPage, opt)
   175  
   176  	var r0 []*model.FileInfo
   177  	if rf, ok := ret.Get(0).(func(int, int, *model.GetFileInfosOptions) []*model.FileInfo); ok {
   178  		r0 = rf(page, perPage, opt)
   179  	} else {
   180  		if ret.Get(0) != nil {
   181  			r0 = ret.Get(0).([]*model.FileInfo)
   182  		}
   183  	}
   184  
   185  	var r1 error
   186  	if rf, ok := ret.Get(1).(func(int, int, *model.GetFileInfosOptions) error); ok {
   187  		r1 = rf(page, perPage, opt)
   188  	} else {
   189  		r1 = ret.Error(1)
   190  	}
   191  
   192  	return r0, r1
   193  }
   194  
   195  // InvalidateFileInfosForPostCache provides a mock function with given fields: postId, deleted
   196  func (_m *FileInfoStore) InvalidateFileInfosForPostCache(postId string, deleted bool) {
   197  	_m.Called(postId, deleted)
   198  }
   199  
   200  // PermanentDelete provides a mock function with given fields: fileId
   201  func (_m *FileInfoStore) PermanentDelete(fileId string) error {
   202  	ret := _m.Called(fileId)
   203  
   204  	var r0 error
   205  	if rf, ok := ret.Get(0).(func(string) error); ok {
   206  		r0 = rf(fileId)
   207  	} else {
   208  		r0 = ret.Error(0)
   209  	}
   210  
   211  	return r0
   212  }
   213  
   214  // PermanentDeleteBatch provides a mock function with given fields: endTime, limit
   215  func (_m *FileInfoStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, error) {
   216  	ret := _m.Called(endTime, limit)
   217  
   218  	var r0 int64
   219  	if rf, ok := ret.Get(0).(func(int64, int64) int64); ok {
   220  		r0 = rf(endTime, limit)
   221  	} else {
   222  		r0 = ret.Get(0).(int64)
   223  	}
   224  
   225  	var r1 error
   226  	if rf, ok := ret.Get(1).(func(int64, int64) error); ok {
   227  		r1 = rf(endTime, limit)
   228  	} else {
   229  		r1 = ret.Error(1)
   230  	}
   231  
   232  	return r0, r1
   233  }
   234  
   235  // PermanentDeleteByUser provides a mock function with given fields: userId
   236  func (_m *FileInfoStore) PermanentDeleteByUser(userId string) (int64, error) {
   237  	ret := _m.Called(userId)
   238  
   239  	var r0 int64
   240  	if rf, ok := ret.Get(0).(func(string) int64); ok {
   241  		r0 = rf(userId)
   242  	} else {
   243  		r0 = ret.Get(0).(int64)
   244  	}
   245  
   246  	var r1 error
   247  	if rf, ok := ret.Get(1).(func(string) error); ok {
   248  		r1 = rf(userId)
   249  	} else {
   250  		r1 = ret.Error(1)
   251  	}
   252  
   253  	return r0, r1
   254  }
   255  
   256  // Save provides a mock function with given fields: info
   257  func (_m *FileInfoStore) Save(info *model.FileInfo) (*model.FileInfo, error) {
   258  	ret := _m.Called(info)
   259  
   260  	var r0 *model.FileInfo
   261  	if rf, ok := ret.Get(0).(func(*model.FileInfo) *model.FileInfo); ok {
   262  		r0 = rf(info)
   263  	} else {
   264  		if ret.Get(0) != nil {
   265  			r0 = ret.Get(0).(*model.FileInfo)
   266  		}
   267  	}
   268  
   269  	var r1 error
   270  	if rf, ok := ret.Get(1).(func(*model.FileInfo) error); ok {
   271  		r1 = rf(info)
   272  	} else {
   273  		r1 = ret.Error(1)
   274  	}
   275  
   276  	return r0, r1
   277  }
   278  
   279  // Search provides a mock function with given fields: paramsList, userId, teamId, page, perPage
   280  func (_m *FileInfoStore) Search(paramsList []*model.SearchParams, userId string, teamId string, page int, perPage int) (*model.FileInfoList, error) {
   281  	ret := _m.Called(paramsList, userId, teamId, page, perPage)
   282  
   283  	var r0 *model.FileInfoList
   284  	if rf, ok := ret.Get(0).(func([]*model.SearchParams, string, string, int, int) *model.FileInfoList); ok {
   285  		r0 = rf(paramsList, userId, teamId, page, perPage)
   286  	} else {
   287  		if ret.Get(0) != nil {
   288  			r0 = ret.Get(0).(*model.FileInfoList)
   289  		}
   290  	}
   291  
   292  	var r1 error
   293  	if rf, ok := ret.Get(1).(func([]*model.SearchParams, string, string, int, int) error); ok {
   294  		r1 = rf(paramsList, userId, teamId, page, perPage)
   295  	} else {
   296  		r1 = ret.Error(1)
   297  	}
   298  
   299  	return r0, r1
   300  }
   301  
   302  // SetContent provides a mock function with given fields: fileId, content
   303  func (_m *FileInfoStore) SetContent(fileId string, content string) error {
   304  	ret := _m.Called(fileId, content)
   305  
   306  	var r0 error
   307  	if rf, ok := ret.Get(0).(func(string, string) error); ok {
   308  		r0 = rf(fileId, content)
   309  	} else {
   310  		r0 = ret.Error(0)
   311  	}
   312  
   313  	return r0
   314  }
   315  
   316  // Upsert provides a mock function with given fields: info
   317  func (_m *FileInfoStore) Upsert(info *model.FileInfo) (*model.FileInfo, error) {
   318  	ret := _m.Called(info)
   319  
   320  	var r0 *model.FileInfo
   321  	if rf, ok := ret.Get(0).(func(*model.FileInfo) *model.FileInfo); ok {
   322  		r0 = rf(info)
   323  	} else {
   324  		if ret.Get(0) != nil {
   325  			r0 = ret.Get(0).(*model.FileInfo)
   326  		}
   327  	}
   328  
   329  	var r1 error
   330  	if rf, ok := ret.Get(1).(func(*model.FileInfo) error); ok {
   331  		r1 = rf(info)
   332  	} else {
   333  		r1 = ret.Error(1)
   334  	}
   335  
   336  	return r0, r1
   337  }