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

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/commands/service"
	"code.cloudfoundry.org/cli/cf/models"
)

type FakeBinder struct {
	BindApplicationStub        func(models.Application, models.ServiceInstance, map[string]interface{}) error
	bindApplicationMutex       sync.RWMutex
	bindApplicationArgsForCall []struct {
		arg1 models.Application
		arg2 models.ServiceInstance
		arg3 map[string]interface{}
	}
	bindApplicationReturns struct {
		result1 error
	}
	bindApplicationReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeBinder) BindApplication(arg1 models.Application, arg2 models.ServiceInstance, arg3 map[string]interface{}) error {
	fake.bindApplicationMutex.Lock()
	ret, specificReturn := fake.bindApplicationReturnsOnCall[len(fake.bindApplicationArgsForCall)]
	fake.bindApplicationArgsForCall = append(fake.bindApplicationArgsForCall, struct {
		arg1 models.Application
		arg2 models.ServiceInstance
		arg3 map[string]interface{}
	}{arg1, arg2, arg3})
	fake.recordInvocation("BindApplication", []interface{}{arg1, arg2, arg3})
	fake.bindApplicationMutex.Unlock()
	if fake.BindApplicationStub != nil {
		return fake.BindApplicationStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.bindApplicationReturns
	return fakeReturns.result1
}

func (fake *FakeBinder) BindApplicationCallCount() int {
	fake.bindApplicationMutex.RLock()
	defer fake.bindApplicationMutex.RUnlock()
	return len(fake.bindApplicationArgsForCall)
}

func (fake *FakeBinder) BindApplicationCalls(stub func(models.Application, models.ServiceInstance, map[string]interface{}) error) {
	fake.bindApplicationMutex.Lock()
	defer fake.bindApplicationMutex.Unlock()
	fake.BindApplicationStub = stub
}

func (fake *FakeBinder) BindApplicationArgsForCall(i int) (models.Application, models.ServiceInstance, map[string]interface{}) {
	fake.bindApplicationMutex.RLock()
	defer fake.bindApplicationMutex.RUnlock()
	argsForCall := fake.bindApplicationArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeBinder) BindApplicationReturns(result1 error) {
	fake.bindApplicationMutex.Lock()
	defer fake.bindApplicationMutex.Unlock()
	fake.BindApplicationStub = nil
	fake.bindApplicationReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeBinder) BindApplicationReturnsOnCall(i int, result1 error) {
	fake.bindApplicationMutex.Lock()
	defer fake.bindApplicationMutex.Unlock()
	fake.BindApplicationStub = nil
	if fake.bindApplicationReturnsOnCall == nil {
		fake.bindApplicationReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.bindApplicationReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeBinder) 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 _ service.Binder = new(FakeBinder)
