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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/eirini/bifrost"
	"code.cloudfoundry.org/eirini/models/cf"
)

type FakeStagingCompleter struct {
	CompleteStagingStub        func(context.Context, cf.StagingCompletedRequest) error
	completeStagingMutex       sync.RWMutex
	completeStagingArgsForCall []struct {
		arg1 context.Context
		arg2 cf.StagingCompletedRequest
	}
	completeStagingReturns struct {
		result1 error
	}
	completeStagingReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeStagingCompleter) CompleteStaging(arg1 context.Context, arg2 cf.StagingCompletedRequest) error {
	fake.completeStagingMutex.Lock()
	ret, specificReturn := fake.completeStagingReturnsOnCall[len(fake.completeStagingArgsForCall)]
	fake.completeStagingArgsForCall = append(fake.completeStagingArgsForCall, struct {
		arg1 context.Context
		arg2 cf.StagingCompletedRequest
	}{arg1, arg2})
	stub := fake.CompleteStagingStub
	fakeReturns := fake.completeStagingReturns
	fake.recordInvocation("CompleteStaging", []interface{}{arg1, arg2})
	fake.completeStagingMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeStagingCompleter) CompleteStagingCallCount() int {
	fake.completeStagingMutex.RLock()
	defer fake.completeStagingMutex.RUnlock()
	return len(fake.completeStagingArgsForCall)
}

func (fake *FakeStagingCompleter) CompleteStagingCalls(stub func(context.Context, cf.StagingCompletedRequest) error) {
	fake.completeStagingMutex.Lock()
	defer fake.completeStagingMutex.Unlock()
	fake.CompleteStagingStub = stub
}

func (fake *FakeStagingCompleter) CompleteStagingArgsForCall(i int) (context.Context, cf.StagingCompletedRequest) {
	fake.completeStagingMutex.RLock()
	defer fake.completeStagingMutex.RUnlock()
	argsForCall := fake.completeStagingArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeStagingCompleter) CompleteStagingReturns(result1 error) {
	fake.completeStagingMutex.Lock()
	defer fake.completeStagingMutex.Unlock()
	fake.CompleteStagingStub = nil
	fake.completeStagingReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeStagingCompleter) CompleteStagingReturnsOnCall(i int, result1 error) {
	fake.completeStagingMutex.Lock()
	defer fake.completeStagingMutex.Unlock()
	fake.CompleteStagingStub = nil
	if fake.completeStagingReturnsOnCall == nil {
		fake.completeStagingReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.completeStagingReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeStagingCompleter) 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 _ bifrost.StagingCompleter = new(FakeStagingCompleter)
