github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_user_provided_service_instance_repository.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 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 FakeUserProvidedServiceInstanceRepository struct { 12 CreateStub func(string, string, string, map[string]interface{}, []string) error 13 createMutex sync.RWMutex 14 createArgsForCall []struct { 15 arg1 string 16 arg2 string 17 arg3 string 18 arg4 map[string]interface{} 19 arg5 []string 20 } 21 createReturns struct { 22 result1 error 23 } 24 createReturnsOnCall map[int]struct { 25 result1 error 26 } 27 GetSummariesStub func() (models.UserProvidedServiceSummary, error) 28 getSummariesMutex sync.RWMutex 29 getSummariesArgsForCall []struct { 30 } 31 getSummariesReturns struct { 32 result1 models.UserProvidedServiceSummary 33 result2 error 34 } 35 getSummariesReturnsOnCall map[int]struct { 36 result1 models.UserProvidedServiceSummary 37 result2 error 38 } 39 UpdateStub func(models.ServiceInstanceFields) error 40 updateMutex sync.RWMutex 41 updateArgsForCall []struct { 42 arg1 models.ServiceInstanceFields 43 } 44 updateReturns struct { 45 result1 error 46 } 47 updateReturnsOnCall map[int]struct { 48 result1 error 49 } 50 invocations map[string][][]interface{} 51 invocationsMutex sync.RWMutex 52 } 53 54 func (fake *FakeUserProvidedServiceInstanceRepository) Create(arg1 string, arg2 string, arg3 string, arg4 map[string]interface{}, arg5 []string) error { 55 var arg5Copy []string 56 if arg5 != nil { 57 arg5Copy = make([]string, len(arg5)) 58 copy(arg5Copy, arg5) 59 } 60 fake.createMutex.Lock() 61 ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)] 62 fake.createArgsForCall = append(fake.createArgsForCall, struct { 63 arg1 string 64 arg2 string 65 arg3 string 66 arg4 map[string]interface{} 67 arg5 []string 68 }{arg1, arg2, arg3, arg4, arg5Copy}) 69 fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3, arg4, arg5Copy}) 70 fake.createMutex.Unlock() 71 if fake.CreateStub != nil { 72 return fake.CreateStub(arg1, arg2, arg3, arg4, arg5) 73 } 74 if specificReturn { 75 return ret.result1 76 } 77 fakeReturns := fake.createReturns 78 return fakeReturns.result1 79 } 80 81 func (fake *FakeUserProvidedServiceInstanceRepository) CreateCallCount() int { 82 fake.createMutex.RLock() 83 defer fake.createMutex.RUnlock() 84 return len(fake.createArgsForCall) 85 } 86 87 func (fake *FakeUserProvidedServiceInstanceRepository) CreateCalls(stub func(string, string, string, map[string]interface{}, []string) error) { 88 fake.createMutex.Lock() 89 defer fake.createMutex.Unlock() 90 fake.CreateStub = stub 91 } 92 93 func (fake *FakeUserProvidedServiceInstanceRepository) CreateArgsForCall(i int) (string, string, string, map[string]interface{}, []string) { 94 fake.createMutex.RLock() 95 defer fake.createMutex.RUnlock() 96 argsForCall := fake.createArgsForCall[i] 97 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5 98 } 99 100 func (fake *FakeUserProvidedServiceInstanceRepository) CreateReturns(result1 error) { 101 fake.createMutex.Lock() 102 defer fake.createMutex.Unlock() 103 fake.CreateStub = nil 104 fake.createReturns = struct { 105 result1 error 106 }{result1} 107 } 108 109 func (fake *FakeUserProvidedServiceInstanceRepository) CreateReturnsOnCall(i int, result1 error) { 110 fake.createMutex.Lock() 111 defer fake.createMutex.Unlock() 112 fake.CreateStub = nil 113 if fake.createReturnsOnCall == nil { 114 fake.createReturnsOnCall = make(map[int]struct { 115 result1 error 116 }) 117 } 118 fake.createReturnsOnCall[i] = struct { 119 result1 error 120 }{result1} 121 } 122 123 func (fake *FakeUserProvidedServiceInstanceRepository) GetSummaries() (models.UserProvidedServiceSummary, error) { 124 fake.getSummariesMutex.Lock() 125 ret, specificReturn := fake.getSummariesReturnsOnCall[len(fake.getSummariesArgsForCall)] 126 fake.getSummariesArgsForCall = append(fake.getSummariesArgsForCall, struct { 127 }{}) 128 fake.recordInvocation("GetSummaries", []interface{}{}) 129 fake.getSummariesMutex.Unlock() 130 if fake.GetSummariesStub != nil { 131 return fake.GetSummariesStub() 132 } 133 if specificReturn { 134 return ret.result1, ret.result2 135 } 136 fakeReturns := fake.getSummariesReturns 137 return fakeReturns.result1, fakeReturns.result2 138 } 139 140 func (fake *FakeUserProvidedServiceInstanceRepository) GetSummariesCallCount() int { 141 fake.getSummariesMutex.RLock() 142 defer fake.getSummariesMutex.RUnlock() 143 return len(fake.getSummariesArgsForCall) 144 } 145 146 func (fake *FakeUserProvidedServiceInstanceRepository) GetSummariesCalls(stub func() (models.UserProvidedServiceSummary, error)) { 147 fake.getSummariesMutex.Lock() 148 defer fake.getSummariesMutex.Unlock() 149 fake.GetSummariesStub = stub 150 } 151 152 func (fake *FakeUserProvidedServiceInstanceRepository) GetSummariesReturns(result1 models.UserProvidedServiceSummary, result2 error) { 153 fake.getSummariesMutex.Lock() 154 defer fake.getSummariesMutex.Unlock() 155 fake.GetSummariesStub = nil 156 fake.getSummariesReturns = struct { 157 result1 models.UserProvidedServiceSummary 158 result2 error 159 }{result1, result2} 160 } 161 162 func (fake *FakeUserProvidedServiceInstanceRepository) GetSummariesReturnsOnCall(i int, result1 models.UserProvidedServiceSummary, result2 error) { 163 fake.getSummariesMutex.Lock() 164 defer fake.getSummariesMutex.Unlock() 165 fake.GetSummariesStub = nil 166 if fake.getSummariesReturnsOnCall == nil { 167 fake.getSummariesReturnsOnCall = make(map[int]struct { 168 result1 models.UserProvidedServiceSummary 169 result2 error 170 }) 171 } 172 fake.getSummariesReturnsOnCall[i] = struct { 173 result1 models.UserProvidedServiceSummary 174 result2 error 175 }{result1, result2} 176 } 177 178 func (fake *FakeUserProvidedServiceInstanceRepository) Update(arg1 models.ServiceInstanceFields) error { 179 fake.updateMutex.Lock() 180 ret, specificReturn := fake.updateReturnsOnCall[len(fake.updateArgsForCall)] 181 fake.updateArgsForCall = append(fake.updateArgsForCall, struct { 182 arg1 models.ServiceInstanceFields 183 }{arg1}) 184 fake.recordInvocation("Update", []interface{}{arg1}) 185 fake.updateMutex.Unlock() 186 if fake.UpdateStub != nil { 187 return fake.UpdateStub(arg1) 188 } 189 if specificReturn { 190 return ret.result1 191 } 192 fakeReturns := fake.updateReturns 193 return fakeReturns.result1 194 } 195 196 func (fake *FakeUserProvidedServiceInstanceRepository) UpdateCallCount() int { 197 fake.updateMutex.RLock() 198 defer fake.updateMutex.RUnlock() 199 return len(fake.updateArgsForCall) 200 } 201 202 func (fake *FakeUserProvidedServiceInstanceRepository) UpdateCalls(stub func(models.ServiceInstanceFields) error) { 203 fake.updateMutex.Lock() 204 defer fake.updateMutex.Unlock() 205 fake.UpdateStub = stub 206 } 207 208 func (fake *FakeUserProvidedServiceInstanceRepository) UpdateArgsForCall(i int) models.ServiceInstanceFields { 209 fake.updateMutex.RLock() 210 defer fake.updateMutex.RUnlock() 211 argsForCall := fake.updateArgsForCall[i] 212 return argsForCall.arg1 213 } 214 215 func (fake *FakeUserProvidedServiceInstanceRepository) UpdateReturns(result1 error) { 216 fake.updateMutex.Lock() 217 defer fake.updateMutex.Unlock() 218 fake.UpdateStub = nil 219 fake.updateReturns = struct { 220 result1 error 221 }{result1} 222 } 223 224 func (fake *FakeUserProvidedServiceInstanceRepository) UpdateReturnsOnCall(i int, result1 error) { 225 fake.updateMutex.Lock() 226 defer fake.updateMutex.Unlock() 227 fake.UpdateStub = nil 228 if fake.updateReturnsOnCall == nil { 229 fake.updateReturnsOnCall = make(map[int]struct { 230 result1 error 231 }) 232 } 233 fake.updateReturnsOnCall[i] = struct { 234 result1 error 235 }{result1} 236 } 237 238 func (fake *FakeUserProvidedServiceInstanceRepository) Invocations() map[string][][]interface{} { 239 fake.invocationsMutex.RLock() 240 defer fake.invocationsMutex.RUnlock() 241 fake.createMutex.RLock() 242 defer fake.createMutex.RUnlock() 243 fake.getSummariesMutex.RLock() 244 defer fake.getSummariesMutex.RUnlock() 245 fake.updateMutex.RLock() 246 defer fake.updateMutex.RUnlock() 247 copiedInvocations := map[string][][]interface{}{} 248 for key, value := range fake.invocations { 249 copiedInvocations[key] = value 250 } 251 return copiedInvocations 252 } 253 254 func (fake *FakeUserProvidedServiceInstanceRepository) recordInvocation(key string, args []interface{}) { 255 fake.invocationsMutex.Lock() 256 defer fake.invocationsMutex.Unlock() 257 if fake.invocations == nil { 258 fake.invocations = map[string][][]interface{}{} 259 } 260 if fake.invocations[key] == nil { 261 fake.invocations[key] = [][]interface{}{} 262 } 263 fake.invocations[key] = append(fake.invocations[key], args) 264 } 265 266 var _ api.UserProvidedServiceInstanceRepository = new(FakeUserProvidedServiceInstanceRepository)