github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/command/v6/v6fakes/fake_service_instances_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v6fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/v2action"
     8  	v6 "code.cloudfoundry.org/cli/command/v6"
     9  )
    10  
    11  type FakeServiceInstancesActor struct {
    12  	CloudControllerAPIVersionStub        func() string
    13  	cloudControllerAPIVersionMutex       sync.RWMutex
    14  	cloudControllerAPIVersionArgsForCall []struct {
    15  	}
    16  	cloudControllerAPIVersionReturns struct {
    17  		result1 string
    18  	}
    19  	cloudControllerAPIVersionReturnsOnCall map[int]struct {
    20  		result1 string
    21  	}
    22  	GetServiceInstancesSummaryBySpaceStub        func(string) ([]v2action.ServiceInstanceSummary, v2action.Warnings, error)
    23  	getServiceInstancesSummaryBySpaceMutex       sync.RWMutex
    24  	getServiceInstancesSummaryBySpaceArgsForCall []struct {
    25  		arg1 string
    26  	}
    27  	getServiceInstancesSummaryBySpaceReturns struct {
    28  		result1 []v2action.ServiceInstanceSummary
    29  		result2 v2action.Warnings
    30  		result3 error
    31  	}
    32  	getServiceInstancesSummaryBySpaceReturnsOnCall map[int]struct {
    33  		result1 []v2action.ServiceInstanceSummary
    34  		result2 v2action.Warnings
    35  		result3 error
    36  	}
    37  	invocations      map[string][][]interface{}
    38  	invocationsMutex sync.RWMutex
    39  }
    40  
    41  func (fake *FakeServiceInstancesActor) CloudControllerAPIVersion() string {
    42  	fake.cloudControllerAPIVersionMutex.Lock()
    43  	ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)]
    44  	fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct {
    45  	}{})
    46  	fake.recordInvocation("CloudControllerAPIVersion", []interface{}{})
    47  	fake.cloudControllerAPIVersionMutex.Unlock()
    48  	if fake.CloudControllerAPIVersionStub != nil {
    49  		return fake.CloudControllerAPIVersionStub()
    50  	}
    51  	if specificReturn {
    52  		return ret.result1
    53  	}
    54  	fakeReturns := fake.cloudControllerAPIVersionReturns
    55  	return fakeReturns.result1
    56  }
    57  
    58  func (fake *FakeServiceInstancesActor) CloudControllerAPIVersionCallCount() int {
    59  	fake.cloudControllerAPIVersionMutex.RLock()
    60  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
    61  	return len(fake.cloudControllerAPIVersionArgsForCall)
    62  }
    63  
    64  func (fake *FakeServiceInstancesActor) CloudControllerAPIVersionCalls(stub func() string) {
    65  	fake.cloudControllerAPIVersionMutex.Lock()
    66  	defer fake.cloudControllerAPIVersionMutex.Unlock()
    67  	fake.CloudControllerAPIVersionStub = stub
    68  }
    69  
    70  func (fake *FakeServiceInstancesActor) CloudControllerAPIVersionReturns(result1 string) {
    71  	fake.cloudControllerAPIVersionMutex.Lock()
    72  	defer fake.cloudControllerAPIVersionMutex.Unlock()
    73  	fake.CloudControllerAPIVersionStub = nil
    74  	fake.cloudControllerAPIVersionReturns = struct {
    75  		result1 string
    76  	}{result1}
    77  }
    78  
    79  func (fake *FakeServiceInstancesActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) {
    80  	fake.cloudControllerAPIVersionMutex.Lock()
    81  	defer fake.cloudControllerAPIVersionMutex.Unlock()
    82  	fake.CloudControllerAPIVersionStub = nil
    83  	if fake.cloudControllerAPIVersionReturnsOnCall == nil {
    84  		fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct {
    85  			result1 string
    86  		})
    87  	}
    88  	fake.cloudControllerAPIVersionReturnsOnCall[i] = struct {
    89  		result1 string
    90  	}{result1}
    91  }
    92  
    93  func (fake *FakeServiceInstancesActor) GetServiceInstancesSummaryBySpace(arg1 string) ([]v2action.ServiceInstanceSummary, v2action.Warnings, error) {
    94  	fake.getServiceInstancesSummaryBySpaceMutex.Lock()
    95  	ret, specificReturn := fake.getServiceInstancesSummaryBySpaceReturnsOnCall[len(fake.getServiceInstancesSummaryBySpaceArgsForCall)]
    96  	fake.getServiceInstancesSummaryBySpaceArgsForCall = append(fake.getServiceInstancesSummaryBySpaceArgsForCall, struct {
    97  		arg1 string
    98  	}{arg1})
    99  	fake.recordInvocation("GetServiceInstancesSummaryBySpace", []interface{}{arg1})
   100  	fake.getServiceInstancesSummaryBySpaceMutex.Unlock()
   101  	if fake.GetServiceInstancesSummaryBySpaceStub != nil {
   102  		return fake.GetServiceInstancesSummaryBySpaceStub(arg1)
   103  	}
   104  	if specificReturn {
   105  		return ret.result1, ret.result2, ret.result3
   106  	}
   107  	fakeReturns := fake.getServiceInstancesSummaryBySpaceReturns
   108  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
   109  }
   110  
   111  func (fake *FakeServiceInstancesActor) GetServiceInstancesSummaryBySpaceCallCount() int {
   112  	fake.getServiceInstancesSummaryBySpaceMutex.RLock()
   113  	defer fake.getServiceInstancesSummaryBySpaceMutex.RUnlock()
   114  	return len(fake.getServiceInstancesSummaryBySpaceArgsForCall)
   115  }
   116  
   117  func (fake *FakeServiceInstancesActor) GetServiceInstancesSummaryBySpaceCalls(stub func(string) ([]v2action.ServiceInstanceSummary, v2action.Warnings, error)) {
   118  	fake.getServiceInstancesSummaryBySpaceMutex.Lock()
   119  	defer fake.getServiceInstancesSummaryBySpaceMutex.Unlock()
   120  	fake.GetServiceInstancesSummaryBySpaceStub = stub
   121  }
   122  
   123  func (fake *FakeServiceInstancesActor) GetServiceInstancesSummaryBySpaceArgsForCall(i int) string {
   124  	fake.getServiceInstancesSummaryBySpaceMutex.RLock()
   125  	defer fake.getServiceInstancesSummaryBySpaceMutex.RUnlock()
   126  	argsForCall := fake.getServiceInstancesSummaryBySpaceArgsForCall[i]
   127  	return argsForCall.arg1
   128  }
   129  
   130  func (fake *FakeServiceInstancesActor) GetServiceInstancesSummaryBySpaceReturns(result1 []v2action.ServiceInstanceSummary, result2 v2action.Warnings, result3 error) {
   131  	fake.getServiceInstancesSummaryBySpaceMutex.Lock()
   132  	defer fake.getServiceInstancesSummaryBySpaceMutex.Unlock()
   133  	fake.GetServiceInstancesSummaryBySpaceStub = nil
   134  	fake.getServiceInstancesSummaryBySpaceReturns = struct {
   135  		result1 []v2action.ServiceInstanceSummary
   136  		result2 v2action.Warnings
   137  		result3 error
   138  	}{result1, result2, result3}
   139  }
   140  
   141  func (fake *FakeServiceInstancesActor) GetServiceInstancesSummaryBySpaceReturnsOnCall(i int, result1 []v2action.ServiceInstanceSummary, result2 v2action.Warnings, result3 error) {
   142  	fake.getServiceInstancesSummaryBySpaceMutex.Lock()
   143  	defer fake.getServiceInstancesSummaryBySpaceMutex.Unlock()
   144  	fake.GetServiceInstancesSummaryBySpaceStub = nil
   145  	if fake.getServiceInstancesSummaryBySpaceReturnsOnCall == nil {
   146  		fake.getServiceInstancesSummaryBySpaceReturnsOnCall = make(map[int]struct {
   147  			result1 []v2action.ServiceInstanceSummary
   148  			result2 v2action.Warnings
   149  			result3 error
   150  		})
   151  	}
   152  	fake.getServiceInstancesSummaryBySpaceReturnsOnCall[i] = struct {
   153  		result1 []v2action.ServiceInstanceSummary
   154  		result2 v2action.Warnings
   155  		result3 error
   156  	}{result1, result2, result3}
   157  }
   158  
   159  func (fake *FakeServiceInstancesActor) Invocations() map[string][][]interface{} {
   160  	fake.invocationsMutex.RLock()
   161  	defer fake.invocationsMutex.RUnlock()
   162  	fake.cloudControllerAPIVersionMutex.RLock()
   163  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
   164  	fake.getServiceInstancesSummaryBySpaceMutex.RLock()
   165  	defer fake.getServiceInstancesSummaryBySpaceMutex.RUnlock()
   166  	copiedInvocations := map[string][][]interface{}{}
   167  	for key, value := range fake.invocations {
   168  		copiedInvocations[key] = value
   169  	}
   170  	return copiedInvocations
   171  }
   172  
   173  func (fake *FakeServiceInstancesActor) recordInvocation(key string, args []interface{}) {
   174  	fake.invocationsMutex.Lock()
   175  	defer fake.invocationsMutex.Unlock()
   176  	if fake.invocations == nil {
   177  		fake.invocations = map[string][][]interface{}{}
   178  	}
   179  	if fake.invocations[key] == nil {
   180  		fake.invocations[key] = [][]interface{}{}
   181  	}
   182  	fake.invocations[key] = append(fake.invocations[key], args)
   183  }
   184  
   185  var _ v6.ServiceInstancesActor = new(FakeServiceInstancesActor)