gfwapiclient.resources.fourwings.report.endpoints
¶
Global Fishing Watch (GFW) API Python Client - 4Wings Report API EndPoint.
Module Contents¶
Classes¶
Create 4Wings Report API endpoint. |
Data¶
API¶
- gfwapiclient.resources.fourwings.report.endpoints.__all__ = ['FourWingsReportEndPoint']¶
- class gfwapiclient.resources.fourwings.report.endpoints.FourWingsReportEndPoint(*, request_params: gfwapiclient.resources.fourwings.report.models.request.FourWingsReportParams, request_body: gfwapiclient.resources.fourwings.report.models.request.FourWingsReportBody, http_client: gfwapiclient.http.client.HTTPClient)¶
Bases:
gfwapiclient.http.endpoints.PostEndPoint
[gfwapiclient.resources.fourwings.report.models.request.FourWingsReportParams
,gfwapiclient.resources.fourwings.report.models.request.FourWingsReportBody
,gfwapiclient.resources.fourwings.report.models.response.FourWingsReportItem
,gfwapiclient.resources.fourwings.report.models.response.FourWingsReportResult
]Create 4Wings Report API endpoint.
This endpoint is used to generate reports from the 4Wings API. It supports both query parameters and request bodies for flexible report generation.
Initialization
Initializes a new FourWingsReportEndPoint API endpoint.
- Args:
- request_params (FourWingsReportParams):
The request query parameters.
- request_body (FourWingsReportBody):
The request body.
- http_client (HTTPClient):
The HTTP client.
- _transform_response_data(*, body: Union[List[Dict[str, Any]], Dict[str, Any]]) Union[List[Dict[str, Any]], Dict[str, Any]] ¶
Transform and reshape response body and yield data.
This method transforms the raw response body from the API into a format suitable for the FourWingsReportResult model.
The expected response structure is: {“entries”: [{“dataset”: [{…}]}]}.
- Args:
- body (Union[List[Dict[str, Any]], Dict[str, Any]]):
The raw response body.
- Returns:
- Union[List[Dict[str, Any]], Dict[str, Any]]:
The transformed response data.
- Raises:
- ResultValidationError:
If the response body does not match the expected format.