def METHOD_NAME(self, value):
    if self.instance and self.instance.api_enrollment_enabled() and not value:
        raise serializers.ValidationError("Cannot disable API enrollment")
    return value