-
Notifications
You must be signed in to change notification settings - Fork 113
/
Client.go
119 lines (97 loc) · 3.44 KB
/
Client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Code generated by mockery v2.36.1. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
)
// Client is an autogenerated mock type for the Client type
type Client struct {
mock.Mock
}
// Create provides a mock function with given fields: ctx, shoot, opts
func (_m *Client) Create(ctx context.Context, shoot *v1beta1.Shoot, opts v1.CreateOptions) (*v1beta1.Shoot, error) {
ret := _m.Called(ctx, shoot, opts)
var r0 *v1beta1.Shoot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *v1beta1.Shoot, v1.CreateOptions) (*v1beta1.Shoot, error)); ok {
return rf(ctx, shoot, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, *v1beta1.Shoot, v1.CreateOptions) *v1beta1.Shoot); ok {
r0 = rf(ctx, shoot, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1beta1.Shoot)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *v1beta1.Shoot, v1.CreateOptions) error); ok {
r1 = rf(ctx, shoot, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Get provides a mock function with given fields: ctx, name, opts
func (_m *Client) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Shoot, error) {
ret := _m.Called(ctx, name, opts)
var r0 *v1beta1.Shoot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, v1.GetOptions) (*v1beta1.Shoot, error)); ok {
return rf(ctx, name, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, string, v1.GetOptions) *v1beta1.Shoot); ok {
r0 = rf(ctx, name, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1beta1.Shoot)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, v1.GetOptions) error); ok {
r1 = rf(ctx, name, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Patch provides a mock function with given fields: ctx, name, pt, data, opts, subresources
func (_m *Client) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (*v1beta1.Shoot, error) {
_va := make([]interface{}, len(subresources))
for _i := range subresources {
_va[_i] = subresources[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, name, pt, data, opts)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *v1beta1.Shoot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.PatchType, []byte, v1.PatchOptions, ...string) (*v1beta1.Shoot, error)); ok {
return rf(ctx, name, pt, data, opts, subresources...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.PatchType, []byte, v1.PatchOptions, ...string) *v1beta1.Shoot); ok {
r0 = rf(ctx, name, pt, data, opts, subresources...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1beta1.Shoot)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.PatchType, []byte, v1.PatchOptions, ...string) error); ok {
r1 = rf(ctx, name, pt, data, opts, subresources...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewClient(t interface {
mock.TestingT
Cleanup(func())
}) *Client {
mock := &Client{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}