response¶
The response types and factories for PyBomb.
-
class
pybomb.response.Response(uri: str, num_page_results: int, num_total_results: int, results: list, result: Optional[dict])¶ Bases:
tupleAn API response.
-
classmethod
from_response_data(response_data)¶ Response factory.
If the response is from a fetch client and “results” is not wrapped in a list, the single result will be stored in results in a list and the original result will be added to result.
If the response is from a search client and “results” is a list, this list will be stored in results and result will be empty.
Either way, results will always hold the results in list format.
- Parameters
response_data (
Response) – Raw request response of API call- Return type
- Returns
A PyBomb Response containing the raw response data.
-
property
num_page_results¶ Alias for field number 1
-
property
num_total_results¶ Alias for field number 2
-
property
result¶ Alias for field number 4
-
property
results¶ Alias for field number 3
-
property
uri¶ Alias for field number 0
-
classmethod