uptrakit-openapi-client 0.0.3

Typed HTTP client for the Uptrakit web API
Documentation
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
//! URL path constants and constructors for all Uptrakit API endpoints.
//!
//! This is the single source of truth for every path used by the typed client
//! methods and the mock server helpers. When an API path changes, update it
//! here and the compiler will catch every stale call site.
//!
//! # Conventions
//!
//! - `pub(crate) const NAME: &str` — static paths with no runtime parameters.
//! - `pub(crate) fn name(id: &Uuid) -> String` — paths that embed one or more
//!   IDs resolved at call time.

pub(crate) mod auth {
    /// `POST /api/v1/auth/register`
    pub(crate) const REGISTER: &str = "/api/v1/auth/register";
    /// `POST /api/v1/auth/login`
    pub(crate) const LOGIN: &str = "/api/v1/auth/login";
    /// `POST /api/v1/auth/refresh`
    pub(crate) const REFRESH: &str = "/api/v1/auth/refresh";
    /// `POST /api/v1/auth/logout`
    pub(crate) const LOGOUT: &str = "/api/v1/auth/logout";
    /// `GET /api/v1/auth/me`
    pub(crate) const ME: &str = "/api/v1/auth/me";
    /// `GET /api/v1/auth/methods`
    pub(crate) const METHODS: &str = "/api/v1/auth/methods";
    /// `POST /api/v1/auth/device/approve`
    pub(crate) const DEVICE_APPROVE: &str = "/api/v1/auth/device/approve";
    /// `POST /api/v1/auth/device/deny`
    pub(crate) const DEVICE_DENY: &str = "/api/v1/auth/device/deny";
    /// `GET /api/v1/auth/device/lookup`
    pub(crate) const DEVICE_LOOKUP: &str = "/api/v1/auth/device/lookup";
}

pub(crate) mod api_tokens {
    use uuid::Uuid;
    /// `GET /api/v1/auth/api-tokens` · `POST /api/v1/auth/api-tokens`
    pub(crate) const BASE: &str = "/api/v1/auth/api-tokens";
    /// `DELETE /api/v1/auth/api-tokens/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/auth/api-tokens/{id}")
    }
}

pub(crate) mod health {
    /// `GET /healthz`
    pub(crate) const HEALTHZ: &str = "/healthz";
}

pub(crate) mod autodiscovery {
    use uuid::Uuid;
    /// `GET /api/v1/autodiscovery/ignores` · `POST …`
    pub(crate) const IGNORES: &str = "/api/v1/autodiscovery/ignores";
    /// `POST /api/v1/autodiscovery/ignores/batch`
    pub(crate) const BATCH: &str = "/api/v1/autodiscovery/ignores/batch";
    /// `DELETE /api/v1/autodiscovery/ignores/{id}`
    pub(crate) fn ignore_by_id(id: &Uuid) -> String {
        format!("/api/v1/autodiscovery/ignores/{id}")
    }
}

pub(crate) mod discovery_allowlist {
    use uuid::Uuid;
    /// `GET /api/v1/discovery-allowlist` · `POST …`
    pub(crate) const BASE: &str = "/api/v1/discovery-allowlist";
    /// `DELETE /api/v1/discovery-allowlist/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/discovery-allowlist/{id}")
    }
    /// `GET /api/v1/hosts/{host_id}/discovery-allowlist` · `POST …`
    pub(crate) fn host_base(host_id: &Uuid) -> String {
        format!("/api/v1/hosts/{host_id}/discovery-allowlist")
    }
    /// `DELETE /api/v1/hosts/{host_id}/discovery-allowlist/{entry_id}`
    pub(crate) fn host_entry(host_id: &Uuid, entry_id: &Uuid) -> String {
        format!("/api/v1/hosts/{host_id}/discovery-allowlist/{entry_id}")
    }
}

