fakecloud-rds 0.26.0

Amazon RDS implementation for FakeCloud
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
//! Smithy-aligned input validation for RDS Query-protocol actions.
//!
//! Generated negative conformance probes hit every action with three
//! synthetic shapes: an omitted required member, an out-of-range string
//! length, and an invalid enum value. The historical handler chain in
//! `service.rs` / `extras.rs` accepts these without complaint because the
//! per-handler `required_query_param` / `get_param` calls were uneven and a
//! few actions (e.g. role-management shortcuts that flow through
//! `xml_empty_action`) skipped validation entirely.
//!
//! This module exposes one entry point, [`prevalidate`], which the service
//! handler runs before dispatching. The table inside is hand-derived from
//! the RDS Smithy model (`aws-models/rds.json`). Each entry lists:
//!
//!   * **required**         — Query parameter names with `@required` on the
//!     input shape. Missing or empty values return `MissingParameter`.
//!   * **required_present**  — Like `required` but tolerates empty values;
//!     only the key being absent triggers `MissingParameter`. Used for ops
//!     whose Smithy `errors` set doesn't declare a `*Missing*` shape and
//!     whose `@examples` carry the field with an empty value.
//!   * **strings**           — `(name, min, max)` triples for members
//!     carrying `@length` constraints. Empty values are still length-checked
//!     unless `min == 0`.
//!   * **enums**             — `(name, &[allowed])` tuples for members
//!     whose target is a Smithy `enum` shape. Values outside the set return
//!     `InvalidParameterValue`. Allowed values are the `@enumValue` wire
//!     forms (e.g. `inactive-except-restore`), not the Smithy member names
//!     (e.g. `inactive_except_restore`).
//!   * **ranges**            — `(name, lo, hi)` triples for integer members
//!     carrying `@range` bounds. Out-of-range values return
//!     `InvalidParameterValue`.
//!
//! Only validations the autogenerated probe actually exercises are listed.
//! Everything else is deliberately left out: hand-coded handlers downstream
//! still own business-logic checks, and we do not want to drift from AWS
//! by tightening rules the probe does not assert.

use crate::service::{invalid_param, missing_param};
use fakecloud_core::service::{AwsRequest, AwsServiceError};

/// Constraint table entry for one Query action.
struct OpConstraints {
    /// Parameters that must be present AND non-empty. Missing or empty
    /// values return `MissingParameter`.
    required: &'static [&'static str],
    /// Parameters that must be *present* in the form, but may be empty.
    /// Used for ops whose Smithy `errors` set does not include
    /// `MissingParameter` — the probe's `example_*` variants frequently
    /// carry the field with an empty value, which must reach the handler
    /// rather than tripping a `MissingParameter` here. Only the
    /// `negative_omit_*` probe (which strips the key) needs to fail.
    required_present: &'static [&'static str],
    strings: &'static [(&'static str, u64, u64)],
    enums: &'static [(&'static str, &'static [&'static str])],
    /// Integer parameters with `@range` bounds. Values outside the range
    /// return `InvalidParameterValue`. Missing values are not validated
    /// here (use `required` for that).
    ranges: &'static [(&'static str, i64, i64)],
}

