// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
// Copyright (c) Abstract Machines

// SPDX-License-Identifier: Apache-2.0

package mocks

import (
	"context"

	"github.com/absmach/supermq/certs"
	mock "github.com/stretchr/testify/mock"
)

// NewRepository creates a new instance of Repository. 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 NewRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *Repository {
	mock := &Repository{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}

// Repository is an autogenerated mock type for the Repository type
type Repository struct {
	mock.Mock
}

type Repository_Expecter struct {
	mock *mock.Mock
}

func (_m *Repository) EXPECT() *Repository_Expecter {
	return &Repository_Expecter{mock: &_m.Mock}
}

// Remove provides a mock function for the type Repository
func (_mock *Repository) Remove(ctx context.Context, clientID string) error {
	ret := _mock.Called(ctx, clientID)

	if len(ret) == 0 {
		panic("no return value specified for Remove")
	}

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
		r0 = returnFunc(ctx, clientID)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

// Repository_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove'
type Repository_Remove_Call struct {
	*mock.Call
}

// Remove is a helper method to define mock.On call
//   - ctx context.Context
//   - clientID string
func (_e *Repository_Expecter) Remove(ctx interface{}, clientID interface{}) *Repository_Remove_Call {
	return &Repository_Remove_Call{Call: _e.mock.On("Remove", ctx, clientID)}
}

func (_c *Repository_Remove_Call) Run(run func(ctx context.Context, clientID string)) *Repository_Remove_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_Remove_Call) Return(err error) *Repository_Remove_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Repository_Remove_Call) RunAndReturn(run func(ctx context.Context, clientID string) error) *Repository_Remove_Call {
	_c.Call.Return(run)
	return _c
}

// RemoveBySerial provides a mock function for the type Repository
func (_mock *Repository) RemoveBySerial(ctx context.Context, serialID string) error {
	ret := _mock.Called(ctx, serialID)

	if len(ret) == 0 {
		panic("no return value specified for RemoveBySerial")
	}

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
		r0 = returnFunc(ctx, serialID)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

// Repository_RemoveBySerial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBySerial'
type Repository_RemoveBySerial_Call struct {
	*mock.Call
}

// RemoveBySerial is a helper method to define mock.On call
//   - ctx context.Context
//   - serialID string
func (_e *Repository_Expecter) RemoveBySerial(ctx interface{}, serialID interface{}) *Repository_RemoveBySerial_Call {
	return &Repository_RemoveBySerial_Call{Call: _e.mock.On("RemoveBySerial", ctx, serialID)}
}

func (_c *Repository_RemoveBySerial_Call) Run(run func(ctx context.Context, serialID string)) *Repository_RemoveBySerial_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_RemoveBySerial_Call) Return(err error) *Repository_RemoveBySerial_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Repository_RemoveBySerial_Call) RunAndReturn(run func(ctx context.Context, serialID string) error) *Repository_RemoveBySerial_Call {
	_c.Call.Return(run)
	return _c
}

// RetrieveAll provides a mock function for the type Repository
func (_mock *Repository) RetrieveAll(ctx context.Context, offset uint64, limit uint64) (certs.CertPage, error) {
	ret := _mock.Called(ctx, offset, limit)

	if len(ret) == 0 {
		panic("no return value specified for RetrieveAll")
	}

	var r0 certs.CertPage
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, uint64, uint64) (certs.CertPage, error)); ok {
		return returnFunc(ctx, offset, limit)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, uint64, uint64) certs.CertPage); ok {
		r0 = returnFunc(ctx, offset, limit)
	} else {
		r0 = ret.Get(0).(certs.CertPage)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, uint64, uint64) error); ok {
		r1 = returnFunc(ctx, offset, limit)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// Repository_RetrieveAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveAll'
type Repository_RetrieveAll_Call struct {
	*mock.Call
}

// RetrieveAll is a helper method to define mock.On call
//   - ctx context.Context
//   - offset uint64
//   - limit uint64
func (_e *Repository_Expecter) RetrieveAll(ctx interface{}, offset interface{}, limit interface{}) *Repository_RetrieveAll_Call {
	return &Repository_RetrieveAll_Call{Call: _e.mock.On("RetrieveAll", ctx, offset, limit)}
}

func (_c *Repository_RetrieveAll_Call) Run(run func(ctx context.Context, offset uint64, limit uint64)) *Repository_RetrieveAll_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 uint64
		if args[1] != nil {
			arg1 = args[1].(uint64)
		}
		var arg2 uint64
		if args[2] != nil {
			arg2 = args[2].(uint64)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *Repository_RetrieveAll_Call) Return(certPage certs.CertPage, err error) *Repository_RetrieveAll_Call {
	_c.Call.Return(certPage, err)
	return _c
}

func (_c *Repository_RetrieveAll_Call) RunAndReturn(run func(ctx context.Context, offset uint64, limit uint64) (certs.CertPage, error)) *Repository_RetrieveAll_Call {
	_c.Call.Return(run)
	return _c
}

// RetrieveByClient provides a mock function for the type Repository
func (_mock *Repository) RetrieveByClient(ctx context.Context, clientID string, pm certs.PageMetadata) (certs.CertPage, error) {
	ret := _mock.Called(ctx, clientID, pm)

	if len(ret) == 0 {
		panic("no return value specified for RetrieveByClient")
	}

	var r0 certs.CertPage
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, certs.PageMetadata) (certs.CertPage, error)); ok {
		return returnFunc(ctx, clientID, pm)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, certs.PageMetadata) certs.CertPage); ok {
		r0 = returnFunc(ctx, clientID, pm)
	} else {
		r0 = ret.Get(0).(certs.CertPage)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string, certs.PageMetadata) error); ok {
		r1 = returnFunc(ctx, clientID, pm)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// Repository_RetrieveByClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveByClient'
type Repository_RetrieveByClient_Call struct {
	*mock.Call
}

// RetrieveByClient is a helper method to define mock.On call
//   - ctx context.Context
//   - clientID string
//   - pm certs.PageMetadata
func (_e *Repository_Expecter) RetrieveByClient(ctx interface{}, clientID interface{}, pm interface{}) *Repository_RetrieveByClient_Call {
	return &Repository_RetrieveByClient_Call{Call: _e.mock.On("RetrieveByClient", ctx, clientID, pm)}
}

func (_c *Repository_RetrieveByClient_Call) Run(run func(ctx context.Context, clientID string, pm certs.PageMetadata)) *Repository_RetrieveByClient_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		var arg2 certs.PageMetadata
		if args[2] != nil {
			arg2 = args[2].(certs.PageMetadata)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *Repository_RetrieveByClient_Call) Return(certPage certs.CertPage, err error) *Repository_RetrieveByClient_Call {
	_c.Call.Return(certPage, err)
	return _c
}

func (_c *Repository_RetrieveByClient_Call) RunAndReturn(run func(ctx context.Context, clientID string, pm certs.PageMetadata) (certs.CertPage, error)) *Repository_RetrieveByClient_Call {
	_c.Call.Return(run)
	return _c
}

// RetrieveBySerial provides a mock function for the type Repository
func (_mock *Repository) RetrieveBySerial(ctx context.Context, serialID string) (certs.Cert, error) {
	ret := _mock.Called(ctx, serialID)

	if len(ret) == 0 {
		panic("no return value specified for RetrieveBySerial")
	}

	var r0 certs.Cert
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (certs.Cert, error)); ok {
		return returnFunc(ctx, serialID)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) certs.Cert); ok {
		r0 = returnFunc(ctx, serialID)
	} else {
		r0 = ret.Get(0).(certs.Cert)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, serialID)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// Repository_RetrieveBySerial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveBySerial'
