/*
Copyright 2024 chideat.

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.
*/

package mocks

import (
	context "context"

	corev1 "k8s.io/api/core/v1"

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

	v1 "k8s.io/api/apps/v1"
)

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

// CreateDeployment provides a mock function with given fields: ctx, namespace, deployment
func (_m *Deployment) CreateDeployment(ctx context.Context, namespace string, deployment *v1.Deployment) error {
	ret := _m.Called(ctx, namespace, deployment)

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

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

	return r0
}

// CreateIfNotExistsDeployment provides a mock function with given fields: ctx, namespace, deploy
func (_m *Deployment) CreateIfNotExistsDeployment(ctx context.Context, namespace string, deploy *v1.Deployment) error {
	ret := _m.Called(ctx, namespace, deploy)

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

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

	return r0
}

// CreateOrUpdateDeployment provides a mock function with given fields: ctx, namespace, deployment
func (_m *Deployment) CreateOrUpdateDeployment(ctx context.Context, namespace string, deployment *v1.Deployment) error {
	ret := _m.Called(ctx, namespace, deployment)

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

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

	return r0
}

// DeleteDeployment provides a mock function with given fields: ctx, namespace, name
func (_m *Deployment) DeleteDeployment(ctx context.Context, namespace string, name string) error {
	ret := _m.Called(ctx, namespace, name)

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

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

	return r0
}

// GetDeployment provides a mock function with given fields: ctx, namespace, name
func (_m *Deployment) GetDeployment(ctx context.Context, namespace string, name string) (*v1.Deployment, error) {
	ret := _m.Called(ctx, namespace, name)

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

	var r0 *v1.Deployment
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1.Deployment, error)); ok {
		return rf(ctx, namespace, name)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1.Deployment); ok {
		r0 = rf(ctx, namespace, name)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v1.Deployment)
		}
	}

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

	return r0, r1
}

// GetDeploymentPods provides a mock function with given fields: ctx, namespace, name
func (_m *Deployment) GetDeploymentPods(ctx context.Context, namespace string, name string) (*corev1.PodList, error) {
	ret := _m.Called(ctx, namespace, name)

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

	var r0 *corev1.PodList
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string) (*corev1.PodList, error)); ok {
		return rf(ctx, namespace, name)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, string) *corev1.PodList); ok {
		r0 = rf(ctx, namespace, name)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*corev1.PodList)
		}
	}

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

	return r0, r1
}

// ListDeployments provides a mock function with given fields: ctx, namespace
func (_m *Deployment) ListDeployments(ctx context.Context, namespace string) (*v1.DeploymentList, error) {
	ret := _m.Called(ctx, namespace)

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

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

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

	return r0, r1
}

// RestartDeployment provides a mock function with given fields: ctx, namespace, name
func (_m *Deployment) RestartDeployment(ctx context.Context, namespace string, name string) (*v1.Deployment, error) {
	ret := _m.Called(ctx, namespace, name)

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

	var r0 *v1.Deployment
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1.Deployment, error)); ok {
		return rf(ctx, namespace, name)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1.Deployment); ok {
		r0 = rf(ctx, namespace, name)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v1.Deployment)
		}
	}

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

	return r0, r1
}

// UpdateDeployment provides a mock function with given fields: ctx, namespace, deployment
func (_m *Deployment) UpdateDeployment(ctx context.Context, namespace string, deployment *v1.Deployment) error {
	ret := _m.Called(ctx, namespace, deployment)

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

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

	return r0
}

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

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

	return mock
}
