// The MIT License (MIT)

// Copyright (c) 2017-2020 Uber Technologies Inc.

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

// Code generated by mockery v2.43.1. DO NOT EDIT.

package mocks

import (
	context "context"

	mock "github.com/stretchr/testify/mock"

	persistence "github.com/uber/cadence/common/persistence"
)

// VisibilityManager is an autogenerated mock type for the VisibilityManager type
type VisibilityManager struct {
	mock.Mock
}

// Close provides a mock function with given fields:
func (_m *VisibilityManager) Close() {
	_m.Called()
}

// CountWorkflowExecutions provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) CountWorkflowExecutions(ctx context.Context, request *persistence.CountWorkflowExecutionsRequest) (*persistence.CountWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for CountWorkflowExecutions")
	}

	var r0 *persistence.CountWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.CountWorkflowExecutionsRequest) (*persistence.CountWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.CountWorkflowExecutionsRequest) *persistence.CountWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.CountWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.CountWorkflowExecutionsRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// DeleteUninitializedWorkflowExecution provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) DeleteUninitializedWorkflowExecution(ctx context.Context, request *persistence.VisibilityDeleteWorkflowExecutionRequest) error {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for DeleteUninitializedWorkflowExecution")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.VisibilityDeleteWorkflowExecutionRequest) error); ok {
		r0 = rf(ctx, request)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// DeleteWorkflowExecution provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) DeleteWorkflowExecution(ctx context.Context, request *persistence.VisibilityDeleteWorkflowExecutionRequest) error {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for DeleteWorkflowExecution")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.VisibilityDeleteWorkflowExecutionRequest) error); ok {
		r0 = rf(ctx, request)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// GetClosedWorkflowExecution provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) GetClosedWorkflowExecution(ctx context.Context, request *persistence.GetClosedWorkflowExecutionRequest) (*persistence.GetClosedWorkflowExecutionResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for GetClosedWorkflowExecution")
	}

	var r0 *persistence.GetClosedWorkflowExecutionResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.GetClosedWorkflowExecutionRequest) (*persistence.GetClosedWorkflowExecutionResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.GetClosedWorkflowExecutionRequest) *persistence.GetClosedWorkflowExecutionResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.GetClosedWorkflowExecutionResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.GetClosedWorkflowExecutionRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetName provides a mock function with given fields:
func (_m *VisibilityManager) GetName() string {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for GetName")
	}

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// ListClosedWorkflowExecutions provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ListClosedWorkflowExecutions(ctx context.Context, request *persistence.ListWorkflowExecutionsRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ListClosedWorkflowExecutions")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListWorkflowExecutionsRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ListClosedWorkflowExecutionsByStatus provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ListClosedWorkflowExecutionsByStatus(ctx context.Context, request *persistence.ListClosedWorkflowExecutionsByStatusRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ListClosedWorkflowExecutionsByStatus")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListClosedWorkflowExecutionsByStatusRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListClosedWorkflowExecutionsByStatusRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListClosedWorkflowExecutionsByStatusRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ListClosedWorkflowExecutionsByType provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ListClosedWorkflowExecutionsByType(ctx context.Context, request *persistence.ListWorkflowExecutionsByTypeRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ListClosedWorkflowExecutionsByType")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByTypeRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByTypeRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListWorkflowExecutionsByTypeRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ListClosedWorkflowExecutionsByWorkflowID provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ListClosedWorkflowExecutionsByWorkflowID(ctx context.Context, request *persistence.ListWorkflowExecutionsByWorkflowIDRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ListClosedWorkflowExecutionsByWorkflowID")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByWorkflowIDRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByWorkflowIDRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListWorkflowExecutionsByWorkflowIDRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ListOpenWorkflowExecutions provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ListOpenWorkflowExecutions(ctx context.Context, request *persistence.ListWorkflowExecutionsRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ListOpenWorkflowExecutions")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListWorkflowExecutionsRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ListOpenWorkflowExecutionsByType provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ListOpenWorkflowExecutionsByType(ctx context.Context, request *persistence.ListWorkflowExecutionsByTypeRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ListOpenWorkflowExecutionsByType")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByTypeRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByTypeRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListWorkflowExecutionsByTypeRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ListOpenWorkflowExecutionsByWorkflowID provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ListOpenWorkflowExecutionsByWorkflowID(ctx context.Context, request *persistence.ListWorkflowExecutionsByWorkflowIDRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ListOpenWorkflowExecutionsByWorkflowID")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByWorkflowIDRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByWorkflowIDRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListWorkflowExecutionsByWorkflowIDRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ListWorkflowExecutions provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ListWorkflowExecutions(ctx context.Context, request *persistence.ListWorkflowExecutionsByQueryRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ListWorkflowExecutions")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByQueryRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByQueryRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListWorkflowExecutionsByQueryRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// RecordWorkflowExecutionClosed provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) RecordWorkflowExecutionClosed(ctx context.Context, request *persistence.RecordWorkflowExecutionClosedRequest) error {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for RecordWorkflowExecutionClosed")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.RecordWorkflowExecutionClosedRequest) error); ok {
		r0 = rf(ctx, request)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// RecordWorkflowExecutionStarted provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) RecordWorkflowExecutionStarted(ctx context.Context, request *persistence.RecordWorkflowExecutionStartedRequest) error {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for RecordWorkflowExecutionStarted")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.RecordWorkflowExecutionStartedRequest) error); ok {
		r0 = rf(ctx, request)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// RecordWorkflowExecutionUninitialized provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) RecordWorkflowExecutionUninitialized(ctx context.Context, request *persistence.RecordWorkflowExecutionUninitializedRequest) error {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for RecordWorkflowExecutionUninitialized")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.RecordWorkflowExecutionUninitializedRequest) error); ok {
		r0 = rf(ctx, request)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// ScanWorkflowExecutions provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) ScanWorkflowExecutions(ctx context.Context, request *persistence.ListWorkflowExecutionsByQueryRequest) (*persistence.ListWorkflowExecutionsResponse, error) {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for ScanWorkflowExecutions")
	}

	var r0 *persistence.ListWorkflowExecutionsResponse
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByQueryRequest) (*persistence.ListWorkflowExecutionsResponse, error)); ok {
		return rf(ctx, request)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.ListWorkflowExecutionsByQueryRequest) *persistence.ListWorkflowExecutionsResponse); ok {
		r0 = rf(ctx, request)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*persistence.ListWorkflowExecutionsResponse)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *persistence.ListWorkflowExecutionsByQueryRequest) error); ok {
		r1 = rf(ctx, request)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// UpsertWorkflowExecution provides a mock function with given fields: ctx, request
func (_m *VisibilityManager) UpsertWorkflowExecution(ctx context.Context, request *persistence.UpsertWorkflowExecutionRequest) error {
	ret := _m.Called(ctx, request)

	if len(ret) == 0 {
		panic("no return value specified for UpsertWorkflowExecution")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *persistence.UpsertWorkflowExecutionRequest) error); ok {
		r0 = rf(ctx, request)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// NewVisibilityManager creates a new instance of VisibilityManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewVisibilityManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *VisibilityManager {
	mock := &VisibilityManager{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
