<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iter(self):
 """Gets all resources, automating paging through data Returns: iterable of object: Iterable of resource objects """


        page = 1
        fetch_all = True
        url = "{}/{}".format(__endpoint__, self.type.RESOURCE)

        if 'page' in self.params:
            page = self.params['page']
            fetch_all = False

        response = RestClient.get(url, self.params)[self.type.RESOURCE]
        while len(response):
            for item in response:
                yield self.type(item)

            if not fetch_all:
                break
            else:
                page += 1
                self.where(page=page)
            response = RestClient.get(url, self.params)[self.type.RESOURCE]