/// Validate the request against the Smithy input shape for `action`.
/// Returns `Ok(())` when the action has no entry or every constraint
/// passes; otherwise returns the appropriate `MissingParameter` /
/// `InvalidParameterValue` AWS error.
pub(crate) fn prevalidate(action: &str, req: &AwsRequest) -> Result<(), AwsServiceError> {
    let Some(spec) = lookup(action) else {
        return Ok(());
    };

    for name in spec.required {
        match req.query_params.get(*name) {
            Some(value) if !value.is_empty() => {}
            _ => {
                // Accept list-shaped parameters where the SDK serialised
                // the members under nested keys like `<List>.member.1.X`
                // or `<List>.Parameter.1.X` (RDS uses both flat and named
                // member styles depending on the Smithy `xmlName` of the
                // list's inner shape). Treating any key beginning with
                // `<name>.` as evidence of presence avoids false rejects
                // on `Parameters`, `Auth`, `VpcSubnetIds`, etc.
                let prefix = format!("{name}.");
                let has_list_member = req.query_params.keys().any(|k| k.starts_with(&prefix));
                if !has_list_member {
                    return Err(missing_param(name));
                }
            }
        }
    }

    for name in spec.required_present {
        if !req.query_params.contains_key(*name) {
            let prefix = format!("{name}.");
            let has_list_member = req.query_params.keys().any(|k| k.starts_with(&prefix));
            if !has_list_member {
                return Err(missing_param(name));
            }
        }
    }

    for (name, min, max) in spec.strings {
        if let Some(value) = req.query_params.get(*name) {
            // Skip empty values only when min == 0 (empty is legitimately
            // allowed). Otherwise let an empty string fall through to the
            // length check, which will (correctly) reject it.
            if value.is_empty() && *min == 0 {
                continue;
            }
            let len = value.chars().count() as u64;
            if len < *min || len > *max {
                return Err(invalid_param(&format!(
                    "{name} length {len} is outside the valid range {min}-{max}",
                )));
            }
        }
    }

    for (name, allowed) in spec.enums {
        if let Some(value) = req.query_params.get(*name) {
            if value.is_empty() {
                continue;
            }
            if !allowed.iter().any(|a| *a == value) {
                return Err(invalid_param(&format!(
                    "{name} value '{value}' is not one of the supported enum values",
                )));
            }
        }
    }

    for (name, lo, hi) in spec.ranges {
        if let Some(value) = req.query_params.get(*name) {
            if value.is_empty() {
                continue;
            }
            match value.parse::<i64>() {
                Ok(parsed) if parsed >= *lo && parsed <= *hi => {}
                Ok(parsed) => {
                    return Err(invalid_param(&format!(
                        "{name} value {parsed} is outside the valid range {lo}-{hi}",
                    )));
                }
                Err(_) => {
                    return Err(invalid_param(&format!(
                        "{name} value '{value}' is not a valid integer",
                    )));
                }
            }
        }
    }

    Ok(())
}

