// Code generated by mockery v2.51.0. DO NOT EDIT. package policy import ( context "context" modelspolicy "github.com/goharbor/harbor/src/pkg/p2p/preheat/models/policy" mock "github.com/stretchr/testify/mock" q "github.com/goharbor/harbor/src/lib/q" ) // Manager is an autogenerated mock type for the Manager type type Manager struct { mock.Mock } // Count provides a mock function with given fields: ctx, query func (_m *Manager) Count(ctx context.Context, query *q.Query) (int64, error) { ret := _m.Called(ctx, query) if len(ret) == 0 { panic("no return value specified for Count") } var r0 int64 var r1 error if rf, ok := ret.Get(0).(func(context.Context, *q.Query) (int64, error)); ok { return rf(ctx, query) } if rf, ok := ret.Get(0).(func(context.Context, *q.Query) int64); ok { r0 = rf(ctx, query) } else { r0 = ret.Get(0).(int64) } if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok { r1 = rf(ctx, query) } else { r1 = ret.Error(1) } return r0, r1 } // Create provides a mock function with given fields: ctx, schema func (_m *Manager) Create(ctx context.Context, schema *modelspolicy.Schema) (int64, error) { ret := _m.Called(ctx, schema) if len(ret) == 0 { panic("no return value specified for Create") } var r0 int64 var r1 error if rf, ok := ret.Get(0).(func(context.Context, *modelspolicy.Schema) (int64, error)); ok { return rf(ctx, schema) } if rf, ok := ret.Get(0).(func(context.Context, *modelspolicy.Schema) int64); ok { r0 = rf(ctx, schema) } else { r0 = ret.Get(0).(int64) } if rf, ok := ret.Get(1).(func(context.Context, *modelspolicy.Schema) error); ok { r1 = rf(ctx, schema) } else { r1 = ret.Error(1) } return r0, r1 } // Delete provides a mock function with given fields: ctx, id func (_m *Manager) Delete(ctx context.Context, id int64) error { ret := _m.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok { r0 = rf(ctx, id) } else { r0 = ret.Error(0) } return r0 } // Get provides a mock function with given fields: ctx, id func (_m *Manager) Get(ctx context.Context, id int64) (*modelspolicy.Schema, error) { ret := _m.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for Get") } var r0 *modelspolicy.Schema var r1 error if rf, ok := ret.Get(0).(func(context.Context, int64) (*modelspolicy.Schema, error)); ok { return rf(ctx, id) } if rf, ok := ret.Get(0).(func(context.Context, int64) *modelspolicy.Schema); ok { r0 = rf(ctx, id) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*modelspolicy.Schema) } } if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { r1 = rf(ctx, id) } else { r1 = ret.Error(1) } return r0, r1 } // GetByName provides a mock function with given fields: ctx, projectID, name func (_m *Manager) GetByName(ctx context.Context, projectID int64, name string) (*modelspolicy.Schema, error) { ret := _m.Called(ctx, projectID, name) if len(ret) == 0 { panic("no return value specified for GetByName") } var r0 *modelspolicy.Schema var r1 error if rf, ok := ret.Get(0).(func(context.Context, int64, string) (*modelspolicy.Schema, error)); ok { return rf(ctx, projectID, name) } if rf, ok := ret.Get(0).(func(context.Context, int64, string) *modelspolicy.Schema); ok { r0 = rf(ctx, projectID, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*modelspolicy.Schema) } } if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok { r1 = rf(ctx, projectID, name) } else { r1 = ret.Error(1) } return r0, r1 } // ListPolicies provides a mock function with given fields: ctx, query func (_m *Manager) ListPolicies(ctx context.Context, query *q.Query) ([]*modelspolicy.Schema, error) { ret := _m.Called(ctx, query) if len(ret) == 0 { panic("no return value specified for ListPolicies") } var r0 []*modelspolicy.Schema var r1 error if rf, ok := ret.Get(0).(func(context.Context, *q.Query) ([]*modelspolicy.Schema, error)); ok { return rf(ctx, query) } if rf, ok := ret.Get(0).(func(context.Context, *q.Query) []*modelspolicy.Schema); ok { r0 = rf(ctx, query) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*modelspolicy.Schema) } } if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok { r1 = rf(ctx, query) } else { r1 = ret.Error(1) } return r0, r1 } // ListPoliciesByProject provides a mock function with given fields: ctx, project, query func (_m *Manager) ListPoliciesByProject(ctx context.Context, project int64, query *q.Query) ([]*modelspolicy.Schema, error) { ret := _m.Called(ctx, project, query) if len(ret) == 0 { panic("no return value specified for ListPoliciesByProject") } var r0 []*modelspolicy.Schema var r1 error if rf, ok := ret.Get(0).(func(context.Context, int64, *q.Query) ([]*modelspolicy.Schema, error)); ok { return rf(ctx, project, query) } if rf, ok := ret.Get(0).(func(context.Context, int64, *q.Query) []*modelspolicy.Schema); ok { r0 = rf(ctx, project, query) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*modelspolicy.Schema) } } if rf, ok := ret.Get(1).(func(context.Context, int64, *q.Query) error); ok { r1 = rf(ctx, project, query) } else { r1 = ret.Error(1) } return r0, r1 } // Update provides a mock function with given fields: ctx, schema, props func (_m *Manager) Update(ctx context.Context, schema *modelspolicy.Schema, props ...string) error { _va := make([]interface{}, len(props)) for _i := range props { _va[_i] = props[_i] } var _ca []interface{} _ca = append(_ca, ctx, schema) _ca = append(_ca, _va...) ret := _m.Called(_ca...) if len(ret) == 0 { panic("no return value specified for Update") } var r0 error if rf, ok := ret.Get(0).(func(context.Context, *modelspolicy.Schema, ...string) error); ok { r0 = rf(ctx, schema, props...) } else { r0 = ret.Error(0) } return r0 } // NewManager creates a new instance of Manager. 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 NewManager(t interface { mock.TestingT Cleanup(func()) }) *Manager { mock := &Manager{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }