diff --git a/Makefile b/Makefile index afcdaf19..9d6277e2 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ CGO_ENABLED := $(or ${CGO_ENABLED},0) GO := go GO111MODULE := on -release:: generate-client gofmt test; +release:: generate-client mocks gofmt test; .PHONY: gofmt gofmt: @@ -25,4 +25,8 @@ golangcicheck: .PHONY: lint lint: golangcicheck - CGO_ENABLED=1 golangci-lint run \ No newline at end of file + CGO_ENABLED=1 golangci-lint run + +.PHONY: mocks +mocks: + docker run --user $$(id -u):$$(id -g) --rm -w /work -v ${PWD}:/work vektra/mockery:v2.7.4 -r --keeptree --inpackage --dir api/client --output test/mocks --all diff --git a/go.sum b/go.sum index ad01766e..b987109f 100644 --- a/go.sum +++ b/go.sum @@ -852,6 +852,7 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/test/mocks/filesystemlayout/ClientOption.go b/test/mocks/filesystemlayout/ClientOption.go new file mode 100644 index 00000000..2af4e516 --- /dev/null +++ b/test/mocks/filesystemlayout/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package filesystemlayout + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/filesystemlayout/ClientService.go b/test/mocks/filesystemlayout/ClientService.go new file mode 100644 index 00000000..2c33c76d --- /dev/null +++ b/test/mocks/filesystemlayout/ClientService.go @@ -0,0 +1,230 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package filesystemlayout + +import ( + filesystemlayout "github.com/metal-stack/metal-go/api/client/filesystemlayout" + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// CreateFilesystemLayout provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) CreateFilesystemLayout(params *filesystemlayout.CreateFilesystemLayoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...filesystemlayout.ClientOption) (*filesystemlayout.CreateFilesystemLayoutCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *filesystemlayout.CreateFilesystemLayoutCreated + if rf, ok := ret.Get(0).(func(*filesystemlayout.CreateFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) *filesystemlayout.CreateFilesystemLayoutCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*filesystemlayout.CreateFilesystemLayoutCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*filesystemlayout.CreateFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeleteFilesystemLayout provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) DeleteFilesystemLayout(params *filesystemlayout.DeleteFilesystemLayoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...filesystemlayout.ClientOption) (*filesystemlayout.DeleteFilesystemLayoutOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *filesystemlayout.DeleteFilesystemLayoutOK + if rf, ok := ret.Get(0).(func(*filesystemlayout.DeleteFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) *filesystemlayout.DeleteFilesystemLayoutOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*filesystemlayout.DeleteFilesystemLayoutOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*filesystemlayout.DeleteFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetFilesystemLayout provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) GetFilesystemLayout(params *filesystemlayout.GetFilesystemLayoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...filesystemlayout.ClientOption) (*filesystemlayout.GetFilesystemLayoutOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *filesystemlayout.GetFilesystemLayoutOK + if rf, ok := ret.Get(0).(func(*filesystemlayout.GetFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) *filesystemlayout.GetFilesystemLayoutOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*filesystemlayout.GetFilesystemLayoutOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*filesystemlayout.GetFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListFilesystemLayouts provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListFilesystemLayouts(params *filesystemlayout.ListFilesystemLayoutsParams, authInfo runtime.ClientAuthInfoWriter, opts ...filesystemlayout.ClientOption) (*filesystemlayout.ListFilesystemLayoutsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *filesystemlayout.ListFilesystemLayoutsOK + if rf, ok := ret.Get(0).(func(*filesystemlayout.ListFilesystemLayoutsParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) *filesystemlayout.ListFilesystemLayoutsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*filesystemlayout.ListFilesystemLayoutsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*filesystemlayout.ListFilesystemLayoutsParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MatchFilesystemLayout provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) MatchFilesystemLayout(params *filesystemlayout.MatchFilesystemLayoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...filesystemlayout.ClientOption) (*filesystemlayout.MatchFilesystemLayoutOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *filesystemlayout.MatchFilesystemLayoutOK + if rf, ok := ret.Get(0).(func(*filesystemlayout.MatchFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) *filesystemlayout.MatchFilesystemLayoutOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*filesystemlayout.MatchFilesystemLayoutOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*filesystemlayout.MatchFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// TryFilesystemLayout provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) TryFilesystemLayout(params *filesystemlayout.TryFilesystemLayoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...filesystemlayout.ClientOption) (*filesystemlayout.TryFilesystemLayoutOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *filesystemlayout.TryFilesystemLayoutOK + if rf, ok := ret.Get(0).(func(*filesystemlayout.TryFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) *filesystemlayout.TryFilesystemLayoutOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*filesystemlayout.TryFilesystemLayoutOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*filesystemlayout.TryFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// UpdateFilesystemLayout provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdateFilesystemLayout(params *filesystemlayout.UpdateFilesystemLayoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...filesystemlayout.ClientOption) (*filesystemlayout.UpdateFilesystemLayoutOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *filesystemlayout.UpdateFilesystemLayoutOK + if rf, ok := ret.Get(0).(func(*filesystemlayout.UpdateFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) *filesystemlayout.UpdateFilesystemLayoutOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*filesystemlayout.UpdateFilesystemLayoutOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*filesystemlayout.UpdateFilesystemLayoutParams, runtime.ClientAuthInfoWriter, ...filesystemlayout.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/firewall/ClientOption.go b/test/mocks/firewall/ClientOption.go new file mode 100644 index 00000000..1b586667 --- /dev/null +++ b/test/mocks/firewall/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package firewall + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/firewall/ClientService.go b/test/mocks/firewall/ClientService.go new file mode 100644 index 00000000..afcc00d1 --- /dev/null +++ b/test/mocks/firewall/ClientService.go @@ -0,0 +1,140 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package firewall + +import ( + firewall "github.com/metal-stack/metal-go/api/client/firewall" + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// AllocateFirewall provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) AllocateFirewall(params *firewall.AllocateFirewallParams, authInfo runtime.ClientAuthInfoWriter, opts ...firewall.ClientOption) (*firewall.AllocateFirewallOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *firewall.AllocateFirewallOK + if rf, ok := ret.Get(0).(func(*firewall.AllocateFirewallParams, runtime.ClientAuthInfoWriter, ...firewall.ClientOption) *firewall.AllocateFirewallOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*firewall.AllocateFirewallOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*firewall.AllocateFirewallParams, runtime.ClientAuthInfoWriter, ...firewall.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindFirewall provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindFirewall(params *firewall.FindFirewallParams, authInfo runtime.ClientAuthInfoWriter, opts ...firewall.ClientOption) (*firewall.FindFirewallOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *firewall.FindFirewallOK + if rf, ok := ret.Get(0).(func(*firewall.FindFirewallParams, runtime.ClientAuthInfoWriter, ...firewall.ClientOption) *firewall.FindFirewallOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*firewall.FindFirewallOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*firewall.FindFirewallParams, runtime.ClientAuthInfoWriter, ...firewall.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindFirewalls provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindFirewalls(params *firewall.FindFirewallsParams, authInfo runtime.ClientAuthInfoWriter, opts ...firewall.ClientOption) (*firewall.FindFirewallsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *firewall.FindFirewallsOK + if rf, ok := ret.Get(0).(func(*firewall.FindFirewallsParams, runtime.ClientAuthInfoWriter, ...firewall.ClientOption) *firewall.FindFirewallsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*firewall.FindFirewallsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*firewall.FindFirewallsParams, runtime.ClientAuthInfoWriter, ...firewall.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListFirewalls provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListFirewalls(params *firewall.ListFirewallsParams, authInfo runtime.ClientAuthInfoWriter, opts ...firewall.ClientOption) (*firewall.ListFirewallsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *firewall.ListFirewallsOK + if rf, ok := ret.Get(0).(func(*firewall.ListFirewallsParams, runtime.ClientAuthInfoWriter, ...firewall.ClientOption) *firewall.ListFirewallsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*firewall.ListFirewallsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*firewall.ListFirewallsParams, runtime.ClientAuthInfoWriter, ...firewall.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} diff --git a/test/mocks/firmware/ClientOption.go b/test/mocks/firmware/ClientOption.go new file mode 100644 index 00000000..21bcfc9b --- /dev/null +++ b/test/mocks/firmware/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package firmware + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/firmware/ClientService.go b/test/mocks/firmware/ClientService.go new file mode 100644 index 00000000..7e451dc0 --- /dev/null +++ b/test/mocks/firmware/ClientService.go @@ -0,0 +1,110 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package firmware + +import ( + firmware "github.com/metal-stack/metal-go/api/client/firmware" + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// ListFirmwares provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListFirmwares(params *firmware.ListFirmwaresParams, authInfo runtime.ClientAuthInfoWriter, opts ...firmware.ClientOption) (*firmware.ListFirmwaresOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *firmware.ListFirmwaresOK + if rf, ok := ret.Get(0).(func(*firmware.ListFirmwaresParams, runtime.ClientAuthInfoWriter, ...firmware.ClientOption) *firmware.ListFirmwaresOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*firmware.ListFirmwaresOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*firmware.ListFirmwaresParams, runtime.ClientAuthInfoWriter, ...firmware.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RemoveFirmware provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) RemoveFirmware(params *firmware.RemoveFirmwareParams, authInfo runtime.ClientAuthInfoWriter, opts ...firmware.ClientOption) (*firmware.RemoveFirmwareOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *firmware.RemoveFirmwareOK + if rf, ok := ret.Get(0).(func(*firmware.RemoveFirmwareParams, runtime.ClientAuthInfoWriter, ...firmware.ClientOption) *firmware.RemoveFirmwareOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*firmware.RemoveFirmwareOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*firmware.RemoveFirmwareParams, runtime.ClientAuthInfoWriter, ...firmware.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UploadFirmware provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UploadFirmware(params *firmware.UploadFirmwareParams, authInfo runtime.ClientAuthInfoWriter, opts ...firmware.ClientOption) (*firmware.UploadFirmwareOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *firmware.UploadFirmwareOK + if rf, ok := ret.Get(0).(func(*firmware.UploadFirmwareParams, runtime.ClientAuthInfoWriter, ...firmware.ClientOption) *firmware.UploadFirmwareOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*firmware.UploadFirmwareOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*firmware.UploadFirmwareParams, runtime.ClientAuthInfoWriter, ...firmware.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/health/ClientOption.go b/test/mocks/health/ClientOption.go new file mode 100644 index 00000000..82b28e77 --- /dev/null +++ b/test/mocks/health/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package health + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/health/ClientService.go b/test/mocks/health/ClientService.go new file mode 100644 index 00000000..bd467258 --- /dev/null +++ b/test/mocks/health/ClientService.go @@ -0,0 +1,50 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package health + +import ( + health "github.com/metal-stack/metal-go/api/client/health" + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// Health provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) Health(params *health.HealthParams, authInfo runtime.ClientAuthInfoWriter, opts ...health.ClientOption) (*health.HealthOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *health.HealthOK + if rf, ok := ret.Get(0).(func(*health.HealthParams, runtime.ClientAuthInfoWriter, ...health.ClientOption) *health.HealthOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*health.HealthOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*health.HealthParams, runtime.ClientAuthInfoWriter, ...health.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} diff --git a/test/mocks/image/ClientOption.go b/test/mocks/image/ClientOption.go new file mode 100644 index 00000000..32c77f35 --- /dev/null +++ b/test/mocks/image/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package image + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/image/ClientService.go b/test/mocks/image/ClientService.go new file mode 100644 index 00000000..657f3a07 --- /dev/null +++ b/test/mocks/image/ClientService.go @@ -0,0 +1,200 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package image + +import ( + image "github.com/metal-stack/metal-go/api/client/image" + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// CreateImage provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) CreateImage(params *image.CreateImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...image.ClientOption) (*image.CreateImageCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *image.CreateImageCreated + if rf, ok := ret.Get(0).(func(*image.CreateImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) *image.CreateImageCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*image.CreateImageCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*image.CreateImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeleteImage provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) DeleteImage(params *image.DeleteImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...image.ClientOption) (*image.DeleteImageOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *image.DeleteImageOK + if rf, ok := ret.Get(0).(func(*image.DeleteImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) *image.DeleteImageOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*image.DeleteImageOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*image.DeleteImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindImage provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindImage(params *image.FindImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...image.ClientOption) (*image.FindImageOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *image.FindImageOK + if rf, ok := ret.Get(0).(func(*image.FindImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) *image.FindImageOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*image.FindImageOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*image.FindImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindLatestImage provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindLatestImage(params *image.FindLatestImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...image.ClientOption) (*image.FindLatestImageOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *image.FindLatestImageOK + if rf, ok := ret.Get(0).(func(*image.FindLatestImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) *image.FindLatestImageOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*image.FindLatestImageOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*image.FindLatestImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListImages provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListImages(params *image.ListImagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...image.ClientOption) (*image.ListImagesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *image.ListImagesOK + if rf, ok := ret.Get(0).(func(*image.ListImagesParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) *image.ListImagesOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*image.ListImagesOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*image.ListImagesParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UpdateImage provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdateImage(params *image.UpdateImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...image.ClientOption) (*image.UpdateImageOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *image.UpdateImageOK + if rf, ok := ret.Get(0).(func(*image.UpdateImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) *image.UpdateImageOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*image.UpdateImageOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*image.UpdateImageParams, runtime.ClientAuthInfoWriter, ...image.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/ip/ClientOption.go b/test/mocks/ip/ClientOption.go new file mode 100644 index 00000000..dffbb1c9 --- /dev/null +++ b/test/mocks/ip/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package ip + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/ip/ClientService.go b/test/mocks/ip/ClientService.go new file mode 100644 index 00000000..6dd8cd1f --- /dev/null +++ b/test/mocks/ip/ClientService.go @@ -0,0 +1,230 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package ip + +import ( + ip "github.com/metal-stack/metal-go/api/client/ip" + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// AllocateIP provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) AllocateIP(params *ip.AllocateIPParams, authInfo runtime.ClientAuthInfoWriter, opts ...ip.ClientOption) (*ip.AllocateIPCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *ip.AllocateIPCreated + if rf, ok := ret.Get(0).(func(*ip.AllocateIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) *ip.AllocateIPCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ip.AllocateIPCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*ip.AllocateIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// AllocateSpecificIP provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) AllocateSpecificIP(params *ip.AllocateSpecificIPParams, authInfo runtime.ClientAuthInfoWriter, opts ...ip.ClientOption) (*ip.AllocateSpecificIPCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *ip.AllocateSpecificIPCreated + if rf, ok := ret.Get(0).(func(*ip.AllocateSpecificIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) *ip.AllocateSpecificIPCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ip.AllocateSpecificIPCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*ip.AllocateSpecificIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindIP provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindIP(params *ip.FindIPParams, authInfo runtime.ClientAuthInfoWriter, opts ...ip.ClientOption) (*ip.FindIPOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *ip.FindIPOK + if rf, ok := ret.Get(0).(func(*ip.FindIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) *ip.FindIPOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ip.FindIPOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*ip.FindIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindIPs provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindIPs(params *ip.FindIPsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ip.ClientOption) (*ip.FindIPsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *ip.FindIPsOK + if rf, ok := ret.Get(0).(func(*ip.FindIPsParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) *ip.FindIPsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ip.FindIPsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*ip.FindIPsParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FreeIP provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FreeIP(params *ip.FreeIPParams, authInfo runtime.ClientAuthInfoWriter, opts ...ip.ClientOption) (*ip.FreeIPOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *ip.FreeIPOK + if rf, ok := ret.Get(0).(func(*ip.FreeIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) *ip.FreeIPOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ip.FreeIPOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*ip.FreeIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListIPs provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListIPs(params *ip.ListIPsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ip.ClientOption) (*ip.ListIPsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *ip.ListIPsOK + if rf, ok := ret.Get(0).(func(*ip.ListIPsParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) *ip.ListIPsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ip.ListIPsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*ip.ListIPsParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UpdateIP provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdateIP(params *ip.UpdateIPParams, authInfo runtime.ClientAuthInfoWriter, opts ...ip.ClientOption) (*ip.UpdateIPOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *ip.UpdateIPOK + if rf, ok := ret.Get(0).(func(*ip.UpdateIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) *ip.UpdateIPOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ip.UpdateIPOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*ip.UpdateIPParams, runtime.ClientAuthInfoWriter, ...ip.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/machine/ClientOption.go b/test/mocks/machine/ClientOption.go new file mode 100644 index 00000000..f7b99921 --- /dev/null +++ b/test/mocks/machine/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package machine + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/machine/ClientService.go b/test/mocks/machine/ClientService.go new file mode 100644 index 00000000..dba97ee9 --- /dev/null +++ b/test/mocks/machine/ClientService.go @@ -0,0 +1,869 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package machine + +import ( + machine "github.com/metal-stack/metal-go/api/client/machine" + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// AbortReinstallMachine provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) AbortReinstallMachine(params *machine.AbortReinstallMachineParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.AbortReinstallMachineOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.AbortReinstallMachineOK + if rf, ok := ret.Get(0).(func(*machine.AbortReinstallMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.AbortReinstallMachineOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.AbortReinstallMachineOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.AbortReinstallMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// AddProvisioningEvent provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) AddProvisioningEvent(params *machine.AddProvisioningEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.AddProvisioningEventOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.AddProvisioningEventOK + if rf, ok := ret.Get(0).(func(*machine.AddProvisioningEventParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.AddProvisioningEventOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.AddProvisioningEventOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.AddProvisioningEventParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// AllocateMachine provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) AllocateMachine(params *machine.AllocateMachineParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.AllocateMachineOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.AllocateMachineOK + if rf, ok := ret.Get(0).(func(*machine.AllocateMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.AllocateMachineOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.AllocateMachineOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.AllocateMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ChassisIdentifyLEDOff provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ChassisIdentifyLEDOff(params *machine.ChassisIdentifyLEDOffParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.ChassisIdentifyLEDOffOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.ChassisIdentifyLEDOffOK + if rf, ok := ret.Get(0).(func(*machine.ChassisIdentifyLEDOffParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.ChassisIdentifyLEDOffOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.ChassisIdentifyLEDOffOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.ChassisIdentifyLEDOffParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ChassisIdentifyLEDOn provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ChassisIdentifyLEDOn(params *machine.ChassisIdentifyLEDOnParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.ChassisIdentifyLEDOnOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.ChassisIdentifyLEDOnOK + if rf, ok := ret.Get(0).(func(*machine.ChassisIdentifyLEDOnParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.ChassisIdentifyLEDOnOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.ChassisIdentifyLEDOnOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.ChassisIdentifyLEDOnParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeleteMachine provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) DeleteMachine(params *machine.DeleteMachineParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.DeleteMachineOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.DeleteMachineOK + if rf, ok := ret.Get(0).(func(*machine.DeleteMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.DeleteMachineOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.DeleteMachineOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.DeleteMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FinalizeAllocation provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FinalizeAllocation(params *machine.FinalizeAllocationParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.FinalizeAllocationOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.FinalizeAllocationOK + if rf, ok := ret.Get(0).(func(*machine.FinalizeAllocationParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.FinalizeAllocationOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.FinalizeAllocationOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.FinalizeAllocationParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindIPMIMachine provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindIPMIMachine(params *machine.FindIPMIMachineParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.FindIPMIMachineOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.FindIPMIMachineOK + if rf, ok := ret.Get(0).(func(*machine.FindIPMIMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.FindIPMIMachineOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.FindIPMIMachineOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.FindIPMIMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindIPMIMachines provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindIPMIMachines(params *machine.FindIPMIMachinesParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.FindIPMIMachinesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.FindIPMIMachinesOK + if rf, ok := ret.Get(0).(func(*machine.FindIPMIMachinesParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.FindIPMIMachinesOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.FindIPMIMachinesOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.FindIPMIMachinesParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindMachine provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindMachine(params *machine.FindMachineParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.FindMachineOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.FindMachineOK + if rf, ok := ret.Get(0).(func(*machine.FindMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.FindMachineOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.FindMachineOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.FindMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindMachines provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindMachines(params *machine.FindMachinesParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.FindMachinesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.FindMachinesOK + if rf, ok := ret.Get(0).(func(*machine.FindMachinesParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.FindMachinesOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.FindMachinesOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.FindMachinesParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FreeMachine provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FreeMachine(params *machine.FreeMachineParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.FreeMachineOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.FreeMachineOK + if rf, ok := ret.Get(0).(func(*machine.FreeMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.FreeMachineOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.FreeMachineOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.FreeMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetMachineConsolePassword provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) GetMachineConsolePassword(params *machine.GetMachineConsolePasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.GetMachineConsolePasswordOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.GetMachineConsolePasswordOK + if rf, ok := ret.Get(0).(func(*machine.GetMachineConsolePasswordParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.GetMachineConsolePasswordOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.GetMachineConsolePasswordOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.GetMachineConsolePasswordParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetProvisioningEventContainer provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) GetProvisioningEventContainer(params *machine.GetProvisioningEventContainerParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.GetProvisioningEventContainerOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.GetProvisioningEventContainerOK + if rf, ok := ret.Get(0).(func(*machine.GetProvisioningEventContainerParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.GetProvisioningEventContainerOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.GetProvisioningEventContainerOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.GetProvisioningEventContainerParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IpmiReport provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) IpmiReport(params *machine.IpmiReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.IpmiReportOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.IpmiReportOK + if rf, ok := ret.Get(0).(func(*machine.IpmiReportParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.IpmiReportOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.IpmiReportOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.IpmiReportParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListMachines provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListMachines(params *machine.ListMachinesParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.ListMachinesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.ListMachinesOK + if rf, ok := ret.Get(0).(func(*machine.ListMachinesParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.ListMachinesOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.ListMachinesOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.ListMachinesParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MachineBios provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) MachineBios(params *machine.MachineBiosParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.MachineBiosOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.MachineBiosOK + if rf, ok := ret.Get(0).(func(*machine.MachineBiosParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.MachineBiosOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.MachineBiosOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.MachineBiosParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MachineCycle provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) MachineCycle(params *machine.MachineCycleParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.MachineCycleOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.MachineCycleOK + if rf, ok := ret.Get(0).(func(*machine.MachineCycleParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.MachineCycleOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.MachineCycleOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.MachineCycleParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MachineDisk provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) MachineDisk(params *machine.MachineDiskParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.MachineDiskOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.MachineDiskOK + if rf, ok := ret.Get(0).(func(*machine.MachineDiskParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.MachineDiskOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.MachineDiskOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.MachineDiskParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MachineOff provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) MachineOff(params *machine.MachineOffParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.MachineOffOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.MachineOffOK + if rf, ok := ret.Get(0).(func(*machine.MachineOffParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.MachineOffOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.MachineOffOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.MachineOffParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MachineOn provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) MachineOn(params *machine.MachineOnParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.MachineOnOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.MachineOnOK + if rf, ok := ret.Get(0).(func(*machine.MachineOnParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.MachineOnOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.MachineOnOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.MachineOnParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MachinePxe provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) MachinePxe(params *machine.MachinePxeParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.MachinePxeOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.MachinePxeOK + if rf, ok := ret.Get(0).(func(*machine.MachinePxeParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.MachinePxeOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.MachinePxeOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.MachinePxeParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MachineReset provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) MachineReset(params *machine.MachineResetParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.MachineResetOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.MachineResetOK + if rf, ok := ret.Get(0).(func(*machine.MachineResetParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.MachineResetOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.MachineResetOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.MachineResetParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RegisterMachine provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) RegisterMachine(params *machine.RegisterMachineParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.RegisterMachineOK, *machine.RegisterMachineCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.RegisterMachineOK + if rf, ok := ret.Get(0).(func(*machine.RegisterMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.RegisterMachineOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.RegisterMachineOK) + } + } + + var r1 *machine.RegisterMachineCreated + if rf, ok := ret.Get(1).(func(*machine.RegisterMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.RegisterMachineCreated); ok { + r1 = rf(params, authInfo, opts...) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*machine.RegisterMachineCreated) + } + } + + var r2 error + if rf, ok := ret.Get(2).(func(*machine.RegisterMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r2 = rf(params, authInfo, opts...) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ReinstallMachine provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ReinstallMachine(params *machine.ReinstallMachineParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.ReinstallMachineOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.ReinstallMachineOK + if rf, ok := ret.Get(0).(func(*machine.ReinstallMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.ReinstallMachineOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.ReinstallMachineOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.ReinstallMachineParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetChassisIdentifyLEDState provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) SetChassisIdentifyLEDState(params *machine.SetChassisIdentifyLEDStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.SetChassisIdentifyLEDStateOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.SetChassisIdentifyLEDStateOK + if rf, ok := ret.Get(0).(func(*machine.SetChassisIdentifyLEDStateParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.SetChassisIdentifyLEDStateOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.SetChassisIdentifyLEDStateOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.SetChassisIdentifyLEDStateParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetMachineState provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) SetMachineState(params *machine.SetMachineStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.SetMachineStateOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.SetMachineStateOK + if rf, ok := ret.Get(0).(func(*machine.SetMachineStateParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.SetMachineStateOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.SetMachineStateOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.SetMachineStateParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UpdateFirmware provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdateFirmware(params *machine.UpdateFirmwareParams, authInfo runtime.ClientAuthInfoWriter, opts ...machine.ClientOption) (*machine.UpdateFirmwareOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *machine.UpdateFirmwareOK + if rf, ok := ret.Get(0).(func(*machine.UpdateFirmwareParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) *machine.UpdateFirmwareOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*machine.UpdateFirmwareOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*machine.UpdateFirmwareParams, runtime.ClientAuthInfoWriter, ...machine.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/network/ClientOption.go b/test/mocks/network/ClientOption.go new file mode 100644 index 00000000..e5119c13 --- /dev/null +++ b/test/mocks/network/ClientOption.go @@ -0,0 +1,19 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package network + +import ( + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/network/ClientService.go b/test/mocks/network/ClientService.go new file mode 100644 index 00000000..e8c7cccf --- /dev/null +++ b/test/mocks/network/ClientService.go @@ -0,0 +1,259 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package network + +import ( + runtime "github.com/go-openapi/runtime" + network "github.com/metal-stack/metal-go/api/client/network" + mock "github.com/stretchr/testify/mock" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// AllocateNetwork provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) AllocateNetwork(params *network.AllocateNetworkParams, authInfo runtime.ClientAuthInfoWriter, opts ...network.ClientOption) (*network.AllocateNetworkCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *network.AllocateNetworkCreated + if rf, ok := ret.Get(0).(func(*network.AllocateNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) *network.AllocateNetworkCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*network.AllocateNetworkCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*network.AllocateNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CreateNetwork provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) CreateNetwork(params *network.CreateNetworkParams, authInfo runtime.ClientAuthInfoWriter, opts ...network.ClientOption) (*network.CreateNetworkCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *network.CreateNetworkCreated + if rf, ok := ret.Get(0).(func(*network.CreateNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) *network.CreateNetworkCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*network.CreateNetworkCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*network.CreateNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeleteNetwork provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) DeleteNetwork(params *network.DeleteNetworkParams, authInfo runtime.ClientAuthInfoWriter, opts ...network.ClientOption) (*network.DeleteNetworkOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *network.DeleteNetworkOK + if rf, ok := ret.Get(0).(func(*network.DeleteNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) *network.DeleteNetworkOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*network.DeleteNetworkOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*network.DeleteNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindNetwork provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindNetwork(params *network.FindNetworkParams, authInfo runtime.ClientAuthInfoWriter, opts ...network.ClientOption) (*network.FindNetworkOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *network.FindNetworkOK + if rf, ok := ret.Get(0).(func(*network.FindNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) *network.FindNetworkOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*network.FindNetworkOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*network.FindNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindNetworks provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindNetworks(params *network.FindNetworksParams, authInfo runtime.ClientAuthInfoWriter, opts ...network.ClientOption) (*network.FindNetworksOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *network.FindNetworksOK + if rf, ok := ret.Get(0).(func(*network.FindNetworksParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) *network.FindNetworksOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*network.FindNetworksOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*network.FindNetworksParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FreeNetwork provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FreeNetwork(params *network.FreeNetworkParams, authInfo runtime.ClientAuthInfoWriter, opts ...network.ClientOption) (*network.FreeNetworkOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *network.FreeNetworkOK + if rf, ok := ret.Get(0).(func(*network.FreeNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) *network.FreeNetworkOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*network.FreeNetworkOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*network.FreeNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListNetworks provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListNetworks(params *network.ListNetworksParams, authInfo runtime.ClientAuthInfoWriter, opts ...network.ClientOption) (*network.ListNetworksOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *network.ListNetworksOK + if rf, ok := ret.Get(0).(func(*network.ListNetworksParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) *network.ListNetworksOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*network.ListNetworksOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*network.ListNetworksParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UpdateNetwork provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdateNetwork(params *network.UpdateNetworkParams, authInfo runtime.ClientAuthInfoWriter, opts ...network.ClientOption) (*network.UpdateNetworkOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *network.UpdateNetworkOK + if rf, ok := ret.Get(0).(func(*network.UpdateNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) *network.UpdateNetworkOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*network.UpdateNetworkOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*network.UpdateNetworkParams, runtime.ClientAuthInfoWriter, ...network.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/partition/ClientOption.go b/test/mocks/partition/ClientOption.go new file mode 100644 index 00000000..015e4e2a --- /dev/null +++ b/test/mocks/partition/ClientOption.go @@ -0,0 +1,19 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package partition + +import ( + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/partition/ClientService.go b/test/mocks/partition/ClientService.go new file mode 100644 index 00000000..5e1e06a2 --- /dev/null +++ b/test/mocks/partition/ClientService.go @@ -0,0 +1,199 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package partition + +import ( + runtime "github.com/go-openapi/runtime" + partition "github.com/metal-stack/metal-go/api/client/partition" + mock "github.com/stretchr/testify/mock" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// CreatePartition provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) CreatePartition(params *partition.CreatePartitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...partition.ClientOption) (*partition.CreatePartitionCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *partition.CreatePartitionCreated + if rf, ok := ret.Get(0).(func(*partition.CreatePartitionParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) *partition.CreatePartitionCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*partition.CreatePartitionCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*partition.CreatePartitionParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeletePartition provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) DeletePartition(params *partition.DeletePartitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...partition.ClientOption) (*partition.DeletePartitionOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *partition.DeletePartitionOK + if rf, ok := ret.Get(0).(func(*partition.DeletePartitionParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) *partition.DeletePartitionOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*partition.DeletePartitionOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*partition.DeletePartitionParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindPartition provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindPartition(params *partition.FindPartitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...partition.ClientOption) (*partition.FindPartitionOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *partition.FindPartitionOK + if rf, ok := ret.Get(0).(func(*partition.FindPartitionParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) *partition.FindPartitionOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*partition.FindPartitionOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*partition.FindPartitionParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListPartitions provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListPartitions(params *partition.ListPartitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...partition.ClientOption) (*partition.ListPartitionsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *partition.ListPartitionsOK + if rf, ok := ret.Get(0).(func(*partition.ListPartitionsParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) *partition.ListPartitionsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*partition.ListPartitionsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*partition.ListPartitionsParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PartitionCapacity provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) PartitionCapacity(params *partition.PartitionCapacityParams, authInfo runtime.ClientAuthInfoWriter, opts ...partition.ClientOption) (*partition.PartitionCapacityOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *partition.PartitionCapacityOK + if rf, ok := ret.Get(0).(func(*partition.PartitionCapacityParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) *partition.PartitionCapacityOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*partition.PartitionCapacityOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*partition.PartitionCapacityParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UpdatePartition provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdatePartition(params *partition.UpdatePartitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...partition.ClientOption) (*partition.UpdatePartitionOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *partition.UpdatePartitionOK + if rf, ok := ret.Get(0).(func(*partition.UpdatePartitionParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) *partition.UpdatePartitionOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*partition.UpdatePartitionOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*partition.UpdatePartitionParams, runtime.ClientAuthInfoWriter, ...partition.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/project/ClientOption.go b/test/mocks/project/ClientOption.go new file mode 100644 index 00000000..d70d0727 --- /dev/null +++ b/test/mocks/project/ClientOption.go @@ -0,0 +1,19 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package project + +import ( + mock "github.com/stretchr/testify/mock" + + runtime "github.com/go-openapi/runtime" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/project/ClientService.go b/test/mocks/project/ClientService.go new file mode 100644 index 00000000..109adbc0 --- /dev/null +++ b/test/mocks/project/ClientService.go @@ -0,0 +1,199 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package project + +import ( + runtime "github.com/go-openapi/runtime" + project "github.com/metal-stack/metal-go/api/client/project" + mock "github.com/stretchr/testify/mock" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// CreateProject provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) CreateProject(params *project.CreateProjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...project.ClientOption) (*project.CreateProjectCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *project.CreateProjectCreated + if rf, ok := ret.Get(0).(func(*project.CreateProjectParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) *project.CreateProjectCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*project.CreateProjectCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*project.CreateProjectParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeleteProject provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) DeleteProject(params *project.DeleteProjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...project.ClientOption) (*project.DeleteProjectOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *project.DeleteProjectOK + if rf, ok := ret.Get(0).(func(*project.DeleteProjectParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) *project.DeleteProjectOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*project.DeleteProjectOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*project.DeleteProjectParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindProject provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindProject(params *project.FindProjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...project.ClientOption) (*project.FindProjectOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *project.FindProjectOK + if rf, ok := ret.Get(0).(func(*project.FindProjectParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) *project.FindProjectOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*project.FindProjectOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*project.FindProjectParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindProjects provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindProjects(params *project.FindProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...project.ClientOption) (*project.FindProjectsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *project.FindProjectsOK + if rf, ok := ret.Get(0).(func(*project.FindProjectsParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) *project.FindProjectsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*project.FindProjectsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*project.FindProjectsParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListProjects provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListProjects(params *project.ListProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...project.ClientOption) (*project.ListProjectsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *project.ListProjectsOK + if rf, ok := ret.Get(0).(func(*project.ListProjectsParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) *project.ListProjectsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*project.ListProjectsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*project.ListProjectsParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UpdateProject provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdateProject(params *project.UpdateProjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...project.ClientOption) (*project.UpdateProjectOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *project.UpdateProjectOK + if rf, ok := ret.Get(0).(func(*project.UpdateProjectParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) *project.UpdateProjectOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*project.UpdateProjectOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*project.UpdateProjectParams, runtime.ClientAuthInfoWriter, ...project.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/size/ClientOption.go b/test/mocks/size/ClientOption.go new file mode 100644 index 00000000..96161f10 --- /dev/null +++ b/test/mocks/size/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package size + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/size/ClientService.go b/test/mocks/size/ClientService.go new file mode 100644 index 00000000..fb274076 --- /dev/null +++ b/test/mocks/size/ClientService.go @@ -0,0 +1,200 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package size + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" + + size "github.com/metal-stack/metal-go/api/client/size" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// CreateSize provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) CreateSize(params *size.CreateSizeParams, authInfo runtime.ClientAuthInfoWriter, opts ...size.ClientOption) (*size.CreateSizeCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *size.CreateSizeCreated + if rf, ok := ret.Get(0).(func(*size.CreateSizeParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) *size.CreateSizeCreated); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*size.CreateSizeCreated) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*size.CreateSizeParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeleteSize provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) DeleteSize(params *size.DeleteSizeParams, authInfo runtime.ClientAuthInfoWriter, opts ...size.ClientOption) (*size.DeleteSizeOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *size.DeleteSizeOK + if rf, ok := ret.Get(0).(func(*size.DeleteSizeParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) *size.DeleteSizeOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*size.DeleteSizeOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*size.DeleteSizeParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindSize provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindSize(params *size.FindSizeParams, authInfo runtime.ClientAuthInfoWriter, opts ...size.ClientOption) (*size.FindSizeOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *size.FindSizeOK + if rf, ok := ret.Get(0).(func(*size.FindSizeParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) *size.FindSizeOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*size.FindSizeOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*size.FindSizeParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FromHardware provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FromHardware(params *size.FromHardwareParams, authInfo runtime.ClientAuthInfoWriter, opts ...size.ClientOption) (*size.FromHardwareOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *size.FromHardwareOK + if rf, ok := ret.Get(0).(func(*size.FromHardwareParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) *size.FromHardwareOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*size.FromHardwareOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*size.FromHardwareParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListSizes provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListSizes(params *size.ListSizesParams, authInfo runtime.ClientAuthInfoWriter, opts ...size.ClientOption) (*size.ListSizesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *size.ListSizesOK + if rf, ok := ret.Get(0).(func(*size.ListSizesParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) *size.ListSizesOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*size.ListSizesOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*size.ListSizesParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UpdateSize provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdateSize(params *size.UpdateSizeParams, authInfo runtime.ClientAuthInfoWriter, opts ...size.ClientOption) (*size.UpdateSizeOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *size.UpdateSizeOK + if rf, ok := ret.Get(0).(func(*size.UpdateSizeParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) *size.UpdateSizeOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*size.UpdateSizeOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*size.UpdateSizeParams, runtime.ClientAuthInfoWriter, ...size.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/switch_operations/ClientOption.go b/test/mocks/switch_operations/ClientOption.go new file mode 100644 index 00000000..3e4a386f --- /dev/null +++ b/test/mocks/switch_operations/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package switch_operations + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/switch_operations/ClientService.go b/test/mocks/switch_operations/ClientService.go new file mode 100644 index 00000000..c2e44ff1 --- /dev/null +++ b/test/mocks/switch_operations/ClientService.go @@ -0,0 +1,209 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package switch_operations + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" + + switch_operations "github.com/metal-stack/metal-go/api/client/switch_operations" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// DeleteSwitch provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) DeleteSwitch(params *switch_operations.DeleteSwitchParams, authInfo runtime.ClientAuthInfoWriter, opts ...switch_operations.ClientOption) (*switch_operations.DeleteSwitchOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *switch_operations.DeleteSwitchOK + if rf, ok := ret.Get(0).(func(*switch_operations.DeleteSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) *switch_operations.DeleteSwitchOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*switch_operations.DeleteSwitchOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*switch_operations.DeleteSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FindSwitch provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) FindSwitch(params *switch_operations.FindSwitchParams, authInfo runtime.ClientAuthInfoWriter, opts ...switch_operations.ClientOption) (*switch_operations.FindSwitchOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *switch_operations.FindSwitchOK + if rf, ok := ret.Get(0).(func(*switch_operations.FindSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) *switch_operations.FindSwitchOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*switch_operations.FindSwitchOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*switch_operations.FindSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListSwitches provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListSwitches(params *switch_operations.ListSwitchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...switch_operations.ClientOption) (*switch_operations.ListSwitchesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *switch_operations.ListSwitchesOK + if rf, ok := ret.Get(0).(func(*switch_operations.ListSwitchesParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) *switch_operations.ListSwitchesOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*switch_operations.ListSwitchesOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*switch_operations.ListSwitchesParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NotifySwitch provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) NotifySwitch(params *switch_operations.NotifySwitchParams, authInfo runtime.ClientAuthInfoWriter, opts ...switch_operations.ClientOption) (*switch_operations.NotifySwitchOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *switch_operations.NotifySwitchOK + if rf, ok := ret.Get(0).(func(*switch_operations.NotifySwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) *switch_operations.NotifySwitchOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*switch_operations.NotifySwitchOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*switch_operations.NotifySwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RegisterSwitch provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) RegisterSwitch(params *switch_operations.RegisterSwitchParams, authInfo runtime.ClientAuthInfoWriter, opts ...switch_operations.ClientOption) (*switch_operations.RegisterSwitchOK, *switch_operations.RegisterSwitchCreated, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *switch_operations.RegisterSwitchOK + if rf, ok := ret.Get(0).(func(*switch_operations.RegisterSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) *switch_operations.RegisterSwitchOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*switch_operations.RegisterSwitchOK) + } + } + + var r1 *switch_operations.RegisterSwitchCreated + if rf, ok := ret.Get(1).(func(*switch_operations.RegisterSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) *switch_operations.RegisterSwitchCreated); ok { + r1 = rf(params, authInfo, opts...) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*switch_operations.RegisterSwitchCreated) + } + } + + var r2 error + if rf, ok := ret.Get(2).(func(*switch_operations.RegisterSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) error); ok { + r2 = rf(params, authInfo, opts...) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +// UpdateSwitch provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) UpdateSwitch(params *switch_operations.UpdateSwitchParams, authInfo runtime.ClientAuthInfoWriter, opts ...switch_operations.ClientOption) (*switch_operations.UpdateSwitchOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *switch_operations.UpdateSwitchOK + if rf, ok := ret.Get(0).(func(*switch_operations.UpdateSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) *switch_operations.UpdateSwitchOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*switch_operations.UpdateSwitchOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*switch_operations.UpdateSwitchParams, runtime.ClientAuthInfoWriter, ...switch_operations.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/test/mocks/tenant/ClientOption.go b/test/mocks/tenant/ClientOption.go new file mode 100644 index 00000000..aaf8617b --- /dev/null +++ b/test/mocks/tenant/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package tenant + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/tenant/ClientService.go b/test/mocks/tenant/ClientService.go new file mode 100644 index 00000000..91fd14d1 --- /dev/null +++ b/test/mocks/tenant/ClientService.go @@ -0,0 +1,80 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package tenant + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" + + tenant "github.com/metal-stack/metal-go/api/client/tenant" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// GetTenant provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) GetTenant(params *tenant.GetTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...tenant.ClientOption) (*tenant.GetTenantOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *tenant.GetTenantOK + if rf, ok := ret.Get(0).(func(*tenant.GetTenantParams, runtime.ClientAuthInfoWriter, ...tenant.ClientOption) *tenant.GetTenantOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*tenant.GetTenantOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*tenant.GetTenantParams, runtime.ClientAuthInfoWriter, ...tenant.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListTenants provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) ListTenants(params *tenant.ListTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...tenant.ClientOption) (*tenant.ListTenantsOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *tenant.ListTenantsOK + if rf, ok := ret.Get(0).(func(*tenant.ListTenantsParams, runtime.ClientAuthInfoWriter, ...tenant.ClientOption) *tenant.ListTenantsOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*tenant.ListTenantsOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*tenant.ListTenantsParams, runtime.ClientAuthInfoWriter, ...tenant.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} diff --git a/test/mocks/version/ClientOption.go b/test/mocks/version/ClientOption.go new file mode 100644 index 00000000..946e4a24 --- /dev/null +++ b/test/mocks/version/ClientOption.go @@ -0,0 +1,18 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package version + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" +) + +// ClientOption is an autogenerated mock type for the ClientOption type +type ClientOption struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOption) Execute(_a0 *runtime.ClientOperation) { + _m.Called(_a0) +} diff --git a/test/mocks/version/ClientService.go b/test/mocks/version/ClientService.go new file mode 100644 index 00000000..ce052bc9 --- /dev/null +++ b/test/mocks/version/ClientService.go @@ -0,0 +1,50 @@ +// Code generated by mockery v2.7.4. DO NOT EDIT. + +package version + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" + + version "github.com/metal-stack/metal-go/api/client/version" +) + +// ClientService is an autogenerated mock type for the ClientService type +type ClientService struct { + mock.Mock +} + +// Info provides a mock function with given fields: params, authInfo, opts +func (_m *ClientService) Info(params *version.InfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...version.ClientOption) (*version.InfoOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params, authInfo) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *version.InfoOK + if rf, ok := ret.Get(0).(func(*version.InfoParams, runtime.ClientAuthInfoWriter, ...version.ClientOption) *version.InfoOK); ok { + r0 = rf(params, authInfo, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*version.InfoOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*version.InfoParams, runtime.ClientAuthInfoWriter, ...version.ClientOption) error); ok { + r1 = rf(params, authInfo, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *ClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +}