/
application_template_service.go
337 lines (279 loc) · 10.4 KB
/
application_template_service.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
// Code generated by mockery. DO NOT EDIT.
package automock
import (
context "context"
labelfilter "github.com/kyma-incubator/compass/components/director/internal/labelfilter"
mock "github.com/stretchr/testify/mock"
model "github.com/kyma-incubator/compass/components/director/internal/model"
)
// ApplicationTemplateService is an autogenerated mock type for the ApplicationTemplateService type
type ApplicationTemplateService struct {
mock.Mock
}
// Create provides a mock function with given fields: ctx, in
func (_m *ApplicationTemplateService) Create(ctx context.Context, in model.ApplicationTemplateInput) (string, error) {
ret := _m.Called(ctx, in)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, model.ApplicationTemplateInput) (string, error)); ok {
return rf(ctx, in)
}
if rf, ok := ret.Get(0).(func(context.Context, model.ApplicationTemplateInput) string); ok {
r0 = rf(ctx, in)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, model.ApplicationTemplateInput) error); ok {
r1 = rf(ctx, in)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CreateWithLabels provides a mock function with given fields: ctx, in, labels
func (_m *ApplicationTemplateService) CreateWithLabels(ctx context.Context, in model.ApplicationTemplateInput, labels map[string]interface{}) (string, error) {
ret := _m.Called(ctx, in, labels)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, model.ApplicationTemplateInput, map[string]interface{}) (string, error)); ok {
return rf(ctx, in, labels)
}
if rf, ok := ret.Get(0).(func(context.Context, model.ApplicationTemplateInput, map[string]interface{}) string); ok {
r0 = rf(ctx, in, labels)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, model.ApplicationTemplateInput, map[string]interface{}) error); ok {
r1 = rf(ctx, in, labels)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Delete provides a mock function with given fields: ctx, id
func (_m *ApplicationTemplateService) Delete(ctx context.Context, id string) error {
ret := _m.Called(ctx, id)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// Get provides a mock function with given fields: ctx, id
func (_m *ApplicationTemplateService) Get(ctx context.Context, id string) (*model.ApplicationTemplate, error) {
ret := _m.Called(ctx, id)
var r0 *model.ApplicationTemplate
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*model.ApplicationTemplate, error)); ok {
return rf(ctx, id)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *model.ApplicationTemplate); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.ApplicationTemplate)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetByFilters provides a mock function with given fields: ctx, filter
func (_m *ApplicationTemplateService) GetByFilters(ctx context.Context, filter []*labelfilter.LabelFilter) (*model.ApplicationTemplate, error) {
ret := _m.Called(ctx, filter)
var r0 *model.ApplicationTemplate
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter) (*model.ApplicationTemplate, error)); ok {
return rf(ctx, filter)
}
if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter) *model.ApplicationTemplate); ok {
r0 = rf(ctx, filter)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.ApplicationTemplate)
}
}
if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter) error); ok {
r1 = rf(ctx, filter)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetByNameAndRegion provides a mock function with given fields: ctx, name, region
func (_m *ApplicationTemplateService) GetByNameAndRegion(ctx context.Context, name string, region interface{}) (*model.ApplicationTemplate, error) {
ret := _m.Called(ctx, name, region)
var r0 *model.ApplicationTemplate
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, interface{}) (*model.ApplicationTemplate, error)); ok {
return rf(ctx, name, region)
}
if rf, ok := ret.Get(0).(func(context.Context, string, interface{}) *model.ApplicationTemplate); ok {
r0 = rf(ctx, name, region)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.ApplicationTemplate)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, interface{}) error); ok {
r1 = rf(ctx, name, region)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetLabel provides a mock function with given fields: ctx, appTemplateID, key
func (_m *ApplicationTemplateService) GetLabel(ctx context.Context, appTemplateID string, key string) (*model.Label, error) {
ret := _m.Called(ctx, appTemplateID, key)
var r0 *model.Label
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*model.Label, error)); ok {
return rf(ctx, appTemplateID, key)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Label); ok {
r0 = rf(ctx, appTemplateID, key)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Label)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, appTemplateID, key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: ctx, filter, pageSize, cursor
func (_m *ApplicationTemplateService) List(ctx context.Context, filter []*labelfilter.LabelFilter, pageSize int, cursor string) (model.ApplicationTemplatePage, error) {
ret := _m.Called(ctx, filter, pageSize, cursor)
var r0 model.ApplicationTemplatePage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter, int, string) (model.ApplicationTemplatePage, error)); ok {
return rf(ctx, filter, pageSize, cursor)
}
if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter, int, string) model.ApplicationTemplatePage); ok {
r0 = rf(ctx, filter, pageSize, cursor)
} else {
r0 = ret.Get(0).(model.ApplicationTemplatePage)
}
if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter, int, string) error); ok {
r1 = rf(ctx, filter, pageSize, cursor)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListByFilters provides a mock function with given fields: ctx, filter
func (_m *ApplicationTemplateService) ListByFilters(ctx context.Context, filter []*labelfilter.LabelFilter) ([]*model.ApplicationTemplate, error) {
ret := _m.Called(ctx, filter)
var r0 []*model.ApplicationTemplate
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter) ([]*model.ApplicationTemplate, error)); ok {
return rf(ctx, filter)
}
if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter) []*model.ApplicationTemplate); ok {
r0 = rf(ctx, filter)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.ApplicationTemplate)
}
}
if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter) error); ok {
r1 = rf(ctx, filter)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListByName provides a mock function with given fields: ctx, name
func (_m *ApplicationTemplateService) ListByName(ctx context.Context, name string) ([]*model.ApplicationTemplate, error) {
ret := _m.Called(ctx, name)
var r0 []*model.ApplicationTemplate
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*model.ApplicationTemplate, error)); ok {
return rf(ctx, name)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []*model.ApplicationTemplate); ok {
r0 = rf(ctx, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.ApplicationTemplate)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListLabels provides a mock function with given fields: ctx, appTemplateID
func (_m *ApplicationTemplateService) ListLabels(ctx context.Context, appTemplateID string) (map[string]*model.Label, error) {
ret := _m.Called(ctx, appTemplateID)
var r0 map[string]*model.Label
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (map[string]*model.Label, error)); ok {
return rf(ctx, appTemplateID)
}
if rf, ok := ret.Get(0).(func(context.Context, string) map[string]*model.Label); ok {
r0 = rf(ctx, appTemplateID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]*model.Label)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, appTemplateID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PrepareApplicationCreateInputJSON provides a mock function with given fields: appTemplate, values
func (_m *ApplicationTemplateService) PrepareApplicationCreateInputJSON(appTemplate *model.ApplicationTemplate, values model.ApplicationFromTemplateInputValues) (string, error) {
ret := _m.Called(appTemplate, values)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(*model.ApplicationTemplate, model.ApplicationFromTemplateInputValues) (string, error)); ok {
return rf(appTemplate, values)
}
if rf, ok := ret.Get(0).(func(*model.ApplicationTemplate, model.ApplicationFromTemplateInputValues) string); ok {
r0 = rf(appTemplate, values)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(*model.ApplicationTemplate, model.ApplicationFromTemplateInputValues) error); ok {
r1 = rf(appTemplate, values)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Update provides a mock function with given fields: ctx, id, override, in
func (_m *ApplicationTemplateService) Update(ctx context.Context, id string, override bool, in model.ApplicationTemplateUpdateInput) error {
ret := _m.Called(ctx, id, override, in)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, bool, model.ApplicationTemplateUpdateInput) error); ok {
r0 = rf(ctx, id, override, in)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewApplicationTemplateService creates a new instance of ApplicationTemplateService. 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 NewApplicationTemplateService(t interface {
mock.TestingT
Cleanup(func())
}) *ApplicationTemplateService {
mock := &ApplicationTemplateService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}