// Code generated by mocker. DO NOT EDIT.
// github.com/travisjeffery/mocker
// Source: object_key.go

package mock

import (
	sync "sync"

	github_com_hashicorp_go_version "github.com/hashicorp/go-version"
)

// ObjectKey is a mock of ObjectKey interface
type ObjectKey struct {
	lockParseVersion sync.Mutex
	ParseVersionFunc func(key, name string) (bool, *github_com_hashicorp_go_version.Version, error)

	lockURLFor sync.Mutex
	URLForFunc func(name, version string) string

	calls struct {
		ParseVersion []struct {
			Key  string
			Name string
		}
		URLFor []struct {
			Name    string
			Version string
		}
	}
}

// ParseVersion mocks base method by wrapping the associated func.
func (m *ObjectKey) ParseVersion(key, name string) (bool, *github_com_hashicorp_go_version.Version, error) {
	m.lockParseVersion.Lock()
	defer m.lockParseVersion.Unlock()

	if m.ParseVersionFunc == nil {
		panic("mocker: ObjectKey.ParseVersionFunc is nil but ObjectKey.ParseVersion was called.")
	}

	call := struct {
		Key  string
		Name string
	}{
		Key:  key,
		Name: name,
	}

	m.calls.ParseVersion = append(m.calls.ParseVersion, call)

	return m.ParseVersionFunc(key, name)
}

// ParseVersionCalled returns true if ParseVersion was called at least once.
func (m *ObjectKey) ParseVersionCalled() bool {
	m.lockParseVersion.Lock()
	defer m.lockParseVersion.Unlock()

	return len(m.calls.ParseVersion) > 0
}

// ParseVersionCalls returns the calls made to ParseVersion.
func (m *ObjectKey) ParseVersionCalls() []struct {
	Key  string
	Name string
} {
	m.lockParseVersion.Lock()
	defer m.lockParseVersion.Unlock()

	return m.calls.ParseVersion
}

// URLFor mocks base method by wrapping the associated func.
func (m *ObjectKey) URLFor(name, version string) string {
	m.lockURLFor.Lock()
	defer m.lockURLFor.Unlock()

	if m.URLForFunc == nil {
		panic("mocker: ObjectKey.URLForFunc is nil but ObjectKey.URLFor was called.")
	}

	call := struct {
		Name    string
		Version string
	}{
		Name:    name,
		Version: version,
	}

	m.calls.URLFor = append(m.calls.URLFor, call)

	return m.URLForFunc(name, version)
}

// URLForCalled returns true if URLFor was called at least once.
func (m *ObjectKey) URLForCalled() bool {
	m.lockURLFor.Lock()
	defer m.lockURLFor.Unlock()

	return len(m.calls.URLFor) > 0
}

// URLForCalls returns the calls made to URLFor.
func (m *ObjectKey) URLForCalls() []struct {
	Name    string
	Version string
} {
	m.lockURLFor.Lock()
	defer m.lockURLFor.Unlock()

	return m.calls.URLFor
}

// Reset resets the calls made to the mocked methods.
func (m *ObjectKey) Reset() {
	m.lockParseVersion.Lock()
	m.calls.ParseVersion = nil
	m.lockParseVersion.Unlock()
	m.lockURLFor.Lock()
	m.calls.URLFor = nil
	m.lockURLFor.Unlock()
}
