/*
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 (
	client "sigs.k8s.io/controller-runtime/pkg/client"

	context "context"

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

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

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

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

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

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

	return r0
}

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

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

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

	return r0
}

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

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

	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
}

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

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

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

	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
}

// ListCronJobs provides a mock function with given fields: ctx, namespace, cl
func (_m *CronJob) ListCronJobs(ctx context.Context, namespace string, cl client.ListOptions) (*v1.CronJobList, error) {
	ret := _m.Called(ctx, namespace, cl)

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

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

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

	return r0, r1
}

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

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

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

	return r0
}

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

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

	return mock
}
