Skip to content

iter_get_groups_for_capacity_reservation

iter_get_groups_for_capacity_reservation(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    capacity_reservation_id: Optional[CapacityReservationId] = None,
    next_token: Optional[String] = None,
    max_results: Optional[GetGroupsForCapacityReservationRequestMaxResults] = None,
    dry_run: Optional[Boolean] = None,
) -> Iterator[CapacityReservationGroup]
Source code in docs_src/capo_ec2/_services/ec2.py
def iter_get_groups_for_capacity_reservation(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    capacity_reservation_id: Optional[
        "capo_ec2.types.capacity_reservation_id.CapacityReservationId"
    ] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    max_results: Optional[
        "capo_ec2.types.get_groups_for_capacity_reservation_request_max_results.GetGroupsForCapacityReservationRequestMaxResults"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "Iterator[capo_ec2.types.capacity_reservation_group.CapacityReservationGroup]":
    _token = next_token
    while True:
        _response = self.get_groups_for_capacity_reservation(
            config_overrides=config_overrides,
            capacity_reservation_id=capacity_reservation_id,
            next_token=_token,
            max_results=max_results,
            dry_run=dry_run,
        )
        _page = _resolve_path(_response, ("capacity_reservation_groups",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break