|
1 | | -from typing import TYPE_CHECKING, cast |
| 1 | +from typing import TYPE_CHECKING |
2 | 2 |
|
3 | 3 | from indico.client.request import GraphQLRequest, PagedRequest |
4 | 4 | from indico.types.component_blueprint import BlueprintPage, BlueprintTags |
5 | 5 |
|
6 | 6 | if TYPE_CHECKING: # pragma: no cover |
7 | | - from typing import Any, List, Optional |
| 7 | + from typing import Any, Optional |
8 | 8 |
|
9 | 9 | from indico.filters import ComponentBlueprintFilter |
10 | 10 | from indico.typing import Payload |
@@ -76,10 +76,8 @@ def __init__( |
76 | 76 | }, |
77 | 77 | ) |
78 | 78 |
|
79 | | - def process_response( |
80 | | - self, response: "Payload", _: "Optional[List[str]]" = None |
81 | | - ) -> "BlueprintPage": |
82 | | - response = super().process_response( |
| 79 | + def process_response(self, response: "Payload") -> "BlueprintPage": |
| 80 | + response = super().parse_payload( |
83 | 81 | response, nested_keys=["gallery", "component", "blueprintsPage"] |
84 | 82 | ) |
85 | 83 | return BlueprintPage( |
@@ -121,7 +119,11 @@ def __init__(self, component_family: "Optional[str]" = None): |
121 | 119 | ) |
122 | 120 |
|
123 | 121 | def process_response(self, response: "Payload") -> "BlueprintTags": |
124 | | - response = cast(Payload, super().process_response(response)) |
125 | 122 | return BlueprintTags( |
126 | | - tags=[tag for tag in response["gallery"]["component"]["availableTags"]] |
| 123 | + tags=[ |
| 124 | + tag |
| 125 | + for tag in super().parse_payload(response)["gallery"]["component"][ |
| 126 | + "availableTags" |
| 127 | + ] |
| 128 | + ] |
127 | 129 | ) |
0 commit comments