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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
//! Network and account routes (`NetworksAPI`, plus `AuthApi`'s `GET /account`).
use ;
use Method;
/// `GET /2.2/account` — fetch the account resource.
///
/// Ported from `const.py:17` (`ACCOUNT_ENDPOINT`) — a constant the Python source itself never
/// imports outside `const.py` (dead in `eero-api`), but the endpoint is real and used by
/// `rusteero`'s `Client::get_account` and the `get_networks` `/account` fallback. Also relied
/// on by `tests/transport.rs`, `tests/harness_smoke.rs` and `tests/live.rs`
/// (shared test files) as a generic "any authenticated GET" example — do not delete. A fixed
/// path (no `{id}` placeholder): every call site resolves it with an empty id and no parent.
pub const ACCOUNT: Resource = Resource ;
/// `GET /2.2/networks` — list every network on the account.
///
/// Ported from `eero-api src/eero/api/networks.py:79-95` (`NetworksAPI.get_networks`). Unchanged since
/// v8.0.4. A fixed path (no `{id}` placeholder): resolved with an empty id and no parent.
pub const GET_NETWORKS: Resource = Resource ;
// ============================= v8.0.4 (`Resource`) constants =============================
//
// Every constant below is new in v8.0.4. `link: Some(name)` means the caller's
// `parent` envelope's `resources.<name>` is preferred over the template
// (`crate::links::sub_resource_url`); `link: None` on a template containing `{id}` means only the
// template is ever used (no named link exists for that resource); `link: None` on a template with
// no `{id}` is a fixed path that ignores its `id_or_url` argument entirely. Constants whose
// natural name collides with a legacy constant above carry an explicit `_V8` suffix.
/// Documentation-only route marker for `networks/{id}` at v8.0.4: `NetworksApi::get_network`
/// and `NetworksApi::get_premium_status` no longer resolve through this crate's `Resource` model
/// (which only supports a *named* `resources.<link>` preference, via
/// [`crate::links::sub_resource_url`]) — Python's `_network_own_url` (`networks.py:47-69`)
/// instead prefers the parent envelope's own top-level `url` field
/// ([`crate::links::self_url`]), which is exactly [`crate::params::resolve_network_url`]'s
/// behaviour. `NetworksApi::network_own_url` calls that helper directly; this constant exists
/// purely so a server-side path rename to this resource is still a one-line, grep-able fix.
pub const NETWORKS_GET_NETWORK: Resource = Resource ;
/// Same wire resource as [`NETWORKS_GET_NETWORK`]: `NetworksAPI.get_premium_status` (`networks.py:123-150`)
/// reads Eero Plus/Secure fields out of the same full network object, resolved the same way.
pub const PREMIUM_STATUS: Resource = NETWORKS_GET_NETWORK;
/// `POST /2.2/networks/{id}/reboot` — reboot every Eero node on the network, preferring the
/// network's own published `reboot` link.
///
/// Ported from `NetworksAPI.reboot_network` (`networks.py:152-185`).
pub const REBOOT_NETWORK_V8: Resource = Resource ;
/// `POST /2.2/networks/{id}/speedtest` — run a speed test, preferring the network's own
/// published `speedtest` link.
///
/// Ported from `NetworksAPI.run_speed_test` (`networks.py:187-222`).
pub const RUN_SPEED_TEST_V8: Resource = Resource ;
/// `GET /2.2/networks/{id}/speedtest` — past speed-test results, same sub-resource as
/// [`RUN_SPEED_TEST_V8`] but a different verb.
///
/// Ported from `NetworksAPI.get_speed_tests` (`networks.py:224-273`).
pub const NETWORKS_GET_SPEED_TESTS: Resource = Resource ;
/// `PUT /2.2/networks/{id}/settings` — rename the network (form-encoded `name=`), preferring the
/// network's own published `settings` link.
///
/// Python's `set_network_name` moved to a form-encoded body at v8.0.4 (`networks.py:275-314`) —
/// the same literal path DNS/security/SQM's own JSON setters PUT onto (each via its own
/// domain-local `Resource` constant — see e.g. `routes::dns::DNS_PUT_SETTINGS`), but a distinct,
/// form-encoded constant here.
pub const NETWORK_SETTINGS_FORM: Resource = Resource ;
/// `PUT /2.2/networks/{id}/password` — set the network's Wi-Fi password (form-encoded
/// `password=`), preferring the network's own published `password` link.
///
/// Ported from `NetworksAPI.set_network_password` (`networks.py:316-354`).
pub const SET_NETWORK_PASSWORD: Resource = Resource ;
/// `DELETE /2.2/networks/{id}/password` — clear the network's Wi-Fi password, same sub-resource
/// as [`SET_NETWORK_PASSWORD`].
///
/// Ported from `NetworksAPI.clear_network_password` (`networks.py:356-389`).
pub const CLEAR_NETWORK_PASSWORD: Resource = Resource ;
/// `GET /2.2/networks/{id}/guestnetwork` — guest network configuration, preferring the network's
/// own published `guestnetwork` link.
///
/// Ported from `NetworksAPI.get_guest_network` (`networks.py:391-423`).
pub const GET_GUEST_NETWORK: Resource = Resource ;
/// `PUT /2.2/networks/{id}/guestnetwork` — enable/disable/rename the guest network
/// (form-encoded), same sub-resource as [`GET_GUEST_NETWORK`].
///
/// Ported from `NetworksAPI.set_guest_network` (`networks.py:425-481`). No `password` field at
/// v8.0.4 (breaking change vs. `v6.2.0`) — see [`SET_GUEST_PASSWORD`].
pub const SET_GUEST_NETWORK_V8: Resource = Resource ;
/// Documentation-only route marker for `networks/{id}/guestnetwork/password`:
/// `NetworksApi::set_guest_password`/`clear_guest_password` resolve through
/// `_guest_password_url` (`networks.py:28-44`), which prefers `resolve_link(guest_parent,
/// "password")` — a `password` link read from the **guest network's own** envelope, not the
/// network's — falling back to this literal template otherwise. This is the same
/// link-name-inside-an-arbitrary-parent shape [`crate::links::sub_resource_url`] already
/// implements; the only reason this domain doesn't use `Resource::resolve` directly for it is
/// that the "parent" here is semantically the guest envelope, which is exactly the value the
/// caller passes as `parent` anyway (see `NetworksApi::set_guest_password`'s own doc comment) —
/// so [`SET_GUEST_PASSWORD`]/[`CLEAR_GUEST_PASSWORD`] below *are* ordinary `Resource` constants.
pub const GUEST_PASSWORD_TEMPLATE: &str = "networks/{id}/guestnetwork/password";
/// `PUT /2.2/networks/{id}/guestnetwork/password` — set the guest network's password
/// (form-encoded), preferring the *guest network's own* `password` link (not the network's).
///
/// Ported from `NetworksAPI.set_guest_password` (`networks.py:483-523`).
pub const SET_GUEST_PASSWORD: Resource = Resource ;
/// `DELETE /2.2/networks/{id}/guestnetwork/password` — clear the guest network's password, same
/// sub-resource as [`SET_GUEST_PASSWORD`].
///
/// Ported from `NetworksAPI.clear_guest_password` (`networks.py:525-560`).
pub const CLEAR_GUEST_PASSWORD: Resource = Resource ;
/// `PUT /2.2/networks/{id}/temporary_flags/hide_5g` — temporarily hide (pause) the network's
/// 5 GHz band.
///
/// Ported from `NetworksAPI.set_hide_5g` (`networks.py:562-598`), enable branch. Template only
/// (`link: None`): the network envelope publishes no link to this resource, so the path is always
/// built from the template and a caller's `parent` plays no part.
pub const NETWORKS_SET_HIDE_5G: Resource = Resource ;
/// `DELETE /2.2/networks/{id}/temporary_flags/hide_5g` — clear the hide-5 GHz flag, same
/// resource as [`NETWORKS_SET_HIDE_5G`].
///
/// Ported from `NetworksAPI.set_hide_5g` (`networks.py:562-598`), disable branch.
pub const NETWORKS_CLEAR_HIDE_5G: Resource = Resource ;