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

package tests

import (
	context "context"

	apikey "github.com/grafana/grafana/pkg/services/apikey"

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

	serviceaccounts "github.com/grafana/grafana/pkg/services/serviceaccounts"
)

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

// AddServiceAccountToken provides a mock function with given fields: ctx, serviceAccountID, cmd
func (_m *MockServiceAccountService) AddServiceAccountToken(ctx context.Context, serviceAccountID int64, cmd *serviceaccounts.AddServiceAccountTokenCommand) (*apikey.APIKey, error) {
	ret := _m.Called(ctx, serviceAccountID, cmd)

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

	var r0 *apikey.APIKey
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, int64, *serviceaccounts.AddServiceAccountTokenCommand) (*apikey.APIKey, error)); ok {
		return rf(ctx, serviceAccountID, cmd)
	}
	if rf, ok := ret.Get(0).(func(context.Context, int64, *serviceaccounts.AddServiceAccountTokenCommand) *apikey.APIKey); ok {
		r0 = rf(ctx, serviceAccountID, cmd)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*apikey.APIKey)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, int64, *serviceaccounts.AddServiceAccountTokenCommand) error); ok {
		r1 = rf(ctx, serviceAccountID, cmd)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// CreateServiceAccount provides a mock function with given fields: ctx, orgID, saForm
func (_m *MockServiceAccountService) CreateServiceAccount(ctx context.Context, orgID int64, saForm *serviceaccounts.CreateServiceAccountForm) (*serviceaccounts.ServiceAccountDTO, error) {
	ret := _m.Called(ctx, orgID, saForm)

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

	var r0 *serviceaccounts.ServiceAccountDTO
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, int64, *serviceaccounts.CreateServiceAccountForm) (*serviceaccounts.ServiceAccountDTO, error)); ok {
		return rf(ctx, orgID, saForm)
	}
	if rf, ok := ret.Get(0).(func(context.Context, int64, *serviceaccounts.CreateServiceAccountForm) *serviceaccounts.ServiceAccountDTO); ok {
		r0 = rf(ctx, orgID, saForm)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*serviceaccounts.ServiceAccountDTO)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, int64, *serviceaccounts.CreateServiceAccountForm) error); ok {
		r1 = rf(ctx, orgID, saForm)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// DeleteServiceAccount provides a mock function with given fields: ctx, orgID, serviceAccountID
func (_m *MockServiceAccountService) DeleteServiceAccount(ctx context.Context, orgID int64, serviceAccountID int64) error {
	ret := _m.Called(ctx, orgID, serviceAccountID)

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

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

	return r0
}

// DeleteServiceAccountToken provides a mock function with given fields: ctx, orgID, serviceAccountID, tokenID
func (_m *MockServiceAccountService) DeleteServiceAccountToken(ctx context.Context, orgID int64, serviceAccountID int64, tokenID int64) error {
	ret := _m.Called(ctx, orgID, serviceAccountID, tokenID)

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

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

	return r0
}

// EnableServiceAccount provides a mock function with given fields: ctx, orgID, serviceAccountID, enable
func (_m *MockServiceAccountService) EnableServiceAccount(ctx context.Context, orgID int64, serviceAccountID int64, enable bool) error {
	ret := _m.Called(ctx, orgID, serviceAccountID, enable)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, int64, int64, bool) error); ok {
		r0 = rf(ctx, orgID, serviceAccountID, enable)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// ListTokens provides a mock function with given fields: ctx, query
func (_m *MockServiceAccountService) ListTokens(ctx context.Context, query *serviceaccounts.GetSATokensQuery) ([]apikey.APIKey, error) {
	ret := _m.Called(ctx, query)

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

	var r0 []apikey.APIKey
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *serviceaccounts.GetSATokensQuery) ([]apikey.APIKey, error)); ok {
		return rf(ctx, query)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *serviceaccounts.GetSATokensQuery) []apikey.APIKey); ok {
		r0 = rf(ctx, query)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]apikey.APIKey)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *serviceaccounts.GetSATokensQuery) error); ok {
		r1 = rf(ctx, query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// MigrateApiKeysToServiceAccounts provides a mock function with given fields: ctx, orgID
func (_m *MockServiceAccountService) MigrateApiKeysToServiceAccounts(ctx context.Context, orgID int64) (*serviceaccounts.MigrationResult, error) {
	ret := _m.Called(ctx, orgID)

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

	var r0 *serviceaccounts.MigrationResult
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, int64) (*serviceaccounts.MigrationResult, error)); ok {
		return rf(ctx, orgID)
	}
	if rf, ok := ret.Get(0).(func(context.Context, int64) *serviceaccounts.MigrationResult); ok {
		r0 = rf(ctx, orgID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*serviceaccounts.MigrationResult)
		}
	}

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

	return r0, r1
}