pub(crate) mod host_tags {
    use uuid::Uuid;
    /// `GET /api/v1/host-tags` · `POST /api/v1/host-tags`
    pub(crate) const BASE: &str = "/api/v1/host-tags";
    /// `POST /api/v1/host-tags/batch`
    pub(crate) const BATCH: &str = "/api/v1/host-tags/batch";
    /// `GET /api/v1/host-tags/{id}` · `PUT …` · `DELETE …`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/host-tags/{id}")
    }
    /// `PUT /api/v1/hosts/{host_id}/tags`
    pub(crate) fn host_tags(host_id: &Uuid) -> String {
        format!("/api/v1/hosts/{host_id}/tags")
    }
}

pub(crate) mod hosts {
    use uuid::Uuid;
    /// `GET /api/v1/hosts`
    pub(crate) const BASE: &str = "/api/v1/hosts";
    /// `POST /api/v1/hosts/batch`
    pub(crate) const BATCH: &str = "/api/v1/hosts/batch";
    /// `GET /api/v1/hosts/{id}` · `PUT /api/v1/hosts/{id}` · `DELETE /api/v1/hosts/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/hosts/{id}")
    }
    /// `POST /api/v1/hosts/{id}/discover`
    pub(crate) fn discover(id: &Uuid) -> String {
        format!("/api/v1/hosts/{id}/discover")
    }
}

pub(crate) mod oidc_auth {
    use uuid::Uuid;
    /// `GET /api/v1/auth/oidc/{provider_id}/authorize`
    pub(crate) fn authorize(provider_id: &Uuid) -> String {
        format!("/api/v1/auth/oidc/{provider_id}/authorize")
    }
    /// `POST /api/v1/auth/oidc/exchange`
    pub(crate) const EXCHANGE: &str = "/api/v1/auth/oidc/exchange";
    /// `POST /api/v1/auth/oidc/link`
    pub(crate) const LINK: &str = "/api/v1/auth/oidc/link";
    /// `POST /api/v1/auth/oidc/complete-registration`
    pub(crate) const COMPLETE_REGISTRATION: &str = "/api/v1/auth/oidc/complete-registration";
}

pub(crate) mod oidc_providers {
    use uuid::Uuid;
    /// `GET /api/v1/settings/oidc-providers` · `POST /api/v1/settings/oidc-providers`
    pub(crate) const BASE: &str = "/api/v1/settings/oidc-providers";
    /// `GET /api/v1/settings/oidc-providers/{id}` · `PUT …` · `DELETE …`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/settings/oidc-providers/{id}")
    }
    /// `POST /api/v1/settings/oidc-providers/{id}/activate`
    pub(crate) fn activate(id: &Uuid) -> String {
        format!("/api/v1/settings/oidc-providers/{id}/activate")
    }
    /// `POST /api/v1/settings/oidc-providers/{id}/deactivate`
    pub(crate) fn deactivate(id: &Uuid) -> String {
        format!("/api/v1/settings/oidc-providers/{id}/deactivate")
    }
}

pub(crate) mod pki {
    /// `GET /api/v1/pki/ca.crt`
    pub(crate) const CA_CERT: &str = "/api/v1/pki/ca.crt";
    /// `GET /api/v1/pki/ca.crl`
    pub(crate) const CA_CRL: &str = "/api/v1/pki/ca.crl";
}

pub(crate) mod plugin_configs {
    use uuid::Uuid;
    /// `GET /api/v1/plugin-types`
    pub(crate) const PLUGIN_TYPES: &str = "/api/v1/plugin-types";
    /// `GET /api/v1/plugin-configs` · `POST /api/v1/plugin-configs`
    pub(crate) const BASE: &str = "/api/v1/plugin-configs";
    /// `POST /api/v1/plugin-configs/batch`
    pub(crate) const BATCH: &str = "/api/v1/plugin-configs/batch";
    /// `GET /api/v1/plugin-configs/{id}` · `PUT …` · `DELETE …`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/plugin-configs/{id}")
    }
    /// `POST /api/v1/plugin-configs/{id}/discover`
    pub(crate) fn discover(id: &Uuid) -> String {
        format!("/api/v1/plugin-configs/{id}/discover")
    }
    /// `POST /api/v1/plugin-configs/test`
    pub(crate) const TEST: &str = "/api/v1/plugin-configs/test";
}

