// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package gcs

import (
	"context"

	"cloud.google.com/go/iam/credentials/apiv1/credentialspb"
	"github.com/googleapis/gax-go/v2"
	mock "github.com/stretchr/testify/mock"
	"gitlab.com/gitlab-org/gitlab-runner/common"
)

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

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

	return mock
}

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

type mockCredentialsResolver_Expecter struct {
	mock *mock.Mock
}

func (_m *mockCredentialsResolver) EXPECT() *mockCredentialsResolver_Expecter {
	return &mockCredentialsResolver_Expecter{mock: &_m.Mock}
}

// Credentials provides a mock function for the type mockCredentialsResolver
func (_mock *mockCredentialsResolver) Credentials() *common.CacheGCSCredentials {
	ret := _mock.Called()

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

	var r0 *common.CacheGCSCredentials
	if returnFunc, ok := ret.Get(0).(func() *common.CacheGCSCredentials); ok {
		r0 = returnFunc()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*common.CacheGCSCredentials)
		}
	}
	return r0
}

// mockCredentialsResolver_Credentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Credentials'
type mockCredentialsResolver_Credentials_Call struct {
	*mock.Call
}

// Credentials is a helper method to define mock.On call
func (_e *mockCredentialsResolver_Expecter) Credentials() *mockCredentialsResolver_Credentials_Call {
	return &mockCredentialsResolver_Credentials_Call{Call: _e.mock.On("Credentials")}
}

func (_c *mockCredentialsResolver_Credentials_Call) Run(run func()) *mockCredentialsResolver_Credentials_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *mockCredentialsResolver_Credentials_Call) Return(cacheGCSCredentials *common.CacheGCSCredentials) *mockCredentialsResolver_Credentials_Call {
	_c.Call.Return(cacheGCSCredentials)
	return _c
}

func (_c *mockCredentialsResolver_Credentials_Call) RunAndReturn(run func() *common.CacheGCSCredentials) *mockCredentialsResolver_Credentials_Call {
	_c.Call.Return(run)
	return _c
}

// Resolve provides a mock function for the type mockCredentialsResolver
func (_mock *mockCredentialsResolver) Resolve() error {
	ret := _mock.Called()

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func() error); ok {
		r0 = returnFunc()
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

// mockCredentialsResolver_Resolve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Resolve'
type mockCredentialsResolver_Resolve_Call struct {
	*mock.Call
}

// Resolve is a helper method to define mock.On call
func (_e *mockCredentialsResolver_Expecter) Resolve() *mockCredentialsResolver_Resolve_Call {
	return &mockCredentialsResolver_Resolve_Call{Call: _e.mock.On("Resolve")}
}

func (_c *mockCredentialsResolver_Resolve_Call) Run(run func()) *mockCredentialsResolver_Resolve_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *mockCredentialsResolver_Resolve_Call) Return(err error) *mockCredentialsResolver_Resolve_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *mockCredentialsResolver_Resolve_Call) RunAndReturn(run func() error) *mockCredentialsResolver_Resolve_Call {
	_c.Call.Return(run)
	return _c
}

// SignBytesFunc provides a mock function for the type mockCredentialsResolver
func (_mock *mockCredentialsResolver) SignBytesFunc(context1 context.Context) func([]byte) ([]byte, error) {
	ret := _mock.Called(context1)

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

	var r0 func([]byte) ([]byte, error)
	if returnFunc, ok := ret.Get(0).(func(context.Context) func([]byte) ([]byte, error)); ok {
		r0 = returnFunc(context1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(func([]byte) ([]byte, error))
		}
	}
	return r0
}

// mockCredentialsResolver_SignBytesFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignBytesFunc'
type mockCredentialsResolver_SignBytesFunc_Call struct {
	*mock.Call
}

// SignBytesFunc is a helper method to define mock.On call
//   - context1 context.Context
func (_e *mockCredentialsResolver_Expecter) SignBytesFunc(context1 interface{}) *mockCredentialsResolver_SignBytesFunc_Call {
	return &mockCredentialsResolver_SignBytesFunc_Call{Call: _e.mock.On("SignBytesFunc", context1)}
}

func (_c *mockCredentialsResolver_SignBytesFunc_Call) Run(run func(context1 context.Context)) *mockCredentialsResolver_SignBytesFunc_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *mockCredentialsResolver_SignBytesFunc_Call) Return(fn func([]byte) ([]byte, error)) *mockCredentialsResolver_SignBytesFunc_Call {
	_c.Call.Return(fn)
	return _c
}

func (_c *mockCredentialsResolver_SignBytesFunc_Call) RunAndReturn(run func(context1 context.Context) func([]byte) ([]byte, error)) *mockCredentialsResolver_SignBytesFunc_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}

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

type MockIamCredentialsClient_Expecter struct {
	mock *mock.Mock
}

func (_m *MockIamCredentialsClient) EXPECT() *MockIamCredentialsClient_Expecter {
	return &MockIamCredentialsClient_Expecter{mock: &_m.Mock}
}

