github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/api/apifakes/fake_service_repository.go (about) 1 // This file was generated by counterfeiter 2 package apifakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api" 8 "code.cloudfoundry.org/cli/cf/api/resources" 9 "code.cloudfoundry.org/cli/cf/models" 10 ) 11 12 type FakeServiceRepository struct { 13 PurgeServiceOfferingStub func(offering models.ServiceOffering) error 14 purgeServiceOfferingMutex sync.RWMutex 15 purgeServiceOfferingArgsForCall []struct { 16 offering models.ServiceOffering 17 } 18 purgeServiceOfferingReturns struct { 19 result1 error 20 } 21 GetServiceOfferingByGUIDStub func(serviceGUID string) (offering models.ServiceOffering, apiErr error) 22 getServiceOfferingByGUIDMutex sync.RWMutex 23 getServiceOfferingByGUIDArgsForCall []struct { 24 serviceGUID string 25 } 26 getServiceOfferingByGUIDReturns struct { 27 result1 models.ServiceOffering 28 result2 error 29 } 30 FindServiceOfferingsByLabelStub func(name string) (offering models.ServiceOfferings, apiErr error) 31 findServiceOfferingsByLabelMutex sync.RWMutex 32 findServiceOfferingsByLabelArgsForCall []struct { 33 name string 34 } 35 findServiceOfferingsByLabelReturns struct { 36 result1 models.ServiceOfferings 37 result2 error 38 } 39 FindServiceOfferingByLabelAndProviderStub func(name, provider string) (offering models.ServiceOffering, apiErr error) 40 findServiceOfferingByLabelAndProviderMutex sync.RWMutex 41 findServiceOfferingByLabelAndProviderArgsForCall []struct { 42 name string 43 provider string 44 } 45 findServiceOfferingByLabelAndProviderReturns struct { 46 result1 models.ServiceOffering 47 result2 error 48 } 49 FindServiceOfferingsForSpaceByLabelStub func(spaceGUID, name string) (offering models.ServiceOfferings, apiErr error) 50 findServiceOfferingsForSpaceByLabelMutex sync.RWMutex 51 findServiceOfferingsForSpaceByLabelArgsForCall []struct { 52 spaceGUID string 53 name string 54 } 55 findServiceOfferingsForSpaceByLabelReturns struct { 56 result1 models.ServiceOfferings 57 result2 error 58 } 59 GetAllServiceOfferingsStub func() (offerings models.ServiceOfferings, apiErr error) 60 getAllServiceOfferingsMutex sync.RWMutex 61 getAllServiceOfferingsArgsForCall []struct{} 62 getAllServiceOfferingsReturns struct { 63 result1 models.ServiceOfferings 64 result2 error 65 } 66 GetServiceOfferingsForSpaceStub func(spaceGUID string) (offerings models.ServiceOfferings, apiErr error) 67 getServiceOfferingsForSpaceMutex sync.RWMutex 68 getServiceOfferingsForSpaceArgsForCall []struct { 69 spaceGUID string 70 } 71 getServiceOfferingsForSpaceReturns struct { 72 result1 models.ServiceOfferings 73 result2 error 74 } 75 FindInstanceByNameStub func(name string) (instance models.ServiceInstance, apiErr error) 76 findInstanceByNameMutex sync.RWMutex 77 findInstanceByNameArgsForCall []struct { 78 name string 79 } 80 findInstanceByNameReturns struct { 81 result1 models.ServiceInstance 82 result2 error 83 } 84 PurgeServiceInstanceStub func(instance models.ServiceInstance) error 85 purgeServiceInstanceMutex sync.RWMutex 86 purgeServiceInstanceArgsForCall []struct { 87 instance models.ServiceInstance 88 } 89 purgeServiceInstanceReturns struct { 90 result1 error 91 } 92 CreateServiceInstanceStub func(name, planGUID string, params map[string]interface{}, tags []string) (apiErr error) 93 createServiceInstanceMutex sync.RWMutex 94 createServiceInstanceArgsForCall []struct { 95 name string 96 planGUID string 97 params map[string]interface{} 98 tags []string 99 } 100 createServiceInstanceReturns struct { 101 result1 error 102 } 103 UpdateServiceInstanceStub func(instanceGUID, planGUID string, params map[string]interface{}, tags []string) (apiErr error) 104 updateServiceInstanceMutex sync.RWMutex 105 updateServiceInstanceArgsForCall []struct { 106 instanceGUID string 107 planGUID string 108 params map[string]interface{} 109 tags []string 110 } 111 updateServiceInstanceReturns struct { 112 result1 error 113 } 114 RenameServiceStub func(instance models.ServiceInstance, newName string) (apiErr error) 115 renameServiceMutex sync.RWMutex 116 renameServiceArgsForCall []struct { 117 instance models.ServiceInstance 118 newName string 119 } 120 renameServiceReturns struct { 121 result1 error 122 } 123 DeleteServiceStub func(instance models.ServiceInstance) (apiErr error) 124 deleteServiceMutex sync.RWMutex 125 deleteServiceArgsForCall []struct { 126 instance models.ServiceInstance 127 } 128 deleteServiceReturns struct { 129 result1 error 130 } 131 FindServicePlanByDescriptionStub func(planDescription resources.ServicePlanDescription) (planGUID string, apiErr error) 132 findServicePlanByDescriptionMutex sync.RWMutex 133 findServicePlanByDescriptionArgsForCall []struct { 134 planDescription resources.ServicePlanDescription 135 } 136 findServicePlanByDescriptionReturns struct { 137 result1 string 138 result2 error 139 } 140 ListServicesFromBrokerStub func(brokerGUID string) (services []models.ServiceOffering, err error) 141 listServicesFromBrokerMutex sync.RWMutex 142 listServicesFromBrokerArgsForCall []struct { 143 brokerGUID string 144 } 145 listServicesFromBrokerReturns struct { 146 result1 []models.ServiceOffering 147 result2 error 148 } 149 ListServicesFromManyBrokersStub func(brokerGUIDs []string) (services []models.ServiceOffering, err error) 150 listServicesFromManyBrokersMutex sync.RWMutex 151 listServicesFromManyBrokersArgsForCall []struct { 152 brokerGUIDs []string 153 } 154 listServicesFromManyBrokersReturns struct { 155 result1 []models.ServiceOffering 156 result2 error 157 } 158 GetServiceInstanceCountForServicePlanStub func(v1PlanGUID string) (count int, apiErr error) 159 getServiceInstanceCountForServicePlanMutex sync.RWMutex 160 getServiceInstanceCountForServicePlanArgsForCall []struct { 161 v1PlanGUID string 162 } 163 getServiceInstanceCountForServicePlanReturns struct { 164 result1 int 165 result2 error 166 } 167 MigrateServicePlanFromV1ToV2Stub func(v1PlanGUID, v2PlanGUID string) (changedCount int, apiErr error) 168 migrateServicePlanFromV1ToV2Mutex sync.RWMutex 169 migrateServicePlanFromV1ToV2ArgsForCall []struct { 170 v1PlanGUID string 171 v2PlanGUID string 172 } 173 migrateServicePlanFromV1ToV2Returns struct { 174 result1 int 175 result2 error 176 } 177 invocations map[string][][]interface{} 178 invocationsMutex sync.RWMutex 179 } 180 181 func (fake *FakeServiceRepository) PurgeServiceOffering(offering models.ServiceOffering) error { 182 fake.purgeServiceOfferingMutex.Lock() 183 fake.purgeServiceOfferingArgsForCall = append(fake.purgeServiceOfferingArgsForCall, struct { 184 offering models.ServiceOffering 185 }{offering}) 186 fake.recordInvocation("PurgeServiceOffering", []interface{}{offering}) 187 fake.purgeServiceOfferingMutex.Unlock() 188 if fake.PurgeServiceOfferingStub != nil { 189 return fake.PurgeServiceOfferingStub(offering) 190 } else { 191 return fake.purgeServiceOfferingReturns.result1 192 } 193 } 194 195 func (fake *FakeServiceRepository) PurgeServiceOfferingCallCount() int { 196 fake.purgeServiceOfferingMutex.RLock() 197 defer fake.purgeServiceOfferingMutex.RUnlock() 198 return len(fake.purgeServiceOfferingArgsForCall) 199 } 200 201 func (fake *FakeServiceRepository) PurgeServiceOfferingArgsForCall(i int) models.ServiceOffering { 202 fake.purgeServiceOfferingMutex.RLock() 203 defer fake.purgeServiceOfferingMutex.RUnlock() 204 return fake.purgeServiceOfferingArgsForCall[i].offering 205 } 206 207 func (fake *FakeServiceRepository) PurgeServiceOfferingReturns(result1 error) { 208 fake.PurgeServiceOfferingStub = nil 209 fake.purgeServiceOfferingReturns = struct { 210 result1 error 211 }{result1} 212 } 213 214 func (fake *FakeServiceRepository) GetServiceOfferingByGUID(serviceGUID string) (offering models.ServiceOffering, apiErr error) { 215 fake.getServiceOfferingByGUIDMutex.Lock() 216 fake.getServiceOfferingByGUIDArgsForCall = append(fake.getServiceOfferingByGUIDArgsForCall, struct { 217 serviceGUID string 218 }{serviceGUID}) 219 fake.recordInvocation("GetServiceOfferingByGUID", []interface{}{serviceGUID}) 220 fake.getServiceOfferingByGUIDMutex.Unlock() 221 if fake.GetServiceOfferingByGUIDStub != nil { 222 return fake.GetServiceOfferingByGUIDStub(serviceGUID) 223 } else { 224 return fake.getServiceOfferingByGUIDReturns.result1, fake.getServiceOfferingByGUIDReturns.result2 225 } 226 } 227 228 func (fake *FakeServiceRepository) GetServiceOfferingByGUIDCallCount() int { 229 fake.getServiceOfferingByGUIDMutex.RLock() 230 defer fake.getServiceOfferingByGUIDMutex.RUnlock() 231 return len(fake.getServiceOfferingByGUIDArgsForCall) 232 } 233 234 func (fake *FakeServiceRepository) GetServiceOfferingByGUIDArgsForCall(i int) string { 235 fake.getServiceOfferingByGUIDMutex.RLock() 236 defer fake.getServiceOfferingByGUIDMutex.RUnlock() 237 return fake.getServiceOfferingByGUIDArgsForCall[i].serviceGUID 238 } 239 240 func (fake *FakeServiceRepository) GetServiceOfferingByGUIDReturns(result1 models.ServiceOffering, result2 error) { 241 fake.GetServiceOfferingByGUIDStub = nil 242 fake.getServiceOfferingByGUIDReturns = struct { 243 result1 models.ServiceOffering 244 result2 error 245 }{result1, result2} 246 } 247 248 func (fake *FakeServiceRepository) FindServiceOfferingsByLabel(name string) (offering models.ServiceOfferings, apiErr error) { 249 fake.findServiceOfferingsByLabelMutex.Lock() 250 fake.findServiceOfferingsByLabelArgsForCall = append(fake.findServiceOfferingsByLabelArgsForCall, struct { 251 name string 252 }{name}) 253 fake.recordInvocation("FindServiceOfferingsByLabel", []interface{}{name}) 254 fake.findServiceOfferingsByLabelMutex.Unlock() 255 if fake.FindServiceOfferingsByLabelStub != nil { 256 return fake.FindServiceOfferingsByLabelStub(name) 257 } else { 258 return fake.findServiceOfferingsByLabelReturns.result1, fake.findServiceOfferingsByLabelReturns.result2 259 } 260 } 261 262 func (fake *FakeServiceRepository) FindServiceOfferingsByLabelCallCount() int { 263 fake.findServiceOfferingsByLabelMutex.RLock() 264 defer fake.findServiceOfferingsByLabelMutex.RUnlock() 265 return len(fake.findServiceOfferingsByLabelArgsForCall) 266 } 267 268 func (fake *FakeServiceRepository) FindServiceOfferingsByLabelArgsForCall(i int) string { 269 fake.findServiceOfferingsByLabelMutex.RLock() 270 defer fake.findServiceOfferingsByLabelMutex.RUnlock() 271 return fake.findServiceOfferingsByLabelArgsForCall[i].name 272 } 273 274 func (fake *FakeServiceRepository) FindServiceOfferingsByLabelReturns(result1 models.ServiceOfferings, result2 error) { 275 fake.FindServiceOfferingsByLabelStub = nil 276 fake.findServiceOfferingsByLabelReturns = struct { 277 result1 models.ServiceOfferings 278 result2 error 279 }{result1, result2} 280 } 281 282 func (fake *FakeServiceRepository) FindServiceOfferingByLabelAndProvider(name string, provider string) (offering models.ServiceOffering, apiErr error) { 283 fake.findServiceOfferingByLabelAndProviderMutex.Lock() 284 fake.findServiceOfferingByLabelAndProviderArgsForCall = append(fake.findServiceOfferingByLabelAndProviderArgsForCall, struct { 285 name string 286 provider string 287 }{name, provider}) 288 fake.recordInvocation("FindServiceOfferingByLabelAndProvider", []interface{}{name, provider}) 289 fake.findServiceOfferingByLabelAndProviderMutex.Unlock() 290 if fake.FindServiceOfferingByLabelAndProviderStub != nil { 291 return fake.FindServiceOfferingByLabelAndProviderStub(name, provider) 292 } else { 293 return fake.findServiceOfferingByLabelAndProviderReturns.result1, fake.findServiceOfferingByLabelAndProviderReturns.result2 294 } 295 } 296 297 func (fake *FakeServiceRepository) FindServiceOfferingByLabelAndProviderCallCount() int { 298 fake.findServiceOfferingByLabelAndProviderMutex.RLock() 299 defer fake.findServiceOfferingByLabelAndProviderMutex.RUnlock() 300 return len(fake.findServiceOfferingByLabelAndProviderArgsForCall) 301 } 302 303 func (fake *FakeServiceRepository) FindServiceOfferingByLabelAndProviderArgsForCall(i int) (string, string) { 304 fake.findServiceOfferingByLabelAndProviderMutex.RLock() 305 defer fake.findServiceOfferingByLabelAndProviderMutex.RUnlock() 306 return fake.findServiceOfferingByLabelAndProviderArgsForCall[i].name, fake.findServiceOfferingByLabelAndProviderArgsForCall[i].provider 307 } 308 309 func (fake *FakeServiceRepository) FindServiceOfferingByLabelAndProviderReturns(result1 models.ServiceOffering, result2 error) { 310 fake.FindServiceOfferingByLabelAndProviderStub = nil 311 fake.findServiceOfferingByLabelAndProviderReturns = struct { 312 result1 models.ServiceOffering 313 result2 error 314 }{result1, result2} 315 } 316 317 func (fake *FakeServiceRepository) FindServiceOfferingsForSpaceByLabel(spaceGUID string, name string) (offering models.ServiceOfferings, apiErr error) { 318 fake.findServiceOfferingsForSpaceByLabelMutex.Lock() 319 fake.findServiceOfferingsForSpaceByLabelArgsForCall = append(fake.findServiceOfferingsForSpaceByLabelArgsForCall, struct { 320 spaceGUID string 321 name string 322 }{spaceGUID, name}) 323 fake.recordInvocation("FindServiceOfferingsForSpaceByLabel", []interface{}{spaceGUID, name}) 324 fake.findServiceOfferingsForSpaceByLabelMutex.Unlock() 325 if fake.FindServiceOfferingsForSpaceByLabelStub != nil { 326 return fake.FindServiceOfferingsForSpaceByLabelStub(spaceGUID, name) 327 } else { 328 return fake.findServiceOfferingsForSpaceByLabelReturns.result1, fake.findServiceOfferingsForSpaceByLabelReturns.result2 329 } 330 } 331 332 func (fake *FakeServiceRepository) FindServiceOfferingsForSpaceByLabelCallCount() int { 333 fake.findServiceOfferingsForSpaceByLabelMutex.RLock() 334 defer fake.findServiceOfferingsForSpaceByLabelMutex.RUnlock() 335 return len(fake.findServiceOfferingsForSpaceByLabelArgsForCall) 336 } 337 338 func (fake *FakeServiceRepository) FindServiceOfferingsForSpaceByLabelArgsForCall(i int) (string, string) { 339 fake.findServiceOfferingsForSpaceByLabelMutex.RLock() 340 defer fake.findServiceOfferingsForSpaceByLabelMutex.RUnlock() 341 return fake.findServiceOfferingsForSpaceByLabelArgsForCall[i].spaceGUID, fake.findServiceOfferingsForSpaceByLabelArgsForCall[i].name 342 } 343 344 func (fake *FakeServiceRepository) FindServiceOfferingsForSpaceByLabelReturns(result1 models.ServiceOfferings, result2 error) { 345 fake.FindServiceOfferingsForSpaceByLabelStub = nil 346 fake.findServiceOfferingsForSpaceByLabelReturns = struct { 347 result1 models.ServiceOfferings 348 result2 error 349 }{result1, result2} 350 } 351 352 func (fake *FakeServiceRepository) GetAllServiceOfferings() (offerings models.ServiceOfferings, apiErr error) { 353 fake.getAllServiceOfferingsMutex.Lock() 354 fake.getAllServiceOfferingsArgsForCall = append(fake.getAllServiceOfferingsArgsForCall, struct{}{}) 355 fake.recordInvocation("GetAllServiceOfferings", []interface{}{}) 356 fake.getAllServiceOfferingsMutex.Unlock() 357 if fake.GetAllServiceOfferingsStub != nil { 358 return fake.GetAllServiceOfferingsStub() 359 } else { 360 return fake.getAllServiceOfferingsReturns.result1, fake.getAllServiceOfferingsReturns.result2 361 } 362 } 363 364 func (fake *FakeServiceRepository) GetAllServiceOfferingsCallCount() int { 365 fake.getAllServiceOfferingsMutex.RLock() 366 defer fake.getAllServiceOfferingsMutex.RUnlock() 367 return len(fake.getAllServiceOfferingsArgsForCall) 368 } 369 370 func (fake *FakeServiceRepository) GetAllServiceOfferingsReturns(result1 models.ServiceOfferings, result2 error) { 371 fake.GetAllServiceOfferingsStub = nil 372 fake.getAllServiceOfferingsReturns = struct { 373 result1 models.ServiceOfferings 374 result2 error 375 }{result1, result2} 376 } 377 378 func (fake *FakeServiceRepository) GetServiceOfferingsForSpace(spaceGUID string) (offerings models.ServiceOfferings, apiErr error) { 379 fake.getServiceOfferingsForSpaceMutex.Lock() 380 fake.getServiceOfferingsForSpaceArgsForCall = append(fake.getServiceOfferingsForSpaceArgsForCall, struct { 381 spaceGUID string 382 }{spaceGUID}) 383 fake.recordInvocation("GetServiceOfferingsForSpace", []interface{}{spaceGUID}) 384 fake.getServiceOfferingsForSpaceMutex.Unlock() 385 if fake.GetServiceOfferingsForSpaceStub != nil { 386 return fake.GetServiceOfferingsForSpaceStub(spaceGUID) 387 } else { 388 return fake.getServiceOfferingsForSpaceReturns.result1, fake.getServiceOfferingsForSpaceReturns.result2 389 } 390 } 391 392 func (fake *FakeServiceRepository) GetServiceOfferingsForSpaceCallCount() int { 393 fake.getServiceOfferingsForSpaceMutex.RLock() 394 defer fake.getServiceOfferingsForSpaceMutex.RUnlock() 395 return len(fake.getServiceOfferingsForSpaceArgsForCall) 396 } 397 398 func (fake *FakeServiceRepository) GetServiceOfferingsForSpaceArgsForCall(i int) string { 399 fake.getServiceOfferingsForSpaceMutex.RLock() 400 defer fake.getServiceOfferingsForSpaceMutex.RUnlock() 401 return fake.getServiceOfferingsForSpaceArgsForCall[i].spaceGUID 402 } 403 404 func (fake *FakeServiceRepository) GetServiceOfferingsForSpaceReturns(result1 models.ServiceOfferings, result2 error) { 405 fake.GetServiceOfferingsForSpaceStub = nil 406 fake.getServiceOfferingsForSpaceReturns = struct { 407 result1 models.ServiceOfferings 408 result2 error 409 }{result1, result2} 410 } 411 412 func (fake *FakeServiceRepository) FindInstanceByName(name string) (instance models.ServiceInstance, apiErr error) { 413 fake.findInstanceByNameMutex.Lock() 414 fake.findInstanceByNameArgsForCall = append(fake.findInstanceByNameArgsForCall, struct { 415 name string 416 }{name}) 417 fake.recordInvocation("FindInstanceByName", []interface{}{name}) 418 fake.findInstanceByNameMutex.Unlock() 419 if fake.FindInstanceByNameStub != nil { 420 return fake.FindInstanceByNameStub(name) 421 } else { 422 return fake.findInstanceByNameReturns.result1, fake.findInstanceByNameReturns.result2 423 } 424 } 425 426 func (fake *FakeServiceRepository) FindInstanceByNameCallCount() int { 427 fake.findInstanceByNameMutex.RLock() 428 defer fake.findInstanceByNameMutex.RUnlock() 429 return len(fake.findInstanceByNameArgsForCall) 430 } 431 432 func (fake *FakeServiceRepository) FindInstanceByNameArgsForCall(i int) string { 433 fake.findInstanceByNameMutex.RLock() 434 defer fake.findInstanceByNameMutex.RUnlock() 435 return fake.findInstanceByNameArgsForCall[i].name 436 } 437 438 func (fake *FakeServiceRepository) FindInstanceByNameReturns(result1 models.ServiceInstance, result2 error) { 439 fake.FindInstanceByNameStub = nil 440 fake.findInstanceByNameReturns = struct { 441 result1 models.ServiceInstance 442 result2 error 443 }{result1, result2} 444 } 445 446 func (fake *FakeServiceRepository) PurgeServiceInstance(instance models.ServiceInstance) error { 447 fake.purgeServiceInstanceMutex.Lock() 448 fake.purgeServiceInstanceArgsForCall = append(fake.purgeServiceInstanceArgsForCall, struct { 449 instance models.ServiceInstance 450 }{instance}) 451 fake.recordInvocation("PurgeServiceInstance", []interface{}{instance}) 452 fake.purgeServiceInstanceMutex.Unlock() 453 if fake.PurgeServiceInstanceStub != nil { 454 return fake.PurgeServiceInstanceStub(instance) 455 } else { 456 return fake.purgeServiceInstanceReturns.result1 457 } 458 } 459 460 func (fake *FakeServiceRepository) PurgeServiceInstanceCallCount() int { 461 fake.purgeServiceInstanceMutex.RLock() 462 defer fake.purgeServiceInstanceMutex.RUnlock() 463 return len(fake.purgeServiceInstanceArgsForCall) 464 } 465 466 func (fake *FakeServiceRepository) PurgeServiceInstanceArgsForCall(i int) models.ServiceInstance { 467 fake.purgeServiceInstanceMutex.RLock() 468 defer fake.purgeServiceInstanceMutex.RUnlock() 469 return fake.purgeServiceInstanceArgsForCall[i].instance 470 } 471 472 func (fake *FakeServiceRepository) PurgeServiceInstanceReturns(result1 error) { 473 fake.PurgeServiceInstanceStub = nil 474 fake.purgeServiceInstanceReturns = struct { 475 result1 error 476 }{result1} 477 } 478 479 func (fake *FakeServiceRepository) CreateServiceInstance(name string, planGUID string, params map[string]interface{}, tags []string) (apiErr error) { 480 var tagsCopy []string 481 if tags != nil { 482 tagsCopy = make([]string, len(tags)) 483 copy(tagsCopy, tags) 484 } 485 fake.createServiceInstanceMutex.Lock() 486 fake.createServiceInstanceArgsForCall = append(fake.createServiceInstanceArgsForCall, struct { 487 name string 488 planGUID string 489 params map[string]interface{} 490 tags []string 491 }{name, planGUID, params, tagsCopy}) 492 fake.recordInvocation("CreateServiceInstance", []interface{}{name, planGUID, params, tagsCopy}) 493 fake.createServiceInstanceMutex.Unlock() 494 if fake.CreateServiceInstanceStub != nil { 495 return fake.CreateServiceInstanceStub(name, planGUID, params, tags) 496 } else { 497 return fake.createServiceInstanceReturns.result1 498 } 499 } 500 501 func (fake *FakeServiceRepository) CreateServiceInstanceCallCount() int { 502 fake.createServiceInstanceMutex.RLock() 503 defer fake.createServiceInstanceMutex.RUnlock() 504 return len(fake.createServiceInstanceArgsForCall) 505 } 506 507 func (fake *FakeServiceRepository) CreateServiceInstanceArgsForCall(i int) (string, string, map[string]interface{}, []string) { 508 fake.createServiceInstanceMutex.RLock() 509 defer fake.createServiceInstanceMutex.RUnlock() 510 return fake.createServiceInstanceArgsForCall[i].name, fake.createServiceInstanceArgsForCall[i].planGUID, fake.createServiceInstanceArgsForCall[i].params, fake.createServiceInstanceArgsForCall[i].tags 511 } 512 513 func (fake *FakeServiceRepository) CreateServiceInstanceReturns(result1 error) { 514 fake.CreateServiceInstanceStub = nil 515 fake.createServiceInstanceReturns = struct { 516 result1 error 517 }{result1} 518 } 519 520 func (fake *FakeServiceRepository) UpdateServiceInstance(instanceGUID string, planGUID string, params map[string]interface{}, tags []string) (apiErr error) { 521 var tagsCopy []string 522 if tags != nil { 523 tagsCopy = make([]string, len(tags)) 524 copy(tagsCopy, tags) 525 } 526 fake.updateServiceInstanceMutex.Lock() 527 fake.updateServiceInstanceArgsForCall = append(fake.updateServiceInstanceArgsForCall, struct { 528 instanceGUID string 529 planGUID string 530 params map[string]interface{} 531 tags []string 532 }{instanceGUID, planGUID, params, tagsCopy}) 533 fake.recordInvocation("UpdateServiceInstance", []interface{}{instanceGUID, planGUID, params, tagsCopy}) 534 fake.updateServiceInstanceMutex.Unlock() 535 if fake.UpdateServiceInstanceStub != nil { 536 return fake.UpdateServiceInstanceStub(instanceGUID, planGUID, params, tags) 537 } else { 538 return fake.updateServiceInstanceReturns.result1 539 } 540 } 541 542 func (fake *FakeServiceRepository) UpdateServiceInstanceCallCount() int { 543 fake.updateServiceInstanceMutex.RLock() 544 defer fake.updateServiceInstanceMutex.RUnlock() 545 return len(fake.updateServiceInstanceArgsForCall) 546 } 547 548 func (fake *FakeServiceRepository) UpdateServiceInstanceArgsForCall(i int) (string, string, map[string]interface{}, []string) { 549 fake.updateServiceInstanceMutex.RLock() 550 defer fake.updateServiceInstanceMutex.RUnlock() 551 return fake.updateServiceInstanceArgsForCall[i].instanceGUID, fake.updateServiceInstanceArgsForCall[i].planGUID, fake.updateServiceInstanceArgsForCall[i].params, fake.updateServiceInstanceArgsForCall[i].tags 552 } 553 554 func (fake *FakeServiceRepository) UpdateServiceInstanceReturns(result1 error) { 555 fake.UpdateServiceInstanceStub = nil 556 fake.updateServiceInstanceReturns = struct { 557 result1 error 558 }{result1} 559 } 560 561 func (fake *FakeServiceRepository) RenameService(instance models.ServiceInstance, newName string) (apiErr error) { 562 fake.renameServiceMutex.Lock() 563 fake.renameServiceArgsForCall = append(fake.renameServiceArgsForCall, struct { 564 instance models.ServiceInstance 565 newName string 566 }{instance, newName}) 567 fake.recordInvocation("RenameService", []interface{}{instance, newName}) 568 fake.renameServiceMutex.Unlock() 569 if fake.RenameServiceStub != nil { 570 return fake.RenameServiceStub(instance, newName) 571 } else { 572 return fake.renameServiceReturns.result1 573 } 574 } 575 576 func (fake *FakeServiceRepository) RenameServiceCallCount() int { 577 fake.renameServiceMutex.RLock() 578 defer fake.renameServiceMutex.RUnlock() 579 return len(fake.renameServiceArgsForCall) 580 } 581 582 func (fake *FakeServiceRepository) RenameServiceArgsForCall(i int) (models.ServiceInstance, string) { 583 fake.renameServiceMutex.RLock() 584 defer fake.renameServiceMutex.RUnlock() 585 return fake.renameServiceArgsForCall[i].instance, fake.renameServiceArgsForCall[i].newName 586 } 587 588 func (fake *FakeServiceRepository) RenameServiceReturns(result1 error) { 589 fake.RenameServiceStub = nil 590 fake.renameServiceReturns = struct { 591 result1 error 592 }{result1} 593 } 594 595 func (fake *FakeServiceRepository) DeleteService(instance models.ServiceInstance) (apiErr error) { 596 fake.deleteServiceMutex.Lock() 597 fake.deleteServiceArgsForCall = append(fake.deleteServiceArgsForCall, struct { 598 instance models.ServiceInstance 599 }{instance}) 600 fake.recordInvocation("DeleteService", []interface{}{instance}) 601 fake.deleteServiceMutex.Unlock() 602 if fake.DeleteServiceStub != nil { 603 return fake.DeleteServiceStub(instance) 604 } else { 605 return fake.deleteServiceReturns.result1 606 } 607 } 608 609 func (fake *FakeServiceRepository) DeleteServiceCallCount() int { 610 fake.deleteServiceMutex.RLock() 611 defer fake.deleteServiceMutex.RUnlock() 612 return len(fake.deleteServiceArgsForCall) 613 } 614 615 func (fake *FakeServiceRepository) DeleteServiceArgsForCall(i int) models.ServiceInstance { 616 fake.deleteServiceMutex.RLock() 617 defer fake.deleteServiceMutex.RUnlock() 618 return fake.deleteServiceArgsForCall[i].instance 619 } 620 621 func (fake *FakeServiceRepository) DeleteServiceReturns(result1 error) { 622 fake.DeleteServiceStub = nil 623 fake.deleteServiceReturns = struct { 624 result1 error 625 }{result1} 626 } 627 628 func (fake *FakeServiceRepository) FindServicePlanByDescription(planDescription resources.ServicePlanDescription) (planGUID string, apiErr error) { 629 fake.findServicePlanByDescriptionMutex.Lock() 630 fake.findServicePlanByDescriptionArgsForCall = append(fake.findServicePlanByDescriptionArgsForCall, struct { 631 planDescription resources.ServicePlanDescription 632 }{planDescription}) 633 fake.recordInvocation("FindServicePlanByDescription", []interface{}{planDescription}) 634 fake.findServicePlanByDescriptionMutex.Unlock() 635 if fake.FindServicePlanByDescriptionStub != nil { 636 return fake.FindServicePlanByDescriptionStub(planDescription) 637 } else { 638 return fake.findServicePlanByDescriptionReturns.result1, fake.findServicePlanByDescriptionReturns.result2 639 } 640 } 641 642 func (fake *FakeServiceRepository) FindServicePlanByDescriptionCallCount() int { 643 fake.findServicePlanByDescriptionMutex.RLock() 644 defer fake.findServicePlanByDescriptionMutex.RUnlock() 645 return len(fake.findServicePlanByDescriptionArgsForCall) 646 } 647 648 func (fake *FakeServiceRepository) FindServicePlanByDescriptionArgsForCall(i int) resources.ServicePlanDescription { 649 fake.findServicePlanByDescriptionMutex.RLock() 650 defer fake.findServicePlanByDescriptionMutex.RUnlock() 651 return fake.findServicePlanByDescriptionArgsForCall[i].planDescription 652 } 653 654 func (fake *FakeServiceRepository) FindServicePlanByDescriptionReturns(result1 string, result2 error) { 655 fake.FindServicePlanByDescriptionStub = nil 656 fake.findServicePlanByDescriptionReturns = struct { 657 result1 string 658 result2 error 659 }{result1, result2} 660 } 661 662 func (fake *FakeServiceRepository) ListServicesFromBroker(brokerGUID string) (services []models.ServiceOffering, err error) { 663 fake.listServicesFromBrokerMutex.Lock() 664 fake.listServicesFromBrokerArgsForCall = append(fake.listServicesFromBrokerArgsForCall, struct { 665 brokerGUID string 666 }{brokerGUID}) 667 fake.recordInvocation("ListServicesFromBroker", []interface{}{brokerGUID}) 668 fake.listServicesFromBrokerMutex.Unlock() 669 if fake.ListServicesFromBrokerStub != nil { 670 return fake.ListServicesFromBrokerStub(brokerGUID) 671 } else { 672 return fake.listServicesFromBrokerReturns.result1, fake.listServicesFromBrokerReturns.result2 673 } 674 } 675 676 func (fake *FakeServiceRepository) ListServicesFromBrokerCallCount() int { 677 fake.listServicesFromBrokerMutex.RLock() 678 defer fake.listServicesFromBrokerMutex.RUnlock() 679 return len(fake.listServicesFromBrokerArgsForCall) 680 } 681 682 func (fake *FakeServiceRepository) ListServicesFromBrokerArgsForCall(i int) string { 683 fake.listServicesFromBrokerMutex.RLock() 684 defer fake.listServicesFromBrokerMutex.RUnlock() 685 return fake.listServicesFromBrokerArgsForCall[i].brokerGUID 686 } 687 688 func (fake *FakeServiceRepository) ListServicesFromBrokerReturns(result1 []models.ServiceOffering, result2 error) { 689 fake.ListServicesFromBrokerStub = nil 690 fake.listServicesFromBrokerReturns = struct { 691 result1 []models.ServiceOffering 692 result2 error 693 }{result1, result2} 694 } 695 696 func (fake *FakeServiceRepository) ListServicesFromManyBrokers(brokerGUIDs []string) (services []models.ServiceOffering, err error) { 697 var brokerGUIDsCopy []string 698 if brokerGUIDs != nil { 699 brokerGUIDsCopy = make([]string, len(brokerGUIDs)) 700 copy(brokerGUIDsCopy, brokerGUIDs) 701 } 702 fake.listServicesFromManyBrokersMutex.Lock() 703 fake.listServicesFromManyBrokersArgsForCall = append(fake.listServicesFromManyBrokersArgsForCall, struct { 704 brokerGUIDs []string 705 }{brokerGUIDsCopy}) 706 fake.recordInvocation("ListServicesFromManyBrokers", []interface{}{brokerGUIDsCopy}) 707 fake.listServicesFromManyBrokersMutex.Unlock() 708 if fake.ListServicesFromManyBrokersStub != nil { 709 return fake.ListServicesFromManyBrokersStub(brokerGUIDs) 710 } else { 711 return fake.listServicesFromManyBrokersReturns.result1, fake.listServicesFromManyBrokersReturns.result2 712 } 713 } 714 715 func (fake *FakeServiceRepository) ListServicesFromManyBrokersCallCount() int { 716 fake.listServicesFromManyBrokersMutex.RLock() 717 defer fake.listServicesFromManyBrokersMutex.RUnlock() 718 return len(fake.listServicesFromManyBrokersArgsForCall) 719 } 720 721 func (fake *FakeServiceRepository) ListServicesFromManyBrokersArgsForCall(i int) []string { 722 fake.listServicesFromManyBrokersMutex.RLock() 723 defer fake.listServicesFromManyBrokersMutex.RUnlock() 724 return fake.listServicesFromManyBrokersArgsForCall[i].brokerGUIDs 725 } 726 727 func (fake *FakeServiceRepository) ListServicesFromManyBrokersReturns(result1 []models.ServiceOffering, result2 error) { 728 fake.ListServicesFromManyBrokersStub = nil 729 fake.listServicesFromManyBrokersReturns = struct { 730 result1 []models.ServiceOffering 731 result2 error 732 }{result1, result2} 733 } 734 735 func (fake *FakeServiceRepository) GetServiceInstanceCountForServicePlan(v1PlanGUID string) (count int, apiErr error) { 736 fake.getServiceInstanceCountForServicePlanMutex.Lock() 737 fake.getServiceInstanceCountForServicePlanArgsForCall = append(fake.getServiceInstanceCountForServicePlanArgsForCall, struct { 738 v1PlanGUID string 739 }{v1PlanGUID}) 740 fake.recordInvocation("GetServiceInstanceCountForServicePlan", []interface{}{v1PlanGUID}) 741 fake.getServiceInstanceCountForServicePlanMutex.Unlock() 742 if fake.GetServiceInstanceCountForServicePlanStub != nil { 743 return fake.GetServiceInstanceCountForServicePlanStub(v1PlanGUID) 744 } else { 745 return fake.getServiceInstanceCountForServicePlanReturns.result1, fake.getServiceInstanceCountForServicePlanReturns.result2 746 } 747 } 748 749 func (fake *FakeServiceRepository) GetServiceInstanceCountForServicePlanCallCount() int { 750 fake.getServiceInstanceCountForServicePlanMutex.RLock() 751 defer fake.getServiceInstanceCountForServicePlanMutex.RUnlock() 752 return len(fake.getServiceInstanceCountForServicePlanArgsForCall) 753 } 754 755 func (fake *FakeServiceRepository) GetServiceInstanceCountForServicePlanArgsForCall(i int) string { 756 fake.getServiceInstanceCountForServicePlanMutex.RLock() 757 defer fake.getServiceInstanceCountForServicePlanMutex.RUnlock() 758 return fake.getServiceInstanceCountForServicePlanArgsForCall[i].v1PlanGUID 759 } 760 761 func (fake *FakeServiceRepository) GetServiceInstanceCountForServicePlanReturns(result1 int, result2 error) { 762 fake.GetServiceInstanceCountForServicePlanStub = nil 763 fake.getServiceInstanceCountForServicePlanReturns = struct { 764 result1 int 765 result2 error 766 }{result1, result2} 767 } 768 769 func (fake *FakeServiceRepository) MigrateServicePlanFromV1ToV2(v1PlanGUID string, v2PlanGUID string) (changedCount int, apiErr error) { 770 fake.migrateServicePlanFromV1ToV2Mutex.Lock() 771 fake.migrateServicePlanFromV1ToV2ArgsForCall = append(fake.migrateServicePlanFromV1ToV2ArgsForCall, struct { 772 v1PlanGUID string 773 v2PlanGUID string 774 }{v1PlanGUID, v2PlanGUID}) 775 fake.recordInvocation("MigrateServicePlanFromV1ToV2", []interface{}{v1PlanGUID, v2PlanGUID}) 776 fake.migrateServicePlanFromV1ToV2Mutex.Unlock() 777 if fake.MigrateServicePlanFromV1ToV2Stub != nil { 778 return fake.MigrateServicePlanFromV1ToV2Stub(v1PlanGUID, v2PlanGUID) 779 } else { 780 return fake.migrateServicePlanFromV1ToV2Returns.result1, fake.migrateServicePlanFromV1ToV2Returns.result2 781 } 782 } 783 784 func (fake *FakeServiceRepository) MigrateServicePlanFromV1ToV2CallCount() int { 785 fake.migrateServicePlanFromV1ToV2Mutex.RLock() 786 defer fake.migrateServicePlanFromV1ToV2Mutex.RUnlock() 787 return len(fake.migrateServicePlanFromV1ToV2ArgsForCall) 788 } 789 790 func (fake *FakeServiceRepository) MigrateServicePlanFromV1ToV2ArgsForCall(i int) (string, string) { 791 fake.migrateServicePlanFromV1ToV2Mutex.RLock() 792 defer fake.migrateServicePlanFromV1ToV2Mutex.RUnlock() 793 return fake.migrateServicePlanFromV1ToV2ArgsForCall[i].v1PlanGUID, fake.migrateServicePlanFromV1ToV2ArgsForCall[i].v2PlanGUID 794 } 795 796 func (fake *FakeServiceRepository) MigrateServicePlanFromV1ToV2Returns(result1 int, result2 error) { 797 fake.MigrateServicePlanFromV1ToV2Stub = nil 798 fake.migrateServicePlanFromV1ToV2Returns = struct { 799 result1 int 800 result2 error 801 }{result1, result2} 802 } 803 804 func (fake *FakeServiceRepository) Invocations() map[string][][]interface{} { 805 fake.invocationsMutex.RLock() 806 defer fake.invocationsMutex.RUnlock() 807 fake.purgeServiceOfferingMutex.RLock() 808 defer fake.purgeServiceOfferingMutex.RUnlock() 809 fake.getServiceOfferingByGUIDMutex.RLock() 810 defer fake.getServiceOfferingByGUIDMutex.RUnlock() 811 fake.findServiceOfferingsByLabelMutex.RLock() 812 defer fake.findServiceOfferingsByLabelMutex.RUnlock() 813 fake.findServiceOfferingByLabelAndProviderMutex.RLock() 814 defer fake.findServiceOfferingByLabelAndProviderMutex.RUnlock() 815 fake.findServiceOfferingsForSpaceByLabelMutex.RLock() 816 defer fake.findServiceOfferingsForSpaceByLabelMutex.RUnlock() 817 fake.getAllServiceOfferingsMutex.RLock() 818 defer fake.getAllServiceOfferingsMutex.RUnlock() 819 fake.getServiceOfferingsForSpaceMutex.RLock() 820 defer fake.getServiceOfferingsForSpaceMutex.RUnlock() 821 fake.findInstanceByNameMutex.RLock() 822 defer fake.findInstanceByNameMutex.RUnlock() 823 fake.purgeServiceInstanceMutex.RLock() 824 defer fake.purgeServiceInstanceMutex.RUnlock() 825 fake.createServiceInstanceMutex.RLock() 826 defer fake.createServiceInstanceMutex.RUnlock() 827 fake.updateServiceInstanceMutex.RLock() 828 defer fake.updateServiceInstanceMutex.RUnlock() 829 fake.renameServiceMutex.RLock() 830 defer fake.renameServiceMutex.RUnlock() 831 fake.deleteServiceMutex.RLock() 832 defer fake.deleteServiceMutex.RUnlock() 833 fake.findServicePlanByDescriptionMutex.RLock() 834 defer fake.findServicePlanByDescriptionMutex.RUnlock() 835 fake.listServicesFromBrokerMutex.RLock() 836 defer fake.listServicesFromBrokerMutex.RUnlock() 837 fake.listServicesFromManyBrokersMutex.RLock() 838 defer fake.listServicesFromManyBrokersMutex.RUnlock() 839 fake.getServiceInstanceCountForServicePlanMutex.RLock() 840 defer fake.getServiceInstanceCountForServicePlanMutex.RUnlock() 841 fake.migrateServicePlanFromV1ToV2Mutex.RLock() 842 defer fake.migrateServicePlanFromV1ToV2Mutex.RUnlock() 843 return fake.invocations 844 } 845 846 func (fake *FakeServiceRepository) recordInvocation(key string, args []interface{}) { 847 fake.invocationsMutex.Lock() 848 defer fake.invocationsMutex.Unlock() 849 if fake.invocations == nil { 850 fake.invocations = map[string][][]interface{}{} 851 } 852 if fake.invocations[key] == nil { 853 fake.invocations[key] = [][]interface{}{} 854 } 855 fake.invocations[key] = append(fake.invocations[key], args) 856 } 857 858 var _ api.ServiceRepository = new(FakeServiceRepository)