@classmethod
def _get_all(cls, parent_id=None, grandparent_id=None):
    """Retrives all the required resources."""
    client = cls._get_client()
    endpoint = cls._endpoint.format(resource_id='', parent_id=parent_id or
        '', grandparent_id=grandparent_id or '')
    resources = []
    while True:
        response = client.get_resource(endpoint)
        for raw_data in response.get('value', []):
            raw_data['parentResourceID'] = parent_id
            raw_data['grandParentResourceID'] = grandparent_id
            resources.append(cls.from_raw_data(raw_data))
        endpoint = response.get('nextLink')
        if not endpoint:
            break
    return resources
