1#[cfg(feature = "rust")]
2use bon::Builder;
3#[cfg(feature = "node")]
4use napi_derive::napi;
5#[cfg(feature = "python")]
6use pyo3::pyclass;
7#[cfg(feature = "python")]
8use pyo3_stub_gen::derive::gen_stub_pyclass;
9use serde::{Deserialize, Serialize};
10
11#[cfg_attr(feature = "python", gen_stub_pyclass)]
13#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
14#[cfg_attr(feature = "node", napi(object))]
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct SecurityOption {
17 pub option: String,
19 pub status: String,
21 pub value: Option<String>,
23}
24
25#[cfg_attr(feature = "python", gen_stub_pyclass)]
27#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
28#[cfg_attr(feature = "node", napi(object))]
29#[derive(Debug, Clone, Serialize, Deserialize)]
30pub struct GetSecurityOptionsResponse {
31 #[serde(default)]
33 pub data: Vec<SecurityOption>,
34 pub error: Option<String>,
36}
37
38#[cfg_attr(feature = "python", gen_stub_pyclass)]
41#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
42#[cfg_attr(feature = "node", napi(object))]
43#[cfg_attr(feature = "rust", derive(Builder))]
44#[derive(Debug, Clone, Default, Serialize)]
45pub struct SecurityOptionsUpdate {
46 #[serde(skip_serializing_if = "Option::is_none")]
48 pub tokens: Option<String>,
49 #[serde(skip_serializing_if = "Option::is_none")]
51 pub referrers: Option<String>,
52 #[serde(skip_serializing_if = "Option::is_none")]
54 pub jwts: Option<String>,
55 #[serde(skip_serializing_if = "Option::is_none")]
57 pub ips: Option<String>,
58 #[serde(rename = "domainMasks", skip_serializing_if = "Option::is_none")]
60 pub domain_masks: Option<String>,
61 #[serde(skip_serializing_if = "Option::is_none")]
63 pub hsts: Option<String>,
64 #[serde(skip_serializing_if = "Option::is_none")]
66 pub cors: Option<String>,
67 #[serde(rename = "requestFilters", skip_serializing_if = "Option::is_none")]
69 pub request_filters: Option<String>,
70 #[serde(rename = "ipCustomHeader", skip_serializing_if = "Option::is_none")]
72 pub ip_custom_header: Option<String>,
73}
74
75#[cfg_attr(feature = "python", gen_stub_pyclass)]
77#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
78#[cfg_attr(feature = "node", napi(object))]
79#[cfg_attr(feature = "rust", derive(Builder))]
80#[derive(Debug, Clone, Default, Serialize)]
81pub struct UpdateSecurityOptionsRequest {
82 pub options: SecurityOptionsUpdate,
84}
85
86#[cfg_attr(feature = "python", gen_stub_pyclass)]
88#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
89#[cfg_attr(feature = "node", napi(object))]
90#[derive(Debug, Clone, Serialize, Deserialize)]
91pub struct UpdateSecurityOptionsResponse {
92 #[serde(default)]
94 pub data: Vec<SecurityOption>,
95 pub error: Option<String>,
97}
98
99#[cfg_attr(feature = "python", gen_stub_pyclass)]
101#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
102#[cfg_attr(feature = "node", napi(object))]
103#[cfg_attr(feature = "rust", derive(Builder))]
104#[derive(Debug, Clone, Default, Serialize)]
105pub struct CreateReferrerRequest {
106 pub referrer: String,
108}
109
110#[cfg_attr(feature = "python", gen_stub_pyclass)]
112#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
113#[cfg_attr(feature = "node", napi(object))]
114#[cfg_attr(feature = "rust", derive(Builder))]
115#[derive(Debug, Clone, Default, Serialize)]
116pub struct CreateIpRequest {
117 pub ip: String,
119}
120
121#[cfg_attr(feature = "python", gen_stub_pyclass)]
123#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
124#[cfg_attr(feature = "node", napi(object))]
125#[cfg_attr(feature = "rust", derive(Builder))]
126#[derive(Debug, Clone, Default, Serialize)]
127pub struct CreateDomainMaskRequest {
128 #[serde(skip_serializing_if = "Option::is_none")]
130 pub domain_mask: Option<String>,
131}
132
133#[cfg_attr(feature = "python", gen_stub_pyclass)]
135#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
136#[cfg_attr(feature = "node", napi(object))]
137#[cfg_attr(feature = "rust", derive(Builder))]
138#[derive(Debug, Clone, Default, Serialize)]
139pub struct CreateJwtRequest {
140 pub public_key: String,
142 pub kid: String,
144 pub name: String,
146}
147
148#[cfg_attr(feature = "python", gen_stub_pyclass)]
150#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
151#[cfg_attr(feature = "node", napi(object))]
152#[cfg_attr(feature = "rust", derive(Builder))]
153#[derive(Debug, Clone, Default, Serialize)]
154pub struct CreateRequestFilterRequest {
155 pub method: Vec<String>,
157}
158
159#[cfg_attr(feature = "python", gen_stub_pyclass)]
161#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
162#[cfg_attr(feature = "node", napi(object))]
163#[derive(Debug, Clone, Serialize, Deserialize)]
164pub struct CreateRequestFilterResponse {
165 pub data: Option<CreateRequestFilterData>,
167 pub error: Option<String>,
169}
170
171#[cfg_attr(feature = "python", gen_stub_pyclass)]
173#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
174#[cfg_attr(feature = "node", napi(object))]
175#[derive(Debug, Clone, Serialize, Deserialize)]
176pub struct CreateRequestFilterData {
177 pub id: String,
179}
180
181#[cfg_attr(feature = "python", gen_stub_pyclass)]
183#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
184#[cfg_attr(feature = "node", napi(object))]
185#[cfg_attr(feature = "rust", derive(Builder))]
186#[derive(Debug, Clone, Default, Serialize)]
187pub struct UpdateRequestFilterRequest {
188 #[serde(skip_serializing_if = "Option::is_none")]
190 pub method: Option<Vec<String>>,
191}
192
193#[cfg_attr(feature = "python", gen_stub_pyclass)]
195#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
196#[cfg_attr(feature = "node", napi(object))]
197#[cfg_attr(feature = "rust", derive(Builder))]
198#[derive(Debug, Clone, Default, Serialize)]
199pub struct CreateOrUpdateIpCustomHeaderRequest {
200 pub header_name: String,
202}
203
204#[cfg_attr(feature = "python", gen_stub_pyclass)]
206#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
207#[cfg_attr(feature = "node", napi(object))]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209pub struct IpCustomHeaderData {
210 pub header_name: String,
212}
213
214#[cfg_attr(feature = "python", gen_stub_pyclass)]
216#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
217#[cfg_attr(feature = "node", napi(object))]
218#[derive(Debug, Clone, Serialize, Deserialize)]
219pub struct CreateOrUpdateIpCustomHeaderResponse {
220 pub data: Option<IpCustomHeaderData>,
222 pub error: Option<String>,
224}
225
226#[cfg_attr(feature = "python", gen_stub_pyclass)]
228#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
229#[cfg_attr(feature = "node", napi(object))]
230#[derive(Debug, Clone, Serialize, Deserialize)]
231pub struct DeleteBoolResponse {
232 pub data: Option<bool>,
234 pub error: Option<String>,
236}