Skip to main content

fakecloud_sdk/
types.rs

1use serde::{Deserialize, Serialize};
2
3// ── Health ──────────────────────────────────────────────────────────
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6#[serde(rename_all = "camelCase")]
7pub struct HealthResponse {
8    pub status: String,
9    pub version: String,
10    pub services: Vec<String>,
11}
12
13// ── Reset ───────────────────────────────────────────────────────────
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16#[serde(rename_all = "camelCase")]
17pub struct ResetResponse {
18    pub status: String,
19}
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
22#[serde(rename_all = "camelCase")]
23pub struct ResetServiceResponse {
24    pub reset: String,
25}
26
27// ── RDS ─────────────────────────────────────────────────────────────
28
29#[derive(Debug, Clone, Serialize, Deserialize)]
30#[serde(rename_all = "camelCase")]
31pub struct RdsTag {
32    pub key: String,
33    pub value: String,
34}
35
36#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(rename_all = "camelCase")]
38pub struct RdsInstance {
39    pub db_instance_identifier: String,
40    pub db_instance_arn: String,
41    pub db_instance_class: String,
42    pub engine: String,
43    pub engine_version: String,
44    pub db_instance_status: String,
45    pub master_username: String,
46    pub db_name: Option<String>,
47    pub endpoint_address: String,
48    pub port: i32,
49    pub allocated_storage: i32,
50    pub publicly_accessible: bool,
51    pub deletion_protection: bool,
52    pub created_at: String,
53    pub dbi_resource_id: String,
54    pub container_id: String,
55    pub host_port: u16,
56    pub tags: Vec<RdsTag>,
57}
58
59#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(rename_all = "camelCase")]
61pub struct RdsInstancesResponse {
62    pub instances: Vec<RdsInstance>,
63}
64
65// ── Lambda ──────────────────────────────────────────────────────────
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(rename_all = "camelCase")]
69pub struct LambdaInvocation {
70    pub function_arn: String,
71    pub payload: String,
72    pub source: String,
73    pub timestamp: String,
74}
75
76#[derive(Debug, Clone, Serialize, Deserialize)]
77#[serde(rename_all = "camelCase")]
78pub struct LambdaInvocationsResponse {
79    pub invocations: Vec<LambdaInvocation>,
80}
81
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(rename_all = "camelCase")]
84pub struct WarmContainer {
85    pub function_name: String,
86    pub runtime: String,
87    pub container_id: String,
88    pub last_used_secs_ago: u64,
89}
90
91#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(rename_all = "camelCase")]
93pub struct WarmContainersResponse {
94    pub containers: Vec<WarmContainer>,
95}
96
97#[derive(Debug, Clone, Serialize, Deserialize)]
98#[serde(rename_all = "camelCase")]
99pub struct EvictContainerResponse {
100    pub evicted: bool,
101}
102
103// ── SES ─────────────────────────────────────────────────────────────
104
105#[derive(Debug, Clone, Serialize, Deserialize)]
106#[serde(rename_all = "camelCase")]
107pub struct SentEmail {
108    pub message_id: String,
109    pub from: String,
110    pub to: Vec<String>,
111    #[serde(default)]
112    pub cc: Vec<String>,
113    #[serde(default)]
114    pub bcc: Vec<String>,
115    pub subject: Option<String>,
116    pub html_body: Option<String>,
117    pub text_body: Option<String>,
118    pub raw_data: Option<String>,
119    pub template_name: Option<String>,
120    pub template_data: Option<String>,
121    pub timestamp: String,
122}
123
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(rename_all = "camelCase")]
126pub struct SesEmailsResponse {
127    pub emails: Vec<SentEmail>,
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
131#[serde(rename_all = "camelCase")]
132pub struct InboundEmailRequest {
133    pub from: String,
134    pub to: Vec<String>,
135    pub subject: String,
136    pub body: String,
137}
138
139#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(rename_all = "camelCase")]
141pub struct InboundActionExecuted {
142    pub rule: String,
143    pub action_type: String,
144}
145
146#[derive(Debug, Clone, Serialize, Deserialize)]
147#[serde(rename_all = "camelCase")]
148pub struct InboundEmailResponse {
149    pub message_id: String,
150    pub matched_rules: Vec<String>,
151    pub actions_executed: Vec<InboundActionExecuted>,
152}
153
154// ── SNS ─────────────────────────────────────────────────────────────
155
156#[derive(Debug, Clone, Serialize, Deserialize)]
157#[serde(rename_all = "camelCase")]
158pub struct SnsMessage {
159    pub message_id: String,
160    pub topic_arn: String,
161    pub message: String,
162    pub subject: Option<String>,
163    pub timestamp: String,
164}
165
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(rename_all = "camelCase")]
168pub struct SnsMessagesResponse {
169    pub messages: Vec<SnsMessage>,
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
173#[serde(rename_all = "camelCase")]
174pub struct PendingConfirmation {
175    pub subscription_arn: String,
176    pub topic_arn: String,
177    pub protocol: String,
178    pub endpoint: String,
179    pub token: Option<String>,
180}
181
182#[derive(Debug, Clone, Serialize, Deserialize)]
183#[serde(rename_all = "camelCase")]
184pub struct PendingConfirmationsResponse {
185    pub pending_confirmations: Vec<PendingConfirmation>,
186}
187
188#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(rename_all = "camelCase")]
190pub struct ConfirmSubscriptionRequest {
191    pub subscription_arn: String,
192}
193
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(rename_all = "camelCase")]
196pub struct ConfirmSubscriptionResponse {
197    pub confirmed: bool,
198}
199
200// ── SQS ─────────────────────────────────────────────────────────────
201
202#[derive(Debug, Clone, Serialize, Deserialize)]
203#[serde(rename_all = "camelCase")]
204pub struct SqsMessageInfo {
205    pub message_id: String,
206    pub body: String,
207    pub receive_count: u64,
208    pub in_flight: bool,
209    pub created_at: String,
210}
211
212#[derive(Debug, Clone, Serialize, Deserialize)]
213#[serde(rename_all = "camelCase")]
214pub struct SqsQueueMessages {
215    pub queue_url: String,
216    pub queue_name: String,
217    pub messages: Vec<SqsMessageInfo>,
218}
219
220#[derive(Debug, Clone, Serialize, Deserialize)]
221#[serde(rename_all = "camelCase")]
222pub struct SqsMessagesResponse {
223    pub queues: Vec<SqsQueueMessages>,
224}
225
226#[derive(Debug, Clone, Serialize, Deserialize)]
227#[serde(rename_all = "camelCase")]
228pub struct ExpirationTickResponse {
229    pub expired_messages: u64,
230}
231
232#[derive(Debug, Clone, Serialize, Deserialize)]
233#[serde(rename_all = "camelCase")]
234pub struct ForceDlqResponse {
235    pub moved_messages: u64,
236}
237
238// ── EventBridge ─────────────────────────────────────────────────────
239
240#[derive(Debug, Clone, Serialize, Deserialize)]
241#[serde(rename_all = "camelCase")]
242pub struct EventBridgeEvent {
243    pub event_id: String,
244    pub source: String,
245    pub detail_type: String,
246    pub detail: String,
247    pub bus_name: String,
248    pub timestamp: String,
249}
250
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(rename_all = "camelCase")]
253pub struct EventBridgeLambdaDelivery {
254    pub function_arn: String,
255    pub payload: String,
256    pub timestamp: String,
257}
258
259#[derive(Debug, Clone, Serialize, Deserialize)]
260#[serde(rename_all = "camelCase")]
261pub struct EventBridgeLogDelivery {
262    pub log_group_arn: String,
263    pub payload: String,
264    pub timestamp: String,
265}
266
267#[derive(Debug, Clone, Serialize, Deserialize)]
268#[serde(rename_all = "camelCase")]
269pub struct EventBridgeDeliveries {
270    pub lambda: Vec<EventBridgeLambdaDelivery>,
271    pub logs: Vec<EventBridgeLogDelivery>,
272}
273
274#[derive(Debug, Clone, Serialize, Deserialize)]
275#[serde(rename_all = "camelCase")]
276pub struct EventHistoryResponse {
277    pub events: Vec<EventBridgeEvent>,
278    pub deliveries: EventBridgeDeliveries,
279}
280
281#[derive(Debug, Clone, Serialize, Deserialize)]
282#[serde(rename_all = "camelCase")]
283pub struct FireRuleRequest {
284    pub bus_name: Option<String>,
285    pub rule_name: String,
286}
287
288#[derive(Debug, Clone, Serialize, Deserialize)]
289#[serde(rename_all = "camelCase")]
290pub struct FireRuleTarget {
291    #[serde(rename = "type")]
292    pub target_type: String,
293    pub arn: String,
294}
295
296#[derive(Debug, Clone, Serialize, Deserialize)]
297#[serde(rename_all = "camelCase")]
298pub struct FireRuleResponse {
299    pub targets: Vec<FireRuleTarget>,
300}
301
302// ── S3 ──────────────────────────────────────────────────────────────
303
304#[derive(Debug, Clone, Serialize, Deserialize)]
305#[serde(rename_all = "camelCase")]
306pub struct S3Notification {
307    pub bucket: String,
308    pub key: String,
309    pub event_type: String,
310    pub timestamp: String,
311}
312
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(rename_all = "camelCase")]
315pub struct S3NotificationsResponse {
316    pub notifications: Vec<S3Notification>,
317}
318
319#[derive(Debug, Clone, Serialize, Deserialize)]
320#[serde(rename_all = "camelCase")]
321pub struct LifecycleTickResponse {
322    pub processed_buckets: u64,
323    pub expired_objects: u64,
324    pub transitioned_objects: u64,
325}
326
327// ── DynamoDB ────────────────────────────────────────────────────────
328
329#[derive(Debug, Clone, Serialize, Deserialize)]
330#[serde(rename_all = "camelCase")]
331pub struct TtlTickResponse {
332    pub expired_items: u64,
333}
334
335// ── SecretsManager ──────────────────────────────────────────────────
336
337#[derive(Debug, Clone, Serialize, Deserialize)]
338#[serde(rename_all = "camelCase")]
339pub struct RotationTickResponse {
340    pub rotated_secrets: Vec<String>,
341}
342
343// ── ElastiCache ─────────────────────────────────────────────────────
344
345#[derive(Debug, Clone, Serialize, Deserialize)]
346#[serde(rename_all = "camelCase")]
347pub struct ElastiCacheCluster {
348    pub cache_cluster_id: String,
349    pub cache_cluster_status: String,
350    pub engine: String,
351    pub engine_version: String,
352    pub cache_node_type: String,
353    pub num_cache_nodes: i32,
354    pub replication_group_id: Option<String>,
355    pub port: Option<i32>,
356    pub host_port: Option<u16>,
357    pub container_id: Option<String>,
358}
359
360#[derive(Debug, Clone, Serialize, Deserialize)]
361#[serde(rename_all = "camelCase")]
362pub struct ElastiCacheClustersResponse {
363    pub clusters: Vec<ElastiCacheCluster>,
364}
365
366#[derive(Debug, Clone, Serialize, Deserialize)]
367#[serde(rename_all = "camelCase")]
368pub struct ElastiCacheReplicationGroupIntrospection {
369    pub replication_group_id: String,
370    pub status: String,
371    pub description: String,
372    pub member_clusters: Vec<String>,
373    pub automatic_failover: bool,
374    pub multi_az: bool,
375    pub engine: String,
376    pub engine_version: String,
377    pub cache_node_type: String,
378    pub num_cache_clusters: i32,
379}
380
381#[derive(Debug, Clone, Serialize, Deserialize)]
382#[serde(rename_all = "camelCase")]
383pub struct ElastiCacheReplicationGroupsResponse {
384    pub replication_groups: Vec<ElastiCacheReplicationGroupIntrospection>,
385}
386
387#[derive(Debug, Clone, Serialize, Deserialize)]
388#[serde(rename_all = "camelCase")]
389pub struct ElastiCacheServerlessCacheIntrospection {
390    pub serverless_cache_name: String,
391    pub status: String,
392    pub engine: String,
393    pub engine_version: String,
394    pub cache_node_type: Option<String>,
395}
396
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(rename_all = "camelCase")]
399pub struct ElastiCacheServerlessCachesResponse {
400    pub serverless_caches: Vec<ElastiCacheServerlessCacheIntrospection>,
401}
402
403// ── Cognito ─────────────────────────────────────────────────────────
404
405#[derive(Debug, Clone, Serialize, Deserialize)]
406#[serde(rename_all = "camelCase")]
407pub struct UserConfirmationCodes {
408    pub confirmation_code: Option<String>,
409    pub attribute_verification_codes: serde_json::Value,
410}
411
412#[derive(Debug, Clone, Serialize, Deserialize)]
413#[serde(rename_all = "camelCase")]
414pub struct ConfirmationCode {
415    pub pool_id: String,
416    pub username: String,
417    pub code: String,
418    #[serde(rename = "type")]
419    pub code_type: String,
420    #[serde(skip_serializing_if = "Option::is_none")]
421    pub attribute: Option<String>,
422}
423
424#[derive(Debug, Clone, Serialize, Deserialize)]
425#[serde(rename_all = "camelCase")]
426pub struct ConfirmationCodesResponse {
427    pub codes: Vec<ConfirmationCode>,
428}
429
430#[derive(Debug, Clone, Serialize, Deserialize)]
431#[serde(rename_all = "camelCase")]
432pub struct ConfirmUserRequest {
433    pub user_pool_id: String,
434    pub username: String,
435}
436
437#[derive(Debug, Clone, Serialize, Deserialize)]
438#[serde(rename_all = "camelCase")]
439pub struct ConfirmUserResponse {
440    pub confirmed: bool,
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub error: Option<String>,
443}
444
445#[derive(Debug, Clone, Serialize, Deserialize)]
446#[serde(rename_all = "camelCase")]
447pub struct TokenInfo {
448    #[serde(rename = "type")]
449    pub token_type: String,
450    pub username: String,
451    pub pool_id: String,
452    pub client_id: String,
453    pub issued_at: f64,
454}
455
456#[derive(Debug, Clone, Serialize, Deserialize)]
457#[serde(rename_all = "camelCase")]
458pub struct TokensResponse {
459    pub tokens: Vec<TokenInfo>,
460}
461
462#[derive(Debug, Clone, Serialize, Deserialize)]
463#[serde(rename_all = "camelCase")]
464pub struct ExpireTokensRequest {
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub user_pool_id: Option<String>,
467    #[serde(skip_serializing_if = "Option::is_none")]
468    pub username: Option<String>,
469}
470
471#[derive(Debug, Clone, Serialize, Deserialize)]
472#[serde(rename_all = "camelCase")]
473pub struct ExpireTokensResponse {
474    pub expired_tokens: u64,
475}
476
477#[derive(Debug, Clone, Serialize, Deserialize)]
478#[serde(rename_all = "camelCase")]
479pub struct AuthEvent {
480    pub event_type: String,
481    pub username: String,
482    pub user_pool_id: String,
483    pub client_id: Option<String>,
484    pub timestamp: f64,
485    pub success: bool,
486}
487
488#[derive(Debug, Clone, Serialize, Deserialize)]
489#[serde(rename_all = "camelCase")]
490pub struct AuthEventsResponse {
491    pub events: Vec<AuthEvent>,
492}