Skip to content

iter_forecast_geofence_events

iter_forecast_geofence_events(
    collection_name: ResourceName,
    device_state: ForecastGeofenceEventsDeviceState,
    *,
    config_overrides: Optional[LocationClientConfig] = None,
    time_horizon_minutes: Optional[float] = None,
    distance_unit: Optional[DistanceUnit] = None,
    speed_unit: Optional[SpeedUnit] = None,
    next_token: Optional[LargeToken] = None,
    max_results: Optional[int] = None,
) -> Iterator[ForecastedEvent]
Source code in docs_src/capo_location/_services/location.py
def iter_forecast_geofence_events(
    self,
    collection_name: "capo_location.types.resource_name.ResourceName",
    device_state: "capo_location.types.forecast_geofence_events_device_state.ForecastGeofenceEventsDeviceState",
    *,
    config_overrides: Optional[LocationClientConfig] = None,
    time_horizon_minutes: Optional[float] = None,
    distance_unit: Optional[
        "capo_location.types.distance_unit.DistanceUnit"
    ] = None,
    speed_unit: Optional["capo_location.types.speed_unit.SpeedUnit"] = None,
    next_token: Optional["capo_location.types.large_token.LargeToken"] = None,
    max_results: Optional[int] = None,
) -> "Iterator[capo_location.types.forecasted_event.ForecastedEvent]":
    _token = next_token
    while True:
        _response = self.forecast_geofence_events(
            collection_name,
            device_state,
            config_overrides=config_overrides,
            time_horizon_minutes=time_horizon_minutes,
            distance_unit=distance_unit,
            speed_unit=speed_unit,
            next_token=_token,
            max_results=max_results,
        )
        _page = _resolve_path(_response, ("forecasted_events",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break