github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/cfnetworkingaction/cfnetworkingactionfakes/fake_cloud_controller_client.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package cfnetworkingactionfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/cfnetworkingaction"
     8  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
     9  	"code.cloudfoundry.org/cli/resources"
    10  )
    11  
    12  type FakeCloudControllerClient struct {
    13  	GetApplicationByNameAndSpaceStub        func(string, string) (resources.Application, ccv3.Warnings, error)
    14  	getApplicationByNameAndSpaceMutex       sync.RWMutex
    15  	getApplicationByNameAndSpaceArgsForCall []struct {
    16  		arg1 string
    17  		arg2 string
    18  	}
    19  	getApplicationByNameAndSpaceReturns struct {
    20  		result1 resources.Application
    21  		result2 ccv3.Warnings
    22  		result3 error
    23  	}
    24  	getApplicationByNameAndSpaceReturnsOnCall map[int]struct {
    25  		result1 resources.Application
    26  		result2 ccv3.Warnings
    27  		result3 error
    28  	}
    29  	GetApplicationsStub        func(...ccv3.Query) ([]resources.Application, ccv3.Warnings, error)
    30  	getApplicationsMutex       sync.RWMutex
    31  	getApplicationsArgsForCall []struct {
    32  		arg1 []ccv3.Query
    33  	}
    34  	getApplicationsReturns struct {
    35  		result1 []resources.Application
    36  		result2 ccv3.Warnings
    37  		result3 error
    38  	}
    39  	getApplicationsReturnsOnCall map[int]struct {
    40  		result1 []resources.Application
    41  		result2 ccv3.Warnings
    42  		result3 error
    43  	}
    44  	GetOrganizationsStub        func(...ccv3.Query) ([]resources.Organization, ccv3.Warnings, error)
    45  	getOrganizationsMutex       sync.RWMutex
    46  	getOrganizationsArgsForCall []struct {
    47  		arg1 []ccv3.Query
    48  	}
    49  	getOrganizationsReturns struct {
    50  		result1 []resources.Organization
    51  		result2 ccv3.Warnings
    52  		result3 error
    53  	}
    54  	getOrganizationsReturnsOnCall map[int]struct {
    55  		result1 []resources.Organization
    56  		result2 ccv3.Warnings
    57  		result3 error
    58  	}
    59  	GetSpacesStub        func(...ccv3.Query) ([]resources.Space, ccv3.IncludedResources, ccv3.Warnings, error)
    60  	getSpacesMutex       sync.RWMutex
    61  	getSpacesArgsForCall []struct {
    62  		arg1 []ccv3.Query
    63  	}
    64  	getSpacesReturns struct {
    65  		result1 []resources.Space
    66  		result2 ccv3.IncludedResources
    67  		result3 ccv3.Warnings
    68  		result4 error
    69  	}
    70  	getSpacesReturnsOnCall map[int]struct {
    71  		result1 []resources.Space
    72  		result2 ccv3.IncludedResources
    73  		result3 ccv3.Warnings
    74  		result4 error
    75  	}
    76  	invocations      map[string][][]interface{}
    77  	invocationsMutex sync.RWMutex
    78  }
    79  
    80  func (fake *FakeCloudControllerClient) GetApplicationByNameAndSpace(arg1 string, arg2 string) (resources.Application, ccv3.Warnings, error) {
    81  	fake.getApplicationByNameAndSpaceMutex.Lock()
    82  	ret, specificReturn := fake.getApplicationByNameAndSpaceReturnsOnCall[len(fake.getApplicationByNameAndSpaceArgsForCall)]
    83  	fake.getApplicationByNameAndSpaceArgsForCall = append(fake.getApplicationByNameAndSpaceArgsForCall, struct {
    84  		arg1 string
    85  		arg2 string
    86  	}{arg1, arg2})
    87  	fake.recordInvocation("GetApplicationByNameAndSpace", []interface{}{arg1, arg2})
    88  	fake.getApplicationByNameAndSpaceMutex.Unlock()
    89  	if fake.GetApplicationByNameAndSpaceStub != nil {
    90  		return fake.GetApplicationByNameAndSpaceStub(arg1, arg2)
    91  	}
    92  	if specificReturn {
    93  		return ret.result1, ret.result2, ret.result3
    94  	}
    95  	fakeReturns := fake.getApplicationByNameAndSpaceReturns
    96  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
    97  }
    98  
    99  func (fake *FakeCloudControllerClient) GetApplicationByNameAndSpaceCallCount() int {
   100  	fake.getApplicationByNameAndSpaceMutex.RLock()
   101  	defer fake.getApplicationByNameAndSpaceMutex.RUnlock()
   102  	return len(fake.getApplicationByNameAndSpaceArgsForCall)
   103  }
   104  
   105  func (fake *FakeCloudControllerClient) GetApplicationByNameAndSpaceCalls(stub func(string, string) (resources.Application, ccv3.Warnings, error)) {
   106  	fake.getApplicationByNameAndSpaceMutex.Lock()
   107  	defer fake.getApplicationByNameAndSpaceMutex.Unlock()
   108  	fake.GetApplicationByNameAndSpaceStub = stub
   109  }
   110  
   111  func (fake *FakeCloudControllerClient) GetApplicationByNameAndSpaceArgsForCall(i int) (string, string) {
   112  	fake.getApplicationByNameAndSpaceMutex.RLock()
   113  	defer fake.getApplicationByNameAndSpaceMutex.RUnlock()
   114  	argsForCall := fake.getApplicationByNameAndSpaceArgsForCall[i]
   115  	return argsForCall.arg1, argsForCall.arg2
   116  }
   117  
   118  func (fake *FakeCloudControllerClient) GetApplicationByNameAndSpaceReturns(result1 resources.Application, result2 ccv3.Warnings, result3 error) {
   119  	fake.getApplicationByNameAndSpaceMutex.Lock()
   120  	defer fake.getApplicationByNameAndSpaceMutex.Unlock()
   121  	fake.GetApplicationByNameAndSpaceStub = nil
   122  	fake.getApplicationByNameAndSpaceReturns = struct {
   123  		result1 resources.Application
   124  		result2 ccv3.Warnings
   125  		result3 error
   126  	}{result1, result2, result3}
   127  }
   128  
   129  func (fake *FakeCloudControllerClient) GetApplicationByNameAndSpaceReturnsOnCall(i int, result1 resources.Application, result2 ccv3.Warnings, result3 error) {
   130  	fake.getApplicationByNameAndSpaceMutex.Lock()
   131  	defer fake.getApplicationByNameAndSpaceMutex.Unlock()
   132  	fake.GetApplicationByNameAndSpaceStub = nil
   133  	if fake.getApplicationByNameAndSpaceReturnsOnCall == nil {
   134  		fake.getApplicationByNameAndSpaceReturnsOnCall = make(map[int]struct {
   135  			result1 resources.Application
   136  			result2 ccv3.Warnings
   137  			result3 error
   138  		})
   139  	}
   140  	fake.getApplicationByNameAndSpaceReturnsOnCall[i] = struct {
   141  		result1 resources.Application
   142  		result2 ccv3.Warnings
   143  		result3 error
   144  	}{result1, result2, result3}
   145  }
   146  
   147  func (fake *FakeCloudControllerClient) GetApplications(arg1 ...ccv3.Query) ([]resources.Application, ccv3.Warnings, error) {
   148  	fake.getApplicationsMutex.Lock()
   149  	ret, specificReturn := fake.getApplicationsReturnsOnCall[len(fake.getApplicationsArgsForCall)]
   150  	fake.getApplicationsArgsForCall = append(fake.getApplicationsArgsForCall, struct {
   151  		arg1 []ccv3.Query
   152  	}{arg1})
   153  	fake.recordInvocation("GetApplications", []interface{}{arg1})
   154  	fake.getApplicationsMutex.Unlock()
   155  	if fake.GetApplicationsStub != nil {
   156  		return fake.GetApplicationsStub(arg1...)
   157  	}
   158  	if specificReturn {
   159  		return ret.result1, ret.result2, ret.result3
   160  	}
   161  	fakeReturns := fake.getApplicationsReturns
   162  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
   163  }
   164  
   165  func (fake *FakeCloudControllerClient) GetApplicationsCallCount() int {
   166  	fake.getApplicationsMutex.RLock()
   167  	defer fake.getApplicationsMutex.RUnlock()
   168  	return len(fake.getApplicationsArgsForCall)
   169  }
   170  
   171  func (fake *FakeCloudControllerClient) GetApplicationsCalls(stub func(...ccv3.Query) ([]resources.Application, ccv3.Warnings, error)) {
   172  	fake.getApplicationsMutex.Lock()
   173  	defer fake.getApplicationsMutex.Unlock()
   174  	fake.GetApplicationsStub = stub
   175  }
   176  
   177  func (fake *FakeCloudControllerClient) GetApplicationsArgsForCall(i int) []ccv3.Query {
   178  	fake.getApplicationsMutex.RLock()
   179  	defer fake.getApplicationsMutex.RUnlock()
   180  	argsForCall := fake.getApplicationsArgsForCall[i]
   181  	return argsForCall.arg1
   182  }
   183  
   184  func (fake *FakeCloudControllerClient) GetApplicationsReturns(result1 []resources.Application, result2 ccv3.Warnings, result3 error) {
   185  	fake.getApplicationsMutex.Lock()
   186  	defer fake.getApplicationsMutex.Unlock()
   187  	fake.GetApplicationsStub = nil
   188  	fake.getApplicationsReturns = struct {
   189  		result1 []resources.Application
   190  		result2 ccv3.Warnings
   191  		result3 error
   192  	}{result1, result2, result3}
   193  }
   194  
   195  func (fake *FakeCloudControllerClient) GetApplicationsReturnsOnCall(i int, result1 []resources.Application, result2 ccv3.Warnings, result3 error) {
   196  	fake.getApplicationsMutex.Lock()
   197  	defer fake.getApplicationsMutex.Unlock()
   198  	fake.GetApplicationsStub = nil
   199  	if fake.getApplicationsReturnsOnCall == nil {
   200  		fake.getApplicationsReturnsOnCall = make(map[int]struct {
   201  			result1 []resources.Application
   202  			result2 ccv3.Warnings
   203  			result3 error
   204  		})
   205  	}
   206  	fake.getApplicationsReturnsOnCall[i] = struct {
   207  		result1 []resources.Application
   208  		result2 ccv3.Warnings
   209  		result3 error
   210  	}{result1, result2, result3}
   211  }
   212  
   213  func (fake *FakeCloudControllerClient) GetOrganizations(arg1 ...ccv3.Query) ([]resources.Organization, ccv3.Warnings, error) {
   214  	fake.getOrganizationsMutex.Lock()
   215  	ret, specificReturn := fake.getOrganizationsReturnsOnCall[len(fake.getOrganizationsArgsForCall)]
   216  	fake.getOrganizationsArgsForCall = append(fake.getOrganizationsArgsForCall, struct {
   217  		arg1 []ccv3.Query
   218  	}{arg1})
   219  	fake.recordInvocation("GetOrganizations", []interface{}{arg1})
   220  	fake.getOrganizationsMutex.Unlock()
   221  	if fake.GetOrganizationsStub != nil {
   222  		return fake.GetOrganizationsStub(arg1...)
   223  	}
   224  	if specificReturn {
   225  		return ret.result1, ret.result2, ret.result3
   226  	}
   227  	fakeReturns := fake.getOrganizationsReturns
   228  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
   229  }
   230  
   231  func (fake *FakeCloudControllerClient) GetOrganizationsCallCount() int {
   232  	fake.getOrganizationsMutex.RLock()
   233  	defer fake.getOrganizationsMutex.RUnlock()
   234  	return len(fake.getOrganizationsArgsForCall)
   235  }
   236  
   237  func (fake *FakeCloudControllerClient) GetOrganizationsCalls(stub func(...ccv3.Query) ([]resources.Organization, ccv3.Warnings, error)) {
   238  	fake.getOrganizationsMutex.Lock()
   239  	defer fake.getOrganizationsMutex.Unlock()
   240  	fake.GetOrganizationsStub = stub
   241  }
   242  
   243  func (fake *FakeCloudControllerClient) GetOrganizationsArgsForCall(i int) []ccv3.Query {
   244  	fake.getOrganizationsMutex.RLock()
   245  	defer fake.getOrganizationsMutex.RUnlock()
   246  	argsForCall := fake.getOrganizationsArgsForCall[i]
   247  	return argsForCall.arg1
   248  }
   249  
   250  func (fake *FakeCloudControllerClient) GetOrganizationsReturns(result1 []resources.Organization, result2 ccv3.Warnings, result3 error) {
   251  	fake.getOrganizationsMutex.Lock()
   252  	defer fake.getOrganizationsMutex.Unlock()
   253  	fake.GetOrganizationsStub = nil
   254  	fake.getOrganizationsReturns = struct {
   255  		result1 []resources.Organization
   256  		result2 ccv3.Warnings
   257  		result3 error
   258  	}{result1, result2, result3}
   259  }
   260  
   261  func (fake *FakeCloudControllerClient) GetOrganizationsReturnsOnCall(i int, result1 []resources.Organization, result2 ccv3.Warnings, result3 error) {
   262  	fake.getOrganizationsMutex.Lock()
   263  	defer fake.getOrganizationsMutex.Unlock()
   264  	fake.GetOrganizationsStub = nil
   265  	if fake.getOrganizationsReturnsOnCall == nil {
   266  		fake.getOrganizationsReturnsOnCall = make(map[int]struct {
   267  			result1 []resources.Organization
   268  			result2 ccv3.Warnings
   269  			result3 error
   270  		})
   271  	}
   272  	fake.getOrganizationsReturnsOnCall[i] = struct {
   273  		result1 []resources.Organization
   274  		result2 ccv3.Warnings
   275  		result3 error
   276  	}{result1, result2, result3}
   277  }
   278  
   279  func (fake *FakeCloudControllerClient) GetSpaces(arg1 ...ccv3.Query) ([]resources.Space, ccv3.IncludedResources, ccv3.Warnings, error) {
   280  	fake.getSpacesMutex.Lock()
   281  	ret, specificReturn := fake.getSpacesReturnsOnCall[len(fake.getSpacesArgsForCall)]
   282  	fake.getSpacesArgsForCall = append(fake.getSpacesArgsForCall, struct {
   283  		arg1 []ccv3.Query
   284  	}{arg1})
   285  	fake.recordInvocation("GetSpaces", []interface{}{arg1})
   286  	fake.getSpacesMutex.Unlock()
   287  	if fake.GetSpacesStub != nil {
   288  		return fake.GetSpacesStub(arg1...)
   289  	}
   290  	if specificReturn {
   291  		return ret.result1, ret.result2, ret.result3, ret.result4
   292  	}
   293  	fakeReturns := fake.getSpacesReturns
   294  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3, fakeReturns.result4
   295  }
   296  
   297  func (fake *FakeCloudControllerClient) GetSpacesCallCount() int {
   298  	fake.getSpacesMutex.RLock()
   299  	defer fake.getSpacesMutex.RUnlock()
   300  	return len(fake.getSpacesArgsForCall)
   301  }
   302  
   303  func (fake *FakeCloudControllerClient) GetSpacesCalls(stub func(...ccv3.Query) ([]resources.Space, ccv3.IncludedResources, ccv3.Warnings, error)) {
   304  	fake.getSpacesMutex.Lock()
   305  	defer fake.getSpacesMutex.Unlock()
   306  	fake.GetSpacesStub = stub
   307  }
   308  
   309  func (fake *FakeCloudControllerClient) GetSpacesArgsForCall(i int) []ccv3.Query {
   310  	fake.getSpacesMutex.RLock()
   311  	defer fake.getSpacesMutex.RUnlock()
   312  	argsForCall := fake.getSpacesArgsForCall[i]
   313  	return argsForCall.arg1
   314  }
   315  
   316  func (fake *FakeCloudControllerClient) GetSpacesReturns(result1 []resources.Space, result2 ccv3.IncludedResources, result3 ccv3.Warnings, result4 error) {
   317  	fake.getSpacesMutex.Lock()
   318  	defer fake.getSpacesMutex.Unlock()
   319  	fake.GetSpacesStub = nil
   320  	fake.getSpacesReturns = struct {
   321  		result1 []resources.Space
   322  		result2 ccv3.IncludedResources
   323  		result3 ccv3.Warnings
   324  		result4 error
   325  	}{result1, result2, result3, result4}
   326  }
   327  
   328  func (fake *FakeCloudControllerClient) GetSpacesReturnsOnCall(i int, result1 []resources.Space, result2 ccv3.IncludedResources, result3 ccv3.Warnings, result4 error) {
   329  	fake.getSpacesMutex.Lock()
   330  	defer fake.getSpacesMutex.Unlock()
   331  	fake.GetSpacesStub = nil
   332  	if fake.getSpacesReturnsOnCall == nil {
   333  		fake.getSpacesReturnsOnCall = make(map[int]struct {
   334  			result1 []resources.Space
   335  			result2 ccv3.IncludedResources
   336  			result3 ccv3.Warnings
   337  			result4 error
   338  		})
   339  	}
   340  	fake.getSpacesReturnsOnCall[i] = struct {
   341  		result1 []resources.Space
   342  		result2 ccv3.IncludedResources
   343  		result3 ccv3.Warnings
   344  		result4 error
   345  	}{result1, result2, result3, result4}
   346  }
   347  
   348  func (fake *FakeCloudControllerClient) Invocations() map[string][][]interface{} {
   349  	fake.invocationsMutex.RLock()
   350  	defer fake.invocationsMutex.RUnlock()
   351  	fake.getApplicationByNameAndSpaceMutex.RLock()
   352  	defer fake.getApplicationByNameAndSpaceMutex.RUnlock()
   353  	fake.getApplicationsMutex.RLock()
   354  	defer fake.getApplicationsMutex.RUnlock()
   355  	fake.getOrganizationsMutex.RLock()
   356  	defer fake.getOrganizationsMutex.RUnlock()
   357  	fake.getSpacesMutex.RLock()
   358  	defer fake.getSpacesMutex.RUnlock()
   359  	copiedInvocations := map[string][][]interface{}{}
   360  	for key, value := range fake.invocations {
   361  		copiedInvocations[key] = value
   362  	}
   363  	return copiedInvocations
   364  }
   365  
   366  func (fake *FakeCloudControllerClient) recordInvocation(key string, args []interface{}) {
   367  	fake.invocationsMutex.Lock()
   368  	defer fake.invocationsMutex.Unlock()
   369  	if fake.invocations == nil {
   370  		fake.invocations = map[string][][]interface{}{}
   371  	}
   372  	if fake.invocations[key] == nil {
   373  		fake.invocations[key] = [][]interface{}{}
   374  	}
   375  	fake.invocations[key] = append(fake.invocations[key], args)
   376  }
   377  
   378  var _ cfnetworkingaction.CloudControllerClient = new(FakeCloudControllerClient)