diff --git a/client/mock_client.go b/client/mock_client.go index 365906b..a7616d8 100644 --- a/client/mock_client.go +++ b/client/mock_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. +// Code generated by mockery v2.32.3. DO NOT EDIT. package dbclient @@ -274,65 +274,6 @@ func (_m *MockIDBClient) DeleteUser(ctx context.Context, userID types.UserID) (m return r0, r1 } -// GetAccountByID provides a mock function with given fields: ctx, accountID -func (_m *MockIDBClient) GetAccountByID(ctx context.Context, accountID types.AccountID) (*types.Account, error) { - ret := _m.Called(ctx, accountID) - - var r0 *types.Account - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.AccountID) (*types.Account, error)); ok { - return rf(ctx, accountID) - } - if rf, ok := ret.Get(0).(func(context.Context, types.AccountID) *types.Account); ok { - r0 = rf(ctx, accountID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Account) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.AccountID) error); ok { - r1 = rf(ctx, accountID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetAccountsByUser provides a mock function with given fields: ctx, userID, options -func (_m *MockIDBClient) GetAccountsByUser(ctx context.Context, userID types.UserID, options ...AccountOptions) ([]*types.Account, error) { - _va := make([]interface{}, len(options)) - for _i := range options { - _va[_i] = options[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, userID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 []*types.Account - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.UserID, ...AccountOptions) ([]*types.Account, error)); ok { - return rf(ctx, userID, options...) - } - if rf, ok := ret.Get(0).(func(context.Context, types.UserID, ...AccountOptions) []*types.Account); ok { - r0 = rf(ctx, userID, options...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*types.Account) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.UserID, ...AccountOptions) error); ok { - r1 = rf(ctx, userID, options...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // GetAllAccounts provides a mock function with given fields: ctx, options func (_m *MockIDBClient) GetAllAccounts(ctx context.Context, options ...AccountOptions) ([]*types.Account, error) { _va := make([]interface{}, len(options)) @@ -728,6 +669,72 @@ func (_m *MockIDBClient) GetPortalUserID(ctx context.Context, userID string) (ty return r0, r1 } +// GetUserAccount provides a mock function with given fields: ctx, accountID, userID, options +func (_m *MockIDBClient) GetUserAccount(ctx context.Context, accountID types.AccountID, userID types.UserID, options ...AccountOptions) (*types.Account, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, accountID, userID) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *types.Account + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.AccountID, types.UserID, ...AccountOptions) (*types.Account, error)); ok { + return rf(ctx, accountID, userID, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, types.AccountID, types.UserID, ...AccountOptions) *types.Account); ok { + r0 = rf(ctx, accountID, userID, options...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Account) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, types.AccountID, types.UserID, ...AccountOptions) error); ok { + r1 = rf(ctx, accountID, userID, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetUserAccounts provides a mock function with given fields: ctx, userID, options +func (_m *MockIDBClient) GetUserAccounts(ctx context.Context, userID types.UserID, options ...AccountOptions) ([]*types.Account, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, userID) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 []*types.Account + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.UserID, ...AccountOptions) ([]*types.Account, error)); ok { + return rf(ctx, userID, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, types.UserID, ...AccountOptions) []*types.Account); ok { + r0 = rf(ctx, userID, options...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*types.Account) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, types.UserID, ...AccountOptions) error); ok { + r1 = rf(ctx, userID, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // RemoveAccountUser provides a mock function with given fields: ctx, removeUser func (_m *MockIDBClient) RemoveAccountUser(ctx context.Context, removeUser types.UpdateRemoveAccountUser) (map[string]string, error) { ret := _m.Called(ctx, removeUser) diff --git a/client/mock_reader.go b/client/mock_reader.go index b8891a3..4cac7be 100644 --- a/client/mock_reader.go +++ b/client/mock_reader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. +// Code generated by mockery v2.32.3. DO NOT EDIT. package dbclient @@ -14,65 +14,6 @@ type MockIDBReader struct { mock.Mock } -// GetAccountByID provides a mock function with given fields: ctx, accountID -func (_m *MockIDBReader) GetAccountByID(ctx context.Context, accountID types.AccountID) (*types.Account, error) { - ret := _m.Called(ctx, accountID) - - var r0 *types.Account - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.AccountID) (*types.Account, error)); ok { - return rf(ctx, accountID) - } - if rf, ok := ret.Get(0).(func(context.Context, types.AccountID) *types.Account); ok { - r0 = rf(ctx, accountID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Account) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.AccountID) error); ok { - r1 = rf(ctx, accountID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetAccountsByUser provides a mock function with given fields: ctx, userID, options -func (_m *MockIDBReader) GetAccountsByUser(ctx context.Context, userID types.UserID, options ...AccountOptions) ([]*types.Account, error) { - _va := make([]interface{}, len(options)) - for _i := range options { - _va[_i] = options[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, userID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 []*types.Account - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.UserID, ...AccountOptions) ([]*types.Account, error)); ok { - return rf(ctx, userID, options...) - } - if rf, ok := ret.Get(0).(func(context.Context, types.UserID, ...AccountOptions) []*types.Account); ok { - r0 = rf(ctx, userID, options...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*types.Account) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.UserID, ...AccountOptions) error); ok { - r1 = rf(ctx, userID, options...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // GetAllAccounts provides a mock function with given fields: ctx, options func (_m *MockIDBReader) GetAllAccounts(ctx context.Context, options ...AccountOptions) ([]*types.Account, error) { _va := make([]interface{}, len(options)) @@ -468,6 +409,72 @@ func (_m *MockIDBReader) GetPortalUserID(ctx context.Context, userID string) (ty return r0, r1 } +// GetUserAccount provides a mock function with given fields: ctx, accountID, userID, options +func (_m *MockIDBReader) GetUserAccount(ctx context.Context, accountID types.AccountID, userID types.UserID, options ...AccountOptions) (*types.Account, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, accountID, userID) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *types.Account + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.AccountID, types.UserID, ...AccountOptions) (*types.Account, error)); ok { + return rf(ctx, accountID, userID, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, types.AccountID, types.UserID, ...AccountOptions) *types.Account); ok { + r0 = rf(ctx, accountID, userID, options...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Account) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, types.AccountID, types.UserID, ...AccountOptions) error); ok { + r1 = rf(ctx, accountID, userID, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetUserAccounts provides a mock function with given fields: ctx, userID, options +func (_m *MockIDBReader) GetUserAccounts(ctx context.Context, userID types.UserID, options ...AccountOptions) ([]*types.Account, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, userID) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 []*types.Account + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.UserID, ...AccountOptions) ([]*types.Account, error)); ok { + return rf(ctx, userID, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, types.UserID, ...AccountOptions) []*types.Account); ok { + r0 = rf(ctx, userID, options...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*types.Account) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, types.UserID, ...AccountOptions) error); ok { + r1 = rf(ctx, userID, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // NewMockIDBReader creates a new instance of MockIDBReader. 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 NewMockIDBReader(t interface { diff --git a/client/mock_writer.go b/client/mock_writer.go index 2450c0f..abc1f13 100644 --- a/client/mock_writer.go +++ b/client/mock_writer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. +// Code generated by mockery v2.32.3. DO NOT EDIT. package dbclient