pub(crate) mod plugin_type_settings {
    /// `GET /api/v1/plugin-type-settings`
    pub(crate) const BASE: &str = "/api/v1/plugin-type-settings";
    /// `GET /api/v1/plugin-type-settings/{plugin_type}` · `PUT …` · `DELETE …`
    pub(crate) fn by_type(plugin_type: &str) -> String {
        format!("/api/v1/plugin-type-settings/{plugin_type}")
    }
}

pub(crate) mod scheduler {
    use uuid::Uuid;
    /// `GET /api/v1/scheduler/tasks`
    pub(crate) const BASE: &str = "/api/v1/scheduler/tasks";
    /// `GET /api/v1/scheduler/tasks/{id}` · `PUT …`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/scheduler/tasks/{id}")
    }
    /// `POST /api/v1/scheduler/tasks/{id}/trigger`
    pub(crate) fn trigger(id: &Uuid) -> String {
        format!("/api/v1/scheduler/tasks/{id}/trigger")
    }
}

pub(crate) mod notifications {
    use uuid::Uuid;
    /// `POST /api/v1/notifications/channels` · `GET …`
    pub(crate) const CHANNELS: &str = "/api/v1/notifications/channels";
    /// `GET /api/v1/notifications/channels/{id}` · `PUT …` · `DELETE …`
    pub(crate) fn channel_by_id(id: &Uuid) -> String {
        format!("/api/v1/notifications/channels/{id}")
    }
    /// `POST /api/v1/notifications/channels/{id}/test`
    pub(crate) fn test_channel(id: &Uuid) -> String {
        format!("/api/v1/notifications/channels/{id}/test")
    }
    /// `POST /api/v1/notifications/rules` · `GET …`
    pub(crate) const RULES: &str = "/api/v1/notifications/rules";
    /// `GET /api/v1/notifications/rules/{id}` · `PUT …` · `DELETE …`
    pub(crate) fn rule_by_id(id: &Uuid) -> String {
        format!("/api/v1/notifications/rules/{id}")
    }
    /// `GET /api/v1/notifications/log`
    pub(crate) const LOG: &str = "/api/v1/notifications/log";
}

pub(crate) mod enrollment_tokens {
    use uuid::Uuid;
    /// `GET /api/v1/enrollment-tokens` · `POST /api/v1/enrollment-tokens`
    pub(crate) const BASE: &str = "/api/v1/enrollment-tokens";
    /// `GET /api/v1/enrollment-tokens/{id}` · `DELETE /api/v1/enrollment-tokens/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/enrollment-tokens/{id}")
    }
}

pub(crate) mod services {
    use uuid::Uuid;
    /// `GET /api/v1/services` · `POST /api/v1/services`
    pub(crate) const BASE: &str = "/api/v1/services";
    /// `POST /api/v1/services/batch`
    pub(crate) const BATCH: &str = "/api/v1/services/batch";
    /// `GET /api/v1/services/{id}` · `PUT …` · `DELETE …`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/services/{id}")
    }
    /// `POST /api/v1/services/{id}/approve`
    pub(crate) fn approve(id: &Uuid) -> String {
        format!("/api/v1/services/{id}/approve")
    }
    /// `POST /api/v1/services/{id}/reject`
    pub(crate) fn reject(id: &Uuid) -> String {
        format!("/api/v1/services/{id}/reject")
    }
    /// `POST /api/v1/services/{id}/merge`
    pub(crate) fn merge(id: &Uuid) -> String {
        format!("/api/v1/services/{id}/merge")
    }
    /// `POST /api/v1/services/{id}/update-freeze`
    pub(crate) fn update_freeze(id: &Uuid) -> String {
        format!("/api/v1/services/{id}/update-freeze")
    }
}