type Repository_RetrieveBySerial_Call struct {
	*mock.Call
}

// RetrieveBySerial is a helper method to define mock.On call
//   - ctx context.Context
//   - serialID string
func (_e *Repository_Expecter) RetrieveBySerial(ctx interface{}, serialID interface{}) *Repository_RetrieveBySerial_Call {
	return &Repository_RetrieveBySerial_Call{Call: _e.mock.On("RetrieveBySerial", ctx, serialID)}
}

func (_c *Repository_RetrieveBySerial_Call) Run(run func(ctx context.Context, serialID string)) *Repository_RetrieveBySerial_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_RetrieveBySerial_Call) Return(cert certs.Cert, err error) *Repository_RetrieveBySerial_Call {
	_c.Call.Return(cert, err)
	return _c
}

func (_c *Repository_RetrieveBySerial_Call) RunAndReturn(run func(ctx context.Context, serialID string) (certs.Cert, error)) *Repository_RetrieveBySerial_Call {
	_c.Call.Return(run)
	return _c
}

// Save provides a mock function for the type Repository
func (_mock *Repository) Save(ctx context.Context, cert certs.Cert) (string, error) {
	ret := _mock.Called(ctx, cert)

	if len(ret) == 0 {
		panic("no return value specified for Save")
	}

	var r0 string
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, certs.Cert) (string, error)); ok {
		return returnFunc(ctx, cert)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, certs.Cert) string); ok {
		r0 = returnFunc(ctx, cert)
	} else {
		r0 = ret.Get(0).(string)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, certs.Cert) error); ok {
		r1 = returnFunc(ctx, cert)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// Repository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
type Repository_Save_Call struct {
	*mock.Call
}

// Save is a helper method to define mock.On call
//   - ctx context.Context
//   - cert certs.Cert
func (_e *Repository_Expecter) Save(ctx interface{}, cert interface{}) *Repository_Save_Call {
	return &Repository_Save_Call{Call: _e.mock.On("Save", ctx, cert)}
}

func (_c *Repository_Save_Call) Run(run func(ctx context.Context, cert certs.Cert)) *Repository_Save_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 certs.Cert
		if args[1] != nil {
			arg1 = args[1].(certs.Cert)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_Save_Call) Return(s string, err error) *Repository_Save_Call {
	_c.Call.Return(s, err)
	return _c
}

func (_c *Repository_Save_Call) RunAndReturn(run func(ctx context.Context, cert certs.Cert) (string, error)) *Repository_Save_Call {
	_c.Call.Return(run)
	return _c
}

// Update provides a mock function for the type Repository
func (_mock *Repository) Update(ctx context.Context, cert certs.Cert) error {
	ret := _mock.Called(ctx, cert)

	if len(ret) == 0 {
		panic("no return value specified for Update")
	}

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, certs.Cert) error); ok {
		r0 = returnFunc(ctx, cert)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

// Repository_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
type Repository_Update_Call struct {
	*mock.Call
}

// Update is a helper method to define mock.On call
//   - ctx context.Context
//   - cert certs.Cert
func (_e *Repository_Expecter) Update(ctx interface{}, cert interface{}) *Repository_Update_Call {
	return &Repository_Update_Call{Call: _e.mock.On("Update", ctx, cert)}
}

func (_c *Repository_Update_Call) Run(run func(ctx context.Context, cert certs.Cert)) *Repository_Update_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 certs.Cert
		if args[1] != nil {
			arg1 = args[1].(certs.Cert)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_Update_Call) Return(err error) *Repository_Update_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Repository_Update_Call) RunAndReturn(run func(ctx context.Context, cert certs.Cert) error) *Repository_Update_Call {
	_c.Call.Return(run)
	return _c
}
