Source code for globus_sdk.transfer.response.iterable
from globus_sdk.transfer.response.base import TransferResponse
[docs]class IterableTransferResponse(TransferResponse):
"""
Response class for non-paged list oriented resources. Allows top level
fields to be accessed normally via standard item access, and also
provides a convenient way to iterate over the sub-item list in the
``DATA`` key:
>>> print("Path:", r["path"])
>>> # Equivalent to: for item in r["DATA"]
>>> for item in r:
>>> print(item["name"], item["type"])
"""
def __iter__(self):
return iter(self["DATA"])