Skip to content

iter_list_protected_resources_by_backup_vault

iter_list_protected_resources_by_backup_vault(
    backup_vault_name: BackupVaultName,
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    backup_vault_account_id: Optional[AccountId] = None,
    next_token: Optional[string] = None,
    max_results: Optional[MaxResults] = None,
) -> Iterator[ProtectedResource]
Source code in docs_src/capo_backup/_services/backup.py
def iter_list_protected_resources_by_backup_vault(
    self,
    backup_vault_name: "capo_backup.types.backup_vault_name.BackupVaultName",
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    backup_vault_account_id: Optional[
        "capo_backup.types.account_id.AccountId"
    ] = None,
    next_token: Optional["capo_backup.types.string.string"] = None,
    max_results: Optional["capo_backup.types.max_results.MaxResults"] = None,
) -> "Iterator[capo_backup.types.protected_resource.ProtectedResource]":
    _token = next_token
    while True:
        _response = self.list_protected_resources_by_backup_vault(
            backup_vault_name,
            config_overrides=config_overrides,
            backup_vault_account_id=backup_vault_account_id,
            next_token=_token,
            max_results=max_results,
        )
        _page = _resolve_path(_response, ("results",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break