-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
Version
12.0.0
What happened
domain_api.DomainApi(api_client).list_domains(id, version) gives me a DomainsResponse object that contains a list in _data_store. It does not seem to cope with that. You cannot iterate because that will try to index 0 which yields:
In [77]: [domain for domain in domains]
---------------------------------------------------------------------------
ApiAttributeError Traceback (most recent call last)
Cell In[77], line 1
----> 1 [domain for domain in domains]
File ~/src/debian/fastly/venv/lib/python3.13/site-packages/fastly/model_utils.py:468, in ModelSimple.__getitem__(self, name)
465 if name in self:
466 return self.get(name)
--> 468 raise ApiAttributeError(
469 "{0} has no attribute '{1}'".format(
470 type(self).__name__, name),
471 [e for e in [self._path_to_item, name] if e]
472 )
ApiAttributeError: DomainsResponse has no attribute '0' at ['['received_data']']
It seems like the only way to actually access the data is to break the abstraction and access _data_store directly.
Metadata
Metadata
Assignees
Labels
No labels