gfwapiclient.resources.events.list.endpoints

Global Fishing Watch (GFW) API Python Client - Get All Events API Endpoint.

Module Contents

Classes

EventListEndPoint

Get All Events API endpoint.

Data

API

gfwapiclient.resources.events.list.endpoints.__all__ = ['EventListEndPoint']
class gfwapiclient.resources.events.list.endpoints.EventListEndPoint(*, request_params: gfwapiclient.resources.events.list.models.request.EventListParams, request_body: gfwapiclient.resources.events.list.models.request.EventListBody, http_client: gfwapiclient.http.client.HTTPClient)

Bases: gfwapiclient.http.endpoints.PostEndPoint[gfwapiclient.resources.events.list.models.request.EventListParams, gfwapiclient.resources.events.list.models.request.EventListBody, gfwapiclient.resources.events.list.models.response.EventListItem, gfwapiclient.resources.events.list.models.response.EventListResult]

Get All Events API endpoint.

This endpoint allows you to retrieve a list of events based on specified request parameters and body.

Initialization

Initializes a new EventListEndPoint API endpoint.

Args:
request_params (EventListParams):

The request parameters.

request_body (EventListBody):

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]]

Transforms and reshapes the response body to extract event data.

The API response contains event data within an “entries” list. This method extracts and returns the event data from this list.

Args:
body (Union[List[Dict[str, Any]], Dict[str, Any]]):

The response body from the API.

Returns:
Union[List[Dict[str, Any]], Dict[str, Any]]:

The transformed event data.

Raises:
ResultValidationError:

If the response body does not contain the expected “entries” list.