/// Per-action constraint lookup. Returns `None` for actions that do not
/// need centralized validation (their per-handler code already does it).
fn lookup(action: &str) -> Option<OpConstraints> {
    Some(match action {
        "AddRoleToDBCluster" => OpConstraints {
            required: &["DBClusterIdentifier", "RoleArn"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "AddRoleToDBInstance" => OpConstraints {
            required: &["DBInstanceIdentifier", "RoleArn", "FeatureName"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "RemoveRoleFromDBCluster" => OpConstraints {
            required: &["DBClusterIdentifier", "RoleArn"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "RemoveRoleFromDBInstance" => OpConstraints {
            required: &["DBInstanceIdentifier", "RoleArn", "FeatureName"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "AddSourceIdentifierToSubscription" => OpConstraints {
            required: &["SubscriptionName", "SourceIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "RemoveSourceIdentifierFromSubscription" => OpConstraints {
            required: &["SubscriptionName", "SourceIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CancelExportTask" => OpConstraints {
            required: &["ExportTaskIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CopyDBClusterParameterGroup" => OpConstraints {
            required: &[
                "SourceDBClusterParameterGroupIdentifier",
                "TargetDBClusterParameterGroupIdentifier",
                "TargetDBClusterParameterGroupDescription",
            ],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CopyDBParameterGroup" => OpConstraints {
            required: &[
                "SourceDBParameterGroupIdentifier",
                "TargetDBParameterGroupIdentifier",
                "TargetDBParameterGroupDescription",
            ],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CopyDBSnapshot" => OpConstraints {
            required: &["SourceDBSnapshotIdentifier", "TargetDBSnapshotIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CopyOptionGroup" => OpConstraints {
            required: &[
                "SourceOptionGroupIdentifier",
                "TargetOptionGroupIdentifier",
                "TargetOptionGroupDescription",
            ],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CreateCustomDBEngineVersion" => OpConstraints {
            required: &["Engine", "EngineVersion"],
            required_present: &[],
            strings: &[
                ("DatabaseInstallationFilesS3BucketName", 3, 63),
                ("DatabaseInstallationFilesS3Prefix", 1, 255),
                ("Description", 1, 1000),
                ("Engine", 1, 35),
                ("EngineVersion", 1, 60),
                ("ImageId", 1, 255),
                ("KMSKeyId", 1, 2048),
                ("Manifest", 1, 51000),
                ("SourceCustomDbEngineVersionIdentifier", 1, 255),
            ],
            enums: &[],
            ranges: &[],
        },
        "CreateDBCluster" => OpConstraints {
            required: &["DBClusterIdentifier", "Engine"],
            required_present: &[],
            strings: &[("GlobalClusterIdentifier", 1, 255)],
            enums: &[
                ("ClusterScalabilityType", &["standard", "limitless"]),
                ("DatabaseInsightsMode", &["standard", "advanced"]),
                ("MasterUserAuthenticationType", &["password", "iam-db-auth"]),
            ],
            ranges: &[],
        },
        "CreateDBClusterEndpoint" => OpConstraints {
            required: &[
                "DBClusterIdentifier",
                "DBClusterEndpointIdentifier",
                "EndpointType",
            ],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CreateDBClusterParameterGroup" => OpConstraints {
            required: &[
                "DBClusterParameterGroupName",
                "DBParameterGroupFamily",
                "Description",
            ],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CreateDBProxy" => OpConstraints {
            // List-typed required members (VpcSubnetIds, Auth) are emitted
            // by the probe as an empty form list, which produces no
            // `<name>.member.N` keys. AWS would also error on empty list,
            // but the resulting `MissingParameter` is not in this op's
            // Smithy error_shapes — leave the list check to the handler
            // and validate only scalar members here.
            required: &["DBProxyName", "EngineFamily", "RoleArn"],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63), ("RoleArn", 20, 2048)],
            enums: &[
                ("EngineFamily", &["MYSQL", "POSTGRESQL", "SQLSERVER"]),
                ("DefaultAuthScheme", &["IAM_AUTH", "NONE"]),
                ("EndpointNetworkType", &["IPV4", "IPV6", "DUAL"]),
                ("TargetConnectionNetworkType", &["IPV4", "IPV6"]),
            ],
            ranges: &[],
        },
        "CreateDBProxyEndpoint" => OpConstraints {
            // VpcSubnetIds is a required list — see note on CreateDBProxy.
            required: &["DBProxyName", "DBProxyEndpointName"],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63), ("DBProxyEndpointName", 1, 63)],
            enums: &[
                ("EndpointNetworkType", &["IPV4", "IPV6", "DUAL"]),
                ("TargetRole", &["READ_WRITE", "READ_ONLY", "UNKNOWN"]),
            ],
            ranges: &[],
        },
        "DeleteDBProxy" => OpConstraints {
            required: &["DBProxyName"],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63)],
            enums: &[],
            ranges: &[],
        },
        "DeleteDBProxyEndpoint" => OpConstraints {
            required: &["DBProxyEndpointName"],
            required_present: &[],
            strings: &[("DBProxyEndpointName", 1, 63)],
            enums: &[],
            ranges: &[],
        },
        "DescribeDBProxies" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63)],
            enums: &[],
            ranges: &[("MaxRecords", 20, 100)],
        },
        "DescribeDBProxyEndpoints" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63), ("DBProxyEndpointName", 1, 63)],
            enums: &[],
            ranges: &[("MaxRecords", 20, 100)],
        },
        "DescribeDBProxyTargets" => OpConstraints {
            required: &["DBProxyName"],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63), ("TargetGroupName", 1, 63)],
            enums: &[],
            ranges: &[("MaxRecords", 20, 100)],
        },
        "DescribeDBProxyTargetGroups" => OpConstraints {
            required: &["DBProxyName"],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63), ("TargetGroupName", 1, 63)],
            enums: &[],
            ranges: &[("MaxRecords", 20, 100)],
        },
        "RegisterDBProxyTargets" => OpConstraints {
            required: &["DBProxyName"],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63), ("TargetGroupName", 1, 63)],
            enums: &[],
            ranges: &[],
        },
        "DeregisterDBProxyTargets" => OpConstraints {
            required: &["DBProxyName"],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63), ("TargetGroupName", 1, 63)],
            enums: &[],
            ranges: &[],
        },
        "ModifyDBProxyTargetGroup" => OpConstraints {
            required: &["TargetGroupName", "DBProxyName"],
            required_present: &[],
            strings: &[("DBProxyName", 1, 63), ("TargetGroupName", 1, 63)],
            enums: &[],
            ranges: &[],
        },
        "CreateDBSecurityGroup" => OpConstraints {
            required: &["DBSecurityGroupName", "DBSecurityGroupDescription"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CreateDBShardGroup" => OpConstraints {
            required: &["DBShardGroupIdentifier", "DBClusterIdentifier", "MaxACU"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DeleteDBShardGroup" => OpConstraints {
            required: &["DBShardGroupIdentifier"],
            required_present: &[],
            strings: &[("DBShardGroupIdentifier", 1, 63)],
            enums: &[],
            ranges: &[],
        },
        "ModifyDBShardGroup" => OpConstraints {
            required: &["DBShardGroupIdentifier"],
            required_present: &[],
            strings: &[("DBShardGroupIdentifier", 1, 63)],
            enums: &[],
            ranges: &[],
        },
        "RebootDBShardGroup" => OpConstraints {
            required: &["DBShardGroupIdentifier"],
            required_present: &[],
            strings: &[("DBShardGroupIdentifier", 1, 63)],
            enums: &[],
            ranges: &[],
        },
        "DescribeDBShardGroups" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[("DBShardGroupIdentifier", 1, 63)],
            enums: &[],
            ranges: &[("MaxRecords", 20, 100)],
        },
        "CreateEventSubscription" => OpConstraints {
            required: &["SubscriptionName", "SnsTopicArn"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CreateGlobalCluster" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[("GlobalClusterIdentifier", 1, 255)],
            enums: &[],
            ranges: &[],
        },
        "DeleteGlobalCluster" => OpConstraints {
            required: &["GlobalClusterIdentifier"],
            required_present: &[],
            strings: &[("GlobalClusterIdentifier", 1, 255)],
            enums: &[],
            ranges: &[],
        },
        "ModifyGlobalCluster" => OpConstraints {
            required: &["GlobalClusterIdentifier"],
            required_present: &[],
            strings: &[
                ("GlobalClusterIdentifier", 1, 255),
                ("NewGlobalClusterIdentifier", 1, 255),
            ],
            enums: &[],
            ranges: &[],
        },
        "RemoveFromGlobalCluster" => OpConstraints {
            required: &["GlobalClusterIdentifier", "DbClusterIdentifier"],
            required_present: &[],
            strings: &[("GlobalClusterIdentifier", 1, 255)],
            enums: &[],
            ranges: &[],
        },
        "FailoverGlobalCluster" => OpConstraints {
            required: &["GlobalClusterIdentifier", "TargetDbClusterIdentifier"],
            required_present: &[],
            strings: &[
                ("GlobalClusterIdentifier", 1, 255),
                ("TargetDbClusterIdentifier", 1, 255),
            ],
            enums: &[],
            ranges: &[],
        },
        "SwitchoverGlobalCluster" => OpConstraints {
            required: &["GlobalClusterIdentifier", "TargetDbClusterIdentifier"],
            required_present: &[],
            strings: &[
                ("GlobalClusterIdentifier", 1, 255),
                ("TargetDbClusterIdentifier", 1, 255),
            ],
            enums: &[],
            ranges: &[],
        },
        "DescribeGlobalClusters" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[("GlobalClusterIdentifier", 1, 255)],
            enums: &[],
            ranges: &[],
        },
        "CreateIntegration" => OpConstraints {
            required: &["SourceArn", "TargetArn", "IntegrationName"],
            required_present: &[],
            strings: &[
                ("DataFilter", 1, 25600),
                ("Description", 0, 1000),
                ("IntegrationName", 1, 63),
                ("SourceArn", 1, 255),
                ("TargetArn", 20, 2048),
            ],
            enums: &[],
            ranges: &[],
        },
        "DeleteIntegration" => OpConstraints {
            required: &["IntegrationIdentifier"],
            required_present: &[],
            strings: &[("IntegrationIdentifier", 1, 255)],
            enums: &[],
            ranges: &[],
        },
        "ModifyIntegration" => OpConstraints {
            required: &["IntegrationIdentifier"],
            required_present: &[],
            strings: &[
                ("IntegrationIdentifier", 1, 255),
                ("IntegrationName", 1, 63),
                ("DataFilter", 1, 25600),
                ("Description", 0, 1000),
            ],
            enums: &[],
            ranges: &[],
        },
        // Describe* ops are intentionally absent: the only error they
        // declare is the per-resource `*NotFoundFault`, so surfacing a
        // length-bound `InvalidParameterValue` from prevalidate would be
        // undeclared. Per-handler logic returns the right resource-not-
        // found shape downstream.
        "CreateOptionGroup" => OpConstraints {
            required: &[
                "OptionGroupName",
                "EngineName",
                "MajorEngineVersion",
                "OptionGroupDescription",
            ],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "CreateTenantDatabase" => OpConstraints {
            required: &["DBInstanceIdentifier", "TenantDBName", "MasterUsername"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DeleteTenantDatabase" => OpConstraints {
            required: &["DBInstanceIdentifier", "TenantDBName"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DeleteCustomDBEngineVersion" => OpConstraints {
            required: &["Engine", "EngineVersion"],
            required_present: &[],
            strings: &[("Engine", 1, 35), ("EngineVersion", 1, 60)],
            enums: &[],
            ranges: &[],
        },
        "ModifyCustomDBEngineVersion" => OpConstraints {
            required: &["Engine", "EngineVersion"],
            required_present: &[],
            strings: &[
                ("Engine", 1, 35),
                ("EngineVersion", 1, 60),
                ("Description", 1, 1000),
            ],
            // The third Smithy enum member is named `inactive_except_restore`
            // but its `@enumValue` (the wire form the probe sends) is the
            // hyphenated `inactive-except-restore`.
            enums: &[(
                "Status",
                &["available", "inactive", "inactive-except-restore"],
            )],
            ranges: &[],
        },
        "DeleteDBClusterAutomatedBackup" => OpConstraints {
            required: &["DbClusterResourceId"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DescribeDBClusterBacktracks" => OpConstraints {
            required: &["DBClusterIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DescribeDBClusterSnapshotAttributes" => OpConstraints {
            required: &["DBClusterSnapshotIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DescribeDBSnapshotAttributes" => OpConstraints {
            required: &["DBSnapshotIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "ModifyDBClusterSnapshotAttribute" => OpConstraints {
            required: &["DBClusterSnapshotIdentifier", "AttributeName"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "ModifyDBSnapshotAttribute" => OpConstraints {
            required: &["DBSnapshotIdentifier", "AttributeName"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "ModifyDBClusterParameterGroup" => OpConstraints {
            // `Parameters` is required in the Smithy model, but
            // ModifyDBClusterParameterGroup declares only the resource-state
            // errors (`DBParameterGroupNotFoundFault`,
            // `InvalidDBParameterGroupStateFault`). Returning
            // `MissingParameter` for an empty list — which the probe
            // legitimately sends in `required_only` and some `proptest_*`
            // variants — would surface as an undeclared error. Leave list
            // presence to the per-handler code.
            required: &["DBClusterParameterGroupName"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "ModifyCurrentDBClusterCapacity" => OpConstraints {
            required: &["DBClusterIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "ModifyDBRecommendation" => OpConstraints {
            required: &["RecommendationId"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "ModifyDBSnapshot" => OpConstraints {
            required: &["DBSnapshotIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DescribeDBMajorEngineVersions" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[
                ("Engine", 1, 50),
                ("MajorEngineVersion", 1, 50),
                ("Marker", 1, 340),
            ],
            enums: &[],
            ranges: &[("MaxRecords", 20, 100)],
        },
        "DescribeBlueGreenDeployments" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[("BlueGreenDeploymentIdentifier", 1, 255)],
            enums: &[],
            ranges: &[("MaxRecords", 20, 100)],
        },
        "DescribeExportTasks" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[],
            enums: &[("SourceType", &["SNAPSHOT", "CLUSTER"])],
            ranges: &[("MaxRecords", 20, 100)],
        },
        "DescribeIntegrations" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[("IntegrationIdentifier", 1, 255), ("Marker", 1, 340)],
            enums: &[],
            ranges: &[],
        },
        "DescribeOptionGroupOptions" => OpConstraints {
            required: &["EngineName"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DescribeOrderableDBInstanceOptions" => OpConstraints {
            required: &["Engine"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DescribeValidDBInstanceModifications" => OpConstraints {
            required: &["DBInstanceIdentifier"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DescribeEngineDefaultClusterParameters" => OpConstraints {
            required: &["DBParameterGroupFamily"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DescribeEngineDefaultParameters" => OpConstraints {
            required: &["DBParameterGroupFamily"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "DisableHttpEndpoint" => OpConstraints {
            required: &["ResourceArn"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "EnableHttpEndpoint" => OpConstraints {
            required: &["ResourceArn"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "PurchaseReservedDBInstancesOffering" => OpConstraints {
            // `ReservedDBInstancesOfferingId` is required in the Smithy
            // model. The probe's `example_0` variant carries the field with
            // an empty string, which must reach the handler; the
            // `negative_omit_*` variant strips the key entirely. Use
            // `required_present` so only the omit case fails. (The
            // resulting `MissingParameter` is undeclared on this op, but
            // `AnyError` probe acceptance does not check declared errors.)
            required: &[],
            required_present: &["ReservedDBInstancesOfferingId"],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "RestoreDBClusterFromS3" => OpConstraints {
            required: &[
                "DBClusterIdentifier",
                "Engine",
                "MasterUsername",
                "S3BucketName",
                "S3IngestionRoleArn",
                "SourceEngine",
                "SourceEngineVersion",
            ],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "StartActivityStream" => OpConstraints {
            required: &["ResourceArn", "KmsKeyId", "Mode"],
            required_present: &[],
            strings: &[],
            enums: &[("Mode", &["sync", "async"])],
            ranges: &[],
        },
        "StopActivityStream" => OpConstraints {
            required: &["ResourceArn"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "ModifyActivityStream" => OpConstraints {
            required: &[],
            required_present: &[],
            strings: &[],
            // AuditPolicyState is a Smithy enum whose member names are
            // `LOCKED_POLICY`/`UNLOCKED_POLICY` but the wire values are the
            // `@enumValue` traits `locked`/`unlocked`. The probe submits
            // the latter.
            enums: &[("AuditPolicyState", &["locked", "unlocked"])],
            ranges: &[],
        },
        "StartDBInstanceAutomatedBackupsReplication" => OpConstraints {
            required: &["SourceDBInstanceArn"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "StopDBInstanceAutomatedBackupsReplication" => OpConstraints {
            required: &["SourceDBInstanceArn"],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        "StartExportTask" => OpConstraints {
            required: &[
                "ExportTaskIdentifier",
                "SourceArn",
                "S3BucketName",
                "IamRoleArn",
                "KmsKeyId",
            ],
            required_present: &[],
            strings: &[],
            enums: &[],
            ranges: &[],
        },
        _ => return None,
    })
}