// Copyright 2023 Northern.tech AS
//
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.

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

package mocks

import (
	context "context"

	app "github.com/mendersoftware/mender-server/services/deviceconnect/app"

	io "io"

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

	model "github.com/mendersoftware/mender-server/services/deviceconnect/model"

	time "time"
)

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

// DeleteDevice provides a mock function with given fields: ctx, tenantID, deviceID
func (_m *App) DeleteDevice(ctx context.Context, tenantID string, deviceID string) error {
	ret := _m.Called(ctx, tenantID, deviceID)

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

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

	return r0
}

// DeleteTenant provides a mock function with given fields: ctx, tenantID
func (_m *App) DeleteTenant(ctx context.Context, tenantID string) error {
	ret := _m.Called(ctx, tenantID)

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

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

	return r0
}

// FreeUserSession provides a mock function with given fields: ctx, sessionID, sessionTypes
func (_m *App) FreeUserSession(ctx context.Context, sessionID string, sessionTypes []string) error {
	ret := _m.Called(ctx, sessionID, sessionTypes)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, []string) error); ok {
		r0 = rf(ctx, sessionID, sessionTypes)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// GetControlRecorder provides a mock function with given fields: sessionID
func (_m *App) GetControlRecorder(sessionID string) app.Recorder {
	ret := _m.Called(sessionID)

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

	var r0 app.Recorder
	if rf, ok := ret.Get(0).(func(string) app.Recorder); ok {
		r0 = rf(sessionID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(app.Recorder)
		}
	}

	return r0
}

// GetDevice provides a mock function with given fields: ctx, tenantID, deviceID
func (_m *App) GetDevice(ctx context.Context, tenantID string, deviceID string) (*model.Device, error) {
	ret := _m.Called(ctx, tenantID, deviceID)

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

	var r0 *model.Device
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string) (*model.Device, error)); ok {
		return rf(ctx, tenantID, deviceID)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Device); ok {
		r0 = rf(ctx, tenantID, deviceID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*model.Device)
		}
	}

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

	return r0, r1
}

// GetRecorder provides a mock function with given fields: sessionID
func (_m *App) GetRecorder(sessionID string) app.Recorder {
	ret := _m.Called(sessionID)

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

	var r0 app.Recorder
	if rf, ok := ret.Get(0).(func(string) app.Recorder); ok {
		r0 = rf(sessionID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(app.Recorder)
		}
	}

	return r0
}

// GetSessionRecording provides a mock function with given fields: ctx, id, w
func (_m *App) GetSessionRecording(ctx context.Context, id string, w io.Writer) error {
	ret := _m.Called(ctx, id, w)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, io.Writer) error); ok {
		r0 = rf(ctx, id, w)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// HealthCheck provides a mock function with given fields: ctx
func (_m *App) HealthCheck(ctx context.Context) error {
	ret := _m.Called(ctx)

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

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

	return r0
}

// PrepareUserSession provides a mock function with given fields: ctx, sess
func (_m *App) PrepareUserSession(ctx context.Context, sess *model.Session) error {
	ret := _m.Called(ctx, sess)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *model.Session) error); ok {
		r0 = rf(ctx, sess)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// ProvisionDevice provides a mock function with given fields: ctx, tenantID, device
func (_m *App) ProvisionDevice(ctx context.Context, tenantID string, device *model.Device) error {
	ret := _m.Called(ctx, tenantID, device)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, *model.Device) error); ok {
		r0 = rf(ctx, tenantID, device)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// RegisterConnectionCancelHandle provides a mock function with given fields: id, cancel, exclusive
func (_m *App) RegisterConnectionCancelHandle(id string, cancel context.CancelFunc, exclusive bool) uint32 {
	ret := _m.Called(id, cancel, exclusive)

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

	var r0 uint32
	if rf, ok := ret.Get(0).(func(string, context.CancelFunc, bool) uint32); ok {
		r0 = rf(id, cancel, exclusive)
	} else {
		r0 = ret.Get(0).(uint32)
	}

	return r0
}

// SaveSessionRecording provides a mock function with given fields: ctx, id, sessionBytes
func (_m *App) SaveSessionRecording(ctx context.Context, id string, sessionBytes []byte) error {
	ret := _m.Called(ctx, id, sessionBytes)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok {
		r0 = rf(ctx, id, sessionBytes)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// SetDeviceConnected provides a mock function with given fields: ctx, tenantID, deviceID
func (_m *App) SetDeviceConnected(ctx context.Context, tenantID string, deviceID string) (int64, error) {
	ret := _m.Called(ctx, tenantID, deviceID)

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

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

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

	return r0, r1
}

// SetDeviceDisconnected provides a mock function with given fields: ctx, tenantID, deviceID, version
func (_m *App) SetDeviceDisconnected(ctx context.Context, tenantID string, deviceID string, version int64) error {
	ret := _m.Called(ctx, tenantID, deviceID, version)

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

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

	return r0
}

// Shutdown provides a mock function with given fields: timeout
func (_m *App) Shutdown(timeout time.Duration) {
	_m.Called(timeout)
}

// ShutdownDone provides a mock function with no fields
func (_m *App) ShutdownDone() {
	_m.Called()
}

// UnregisterConnectionCancelHandle provides a mock function with given fields: handleID
func (_m *App) UnregisterConnectionCancelHandle(handleID uint32) {
	_m.Called(handleID)
}

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

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

	return mock
}
