def METHOD_NAME(self, obj: Dict[str, Any]) -> Dict[str, Any]:
    if isinstance(obj, str):
        if obj.endswith(".amazonaws.com"):
            return {"Service": obj}
        if obj.endswith(":root"):
            return {"AWS": obj}
    return obj