Code Duplication    Length = 41-42 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 2 locations

@@ 3668-3709 (lines=42) @@
3665
3666
        return self._send_xml_command(cmd)
3667
3668
    def get_reports(
3669
        self,
3670
        *,
3671
        filter: Optional[str] = None,
3672
        filter_id: Optional[str] = None,
3673
        note_details: Optional[bool] = None,
3674
        override_details: Optional[bool] = None,
3675
        details: Optional[bool] = None
3676
    ) -> Any:
3677
        """Request a list of reports
3678
3679
        Arguments:
3680
            filter: Filter term to use for the query
3681
            filter_id: UUID of an existing filter to use for the query
3682
            note_details: If notes are included, whether to include note details
3683
            override_details: If overrides are included, whether to include
3684
                override details
3685
            details: Whether to exclude results
3686
3687
        Returns:
3688
            The response. See :py:meth:`send_command` for details.
3689
        """
3690
        cmd = XmlCommand("get_reports")
3691
3692
        if filter:
3693
            cmd.set_attribute("report_filter", filter)
3694
3695
        if filter_id:
3696
            cmd.set_attribute("report_filt_id", filter_id)
3697
3698
        if note_details is not None:
3699
            cmd.set_attribute("note_details", _to_bool(note_details))
3700
3701
        if override_details is not None:
3702
            cmd.set_attribute("override_details", _to_bool(override_details))
3703
3704
        if details is not None:
3705
            cmd.set_attribute("details", _to_bool(details))
3706
3707
        cmd.set_attribute("ignore_pagination", "1")
3708
3709
        return self._send_xml_command(cmd)
3710
3711
    def get_report(
3712
        self,
@@ 3826-3866 (lines=41) @@
3823
        cmd.set_attribute("details", "1")
3824
        return self._send_xml_command(cmd)
3825
3826
    def get_results(
3827
        self,
3828
        *,
3829
        filter: Optional[str] = None,
3830
        filter_id: Optional[str] = None,
3831
        task_id: Optional[str] = None,
3832
        note_details: Optional[bool] = None,
3833
        override_details: Optional[bool] = None,
3834
        details: Optional[bool] = None
3835
    ) -> Any:
3836
        """Request a list of results
3837
3838
        Arguments:
3839
            filter: Filter term to use for the query
3840
            filter_id: UUID of an existing filter to use for the query
3841
            task_id: UUID of task for note and override handling
3842
            note_details: If notes are included, whether to include note details
3843
            override_details: If overrides are included, whether to include
3844
                override details
3845
            details: Whether to include additional details of the results
3846
3847
        Returns:
3848
            The response. See :py:meth:`send_command` for details.
3849
        """
3850
        cmd = XmlCommand("get_results")
3851
3852
        _add_filter(cmd, filter, filter_id)
3853
3854
        if task_id:
3855
            cmd.set_attribute("task_id", task_id)
3856
3857
        if details is not None:
3858
            cmd.set_attribute("details", _to_bool(details))
3859
3860
        if note_details is not None:
3861
            cmd.set_attribute("note_details", _to_bool(note_details))
3862
3863
        if override_details is not None:
3864
            cmd.set_attribute("override_details", _to_bool(override_details))
3865
3866
        return self._send_xml_command(cmd)
3867
3868
    def get_result(self, result_id: str) -> Any:
3869
        """Request a single result