def _get_all_feature_states_for_user_response(  # type: ignore[no-untyped-def]
        self,
        identity: Identity,
        headers: dict[str, typing.Any],
    ):
        """
        Get all feature states for an identity

        :param identity: Identity model to return feature states for
        :return: Response containing lists of both serialized flags and traits
        """
        all_feature_states = identity.get_all_feature_states(
            additional_filters=self._get_additional_filters(),
        )
        serializer_class = self.get_serializer_class()
        serializer = serializer_class(
            {
                "flags": all_feature_states,
                "identifier": identity.identifier,
                "traits": identity.identity_traits.all() if identity.id else [],
            },
            context=self.get_serializer_context(),  # type: ignore[no-untyped-call]
        )

        identify_integrations(identity, all_feature_states)  # type: ignore[no-untyped-call]

        return Response(
            data=serializer.data, status=status.HTTP_200_OK, headers=headers
        )

        Get all feature states for an identity

        :param identity: Identity model to return feature states for
        :return: Response containing lists of both serialized flags and traits
        
api/environments/identities/views.py