github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_service_plan_visibility_repository.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package apifakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api" 8 "code.cloudfoundry.org/cli/cf/models" 9 ) 10 11 type FakeServicePlanVisibilityRepository struct { 12 CreateStub func(string, string) error 13 createMutex sync.RWMutex 14 createArgsForCall []struct { 15 arg1 string 16 arg2 string 17 } 18 createReturns struct { 19 result1 error 20 } 21 createReturnsOnCall map[int]struct { 22 result1 error 23 } 24 DeleteStub func(string) error 25 deleteMutex sync.RWMutex 26 deleteArgsForCall []struct { 27 arg1 string 28 } 29 deleteReturns struct { 30 result1 error 31 } 32 deleteReturnsOnCall map[int]struct { 33 result1 error 34 } 35 ListStub func() ([]models.ServicePlanVisibilityFields, error) 36 listMutex sync.RWMutex 37 listArgsForCall []struct { 38 } 39 listReturns struct { 40 result1 []models.ServicePlanVisibilityFields 41 result2 error 42 } 43 listReturnsOnCall map[int]struct { 44 result1 []models.ServicePlanVisibilityFields 45 result2 error 46 } 47 SearchStub func(map[string]string) ([]models.ServicePlanVisibilityFields, error) 48 searchMutex sync.RWMutex 49 searchArgsForCall []struct { 50 arg1 map[string]string 51 } 52 searchReturns struct { 53 result1 []models.ServicePlanVisibilityFields 54 result2 error 55 } 56 searchReturnsOnCall map[int]struct { 57 result1 []models.ServicePlanVisibilityFields 58 result2 error 59 } 60 invocations map[string][][]interface{} 61 invocationsMutex sync.RWMutex 62 } 63 64 func (fake *FakeServicePlanVisibilityRepository) Create(arg1 string, arg2 string) error { 65 fake.createMutex.Lock() 66 ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)] 67 fake.createArgsForCall = append(fake.createArgsForCall, struct { 68 arg1 string 69 arg2 string 70 }{arg1, arg2}) 71 fake.recordInvocation("Create", []interface{}{arg1, arg2}) 72 fake.createMutex.Unlock() 73 if fake.CreateStub != nil { 74 return fake.CreateStub(arg1, arg2) 75 } 76 if specificReturn { 77 return ret.result1 78 } 79 fakeReturns := fake.createReturns 80 return fakeReturns.result1 81 } 82 83 func (fake *FakeServicePlanVisibilityRepository) CreateCallCount() int { 84 fake.createMutex.RLock() 85 defer fake.createMutex.RUnlock() 86 return len(fake.createArgsForCall) 87 } 88 89 func (fake *FakeServicePlanVisibilityRepository) CreateCalls(stub func(string, string) error) { 90 fake.createMutex.Lock() 91 defer fake.createMutex.Unlock() 92 fake.CreateStub = stub 93 } 94 95 func (fake *FakeServicePlanVisibilityRepository) CreateArgsForCall(i int) (string, string) { 96 fake.createMutex.RLock() 97 defer fake.createMutex.RUnlock() 98 argsForCall := fake.createArgsForCall[i] 99 return argsForCall.arg1, argsForCall.arg2 100 } 101 102 func (fake *FakeServicePlanVisibilityRepository) CreateReturns(result1 error) { 103 fake.createMutex.Lock() 104 defer fake.createMutex.Unlock() 105 fake.CreateStub = nil 106 fake.createReturns = struct { 107 result1 error 108 }{result1} 109 } 110 111 func (fake *FakeServicePlanVisibilityRepository) CreateReturnsOnCall(i int, result1 error) { 112 fake.createMutex.Lock() 113 defer fake.createMutex.Unlock() 114 fake.CreateStub = nil 115 if fake.createReturnsOnCall == nil { 116 fake.createReturnsOnCall = make(map[int]struct { 117 result1 error 118 }) 119 } 120 fake.createReturnsOnCall[i] = struct { 121 result1 error 122 }{result1} 123 } 124 125 func (fake *FakeServicePlanVisibilityRepository) Delete(arg1 string) error { 126 fake.deleteMutex.Lock() 127 ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)] 128 fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { 129 arg1 string 130 }{arg1}) 131 fake.recordInvocation("Delete", []interface{}{arg1}) 132 fake.deleteMutex.Unlock() 133 if fake.DeleteStub != nil { 134 return fake.DeleteStub(arg1) 135 } 136 if specificReturn { 137 return ret.result1 138 } 139 fakeReturns := fake.deleteReturns 140 return fakeReturns.result1 141 } 142 143 func (fake *FakeServicePlanVisibilityRepository) DeleteCallCount() int { 144 fake.deleteMutex.RLock() 145 defer fake.deleteMutex.RUnlock() 146 return len(fake.deleteArgsForCall) 147 } 148 149 func (fake *FakeServicePlanVisibilityRepository) DeleteCalls(stub func(string) error) { 150 fake.deleteMutex.Lock() 151 defer fake.deleteMutex.Unlock() 152 fake.DeleteStub = stub 153 } 154 155 func (fake *FakeServicePlanVisibilityRepository) DeleteArgsForCall(i int) string { 156 fake.deleteMutex.RLock() 157 defer fake.deleteMutex.RUnlock() 158 argsForCall := fake.deleteArgsForCall[i] 159 return argsForCall.arg1 160 } 161 162 func (fake *FakeServicePlanVisibilityRepository) DeleteReturns(result1 error) { 163 fake.deleteMutex.Lock() 164 defer fake.deleteMutex.Unlock() 165 fake.DeleteStub = nil 166 fake.deleteReturns = struct { 167 result1 error 168 }{result1} 169 } 170 171 func (fake *FakeServicePlanVisibilityRepository) DeleteReturnsOnCall(i int, result1 error) { 172 fake.deleteMutex.Lock() 173 defer fake.deleteMutex.Unlock() 174 fake.DeleteStub = nil 175 if fake.deleteReturnsOnCall == nil { 176 fake.deleteReturnsOnCall = make(map[int]struct { 177 result1 error 178 }) 179 } 180 fake.deleteReturnsOnCall[i] = struct { 181 result1 error 182 }{result1} 183 } 184 185 func (fake *FakeServicePlanVisibilityRepository) List() ([]models.ServicePlanVisibilityFields, error) { 186 fake.listMutex.Lock() 187 ret, specificReturn := fake.listReturnsOnCall[len(fake.listArgsForCall)] 188 fake.listArgsForCall = append(fake.listArgsForCall, struct { 189 }{}) 190 fake.recordInvocation("List", []interface{}{}) 191 fake.listMutex.Unlock() 192 if fake.ListStub != nil { 193 return fake.ListStub() 194 } 195 if specificReturn { 196 return ret.result1, ret.result2 197 } 198 fakeReturns := fake.listReturns 199 return fakeReturns.result1, fakeReturns.result2 200 } 201 202 func (fake *FakeServicePlanVisibilityRepository) ListCallCount() int { 203 fake.listMutex.RLock() 204 defer fake.listMutex.RUnlock() 205 return len(fake.listArgsForCall) 206 } 207 208 func (fake *FakeServicePlanVisibilityRepository) ListCalls(stub func() ([]models.ServicePlanVisibilityFields, error)) { 209 fake.listMutex.Lock() 210 defer fake.listMutex.Unlock() 211 fake.ListStub = stub 212 } 213 214 func (fake *FakeServicePlanVisibilityRepository) ListReturns(result1 []models.ServicePlanVisibilityFields, result2 error) { 215 fake.listMutex.Lock() 216 defer fake.listMutex.Unlock() 217 fake.ListStub = nil 218 fake.listReturns = struct { 219 result1 []models.ServicePlanVisibilityFields 220 result2 error 221 }{result1, result2} 222 } 223 224 func (fake *FakeServicePlanVisibilityRepository) ListReturnsOnCall(i int, result1 []models.ServicePlanVisibilityFields, result2 error) { 225 fake.listMutex.Lock() 226 defer fake.listMutex.Unlock() 227 fake.ListStub = nil 228 if fake.listReturnsOnCall == nil { 229 fake.listReturnsOnCall = make(map[int]struct { 230 result1 []models.ServicePlanVisibilityFields 231 result2 error 232 }) 233 } 234 fake.listReturnsOnCall[i] = struct { 235 result1 []models.ServicePlanVisibilityFields 236 result2 error 237 }{result1, result2} 238 } 239 240 func (fake *FakeServicePlanVisibilityRepository) Search(arg1 map[string]string) ([]models.ServicePlanVisibilityFields, error) { 241 fake.searchMutex.Lock() 242 ret, specificReturn := fake.searchReturnsOnCall[len(fake.searchArgsForCall)] 243 fake.searchArgsForCall = append(fake.searchArgsForCall, struct { 244 arg1 map[string]string 245 }{arg1}) 246 fake.recordInvocation("Search", []interface{}{arg1}) 247 fake.searchMutex.Unlock() 248 if fake.SearchStub != nil { 249 return fake.SearchStub(arg1) 250 } 251 if specificReturn { 252 return ret.result1, ret.result2 253 } 254 fakeReturns := fake.searchReturns 255 return fakeReturns.result1, fakeReturns.result2 256 } 257 258 func (fake *FakeServicePlanVisibilityRepository) SearchCallCount() int { 259 fake.searchMutex.RLock() 260 defer fake.searchMutex.RUnlock() 261 return len(fake.searchArgsForCall) 262 } 263 264 func (fake *FakeServicePlanVisibilityRepository) SearchCalls(stub func(map[string]string) ([]models.ServicePlanVisibilityFields, error)) { 265 fake.searchMutex.Lock() 266 defer fake.searchMutex.Unlock() 267 fake.SearchStub = stub 268 } 269 270 func (fake *FakeServicePlanVisibilityRepository) SearchArgsForCall(i int) map[string]string { 271 fake.searchMutex.RLock() 272 defer fake.searchMutex.RUnlock() 273 argsForCall := fake.searchArgsForCall[i] 274 return argsForCall.arg1 275 } 276 277 func (fake *FakeServicePlanVisibilityRepository) SearchReturns(result1 []models.ServicePlanVisibilityFields, result2 error) { 278 fake.searchMutex.Lock() 279 defer fake.searchMutex.Unlock() 280 fake.SearchStub = nil 281 fake.searchReturns = struct { 282 result1 []models.ServicePlanVisibilityFields 283 result2 error 284 }{result1, result2} 285 } 286 287 func (fake *FakeServicePlanVisibilityRepository) SearchReturnsOnCall(i int, result1 []models.ServicePlanVisibilityFields, result2 error) { 288 fake.searchMutex.Lock() 289 defer fake.searchMutex.Unlock() 290 fake.SearchStub = nil 291 if fake.searchReturnsOnCall == nil { 292 fake.searchReturnsOnCall = make(map[int]struct { 293 result1 []models.ServicePlanVisibilityFields 294 result2 error 295 }) 296 } 297 fake.searchReturnsOnCall[i] = struct { 298 result1 []models.ServicePlanVisibilityFields 299 result2 error 300 }{result1, result2} 301 } 302 303 func (fake *FakeServicePlanVisibilityRepository) Invocations() map[string][][]interface{} { 304 fake.invocationsMutex.RLock() 305 defer fake.invocationsMutex.RUnlock() 306 fake.createMutex.RLock() 307 defer fake.createMutex.RUnlock() 308 fake.deleteMutex.RLock() 309 defer fake.deleteMutex.RUnlock() 310 fake.listMutex.RLock() 311 defer fake.listMutex.RUnlock() 312 fake.searchMutex.RLock() 313 defer fake.searchMutex.RUnlock() 314 copiedInvocations := map[string][][]interface{}{} 315 for key, value := range fake.invocations { 316 copiedInvocations[key] = value 317 } 318 return copiedInvocations 319 } 320 321 func (fake *FakeServicePlanVisibilityRepository) recordInvocation(key string, args []interface{}) { 322 fake.invocationsMutex.Lock() 323 defer fake.invocationsMutex.Unlock() 324 if fake.invocations == nil { 325 fake.invocations = map[string][][]interface{}{} 326 } 327 if fake.invocations[key] == nil { 328 fake.invocations[key] = [][]interface{}{} 329 } 330 fake.invocations[key] = append(fake.invocations[key], args) 331 } 332 333 var _ api.ServicePlanVisibilityRepository = new(FakeServicePlanVisibilityRepository)