Ejemplo n.º 1
0
    def _fetch_actors(self, start_timestamp: int) -> Generator[List[Actor], None, None]:
        limit = 50
        sort = "created_date|desc"
        fql_filter = f"created_date:>{start_timestamp}"
        fields = ["__full__"]

        paginated_query = paginate(self._query_actor_entities)

        return paginated_query(
            limit=limit, sort=sort, fql_filter=fql_filter, fields=fields
        )
Ejemplo n.º 2
0
    def _fetch_indicators(
            self,
            fetch_timestamp: int) -> Generator[List[Indicator], None, None]:
        limit = 10000
        sort = "published_date|desc"
        fql_filter = f"published_date:>{fetch_timestamp}"

        if self.exclude_types:
            fql_filter = f"{fql_filter}+type:!{self.exclude_types}"

        paginated_query = paginate(self._query_indicator_entities)

        return paginated_query(limit=limit, sort=sort, fql_filter=fql_filter)
Ejemplo n.º 3
0
    def _fetch_reports(
            self, start_timestamp: int) -> Generator[List[Report], None, None]:
        limit = 30
        sort = "created_date|desc"
        fields = ["__full__"]

        fql_filter = f"created_date:>{start_timestamp}"

        if self.include_types:
            fql_filter = f"{fql_filter}+type:{self.include_types}"

        paginated_query = paginate(self._query_report_entities)

        return paginated_query(limit=limit,
                               sort=sort,
                               fql_filter=fql_filter,
                               fields=fields)