Skip to content

Commit 98d69d0

Browse files
committed
Swapping iterator's _next_item() for _item_to_value().
This is so that the owned items iterator management could be done on the base class and the child classes just need to worry about converting the JSON values to whatever type is required.
1 parent 0a53b63 commit 98d69d0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • packages/google-cloud-resource-manager/google/cloud/resource_manager

packages/google-cloud-resource-manager/google/cloud/resource_manager/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,15 @@ class _ProjectPage(Page):
173173

174174
ITEMS_KEY = 'projects'
175175

176-
def _next_item(self):
177-
"""Get the next project in the page.
176+
def _item_to_value(self, resource):
177+
"""Convert a JSON project to the native object.
178+
179+
:type resource: dict
180+
:param resource: An resource to be converted to a project.
178181
179182
:rtype: :class:`.Project`
180183
:returns: The next project in the page.
181184
"""
182-
resource = six.next(self._item_iter)
183185
return Project.from_api_repr(resource, client=self._parent.client)
184186

185187

0 commit comments

Comments
 (0)