Skip to main content

gproxy_protocol/claude/common/
cache.rs

1use serde::{Deserialize, Serialize};
2
3use super::CacheTtl;
4
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
6#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
7pub struct CacheControl {
8    #[serde(rename = "type")]
9    pub type_: CacheControlType,
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub ttl: Option<CacheTtl>,
12    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13    pub rest: serde_json::Map<String, serde_json::Value>,
14}
15
16#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
17#[non_exhaustive]
18pub enum CacheControlType {
19    #[serde(rename = "ephemeral")]
20    Ephemeral,
21}