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

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/api/appinstances"
	"code.cloudfoundry.org/cli/cf/models"
)

type FakeRepository struct {
	DeleteInstanceStub        func(string, int) error
	deleteInstanceMutex       sync.RWMutex
	deleteInstanceArgsForCall []struct {
		arg1 string
		arg2 int
	}
	deleteInstanceReturns struct {
		result1 error
	}
	deleteInstanceReturnsOnCall map[int]struct {
		result1 error
	}
	GetInstancesStub        func(string) ([]models.AppInstanceFields, error)
	getInstancesMutex       sync.RWMutex
	getInstancesArgsForCall []struct {
		arg1 string
	}
	getInstancesReturns struct {
		result1 []models.AppInstanceFields
		result2 error
	}
	getInstancesReturnsOnCall map[int]struct {
		result1 []models.AppInstanceFields
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRepository) DeleteInstance(arg1 string, arg2 int) error {
	fake.deleteInstanceMutex.Lock()
	ret, specificReturn := fake.deleteInstanceReturnsOnCall[len(fake.deleteInstanceArgsForCall)]
	fake.deleteInstanceArgsForCall = append(fake.deleteInstanceArgsForCall, struct {
		arg1 string
		arg2 int
	}{arg1, arg2})
	fake.recordInvocation("DeleteInstance", []interface{}{arg1, arg2})
	fake.deleteInstanceMutex.Unlock()
	if fake.DeleteInstanceStub != nil {
		return fake.DeleteInstanceStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.deleteInstanceReturns
	return fakeReturns.result1
}

func (fake *FakeRepository) DeleteInstanceCallCount() int {
	fake.deleteInstanceMutex.RLock()
	defer fake.deleteInstanceMutex.RUnlock()
	return len(fake.deleteInstanceArgsForCall)
}

func (fake *FakeRepository) DeleteInstanceCalls(stub func(string, int) error) {
	fake.deleteInstanceMutex.Lock()
	defer fake.deleteInstanceMutex.Unlock()
	fake.DeleteInstanceStub = stub
}

func (fake *FakeRepository) DeleteInstanceArgsForCall(i int) (string, int) {
	fake.deleteInstanceMutex.RLock()
	defer fake.deleteInstanceMutex.RUnlock()
	argsForCall := fake.deleteInstanceArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeRepository) DeleteInstanceReturns(result1 error) {
	fake.deleteInstanceMutex.Lock()
	defer fake.deleteInstanceMutex.Unlock()
	fake.DeleteInstanceStub = nil
	fake.deleteInstanceReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRepository) DeleteInstanceReturnsOnCall(i int, result1 error) {
	fake.deleteInstanceMutex.Lock()
	defer fake.deleteInstanceMutex.Unlock()
	fake.DeleteInstanceStub = nil
	if fake.deleteInstanceReturnsOnCall == nil {
		fake.deleteInstanceReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteInstanceReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeRepository) GetInstances(arg1 string) ([]models.AppInstanceFields, error) {
	fake.getInstancesMutex.Lock()
	ret, specificReturn := fake.getInstancesReturnsOnCall[len(fake.getInstancesArgsForCall)]
	fake.getInstancesArgsForCall = append(fake.getInstancesArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("GetInstances", []interface{}{arg1})
	fake.getInstancesMutex.Unlock()
	if fake.GetInstancesStub != nil {
		return fake.GetInstancesStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getInstancesReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRepository) GetInstancesCallCount() int {
	fake.getInstancesMutex.RLock()
	defer fake.getInstancesMutex.RUnlock()
	return len(fake.getInstancesArgsForCall)
}

func (fake *FakeRepository) GetInstancesCalls(stub func(string) ([]models.AppInstanceFields, error)) {
	fake.getInstancesMutex.Lock()
	defer fake.getInstancesMutex.Unlock()
	fake.GetInstancesStub = stub
}

func (fake *FakeRepository) GetInstancesArgsForCall(i int) string {
	fake.getInstancesMutex.RLock()
	defer fake.getInstancesMutex.RUnlock()
	argsForCall := fake.getInstancesArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRepository) GetInstancesReturns(result1 []models.AppInstanceFields, result2 error) {
	fake.getInstancesMutex.Lock()
	defer fake.getInstancesMutex.Unlock()
	fake.GetInstancesStub = nil
	fake.getInstancesReturns = struct {
		result1 []models.AppInstanceFields
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) GetInstancesReturnsOnCall(i int, result1 []models.AppInstanceFields, result2 error) {
	fake.getInstancesMutex.Lock()
	defer fake.getInstancesMutex.Unlock()
	fake.GetInstancesStub = nil
	if fake.getInstancesReturnsOnCall == nil {
		fake.getInstancesReturnsOnCall = make(map[int]struct {
			result1 []models.AppInstanceFields
			result2 error
		})
	}
	fake.getInstancesReturnsOnCall[i] = struct {
		result1 []models.AppInstanceFields
		result2 error
	}{result1, result2}
}

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

func (fake *FakeRepository) 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 _ appinstances.Repository = new(FakeRepository)
