def METHOD_NAME(self, validated_data):
    project = validated_data["project"]
    self.validate_project_segment_limit(project)
    rules_data = validated_data.pop("rules", [])
    # create segment with nested rules and conditions
    segment = Segment.objects.METHOD_NAME(**validated_data)
    self._update_or_create_segment_rules(
        rules_data, segment=segment, is_create=True
    )
    return segment