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

import (
	"policy-server/api/api_v0"
	"sync"
)

type Validator struct {
	ValidatePoliciesStub        func(policies []api_v0.Policy) error
	validatePoliciesMutex       sync.RWMutex
	validatePoliciesArgsForCall []struct {
		policies []api_v0.Policy
	}
	validatePoliciesReturns struct {
		result1 error
	}
	validatePoliciesReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *Validator) ValidatePolicies(policies []api_v0.Policy) error {
	var policiesCopy []api_v0.Policy
	if policies != nil {
		policiesCopy = make([]api_v0.Policy, len(policies))
		copy(policiesCopy, policies)
	}
	fake.validatePoliciesMutex.Lock()
	ret, specificReturn := fake.validatePoliciesReturnsOnCall[len(fake.validatePoliciesArgsForCall)]
	fake.validatePoliciesArgsForCall = append(fake.validatePoliciesArgsForCall, struct {
		policies []api_v0.Policy
	}{policiesCopy})
	fake.recordInvocation("ValidatePolicies", []interface{}{policiesCopy})
	fake.validatePoliciesMutex.Unlock()
	if fake.ValidatePoliciesStub != nil {
		return fake.ValidatePoliciesStub(policies)
	}
	if specificReturn {
		return ret.result1
	}
	return fake.validatePoliciesReturns.result1
}

func (fake *Validator) ValidatePoliciesCallCount() int {
	fake.validatePoliciesMutex.RLock()
	defer fake.validatePoliciesMutex.RUnlock()
	return len(fake.validatePoliciesArgsForCall)
}

func (fake *Validator) ValidatePoliciesArgsForCall(i int) []api_v0.Policy {
	fake.validatePoliciesMutex.RLock()
	defer fake.validatePoliciesMutex.RUnlock()
	return fake.validatePoliciesArgsForCall[i].policies
}

func (fake *Validator) ValidatePoliciesReturns(result1 error) {
	fake.ValidatePoliciesStub = nil
	fake.validatePoliciesReturns = struct {
		result1 error
	}{result1}
}

func (fake *Validator) ValidatePoliciesReturnsOnCall(i int, result1 error) {
	fake.ValidatePoliciesStub = nil
	if fake.validatePoliciesReturnsOnCall == nil {
		fake.validatePoliciesReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.validatePoliciesReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *Validator) 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)
}
