Skip to main content

configvault_sdk/
models.rs

1use std::collections::HashMap;
2
3use serde::Deserialize;
4
5/// Response from `GET /config/{key}`.
6#[derive(Debug, Deserialize)]
7pub struct ConfigResponse {
8    pub key: String,
9    pub value: String,
10}
11
12/// Response from `GET /config?prefix={namespace}`.
13#[derive(Debug, Deserialize)]
14pub struct ConfigListResponse {
15    pub namespace: String,
16    pub configs: HashMap<String, String>,
17}
18
19/// Response from `GET /health`.
20#[derive(Debug, Deserialize)]
21pub struct HealthResponse {
22    pub status: String,
23    pub vault: String,
24    pub timestamp: String,
25}
26
27/// Event payload for SSE `config-changed` events.
28#[derive(Debug, Clone, Deserialize)]
29pub struct ConfigChangedEvent {
30    pub keys: Vec<String>,
31    pub timestamp: String,
32}
33
34/// Response from `POST /sync`.
35#[derive(Debug, Deserialize)]
36#[serde(rename_all = "camelCase")]
37pub struct SyncResponse {
38    pub success: bool,
39    pub synced_at: String,
40    pub message: String,
41}