github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/api/apifakes/fake_user_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/models" 9 ) 10 11 type FakeUserRepository struct { 12 FindByUsernameStub func(username string) (user models.UserFields, apiErr error) 13 findByUsernameMutex sync.RWMutex 14 findByUsernameArgsForCall []struct { 15 username string 16 } 17 findByUsernameReturns struct { 18 result1 models.UserFields 19 result2 error 20 } 21 FindAllByUsernameStub func(username string) (users []models.UserFields, apiErr error) 22 findAllByUsernameMutex sync.RWMutex 23 findAllByUsernameArgsForCall []struct { 24 username string 25 } 26 findAllByUsernameReturns struct { 27 result1 []models.UserFields 28 result2 error 29 } 30 ListUsersInOrgForRoleStub func(orgGUID string, role models.Role) ([]models.UserFields, error) 31 listUsersInOrgForRoleMutex sync.RWMutex 32 listUsersInOrgForRoleArgsForCall []struct { 33 orgGUID string 34 role models.Role 35 } 36 listUsersInOrgForRoleReturns struct { 37 result1 []models.UserFields 38 result2 error 39 } 40 ListUsersInOrgForRoleWithNoUAAStub func(orgGUID string, role models.Role) ([]models.UserFields, error) 41 listUsersInOrgForRoleWithNoUAAMutex sync.RWMutex 42 listUsersInOrgForRoleWithNoUAAArgsForCall []struct { 43 orgGUID string 44 role models.Role 45 } 46 listUsersInOrgForRoleWithNoUAAReturns struct { 47 result1 []models.UserFields 48 result2 error 49 } 50 ListUsersInSpaceForRoleWithNoUAAStub func(spaceGUID string, role models.Role) ([]models.UserFields, error) 51 listUsersInSpaceForRoleWithNoUAAMutex sync.RWMutex 52 listUsersInSpaceForRoleWithNoUAAArgsForCall []struct { 53 spaceGUID string 54 role models.Role 55 } 56 listUsersInSpaceForRoleWithNoUAAReturns struct { 57 result1 []models.UserFields 58 result2 error 59 } 60 CreateStub func(username, password string) (apiErr error) 61 createMutex sync.RWMutex 62 createArgsForCall []struct { 63 username string 64 password string 65 } 66 createReturns struct { 67 result1 error 68 } 69 DeleteStub func(userGUID string) (apiErr error) 70 deleteMutex sync.RWMutex 71 deleteArgsForCall []struct { 72 userGUID string 73 } 74 deleteReturns struct { 75 result1 error 76 } 77 SetOrgRoleByGUIDStub func(userGUID, orgGUID string, role models.Role) (apiErr error) 78 setOrgRoleByGUIDMutex sync.RWMutex 79 setOrgRoleByGUIDArgsForCall []struct { 80 userGUID string 81 orgGUID string 82 role models.Role 83 } 84 setOrgRoleByGUIDReturns struct { 85 result1 error 86 } 87 SetOrgRoleByUsernameStub func(username, orgGUID string, role models.Role) (apiErr error) 88 setOrgRoleByUsernameMutex sync.RWMutex 89 setOrgRoleByUsernameArgsForCall []struct { 90 username string 91 orgGUID string 92 role models.Role 93 } 94 setOrgRoleByUsernameReturns struct { 95 result1 error 96 } 97 UnsetOrgRoleByGUIDStub func(userGUID, orgGUID string, role models.Role) (apiErr error) 98 unsetOrgRoleByGUIDMutex sync.RWMutex 99 unsetOrgRoleByGUIDArgsForCall []struct { 100 userGUID string 101 orgGUID string 102 role models.Role 103 } 104 unsetOrgRoleByGUIDReturns struct { 105 result1 error 106 } 107 UnsetOrgRoleByUsernameStub func(username, orgGUID string, role models.Role) (apiErr error) 108 unsetOrgRoleByUsernameMutex sync.RWMutex 109 unsetOrgRoleByUsernameArgsForCall []struct { 110 username string 111 orgGUID string 112 role models.Role 113 } 114 unsetOrgRoleByUsernameReturns struct { 115 result1 error 116 } 117 SetSpaceRoleByGUIDStub func(userGUID, spaceGUID, orgGUID string, role models.Role) (apiErr error) 118 setSpaceRoleByGUIDMutex sync.RWMutex 119 setSpaceRoleByGUIDArgsForCall []struct { 120 userGUID string 121 spaceGUID string 122 orgGUID string 123 role models.Role 124 } 125 setSpaceRoleByGUIDReturns struct { 126 result1 error 127 } 128 SetSpaceRoleByUsernameStub func(username, spaceGUID, orgGUID string, role models.Role) (apiErr error) 129 setSpaceRoleByUsernameMutex sync.RWMutex 130 setSpaceRoleByUsernameArgsForCall []struct { 131 username string 132 spaceGUID string 133 orgGUID string 134 role models.Role 135 } 136 setSpaceRoleByUsernameReturns struct { 137 result1 error 138 } 139 UnsetSpaceRoleByGUIDStub func(userGUID, spaceGUID string, role models.Role) (apiErr error) 140 unsetSpaceRoleByGUIDMutex sync.RWMutex 141 unsetSpaceRoleByGUIDArgsForCall []struct { 142 userGUID string 143 spaceGUID string 144 role models.Role 145 } 146 unsetSpaceRoleByGUIDReturns struct { 147 result1 error 148 } 149 UnsetSpaceRoleByUsernameStub func(userGUID, spaceGUID string, role models.Role) (apiErr error) 150 unsetSpaceRoleByUsernameMutex sync.RWMutex 151 unsetSpaceRoleByUsernameArgsForCall []struct { 152 userGUID string 153 spaceGUID string 154 role models.Role 155 } 156 unsetSpaceRoleByUsernameReturns struct { 157 result1 error 158 } 159 invocations map[string][][]interface{} 160 invocationsMutex sync.RWMutex 161 } 162 163 func (fake *FakeUserRepository) FindByUsername(username string) (user models.UserFields, apiErr error) { 164 fake.findByUsernameMutex.Lock() 165 fake.findByUsernameArgsForCall = append(fake.findByUsernameArgsForCall, struct { 166 username string 167 }{username}) 168 fake.recordInvocation("FindByUsername", []interface{}{username}) 169 fake.findByUsernameMutex.Unlock() 170 if fake.FindByUsernameStub != nil { 171 return fake.FindByUsernameStub(username) 172 } else { 173 return fake.findByUsernameReturns.result1, fake.findByUsernameReturns.result2 174 } 175 } 176 177 func (fake *FakeUserRepository) FindByUsernameCallCount() int { 178 fake.findByUsernameMutex.RLock() 179 defer fake.findByUsernameMutex.RUnlock() 180 return len(fake.findByUsernameArgsForCall) 181 } 182 183 func (fake *FakeUserRepository) FindByUsernameArgsForCall(i int) string { 184 fake.findByUsernameMutex.RLock() 185 defer fake.findByUsernameMutex.RUnlock() 186 return fake.findByUsernameArgsForCall[i].username 187 } 188 189 func (fake *FakeUserRepository) FindByUsernameReturns(result1 models.UserFields, result2 error) { 190 fake.FindByUsernameStub = nil 191 fake.findByUsernameReturns = struct { 192 result1 models.UserFields 193 result2 error 194 }{result1, result2} 195 } 196 197 func (fake *FakeUserRepository) FindAllByUsername(username string) (users []models.UserFields, apiErr error) { 198 fake.findAllByUsernameMutex.Lock() 199 fake.findAllByUsernameArgsForCall = append(fake.findAllByUsernameArgsForCall, struct { 200 username string 201 }{username}) 202 fake.recordInvocation("FindAllByUsername", []interface{}{username}) 203 fake.findAllByUsernameMutex.Unlock() 204 if fake.FindAllByUsernameStub != nil { 205 return fake.FindAllByUsernameStub(username) 206 } else { 207 return fake.findAllByUsernameReturns.result1, fake.findAllByUsernameReturns.result2 208 } 209 } 210 211 func (fake *FakeUserRepository) FindAllByUsernameCallCount() int { 212 fake.findAllByUsernameMutex.RLock() 213 defer fake.findAllByUsernameMutex.RUnlock() 214 return len(fake.findAllByUsernameArgsForCall) 215 } 216 217 func (fake *FakeUserRepository) FindAllByUsernameArgsForCall(i int) string { 218 fake.findAllByUsernameMutex.RLock() 219 defer fake.findAllByUsernameMutex.RUnlock() 220 return fake.findAllByUsernameArgsForCall[i].username 221 } 222 223 func (fake *FakeUserRepository) FindAllByUsernameReturns(result1 []models.UserFields, result2 error) { 224 fake.FindAllByUsernameStub = nil 225 fake.findAllByUsernameReturns = struct { 226 result1 []models.UserFields 227 result2 error 228 }{result1, result2} 229 } 230 231 func (fake *FakeUserRepository) ListUsersInOrgForRole(orgGUID string, role models.Role) ([]models.UserFields, error) { 232 fake.listUsersInOrgForRoleMutex.Lock() 233 fake.listUsersInOrgForRoleArgsForCall = append(fake.listUsersInOrgForRoleArgsForCall, struct { 234 orgGUID string 235 role models.Role 236 }{orgGUID, role}) 237 fake.recordInvocation("ListUsersInOrgForRole", []interface{}{orgGUID, role}) 238 fake.listUsersInOrgForRoleMutex.Unlock() 239 if fake.ListUsersInOrgForRoleStub != nil { 240 return fake.ListUsersInOrgForRoleStub(orgGUID, role) 241 } else { 242 return fake.listUsersInOrgForRoleReturns.result1, fake.listUsersInOrgForRoleReturns.result2 243 } 244 } 245 246 func (fake *FakeUserRepository) ListUsersInOrgForRoleCallCount() int { 247 fake.listUsersInOrgForRoleMutex.RLock() 248 defer fake.listUsersInOrgForRoleMutex.RUnlock() 249 return len(fake.listUsersInOrgForRoleArgsForCall) 250 } 251 252 func (fake *FakeUserRepository) ListUsersInOrgForRoleArgsForCall(i int) (string, models.Role) { 253 fake.listUsersInOrgForRoleMutex.RLock() 254 defer fake.listUsersInOrgForRoleMutex.RUnlock() 255 return fake.listUsersInOrgForRoleArgsForCall[i].orgGUID, fake.listUsersInOrgForRoleArgsForCall[i].role 256 } 257 258 func (fake *FakeUserRepository) ListUsersInOrgForRoleReturns(result1 []models.UserFields, result2 error) { 259 fake.ListUsersInOrgForRoleStub = nil 260 fake.listUsersInOrgForRoleReturns = struct { 261 result1 []models.UserFields 262 result2 error 263 }{result1, result2} 264 } 265 266 func (fake *FakeUserRepository) ListUsersInOrgForRoleWithNoUAA(orgGUID string, role models.Role) ([]models.UserFields, error) { 267 fake.listUsersInOrgForRoleWithNoUAAMutex.Lock() 268 fake.listUsersInOrgForRoleWithNoUAAArgsForCall = append(fake.listUsersInOrgForRoleWithNoUAAArgsForCall, struct { 269 orgGUID string 270 role models.Role 271 }{orgGUID, role}) 272 fake.recordInvocation("ListUsersInOrgForRoleWithNoUAA", []interface{}{orgGUID, role}) 273 fake.listUsersInOrgForRoleWithNoUAAMutex.Unlock() 274 if fake.ListUsersInOrgForRoleWithNoUAAStub != nil { 275 return fake.ListUsersInOrgForRoleWithNoUAAStub(orgGUID, role) 276 } else { 277 return fake.listUsersInOrgForRoleWithNoUAAReturns.result1, fake.listUsersInOrgForRoleWithNoUAAReturns.result2 278 } 279 } 280 281 func (fake *FakeUserRepository) ListUsersInOrgForRoleWithNoUAACallCount() int { 282 fake.listUsersInOrgForRoleWithNoUAAMutex.RLock() 283 defer fake.listUsersInOrgForRoleWithNoUAAMutex.RUnlock() 284 return len(fake.listUsersInOrgForRoleWithNoUAAArgsForCall) 285 } 286 287 func (fake *FakeUserRepository) ListUsersInOrgForRoleWithNoUAAArgsForCall(i int) (string, models.Role) { 288 fake.listUsersInOrgForRoleWithNoUAAMutex.RLock() 289 defer fake.listUsersInOrgForRoleWithNoUAAMutex.RUnlock() 290 return fake.listUsersInOrgForRoleWithNoUAAArgsForCall[i].orgGUID, fake.listUsersInOrgForRoleWithNoUAAArgsForCall[i].role 291 } 292 293 func (fake *FakeUserRepository) ListUsersInOrgForRoleWithNoUAAReturns(result1 []models.UserFields, result2 error) { 294 fake.ListUsersInOrgForRoleWithNoUAAStub = nil 295 fake.listUsersInOrgForRoleWithNoUAAReturns = struct { 296 result1 []models.UserFields 297 result2 error 298 }{result1, result2} 299 } 300 301 func (fake *FakeUserRepository) ListUsersInSpaceForRoleWithNoUAA(spaceGUID string, role models.Role) ([]models.UserFields, error) { 302 fake.listUsersInSpaceForRoleWithNoUAAMutex.Lock() 303 fake.listUsersInSpaceForRoleWithNoUAAArgsForCall = append(fake.listUsersInSpaceForRoleWithNoUAAArgsForCall, struct { 304 spaceGUID string 305 role models.Role 306 }{spaceGUID, role}) 307 fake.recordInvocation("ListUsersInSpaceForRoleWithNoUAA", []interface{}{spaceGUID, role}) 308 fake.listUsersInSpaceForRoleWithNoUAAMutex.Unlock() 309 if fake.ListUsersInSpaceForRoleWithNoUAAStub != nil { 310 return fake.ListUsersInSpaceForRoleWithNoUAAStub(spaceGUID, role) 311 } else { 312 return fake.listUsersInSpaceForRoleWithNoUAAReturns.result1, fake.listUsersInSpaceForRoleWithNoUAAReturns.result2 313 } 314 } 315 316 func (fake *FakeUserRepository) ListUsersInSpaceForRoleWithNoUAACallCount() int { 317 fake.listUsersInSpaceForRoleWithNoUAAMutex.RLock() 318 defer fake.listUsersInSpaceForRoleWithNoUAAMutex.RUnlock() 319 return len(fake.listUsersInSpaceForRoleWithNoUAAArgsForCall) 320 } 321 322 func (fake *FakeUserRepository) ListUsersInSpaceForRoleWithNoUAAArgsForCall(i int) (string, models.Role) { 323 fake.listUsersInSpaceForRoleWithNoUAAMutex.RLock() 324 defer fake.listUsersInSpaceForRoleWithNoUAAMutex.RUnlock() 325 return fake.listUsersInSpaceForRoleWithNoUAAArgsForCall[i].spaceGUID, fake.listUsersInSpaceForRoleWithNoUAAArgsForCall[i].role 326 } 327 328 func (fake *FakeUserRepository) ListUsersInSpaceForRoleWithNoUAAReturns(result1 []models.UserFields, result2 error) { 329 fake.ListUsersInSpaceForRoleWithNoUAAStub = nil 330 fake.listUsersInSpaceForRoleWithNoUAAReturns = struct { 331 result1 []models.UserFields 332 result2 error 333 }{result1, result2} 334 } 335 336 func (fake *FakeUserRepository) Create(username string, password string) (apiErr error) { 337 fake.createMutex.Lock() 338 fake.createArgsForCall = append(fake.createArgsForCall, struct { 339 username string 340 password string 341 }{username, password}) 342 fake.recordInvocation("Create", []interface{}{username, password}) 343 fake.createMutex.Unlock() 344 if fake.CreateStub != nil { 345 return fake.CreateStub(username, password) 346 } else { 347 return fake.createReturns.result1 348 } 349 } 350 351 func (fake *FakeUserRepository) CreateCallCount() int { 352 fake.createMutex.RLock() 353 defer fake.createMutex.RUnlock() 354 return len(fake.createArgsForCall) 355 } 356 357 func (fake *FakeUserRepository) CreateArgsForCall(i int) (string, string) { 358 fake.createMutex.RLock() 359 defer fake.createMutex.RUnlock() 360 return fake.createArgsForCall[i].username, fake.createArgsForCall[i].password 361 } 362 363 func (fake *FakeUserRepository) CreateReturns(result1 error) { 364 fake.CreateStub = nil 365 fake.createReturns = struct { 366 result1 error 367 }{result1} 368 } 369 370 func (fake *FakeUserRepository) Delete(userGUID string) (apiErr error) { 371 fake.deleteMutex.Lock() 372 fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { 373 userGUID string 374 }{userGUID}) 375 fake.recordInvocation("Delete", []interface{}{userGUID}) 376 fake.deleteMutex.Unlock() 377 if fake.DeleteStub != nil { 378 return fake.DeleteStub(userGUID) 379 } else { 380 return fake.deleteReturns.result1 381 } 382 } 383 384 func (fake *FakeUserRepository) DeleteCallCount() int { 385 fake.deleteMutex.RLock() 386 defer fake.deleteMutex.RUnlock() 387 return len(fake.deleteArgsForCall) 388 } 389 390 func (fake *FakeUserRepository) DeleteArgsForCall(i int) string { 391 fake.deleteMutex.RLock() 392 defer fake.deleteMutex.RUnlock() 393 return fake.deleteArgsForCall[i].userGUID 394 } 395 396 func (fake *FakeUserRepository) DeleteReturns(result1 error) { 397 fake.DeleteStub = nil 398 fake.deleteReturns = struct { 399 result1 error 400 }{result1} 401 } 402 403 func (fake *FakeUserRepository) SetOrgRoleByGUID(userGUID string, orgGUID string, role models.Role) (apiErr error) { 404 fake.setOrgRoleByGUIDMutex.Lock() 405 fake.setOrgRoleByGUIDArgsForCall = append(fake.setOrgRoleByGUIDArgsForCall, struct { 406 userGUID string 407 orgGUID string 408 role models.Role 409 }{userGUID, orgGUID, role}) 410 fake.recordInvocation("SetOrgRoleByGUID", []interface{}{userGUID, orgGUID, role}) 411 fake.setOrgRoleByGUIDMutex.Unlock() 412 if fake.SetOrgRoleByGUIDStub != nil { 413 return fake.SetOrgRoleByGUIDStub(userGUID, orgGUID, role) 414 } else { 415 return fake.setOrgRoleByGUIDReturns.result1 416 } 417 } 418 419 func (fake *FakeUserRepository) SetOrgRoleByGUIDCallCount() int { 420 fake.setOrgRoleByGUIDMutex.RLock() 421 defer fake.setOrgRoleByGUIDMutex.RUnlock() 422 return len(fake.setOrgRoleByGUIDArgsForCall) 423 } 424 425 func (fake *FakeUserRepository) SetOrgRoleByGUIDArgsForCall(i int) (string, string, models.Role) { 426 fake.setOrgRoleByGUIDMutex.RLock() 427 defer fake.setOrgRoleByGUIDMutex.RUnlock() 428 return fake.setOrgRoleByGUIDArgsForCall[i].userGUID, fake.setOrgRoleByGUIDArgsForCall[i].orgGUID, fake.setOrgRoleByGUIDArgsForCall[i].role 429 } 430 431 func (fake *FakeUserRepository) SetOrgRoleByGUIDReturns(result1 error) { 432 fake.SetOrgRoleByGUIDStub = nil 433 fake.setOrgRoleByGUIDReturns = struct { 434 result1 error 435 }{result1} 436 } 437 438 func (fake *FakeUserRepository) SetOrgRoleByUsername(username string, orgGUID string, role models.Role) (apiErr error) { 439 fake.setOrgRoleByUsernameMutex.Lock() 440 fake.setOrgRoleByUsernameArgsForCall = append(fake.setOrgRoleByUsernameArgsForCall, struct { 441 username string 442 orgGUID string 443 role models.Role 444 }{username, orgGUID, role}) 445 fake.recordInvocation("SetOrgRoleByUsername", []interface{}{username, orgGUID, role}) 446 fake.setOrgRoleByUsernameMutex.Unlock() 447 if fake.SetOrgRoleByUsernameStub != nil { 448 return fake.SetOrgRoleByUsernameStub(username, orgGUID, role) 449 } else { 450 return fake.setOrgRoleByUsernameReturns.result1 451 } 452 } 453 454 func (fake *FakeUserRepository) SetOrgRoleByUsernameCallCount() int { 455 fake.setOrgRoleByUsernameMutex.RLock() 456 defer fake.setOrgRoleByUsernameMutex.RUnlock() 457 return len(fake.setOrgRoleByUsernameArgsForCall) 458 } 459 460 func (fake *FakeUserRepository) SetOrgRoleByUsernameArgsForCall(i int) (string, string, models.Role) { 461 fake.setOrgRoleByUsernameMutex.RLock() 462 defer fake.setOrgRoleByUsernameMutex.RUnlock() 463 return fake.setOrgRoleByUsernameArgsForCall[i].username, fake.setOrgRoleByUsernameArgsForCall[i].orgGUID, fake.setOrgRoleByUsernameArgsForCall[i].role 464 } 465 466 func (fake *FakeUserRepository) SetOrgRoleByUsernameReturns(result1 error) { 467 fake.SetOrgRoleByUsernameStub = nil 468 fake.setOrgRoleByUsernameReturns = struct { 469 result1 error 470 }{result1} 471 } 472 473 func (fake *FakeUserRepository) UnsetOrgRoleByGUID(userGUID string, orgGUID string, role models.Role) (apiErr error) { 474 fake.unsetOrgRoleByGUIDMutex.Lock() 475 fake.unsetOrgRoleByGUIDArgsForCall = append(fake.unsetOrgRoleByGUIDArgsForCall, struct { 476 userGUID string 477 orgGUID string 478 role models.Role 479 }{userGUID, orgGUID, role}) 480 fake.recordInvocation("UnsetOrgRoleByGUID", []interface{}{userGUID, orgGUID, role}) 481 fake.unsetOrgRoleByGUIDMutex.Unlock() 482 if fake.UnsetOrgRoleByGUIDStub != nil { 483 return fake.UnsetOrgRoleByGUIDStub(userGUID, orgGUID, role) 484 } else { 485 return fake.unsetOrgRoleByGUIDReturns.result1 486 } 487 } 488 489 func (fake *FakeUserRepository) UnsetOrgRoleByGUIDCallCount() int { 490 fake.unsetOrgRoleByGUIDMutex.RLock() 491 defer fake.unsetOrgRoleByGUIDMutex.RUnlock() 492 return len(fake.unsetOrgRoleByGUIDArgsForCall) 493 } 494 495 func (fake *FakeUserRepository) UnsetOrgRoleByGUIDArgsForCall(i int) (string, string, models.Role) { 496 fake.unsetOrgRoleByGUIDMutex.RLock() 497 defer fake.unsetOrgRoleByGUIDMutex.RUnlock() 498 return fake.unsetOrgRoleByGUIDArgsForCall[i].userGUID, fake.unsetOrgRoleByGUIDArgsForCall[i].orgGUID, fake.unsetOrgRoleByGUIDArgsForCall[i].role 499 } 500 501 func (fake *FakeUserRepository) UnsetOrgRoleByGUIDReturns(result1 error) { 502 fake.UnsetOrgRoleByGUIDStub = nil 503 fake.unsetOrgRoleByGUIDReturns = struct { 504 result1 error 505 }{result1} 506 } 507 508 func (fake *FakeUserRepository) UnsetOrgRoleByUsername(username string, orgGUID string, role models.Role) (apiErr error) { 509 fake.unsetOrgRoleByUsernameMutex.Lock() 510 fake.unsetOrgRoleByUsernameArgsForCall = append(fake.unsetOrgRoleByUsernameArgsForCall, struct { 511 username string 512 orgGUID string 513 role models.Role 514 }{username, orgGUID, role}) 515 fake.recordInvocation("UnsetOrgRoleByUsername", []interface{}{username, orgGUID, role}) 516 fake.unsetOrgRoleByUsernameMutex.Unlock() 517 if fake.UnsetOrgRoleByUsernameStub != nil { 518 return fake.UnsetOrgRoleByUsernameStub(username, orgGUID, role) 519 } else { 520 return fake.unsetOrgRoleByUsernameReturns.result1 521 } 522 } 523 524 func (fake *FakeUserRepository) UnsetOrgRoleByUsernameCallCount() int { 525 fake.unsetOrgRoleByUsernameMutex.RLock() 526 defer fake.unsetOrgRoleByUsernameMutex.RUnlock() 527 return len(fake.unsetOrgRoleByUsernameArgsForCall) 528 } 529 530 func (fake *FakeUserRepository) UnsetOrgRoleByUsernameArgsForCall(i int) (string, string, models.Role) { 531 fake.unsetOrgRoleByUsernameMutex.RLock() 532 defer fake.unsetOrgRoleByUsernameMutex.RUnlock() 533 return fake.unsetOrgRoleByUsernameArgsForCall[i].username, fake.unsetOrgRoleByUsernameArgsForCall[i].orgGUID, fake.unsetOrgRoleByUsernameArgsForCall[i].role 534 } 535 536 func (fake *FakeUserRepository) UnsetOrgRoleByUsernameReturns(result1 error) { 537 fake.UnsetOrgRoleByUsernameStub = nil 538 fake.unsetOrgRoleByUsernameReturns = struct { 539 result1 error 540 }{result1} 541 } 542 543 func (fake *FakeUserRepository) SetSpaceRoleByGUID(userGUID string, spaceGUID string, orgGUID string, role models.Role) (apiErr error) { 544 fake.setSpaceRoleByGUIDMutex.Lock() 545 fake.setSpaceRoleByGUIDArgsForCall = append(fake.setSpaceRoleByGUIDArgsForCall, struct { 546 userGUID string 547 spaceGUID string 548 orgGUID string 549 role models.Role 550 }{userGUID, spaceGUID, orgGUID, role}) 551 fake.recordInvocation("SetSpaceRoleByGUID", []interface{}{userGUID, spaceGUID, orgGUID, role}) 552 fake.setSpaceRoleByGUIDMutex.Unlock() 553 if fake.SetSpaceRoleByGUIDStub != nil { 554 return fake.SetSpaceRoleByGUIDStub(userGUID, spaceGUID, orgGUID, role) 555 } else { 556 return fake.setSpaceRoleByGUIDReturns.result1 557 } 558 } 559 560 func (fake *FakeUserRepository) SetSpaceRoleByGUIDCallCount() int { 561 fake.setSpaceRoleByGUIDMutex.RLock() 562 defer fake.setSpaceRoleByGUIDMutex.RUnlock() 563 return len(fake.setSpaceRoleByGUIDArgsForCall) 564 } 565 566 func (fake *FakeUserRepository) SetSpaceRoleByGUIDArgsForCall(i int) (string, string, string, models.Role) { 567 fake.setSpaceRoleByGUIDMutex.RLock() 568 defer fake.setSpaceRoleByGUIDMutex.RUnlock() 569 return fake.setSpaceRoleByGUIDArgsForCall[i].userGUID, fake.setSpaceRoleByGUIDArgsForCall[i].spaceGUID, fake.setSpaceRoleByGUIDArgsForCall[i].orgGUID, fake.setSpaceRoleByGUIDArgsForCall[i].role 570 } 571 572 func (fake *FakeUserRepository) SetSpaceRoleByGUIDReturns(result1 error) { 573 fake.SetSpaceRoleByGUIDStub = nil 574 fake.setSpaceRoleByGUIDReturns = struct { 575 result1 error 576 }{result1} 577 } 578 579 func (fake *FakeUserRepository) SetSpaceRoleByUsername(username string, spaceGUID string, orgGUID string, role models.Role) (apiErr error) { 580 fake.setSpaceRoleByUsernameMutex.Lock() 581 fake.setSpaceRoleByUsernameArgsForCall = append(fake.setSpaceRoleByUsernameArgsForCall, struct { 582 username string 583 spaceGUID string 584 orgGUID string 585 role models.Role 586 }{username, spaceGUID, orgGUID, role}) 587 fake.recordInvocation("SetSpaceRoleByUsername", []interface{}{username, spaceGUID, orgGUID, role}) 588 fake.setSpaceRoleByUsernameMutex.Unlock() 589 if fake.SetSpaceRoleByUsernameStub != nil { 590 return fake.SetSpaceRoleByUsernameStub(username, spaceGUID, orgGUID, role) 591 } else { 592 return fake.setSpaceRoleByUsernameReturns.result1 593 } 594 } 595 596 func (fake *FakeUserRepository) SetSpaceRoleByUsernameCallCount() int { 597 fake.setSpaceRoleByUsernameMutex.RLock() 598 defer fake.setSpaceRoleByUsernameMutex.RUnlock() 599 return len(fake.setSpaceRoleByUsernameArgsForCall) 600 } 601 602 func (fake *FakeUserRepository) SetSpaceRoleByUsernameArgsForCall(i int) (string, string, string, models.Role) { 603 fake.setSpaceRoleByUsernameMutex.RLock() 604 defer fake.setSpaceRoleByUsernameMutex.RUnlock() 605 return fake.setSpaceRoleByUsernameArgsForCall[i].username, fake.setSpaceRoleByUsernameArgsForCall[i].spaceGUID, fake.setSpaceRoleByUsernameArgsForCall[i].orgGUID, fake.setSpaceRoleByUsernameArgsForCall[i].role 606 } 607 608 func (fake *FakeUserRepository) SetSpaceRoleByUsernameReturns(result1 error) { 609 fake.SetSpaceRoleByUsernameStub = nil 610 fake.setSpaceRoleByUsernameReturns = struct { 611 result1 error 612 }{result1} 613 } 614 615 func (fake *FakeUserRepository) UnsetSpaceRoleByGUID(userGUID string, spaceGUID string, role models.Role) (apiErr error) { 616 fake.unsetSpaceRoleByGUIDMutex.Lock() 617 fake.unsetSpaceRoleByGUIDArgsForCall = append(fake.unsetSpaceRoleByGUIDArgsForCall, struct { 618 userGUID string 619 spaceGUID string 620 role models.Role 621 }{userGUID, spaceGUID, role}) 622 fake.recordInvocation("UnsetSpaceRoleByGUID", []interface{}{userGUID, spaceGUID, role}) 623 fake.unsetSpaceRoleByGUIDMutex.Unlock() 624 if fake.UnsetSpaceRoleByGUIDStub != nil { 625 return fake.UnsetSpaceRoleByGUIDStub(userGUID, spaceGUID, role) 626 } else { 627 return fake.unsetSpaceRoleByGUIDReturns.result1 628 } 629 } 630 631 func (fake *FakeUserRepository) UnsetSpaceRoleByGUIDCallCount() int { 632 fake.unsetSpaceRoleByGUIDMutex.RLock() 633 defer fake.unsetSpaceRoleByGUIDMutex.RUnlock() 634 return len(fake.unsetSpaceRoleByGUIDArgsForCall) 635 } 636 637 func (fake *FakeUserRepository) UnsetSpaceRoleByGUIDArgsForCall(i int) (string, string, models.Role) { 638 fake.unsetSpaceRoleByGUIDMutex.RLock() 639 defer fake.unsetSpaceRoleByGUIDMutex.RUnlock() 640 return fake.unsetSpaceRoleByGUIDArgsForCall[i].userGUID, fake.unsetSpaceRoleByGUIDArgsForCall[i].spaceGUID, fake.unsetSpaceRoleByGUIDArgsForCall[i].role 641 } 642 643 func (fake *FakeUserRepository) UnsetSpaceRoleByGUIDReturns(result1 error) { 644 fake.UnsetSpaceRoleByGUIDStub = nil 645 fake.unsetSpaceRoleByGUIDReturns = struct { 646 result1 error 647 }{result1} 648 } 649 650 func (fake *FakeUserRepository) UnsetSpaceRoleByUsername(userGUID string, spaceGUID string, role models.Role) (apiErr error) { 651 fake.unsetSpaceRoleByUsernameMutex.Lock() 652 fake.unsetSpaceRoleByUsernameArgsForCall = append(fake.unsetSpaceRoleByUsernameArgsForCall, struct { 653 userGUID string 654 spaceGUID string 655 role models.Role 656 }{userGUID, spaceGUID, role}) 657 fake.recordInvocation("UnsetSpaceRoleByUsername", []interface{}{userGUID, spaceGUID, role}) 658 fake.unsetSpaceRoleByUsernameMutex.Unlock() 659 if fake.UnsetSpaceRoleByUsernameStub != nil { 660 return fake.UnsetSpaceRoleByUsernameStub(userGUID, spaceGUID, role) 661 } else { 662 return fake.unsetSpaceRoleByUsernameReturns.result1 663 } 664 } 665 666 func (fake *FakeUserRepository) UnsetSpaceRoleByUsernameCallCount() int { 667 fake.unsetSpaceRoleByUsernameMutex.RLock() 668 defer fake.unsetSpaceRoleByUsernameMutex.RUnlock() 669 return len(fake.unsetSpaceRoleByUsernameArgsForCall) 670 } 671 672 func (fake *FakeUserRepository) UnsetSpaceRoleByUsernameArgsForCall(i int) (string, string, models.Role) { 673 fake.unsetSpaceRoleByUsernameMutex.RLock() 674 defer fake.unsetSpaceRoleByUsernameMutex.RUnlock() 675 return fake.unsetSpaceRoleByUsernameArgsForCall[i].userGUID, fake.unsetSpaceRoleByUsernameArgsForCall[i].spaceGUID, fake.unsetSpaceRoleByUsernameArgsForCall[i].role 676 } 677 678 func (fake *FakeUserRepository) UnsetSpaceRoleByUsernameReturns(result1 error) { 679 fake.UnsetSpaceRoleByUsernameStub = nil 680 fake.unsetSpaceRoleByUsernameReturns = struct { 681 result1 error 682 }{result1} 683 } 684 685 func (fake *FakeUserRepository) Invocations() map[string][][]interface{} { 686 fake.invocationsMutex.RLock() 687 defer fake.invocationsMutex.RUnlock() 688 fake.findByUsernameMutex.RLock() 689 defer fake.findByUsernameMutex.RUnlock() 690 fake.findAllByUsernameMutex.RLock() 691 defer fake.findAllByUsernameMutex.RUnlock() 692 fake.listUsersInOrgForRoleMutex.RLock() 693 defer fake.listUsersInOrgForRoleMutex.RUnlock() 694 fake.listUsersInOrgForRoleWithNoUAAMutex.RLock() 695 defer fake.listUsersInOrgForRoleWithNoUAAMutex.RUnlock() 696 fake.listUsersInSpaceForRoleWithNoUAAMutex.RLock() 697 defer fake.listUsersInSpaceForRoleWithNoUAAMutex.RUnlock() 698 fake.createMutex.RLock() 699 defer fake.createMutex.RUnlock() 700 fake.deleteMutex.RLock() 701 defer fake.deleteMutex.RUnlock() 702 fake.setOrgRoleByGUIDMutex.RLock() 703 defer fake.setOrgRoleByGUIDMutex.RUnlock() 704 fake.setOrgRoleByUsernameMutex.RLock() 705 defer fake.setOrgRoleByUsernameMutex.RUnlock() 706 fake.unsetOrgRoleByGUIDMutex.RLock() 707 defer fake.unsetOrgRoleByGUIDMutex.RUnlock() 708 fake.unsetOrgRoleByUsernameMutex.RLock() 709 defer fake.unsetOrgRoleByUsernameMutex.RUnlock() 710 fake.setSpaceRoleByGUIDMutex.RLock() 711 defer fake.setSpaceRoleByGUIDMutex.RUnlock() 712 fake.setSpaceRoleByUsernameMutex.RLock() 713 defer fake.setSpaceRoleByUsernameMutex.RUnlock() 714 fake.unsetSpaceRoleByGUIDMutex.RLock() 715 defer fake.unsetSpaceRoleByGUIDMutex.RUnlock() 716 fake.unsetSpaceRoleByUsernameMutex.RLock() 717 defer fake.unsetSpaceRoleByUsernameMutex.RUnlock() 718 return fake.invocations 719 } 720 721 func (fake *FakeUserRepository) recordInvocation(key string, args []interface{}) { 722 fake.invocationsMutex.Lock() 723 defer fake.invocationsMutex.Unlock() 724 if fake.invocations == nil { 725 fake.invocations = map[string][][]interface{}{} 726 } 727 if fake.invocations[key] == nil { 728 fake.invocations[key] = [][]interface{}{} 729 } 730 fake.invocations[key] = append(fake.invocations[key], args) 731 } 732 733 var _ api.UserRepository = new(FakeUserRepository)