// Code generated by mockery v2.53.4. DO NOT EDIT.

package mocks

import (
	context "context"

	biz "github.com/chainloop-dev/chainloop/app/controlplane/pkg/biz"

	mock "github.com/stretchr/testify/mock"

	time "time"

	uuid "github.com/google/uuid"
)

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

// Create provides a mock function with given fields: ctx, name, description, expiresAt, organizationID, projectID
func (_m *APITokenRepo) Create(ctx context.Context, name string, description *string, expiresAt *time.Time, organizationID uuid.UUID, projectID *uuid.UUID) (*biz.APIToken, error) {
	ret := _m.Called(ctx, name, description, expiresAt, organizationID, projectID)

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

	var r0 *biz.APIToken
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, *string, *time.Time, uuid.UUID, *uuid.UUID) (*biz.APIToken, error)); ok {
		return rf(ctx, name, description, expiresAt, organizationID, projectID)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, *string, *time.Time, uuid.UUID, *uuid.UUID) *biz.APIToken); ok {
		r0 = rf(ctx, name, description, expiresAt, organizationID, projectID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*biz.APIToken)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, string, *string, *time.Time, uuid.UUID, *uuid.UUID) error); ok {
		r1 = rf(ctx, name, description, expiresAt, organizationID, projectID)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// FindByID provides a mock function with given fields: ctx, ID
func (_m *APITokenRepo) FindByID(ctx context.Context, ID uuid.UUID) (*biz.APIToken, error) {
	ret := _m.Called(ctx, ID)

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

	var r0 *biz.APIToken
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID) (*biz.APIToken, error)); ok {
		return rf(ctx, ID)
	}
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID) *biz.APIToken); ok {
		r0 = rf(ctx, ID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*biz.APIToken)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, uuid.UUID) error); ok {
		r1 = rf(ctx, ID)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// FindByIDInOrg provides a mock function with given fields: ctx, orgID, id
func (_m *APITokenRepo) FindByIDInOrg(ctx context.Context, orgID uuid.UUID, id uuid.UUID) (*biz.APIToken, error) {
	ret := _m.Called(ctx, orgID, id)

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

	var r0 *biz.APIToken
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, uuid.UUID) (*biz.APIToken, error)); ok {
		return rf(ctx, orgID, id)
	}
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, uuid.UUID) *biz.APIToken); ok {
		r0 = rf(ctx, orgID, id)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*biz.APIToken)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, uuid.UUID, uuid.UUID) error); ok {
		r1 = rf(ctx, orgID, id)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// FindByNameInOrg provides a mock function with given fields: ctx, orgID, name
func (_m *APITokenRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, name string) (*biz.APIToken, error) {
	ret := _m.Called(ctx, orgID, name)

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

	var r0 *biz.APIToken
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, string) (*biz.APIToken, error)); ok {
		return rf(ctx, orgID, name)
	}
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, string) *biz.APIToken); ok {
		r0 = rf(ctx, orgID, name)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*biz.APIToken)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, uuid.UUID, string) error); ok {
		r1 = rf(ctx, orgID, name)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// List provides a mock function with given fields: ctx, orgID, filters
func (_m *APITokenRepo) List(ctx context.Context, orgID *uuid.UUID, filters *biz.APITokenListFilters) ([]*biz.APIToken, error) {
	ret := _m.Called(ctx, orgID, filters)

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

	var r0 []*biz.APIToken
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *uuid.UUID, *biz.APITokenListFilters) ([]*biz.APIToken, error)); ok {
		return rf(ctx, orgID, filters)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *uuid.UUID, *biz.APITokenListFilters) []*biz.APIToken); ok {
		r0 = rf(ctx, orgID, filters)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*biz.APIToken)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *uuid.UUID, *biz.APITokenListFilters) error); ok {
		r1 = rf(ctx, orgID, filters)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Revoke provides a mock function with given fields: ctx, orgID, ID
func (_m *APITokenRepo) Revoke(ctx context.Context, orgID uuid.UUID, ID uuid.UUID) error {
	ret := _m.Called(ctx, orgID, ID)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, uuid.UUID) error); ok {
		r0 = rf(ctx, orgID, ID)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// UpdateExpiration provides a mock function with given fields: ctx, ID, expiresAt
func (_m *APITokenRepo) UpdateExpiration(ctx context.Context, ID uuid.UUID, expiresAt time.Time) error {
	ret := _m.Called(ctx, ID, expiresAt)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, time.Time) error); ok {
		r0 = rf(ctx, ID, expiresAt)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// UpdateLastUsedAt provides a mock function with given fields: ctx, ID, lastUsedAt
func (_m *APITokenRepo) UpdateLastUsedAt(ctx context.Context, ID uuid.UUID, lastUsedAt time.Time) error {
	ret := _m.Called(ctx, ID, lastUsedAt)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, time.Time) error); ok {
		r0 = rf(ctx, ID, lastUsedAt)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

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

	return mock
}
