github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/store/storetest/mocks/RetentionPolicyStore.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  // 'Regenerate
     4  
     5  package mocks
     6  
     7  import (
     8  	model "github.com/masterhung0112/hk_server/v5/model"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // RetentionPolicyStore is an autogenerated mock type for the RetentionPolicyStore type
    13  type RetentionPolicyStore struct {
    14  	mock.Mock
    15  }
    16  
    17  // AddChannels provides a mock function with given fields: policyId, channelIds
    18  func (_m *RetentionPolicyStore) AddChannels(policyId string, channelIds []string) error {
    19  	ret := _m.Called(policyId, channelIds)
    20  
    21  	var r0 error
    22  	if rf, ok := ret.Get(0).(func(string, []string) error); ok {
    23  		r0 = rf(policyId, channelIds)
    24  	} else {
    25  		r0 = ret.Error(0)
    26  	}
    27  
    28  	return r0
    29  }
    30  
    31  // AddTeams provides a mock function with given fields: policyId, teamIds
    32  func (_m *RetentionPolicyStore) AddTeams(policyId string, teamIds []string) error {
    33  	ret := _m.Called(policyId, teamIds)
    34  
    35  	var r0 error
    36  	if rf, ok := ret.Get(0).(func(string, []string) error); ok {
    37  		r0 = rf(policyId, teamIds)
    38  	} else {
    39  		r0 = ret.Error(0)
    40  	}
    41  
    42  	return r0
    43  }
    44  
    45  // Delete provides a mock function with given fields: id
    46  func (_m *RetentionPolicyStore) Delete(id string) error {
    47  	ret := _m.Called(id)
    48  
    49  	var r0 error
    50  	if rf, ok := ret.Get(0).(func(string) error); ok {
    51  		r0 = rf(id)
    52  	} else {
    53  		r0 = ret.Error(0)
    54  	}
    55  
    56  	return r0
    57  }
    58  
    59  // DeleteOrphanedRows provides a mock function with given fields: limit
    60  func (_m *RetentionPolicyStore) DeleteOrphanedRows(limit int) (int64, error) {
    61  	ret := _m.Called(limit)
    62  
    63  	var r0 int64
    64  	if rf, ok := ret.Get(0).(func(int) int64); ok {
    65  		r0 = rf(limit)
    66  	} else {
    67  		r0 = ret.Get(0).(int64)
    68  	}
    69  
    70  	var r1 error
    71  	if rf, ok := ret.Get(1).(func(int) error); ok {
    72  		r1 = rf(limit)
    73  	} else {
    74  		r1 = ret.Error(1)
    75  	}
    76  
    77  	return r0, r1
    78  }
    79  
    80  // Get provides a mock function with given fields: id
    81  func (_m *RetentionPolicyStore) Get(id string) (*model.RetentionPolicyWithTeamAndChannelCounts, error) {
    82  	ret := _m.Called(id)
    83  
    84  	var r0 *model.RetentionPolicyWithTeamAndChannelCounts
    85  	if rf, ok := ret.Get(0).(func(string) *model.RetentionPolicyWithTeamAndChannelCounts); ok {
    86  		r0 = rf(id)
    87  	} else {
    88  		if ret.Get(0) != nil {
    89  			r0 = ret.Get(0).(*model.RetentionPolicyWithTeamAndChannelCounts)
    90  		}
    91  	}
    92  
    93  	var r1 error
    94  	if rf, ok := ret.Get(1).(func(string) error); ok {
    95  		r1 = rf(id)
    96  	} else {
    97  		r1 = ret.Error(1)
    98  	}
    99  
   100  	return r0, r1
   101  }
   102  
   103  // GetAll provides a mock function with given fields: offset, limit
   104  func (_m *RetentionPolicyStore) GetAll(offset int, limit int) ([]*model.RetentionPolicyWithTeamAndChannelCounts, error) {
   105  	ret := _m.Called(offset, limit)
   106  
   107  	var r0 []*model.RetentionPolicyWithTeamAndChannelCounts
   108  	if rf, ok := ret.Get(0).(func(int, int) []*model.RetentionPolicyWithTeamAndChannelCounts); ok {
   109  		r0 = rf(offset, limit)
   110  	} else {
   111  		if ret.Get(0) != nil {
   112  			r0 = ret.Get(0).([]*model.RetentionPolicyWithTeamAndChannelCounts)
   113  		}
   114  	}
   115  
   116  	var r1 error
   117  	if rf, ok := ret.Get(1).(func(int, int) error); ok {
   118  		r1 = rf(offset, limit)
   119  	} else {
   120  		r1 = ret.Error(1)
   121  	}
   122  
   123  	return r0, r1
   124  }
   125  
   126  // GetChannelPoliciesCountForUser provides a mock function with given fields: userID
   127  func (_m *RetentionPolicyStore) GetChannelPoliciesCountForUser(userID string) (int64, error) {
   128  	ret := _m.Called(userID)
   129  
   130  	var r0 int64
   131  	if rf, ok := ret.Get(0).(func(string) int64); ok {
   132  		r0 = rf(userID)
   133  	} else {
   134  		r0 = ret.Get(0).(int64)
   135  	}
   136  
   137  	var r1 error
   138  	if rf, ok := ret.Get(1).(func(string) error); ok {
   139  		r1 = rf(userID)
   140  	} else {
   141  		r1 = ret.Error(1)
   142  	}
   143  
   144  	return r0, r1
   145  }
   146  
   147  // GetChannelPoliciesForUser provides a mock function with given fields: userID, offset, limit
   148  func (_m *RetentionPolicyStore) GetChannelPoliciesForUser(userID string, offset int, limit int) ([]*model.RetentionPolicyForChannel, error) {
   149  	ret := _m.Called(userID, offset, limit)
   150  
   151  	var r0 []*model.RetentionPolicyForChannel
   152  	if rf, ok := ret.Get(0).(func(string, int, int) []*model.RetentionPolicyForChannel); ok {
   153  		r0 = rf(userID, offset, limit)
   154  	} else {
   155  		if ret.Get(0) != nil {
   156  			r0 = ret.Get(0).([]*model.RetentionPolicyForChannel)
   157  		}
   158  	}
   159  
   160  	var r1 error
   161  	if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
   162  		r1 = rf(userID, offset, limit)
   163  	} else {
   164  		r1 = ret.Error(1)
   165  	}
   166  
   167  	return r0, r1
   168  }
   169  
   170  // GetChannels provides a mock function with given fields: policyId, offset, limit
   171  func (_m *RetentionPolicyStore) GetChannels(policyId string, offset int, limit int) (model.ChannelListWithTeamData, error) {
   172  	ret := _m.Called(policyId, offset, limit)
   173  
   174  	var r0 model.ChannelListWithTeamData
   175  	if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelListWithTeamData); ok {
   176  		r0 = rf(policyId, offset, limit)
   177  	} else {
   178  		if ret.Get(0) != nil {
   179  			r0 = ret.Get(0).(model.ChannelListWithTeamData)
   180  		}
   181  	}
   182  
   183  	var r1 error
   184  	if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
   185  		r1 = rf(policyId, offset, limit)
   186  	} else {
   187  		r1 = ret.Error(1)
   188  	}
   189  
   190  	return r0, r1
   191  }
   192  
   193  // GetChannelsCount provides a mock function with given fields: policyId
   194  func (_m *RetentionPolicyStore) GetChannelsCount(policyId string) (int64, error) {
   195  	ret := _m.Called(policyId)
   196  
   197  	var r0 int64
   198  	if rf, ok := ret.Get(0).(func(string) int64); ok {
   199  		r0 = rf(policyId)
   200  	} else {
   201  		r0 = ret.Get(0).(int64)
   202  	}
   203  
   204  	var r1 error
   205  	if rf, ok := ret.Get(1).(func(string) error); ok {
   206  		r1 = rf(policyId)
   207  	} else {
   208  		r1 = ret.Error(1)
   209  	}
   210  
   211  	return r0, r1
   212  }
   213  
   214  // GetCount provides a mock function with given fields:
   215  func (_m *RetentionPolicyStore) GetCount() (int64, error) {
   216  	ret := _m.Called()
   217  
   218  	var r0 int64
   219  	if rf, ok := ret.Get(0).(func() int64); ok {
   220  		r0 = rf()
   221  	} else {
   222  		r0 = ret.Get(0).(int64)
   223  	}
   224  
   225  	var r1 error
   226  	if rf, ok := ret.Get(1).(func() error); ok {
   227  		r1 = rf()
   228  	} else {
   229  		r1 = ret.Error(1)
   230  	}
   231  
   232  	return r0, r1
   233  }
   234  
   235  // GetTeamPoliciesCountForUser provides a mock function with given fields: userID
   236  func (_m *RetentionPolicyStore) GetTeamPoliciesCountForUser(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  // GetTeamPoliciesForUser provides a mock function with given fields: userID, offset, limit
   257  func (_m *RetentionPolicyStore) GetTeamPoliciesForUser(userID string, offset int, limit int) ([]*model.RetentionPolicyForTeam, error) {
   258  	ret := _m.Called(userID, offset, limit)
   259  
   260  	var r0 []*model.RetentionPolicyForTeam
   261  	if rf, ok := ret.Get(0).(func(string, int, int) []*model.RetentionPolicyForTeam); ok {
   262  		r0 = rf(userID, offset, limit)
   263  	} else {
   264  		if ret.Get(0) != nil {
   265  			r0 = ret.Get(0).([]*model.RetentionPolicyForTeam)
   266  		}
   267  	}
   268  
   269  	var r1 error
   270  	if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
   271  		r1 = rf(userID, offset, limit)
   272  	} else {
   273  		r1 = ret.Error(1)
   274  	}
   275  
   276  	return r0, r1
   277  }
   278  
   279  // GetTeams provides a mock function with given fields: policyId, offset, limit
   280  func (_m *RetentionPolicyStore) GetTeams(policyId string, offset int, limit int) ([]*model.Team, error) {
   281  	ret := _m.Called(policyId, offset, limit)
   282  
   283  	var r0 []*model.Team
   284  	if rf, ok := ret.Get(0).(func(string, int, int) []*model.Team); ok {
   285  		r0 = rf(policyId, offset, limit)
   286  	} else {
   287  		if ret.Get(0) != nil {
   288  			r0 = ret.Get(0).([]*model.Team)
   289  		}
   290  	}
   291  
   292  	var r1 error
   293  	if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
   294  		r1 = rf(policyId, offset, limit)
   295  	} else {
   296  		r1 = ret.Error(1)
   297  	}
   298  
   299  	return r0, r1
   300  }
   301  
   302  // GetTeamsCount provides a mock function with given fields: policyId
   303  func (_m *RetentionPolicyStore) GetTeamsCount(policyId string) (int64, error) {
   304  	ret := _m.Called(policyId)
   305  
   306  	var r0 int64
   307  	if rf, ok := ret.Get(0).(func(string) int64); ok {
   308  		r0 = rf(policyId)
   309  	} else {
   310  		r0 = ret.Get(0).(int64)
   311  	}
   312  
   313  	var r1 error
   314  	if rf, ok := ret.Get(1).(func(string) error); ok {
   315  		r1 = rf(policyId)
   316  	} else {
   317  		r1 = ret.Error(1)
   318  	}
   319  
   320  	return r0, r1
   321  }
   322  
   323  // Patch provides a mock function with given fields: patch
   324  func (_m *RetentionPolicyStore) Patch(patch *model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, error) {
   325  	ret := _m.Called(patch)
   326  
   327  	var r0 *model.RetentionPolicyWithTeamAndChannelCounts
   328  	if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) *model.RetentionPolicyWithTeamAndChannelCounts); ok {
   329  		r0 = rf(patch)
   330  	} else {
   331  		if ret.Get(0) != nil {
   332  			r0 = ret.Get(0).(*model.RetentionPolicyWithTeamAndChannelCounts)
   333  		}
   334  	}
   335  
   336  	var r1 error
   337  	if rf, ok := ret.Get(1).(func(*model.RetentionPolicyWithTeamAndChannelIDs) error); ok {
   338  		r1 = rf(patch)
   339  	} else {
   340  		r1 = ret.Error(1)
   341  	}
   342  
   343  	return r0, r1
   344  }
   345  
   346  // RemoveChannels provides a mock function with given fields: policyId, channelIds
   347  func (_m *RetentionPolicyStore) RemoveChannels(policyId string, channelIds []string) error {
   348  	ret := _m.Called(policyId, channelIds)
   349  
   350  	var r0 error
   351  	if rf, ok := ret.Get(0).(func(string, []string) error); ok {
   352  		r0 = rf(policyId, channelIds)
   353  	} else {
   354  		r0 = ret.Error(0)
   355  	}
   356  
   357  	return r0
   358  }
   359  
   360  // RemoveTeams provides a mock function with given fields: policyId, teamIds
   361  func (_m *RetentionPolicyStore) RemoveTeams(policyId string, teamIds []string) error {
   362  	ret := _m.Called(policyId, teamIds)
   363  
   364  	var r0 error
   365  	if rf, ok := ret.Get(0).(func(string, []string) error); ok {
   366  		r0 = rf(policyId, teamIds)
   367  	} else {
   368  		r0 = ret.Error(0)
   369  	}
   370  
   371  	return r0
   372  }
   373  
   374  // Save provides a mock function with given fields: policy
   375  func (_m *RetentionPolicyStore) Save(policy *model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, error) {
   376  	ret := _m.Called(policy)
   377  
   378  	var r0 *model.RetentionPolicyWithTeamAndChannelCounts
   379  	if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) *model.RetentionPolicyWithTeamAndChannelCounts); ok {
   380  		r0 = rf(policy)
   381  	} else {
   382  		if ret.Get(0) != nil {
   383  			r0 = ret.Get(0).(*model.RetentionPolicyWithTeamAndChannelCounts)
   384  		}
   385  	}
   386  
   387  	var r1 error
   388  	if rf, ok := ret.Get(1).(func(*model.RetentionPolicyWithTeamAndChannelIDs) error); ok {
   389  		r1 = rf(policy)
   390  	} else {
   391  		r1 = ret.Error(1)
   392  	}
   393  
   394  	return r0, r1
   395  }