@@ -327,23 +327,26 @@ def _refresh_data(self):
327327 if self ._x_request_id is not None :
328328 self ._kwargs [Parameters .x_request_id ] = self ._x_request_id
329329 # Call the API again and update internal state
330+ body = None
330331 try :
331332 response = self ._api_endpoint (** self ._kwargs )
332- body , status , headers = response
333- if body is None :
334- raise StopIteration
335- continuation_token = getattr (body , "continuation_token" , None )
336- total_item_count = getattr (body , "total_item_count" , None )
337- # *-get-response models have "continuation_token" attribute. Other models don't have them.
338- if continuation_token is not None :
339- self ._more_items_remaining = True
340- else :
341- # Only GET responses are paged.
342- self ._more_items_remaining = False
343-
344- self ._continuation_token = continuation_token
345- self ._total_item_count = total_item_count
346- self ._items = body .items
333+ body = response .data
347334 except Exception as e :
348335 # Generic errors for pagination
349336 raise PureError ('Failed to collect more items: {}' .format (e ))
337+
338+ if body is None :
339+ raise StopIteration
340+
341+ continuation_token = getattr (body , "continuation_token" , None )
342+ total_item_count = getattr (body , "total_item_count" , None )
343+ # *-get-response models have "continuation_token" attribute. Other models don't have them.
344+ if continuation_token is not None :
345+ self ._more_items_remaining = True
346+ else :
347+ # Only GET responses are paged.
348+ self ._more_items_remaining = False
349+
350+ self ._continuation_token = continuation_token
351+ self ._total_item_count = total_item_count
352+ self ._items = body .items
0 commit comments