pub(crate) mod system_services {
    use uuid::Uuid;
    /// `GET /api/v1/system-services`
    pub(crate) const BASE: &str = "/api/v1/system-services";
    /// `POST /api/v1/system-services/batch`
    pub(crate) const BATCH: &str = "/api/v1/system-services/batch";
    /// `GET /api/v1/system-services/{id}` · `PUT …` · `DELETE …`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/system-services/{id}")
    }
    /// `POST /api/v1/system-services/{id}/approve`
    pub(crate) fn approve(id: &Uuid) -> String {
        format!("/api/v1/system-services/{id}/approve")
    }
    /// `POST /api/v1/system-services/{id}/reject`
    pub(crate) fn reject(id: &Uuid) -> String {
        format!("/api/v1/system-services/{id}/reject")
    }
}

pub(crate) mod system_enrollment_tokens {
    use uuid::Uuid;
    /// `GET /api/v1/system-enrollment-tokens` · `POST /api/v1/system-enrollment-tokens`
    pub(crate) const BASE: &str = "/api/v1/system-enrollment-tokens";
    /// `GET /api/v1/system-enrollment-tokens/{id}` · `DELETE /api/v1/system-enrollment-tokens/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/system-enrollment-tokens/{id}")
    }
}

pub(crate) mod global_settings {
    /// `GET /api/v1/global-settings`
    pub(crate) const COMBINED: &str = "/api/v1/global-settings";
}

pub(crate) mod settings {
    /// `GET /api/v1/settings`
    pub(crate) const COMBINED: &str = "/api/v1/settings";
    /// `GET /api/v1/settings/access` · `PUT …`
    pub(crate) const ACCESS: &str = "/api/v1/settings/access";
    /// `GET /api/v1/settings/agent-certificates` · `PUT …`
    pub(crate) const AGENT_CERTIFICATES: &str = "/api/v1/settings/agent-certificates";
    /// `GET /api/v1/global-settings/network` · `PUT …`
    pub(crate) const NETWORK: &str = "/api/v1/global-settings/network";
    /// `POST /api/v1/global-settings/ca/rotate`
    pub(crate) const ROTATE_CA: &str = "/api/v1/global-settings/ca/rotate";
    /// `POST /api/v1/settings/renew-server-certificate`
    pub(crate) const RENEW_SERVER_CERT: &str = "/api/v1/settings/renew-server-certificate";
    /// `POST /api/v1/settings/reset-data`
    pub(crate) const RESET_DATA: &str = "/api/v1/settings/reset-data";
}

pub(crate) mod settings_nats {
    /// `GET /api/v1/global-settings/nats` · `PUT /api/v1/global-settings/nats`
    pub(crate) const BASE: &str = "/api/v1/global-settings/nats";
}

pub(crate) mod settings_provider_github {
    /// `GET /api/v1/global-settings/providers/github` · `PUT …`
    pub(crate) const BASE: &str = "/api/v1/global-settings/providers/github";
}

