def METHOD_NAME(self, instance, validated_data):
    # use the initial data since we need the ids included to determine which to update & which to create
    rules_data = self.initial_data.pop("rules", [])
    self._update_segment_rules(rules_data, segment=instance)
    # remove rules from validated data to prevent error trying to create segment with nested rules
    del validated_data["rules"]
    return super().METHOD_NAME(instance, validated_data)