From b64fee9116e4f2f3ede7d081a568abb843d5b72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Chr=C3=A1stek?= Date: Tue, 29 Apr 2025 11:41:01 +0200 Subject: [PATCH] Fix: Remove unused `Response` model The `Response` model was removed as it was no longer being used in the `download_workflow_changes` method of the `WorkflowChangesApi`. This change simplifies the codebase and removes an unnecessary dependency. --- .openapi-generator/FILES | 1 - docs/Response.md | 29 -------- phrasetms_client/__init__.py | 1 - phrasetms_client/api/workflow_changes_api.py | 30 ++++---- phrasetms_client/models/__init__.py | 1 - phrasetms_client/models/response.py | 74 -------------------- test/test_response.py | 58 --------------- 7 files changed, 12 insertions(+), 182 deletions(-) delete mode 100644 docs/Response.md delete mode 100644 phrasetms_client/models/response.py delete mode 100644 test/test_response.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 4cdde6db..f7406f72 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -560,7 +560,6 @@ docs/RepeatedWordsWarningDto.md docs/RepeatedWordsWarningDtoAllOf.md docs/RepetitionsSettingsDto.md docs/ReplayRequestDto.md -docs/Response.md docs/ResxSettingsDto.md docs/SCIMApi.md docs/SEGMENTTARGET.md diff --git a/docs/Response.md b/docs/Response.md deleted file mode 100644 index abacb338..00000000 --- a/docs/Response.md +++ /dev/null @@ -1,29 +0,0 @@ -# Response - -## Properties - -| Name | Type | Description | Notes | -| ------------- | --------------------- | ----------- | ---------- | -| **context** | **Dict[str, object]** | | [optional] | -| **done** | **bool** | | [optional] | -| **cancelled** | **bool** | | [optional] | - -## Example - -```python -from phrasetms_client.models.response import Response - -# TODO update the JSON string below -json = "{}" -# create an instance of Response from a JSON string -response_instance = Response.from_json(json) -# print the JSON string representation of the object -print Response.to_json() - -# convert the object into a dict -response_dict = response_instance.to_dict() -# create an instance of Response from a dict -response_from_dict = Response.from_dict(response_dict) -``` - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/phrasetms_client/__init__.py b/phrasetms_client/__init__.py index 920bf5a2..462d998d 100644 --- a/phrasetms_client/__init__.py +++ b/phrasetms_client/__init__.py @@ -899,7 +899,6 @@ ) from phrasetms_client.models.repetitions_settings_dto import RepetitionsSettingsDto from phrasetms_client.models.replay_request_dto import ReplayRequestDto -from phrasetms_client.models.response import Response from phrasetms_client.models.resx_settings_dto import ResxSettingsDto from phrasetms_client.models.segmenttarget import SEGMENTTARGET from phrasetms_client.models.segmenttarget_all_of import SEGMENTTARGETAllOf diff --git a/phrasetms_client/api/workflow_changes_api.py b/phrasetms_client/api/workflow_changes_api.py index 17531855..35744c45 100644 --- a/phrasetms_client/api/workflow_changes_api.py +++ b/phrasetms_client/api/workflow_changes_api.py @@ -21,7 +21,6 @@ from typing import Optional -from phrasetms_client.models.response import Response from phrasetms_client.models.workflow_changes_dto import WorkflowChangesDto from phrasetms_client.api_client import ApiClient @@ -45,7 +44,7 @@ def __init__(self, api_client=None): self.api_client = api_client @validate_arguments - def download_workflow_changes(self, body : Optional[WorkflowChangesDto] = None, **kwargs) -> Response: # noqa: E501 + def download_workflow_changes(self, body : Optional[WorkflowChangesDto] = None, **kwargs) -> None: # noqa: E501 """Download workflow changes report # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -65,7 +64,7 @@ def download_workflow_changes(self, body : Optional[WorkflowChangesDto] = None, :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: Response + :rtype: None """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: @@ -106,7 +105,7 @@ def download_workflow_changes_with_http_info(self, body : Optional[WorkflowChang :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(Response, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ _params = locals() @@ -157,23 +156,18 @@ def download_workflow_changes_with_http_info(self, body : Optional[WorkflowChang _header_params['Accept'] = self.api_client.select_header_accept( ['text/html']) # noqa: E501 + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + # authentication setting _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "Response", - '400': None, - '401': None, - '403': None, - '404': None, - '405': None, - '408': None, - '410': None, - '415': None, - '429': None, - '500': None, - '501': None, - } + _response_types_map = {} return self.api_client.call_api( '/api2/v2/jobs/workflowChanges', 'POST', diff --git a/phrasetms_client/models/__init__.py b/phrasetms_client/models/__init__.py index 970aa387..3932ed62 100644 --- a/phrasetms_client/models/__init__.py +++ b/phrasetms_client/models/__init__.py @@ -541,7 +541,6 @@ from phrasetms_client.models.repeated_words_warning_dto_all_of import RepeatedWordsWarningDtoAllOf from phrasetms_client.models.repetitions_settings_dto import RepetitionsSettingsDto from phrasetms_client.models.replay_request_dto import ReplayRequestDto -from phrasetms_client.models.response import Response from phrasetms_client.models.resx_settings_dto import ResxSettingsDto from phrasetms_client.models.segmenttarget import SEGMENTTARGET from phrasetms_client.models.segmenttarget_all_of import SEGMENTTARGETAllOf diff --git a/phrasetms_client/models/response.py b/phrasetms_client/models/response.py deleted file mode 100644 index aa881c89..00000000 --- a/phrasetms_client/models/response.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - Phrase TMS API - - Welcome to Phrase's TMS API documentation. Please visit our [help center](https://support.phrase.com/hc/en-us/sections/5709662083612) for more information about the APIs. If you have any questions, please contact [Support](https://support.phrase.com/hc/requests/new). Please, include the `User-Agent` header with the name of your application or project. It might be a good idea to include some sort of contact information as well, so that we can get in touch if necessary. Examples of excellent `User-Agent` headers: > User-Agent: Example mobile app (example@phrase.com)
User-Agent: ACME Inc Java 1.8 Client (http://acmeinc.com/contact) # noqa: E501 - - The version of the OpenAPI document: Latest - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, Dict, Optional -from pydantic import BaseModel, StrictBool - -class Response(BaseModel): - """ - Response - """ - context: Optional[Dict[str, Dict[str, Any]]] = None - done: Optional[StrictBool] = None - cancelled: Optional[StrictBool] = None - __properties = ["context", "done", "cancelled"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Response: - """Create an instance of Response from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> Response: - """Create an instance of Response from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return Response.parse_obj(obj) - - _obj = Response.parse_obj({ - "context": obj.get("context"), - "done": obj.get("done"), - "cancelled": obj.get("cancelled") - }) - return _obj - diff --git a/test/test_response.py b/test/test_response.py deleted file mode 100644 index 49de9b5d..00000000 --- a/test/test_response.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Phrase TMS API - - Welcome to Phrase's TMS API documentation. Please visit our [help center](https://support.phrase.com/hc/en-us/sections/5709662083612) for more information about the APIs. If you have any questions, please contact [Support](https://support.phrase.com/hc/requests/new). Please, include the `User-Agent` header with the name of your application or project. It might be a good idea to include some sort of contact information as well, so that we can get in touch if necessary. Examples of excellent `User-Agent` headers: > User-Agent: Example mobile app (example@phrase.com)
User-Agent: ACME Inc Java 1.8 Client (http://acmeinc.com/contact) # noqa: E501 - - The version of the OpenAPI document: Latest - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -import unittest -import datetime - -import phrasetms_client -from phrasetms_client.models.response import Response # noqa: E501 -from phrasetms_client.rest import ApiException - -class TestResponse(unittest.TestCase): - """Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Response` - """ - model = phrasetms_client.models.response.Response() # noqa: E501 - if include_optional : - return Response( - context = { - 'key' : None - }, - done = True, - cancelled = True - ) - else : - return Response( - ) - """ - - def testResponse(self): - """Test Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main()