pub(crate) mod software_items {
    use uuid::Uuid;
    /// `GET /api/v1/software-items` · `POST …`
    pub(crate) const BASE: &str = "/api/v1/software-items";
    /// `POST /api/v1/software-items/batch`
    pub(crate) const BATCH: &str = "/api/v1/software-items/batch";
    /// `POST /api/v1/software-items/merge/preview`
    pub(crate) const MERGE_PREVIEW: &str = "/api/v1/software-items/merge/preview";
    /// `POST /api/v1/software-items/merge/execute`
    pub(crate) const MERGE_EXECUTE: &str = "/api/v1/software-items/merge/execute";
    /// `GET /api/v1/software-items/{id}` · `PUT …` · `DELETE …`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/software-items/{id}")
    }
    /// `POST /api/v1/software-items/{id}/hosts`
    pub(crate) fn hosts(id: &Uuid) -> String {
        format!("/api/v1/software-items/{id}/hosts")
    }
    /// `DELETE /api/v1/software-items/{item_id}/hosts/{host_id}`
    pub(crate) fn host(item_id: &Uuid, host_id: &Uuid) -> String {
        format!("/api/v1/software-items/{item_id}/hosts/{host_id}")
    }
    /// `POST /api/v1/software-items/{id}/check-versions`
    pub(crate) fn check_versions(id: &Uuid) -> String {
        format!("/api/v1/software-items/{id}/check-versions")
    }
    /// `POST /api/v1/software-items/{item_id}/hosts/{host_id}/check-versions`
    pub(crate) fn host_check_versions(item_id: &Uuid, host_id: &Uuid) -> String {
        format!("/api/v1/software-items/{item_id}/hosts/{host_id}/check-versions")
    }
    /// `POST /api/v1/software-items/{item_id}/hosts/{host_id}/update`
    pub(crate) fn host_update(item_id: &Uuid, host_id: &Uuid) -> String {
        format!("/api/v1/software-items/{item_id}/hosts/{host_id}/update")
    }
    /// `DELETE /api/v1/software-items/{item_id}/hosts/{host_id}/plugins/{role}/{ordinal}`
    pub(crate) fn host_plugin_assignment(
        item_id: &Uuid,
        host_id: &Uuid,
        role: &str,
        ordinal: i32,
    ) -> String {
        format!("/api/v1/software-items/{item_id}/hosts/{host_id}/plugins/{role}/{ordinal}")
    }
    /// `POST /api/v1/software-items/{id}/approve`
    pub(crate) fn approve(id: &Uuid) -> String {
        format!("/api/v1/software-items/{id}/approve")
    }
}

pub(crate) mod system_alerts {
    /// `GET /api/v1/system/alerts`
    pub(crate) const ALERTS: &str = "/api/v1/system/alerts";
}

pub(crate) mod update_batches {
    use uuid::Uuid;
    /// `GET /api/v1/update-batches`
    pub(crate) const BASE: &str = "/api/v1/update-batches";
    /// `GET /api/v1/update-batches/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/update-batches/{id}")
    }
    /// `POST /api/v1/hosts/{host_id}/batch-update`
    pub(crate) fn host_batch_update(host_id: &Uuid) -> String {
        format!("/api/v1/hosts/{host_id}/batch-update")
    }
    /// `POST /api/v1/software-items/{id}/batch-update`
    pub(crate) fn item_batch_update(id: &Uuid) -> String {
        format!("/api/v1/software-items/{id}/batch-update")
    }
    /// `GET /api/v1/update-batches/{id}/stream`
    pub(crate) fn stream(id: &Uuid) -> String {
        format!("/api/v1/update-batches/{id}/stream")
    }
}

pub(crate) mod events {
    /// `GET /api/v1/events/stream`
    pub(crate) const STREAM: &str = "/api/v1/events/stream";
}

pub(crate) mod surfaces {
    /// `GET /api/v1/surfaces`
    pub(crate) const BASE: &str = "/api/v1/surfaces";
    /// `GET /api/v1/surfaces/{surface_id}/providers`
    pub(crate) fn providers(surface_id: &str) -> String {
        format!("/api/v1/surfaces/{surface_id}/providers")
    }
    /// `GET /api/v1/surfaces/{surface_id}`
    pub(crate) fn read(surface_id: &str) -> String {
        format!("/api/v1/surfaces/{surface_id}")
    }
    /// `POST /api/v1/surfaces/{surface_id}/interactions/{interaction_id}`
    pub(crate) fn interaction(surface_id: &str, interaction_id: &str) -> String {
        format!("/api/v1/surfaces/{surface_id}/interactions/{interaction_id}")
    }
    /// `GET|PUT|DELETE /api/v1/surfaces/{surface_id}/interactions/{interaction_id}/{item_id}`
    pub(crate) fn interaction_item(
        surface_id: &str,
        interaction_id: &str,
        item_id: &str,
    ) -> String {
        format!("/api/v1/surfaces/{surface_id}/interactions/{interaction_id}/{item_id}")
    }
}

