// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package mocks

import (
	"context"

	"github.com/agntcy/identity-service/internal/core/iam/types"
	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}
}

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

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

	var r0 *types.APIKey
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *types.APIKey) (*types.APIKey, error)); ok {
		return returnFunc(ctx, APIKey)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *types.APIKey) *types.APIKey); ok {
		r0 = returnFunc(ctx, APIKey)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.APIKey)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *types.APIKey) error); ok {
		r1 = returnFunc(ctx, APIKey)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// AddAPIKey is a helper method to define mock.On call
//   - ctx context.Context
//   - APIKey *types.APIKey
func (_e *Repository_Expecter) AddAPIKey(ctx interface{}, APIKey interface{}) *Repository_AddAPIKey_Call {
	return &Repository_AddAPIKey_Call{Call: _e.mock.On("AddAPIKey", ctx, APIKey)}
}

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

func (_c *Repository_AddAPIKey_Call) Return(aPIKey *types.APIKey, err error) *Repository_AddAPIKey_Call {
	_c.Call.Return(aPIKey, err)
	return _c
}

func (_c *Repository_AddAPIKey_Call) RunAndReturn(run func(ctx context.Context, APIKey *types.APIKey) (*types.APIKey, error)) *Repository_AddAPIKey_Call {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

// DeleteAPIKey is a helper method to define mock.On call
//   - ctx context.Context
//   - APIKey *types.APIKey
func (_e *Repository_Expecter) DeleteAPIKey(ctx interface{}, APIKey interface{}) *Repository_DeleteAPIKey_Call {
	return &Repository_DeleteAPIKey_Call{Call: _e.mock.On("DeleteAPIKey", ctx, APIKey)}
}

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

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

func (_c *Repository_DeleteAPIKey_Call) RunAndReturn(run func(ctx context.Context, APIKey *types.APIKey) error) *Repository_DeleteAPIKey_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	var r0 *types.APIKey
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*types.APIKey, error)); ok {
		return returnFunc(ctx, appID)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) *types.APIKey); ok {
		r0 = returnFunc(ctx, appID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.APIKey)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, appID)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

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

func (_c *Repository_GetAPIKeyByApp_Call) Run(run func(ctx context.Context, appID string)) *Repository_GetAPIKeyByApp_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_GetAPIKeyByApp_Call) Return(aPIKey *types.APIKey, err error) *Repository_GetAPIKeyByApp_Call {
	_c.Call.Return(aPIKey, err)
	return _c
}

func (_c *Repository_GetAPIKeyByApp_Call) RunAndReturn(run func(ctx context.Context, appID string) (*types.APIKey, error)) *Repository_GetAPIKeyByApp_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	var r0 *types.APIKey
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*types.APIKey, error)); ok {
		return returnFunc(ctx, appSecret)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) *types.APIKey); ok {
		r0 = returnFunc(ctx, appSecret)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.APIKey)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, appSecret)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

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

func (_c *Repository_GetAPIKeyBySecret_Call) Run(run func(ctx context.Context, appSecret string)) *Repository_GetAPIKeyBySecret_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_GetAPIKeyBySecret_Call) Return(aPIKey *types.APIKey, err error) *Repository_GetAPIKeyBySecret_Call {
	_c.Call.Return(aPIKey, err)
	return _c
}

func (_c *Repository_GetAPIKeyBySecret_Call) RunAndReturn(run func(ctx context.Context, appSecret string) (*types.APIKey, error)) *Repository_GetAPIKeyBySecret_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	var r0 *types.APIKey
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context) (*types.APIKey, error)); ok {
		return returnFunc(ctx)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context) *types.APIKey); ok {
		r0 = returnFunc(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.APIKey)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = returnFunc(ctx)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

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

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

func (_c *Repository_GetAPIKeyByTenant_Call) Return(aPIKey *types.APIKey, err error) *Repository_GetAPIKeyByTenant_Call {
	_c.Call.Return(aPIKey, err)
	return _c
}

func (_c *Repository_GetAPIKeyByTenant_Call) RunAndReturn(run func(ctx context.Context) (*types.APIKey, error)) *Repository_GetAPIKeyByTenant_Call {
	_c.Call.Return(run)
	return _c
}
