@@ 1358-1382 (lines=25) @@ | ||
1355 | ||
1356 | return self._send_xml_command(cmd) |
|
1357 | ||
1358 | def clone_report_format( |
|
1359 | self, report_format_id: [Union[str, ReportFormatType]] |
|
1360 | ) -> Any: |
|
1361 | """Clone a report format from an existing one |
|
1362 | ||
1363 | Arguments: |
|
1364 | report_format_id: UUID of the existing report format |
|
1365 | or ReportFormatType (enum) |
|
1366 | ||
1367 | Returns: |
|
1368 | The response. See :py:meth:`send_command` for details. |
|
1369 | """ |
|
1370 | if not report_format_id: |
|
1371 | raise RequiredArgument( |
|
1372 | function=self.clone_report_format.__name__, |
|
1373 | argument='report_format_id', |
|
1374 | ) |
|
1375 | ||
1376 | cmd = XmlCommand("create_report_format") |
|
1377 | ||
1378 | if isinstance(report_format_id, ReportFormatType): |
|
1379 | report_format_id = report_format_id.value |
|
1380 | ||
1381 | cmd.add_element("copy", report_format_id) |
|
1382 | return self._send_xml_command(cmd) |
|
1383 | ||
1384 | def import_report_format(self, report_format: str) -> Any: |
|
1385 | """Import a report format from XML |
@@ 3805-3829 (lines=25) @@ | ||
3802 | ||
3803 | return self._send_xml_command(cmd) |
|
3804 | ||
3805 | def clone_report_format( |
|
3806 | self, report_format_id: [Union[str, ReportFormatType]] |
|
3807 | ) -> Any: |
|
3808 | """Clone a report format from an existing one |
|
3809 | ||
3810 | Arguments: |
|
3811 | report_format_id: UUID of the existing report format |
|
3812 | or ReportFormatType (enum) |
|
3813 | ||
3814 | Returns: |
|
3815 | The response. See :py:meth:`send_command` for details. |
|
3816 | """ |
|
3817 | if not report_format_id: |
|
3818 | raise RequiredArgument( |
|
3819 | function=self.clone_report_format.__name__, |
|
3820 | argument='report_format_id', |
|
3821 | ) |
|
3822 | ||
3823 | cmd = XmlCommand("create_report_format") |
|
3824 | ||
3825 | if isinstance(report_format_id, ReportFormatType): |
|
3826 | report_format_id = report_format_id.value |
|
3827 | ||
3828 | cmd.add_element("copy", report_format_id) |
|
3829 | return self._send_xml_command(cmd) |
|
3830 | ||
3831 | def import_report_format(self, report_format: str) -> Any: |
|
3832 | """Import a report format from XML |