pub(crate) mod users {
    use uuid::Uuid;
    /// `GET /api/v1/users`
    pub(crate) const BASE: &str = "/api/v1/users";
    /// `GET /api/v1/users/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/users/{id}")
    }
    /// `PUT /api/v1/users/{id}/roles`
    pub(crate) fn roles(id: &Uuid) -> String {
        format!("/api/v1/users/{id}/roles")
    }
    /// `PUT /api/v1/users/{id}/active`
    pub(crate) fn active(id: &Uuid) -> String {
        format!("/api/v1/users/{id}/active")
    }
}

pub(crate) mod roles {
    use uuid::Uuid;
    /// `GET /api/v1/roles`
    pub(crate) const BASE: &str = "/api/v1/roles";
    /// `GET /api/v1/roles/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/roles/{id}")
    }
}

pub(crate) mod access_catalog {
    /// `GET /api/v1/access/catalog`
    pub(crate) const BASE: &str = "/api/v1/access/catalog";
}

pub(crate) mod access_grants {
    use uuid::Uuid;

    /// `GET /api/v1/access/grants` · `POST /api/v1/access/grants`
    pub(crate) const BASE: &str = "/api/v1/access/grants";

    /// `GET /api/v1/access/grants/{id}` · `PUT /api/v1/access/grants/{id}` ·
    /// `DELETE /api/v1/access/grants/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/access/grants/{id}")
    }
}

pub(crate) mod audit_logs {
    /// `GET /api/v1/audit-logs`
    pub(crate) const BASE: &str = "/api/v1/audit-logs";
    /// `GET /api/v1/system-audit-logs`
    pub(crate) const SYSTEM: &str = "/api/v1/system-audit-logs";
}

pub(crate) mod update_history {
    use uuid::Uuid;
    /// `GET /api/v1/update-history`
    pub(crate) const BASE: &str = "/api/v1/update-history";
    /// `GET /api/v1/update-history/{id}`
    pub(crate) fn by_id(id: &Uuid) -> String {
        format!("/api/v1/update-history/{id}")
    }
    /// `GET /api/v1/update-history/{id}/output/stream`
    pub(crate) fn output_stream(id: &Uuid) -> String {
        format!("/api/v1/update-history/{id}/output/stream")
    }
}

pub(crate) mod oauth {
    /// `POST /api/v1/oauth/device_authorization` — RFC 8628 §3.1
    pub(crate) const DEVICE_AUTHORIZATION: &str = "/api/v1/oauth/device_authorization";
    /// `POST /api/v1/oauth/token` — RFC 6749 §3.2 / RFC 8628 §3.4
    pub(crate) const TOKEN: &str = "/api/v1/oauth/token";
    /// `GET /.well-known/oauth-authorization-server` — RFC 8414 §3
    pub(crate) const METADATA: &str = "/.well-known/oauth-authorization-server";

    /// `GET`/`POST /api/oauth/clients` — operator client management
    pub(crate) const CLIENTS: &str = "/api/oauth/clients";
    /// `DELETE /api/oauth/clients/{client_id}`
    pub(crate) fn client_by_id(client_id: &str) -> String {
        format!("/api/oauth/clients/{}", encode_segment(client_id))
    }
    /// `POST /api/oauth/clients/{client_id}/trust`
    pub(crate) fn client_trust(client_id: &str) -> String {
        format!("/api/oauth/clients/{}/trust", encode_segment(client_id))
    }
    /// `GET /api/oauth/consents` — end-user authorized apps
    pub(crate) const CONSENTS: &str = "/api/oauth/consents";
    /// `DELETE /api/oauth/consents/{id}`
    pub(crate) fn consent_by_id(id: &uuid::Uuid) -> String {
        format!("/api/oauth/consents/{id}")
    }

    /// Percent-encode a path segment. OAuth client ids may be full HTTPS
    /// URLs (CIMD), which must travel as a single encoded segment.
    fn encode_segment(s: &str) -> String {
        percent_encoding::utf8_percent_encode(s, percent_encoding::NON_ALPHANUMERIC).to_string()
    }
}