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

package mocks

import (
	go_version "github.com/hashicorp/go-version"
	pegomock "github.com/petergtz/pegomock/v4"
	models "github.com/runatlantis/atlantis/server/core/runtime/models"
	terraform "github.com/runatlantis/atlantis/server/core/terraform"
	command "github.com/runatlantis/atlantis/server/events/command"
	"reflect"
	"time"
)

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

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

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

func (mock *MockAsyncTFExec) RunCommandAsync(ctx command.ProjectContext, path string, args []string, envs map[string]string, d terraform.Distribution, v *go_version.Version, workspace string) (chan<- string, <-chan models.Line) {
	if mock == nil {
		panic("mock must not be nil. Use myMock := NewMockAsyncTFExec().")
	}
	_params := []pegomock.Param{ctx, path, args, envs, d, v, workspace}
	_result := pegomock.GetGenericMockFrom(mock).Invoke("RunCommandAsync", _params, []reflect.Type{reflect.TypeOf((*chan<- string)(nil)).Elem(), reflect.TypeOf((*<-chan models.Line)(nil)).Elem()})
	var _ret0 chan<- string
	var _ret1 <-chan models.Line
	if len(_result) != 0 {
		if _result[0] != nil {
			var ok bool
			_ret0, ok = _result[0].(chan string)
			if !ok {
				_ret0 = _result[0].(chan<- string)
			}
		}
		if _result[1] != nil {
			var ok bool
			_ret1, ok = _result[1].(chan models.Line)
			if !ok {
				_ret1 = _result[1].(<-chan models.Line)
			}
		}
	}
	return _ret0, _ret1
}

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

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

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

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

type VerifierMockAsyncTFExec struct {
	mock                   *MockAsyncTFExec
	invocationCountMatcher pegomock.InvocationCountMatcher
	inOrderContext         *pegomock.InOrderContext
	timeout                time.Duration
}

func (verifier *VerifierMockAsyncTFExec) RunCommandAsync(ctx command.ProjectContext, path string, args []string, envs map[string]string, d terraform.Distribution, v *go_version.Version, workspace string) *MockAsyncTFExec_RunCommandAsync_OngoingVerification {
	_params := []pegomock.Param{ctx, path, args, envs, d, v, workspace}
	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunCommandAsync", _params, verifier.timeout)
	return &MockAsyncTFExec_RunCommandAsync_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}

type MockAsyncTFExec_RunCommandAsync_OngoingVerification struct {
	mock              *MockAsyncTFExec
	methodInvocations []pegomock.MethodInvocation
}

func (c *MockAsyncTFExec_RunCommandAsync_OngoingVerification) GetCapturedArguments() (command.ProjectContext, string, []string, map[string]string, terraform.Distribution, *go_version.Version, string) {
	ctx, path, args, envs, d, v, workspace := c.GetAllCapturedArguments()
	return ctx[len(ctx)-1], path[len(path)-1], args[len(args)-1], envs[len(envs)-1], d[len(d)-1], v[len(v)-1], workspace[len(workspace)-1]
}

func (c *MockAsyncTFExec_RunCommandAsync_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []string, _param2 [][]string, _param3 []map[string]string, _param4 []terraform.Distribution, _param5 []*go_version.Version, _param6 []string) {
	_params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
	if len(_params) > 0 {
		if len(_params) > 0 {
			_param0 = make([]command.ProjectContext, len(c.methodInvocations))
			for u, param := range _params[0] {
				_param0[u] = param.(command.ProjectContext)
			}
		}
		if len(_params) > 1 {
			_param1 = make([]string, len(c.methodInvocations))
			for u, param := range _params[1] {
				_param1[u] = param.(string)
			}
		}
		if len(_params) > 2 {
			_param2 = make([][]string, len(c.methodInvocations))
			for u, param := range _params[2] {
				_param2[u] = param.([]string)
			}
		}
		if len(_params) > 3 {
			_param3 = make([]map[string]string, len(c.methodInvocations))
			for u, param := range _params[3] {
				_param3[u] = param.(map[string]string)
			}
		}
		if len(_params) > 4 {
			_param4 = make([]terraform.Distribution, len(c.methodInvocations))
			for u, param := range _params[4] {
				_param4[u] = param.(terraform.Distribution)
			}
		}
		if len(_params) > 5 {
			_param5 = make([]*go_version.Version, len(c.methodInvocations))
			for u, param := range _params[5] {
				_param5[u] = param.(*go_version.Version)
			}
		}
		if len(_params) > 6 {
			_param6 = make([]string, len(c.methodInvocations))
			for u, param := range _params[6] {
				_param6[u] = param.(string)
			}
		}
	}
	return
}
