github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/quotas/quotasfakes/fake_quota_repository.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package quotasfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/api/quotas"
     8  	"code.cloudfoundry.org/cli/cf/models"
     9  )
    10  
    11  type FakeQuotaRepository struct {
    12  	AssignQuotaToOrgStub        func(string, string) error
    13  	assignQuotaToOrgMutex       sync.RWMutex
    14  	assignQuotaToOrgArgsForCall []struct {
    15  		arg1 string
    16  		arg2 string
    17  	}
    18  	assignQuotaToOrgReturns struct {
    19  		result1 error
    20  	}
    21  	assignQuotaToOrgReturnsOnCall map[int]struct {
    22  		result1 error
    23  	}
    24  	CreateStub        func(models.QuotaFields) error
    25  	createMutex       sync.RWMutex
    26  	createArgsForCall []struct {
    27  		arg1 models.QuotaFields
    28  	}
    29  	createReturns struct {
    30  		result1 error
    31  	}
    32  	createReturnsOnCall map[int]struct {
    33  		result1 error
    34  	}
    35  	DeleteStub        func(string) error
    36  	deleteMutex       sync.RWMutex
    37  	deleteArgsForCall []struct {
    38  		arg1 string
    39  	}
    40  	deleteReturns struct {
    41  		result1 error
    42  	}
    43  	deleteReturnsOnCall map[int]struct {
    44  		result1 error
    45  	}
    46  	FindAllStub        func() ([]models.QuotaFields, error)
    47  	findAllMutex       sync.RWMutex
    48  	findAllArgsForCall []struct {
    49  	}
    50  	findAllReturns struct {
    51  		result1 []models.QuotaFields
    52  		result2 error
    53  	}
    54  	findAllReturnsOnCall map[int]struct {
    55  		result1 []models.QuotaFields
    56  		result2 error
    57  	}
    58  	FindByNameStub        func(string) (models.QuotaFields, error)
    59  	findByNameMutex       sync.RWMutex
    60  	findByNameArgsForCall []struct {
    61  		arg1 string
    62  	}
    63  	findByNameReturns struct {
    64  		result1 models.QuotaFields
    65  		result2 error
    66  	}
    67  	findByNameReturnsOnCall map[int]struct {
    68  		result1 models.QuotaFields
    69  		result2 error
    70  	}
    71  	UpdateStub        func(models.QuotaFields) error
    72  	updateMutex       sync.RWMutex
    73  	updateArgsForCall []struct {
    74  		arg1 models.QuotaFields
    75  	}
    76  	updateReturns struct {
    77  		result1 error
    78  	}
    79  	updateReturnsOnCall map[int]struct {
    80  		result1 error
    81  	}
    82  	invocations      map[string][][]interface{}
    83  	invocationsMutex sync.RWMutex
    84  }
    85  
    86  func (fake *FakeQuotaRepository) AssignQuotaToOrg(arg1 string, arg2 string) error {
    87  	fake.assignQuotaToOrgMutex.Lock()
    88  	ret, specificReturn := fake.assignQuotaToOrgReturnsOnCall[len(fake.assignQuotaToOrgArgsForCall)]
    89  	fake.assignQuotaToOrgArgsForCall = append(fake.assignQuotaToOrgArgsForCall, struct {
    90  		arg1 string
    91  		arg2 string
    92  	}{arg1, arg2})
    93  	fake.recordInvocation("AssignQuotaToOrg", []interface{}{arg1, arg2})
    94  	fake.assignQuotaToOrgMutex.Unlock()
    95  	if fake.AssignQuotaToOrgStub != nil {
    96  		return fake.AssignQuotaToOrgStub(arg1, arg2)
    97  	}
    98  	if specificReturn {
    99  		return ret.result1
   100  	}
   101  	fakeReturns := fake.assignQuotaToOrgReturns
   102  	return fakeReturns.result1
   103  }
   104  
   105  func (fake *FakeQuotaRepository) AssignQuotaToOrgCallCount() int {
   106  	fake.assignQuotaToOrgMutex.RLock()
   107  	defer fake.assignQuotaToOrgMutex.RUnlock()
   108  	return len(fake.assignQuotaToOrgArgsForCall)
   109  }
   110  
   111  func (fake *FakeQuotaRepository) AssignQuotaToOrgCalls(stub func(string, string) error) {
   112  	fake.assignQuotaToOrgMutex.Lock()
   113  	defer fake.assignQuotaToOrgMutex.Unlock()
   114  	fake.AssignQuotaToOrgStub = stub
   115  }
   116  
   117  func (fake *FakeQuotaRepository) AssignQuotaToOrgArgsForCall(i int) (string, string) {
   118  	fake.assignQuotaToOrgMutex.RLock()
   119  	defer fake.assignQuotaToOrgMutex.RUnlock()
   120  	argsForCall := fake.assignQuotaToOrgArgsForCall[i]
   121  	return argsForCall.arg1, argsForCall.arg2
   122  }
   123  
   124  func (fake *FakeQuotaRepository) AssignQuotaToOrgReturns(result1 error) {
   125  	fake.assignQuotaToOrgMutex.Lock()
   126  	defer fake.assignQuotaToOrgMutex.Unlock()
   127  	fake.AssignQuotaToOrgStub = nil
   128  	fake.assignQuotaToOrgReturns = struct {
   129  		result1 error
   130  	}{result1}
   131  }
   132  
   133  func (fake *FakeQuotaRepository) AssignQuotaToOrgReturnsOnCall(i int, result1 error) {
   134  	fake.assignQuotaToOrgMutex.Lock()
   135  	defer fake.assignQuotaToOrgMutex.Unlock()
   136  	fake.AssignQuotaToOrgStub = nil
   137  	if fake.assignQuotaToOrgReturnsOnCall == nil {
   138  		fake.assignQuotaToOrgReturnsOnCall = make(map[int]struct {
   139  			result1 error
   140  		})
   141  	}
   142  	fake.assignQuotaToOrgReturnsOnCall[i] = struct {
   143  		result1 error
   144  	}{result1}
   145  }
   146  
   147  func (fake *FakeQuotaRepository) Create(arg1 models.QuotaFields) error {
   148  	fake.createMutex.Lock()
   149  	ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
   150  	fake.createArgsForCall = append(fake.createArgsForCall, struct {
   151  		arg1 models.QuotaFields
   152  	}{arg1})
   153  	fake.recordInvocation("Create", []interface{}{arg1})
   154  	fake.createMutex.Unlock()
   155  	if fake.CreateStub != nil {
   156  		return fake.CreateStub(arg1)
   157  	}
   158  	if specificReturn {
   159  		return ret.result1
   160  	}
   161  	fakeReturns := fake.createReturns
   162  	return fakeReturns.result1
   163  }
   164  
   165  func (fake *FakeQuotaRepository) CreateCallCount() int {
   166  	fake.createMutex.RLock()
   167  	defer fake.createMutex.RUnlock()
   168  	return len(fake.createArgsForCall)
   169  }
   170  
   171  func (fake *FakeQuotaRepository) CreateCalls(stub func(models.QuotaFields) error) {
   172  	fake.createMutex.Lock()
   173  	defer fake.createMutex.Unlock()
   174  	fake.CreateStub = stub
   175  }
   176  
   177  func (fake *FakeQuotaRepository) CreateArgsForCall(i int) models.QuotaFields {
   178  	fake.createMutex.RLock()
   179  	defer fake.createMutex.RUnlock()
   180  	argsForCall := fake.createArgsForCall[i]
   181  	return argsForCall.arg1
   182  }
   183  
   184  func (fake *FakeQuotaRepository) CreateReturns(result1 error) {
   185  	fake.createMutex.Lock()
   186  	defer fake.createMutex.Unlock()
   187  	fake.CreateStub = nil
   188  	fake.createReturns = struct {
   189  		result1 error
   190  	}{result1}
   191  }
   192  
   193  func (fake *FakeQuotaRepository) CreateReturnsOnCall(i int, result1 error) {
   194  	fake.createMutex.Lock()
   195  	defer fake.createMutex.Unlock()
   196  	fake.CreateStub = nil
   197  	if fake.createReturnsOnCall == nil {
   198  		fake.createReturnsOnCall = make(map[int]struct {
   199  			result1 error
   200  		})
   201  	}
   202  	fake.createReturnsOnCall[i] = struct {
   203  		result1 error
   204  	}{result1}
   205  }
   206  
   207  func (fake *FakeQuotaRepository) Delete(arg1 string) error {
   208  	fake.deleteMutex.Lock()
   209  	ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)]
   210  	fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
   211  		arg1 string
   212  	}{arg1})
   213  	fake.recordInvocation("Delete", []interface{}{arg1})
   214  	fake.deleteMutex.Unlock()
   215  	if fake.DeleteStub != nil {
   216  		return fake.DeleteStub(arg1)
   217  	}
   218  	if specificReturn {
   219  		return ret.result1
   220  	}
   221  	fakeReturns := fake.deleteReturns
   222  	return fakeReturns.result1
   223  }
   224  
   225  func (fake *FakeQuotaRepository) DeleteCallCount() int {
   226  	fake.deleteMutex.RLock()
   227  	defer fake.deleteMutex.RUnlock()
   228  	return len(fake.deleteArgsForCall)
   229  }
   230  
   231  func (fake *FakeQuotaRepository) DeleteCalls(stub func(string) error) {
   232  	fake.deleteMutex.Lock()
   233  	defer fake.deleteMutex.Unlock()
   234  	fake.DeleteStub = stub
   235  }
   236  
   237  func (fake *FakeQuotaRepository) DeleteArgsForCall(i int) string {
   238  	fake.deleteMutex.RLock()
   239  	defer fake.deleteMutex.RUnlock()
   240  	argsForCall := fake.deleteArgsForCall[i]
   241  	return argsForCall.arg1
   242  }
   243  
   244  func (fake *FakeQuotaRepository) DeleteReturns(result1 error) {
   245  	fake.deleteMutex.Lock()
   246  	defer fake.deleteMutex.Unlock()
   247  	fake.DeleteStub = nil
   248  	fake.deleteReturns = struct {
   249  		result1 error
   250  	}{result1}
   251  }
   252  
   253  func (fake *FakeQuotaRepository) DeleteReturnsOnCall(i int, result1 error) {
   254  	fake.deleteMutex.Lock()
   255  	defer fake.deleteMutex.Unlock()
   256  	fake.DeleteStub = nil
   257  	if fake.deleteReturnsOnCall == nil {
   258  		fake.deleteReturnsOnCall = make(map[int]struct {
   259  			result1 error
   260  		})
   261  	}
   262  	fake.deleteReturnsOnCall[i] = struct {
   263  		result1 error
   264  	}{result1}
   265  }
   266  
   267  func (fake *FakeQuotaRepository) FindAll() ([]models.QuotaFields, error) {
   268  	fake.findAllMutex.Lock()
   269  	ret, specificReturn := fake.findAllReturnsOnCall[len(fake.findAllArgsForCall)]
   270  	fake.findAllArgsForCall = append(fake.findAllArgsForCall, struct {
   271  	}{})
   272  	fake.recordInvocation("FindAll", []interface{}{})
   273  	fake.findAllMutex.Unlock()
   274  	if fake.FindAllStub != nil {
   275  		return fake.FindAllStub()
   276  	}
   277  	if specificReturn {
   278  		return ret.result1, ret.result2
   279  	}
   280  	fakeReturns := fake.findAllReturns
   281  	return fakeReturns.result1, fakeReturns.result2
   282  }
   283  
   284  func (fake *FakeQuotaRepository) FindAllCallCount() int {
   285  	fake.findAllMutex.RLock()
   286  	defer fake.findAllMutex.RUnlock()
   287  	return len(fake.findAllArgsForCall)
   288  }
   289  
   290  func (fake *FakeQuotaRepository) FindAllCalls(stub func() ([]models.QuotaFields, error)) {
   291  	fake.findAllMutex.Lock()
   292  	defer fake.findAllMutex.Unlock()
   293  	fake.FindAllStub = stub
   294  }
   295  
   296  func (fake *FakeQuotaRepository) FindAllReturns(result1 []models.QuotaFields, result2 error) {
   297  	fake.findAllMutex.Lock()
   298  	defer fake.findAllMutex.Unlock()
   299  	fake.FindAllStub = nil
   300  	fake.findAllReturns = struct {
   301  		result1 []models.QuotaFields
   302  		result2 error
   303  	}{result1, result2}
   304  }
   305  
   306  func (fake *FakeQuotaRepository) FindAllReturnsOnCall(i int, result1 []models.QuotaFields, result2 error) {
   307  	fake.findAllMutex.Lock()
   308  	defer fake.findAllMutex.Unlock()
   309  	fake.FindAllStub = nil
   310  	if fake.findAllReturnsOnCall == nil {
   311  		fake.findAllReturnsOnCall = make(map[int]struct {
   312  			result1 []models.QuotaFields
   313  			result2 error
   314  		})
   315  	}
   316  	fake.findAllReturnsOnCall[i] = struct {
   317  		result1 []models.QuotaFields
   318  		result2 error
   319  	}{result1, result2}
   320  }
   321  
   322  func (fake *FakeQuotaRepository) FindByName(arg1 string) (models.QuotaFields, error) {
   323  	fake.findByNameMutex.Lock()
   324  	ret, specificReturn := fake.findByNameReturnsOnCall[len(fake.findByNameArgsForCall)]
   325  	fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct {
   326  		arg1 string
   327  	}{arg1})
   328  	fake.recordInvocation("FindByName", []interface{}{arg1})
   329  	fake.findByNameMutex.Unlock()
   330  	if fake.FindByNameStub != nil {
   331  		return fake.FindByNameStub(arg1)
   332  	}
   333  	if specificReturn {
   334  		return ret.result1, ret.result2
   335  	}
   336  	fakeReturns := fake.findByNameReturns
   337  	return fakeReturns.result1, fakeReturns.result2
   338  }
   339  
   340  func (fake *FakeQuotaRepository) FindByNameCallCount() int {
   341  	fake.findByNameMutex.RLock()
   342  	defer fake.findByNameMutex.RUnlock()
   343  	return len(fake.findByNameArgsForCall)
   344  }
   345  
   346  func (fake *FakeQuotaRepository) FindByNameCalls(stub func(string) (models.QuotaFields, error)) {
   347  	fake.findByNameMutex.Lock()
   348  	defer fake.findByNameMutex.Unlock()
   349  	fake.FindByNameStub = stub
   350  }
   351  
   352  func (fake *FakeQuotaRepository) FindByNameArgsForCall(i int) string {
   353  	fake.findByNameMutex.RLock()
   354  	defer fake.findByNameMutex.RUnlock()
   355  	argsForCall := fake.findByNameArgsForCall[i]
   356  	return argsForCall.arg1
   357  }
   358  
   359  func (fake *FakeQuotaRepository) FindByNameReturns(result1 models.QuotaFields, result2 error) {
   360  	fake.findByNameMutex.Lock()
   361  	defer fake.findByNameMutex.Unlock()
   362  	fake.FindByNameStub = nil
   363  	fake.findByNameReturns = struct {
   364  		result1 models.QuotaFields
   365  		result2 error
   366  	}{result1, result2}
   367  }
   368  
   369  func (fake *FakeQuotaRepository) FindByNameReturnsOnCall(i int, result1 models.QuotaFields, result2 error) {
   370  	fake.findByNameMutex.Lock()
   371  	defer fake.findByNameMutex.Unlock()
   372  	fake.FindByNameStub = nil
   373  	if fake.findByNameReturnsOnCall == nil {
   374  		fake.findByNameReturnsOnCall = make(map[int]struct {
   375  			result1 models.QuotaFields
   376  			result2 error
   377  		})
   378  	}
   379  	fake.findByNameReturnsOnCall[i] = struct {
   380  		result1 models.QuotaFields
   381  		result2 error
   382  	}{result1, result2}
   383  }
   384  
   385  func (fake *FakeQuotaRepository) Update(arg1 models.QuotaFields) error {
   386  	fake.updateMutex.Lock()
   387  	ret, specificReturn := fake.updateReturnsOnCall[len(fake.updateArgsForCall)]
   388  	fake.updateArgsForCall = append(fake.updateArgsForCall, struct {
   389  		arg1 models.QuotaFields
   390  	}{arg1})
   391  	fake.recordInvocation("Update", []interface{}{arg1})
   392  	fake.updateMutex.Unlock()
   393  	if fake.UpdateStub != nil {
   394  		return fake.UpdateStub(arg1)
   395  	}
   396  	if specificReturn {
   397  		return ret.result1
   398  	}
   399  	fakeReturns := fake.updateReturns
   400  	return fakeReturns.result1
   401  }
   402  
   403  func (fake *FakeQuotaRepository) UpdateCallCount() int {
   404  	fake.updateMutex.RLock()
   405  	defer fake.updateMutex.RUnlock()
   406  	return len(fake.updateArgsForCall)
   407  }
   408  
   409  func (fake *FakeQuotaRepository) UpdateCalls(stub func(models.QuotaFields) error) {
   410  	fake.updateMutex.Lock()
   411  	defer fake.updateMutex.Unlock()
   412  	fake.UpdateStub = stub
   413  }
   414  
   415  func (fake *FakeQuotaRepository) UpdateArgsForCall(i int) models.QuotaFields {
   416  	fake.updateMutex.RLock()
   417  	defer fake.updateMutex.RUnlock()
   418  	argsForCall := fake.updateArgsForCall[i]
   419  	return argsForCall.arg1
   420  }
   421  
   422  func (fake *FakeQuotaRepository) UpdateReturns(result1 error) {
   423  	fake.updateMutex.Lock()
   424  	defer fake.updateMutex.Unlock()
   425  	fake.UpdateStub = nil
   426  	fake.updateReturns = struct {
   427  		result1 error
   428  	}{result1}
   429  }
   430  
   431  func (fake *FakeQuotaRepository) UpdateReturnsOnCall(i int, result1 error) {
   432  	fake.updateMutex.Lock()
   433  	defer fake.updateMutex.Unlock()
   434  	fake.UpdateStub = nil
   435  	if fake.updateReturnsOnCall == nil {
   436  		fake.updateReturnsOnCall = make(map[int]struct {
   437  			result1 error
   438  		})
   439  	}
   440  	fake.updateReturnsOnCall[i] = struct {
   441  		result1 error
   442  	}{result1}
   443  }
   444  
   445  func (fake *FakeQuotaRepository) Invocations() map[string][][]interface{} {
   446  	fake.invocationsMutex.RLock()
   447  	defer fake.invocationsMutex.RUnlock()
   448  	fake.assignQuotaToOrgMutex.RLock()
   449  	defer fake.assignQuotaToOrgMutex.RUnlock()
   450  	fake.createMutex.RLock()
   451  	defer fake.createMutex.RUnlock()
   452  	fake.deleteMutex.RLock()
   453  	defer fake.deleteMutex.RUnlock()
   454  	fake.findAllMutex.RLock()
   455  	defer fake.findAllMutex.RUnlock()
   456  	fake.findByNameMutex.RLock()
   457  	defer fake.findByNameMutex.RUnlock()
   458  	fake.updateMutex.RLock()
   459  	defer fake.updateMutex.RUnlock()
   460  	copiedInvocations := map[string][][]interface{}{}
   461  	for key, value := range fake.invocations {
   462  		copiedInvocations[key] = value
   463  	}
   464  	return copiedInvocations
   465  }
   466  
   467  func (fake *FakeQuotaRepository) recordInvocation(key string, args []interface{}) {
   468  	fake.invocationsMutex.Lock()
   469  	defer fake.invocationsMutex.Unlock()
   470  	if fake.invocations == nil {
   471  		fake.invocations = map[string][][]interface{}{}
   472  	}
   473  	if fake.invocations[key] == nil {
   474  		fake.invocations[key] = [][]interface{}{}
   475  	}
   476  	fake.invocations[key] = append(fake.invocations[key], args)
   477  }
   478  
   479  var _ quotas.QuotaRepository = new(FakeQuotaRepository)