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

import (
	"sync"

	"github.com/operator-framework/operator-registry/pkg/appregistry"
)

type FakeManifestDownloader struct {
	DownloadManifestsStub        func(string, string) error
	downloadManifestsMutex       sync.RWMutex
	downloadManifestsArgsForCall []struct {
		arg1 string
		arg2 string
	}
	downloadManifestsReturns struct {
		result1 error
	}
	downloadManifestsReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeManifestDownloader) DownloadManifests(arg1 string, arg2 string) error {
	fake.downloadManifestsMutex.Lock()
	ret, specificReturn := fake.downloadManifestsReturnsOnCall[len(fake.downloadManifestsArgsForCall)]
	fake.downloadManifestsArgsForCall = append(fake.downloadManifestsArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("DownloadManifests", []interface{}{arg1, arg2})
	fake.downloadManifestsMutex.Unlock()
	if fake.DownloadManifestsStub != nil {
		return fake.DownloadManifestsStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.downloadManifestsReturns
	return fakeReturns.result1
}

func (fake *FakeManifestDownloader) DownloadManifestsCallCount() int {
	fake.downloadManifestsMutex.RLock()
	defer fake.downloadManifestsMutex.RUnlock()
	return len(fake.downloadManifestsArgsForCall)
}

func (fake *FakeManifestDownloader) DownloadManifestsCalls(stub func(string, string) error) {
	fake.downloadManifestsMutex.Lock()
	defer fake.downloadManifestsMutex.Unlock()
	fake.DownloadManifestsStub = stub
}

func (fake *FakeManifestDownloader) DownloadManifestsArgsForCall(i int) (string, string) {
	fake.downloadManifestsMutex.RLock()
	defer fake.downloadManifestsMutex.RUnlock()
	argsForCall := fake.downloadManifestsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeManifestDownloader) DownloadManifestsReturns(result1 error) {
	fake.downloadManifestsMutex.Lock()
	defer fake.downloadManifestsMutex.Unlock()
	fake.DownloadManifestsStub = nil
	fake.downloadManifestsReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeManifestDownloader) DownloadManifestsReturnsOnCall(i int, result1 error) {
	fake.downloadManifestsMutex.Lock()
	defer fake.downloadManifestsMutex.Unlock()
	fake.DownloadManifestsStub = nil
	if fake.downloadManifestsReturnsOnCall == nil {
		fake.downloadManifestsReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.downloadManifestsReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeManifestDownloader) 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 _ appregistry.ManifestDownloader = new(FakeManifestDownloader)
