// Code generated by counterfeiter. DO NOT EDIT.
package manifestfakes

import (
	"sync"

	"github.com/cloudfoundry/bosh-cli/v7/deployment/manifest"
	"github.com/cloudfoundry/bosh-cli/v7/deployment/template"
)

type FakeParser struct {
	ParseStub        func(template.InterpolatedTemplate, string) (manifest.Manifest, error)
	parseMutex       sync.RWMutex
	parseArgsForCall []struct {
		arg1 template.InterpolatedTemplate
		arg2 string
	}
	parseReturns struct {
		result1 manifest.Manifest
		result2 error
	}
	parseReturnsOnCall map[int]struct {
		result1 manifest.Manifest
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeParser) Parse(arg1 template.InterpolatedTemplate, arg2 string) (manifest.Manifest, error) {
	fake.parseMutex.Lock()
	ret, specificReturn := fake.parseReturnsOnCall[len(fake.parseArgsForCall)]
	fake.parseArgsForCall = append(fake.parseArgsForCall, struct {
		arg1 template.InterpolatedTemplate
		arg2 string
	}{arg1, arg2})
	stub := fake.ParseStub
	fakeReturns := fake.parseReturns
	fake.recordInvocation("Parse", []interface{}{arg1, arg2})
	fake.parseMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeParser) ParseCallCount() int {
	fake.parseMutex.RLock()
	defer fake.parseMutex.RUnlock()
	return len(fake.parseArgsForCall)
}

func (fake *FakeParser) ParseCalls(stub func(template.InterpolatedTemplate, string) (manifest.Manifest, error)) {
	fake.parseMutex.Lock()
	defer fake.parseMutex.Unlock()
	fake.ParseStub = stub
}

func (fake *FakeParser) ParseArgsForCall(i int) (template.InterpolatedTemplate, string) {
	fake.parseMutex.RLock()
	defer fake.parseMutex.RUnlock()
	argsForCall := fake.parseArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeParser) ParseReturns(result1 manifest.Manifest, result2 error) {
	fake.parseMutex.Lock()
	defer fake.parseMutex.Unlock()
	fake.ParseStub = nil
	fake.parseReturns = struct {
		result1 manifest.Manifest
		result2 error
	}{result1, result2}
}

func (fake *FakeParser) ParseReturnsOnCall(i int, result1 manifest.Manifest, result2 error) {
	fake.parseMutex.Lock()
	defer fake.parseMutex.Unlock()
	fake.ParseStub = nil
	if fake.parseReturnsOnCall == nil {
		fake.parseReturnsOnCall = make(map[int]struct {
			result1 manifest.Manifest
			result2 error
		})
	}
	fake.parseReturnsOnCall[i] = struct {
		result1 manifest.Manifest
		result2 error
	}{result1, result2}
}

func (fake *FakeParser) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.parseMutex.RLock()
	defer fake.parseMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeParser) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ manifest.Parser = new(FakeParser)
