forked from Unleash/unleash-types-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrontend.rs
34 lines (30 loc) · 941 Bytes
/
frontend.rs
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
use crate::client_features::Payload;
use serde::{Deserialize, Serialize};
#[cfg(feature = "openapi")]
use utoipa::ToSchema;
#[derive(Serialize, Deserialize, Debug)]
#[cfg_attr(feature = "openapi", derive(ToSchema))]
#[serde(rename_all = "camelCase")]
pub struct FrontendResult {
pub toggles: Vec<EvaluatedToggle>,
}
#[derive(Clone, Serialize, Deserialize, Debug)]
#[cfg_attr(feature = "openapi", derive(ToSchema))]
#[serde(rename_all = "camelCase")]
#[allow(non_snake_case)]
pub struct EvaluatedToggle {
pub name: String,
pub enabled: bool,
pub variant: EvaluatedVariant,
#[serde(rename = "impression_data")]
pub impression_data: bool,
pub impressionData: bool,
}
#[derive(Clone, Serialize, Deserialize, Debug)]
#[cfg_attr(feature = "openapi", derive(ToSchema))]
#[serde(rename_all = "camelCase")]
pub struct EvaluatedVariant {
pub name: String,
pub enabled: bool,
pub payload: Option<Payload>,
}