diff --git a/crowdin_api/api_resources/translations/resource.py b/crowdin_api/api_resources/translations/resource.py index 020da3c..273bf04 100644 --- a/crowdin_api/api_resources/translations/resource.py +++ b/crowdin_api/api_resources/translations/resource.py @@ -129,6 +129,24 @@ def apply_pre_translation( }, ) + def pre_translation_report( + self, + preTranslationId: str, + projectId: Optional[int] = None, + ): + """ + Pre-Translation Report + + Link to documentation: + https://support.crowdin.com/developer/api/v2/#tag/Translations/operation/api.projects.pre-translations.report.getReport + """ + projectId = projectId or self.get_project_id() + + return self.requester.request( + method="get", + path=f"projects/{projectId}/pre-translations/{preTranslationId}/report", + ) + def edit_pre_translation( self, preTranslationId: str, diff --git a/crowdin_api/api_resources/translations/tests/test_translations_resources.py b/crowdin_api/api_resources/translations/tests/test_translations_resources.py index 2f35cea..5c1db6e 100644 --- a/crowdin_api/api_resources/translations/tests/test_translations_resources.py +++ b/crowdin_api/api_resources/translations/tests/test_translations_resources.py @@ -119,6 +119,17 @@ def test_apply_pre_translation(self, m_request, in_params, request_data, base_ab path="projects/1/pre-translations", ) + @mock.patch("crowdin_api.requester.APIRequester.request") + def test_pre_translation_report(self, m_request, base_absolut_url): + m_request.return_value = "response" + + resource = self.get_resource(base_absolut_url) + assert resource.pre_translation_report(projectId=1, preTranslationId="2") == "response" + m_request.assert_called_once_with( + method="get", + path="projects/1/pre-translations/2/report", + ) + @mock.patch("crowdin_api.requester.APIRequester.request") def test_edit_bundle(self, m_request, base_absolut_url): m_request.return_value = "response"