Skip to content

iter_list_violation_events async

iter_list_violation_events(
    start_time: Timestamp,
    end_time: Timestamp,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    thing_name: Optional[DeviceDefenderThingName] = None,
    security_profile_name: Optional[SecurityProfileName] = None,
    behavior_criteria_type: Optional[BehaviorCriteriaType] = None,
    list_suppressed_alerts: Optional[ListSuppressedAlerts] = None,
    verification_state: Optional[VerificationState] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> AsyncIterator[ViolationEvent]
Source code in docs_src/capo_iot/_services/async_io_t.py
async def iter_list_violation_events(
    self,
    start_time: "capo_iot.types.timestamp.Timestamp",
    end_time: "capo_iot.types.timestamp.Timestamp",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    thing_name: Optional[
        "capo_iot.types.device_defender_thing_name.DeviceDefenderThingName"
    ] = None,
    security_profile_name: Optional[
        "capo_iot.types.security_profile_name.SecurityProfileName"
    ] = None,
    behavior_criteria_type: Optional[
        "capo_iot.types.behavior_criteria_type.BehaviorCriteriaType"
    ] = None,
    list_suppressed_alerts: Optional[
        "capo_iot.types.list_suppressed_alerts.ListSuppressedAlerts"
    ] = None,
    verification_state: Optional[
        "capo_iot.types.verification_state.VerificationState"
    ] = None,
    next_token: Optional["capo_iot.types.next_token.NextToken"] = None,
    max_results: Optional["capo_iot.types.max_results.MaxResults"] = None,
) -> "AsyncIterator[capo_iot.types.violation_event.ViolationEvent]":
    _token = next_token
    while True:
        _response = await self.list_violation_events(
            start_time,
            end_time,
            config_overrides=config_overrides,
            thing_name=thing_name,
            security_profile_name=security_profile_name,
            behavior_criteria_type=behavior_criteria_type,
            list_suppressed_alerts=list_suppressed_alerts,
            verification_state=verification_state,
            next_token=_token,
            max_results=max_results,
        )
        _page = _resolve_path(_response, ("violation_events",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break