> +      }
> +
> +      public UserOptions build() {
> +         UserOptions options = new UserOptions();
> +
> +         if (page != null) {
> +            options.queryParameters.put("page", String.valueOf(page));
> +         }
> +
> +         if (results != null) {
> +            options.queryParameters.put("numResults", 
> String.valueOf(results));
> +         }
> +
> +         return addFilterOptions(options);
> +      }
> +   }

We've just found that the pagination query parameters in the users resource in 
the Abiquo API are not consistent with the pagination in other resources. The 
`page` and `numResults` parameters are only used in the `users` list, and in 
all the other resources they are named `startwith` and `limit`. I've opened an 
issue to change the Abiquo API accordingly to make the query parameters in the 
`users` resource consistent with the rest of the API.

Even if the Abiquo API is not consistent, we can make the jclouds interface 
consistent in the meanwhile. I'd just remove the `page` and `numResults` 
property, and use the `startwith` and `limit` methods of the builder when 
creating the UserOptions, and in the `build()` method, just add the `page` and 
`numResults` parameter by checking the presence and value of those fields. This 
way the UserOptions usage will be the same than other options.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/22/files#r5704199

Reply via email to