// RetrieveServiceAccount provides a mock function with given fields: ctx, query
func (_m *MockServiceAccountService) RetrieveServiceAccount(ctx context.Context, query *serviceaccounts.GetServiceAccountQuery) (*serviceaccounts.ServiceAccountProfileDTO, error) {
	ret := _m.Called(ctx, query)

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

	var r0 *serviceaccounts.ServiceAccountProfileDTO
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *serviceaccounts.GetServiceAccountQuery) (*serviceaccounts.ServiceAccountProfileDTO, error)); ok {
		return rf(ctx, query)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *serviceaccounts.GetServiceAccountQuery) *serviceaccounts.ServiceAccountProfileDTO); ok {
		r0 = rf(ctx, query)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*serviceaccounts.ServiceAccountProfileDTO)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *serviceaccounts.GetServiceAccountQuery) error); ok {
		r1 = rf(ctx, query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// RetrieveServiceAccountIdByName provides a mock function with given fields: ctx, orgID, name
func (_m *MockServiceAccountService) RetrieveServiceAccountIdByName(ctx context.Context, orgID int64, name string) (int64, error) {
	ret := _m.Called(ctx, orgID, name)

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

	var r0 int64
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, int64, string) (int64, error)); ok {
		return rf(ctx, orgID, name)
	}
	if rf, ok := ret.Get(0).(func(context.Context, int64, string) int64); ok {
		r0 = rf(ctx, orgID, name)
	} else {
		r0 = ret.Get(0).(int64)
	}

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

	return r0, r1
}

// SearchOrgServiceAccounts provides a mock function with given fields: ctx, query
func (_m *MockServiceAccountService) SearchOrgServiceAccounts(ctx context.Context, query *serviceaccounts.SearchOrgServiceAccountsQuery) (*serviceaccounts.SearchOrgServiceAccountsResult, error) {
	ret := _m.Called(ctx, query)

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

	var r0 *serviceaccounts.SearchOrgServiceAccountsResult
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *serviceaccounts.SearchOrgServiceAccountsQuery) (*serviceaccounts.SearchOrgServiceAccountsResult, error)); ok {
		return rf(ctx, query)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *serviceaccounts.SearchOrgServiceAccountsQuery) *serviceaccounts.SearchOrgServiceAccountsResult); ok {
		r0 = rf(ctx, query)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*serviceaccounts.SearchOrgServiceAccountsResult)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *serviceaccounts.SearchOrgServiceAccountsQuery) error); ok {
		r1 = rf(ctx, query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// UpdateServiceAccount provides a mock function with given fields: ctx, orgID, serviceAccountID, saForm
func (_m *MockServiceAccountService) UpdateServiceAccount(ctx context.Context, orgID int64, serviceAccountID int64, saForm *serviceaccounts.UpdateServiceAccountForm) (*serviceaccounts.ServiceAccountProfileDTO, error) {
	ret := _m.Called(ctx, orgID, serviceAccountID, saForm)

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

	var r0 *serviceaccounts.ServiceAccountProfileDTO
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *serviceaccounts.UpdateServiceAccountForm) (*serviceaccounts.ServiceAccountProfileDTO, error)); ok {
		return rf(ctx, orgID, serviceAccountID, saForm)
	}
	if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *serviceaccounts.UpdateServiceAccountForm) *serviceaccounts.ServiceAccountProfileDTO); ok {
		r0 = rf(ctx, orgID, serviceAccountID, saForm)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*serviceaccounts.ServiceAccountProfileDTO)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, int64, int64, *serviceaccounts.UpdateServiceAccountForm) error); ok {
		r1 = rf(ctx, orgID, serviceAccountID, saForm)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

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

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

	return mock
}