// SignBlob provides a mock function for the type MockIamCredentialsClient
func (_mock *MockIamCredentialsClient) SignBlob(context1 context.Context, signBlobRequest *credentialspb.SignBlobRequest, callOptions ...gax.CallOption) (*credentialspb.SignBlobResponse, error) {
	// gax.CallOption
	_va := make([]interface{}, len(callOptions))
	for _i := range callOptions {
		_va[_i] = callOptions[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, context1, signBlobRequest)
	_ca = append(_ca, _va...)
	ret := _mock.Called(_ca...)

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

	var r0 *credentialspb.SignBlobResponse
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *credentialspb.SignBlobRequest, ...gax.CallOption) (*credentialspb.SignBlobResponse, error)); ok {
		return returnFunc(context1, signBlobRequest, callOptions...)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *credentialspb.SignBlobRequest, ...gax.CallOption) *credentialspb.SignBlobResponse); ok {
		r0 = returnFunc(context1, signBlobRequest, callOptions...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*credentialspb.SignBlobResponse)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *credentialspb.SignBlobRequest, ...gax.CallOption) error); ok {
		r1 = returnFunc(context1, signBlobRequest, callOptions...)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// MockIamCredentialsClient_SignBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignBlob'
type MockIamCredentialsClient_SignBlob_Call struct {
	*mock.Call
}

// SignBlob is a helper method to define mock.On call
//   - context1 context.Context
//   - signBlobRequest *credentialspb.SignBlobRequest
//   - callOptions ...gax.CallOption
func (_e *MockIamCredentialsClient_Expecter) SignBlob(context1 interface{}, signBlobRequest interface{}, callOptions ...interface{}) *MockIamCredentialsClient_SignBlob_Call {
	return &MockIamCredentialsClient_SignBlob_Call{Call: _e.mock.On("SignBlob",
		append([]interface{}{context1, signBlobRequest}, callOptions...)...)}
}

func (_c *MockIamCredentialsClient_SignBlob_Call) Run(run func(context1 context.Context, signBlobRequest *credentialspb.SignBlobRequest, callOptions ...gax.CallOption)) *MockIamCredentialsClient_SignBlob_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *credentialspb.SignBlobRequest
		if args[1] != nil {
			arg1 = args[1].(*credentialspb.SignBlobRequest)
		}
		var arg2 []gax.CallOption
		variadicArgs := make([]gax.CallOption, len(args)-2)
		for i, a := range args[2:] {
			if a != nil {
				variadicArgs[i] = a.(gax.CallOption)
			}
		}
		arg2 = variadicArgs
		run(
			arg0,
			arg1,
			arg2...,
		)
	})
	return _c
}

func (_c *MockIamCredentialsClient_SignBlob_Call) Return(signBlobResponse *credentialspb.SignBlobResponse, err error) *MockIamCredentialsClient_SignBlob_Call {
	_c.Call.Return(signBlobResponse, err)
	return _c
}

func (_c *MockIamCredentialsClient_SignBlob_Call) RunAndReturn(run func(context1 context.Context, signBlobRequest *credentialspb.SignBlobRequest, callOptions ...gax.CallOption) (*credentialspb.SignBlobResponse, error)) *MockIamCredentialsClient_SignBlob_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}

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

type MockMetadataClient_Expecter struct {
	mock *mock.Mock
}

func (_m *MockMetadataClient) EXPECT() *MockMetadataClient_Expecter {
	return &MockMetadataClient_Expecter{mock: &_m.Mock}
}

// Email provides a mock function for the type MockMetadataClient
func (_mock *MockMetadataClient) Email(serviceAccount string) (string, error) {
	ret := _mock.Called(serviceAccount)

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

	var r0 string
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(string) (string, error)); ok {
		return returnFunc(serviceAccount)
	}
	if returnFunc, ok := ret.Get(0).(func(string) string); ok {
		r0 = returnFunc(serviceAccount)
	} else {
		r0 = ret.Get(0).(string)
	}
	if returnFunc, ok := ret.Get(1).(func(string) error); ok {
		r1 = returnFunc(serviceAccount)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// MockMetadataClient_Email_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Email'
type MockMetadataClient_Email_Call struct {
	*mock.Call
}

// Email is a helper method to define mock.On call
//   - serviceAccount string
func (_e *MockMetadataClient_Expecter) Email(serviceAccount interface{}) *MockMetadataClient_Email_Call {
	return &MockMetadataClient_Email_Call{Call: _e.mock.On("Email", serviceAccount)}
}

func (_c *MockMetadataClient_Email_Call) Run(run func(serviceAccount string)) *MockMetadataClient_Email_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 string
		if args[0] != nil {
			arg0 = args[0].(string)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *MockMetadataClient_Email_Call) Return(s string, err error) *MockMetadataClient_Email_Call {
	_c.Call.Return(s, err)
	return _c
}

func (_c *MockMetadataClient_Email_Call) RunAndReturn(run func(serviceAccount string) (string, error)) *MockMetadataClient_Email_Call {
	_c.Call.Return(run)
	return _c
}
