def pages(self) -> Iterable[List[dict]]: """Iterate over pages returned from the endpoint""" data = self._initial_request() yield data["results"] while data["next"]: data = get_json(data["next"], base_url="") if data["results"]: yield data["results"]
def paginated_output_data(environment_uid: str, graph_uid: str, store_name: str): return get_json( Endpoints.OUTPUT_DATA, params={ "environment_uid": environment_uid, "graph_uid": graph_uid, "store_name": store_name, }, )
def paginated_execution_events(environment_uid: str, graph_uid: str, node_id: str): return get_json( Endpoints.EXECUTION_EVENTS, params={ "environment_uid": environment_uid, "graph_uid": graph_uid, "node_id": node_id, }, )
def paginated_webhook_urls( environment_uid: str, graph_uid: str, ): return get_json( Endpoints.WEBHOOKS, params={ "environment_uid": environment_uid, "graph_uid": graph_uid }, )
def get_graph_by_uid(graph_uid: str) -> dict: return get_json(Endpoints.graphs_latest(graph_uid))
def get_graph_by_slug(organization_uid: str, slug: str) -> dict: return get_json(Endpoints.graph_by_slug(organization_uid, slug))
def get_graph_version_by_id(graph_version_uid) -> dict: return get_json(Endpoints.graph_version_by_id(graph_version_uid))
def paginated_graphs(organization_uid: str): return get_json(Endpoints.graphs_list(organization_uid))
def paginated_graph_components(): """All public components""" return get_json(Endpoints.COMPONENTS_LIST)
def get_environment_by_name(organization_uid: str, name: str) -> dict: return get_json(Endpoints.environment_by_slug(organization_uid, name))
def paginated_environments(environment_uid: str): return get_json(Endpoints.environments_list(environment_uid))
def get_environment_by_id(environment_uid: str) -> dict: return get_json(Endpoints.environment_by_id(environment_uid))
def get_organization_by_name(name: str) -> dict: return get_json(Endpoints.organization_by_slug(name))
def paginated_organizations(): return get_json(Endpoints.ORGANIZATIONS_LIST)
def get_organization_by_id(organization_uid: str) -> dict: return get_json(Endpoints.organization_by_id(organization_uid))