github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/api/automock/api_service.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 // APIService is an autogenerated mock type for the APIService type 15 type APIService struct { 16 mock.Mock 17 } 18 19 // CreateInApplication provides a mock function with given fields: ctx, appID, in, spec 20 func (_m *APIService) CreateInApplication(ctx context.Context, appID string, in model.APIDefinitionInput, spec *model.SpecInput) (string, error) { 21 ret := _m.Called(ctx, appID, in, spec) 22 23 var r0 string 24 if rf, ok := ret.Get(0).(func(context.Context, string, model.APIDefinitionInput, *model.SpecInput) string); ok { 25 r0 = rf(ctx, appID, in, spec) 26 } else { 27 r0 = ret.Get(0).(string) 28 } 29 30 var r1 error 31 if rf, ok := ret.Get(1).(func(context.Context, string, model.APIDefinitionInput, *model.SpecInput) error); ok { 32 r1 = rf(ctx, appID, in, spec) 33 } else { 34 r1 = ret.Error(1) 35 } 36 37 return r0, r1 38 } 39 40 // CreateInBundle provides a mock function with given fields: ctx, resourceType, resourceID, bundleID, in, spec 41 func (_m *APIService) CreateInBundle(ctx context.Context, resourceType resource.Type, resourceID string, bundleID string, in model.APIDefinitionInput, spec *model.SpecInput) (string, error) { 42 ret := _m.Called(ctx, resourceType, resourceID, bundleID, in, spec) 43 44 var r0 string 45 if rf, ok := ret.Get(0).(func(context.Context, resource.Type, string, string, model.APIDefinitionInput, *model.SpecInput) string); ok { 46 r0 = rf(ctx, resourceType, resourceID, bundleID, in, spec) 47 } else { 48 r0 = ret.Get(0).(string) 49 } 50 51 var r1 error 52 if rf, ok := ret.Get(1).(func(context.Context, resource.Type, string, string, model.APIDefinitionInput, *model.SpecInput) error); ok { 53 r1 = rf(ctx, resourceType, resourceID, bundleID, in, spec) 54 } else { 55 r1 = ret.Error(1) 56 } 57 58 return r0, r1 59 } 60 61 // Delete provides a mock function with given fields: ctx, resourceType, id 62 func (_m *APIService) Delete(ctx context.Context, resourceType resource.Type, id string) error { 63 ret := _m.Called(ctx, resourceType, id) 64 65 var r0 error 66 if rf, ok := ret.Get(0).(func(context.Context, resource.Type, string) error); ok { 67 r0 = rf(ctx, resourceType, id) 68 } else { 69 r0 = ret.Error(0) 70 } 71 72 return r0 73 } 74 75 // Get provides a mock function with given fields: ctx, id 76 func (_m *APIService) Get(ctx context.Context, id string) (*model.APIDefinition, error) { 77 ret := _m.Called(ctx, id) 78 79 var r0 *model.APIDefinition 80 if rf, ok := ret.Get(0).(func(context.Context, string) *model.APIDefinition); ok { 81 r0 = rf(ctx, id) 82 } else { 83 if ret.Get(0) != nil { 84 r0 = ret.Get(0).(*model.APIDefinition) 85 } 86 } 87 88 var r1 error 89 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 90 r1 = rf(ctx, id) 91 } else { 92 r1 = ret.Error(1) 93 } 94 95 return r0, r1 96 } 97 98 // ListByApplicationID provides a mock function with given fields: ctx, appID 99 func (_m *APIService) ListByApplicationID(ctx context.Context, appID string) ([]*model.APIDefinition, error) { 100 ret := _m.Called(ctx, appID) 101 102 var r0 []*model.APIDefinition 103 if rf, ok := ret.Get(0).(func(context.Context, string) []*model.APIDefinition); ok { 104 r0 = rf(ctx, appID) 105 } else { 106 if ret.Get(0) != nil { 107 r0 = ret.Get(0).([]*model.APIDefinition) 108 } 109 } 110 111 var r1 error 112 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 113 r1 = rf(ctx, appID) 114 } else { 115 r1 = ret.Error(1) 116 } 117 118 return r0, r1 119 } 120 121 // ListByApplicationIDPage provides a mock function with given fields: ctx, appID, pageSize, cursor 122 func (_m *APIService) ListByApplicationIDPage(ctx context.Context, appID string, pageSize int, cursor string) (*model.APIDefinitionPage, error) { 123 ret := _m.Called(ctx, appID, pageSize, cursor) 124 125 var r0 *model.APIDefinitionPage 126 if rf, ok := ret.Get(0).(func(context.Context, string, int, string) *model.APIDefinitionPage); ok { 127 r0 = rf(ctx, appID, pageSize, cursor) 128 } else { 129 if ret.Get(0) != nil { 130 r0 = ret.Get(0).(*model.APIDefinitionPage) 131 } 132 } 133 134 var r1 error 135 if rf, ok := ret.Get(1).(func(context.Context, string, int, string) error); ok { 136 r1 = rf(ctx, appID, pageSize, cursor) 137 } else { 138 r1 = ret.Error(1) 139 } 140 141 return r0, r1 142 } 143 144 // ListFetchRequests provides a mock function with given fields: ctx, specIDs 145 func (_m *APIService) ListFetchRequests(ctx context.Context, specIDs []string) ([]*model.FetchRequest, error) { 146 ret := _m.Called(ctx, specIDs) 147 148 var r0 []*model.FetchRequest 149 if rf, ok := ret.Get(0).(func(context.Context, []string) []*model.FetchRequest); ok { 150 r0 = rf(ctx, specIDs) 151 } else { 152 if ret.Get(0) != nil { 153 r0 = ret.Get(0).([]*model.FetchRequest) 154 } 155 } 156 157 var r1 error 158 if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok { 159 r1 = rf(ctx, specIDs) 160 } else { 161 r1 = ret.Error(1) 162 } 163 164 return r0, r1 165 } 166 167 // Update provides a mock function with given fields: ctx, resourceType, id, in, spec 168 func (_m *APIService) Update(ctx context.Context, resourceType resource.Type, id string, in model.APIDefinitionInput, spec *model.SpecInput) error { 169 ret := _m.Called(ctx, resourceType, id, in, spec) 170 171 var r0 error 172 if rf, ok := ret.Get(0).(func(context.Context, resource.Type, string, model.APIDefinitionInput, *model.SpecInput) error); ok { 173 r0 = rf(ctx, resourceType, id, in, spec) 174 } else { 175 r0 = ret.Error(0) 176 } 177 178 return r0 179 } 180 181 // UpdateForApplication provides a mock function with given fields: ctx, id, in, specIn 182 func (_m *APIService) UpdateForApplication(ctx context.Context, id string, in model.APIDefinitionInput, specIn *model.SpecInput) error { 183 ret := _m.Called(ctx, id, in, specIn) 184 185 var r0 error 186 if rf, ok := ret.Get(0).(func(context.Context, string, model.APIDefinitionInput, *model.SpecInput) error); ok { 187 r0 = rf(ctx, id, in, specIn) 188 } else { 189 r0 = ret.Error(0) 190 } 191 192 return r0 193 } 194 195 type mockConstructorTestingTNewAPIService interface { 196 mock.TestingT 197 Cleanup(func()) 198 } 199 200 // NewAPIService creates a new instance of APIService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 201 func NewAPIService(t mockConstructorTestingTNewAPIService) *APIService { 202 mock := &APIService{} 203 mock.Mock.Test(t) 204 205 t.Cleanup(func() { mock.AssertExpectations(t) }) 206 207 return mock 208 }