We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82cb486 commit f452638Copy full SHA for f452638
openstack/loadbalancer/v2/quotas/results.go
@@ -24,6 +24,27 @@ type QuotaPage struct {
24
pagination.LinkedPageBase
25
}
26
27
+func (r QuotaPage) NextPageURL() (string, error) {
28
+ var s struct {
29
+ Links []gophercloud.Link `json:"quota_links"`
30
+ }
31
+ err := r.ExtractInto(&s)
32
+ if err != nil {
33
+ return "", err
34
35
+ return gophercloud.ExtractNextURL(s.Links)
36
+}
37
+
38
+// IsEmpty checks whether a FlavorPage struct is empty.
39
+func (r QuotaPage) IsEmpty() (bool, error) {
40
+ if r.StatusCode == 204 {
41
+ return true, nil
42
43
44
+ is, err := ExtractQuotas(r)
45
+ return len(is) == 0, err
46
47
48
func ExtractQuotas(r pagination.Page) ([]Quota, error) {
49
var s struct {
50
Quotas []Quota `json:"quotas"`
0 commit comments