github.com/haalcala/mattermost-server-change-repo/v5@v5.33.2/store/storetest/mocks/UserAccessTokenStore.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  // UserAccessTokenStore is an autogenerated mock type for the UserAccessTokenStore type
    13  type UserAccessTokenStore struct {
    14  	mock.Mock
    15  }
    16  
    17  // Delete provides a mock function with given fields: tokenId
    18  func (_m *UserAccessTokenStore) Delete(tokenId string) error {
    19  	ret := _m.Called(tokenId)
    20  
    21  	var r0 error
    22  	if rf, ok := ret.Get(0).(func(string) error); ok {
    23  		r0 = rf(tokenId)
    24  	} else {
    25  		r0 = ret.Error(0)
    26  	}
    27  
    28  	return r0
    29  }
    30  
    31  // DeleteAllForUser provides a mock function with given fields: userId
    32  func (_m *UserAccessTokenStore) DeleteAllForUser(userId string) error {
    33  	ret := _m.Called(userId)
    34  
    35  	var r0 error
    36  	if rf, ok := ret.Get(0).(func(string) error); ok {
    37  		r0 = rf(userId)
    38  	} else {
    39  		r0 = ret.Error(0)
    40  	}
    41  
    42  	return r0
    43  }
    44  
    45  // Get provides a mock function with given fields: tokenId
    46  func (_m *UserAccessTokenStore) Get(tokenId string) (*model.UserAccessToken, error) {
    47  	ret := _m.Called(tokenId)
    48  
    49  	var r0 *model.UserAccessToken
    50  	if rf, ok := ret.Get(0).(func(string) *model.UserAccessToken); ok {
    51  		r0 = rf(tokenId)
    52  	} else {
    53  		if ret.Get(0) != nil {
    54  			r0 = ret.Get(0).(*model.UserAccessToken)
    55  		}
    56  	}
    57  
    58  	var r1 error
    59  	if rf, ok := ret.Get(1).(func(string) error); ok {
    60  		r1 = rf(tokenId)
    61  	} else {
    62  		r1 = ret.Error(1)
    63  	}
    64  
    65  	return r0, r1
    66  }
    67  
    68  // GetAll provides a mock function with given fields: offset, limit
    69  func (_m *UserAccessTokenStore) GetAll(offset int, limit int) ([]*model.UserAccessToken, error) {
    70  	ret := _m.Called(offset, limit)
    71  
    72  	var r0 []*model.UserAccessToken
    73  	if rf, ok := ret.Get(0).(func(int, int) []*model.UserAccessToken); ok {
    74  		r0 = rf(offset, limit)
    75  	} else {
    76  		if ret.Get(0) != nil {
    77  			r0 = ret.Get(0).([]*model.UserAccessToken)
    78  		}
    79  	}
    80  
    81  	var r1 error
    82  	if rf, ok := ret.Get(1).(func(int, int) error); ok {
    83  		r1 = rf(offset, limit)
    84  	} else {
    85  		r1 = ret.Error(1)
    86  	}
    87  
    88  	return r0, r1
    89  }
    90  
    91  // GetByToken provides a mock function with given fields: tokenString
    92  func (_m *UserAccessTokenStore) GetByToken(tokenString string) (*model.UserAccessToken, error) {
    93  	ret := _m.Called(tokenString)
    94  
    95  	var r0 *model.UserAccessToken
    96  	if rf, ok := ret.Get(0).(func(string) *model.UserAccessToken); ok {
    97  		r0 = rf(tokenString)
    98  	} else {
    99  		if ret.Get(0) != nil {
   100  			r0 = ret.Get(0).(*model.UserAccessToken)
   101  		}
   102  	}
   103  
   104  	var r1 error
   105  	if rf, ok := ret.Get(1).(func(string) error); ok {
   106  		r1 = rf(tokenString)
   107  	} else {
   108  		r1 = ret.Error(1)
   109  	}
   110  
   111  	return r0, r1
   112  }
   113  
   114  // GetByUser provides a mock function with given fields: userId, page, perPage
   115  func (_m *UserAccessTokenStore) GetByUser(userId string, page int, perPage int) ([]*model.UserAccessToken, error) {
   116  	ret := _m.Called(userId, page, perPage)
   117  
   118  	var r0 []*model.UserAccessToken
   119  	if rf, ok := ret.Get(0).(func(string, int, int) []*model.UserAccessToken); ok {
   120  		r0 = rf(userId, page, perPage)
   121  	} else {
   122  		if ret.Get(0) != nil {
   123  			r0 = ret.Get(0).([]*model.UserAccessToken)
   124  		}
   125  	}
   126  
   127  	var r1 error
   128  	if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
   129  		r1 = rf(userId, page, perPage)
   130  	} else {
   131  		r1 = ret.Error(1)
   132  	}
   133  
   134  	return r0, r1
   135  }
   136  
   137  // Save provides a mock function with given fields: token
   138  func (_m *UserAccessTokenStore) Save(token *model.UserAccessToken) (*model.UserAccessToken, error) {
   139  	ret := _m.Called(token)
   140  
   141  	var r0 *model.UserAccessToken
   142  	if rf, ok := ret.Get(0).(func(*model.UserAccessToken) *model.UserAccessToken); ok {
   143  		r0 = rf(token)
   144  	} else {
   145  		if ret.Get(0) != nil {
   146  			r0 = ret.Get(0).(*model.UserAccessToken)
   147  		}
   148  	}
   149  
   150  	var r1 error
   151  	if rf, ok := ret.Get(1).(func(*model.UserAccessToken) error); ok {
   152  		r1 = rf(token)
   153  	} else {
   154  		r1 = ret.Error(1)
   155  	}
   156  
   157  	return r0, r1
   158  }
   159  
   160  // Search provides a mock function with given fields: term
   161  func (_m *UserAccessTokenStore) Search(term string) ([]*model.UserAccessToken, error) {
   162  	ret := _m.Called(term)
   163  
   164  	var r0 []*model.UserAccessToken
   165  	if rf, ok := ret.Get(0).(func(string) []*model.UserAccessToken); ok {
   166  		r0 = rf(term)
   167  	} else {
   168  		if ret.Get(0) != nil {
   169  			r0 = ret.Get(0).([]*model.UserAccessToken)
   170  		}
   171  	}
   172  
   173  	var r1 error
   174  	if rf, ok := ret.Get(1).(func(string) error); ok {
   175  		r1 = rf(term)
   176  	} else {
   177  		r1 = ret.Error(1)
   178  	}
   179  
   180  	return r0, r1
   181  }
   182  
   183  // UpdateTokenDisable provides a mock function with given fields: tokenId
   184  func (_m *UserAccessTokenStore) UpdateTokenDisable(tokenId string) error {
   185  	ret := _m.Called(tokenId)
   186  
   187  	var r0 error
   188  	if rf, ok := ret.Get(0).(func(string) error); ok {
   189  		r0 = rf(tokenId)
   190  	} else {
   191  		r0 = ret.Error(0)
   192  	}
   193  
   194  	return r0
   195  }
   196  
   197  // UpdateTokenEnable provides a mock function with given fields: tokenId
   198  func (_m *UserAccessTokenStore) UpdateTokenEnable(tokenId string) error {
   199  	ret := _m.Called(tokenId)
   200  
   201  	var r0 error
   202  	if rf, ok := ret.Get(0).(func(string) error); ok {
   203  		r0 = rf(tokenId)
   204  	} else {
   205  		r0 = ret.Error(0)
   206  	}
   207  
   208  	return r0
   209  }