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 SnsSmsMessage {
175    pub phone_number: String,
176    pub message: String,
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(rename_all = "camelCase")]
181pub struct SnsSmsResponse {
182    pub messages: Vec<SnsSmsMessage>,
183}
184
185#[derive(Debug, Clone, Serialize, Deserialize)]
186#[serde(rename_all = "camelCase")]
187pub struct PendingConfirmation {
188    pub subscription_arn: String,
189    pub topic_arn: String,
190    pub protocol: String,
191    pub endpoint: String,
192    pub token: Option<String>,
193}
194
195#[derive(Debug, Clone, Serialize, Deserialize)]
196#[serde(rename_all = "camelCase")]
197pub struct PendingConfirmationsResponse {
198    pub pending_confirmations: Vec<PendingConfirmation>,
199}
200
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(rename_all = "camelCase")]
203pub struct ConfirmSubscriptionRequest {
204    pub subscription_arn: String,
205}
206
207#[derive(Debug, Clone, Serialize, Deserialize)]
208#[serde(rename_all = "camelCase")]
209pub struct ConfirmSubscriptionResponse {
210    pub confirmed: bool,
211}
212
213// ── SQS ─────────────────────────────────────────────────────────────
214
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(rename_all = "camelCase")]
217pub struct SqsMessageInfo {
218    pub message_id: String,
219    pub body: String,
220    pub receive_count: u64,
221    pub in_flight: bool,
222    pub created_at: String,
223}
224
225#[derive(Debug, Clone, Serialize, Deserialize)]
226#[serde(rename_all = "camelCase")]
227pub struct SqsQueueMessages {
228    pub queue_url: String,
229    pub queue_name: String,
230    pub messages: Vec<SqsMessageInfo>,
231}
232
233#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(rename_all = "camelCase")]
235pub struct SqsMessagesResponse {
236    pub queues: Vec<SqsQueueMessages>,
237}
238
239#[derive(Debug, Clone, Serialize, Deserialize)]
240#[serde(rename_all = "camelCase")]
241pub struct ExpirationTickResponse {
242    pub expired_messages: u64,
243}
244
245#[derive(Debug, Clone, Serialize, Deserialize)]
246#[serde(rename_all = "camelCase")]
247pub struct ForceDlqResponse {
248    pub moved_messages: u64,
249}
250
251// ── EventBridge ─────────────────────────────────────────────────────
252
253#[derive(Debug, Clone, Serialize, Deserialize)]
254#[serde(rename_all = "camelCase")]
255pub struct EventBridgeEvent {
256    pub event_id: String,
257    pub source: String,
258    pub detail_type: String,
259    pub detail: String,
260    pub bus_name: String,
261    pub timestamp: String,
262}
263
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(rename_all = "camelCase")]
266pub struct EventBridgeLambdaDelivery {
267    pub function_arn: String,
268    pub payload: String,
269    pub timestamp: String,
270}
271
272#[derive(Debug, Clone, Serialize, Deserialize)]
273#[serde(rename_all = "camelCase")]
274pub struct EventBridgeLogDelivery {
275    pub log_group_arn: String,
276    pub payload: String,
277    pub timestamp: String,
278}
279
280#[derive(Debug, Clone, Serialize, Deserialize)]
281#[serde(rename_all = "camelCase")]
282pub struct EventBridgeDeliveries {
283    pub lambda: Vec<EventBridgeLambdaDelivery>,
284    pub logs: Vec<EventBridgeLogDelivery>,
285}
286
287#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(rename_all = "camelCase")]
289pub struct EventHistoryResponse {
290    pub events: Vec<EventBridgeEvent>,
291    pub deliveries: EventBridgeDeliveries,
292}
293
294#[derive(Debug, Clone, Serialize, Deserialize)]
295#[serde(rename_all = "camelCase")]
296pub struct FireRuleRequest {
297    pub bus_name: Option<String>,
298    pub rule_name: String,
299}
300
301// ── RDS aws_lambda extension bridge ─────────────────────────────────
302
303/// Request body for `POST /_fakecloud/rds/lambda-invoke`. The endpoint is
304/// the bridge that the PostgreSQL `aws_lambda` extension calls into from
305/// inside an RDS DB instance container — it's normally not driven by
306/// user code directly.
307#[derive(Debug, Clone, Serialize, Deserialize)]
308#[serde(rename_all = "snake_case")]
309pub struct RdsLambdaInvokeRequest {
310    pub function_name: String,
311    pub payload: Option<serde_json::Value>,
312    pub invocation_type: Option<String>,
313    pub region: Option<String>,
314}
315
316/// Shape returned by the bridge — mirrors what `aws_lambda.invoke()`
317/// returns to SQL callers (RDS/Aurora-compatible).
318#[derive(Debug, Clone, Serialize, Deserialize)]
319#[serde(rename_all = "snake_case")]
320pub struct RdsLambdaInvokeResponse {
321    pub status_code: i32,
322    pub payload: Option<serde_json::Value>,
323    pub executed_version: Option<String>,
324    pub log_result: Option<String>,
325}
326
327// ── RDS aws_s3 extension bridge ─────────────────────────────────────
328
329/// Request body for `POST /_fakecloud/rds/s3-import`. The endpoint is
330/// the bridge that the PostgreSQL `aws_s3` extension calls into to
331/// fetch an object from a fakecloud bucket. Body is returned base64
332/// encoded so JSON transport stays text-only.
333#[derive(Debug, Clone, Serialize, Deserialize)]
334#[serde(rename_all = "snake_case")]
335pub struct RdsS3ImportRequest {
336    pub bucket: String,
337    pub key: String,
338    pub region: Option<String>,
339}
340
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(rename_all = "snake_case")]
343pub struct RdsS3ImportResponse {
344    pub bucket: String,
345    pub key: String,
346    pub body_b64: String,
347    pub bytes_processed: i64,
348}
349
350/// Request body for `POST /_fakecloud/rds/s3-export`. Bridge equivalent
351/// of an S3 PutObject driven from inside the DB container.
352#[derive(Debug, Clone, Serialize, Deserialize)]
353#[serde(rename_all = "snake_case")]
354pub struct RdsS3ExportRequest {
355    pub bucket: String,
356    pub key: String,
357    pub region: Option<String>,
358    pub body_b64: String,
359}
360
361#[derive(Debug, Clone, Serialize, Deserialize)]
362#[serde(rename_all = "snake_case")]
363pub struct RdsS3ExportResponse {
364    pub bucket: String,
365    pub key: String,
366    pub bytes_uploaded: i64,
367}
368
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(rename_all = "camelCase")]
371pub struct FireRuleTarget {
372    #[serde(rename = "type")]
373    pub target_type: String,
374    pub arn: String,
375}
376
377#[derive(Debug, Clone, Serialize, Deserialize)]
378#[serde(rename_all = "camelCase")]
379pub struct FireRuleResponse {
380    pub targets: Vec<FireRuleTarget>,
381}
382
383// ── Scheduler (EventBridge Scheduler) ───────────────────────────────
384
385#[derive(Debug, Clone, Serialize, Deserialize)]
386#[serde(rename_all = "camelCase")]
387pub struct SchedulerSchedule {
388    pub account_id: String,
389    pub group_name: String,
390    pub name: String,
391    pub arn: String,
392    pub state: String,
393    pub schedule_expression: String,
394    pub target_arn: String,
395    pub last_fired: Option<String>,
396}
397
398#[derive(Debug, Clone, Serialize, Deserialize)]
399#[serde(rename_all = "camelCase")]
400pub struct SchedulerSchedulesResponse {
401    pub schedules: Vec<SchedulerSchedule>,
402}
403
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(rename_all = "camelCase")]
406pub struct FireScheduleResponse {
407    pub schedule_arn: String,
408    pub target_arn: String,
409}
410
411// ── S3 ──────────────────────────────────────────────────────────────
412
413#[derive(Debug, Clone, Serialize, Deserialize)]
414#[serde(rename_all = "camelCase")]
415pub struct S3Notification {
416    pub bucket: String,
417    pub key: String,
418    pub event_type: String,
419    pub timestamp: String,
420}
421
422#[derive(Debug, Clone, Serialize, Deserialize)]
423#[serde(rename_all = "camelCase")]
424pub struct S3NotificationsResponse {
425    pub notifications: Vec<S3Notification>,
426}
427
428#[derive(Debug, Clone, Serialize, Deserialize)]
429#[serde(rename_all = "camelCase")]
430pub struct LifecycleTickResponse {
431    pub processed_buckets: u64,
432    pub expired_objects: u64,
433    pub transitioned_objects: u64,
434}
435
436// ── DynamoDB ────────────────────────────────────────────────────────
437
438#[derive(Debug, Clone, Serialize, Deserialize)]
439#[serde(rename_all = "camelCase")]
440pub struct TtlTickResponse {
441    pub expired_items: u64,
442}
443
444// ── SecretsManager ──────────────────────────────────────────────────
445
446#[derive(Debug, Clone, Serialize, Deserialize)]
447#[serde(rename_all = "camelCase")]
448pub struct RotationTickResponse {
449    pub rotated_secrets: Vec<String>,
450}
451
452// ── ElastiCache ─────────────────────────────────────────────────────
453
454#[derive(Debug, Clone, Serialize, Deserialize)]
455#[serde(rename_all = "camelCase")]
456pub struct ElastiCacheCluster {
457    pub cache_cluster_id: String,
458    pub cache_cluster_status: String,
459    pub engine: String,
460    pub engine_version: String,
461    pub cache_node_type: String,
462    pub num_cache_nodes: i32,
463    pub replication_group_id: Option<String>,
464    pub port: Option<i32>,
465    pub host_port: Option<u16>,
466    pub container_id: Option<String>,
467}
468
469#[derive(Debug, Clone, Serialize, Deserialize)]
470#[serde(rename_all = "camelCase")]
471pub struct ElastiCacheClustersResponse {
472    pub clusters: Vec<ElastiCacheCluster>,
473}
474
475#[derive(Debug, Clone, Serialize, Deserialize)]
476#[serde(rename_all = "camelCase")]
477pub struct ElastiCacheReplicationGroupIntrospection {
478    pub replication_group_id: String,
479    pub status: String,
480    pub description: String,
481    pub member_clusters: Vec<String>,
482    pub automatic_failover: bool,
483    pub multi_az: bool,
484    pub engine: String,
485    pub engine_version: String,
486    pub cache_node_type: String,
487    pub num_cache_clusters: i32,
488}
489
490#[derive(Debug, Clone, Serialize, Deserialize)]
491#[serde(rename_all = "camelCase")]
492pub struct ElastiCacheReplicationGroupsResponse {
493    pub replication_groups: Vec<ElastiCacheReplicationGroupIntrospection>,
494}
495
496#[derive(Debug, Clone, Serialize, Deserialize)]
497#[serde(rename_all = "camelCase")]
498pub struct ElastiCacheServerlessCacheIntrospection {
499    pub serverless_cache_name: String,
500    pub status: String,
501    pub engine: String,
502    pub engine_version: String,
503    pub cache_node_type: Option<String>,
504}
505
506#[derive(Debug, Clone, Serialize, Deserialize)]
507#[serde(rename_all = "camelCase")]
508pub struct ElastiCacheServerlessCachesResponse {
509    pub serverless_caches: Vec<ElastiCacheServerlessCacheIntrospection>,
510}
511
512// ── Step Functions ──────────────────────────────────────────────────
513
514#[derive(Debug, Clone, Serialize, Deserialize)]
515#[serde(rename_all = "camelCase")]
516pub struct StepFunctionsExecution {
517    pub execution_arn: String,
518    pub state_machine_arn: String,
519    pub name: String,
520    pub status: String,
521    #[serde(skip_serializing_if = "Option::is_none")]
522    pub input: Option<String>,
523    #[serde(skip_serializing_if = "Option::is_none")]
524    pub output: Option<String>,
525    pub start_date: String,
526    #[serde(skip_serializing_if = "Option::is_none")]
527    pub stop_date: Option<String>,
528}
529
530#[derive(Debug, Clone, Serialize, Deserialize)]
531#[serde(rename_all = "camelCase")]
532pub struct StepFunctionsExecutionsResponse {
533    pub executions: Vec<StepFunctionsExecution>,
534}
535
536#[derive(Debug, Clone, Serialize, Deserialize, Default)]
537#[serde(rename_all = "camelCase")]
538pub struct SfnEnqueueActivityTaskRequest {
539    pub activity_arn: String,
540    #[serde(skip_serializing_if = "Option::is_none")]
541    pub input: Option<String>,
542    #[serde(skip_serializing_if = "Option::is_none")]
543    pub heartbeat_seconds: Option<i64>,
544    #[serde(skip_serializing_if = "Option::is_none")]
545    pub timeout_seconds: Option<i64>,
546}
547
548#[derive(Debug, Clone, Serialize, Deserialize)]
549#[serde(rename_all = "camelCase")]
550pub struct SfnEnqueueActivityTaskResponse {
551    pub task_token: String,
552}
553
554// ── Cognito ─────────────────────────────────────────────────────────
555
556#[derive(Debug, Clone, Serialize, Deserialize)]
557#[serde(rename_all = "camelCase")]
558pub struct UserConfirmationCodes {
559    pub confirmation_code: Option<String>,
560    pub attribute_verification_codes: serde_json::Value,
561}
562
563#[derive(Debug, Clone, Serialize, Deserialize)]
564#[serde(rename_all = "camelCase")]
565pub struct ConfirmationCode {
566    pub pool_id: String,
567    pub username: String,
568    pub code: String,
569    #[serde(rename = "type")]
570    pub code_type: String,
571    #[serde(skip_serializing_if = "Option::is_none")]
572    pub attribute: Option<String>,
573}
574
575#[derive(Debug, Clone, Serialize, Deserialize)]
576#[serde(rename_all = "camelCase")]
577pub struct ConfirmationCodesResponse {
578    pub codes: Vec<ConfirmationCode>,
579}
580
581#[derive(Debug, Clone, Serialize, Deserialize)]
582#[serde(rename_all = "camelCase")]
583pub struct ConfirmUserRequest {
584    pub user_pool_id: String,
585    pub username: String,
586}
587
588#[derive(Debug, Clone, Serialize, Deserialize)]
589#[serde(rename_all = "camelCase")]
590pub struct ConfirmUserResponse {
591    pub confirmed: bool,
592    #[serde(skip_serializing_if = "Option::is_none")]
593    pub error: Option<String>,
594}
595
596#[derive(Debug, Clone, Serialize, Deserialize)]
597#[serde(rename_all = "camelCase")]
598pub struct TokenInfo {
599    #[serde(rename = "type")]
600    pub token_type: String,
601    pub username: String,
602    pub pool_id: String,
603    pub client_id: String,
604    pub issued_at: f64,
605}
606
607#[derive(Debug, Clone, Serialize, Deserialize)]
608#[serde(rename_all = "camelCase")]
609pub struct TokensResponse {
610    pub tokens: Vec<TokenInfo>,
611}
612
613#[derive(Debug, Clone, Serialize, Deserialize)]
614#[serde(rename_all = "camelCase")]
615pub struct ExpireTokensRequest {
616    #[serde(skip_serializing_if = "Option::is_none")]
617    pub user_pool_id: Option<String>,
618    #[serde(skip_serializing_if = "Option::is_none")]
619    pub username: Option<String>,
620}
621
622#[derive(Debug, Clone, Serialize, Deserialize)]
623#[serde(rename_all = "camelCase")]
624pub struct ExpireTokensResponse {
625    pub expired_tokens: u64,
626}
627
628#[derive(Debug, Clone, Serialize, Deserialize)]
629#[serde(rename_all = "camelCase")]
630pub struct AuthEvent {
631    pub event_type: String,
632    pub username: String,
633    pub user_pool_id: String,
634    pub client_id: Option<String>,
635    pub timestamp: f64,
636    pub success: bool,
637}
638
639#[derive(Debug, Clone, Serialize, Deserialize)]
640#[serde(rename_all = "camelCase")]
641pub struct AuthEventsResponse {
642    pub events: Vec<AuthEvent>,
643}
644
645// ── API Gateway v2 ──────────────────────────────────────────────────
646
647#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(rename_all = "camelCase")]
649pub struct ApiGatewayV2Request {
650    pub request_id: String,
651    pub api_id: String,
652    pub stage: String,
653    pub method: String,
654    pub path: String,
655    pub headers: std::collections::HashMap<String, String>,
656    pub query_params: std::collections::HashMap<String, String>,
657    #[serde(skip_serializing_if = "Option::is_none")]
658    pub body: Option<String>,
659    pub timestamp: String,
660    pub status_code: u16,
661}
662
663#[derive(Debug, Clone, Serialize, Deserialize)]
664#[serde(rename_all = "camelCase")]
665pub struct ApiGatewayV2RequestsResponse {
666    pub requests: Vec<ApiGatewayV2Request>,
667}
668
669// ── Bedrock ────────────────────────────────────────────────────────
670
671#[derive(Debug, Clone, Serialize, Deserialize)]
672#[serde(rename_all = "camelCase")]
673pub struct BedrockInvocation {
674    pub model_id: String,
675    pub input: String,
676    pub output: String,
677    pub timestamp: String,
678    /// Error detail for faulted calls, or `None` on success.
679    #[serde(default)]
680    pub error: Option<String>,
681}
682
683#[derive(Debug, Clone, Serialize, Deserialize)]
684#[serde(rename_all = "camelCase")]
685pub struct BedrockInvocationsResponse {
686    pub invocations: Vec<BedrockInvocation>,
687}
688
689#[derive(Debug, Clone, Serialize, Deserialize)]
690#[serde(rename_all = "camelCase")]
691pub struct BedrockModelResponseConfig {
692    pub status: String,
693    pub model_id: String,
694}
695
696/// One rule in a per-model response rule list.
697///
698/// `prompt_contains` is a substring that must appear in the prompt for this
699/// rule to match. `None` or an empty string matches any prompt.
700#[derive(Debug, Clone, Serialize, Deserialize)]
701#[serde(rename_all = "camelCase")]
702pub struct BedrockResponseRule {
703    #[serde(default, skip_serializing_if = "Option::is_none")]
704    pub prompt_contains: Option<String>,
705    pub response: String,
706}
707
708/// Configuration for a fault to inject on Bedrock runtime calls.
709#[derive(Debug, Clone, Serialize, Deserialize, Default)]
710#[serde(rename_all = "camelCase")]
711pub struct BedrockFaultRule {
712    pub error_type: String,
713    #[serde(default, skip_serializing_if = "Option::is_none")]
714    pub message: Option<String>,
715    #[serde(default, skip_serializing_if = "Option::is_none")]
716    pub http_status: Option<u16>,
717    #[serde(default, skip_serializing_if = "Option::is_none")]
718    pub count: Option<u32>,
719    #[serde(default, skip_serializing_if = "Option::is_none")]
720    pub model_id: Option<String>,
721    #[serde(default, skip_serializing_if = "Option::is_none")]
722    pub operation: Option<String>,
723}
724
725/// Server-side view of a queued fault rule.
726#[derive(Debug, Clone, Serialize, Deserialize)]
727#[serde(rename_all = "camelCase")]
728pub struct BedrockFaultRuleState {
729    pub error_type: String,
730    pub message: String,
731    pub http_status: u16,
732    pub remaining: u32,
733    #[serde(default)]
734    pub model_id: Option<String>,
735    #[serde(default)]
736    pub operation: Option<String>,
737}
738
739#[derive(Debug, Clone, Serialize, Deserialize)]
740#[serde(rename_all = "camelCase")]
741pub struct BedrockFaultsResponse {
742    pub faults: Vec<BedrockFaultRuleState>,
743}
744
745#[derive(Debug, Clone, Serialize, Deserialize)]
746#[serde(rename_all = "camelCase")]
747pub struct BedrockStatusResponse {
748    pub status: String,
749}
750
751#[derive(Debug, Clone, Serialize, Deserialize)]
752#[serde(rename_all = "camelCase")]
753pub struct EcrRepository {
754    pub repository_name: String,
755    pub repository_arn: String,
756    pub registry_id: String,
757    pub repository_uri: String,
758    pub image_tag_mutability: String,
759    pub scan_on_push: bool,
760    pub created_at: String,
761    pub tags: Vec<EcrTag>,
762    pub has_policy: bool,
763    pub has_lifecycle_policy: bool,
764    pub image_count: u64,
765    pub layer_count: u64,
766}
767
768#[derive(Debug, Clone, Serialize, Deserialize)]
769#[serde(rename_all = "camelCase")]
770pub struct EcrImage {
771    pub repository_name: String,
772    pub image_digest: String,
773    pub image_tags: Vec<String>,
774    pub image_size_in_bytes: u64,
775    pub image_manifest_media_type: String,
776    pub image_pushed_at: String,
777}
778
779#[derive(Debug, Clone, Serialize, Deserialize)]
780#[serde(rename_all = "camelCase")]
781pub struct EcrImagesResponse {
782    pub images: Vec<EcrImage>,
783}
784
785#[derive(Debug, Clone, Serialize, Deserialize)]
786#[serde(rename_all = "camelCase")]
787pub struct EcrPullThroughRule {
788    pub ecr_repository_prefix: String,
789    pub upstream_registry_url: String,
790    pub upstream_registry: Option<String>,
791    pub credential_arn: Option<String>,
792    pub custom_role_arn: Option<String>,
793    pub created_at: String,
794    pub updated_at: String,
795}
796
797#[derive(Debug, Clone, Serialize, Deserialize)]
798#[serde(rename_all = "camelCase")]
799pub struct EcrPullThroughRulesResponse {
800    pub rules: Vec<EcrPullThroughRule>,
801}
802
803#[derive(Debug, Clone, Serialize, Deserialize)]
804#[serde(rename_all = "camelCase")]
805pub struct EcrTag {
806    pub key: String,
807    pub value: String,
808}
809
810#[derive(Debug, Clone, Serialize, Deserialize)]
811#[serde(rename_all = "camelCase")]
812pub struct EcrRepositoriesResponse {
813    pub repositories: Vec<EcrRepository>,
814}
815
816#[derive(Debug, Clone, Serialize, Deserialize)]
817#[serde(rename_all = "camelCase")]
818pub struct EcsCluster {
819    pub cluster_name: String,
820    pub cluster_arn: String,
821    pub status: String,
822    pub running_tasks_count: i32,
823    pub pending_tasks_count: i32,
824    pub active_services_count: i32,
825    pub registered_container_instances_count: i32,
826    pub capacity_providers: Vec<String>,
827    pub tags: Vec<EcsTag>,
828    pub created_at: String,
829}
830
831#[derive(Debug, Clone, Serialize, Deserialize)]
832#[serde(rename_all = "camelCase")]
833pub struct EcsTag {
834    pub key: String,
835    pub value: String,
836}
837
838#[derive(Debug, Clone, Serialize, Deserialize)]
839#[serde(rename_all = "camelCase")]
840pub struct EcsClustersResponse {
841    pub clusters: Vec<EcsCluster>,
842}
843
844#[derive(Debug, Clone, Serialize, Deserialize)]
845#[serde(rename_all = "camelCase")]
846pub struct EcsTaskContainer {
847    pub name: String,
848    pub image: String,
849    pub last_status: String,
850    pub exit_code: Option<i64>,
851    pub runtime_id: Option<String>,
852    pub essential: bool,
853}
854
855#[derive(Debug, Clone, Serialize, Deserialize)]
856#[serde(rename_all = "camelCase")]
857pub struct EcsTask {
858    pub task_arn: String,
859    pub task_id: String,
860    pub cluster_arn: String,
861    pub cluster_name: String,
862    pub task_definition_arn: String,
863    pub family: String,
864    pub revision: i32,
865    pub last_status: String,
866    pub desired_status: String,
867    pub launch_type: String,
868    pub created_at: String,
869    pub started_at: Option<String>,
870    pub stopping_at: Option<String>,
871    pub stopped_at: Option<String>,
872    pub stop_code: Option<String>,
873    pub stopped_reason: Option<String>,
874    pub containers: Vec<EcsTaskContainer>,
875    pub captured_log_bytes: usize,
876}
877
878#[derive(Debug, Clone, Serialize, Deserialize)]
879#[serde(rename_all = "camelCase")]
880pub struct EcsTasksResponse {
881    pub tasks: Vec<EcsTask>,
882}
883
884#[derive(Debug, Clone, Serialize, Deserialize)]
885#[serde(rename_all = "camelCase")]
886pub struct EcsTaskLogsResponse {
887    pub task_arn: String,
888    pub logs: String,
889    pub last_status: String,
890    pub exit_code: Option<i64>,
891}
892
893#[derive(Debug, Clone, Serialize, Deserialize, Default)]
894#[serde(rename_all = "camelCase")]
895pub struct EcsMarkFailedRequest {
896    pub exit_code: Option<i64>,
897    pub reason: Option<String>,
898}
899
900#[derive(Debug, Clone, Serialize, Deserialize)]
901#[serde(rename_all = "camelCase")]
902pub struct EcsLifecycleEvent {
903    pub at: String,
904    pub event_type: String,
905    pub task_arn: Option<String>,
906    pub cluster_arn: Option<String>,
907    pub last_status: Option<String>,
908    pub detail: serde_json::Value,
909}
910
911#[derive(Debug, Clone, Serialize, Deserialize)]
912#[serde(rename_all = "camelCase")]
913pub struct EcsEventsResponse {
914    pub events: Vec<EcsLifecycleEvent>,
915}
916
917// ── ELBv2 ───────────────────────────────────────────────────────────
918
919#[derive(Debug, Clone, Serialize, Deserialize)]
920#[serde(rename_all = "camelCase")]
921pub struct Elbv2LoadBalancer {
922    pub arn: String,
923    pub name: String,
924    pub dns_name: String,
925    pub scheme: String,
926    pub vpc_id: String,
927    pub state_code: String,
928    pub state_reason: Option<String>,
929    pub lb_type: String,
930    pub ip_address_type: String,
931    pub availability_zones: Vec<Elbv2AvailabilityZone>,
932    pub security_groups: Vec<String>,
933    pub created_time: String,
934    pub tags: Vec<Elbv2Tag>,
935    /// In-process data plane TCP port for ALBs. `None` for NLB/GWLB
936    /// or when the data plane is disabled. Tests connect to
937    /// `127.0.0.1:<bound_port>` to reach the routed targets.
938    #[serde(skip_serializing_if = "Option::is_none")]
939    pub bound_port: Option<u16>,
940}
941
942#[derive(Debug, Clone, Serialize, Deserialize)]
943#[serde(rename_all = "camelCase")]
944pub struct Elbv2AvailabilityZone {
945    pub zone_name: String,
946    pub subnet_id: String,
947}
948
949#[derive(Debug, Clone, Serialize, Deserialize)]
950#[serde(rename_all = "camelCase")]
951pub struct Elbv2Tag {
952    pub key: String,
953    pub value: String,
954}
955
956#[derive(Debug, Clone, Serialize, Deserialize)]
957#[serde(rename_all = "camelCase")]
958pub struct Elbv2LoadBalancersResponse {
959    pub load_balancers: Vec<Elbv2LoadBalancer>,
960}
961
962#[derive(Debug, Clone, Serialize, Deserialize)]
963#[serde(rename_all = "camelCase")]
964pub struct Elbv2TargetGroup {
965    pub arn: String,
966    pub name: String,
967    pub protocol: Option<String>,
968    pub port: Option<i32>,
969    pub vpc_id: Option<String>,
970    pub target_type: String,
971    pub load_balancer_arns: Vec<String>,
972    pub targets: Vec<Elbv2Target>,
973    pub health_check_protocol: Option<String>,
974    pub health_check_port: Option<String>,
975    pub health_check_path: Option<String>,
976    pub healthy_threshold_count: i32,
977    pub unhealthy_threshold_count: i32,
978    pub created_time: String,
979    pub tags: Vec<Elbv2Tag>,
980}
981
982#[derive(Debug, Clone, Serialize, Deserialize)]
983#[serde(rename_all = "camelCase")]
984pub struct Elbv2Target {
985    pub id: String,
986    pub port: Option<i32>,
987    pub availability_zone: Option<String>,
988    pub health_state: String,
989    pub health_reason: Option<String>,
990    pub health_description: Option<String>,
991}
992
993#[derive(Debug, Clone, Serialize, Deserialize)]
994#[serde(rename_all = "camelCase")]
995pub struct Elbv2TargetGroupsResponse {
996    pub target_groups: Vec<Elbv2TargetGroup>,
997}
998
999#[derive(Debug, Clone, Serialize, Deserialize)]
1000#[serde(rename_all = "camelCase")]
1001pub struct Elbv2Listener {
1002    pub arn: String,
1003    pub load_balancer_arn: String,
1004    pub port: Option<i32>,
1005    pub protocol: Option<String>,
1006    pub ssl_policy: Option<String>,
1007    pub certificate_arns: Vec<String>,
1008    pub default_action_type: Option<String>,
1009    pub default_target_group_arn: Option<String>,
1010}
1011
1012#[derive(Debug, Clone, Serialize, Deserialize)]
1013#[serde(rename_all = "camelCase")]
1014pub struct Elbv2ListenersResponse {
1015    pub listeners: Vec<Elbv2Listener>,
1016}
1017
1018#[derive(Debug, Clone, Serialize, Deserialize)]
1019#[serde(rename_all = "camelCase")]
1020pub struct Elbv2Rule {
1021    pub arn: String,
1022    pub listener_arn: String,
1023    pub priority: String,
1024    pub is_default: bool,
1025    pub condition_fields: Vec<String>,
1026    pub action_type: Option<String>,
1027}
1028
1029#[derive(Debug, Clone, Serialize, Deserialize)]
1030#[serde(rename_all = "camelCase")]
1031pub struct Elbv2RulesResponse {
1032    pub rules: Vec<Elbv2Rule>,
1033}
1034
1035/// Request to bootstrap an IAM admin user in a specific account.
1036/// Used by `/_fakecloud/iam/create-admin` to solve the multi-account
1037/// bootstrap problem: there's no per-account root credential, so this
1038/// endpoint creates a user with full admin access in any account.
1039#[derive(Debug, Clone, Serialize, Deserialize)]
1040#[serde(rename_all = "camelCase")]
1041pub struct CreateAdminRequest {
1042    pub account_id: String,
1043    pub user_name: String,
1044}
1045
1046#[derive(Debug, Clone, Serialize, Deserialize)]
1047#[serde(rename_all = "camelCase")]
1048pub struct CreateAdminResponse {
1049    pub access_key_id: String,
1050    pub secret_access_key: String,
1051    pub account_id: String,
1052    pub arn: String,
1053}