// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/core/runtime/cache (interfaces: KeySerializer)

package mocks

import (
	"reflect"
	"time"

	go_version "github.com/hashicorp/go-version"
	pegomock "github.com/petergtz/pegomock"
)

type MockKeySerializer struct {
	fail func(message string, callerSkip ...int)
}

func NewMockKeySerializer(options ...pegomock.Option) *MockKeySerializer {
	mock := &MockKeySerializer{}
	for _, option := range options {
		option.Apply(mock)
	}
	return mock
}

func (mock *MockKeySerializer) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
func (mock *MockKeySerializer) FailHandler() pegomock.FailHandler      { return mock.fail }

func (mock *MockKeySerializer) Serialize(key *go_version.Version) (string, error) {
	if mock == nil {
		panic("mock must not be nil. Use myMock := NewMockKeySerializer().")
	}
	params := []pegomock.Param{key}
	result := pegomock.GetGenericMockFrom(mock).Invoke("Serialize", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
	var ret0 string
	var ret1 error
	if len(result) != 0 {
		if result[0] != nil {
			ret0 = result[0].(string)
		}
		if result[1] != nil {
			ret1 = result[1].(error)
		}
	}
	return ret0, ret1
}

func (mock *MockKeySerializer) VerifyWasCalledOnce() *VerifierMockKeySerializer {
	return &VerifierMockKeySerializer{
		mock:                   mock,
		invocationCountMatcher: pegomock.Times(1),
	}
}

func (mock *MockKeySerializer) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockKeySerializer {
	return &VerifierMockKeySerializer{
		mock:                   mock,
		invocationCountMatcher: invocationCountMatcher,
	}
}

func (mock *MockKeySerializer) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockKeySerializer {
	return &VerifierMockKeySerializer{
		mock:                   mock,
		invocationCountMatcher: invocationCountMatcher,
		inOrderContext:         inOrderContext,
	}
}

func (mock *MockKeySerializer) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockKeySerializer {
	return &VerifierMockKeySerializer{
		mock:                   mock,
		invocationCountMatcher: invocationCountMatcher,
		timeout:                timeout,
	}
}

type VerifierMockKeySerializer struct {
	mock                   *MockKeySerializer
	invocationCountMatcher pegomock.InvocationCountMatcher
	inOrderContext         *pegomock.InOrderContext
	timeout                time.Duration
}

func (verifier *VerifierMockKeySerializer) Serialize(key *go_version.Version) *MockKeySerializer_Serialize_OngoingVerification {
	params := []pegomock.Param{key}
	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Serialize", params, verifier.timeout)
	return &MockKeySerializer_Serialize_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}

type MockKeySerializer_Serialize_OngoingVerification struct {
	mock              *MockKeySerializer
	methodInvocations []pegomock.MethodInvocation
}

func (c *MockKeySerializer_Serialize_OngoingVerification) GetCapturedArguments() *go_version.Version {
	key := c.GetAllCapturedArguments()
	return key[len(key)-1]
}

func (c *MockKeySerializer_Serialize_OngoingVerification) GetAllCapturedArguments() (_param0 []*go_version.Version) {
	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
	if len(params) > 0 {
		_param0 = make([]*go_version.Version, len(c.methodInvocations))
		for u, param := range params[0] {
			_param0[u] = param.(*go_version.Version)
		}
	}
	return
}
