github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/api/automock/api_repository.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package automock 4 5 import ( 6 context "context" 7 8 model "github.com/kyma-incubator/compass/components/director/internal/model" 9 mock "github.com/stretchr/testify/mock" 10 11 resource "github.com/kyma-incubator/compass/components/director/pkg/resource" 12 ) 13 14 // APIRepository is an autogenerated mock type for the APIRepository type 15 type APIRepository struct { 16 mock.Mock 17 } 18 19 // Create provides a mock function with given fields: ctx, tenant, item 20 func (_m *APIRepository) Create(ctx context.Context, tenant string, item *model.APIDefinition) error { 21 ret := _m.Called(ctx, tenant, item) 22 23 var r0 error 24 if rf, ok := ret.Get(0).(func(context.Context, string, *model.APIDefinition) error); ok { 25 r0 = rf(ctx, tenant, item) 26 } else { 27 r0 = ret.Error(0) 28 } 29 30 return r0 31 } 32 33 // CreateGlobal provides a mock function with given fields: ctx, item 34 func (_m *APIRepository) CreateGlobal(ctx context.Context, item *model.APIDefinition) error { 35 ret := _m.Called(ctx, item) 36 37 var r0 error 38 if rf, ok := ret.Get(0).(func(context.Context, *model.APIDefinition) error); ok { 39 r0 = rf(ctx, item) 40 } else { 41 r0 = ret.Error(0) 42 } 43 44 return r0 45 } 46 47 // CreateMany provides a mock function with given fields: ctx, tenant, item 48 func (_m *APIRepository) CreateMany(ctx context.Context, tenant string, item []*model.APIDefinition) error { 49 ret := _m.Called(ctx, tenant, item) 50 51 var r0 error 52 if rf, ok := ret.Get(0).(func(context.Context, string, []*model.APIDefinition) error); ok { 53 r0 = rf(ctx, tenant, item) 54 } else { 55 r0 = ret.Error(0) 56 } 57 58 return r0 59 } 60 61 // Delete provides a mock function with given fields: ctx, tenantID, id 62 func (_m *APIRepository) Delete(ctx context.Context, tenantID string, id string) error { 63 ret := _m.Called(ctx, tenantID, id) 64 65 var r0 error 66 if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { 67 r0 = rf(ctx, tenantID, id) 68 } else { 69 r0 = ret.Error(0) 70 } 71 72 return r0 73 } 74 75 // DeleteAllByBundleID provides a mock function with given fields: ctx, tenantID, bundleID 76 func (_m *APIRepository) DeleteAllByBundleID(ctx context.Context, tenantID string, bundleID string) error { 77 ret := _m.Called(ctx, tenantID, bundleID) 78 79 var r0 error 80 if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { 81 r0 = rf(ctx, tenantID, bundleID) 82 } else { 83 r0 = ret.Error(0) 84 } 85 86 return r0 87 } 88 89 // DeleteGlobal provides a mock function with given fields: ctx, id 90 func (_m *APIRepository) DeleteGlobal(ctx context.Context, id string) error { 91 ret := _m.Called(ctx, id) 92 93 var r0 error 94 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 95 r0 = rf(ctx, id) 96 } else { 97 r0 = ret.Error(0) 98 } 99 100 return r0 101 } 102 103 // Exists provides a mock function with given fields: ctx, tenant, id 104 func (_m *APIRepository) Exists(ctx context.Context, tenant string, id string) (bool, error) { 105 ret := _m.Called(ctx, tenant, id) 106 107 var r0 bool 108 if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { 109 r0 = rf(ctx, tenant, id) 110 } else { 111 r0 = ret.Get(0).(bool) 112 } 113 114 var r1 error 115 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 116 r1 = rf(ctx, tenant, id) 117 } else { 118 r1 = ret.Error(1) 119 } 120 121 return r0, r1 122 } 123 124 // GetByID provides a mock function with given fields: ctx, tenantID, id 125 func (_m *APIRepository) GetByID(ctx context.Context, tenantID string, id string) (*model.APIDefinition, error) { 126 ret := _m.Called(ctx, tenantID, id) 127 128 var r0 *model.APIDefinition 129 if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.APIDefinition); ok { 130 r0 = rf(ctx, tenantID, id) 131 } else { 132 if ret.Get(0) != nil { 133 r0 = ret.Get(0).(*model.APIDefinition) 134 } 135 } 136 137 var r1 error 138 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 139 r1 = rf(ctx, tenantID, id) 140 } else { 141 r1 = ret.Error(1) 142 } 143 144 return r0, r1 145 } 146 147 // GetByIDGlobal provides a mock function with given fields: ctx, id 148 func (_m *APIRepository) GetByIDGlobal(ctx context.Context, id string) (*model.APIDefinition, error) { 149 ret := _m.Called(ctx, id) 150 151 var r0 *model.APIDefinition 152 if rf, ok := ret.Get(0).(func(context.Context, string) *model.APIDefinition); ok { 153 r0 = rf(ctx, id) 154 } else { 155 if ret.Get(0) != nil { 156 r0 = ret.Get(0).(*model.APIDefinition) 157 } 158 } 159 160 var r1 error 161 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 162 r1 = rf(ctx, id) 163 } else { 164 r1 = ret.Error(1) 165 } 166 167 return r0, r1 168 } 169 170 // GetForBundle provides a mock function with given fields: ctx, tenant, id, bundleID 171 func (_m *APIRepository) GetForBundle(ctx context.Context, tenant string, id string, bundleID string) (*model.APIDefinition, error) { 172 ret := _m.Called(ctx, tenant, id, bundleID) 173 174 var r0 *model.APIDefinition 175 if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *model.APIDefinition); ok { 176 r0 = rf(ctx, tenant, id, bundleID) 177 } else { 178 if ret.Get(0) != nil { 179 r0 = ret.Get(0).(*model.APIDefinition) 180 } 181 } 182 183 var r1 error 184 if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { 185 r1 = rf(ctx, tenant, id, bundleID) 186 } else { 187 r1 = ret.Error(1) 188 } 189 190 return r0, r1 191 } 192 193 // ListByApplicationIDPage provides a mock function with given fields: ctx, tenantID, appID, pageSize, cursor 194 func (_m *APIRepository) ListByApplicationIDPage(ctx context.Context, tenantID string, appID string, pageSize int, cursor string) (*model.APIDefinitionPage, error) { 195 ret := _m.Called(ctx, tenantID, appID, pageSize, cursor) 196 197 var r0 *model.APIDefinitionPage 198 if rf, ok := ret.Get(0).(func(context.Context, string, string, int, string) *model.APIDefinitionPage); ok { 199 r0 = rf(ctx, tenantID, appID, pageSize, cursor) 200 } else { 201 if ret.Get(0) != nil { 202 r0 = ret.Get(0).(*model.APIDefinitionPage) 203 } 204 } 205 206 var r1 error 207 if rf, ok := ret.Get(1).(func(context.Context, string, string, int, string) error); ok { 208 r1 = rf(ctx, tenantID, appID, pageSize, cursor) 209 } else { 210 r1 = ret.Error(1) 211 } 212 213 return r0, r1 214 } 215 216 // ListByBundleIDs provides a mock function with given fields: ctx, tenantID, bundleIDs, bundleRefs, counts, pageSize, cursor 217 func (_m *APIRepository) ListByBundleIDs(ctx context.Context, tenantID string, bundleIDs []string, bundleRefs []*model.BundleReference, counts map[string]int, pageSize int, cursor string) ([]*model.APIDefinitionPage, error) { 218 ret := _m.Called(ctx, tenantID, bundleIDs, bundleRefs, counts, pageSize, cursor) 219 220 var r0 []*model.APIDefinitionPage 221 if rf, ok := ret.Get(0).(func(context.Context, string, []string, []*model.BundleReference, map[string]int, int, string) []*model.APIDefinitionPage); ok { 222 r0 = rf(ctx, tenantID, bundleIDs, bundleRefs, counts, pageSize, cursor) 223 } else { 224 if ret.Get(0) != nil { 225 r0 = ret.Get(0).([]*model.APIDefinitionPage) 226 } 227 } 228 229 var r1 error 230 if rf, ok := ret.Get(1).(func(context.Context, string, []string, []*model.BundleReference, map[string]int, int, string) error); ok { 231 r1 = rf(ctx, tenantID, bundleIDs, bundleRefs, counts, pageSize, cursor) 232 } else { 233 r1 = ret.Error(1) 234 } 235 236 return r0, r1 237 } 238 239 // ListByResourceID provides a mock function with given fields: ctx, tenantID, resourceType, resourceID 240 func (_m *APIRepository) ListByResourceID(ctx context.Context, tenantID string, resourceType resource.Type, resourceID string) ([]*model.APIDefinition, error) { 241 ret := _m.Called(ctx, tenantID, resourceType, resourceID) 242 243 var r0 []*model.APIDefinition 244 if rf, ok := ret.Get(0).(func(context.Context, string, resource.Type, string) []*model.APIDefinition); ok { 245 r0 = rf(ctx, tenantID, resourceType, resourceID) 246 } else { 247 if ret.Get(0) != nil { 248 r0 = ret.Get(0).([]*model.APIDefinition) 249 } 250 } 251 252 var r1 error 253 if rf, ok := ret.Get(1).(func(context.Context, string, resource.Type, string) error); ok { 254 r1 = rf(ctx, tenantID, resourceType, resourceID) 255 } else { 256 r1 = ret.Error(1) 257 } 258 259 return r0, r1 260 } 261 262 // Update provides a mock function with given fields: ctx, tenant, item 263 func (_m *APIRepository) Update(ctx context.Context, tenant string, item *model.APIDefinition) error { 264 ret := _m.Called(ctx, tenant, item) 265 266 var r0 error 267 if rf, ok := ret.Get(0).(func(context.Context, string, *model.APIDefinition) error); ok { 268 r0 = rf(ctx, tenant, item) 269 } else { 270 r0 = ret.Error(0) 271 } 272 273 return r0 274 } 275 276 // UpdateGlobal provides a mock function with given fields: ctx, item 277 func (_m *APIRepository) UpdateGlobal(ctx context.Context, item *model.APIDefinition) error { 278 ret := _m.Called(ctx, item) 279 280 var r0 error 281 if rf, ok := ret.Get(0).(func(context.Context, *model.APIDefinition) error); ok { 282 r0 = rf(ctx, item) 283 } else { 284 r0 = ret.Error(0) 285 } 286 287 return r0 288 } 289 290 type mockConstructorTestingTNewAPIRepository interface { 291 mock.TestingT 292 Cleanup(func()) 293 } 294 295 // NewAPIRepository creates a new instance of APIRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 296 func NewAPIRepository(t mockConstructorTestingTNewAPIRepository) *APIRepository { 297 mock := &APIRepository{} 298 mock.Mock.Test(t) 299 300 t.Cleanup(func() { mock.AssertExpectations(t) }) 301 302 return mock 303 }