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// ── Step Functions ──────────────────────────────────────────────────
404
405#[derive(Debug, Clone, Serialize, Deserialize)]
406#[serde(rename_all = "camelCase")]
407pub struct StepFunctionsExecution {
408    pub execution_arn: String,
409    pub state_machine_arn: String,
410    pub name: String,
411    pub status: String,
412    #[serde(skip_serializing_if = "Option::is_none")]
413    pub input: Option<String>,
414    #[serde(skip_serializing_if = "Option::is_none")]
415    pub output: Option<String>,
416    pub start_date: String,
417    #[serde(skip_serializing_if = "Option::is_none")]
418    pub stop_date: Option<String>,
419}
420
421#[derive(Debug, Clone, Serialize, Deserialize)]
422#[serde(rename_all = "camelCase")]
423pub struct StepFunctionsExecutionsResponse {
424    pub executions: Vec<StepFunctionsExecution>,
425}
426
427// ── Cognito ─────────────────────────────────────────────────────────
428
429#[derive(Debug, Clone, Serialize, Deserialize)]
430#[serde(rename_all = "camelCase")]
431pub struct UserConfirmationCodes {
432    pub confirmation_code: Option<String>,
433    pub attribute_verification_codes: serde_json::Value,
434}
435
436#[derive(Debug, Clone, Serialize, Deserialize)]
437#[serde(rename_all = "camelCase")]
438pub struct ConfirmationCode {
439    pub pool_id: String,
440    pub username: String,
441    pub code: String,
442    #[serde(rename = "type")]
443    pub code_type: String,
444    #[serde(skip_serializing_if = "Option::is_none")]
445    pub attribute: Option<String>,
446}
447
448#[derive(Debug, Clone, Serialize, Deserialize)]
449#[serde(rename_all = "camelCase")]
450pub struct ConfirmationCodesResponse {
451    pub codes: Vec<ConfirmationCode>,
452}
453
454#[derive(Debug, Clone, Serialize, Deserialize)]
455#[serde(rename_all = "camelCase")]
456pub struct ConfirmUserRequest {
457    pub user_pool_id: String,
458    pub username: String,
459}
460
461#[derive(Debug, Clone, Serialize, Deserialize)]
462#[serde(rename_all = "camelCase")]
463pub struct ConfirmUserResponse {
464    pub confirmed: bool,
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub error: Option<String>,
467}
468
469#[derive(Debug, Clone, Serialize, Deserialize)]
470#[serde(rename_all = "camelCase")]
471pub struct TokenInfo {
472    #[serde(rename = "type")]
473    pub token_type: String,
474    pub username: String,
475    pub pool_id: String,
476    pub client_id: String,
477    pub issued_at: f64,
478}
479
480#[derive(Debug, Clone, Serialize, Deserialize)]
481#[serde(rename_all = "camelCase")]
482pub struct TokensResponse {
483    pub tokens: Vec<TokenInfo>,
484}
485
486#[derive(Debug, Clone, Serialize, Deserialize)]
487#[serde(rename_all = "camelCase")]
488pub struct ExpireTokensRequest {
489    #[serde(skip_serializing_if = "Option::is_none")]
490    pub user_pool_id: Option<String>,
491    #[serde(skip_serializing_if = "Option::is_none")]
492    pub username: Option<String>,
493}
494
495#[derive(Debug, Clone, Serialize, Deserialize)]
496#[serde(rename_all = "camelCase")]
497pub struct ExpireTokensResponse {
498    pub expired_tokens: u64,
499}
500
501#[derive(Debug, Clone, Serialize, Deserialize)]
502#[serde(rename_all = "camelCase")]
503pub struct AuthEvent {
504    pub event_type: String,
505    pub username: String,
506    pub user_pool_id: String,
507    pub client_id: Option<String>,
508    pub timestamp: f64,
509    pub success: bool,
510}
511
512#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(rename_all = "camelCase")]
514pub struct AuthEventsResponse {
515    pub events: Vec<AuthEvent>,
516}
517
518// ── API Gateway v2 ──────────────────────────────────────────────────
519
520#[derive(Debug, Clone, Serialize, Deserialize)]
521#[serde(rename_all = "camelCase")]
522pub struct ApiGatewayV2Request {
523    pub request_id: String,
524    pub api_id: String,
525    pub stage: String,
526    pub method: String,
527    pub path: String,
528    pub headers: std::collections::HashMap<String, String>,
529    pub query_params: std::collections::HashMap<String, String>,
530    #[serde(skip_serializing_if = "Option::is_none")]
531    pub body: Option<String>,
532    pub timestamp: String,
533    pub status_code: u16,
534}
535
536#[derive(Debug, Clone, Serialize, Deserialize)]
537#[serde(rename_all = "camelCase")]
538pub struct ApiGatewayV2RequestsResponse {
539    pub requests: Vec<ApiGatewayV2Request>,
540}
541
542// ── Bedrock ────────────────────────────────────────────────────────
543
544#[derive(Debug, Clone, Serialize, Deserialize)]
545#[serde(rename_all = "camelCase")]
546pub struct BedrockInvocation {
547    pub model_id: String,
548    pub input: String,
549    pub output: String,
550    pub timestamp: String,
551    /// Error detail for faulted calls, or `None` on success.
552    #[serde(default)]
553    pub error: Option<String>,
554}
555
556#[derive(Debug, Clone, Serialize, Deserialize)]
557#[serde(rename_all = "camelCase")]
558pub struct BedrockInvocationsResponse {
559    pub invocations: Vec<BedrockInvocation>,
560}
561
562#[derive(Debug, Clone, Serialize, Deserialize)]
563#[serde(rename_all = "camelCase")]
564pub struct BedrockModelResponseConfig {
565    pub status: String,
566    pub model_id: String,
567}
568
569/// One rule in a per-model response rule list.
570///
571/// `prompt_contains` is a substring that must appear in the prompt for this
572/// rule to match. `None` or an empty string matches any prompt.
573#[derive(Debug, Clone, Serialize, Deserialize)]
574#[serde(rename_all = "camelCase")]
575pub struct BedrockResponseRule {
576    #[serde(default, skip_serializing_if = "Option::is_none")]
577    pub prompt_contains: Option<String>,
578    pub response: String,
579}
580
581/// Configuration for a fault to inject on Bedrock runtime calls.
582#[derive(Debug, Clone, Serialize, Deserialize, Default)]
583#[serde(rename_all = "camelCase")]
584pub struct BedrockFaultRule {
585    pub error_type: String,
586    #[serde(default, skip_serializing_if = "Option::is_none")]
587    pub message: Option<String>,
588    #[serde(default, skip_serializing_if = "Option::is_none")]
589    pub http_status: Option<u16>,
590    #[serde(default, skip_serializing_if = "Option::is_none")]
591    pub count: Option<u32>,
592    #[serde(default, skip_serializing_if = "Option::is_none")]
593    pub model_id: Option<String>,
594    #[serde(default, skip_serializing_if = "Option::is_none")]
595    pub operation: Option<String>,
596}
597
598/// Server-side view of a queued fault rule.
599#[derive(Debug, Clone, Serialize, Deserialize)]
600#[serde(rename_all = "camelCase")]
601pub struct BedrockFaultRuleState {
602    pub error_type: String,
603    pub message: String,
604    pub http_status: u16,
605    pub remaining: u32,
606    #[serde(default)]
607    pub model_id: Option<String>,
608    #[serde(default)]
609    pub operation: Option<String>,
610}
611
612#[derive(Debug, Clone, Serialize, Deserialize)]
613#[serde(rename_all = "camelCase")]
614pub struct BedrockFaultsResponse {
615    pub faults: Vec<BedrockFaultRuleState>,
616}
617
618#[derive(Debug, Clone, Serialize, Deserialize)]
619#[serde(rename_all = "camelCase")]
620pub struct BedrockStatusResponse {
621    pub status: String,
622}