{
    "testCases": [
        {
            "documentation": "For region af-south-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.af-south-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "af-south-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region ap-northeast-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.ap-northeast-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "ap-northeast-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region ap-northeast-2 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.ap-northeast-2.amazonaws.com"
                }
            },
            "params": {
                "Region": "ap-northeast-2",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region ap-northeast-3 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.ap-northeast-3.amazonaws.com"
                }
            },
            "params": {
                "Region": "ap-northeast-3",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region ap-south-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.ap-south-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "ap-south-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region ap-southeast-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.ap-southeast-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "ap-southeast-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region ap-southeast-2 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.ap-southeast-2.amazonaws.com"
                }
            },
            "params": {
                "Region": "ap-southeast-2",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region ca-central-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.ca-central-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "ca-central-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region eu-central-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.eu-central-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "eu-central-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region eu-north-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.eu-north-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "eu-north-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region eu-south-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.eu-south-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "eu-south-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region eu-west-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.eu-west-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "eu-west-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region eu-west-2 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.eu-west-2.amazonaws.com"
                }
            },
            "params": {
                "Region": "eu-west-2",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region eu-west-3 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.eu-west-3.amazonaws.com"
                }
            },
            "params": {
                "Region": "eu-west-3",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region me-south-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.me-south-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "me-south-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region sa-east-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.sa-east-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "sa-east-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-east-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-east-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.us-east-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-east-1",
                "UseFIPS": true,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-east-2 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-east-2.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-east-2",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-west-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-west-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-west-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-west-2 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-west-2.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-west-2",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-west-2 with FIPS enabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.us-west-2.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-west-2",
                "UseFIPS": true,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.us-east-1.api.aws"
                }
            },
            "params": {
                "Region": "us-east-1",
                "UseFIPS": true,
                "UseDualStack": true
            }
        },
        {
            "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-east-1.api.aws"
                }
            },
            "params": {
                "Region": "us-east-1",
                "UseFIPS": false,
                "UseDualStack": true
            }
        },
        {
            "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.cn-north-1.api.amazonwebservices.com.cn"
                }
            },
            "params": {
                "Region": "cn-north-1",
                "UseFIPS": true,
                "UseDualStack": true
            }
        },
        {
            "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.cn-north-1.amazonaws.com.cn"
                }
            },
            "params": {
                "Region": "cn-north-1",
                "UseFIPS": true,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.cn-north-1.api.amazonwebservices.com.cn"
                }
            },
            "params": {
                "Region": "cn-north-1",
                "UseFIPS": false,
                "UseDualStack": true
            }
        },
        {
            "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.cn-north-1.amazonaws.com.cn"
                }
            },
            "params": {
                "Region": "cn-north-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-gov-west-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-gov-west-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.us-gov-west-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-gov-west-1",
                "UseFIPS": true,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.us-gov-east-1.api.aws"
                }
            },
            "params": {
                "Region": "us-gov-east-1",
                "UseFIPS": true,
                "UseDualStack": true
            }
        },
        {
            "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.us-gov-east-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-gov-east-1",
                "UseFIPS": true,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-gov-east-1.api.aws"
                }
            },
            "params": {
                "Region": "us-gov-east-1",
                "UseFIPS": false,
                "UseDualStack": true
            }
        },
        {
            "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-gov-east-1.amazonaws.com"
                }
            },
            "params": {
                "Region": "us-gov-east-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.us-iso-east-1.c2s.ic.gov"
                }
            },
            "params": {
                "Region": "us-iso-east-1",
                "UseFIPS": true,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-iso-east-1.c2s.ic.gov"
                }
            },
            "params": {
                "Region": "us-iso-east-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email-fips.us-isob-east-1.sc2s.sgov.gov"
                }
            },
            "params": {
                "Region": "us-isob-east-1",
                "UseFIPS": true,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://email.us-isob-east-1.sc2s.sgov.gov"
                }
            },
            "params": {
                "Region": "us-isob-east-1",
                "UseFIPS": false,
                "UseDualStack": false
            }
        },
        {
            "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://example.com"
                }
            },
            "params": {
                "Region": "us-east-1",
                "UseFIPS": false,
                "UseDualStack": false,
                "Endpoint": "https://example.com"
            }
        },
        {
            "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled",
            "expect": {
                "endpoint": {
                    "url": "https://example.com"
                }
            },
            "params": {
                "UseFIPS": false,
                "UseDualStack": false,
                "Endpoint": "https://example.com"
            }
        },
        {
            "documentation": "For custom endpoint with fips enabled and dualstack disabled",
            "expect": {
                "error": "Invalid Configuration: FIPS and custom endpoint are not supported"
            },
            "params": {
                "Region": "us-east-1",
                "UseFIPS": true,
                "UseDualStack": false,
                "Endpoint": "https://example.com"
            }
        },
        {
            "documentation": "For custom endpoint with fips disabled and dualstack enabled",
            "expect": {
                "error": "Invalid Configuration: Dualstack and custom endpoint are not supported"
            },
            "params": {
                "Region": "us-east-1",
                "UseFIPS": false,
                "UseDualStack": true,
                "Endpoint": "https://example.com"
            }
        },
        {
            "documentation": "Missing region",
            "expect": {
                "error": "Invalid Configuration: Missing Region"
            }
        },
        {
            "documentation": "Valid EndpointId with dualstack and FIPS disabled. i.e, IPv4 Only stack with no FIPS",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://abc123.456def.endpoints.email.amazonaws.com"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": false,
                "Region": "us-east-1"
            }
        },
        {
            "documentation": "Valid EndpointId with dualstack enabled",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://abc123.456def.endpoints.email.global.api.aws"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": true,
                "UseFIPS": false,
                "Region": "us-west-2"
            }
        },
        {
            "documentation": "Valid EndpointId with FIPS set, dualstack disabled",
            "expect": {
                "error": "Invalid Configuration: FIPS is not supported with multi-region endpoints"
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": true,
                "Region": "ap-northeast-1"
            }
        },
        {
            "documentation": "Valid EndpointId with both dualstack and FIPS enabled",
            "expect": {
                "error": "Invalid Configuration: FIPS is not supported with multi-region endpoints"
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": true,
                "UseFIPS": true,
                "Region": "ap-northeast-2"
            }
        },
        {
            "documentation": "Regular regional request, without EndpointId",
            "expect": {
                "endpoint": {
                    "url": "https://email.eu-west-1.amazonaws.com"
                }
            },
            "params": {
                "UseDualStack": false,
                "Region": "eu-west-1"
            }
        },
        {
            "documentation": "Invalid EndpointId (Invalid chars / format)",
            "expect": {
                "error": "EndpointId must be a valid host label"
            },
            "params": {
                "EndpointId": "badactor.com?foo=bar",
                "UseDualStack": false,
                "Region": "eu-west-2"
            }
        },
        {
            "documentation": "Invalid EndpointId (Empty)",
            "expect": {
                "error": "EndpointId must be a valid host label"
            },
            "params": {
                "EndpointId": "",
                "UseDualStack": false,
                "Region": "ap-south-1"
            }
        },
        {
            "documentation": "Valid EndpointId with custom sdk endpoint",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://example.com"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "Region": "us-east-1",
                "Endpoint": "https://example.com"
            }
        },
        {
            "documentation": "Valid EndpointId with custom sdk endpoint with FIPS enabled",
            "expect": {
                "error": "Invalid Configuration: FIPS is not supported with multi-region endpoints"
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": true,
                "Region": "us-east-1",
                "Endpoint": "https://example.com"
            }
        },
        {
            "documentation": "Gov IPv4 only: us-gov-west-1 primary, dualstack and FIPS disabled",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://abc123.456def.endpoints.email.us-gov.amazonaws.com"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": false,
                "Region": "us-gov-west-1"
            }
        },
        {
            "documentation": "Gov IPv4 only: us-gov-east-1, dualstack and FIPS disabled (proves both gov regions resolve identically)",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://abc123.456def.endpoints.email.us-gov.amazonaws.com"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": false,
                "Region": "us-gov-east-1"
            }
        },
        {
            "documentation": "Gov dualstack: us-gov-west-1, dualstack enabled, FIPS disabled (no global. prefix; api.aws not global.api.aws)",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://abc123.456def.endpoints.email.us-gov.api.aws"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": true,
                "UseFIPS": false,
                "Region": "us-gov-west-1"
            }
        },
        {
            "documentation": "Gov FIPS: us-gov-west-1, FIPS enabled, dualstack disabled — FIPS not supported with multi-region endpoints",
            "expect": {
                "error": "Invalid Configuration: FIPS is not supported with multi-region endpoints"
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": true,
                "Region": "us-gov-west-1"
            }
        },
        {
            "documentation": "Gov FIPS+dualstack: us-gov-west-1, both FIPS and dualstack enabled — FIPS check precedes dualstack branch selection",
            "expect": {
                "error": "Invalid Configuration: FIPS is not supported with multi-region endpoints"
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": true,
                "UseFIPS": true,
                "Region": "us-gov-west-1"
            }
        },
        {
            "documentation": "Gov custom SDK endpoint: us-gov-west-1, EndpointId set, custom Endpoint — passes through unchanged with SigV4a",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://example.com"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": false,
                "Region": "us-gov-west-1",
                "Endpoint": "https://example.com"
            }
        },
        {
            "documentation": "China IPv4 regression: cn-north-1, dualstack disabled — endpoint uses aws-cn dnsSuffix (amazonaws.com.cn)",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://abc123.456def.endpoints.email.amazonaws.com.cn"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": false,
                "Region": "cn-north-1"
            }
        },
        {
            "documentation": "China dualstack regression: cn-north-1, dualstack enabled — uses global. prefix with aws-cn dualStackDnsSuffix (api.amazonwebservices.com.cn)",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://abc123.456def.endpoints.email.global.api.amazonwebservices.com.cn"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": true,
                "UseFIPS": false,
                "Region": "cn-north-1"
            }
        },
        {
            "documentation": "Gov custom SDK endpoint with FIPS: FIPS guard sits above the SDK passthrough, so error wins",
            "expect": {
                "error": "Invalid Configuration: FIPS is not supported with multi-region endpoints"
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": false,
                "UseFIPS": true,
                "Region": "us-gov-west-1",
                "Endpoint": "https://example.com"
            }
        },
        {
            "documentation": "Gov dualstack OSU (us-gov-east-1) matches PDT dualstack output (us-gov.api.aws, no global. prefix)",
            "expect": {
                "endpoint": {
                    "properties": {
                        "authSchemes": [
                            {
                                "signingName": "ses",
                                "name": "sigv4a",
                                "signingRegionSet": [
                                    "*"
                                ]
                            }
                        ]
                    },
                    "url": "https://abc123.456def.endpoints.email.us-gov.api.aws"
                }
            },
            "params": {
                "EndpointId": "abc123.456def",
                "UseDualStack": true,
                "UseFIPS": false,
                "Region": "us-gov-east-1"
            }
        }
    ],
    "version": "1.0"
}