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
//! Eero-node routes (`EerosAPI`), ported from `eero-api src/eero/api/eeros.py` at v8.0.4.
//!
//! Several methods here (`get_eero`, `get_led_status`, `set_location`) resolve their URL by
//! preferring a parent envelope's own `url` field (`crate::links::self_url`) over the template —
//! not a named `resources` link. [`crate::routes::Resource::resolve`] only implements the
//! link-preferring shape (`crate::links::sub_resource_url`), so those methods do not call
//! `Resource::resolve` at all; the constants below still record their `method`/`version`/
//! `template` for documentation, and `src/endpoints/eeros.rs` resolves them by hand via
//! `crate::links::self_url`/`crate::links::resource_url` directly (transport-api.md's "rarely
//! `.request(..)`" case). Nightlight discovery (`get_nightlight`/`set_nightlight`) has no fixed
//! route at all — its URL is read out of a parent's `data.nightlight.url` field, or discovered
//! with a live `GET` of the eero's own URL; see that endpoint's own docs.
//!
//! `port_action` addresses two ids (an eero id and a port/interface number) and so cannot be
//! modelled as a single [`Resource`] (which allows exactly one `{id}` placeholder) either; its
//! URL is built by hand from [`crate::links::resource_url`] + [`crate::links::child_url`] plus a
//! literal `"/action"` suffix, in the endpoint module.
use ;
use Method;
/// `GET /2.2/networks/{network_id}/eeros` — list Eero devices (nodes) on a network.
///
/// Ported from `eero-api src/eero/api/eeros.py:168-195` (`EerosAPI.get_eeros`). Resolved via
/// [`Resource::resolve`]: prefers a parent envelope's `resources.eeros` link, falls back to the
/// `networks/{id}/eeros` template.
pub const GET_EEROS: Resource = Resource ;
/// `GET /2.2/eeros/{eero_id}` — a single Eero node's details.
///
/// Ported from `eero-api src/eero/api/eeros.py:197-225` (`EerosAPI.get_eero`). **Not** resolved
/// via [`Resource::resolve`] — see this module's own docs: `get_eero` prefers a parent's own
/// `url` field ([`crate::links::self_url`]), not a named `resources` link, so
/// `src/endpoints/eeros.rs` resolves it by hand from this constant's `template`/`version`.
pub const GET_EERO: Resource = Resource ;
/// Alias of [`GET_EERO`]: `EerosAPI.get_led_status` reads `led_on`/`led_brightness` out of the
/// same Eero node object, resolved the same self-url-preferred way.
///
/// Ported from `eero-api src/eero/api/eeros.py:271-300` (`EerosAPI.get_led_status`).
pub const GET_LED_STATUS: Resource = GET_EERO;
/// `PUT /2.2/eeros/{eero_id}` — set an Eero node's Wi-Fi location label.
///
/// Ported from `eero-api src/eero/api/eeros.py:401-441` (`EerosAPI.set_location`). Same
/// self-url-preferred resolution as [`GET_EERO`] (not [`Resource::resolve`]) — see this module's
/// own docs.
pub const EEROS_SET_LOCATION: Resource = Resource ;
/// `POST /2.2/eeros/{eero_id}/reboot` — reboot a single Eero node.
///
/// Ported from `eero-api src/eero/api/eeros.py:227-269` (`EerosAPI.reboot_eero`). Sends the
/// literal two-byte body `""` (`RequestBody::EmptyJsonString`), not a JSON object.
pub const REBOOT_EERO: Resource = Resource ;
/// `PUT /2.2/eeros/{eero_id}/led` — turn an Eero node's status LED on/off, or set its brightness.
///
/// Ported from `eero-api src/eero/api/eeros.py:302-399` (`EerosAPI.set_led`,
/// `EerosAPI.set_led_brightness`). A dedicated `led` sub-resource, **not** the eero's own URL —
/// the pre-v8.0.0 shape (a JSON PUT to `eeros/{id}` itself) was verified to change nothing
/// server-side (`wiki/Migration.md:451`). Form-encoded (`RequestBody::Form`), not JSON.
pub const SET_LED: Resource = Resource ;
/// Alias of [`SET_LED`]: `EerosAPI.set_led_brightness` PUTs the same `led` sub-resource with
/// `data={"led_brightness": str(brightness)}`.
///
/// Ported from `eero-api src/eero/api/eeros.py:352-399` (`EerosAPI.set_led_brightness`).
pub const SET_LED_BRIGHTNESS: Resource = SET_LED;
/// `GET /2.2/eeros/{eero_id}/connections` — a single Eero node's client connections.
///
/// Ported from `eero-api src/eero/api/eeros.py:606-639` (`EerosAPI.get_connections`).
pub const GET_CONNECTIONS: Resource = Resource ;
/// `POST /2.2/eeros/{eero_id}/action` — power-cycle an Eero node's ports (optionally rebooting
/// the node too).
///
/// Ported from `eero-api src/eero/api/eeros.py:641-693` (`EerosAPI.node_action`). `action` must
/// be one of `_NODE_ACTIONS`; see [`crate::endpoints::eeros::EerosApi::node_action`].
pub const EEROS_NODE_ACTION: Resource = Resource ;
/// `POST /2.2/eeros/{eero_serial}/led_cycle` — cycle an Eero node's status LED through a colour
/// sequence.
///
/// Ported from `eero-api src/eero/api/eeros.py:744-792` (`EerosAPI.led_cycle`). No `network_id`
/// parameter and no `parent=` support in Python — resolved from a bare id/path/URL only, via
/// [`Resource::resolve`] with `link: None`. Form-encoded, with a repeated `colors[]` field per
/// colour.
pub const EEROS_LED_CYCLE: Resource = Resource ;
/// `POST /2.2/eeros/{eero_id}/nightlight/override` — preview a nightlight brightness value
/// without persisting it.
///
/// Ported from `eero-api src/eero/api/eeros.py:794-834` (`EerosAPI.nightlight_override`). No
/// `network_id` parameter and no `parent=` support in Python.
pub const NIGHTLIGHT_OVERRIDE: Resource = Resource ;
/// `GET /2.2/eeros/{eero_serial}/support` — an Eero node's support/diagnostics summary.
///
/// Ported from `eero-api src/eero/api/eeros.py:836-863` (`EerosAPI.get_eero_support`). No
/// `network_id` parameter and no `parent=` support in Python; observed to 404 on some nodes.
pub const GET_EERO_SUPPORT: Resource = Resource ;