{
  "version": "1.0",
  "serviceId": "example",
  "parameters": {
    "Region": {
      "type": "string",
      "builtIn": "AWS::Region",
      "documentation": "The region to dispatch the request to"
    }
  },
  "rules": [
    {
      "documentation": "rules for when region isSet",
      "type": "tree",
      "conditions": [
        {"fn": "isSet", "argv": [{"ref": "Region"}]}
      ],
      "rules": [
        {
          "type": "endpoint",
          "conditions": [
            {"fn": "aws.partition", "argv": [{"ref": "Region"}], "assign": "partitionResult"}
          ],
          "endpoint": {"url": "https://example.{Region}.{partitionResult#dnsSuffix}"}
        },
        {
          "type": "error",
          "documentation": "invalid region value",
          "conditions": [],
          "error": "unable to determine endpoint for region: {Region}"
        }
      ]
    },
    {
      "type": "endpoint",
      "documentation": "the single service global endpoint",
      "conditions": [],
      "endpoint": {"url": "https://example.amazonaws.com"}
    }
  ]
}