When making API calls which has a listing of items, the API will return the total number of items in a header named 'SoftLayer-Total-Items'. This should be made available in the return value.
I propose wrapping API results that are lists with a class that looks like this:
class SoftLayerListResult(list):
def __init__(self, items, total_count):
self.total_count = total_count
super(SoftLayerListResult, self).__init__(items)
This should maintain backwards compatibility while exposing the total count of items to consumers.
When making API calls which has a listing of items, the API will return the total number of items in a header named 'SoftLayer-Total-Items'. This should be made available in the return value.
I propose wrapping API results that are lists with a class that looks like this:
This should maintain backwards compatibility while exposing the total count of items to consumers.