-
Notifications
You must be signed in to change notification settings - Fork 23
/
target_pools_client.go
56 lines (52 loc) · 1.4 KB
/
target_pools_client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package fakes
import (
"sync"
gcpcompute "google.golang.org/api/compute/v1"
)
type TargetPoolsClient struct {
DeleteTargetPoolCall struct {
sync.Mutex
CallCount int
Receives struct {
Region string
TargetPool string
}
Returns struct {
Error error
}
Stub func(string, string) error
}
ListTargetPoolsCall struct {
sync.Mutex
CallCount int
Receives struct {
Region string
}
Returns struct {
TargetPoolList *gcpcompute.TargetPoolList
Error error
}
Stub func(string) (*gcpcompute.TargetPoolList, error)
}
}
func (f *TargetPoolsClient) DeleteTargetPool(param1 string, param2 string) error {
f.DeleteTargetPoolCall.Lock()
defer f.DeleteTargetPoolCall.Unlock()
f.DeleteTargetPoolCall.CallCount++
f.DeleteTargetPoolCall.Receives.Region = param1
f.DeleteTargetPoolCall.Receives.TargetPool = param2
if f.DeleteTargetPoolCall.Stub != nil {
return f.DeleteTargetPoolCall.Stub(param1, param2)
}
return f.DeleteTargetPoolCall.Returns.Error
}
func (f *TargetPoolsClient) ListTargetPools(param1 string) (*gcpcompute.TargetPoolList, error) {
f.ListTargetPoolsCall.Lock()
defer f.ListTargetPoolsCall.Unlock()
f.ListTargetPoolsCall.CallCount++
f.ListTargetPoolsCall.Receives.Region = param1
if f.ListTargetPoolsCall.Stub != nil {
return f.ListTargetPoolsCall.Stub(param1)
}
return f.ListTargetPoolsCall.Returns.TargetPoolList, f.ListTargetPoolsCall.Returns.Error
}