1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//! `Client` methods for the `BackupAccessPointsAPI` domain (new in v8.0.0).
//!
//! Ported from `eero-api src/eero/api/backup_access_points.py` (v8.0.4) by way of `EeroClient`'s
//! own `backup_access_points`-scoped wrappers in `client.py`.
use super::Client;
use crate::endpoints::backup_access_points::UpdateBackupAccessPointOptions;
use crate::envelope::Envelope;
use crate::error::Error;
impl Client {
/// Lists backup access points — returns the raw Eero API response.
///
/// Ported from `list_backup_access_points()` (`client.py:2912-2918`). `auto_discover =
/// false` — see [`Client::get_diagnostics`]. Passes the cached network envelope as `parent`
/// (`+net`, `client.py:2917`), so a published `backup_access_points` link on it wins over
/// the literal template — see [`crate::endpoints::backup_access_points::BackupAccessPointsApi::list`].
///
/// # Errors
///
/// See [`Client::get_diagnostics`].
pub async fn list_backup_access_points(
&self,
network_id: Option<&str>,
) -> Result<Envelope, Error> {
let network_id = self.ensure_network_id(network_id, false).await?;
let parent = self.network_parent(&network_id);
self.api
.backup_access_points()
.list(&network_id, parent.as_ref())
.await
}
/// Adds a backup access point — returns the raw Eero API response.
///
/// Ported from `add_backup_access_point()` (`client.py:2919-2932`). `auto_discover = false`.
/// Invalidates nothing: `client.py`'s own method body has no `del self._cache[...]` call to
/// reproduce.
///
/// # Errors
///
/// See [`Client::get_diagnostics`].
pub async fn add_backup_access_point(
&self,
ssid: &str,
password: &str,
uuid: Option<&str>,
network_id: Option<&str>,
) -> Result<Envelope, Error> {
let network_id = self.ensure_network_id(network_id, false).await?;
self.api
.backup_access_points()
.add(&network_id, ssid, password, uuid)
.await
}
/// Updates a backup access point — returns the raw Eero API response.
///
/// Ported from `update_backup_access_point()` (`client.py:2933-2959`). `auto_discover =
/// false`. Invalidates nothing — see [`Client::add_backup_access_point`].
///
/// # Errors
///
/// See [`Client::get_diagnostics`].
pub async fn update_backup_access_point(
&self,
backup_network_id: &str,
options: &UpdateBackupAccessPointOptions<'_>,
network_id: Option<&str>,
) -> Result<Envelope, Error> {
let network_id = self.ensure_network_id(network_id, false).await?;
self.api
.backup_access_points()
.update(&network_id, backup_network_id, options)
.await
}
/// Deletes a backup access point — returns the raw Eero API response.
///
/// Ported from `delete_backup_access_point()` (`client.py:2960-2968`). `auto_discover =
/// false`. Invalidates nothing — see [`Client::add_backup_access_point`].
///
/// # Errors
///
/// See [`Client::get_diagnostics`].
pub async fn delete_backup_access_point(
&self,
backup_network_id: &str,
network_id: Option<&str>,
) -> Result<Envelope, Error> {
let network_id = self.ensure_network_id(network_id, false).await?;
self.api
.backup_access_points()
.delete_backup_access_point(&network_id, backup_network_id)
.await
}
/// Reorders backup access points — returns the raw Eero API response.
///
/// Ported from `rearrange_backup_access_points()` (`client.py:2969-2975`). `auto_discover =
/// false`. Invalidates nothing — see [`Client::add_backup_access_point`].
///
/// # Errors
///
/// See [`Client::get_diagnostics`].
pub async fn rearrange_backup_access_points(
&self,
order: &[&str],
network_id: Option<&str>,
) -> Result<Envelope, Error> {
let network_id = self.ensure_network_id(network_id, false).await?;
self.api
.backup_access_points()
.rearrange(&network_id, order)
.await
}
/// Reads discovered backup-access-point SSIDs — returns the raw Eero API response.
///
/// Ported from `discover_backup_ssids()` (`client.py:2976-2980`). `auto_discover = false`.
///
/// # Errors
///
/// See [`Client::get_diagnostics`].
pub async fn discover_backup_ssids(&self, network_id: Option<&str>) -> Result<Envelope, Error> {
let network_id = self.ensure_network_id(network_id, false).await?;
self.api
.backup_access_points()
.discover_ssids(&network_id)
.await
}
/// Starts backup-access-point SSID discovery — returns the raw Eero API response.
///
/// Ported from `start_backup_ssid_discovery()` (`client.py:2981-2985`). `auto_discover =
/// false`. Invalidates nothing — see [`Client::add_backup_access_point`].
///
/// # Errors
///
/// See [`Client::get_diagnostics`].
pub async fn start_backup_ssid_discovery(
&self,
network_id: Option<&str>,
) -> Result<Envelope, Error> {
let network_id = self.ensure_network_id(network_id, false).await?;
self.api
.backup_access_points()
.start_ssid_discovery(&network_id)
.await
}
/// Starts a backup connectivity check — returns the raw Eero API response.
///
/// Ported from `backup_connectivity_check()` (`client.py:2986-2992`). `auto_discover =
/// false`. Invalidates nothing — see [`Client::add_backup_access_point`].
///
/// # Errors
///
/// See [`Client::get_diagnostics`].
pub async fn backup_connectivity_check(
&self,
network_id: Option<&str>,
) -> Result<Envelope, Error> {
let network_id = self.ensure_network_id(network_id, false).await?;
self.api
.backup_access_points()
.connectivity_check(&network_id)
.await
}
}