-
Notifications
You must be signed in to change notification settings - Fork 14
/
instancegroups_response.go
43 lines (35 loc) · 1.01 KB
/
instancegroups_response.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
// code generated; DO NOT EDIT.
package egoscale
import "fmt"
// Response returns the struct to unmarshal
func (ListInstanceGroups) Response() interface{} {
return new(ListInstanceGroupsResponse)
}
// ListRequest returns itself
func (ls *ListInstanceGroups) ListRequest() (ListCommand, error) {
if ls == nil {
return nil, fmt.Errorf("%T cannot be nil", ls)
}
return ls, nil
}
// SetPage sets the current apge
func (ls *ListInstanceGroups) SetPage(page int) {
ls.Page = page
}
// SetPageSize sets the page size
func (ls *ListInstanceGroups) SetPageSize(pageSize int) {
ls.PageSize = pageSize
}
// Each triggers the callback for each, valid answer or any non 404 issue
func (ListInstanceGroups) Each(resp interface{}, callback IterateItemFunc) {
items, ok := resp.(*ListInstanceGroupsResponse)
if !ok {
callback(nil, fmt.Errorf("wrong type, ListInstanceGroupsResponse was expected, got %T", resp))
return
}
for i := range items.InstanceGroup {
if !callback(&items.InstanceGroup[i], nil) {
break
}
}
}