diff --git a/pyproject.toml b/pyproject.toml index 6e0c46b..5f14652 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,10 +45,11 @@ dev = [ "pytest-asyncio>=0.21.1", "pytest-cov>=4.1.0", "ruff>=0.9.7", - "polyfactory>=2.8.2", + "polyfactory>=2.19.0", "gevent>=23.9.1", "pre-commit>=3.4.0", "python-dotenv>=1.0.0", + "vcrpy>=7.0.0", ] [build-system] diff --git a/tests/conftest.py b/tests/conftest.py index e69de29..c29c486 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -0,0 +1,16 @@ +import os + +import pytest +from dotenv import load_dotenv + +from ya_tracker_client import YaTrackerClient + + +@pytest.fixture +def client() -> YaTrackerClient: + load_dotenv() + return YaTrackerClient( + organisation_id=os.getenv('API_ORGANISATION_ID', default=''), + oauth_token=os.getenv('API_TOKEN', default='random_token'), + api_host=os.getenv('API_HOST', default='https://api.tracker.yandex.net'), + ) diff --git a/tests/integration/test_component.py b/tests/integration/test_component.py new file mode 100644 index 0000000..d077e41 --- /dev/null +++ b/tests/integration/test_component.py @@ -0,0 +1,74 @@ +import vcr + +from ya_tracker_client.domain.entities.component import Component +from ya_tracker_client.domain.entities.queue import QueueShort +from ya_tracker_client.domain.entities.user import UserShort + + +class TestGetComponents: + @vcr.use_cassette( + 'tests/integration/vcr_cassettes/get_standard_components.yaml', + filter_headers=['Authorization', 'X-Cloud-Org-Id'], + match_on=['uri', 'method'], + ) + async def test_get_components__when_standard_components_exists__then_return_them(self, client) -> None: + # when + components = await client.get_components() + # then + assert components == [ + Component( + url='https://api.tracker.yandex.net/v2/components/1', + id=1, version=1, name='Фронтенд', + queue=QueueShort( + url='https://api.tracker.yandex.net/v2/queues/DANFIMOV', + id='1', + key='DANFIMOV', + display='Персональная очередь', + ), + description=None, + lead=None, + assign_auto=False, + ), + Component( + url='https://api.tracker.yandex.net/v2/components/2', + id=2, version=1, name='Бекенд', + queue=QueueShort( + url='https://api.tracker.yandex.net/v2/queues/DANFIMOV', + id='1', + key='DANFIMOV', + display='Персональная очередь', + ), + description=None, + lead=None, + assign_auto=False, + ), + ] + + @vcr.use_cassette( + 'tests/integration/vcr_cassettes/get_custom_component.yaml', + filter_headers=['Authorization', 'X-Cloud-Org-Id'], + match_on=['uri', 'method'], + ) + async def test_get_components__when_custom_component_exists__then_return_it(self, client) -> None: + # when + components = await client.get_components() + # then + assert Component( + url='https://api.tracker.yandex.net/v2/components/4', + id=4, + version=2, + name='Custom', + queue=QueueShort( + url='https://api.tracker.yandex.net/v2/queues/DANFIMOV', + id='1', + key='DANFIMOV', + display='Персональная очередь', + ), + description='Описание', + lead=UserShort( + url='https://api.tracker.yandex.net/v2/users/8000000000000004', + id='8000000000000004', + display='Dmitry Anfimov', + ), + assign_auto=True, + ) == components[2] diff --git a/tests/integration/test_issue.py b/tests/integration/test_issue.py new file mode 100644 index 0000000..d2de269 --- /dev/null +++ b/tests/integration/test_issue.py @@ -0,0 +1,79 @@ +from datetime import datetime +from zoneinfo import ZoneInfo + +import pytest +import vcr + +from ya_tracker_client.domain.client.errors import ClientObjectNotFoundError +from ya_tracker_client.domain.entities.issue import Issue +from ya_tracker_client.domain.entities.issue_status import IssueStatus +from ya_tracker_client.domain.entities.issue_type import IssueType +from ya_tracker_client.domain.entities.priority import Priority +from ya_tracker_client.domain.entities.queue import QueueShort +from ya_tracker_client.domain.entities.user import UserShort + + +class TestGetIssue: + @vcr.use_cassette( + 'tests/integration/vcr_cassettes/get_issue_ok.yaml', + filter_headers=['Authorization', 'X-Cloud-Org-Id'], + match_on=['uri', 'method'], + ) + async def test_get_issue__when_issue_found__then_return_it(self, client) -> None: + # when + issue = await client.get_issue('TEST-1') + # then + assert issue == Issue( + url='https://api.tracker.yandex.net/v2/issues/TEST-1', + id='678b278f6eaab8681c533f79', + key='TEST-1', + version=1, + summary='Test', + favorite=False, + votes=0, + type=IssueType( + url='https://api.tracker.yandex.net/v2/issuetypes/2', + id='2', + key='task', + display='Задача', + ), + priority=Priority( + url='https://api.tracker.yandex.net/v2/priorities/3', + id=3, + key='normal', + display='Средний', + ), + queue=QueueShort( + url='https://api.tracker.yandex.net/v2/queues/TEST', + id='2', + key='TEST', + display='Test', + ), + created_at=datetime(2025, 1, 18, 4, 1, 19, 687000, tzinfo=ZoneInfo('UTC')), + created_by=UserShort( + url='https://api.tracker.yandex.net/v2/users/8000000000000004', + id='8000000000000004', + display='Dmitry Anfimov', + ), + updated_by=UserShort( + url='https://api.tracker.yandex.net/v2/users/8000000000000004', + id='8000000000000004', + display='Dmitry Anfimov', + ), + updated_at=datetime(2025, 1, 18, 4, 1, 19, 687000, tzinfo=ZoneInfo('UTC')), + status=IssueStatus( + url='https://api.tracker.yandex.net/v2/statuses/1', + id='1', + key='open', + display='Открыт', + ), + ) + + @vcr.use_cassette( + 'tests/integration/vcr_cassettes/get_issue_not_found.yaml', + filter_headers=['Authorization', 'X-Cloud-Org-Id'], + match_on=['uri', 'method'], + ) + async def test_get_issue__when_issue_not_found__then_return_error(self, client) -> None: + with pytest.raises(ClientObjectNotFoundError): + await client.get_issue('TEST-100') diff --git a/tests/integration/vcr_cassettes/get_custom_component.yaml b/tests/integration/vcr_cassettes/get_custom_component.yaml new file mode 100644 index 0000000..3c85245 --- /dev/null +++ b/tests/integration/vcr_cassettes/get_custom_component.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: 'null' + headers: {} + method: GET + uri: https://api.tracker.yandex.net/v2/components + response: + body: + string: "[{\"self\":\"https://api.tracker.yandex.net/v2/components/1\",\"id\":1,\"version\":1,\"name\":\"\u0424\u0440\u043E\u043D\u0442\u0435\u043D\u0434\",\"queue\":{\"self\":\"https://api.tracker.yandex.net/v2/queues/DANFIMOV\",\"id\":\"1\",\"key\":\"DANFIMOV\",\"display\":\"\u041F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u0430\u044F + \u043E\u0447\u0435\u0440\u0435\u0434\u044C\"},\"assignAuto\":false},{\"self\":\"https://api.tracker.yandex.net/v2/components/2\",\"id\":2,\"version\":1,\"name\":\"\u0411\u0435\u043A\u0435\u043D\u0434\",\"queue\":{\"self\":\"https://api.tracker.yandex.net/v2/queues/DANFIMOV\",\"id\":\"1\",\"key\":\"DANFIMOV\",\"display\":\"\u041F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u0430\u044F + \u043E\u0447\u0435\u0440\u0435\u0434\u044C\"},\"assignAuto\":false},{\"self\":\"https://api.tracker.yandex.net/v2/components/4\",\"id\":4,\"version\":2,\"name\":\"Custom\",\"queue\":{\"self\":\"https://api.tracker.yandex.net/v2/queues/DANFIMOV\",\"id\":\"1\",\"key\":\"DANFIMOV\",\"display\":\"\u041F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u0430\u044F + \u043E\u0447\u0435\u0440\u0435\u0434\u044C\"},\"description\":\"\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\",\"lead\":{\"self\":\"https://api.tracker.yandex.net/v2/users/8000000000000004\",\"id\":\"8000000000000004\",\"display\":\"Dmitry + Anfimov\",\"cloudUid\":\"ajeasjpl5sfocusdpv14\",\"passportUid\":747064831},\"assignAuto\":true}]" + headers: + X-Total-Count: + - '3' + X-Total-Pages: + - '1' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/integration/vcr_cassettes/get_issue_not_found.yaml b/tests/integration/vcr_cassettes/get_issue_not_found.yaml new file mode 100644 index 0000000..fd4592a --- /dev/null +++ b/tests/integration/vcr_cassettes/get_issue_not_found.yaml @@ -0,0 +1,27 @@ +interactions: +- request: + body: 'null' + headers: {} + method: GET + uri: https://api.tracker.yandex.net/v2/issues/TEST-100?expand= + response: + body: + string: "{\"errors\":{},\"errorsData\":{},\"errorMessages\":[\"\u0417\u0430\u0434\u0430\u0447\u0430 + \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.\"],\"statusCode\":404}" + headers: + Content-Language: + - ru + Content-Type: + - application/json;charset=utf-8 + Date: + - Tue, 25 Feb 2025 17:13:26 GMT + Set-Cookie: + - uid=qcgAAGe9+jYPmQDaBjFrAg==; path=/ + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding, Accept-Language, Accept + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/integration/vcr_cassettes/get_issue_ok.yaml b/tests/integration/vcr_cassettes/get_issue_ok.yaml new file mode 100644 index 0000000..f9ae2cc --- /dev/null +++ b/tests/integration/vcr_cassettes/get_issue_ok.yaml @@ -0,0 +1,32 @@ +interactions: +- request: + body: 'null' + headers: {} + method: GET + uri: https://api.tracker.yandex.net/v2/issues/TEST-1?expand= + response: + body: + string: "{\"self\":\"https://api.tracker.yandex.net/v2/issues/TEST-1\",\"id\":\"678b278f6eaab8681c533f79\",\"key\":\"TEST-1\",\"version\":1,\"summary\":\"Test\",\"statusStartTime\":\"2025-01-18T04:01:19.738+0000\",\"updatedBy\":{\"self\":\"https://api.tracker.yandex.net/v2/users/8000000000000004\",\"id\":\"8000000000000004\",\"display\":\"Dmitry + Anfimov\",\"cloudUid\":\"ajeasjpl5sfocusdpv14\",\"passportUid\":747064831},\"statusType\":{\"id\":\"new\",\"display\":\"\u041D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0439\",\"key\":\"new\"},\"type\":{\"self\":\"https://api.tracker.yandex.net/v2/issuetypes/2\",\"id\":\"2\",\"key\":\"task\",\"display\":\"\u0417\u0430\u0434\u0430\u0447\u0430\"},\"priority\":{\"self\":\"https://api.tracker.yandex.net/v2/priorities/3\",\"id\":\"3\",\"key\":\"normal\",\"display\":\"\u0421\u0440\u0435\u0434\u043D\u0438\u0439\"},\"createdAt\":\"2025-01-18T04:01:19.687+0000\",\"createdBy\":{\"self\":\"https://api.tracker.yandex.net/v2/users/8000000000000004\",\"id\":\"8000000000000004\",\"display\":\"Dmitry + Anfimov\",\"cloudUid\":\"ajeasjpl5sfocusdpv14\",\"passportUid\":747064831},\"commentWithoutExternalMessageCount\":0,\"votes\":0,\"commentWithExternalMessageCount\":0,\"queue\":{\"self\":\"https://api.tracker.yandex.net/v2/queues/TEST\",\"id\":\"2\",\"key\":\"TEST\",\"display\":\"Test\"},\"updatedAt\":\"2025-01-18T04:01:19.687+0000\",\"status\":{\"self\":\"https://api.tracker.yandex.net/v2/statuses/1\",\"id\":\"1\",\"key\":\"open\",\"display\":\"\u041E\u0442\u043A\u0440\u044B\u0442\"},\"favorite\":false}" + headers: + Content-Language: + - ru + Content-Type: + - application/json;charset=utf-8 + Date: + - Tue, 25 Feb 2025 16:50:30 GMT + Etag: + - '"1"' + Last-Modified: + - Sat, 18 Jan 2025 04:01:19 +0000 + Set-Cookie: + - uid=qcgAAGe99NYPmQDaBiaOAg==; path=/ + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding, Accept-Language, Accept + status: + code: 200 + message: OK +version: 1 diff --git a/tests/integration/vcr_cassettes/get_standard_components.yaml b/tests/integration/vcr_cassettes/get_standard_components.yaml new file mode 100644 index 0000000..6c0ccf2 --- /dev/null +++ b/tests/integration/vcr_cassettes/get_standard_components.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: 'null' + headers: {} + method: GET + uri: https://api.tracker.yandex.net/v2/components + response: + body: + string: "[{\"self\":\"https://api.tracker.yandex.net/v2/components/1\",\"id\":1,\"version\":1,\"name\":\"\u0424\u0440\u043E\u043D\u0442\u0435\u043D\u0434\",\"queue\":{\"self\":\"https://api.tracker.yandex.net/v2/queues/DANFIMOV\",\"id\":\"1\",\"key\":\"DANFIMOV\",\"display\":\"\u041F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u0430\u044F + \u043E\u0447\u0435\u0440\u0435\u0434\u044C\"},\"assignAuto\":false},{\"self\":\"https://api.tracker.yandex.net/v2/components/2\",\"id\":2,\"version\":1,\"name\":\"\u0411\u0435\u043A\u0435\u043D\u0434\",\"queue\":{\"self\":\"https://api.tracker.yandex.net/v2/queues/DANFIMOV\",\"id\":\"1\",\"key\":\"DANFIMOV\",\"display\":\"\u041F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u0430\u044F + \u043E\u0447\u0435\u0440\u0435\u0434\u044C\"},\"assignAuto\":false}]" + headers: + X-Total-Count: + - '2' + X-Total-Pages: + - '1' + status: + code: 200 + message: OK +version: 1 diff --git a/uv.lock b/uv.lock index 618d100..bb1a877 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,9 @@ version = 1 requires-python = ">=3.10, <=3.13" +resolution-markers = [ + "platform_python_implementation != 'PyPy'", + "platform_python_implementation == 'PyPy'", +] [[package]] name = "aiohappyeyeballs" @@ -145,7 +149,7 @@ name = "cffi" version = "1.17.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "pycparser" }, + { name = "pycparser", marker = "platform_python_implementation != 'PyPy'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824", size = 516621 } wheels = [ @@ -963,7 +967,8 @@ dependencies = [ { name = "certifi" }, { name = "charset-normalizer" }, { name = "idna" }, - { name = "urllib3" }, + { name = "urllib3", version = "1.26.20", source = { registry = "https://pypi.org/simple" }, marker = "platform_python_implementation == 'PyPy'" }, + { name = "urllib3", version = "2.3.0", source = { registry = "https://pypi.org/simple" }, marker = "platform_python_implementation != 'PyPy'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", size = 131218 } wheels = [ @@ -1061,15 +1066,46 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0f/dd/84f10e23edd882c6f968c21c2434fe67bd4a528967067515feca9e611e5e/tzdata-2025.1-py2.py3-none-any.whl", hash = "sha256:7e127113816800496f027041c570f50bcd464a020098a3b6b199517772303639", size = 346762 }, ] +[[package]] +name = "urllib3" +version = "1.26.20" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "platform_python_implementation == 'PyPy'", +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/e8/6ff5e6bc22095cfc59b6ea711b687e2b7ed4bdb373f7eeec370a97d7392f/urllib3-1.26.20.tar.gz", hash = "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32", size = 307380 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/33/cf/8435d5a7159e2a9c83a95896ed596f68cf798005fe107cc655b5c5c14704/urllib3-1.26.20-py2.py3-none-any.whl", hash = "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e", size = 144225 }, +] + [[package]] name = "urllib3" version = "2.3.0" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "platform_python_implementation != 'PyPy'", +] sdist = { url = "https://files.pythonhosted.org/packages/aa/63/e53da845320b757bf29ef6a9062f5c669fe997973f966045cb019c3f4b66/urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d", size = 307268 } wheels = [ { url = "https://files.pythonhosted.org/packages/c8/19/4ec628951a74043532ca2cf5d97b7b14863931476d117c471e8e2b1eb39f/urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df", size = 128369 }, ] +[[package]] +name = "vcrpy" +version = "7.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, + { name = "urllib3", version = "1.26.20", source = { registry = "https://pypi.org/simple" }, marker = "platform_python_implementation == 'PyPy'" }, + { name = "urllib3", version = "2.3.0", source = { registry = "https://pypi.org/simple" }, marker = "platform_python_implementation != 'PyPy'" }, + { name = "wrapt" }, + { name = "yarl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/25/d3/856e06184d4572aada1dd559ddec3bedc46df1f2edc5ab2c91121a2cccdb/vcrpy-7.0.0.tar.gz", hash = "sha256:176391ad0425edde1680c5b20738ea3dc7fb942520a48d2993448050986b3a50", size = 85502 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/13/5d/1f15b252890c968d42b348d1e9b0aa12d5bf3e776704178ec37cceccdb63/vcrpy-7.0.0-py2.py3-none-any.whl", hash = "sha256:55791e26c18daa363435054d8b35bd41a4ac441b6676167635d1b37a71dbe124", size = 42321 }, +] + [[package]] name = "virtualenv" version = "20.29.2" @@ -1084,6 +1120,70 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/93/fa/849483d56773ae29740ae70043ad88e068f98a6401aa819b5d6bee604683/virtualenv-20.29.2-py3-none-any.whl", hash = "sha256:febddfc3d1ea571bdb1dc0f98d7b45d24def7428214d4fb73cc486c9568cce6a", size = 4301478 }, ] +[[package]] +name = "wrapt" +version = "1.17.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/fc/e91cc220803d7bc4db93fb02facd8461c37364151b8494762cc88b0fbcef/wrapt-1.17.2.tar.gz", hash = "sha256:41388e9d4d1522446fe79d3213196bd9e3b301a336965b9e27ca2788ebd122f3", size = 55531 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/d1/1daec934997e8b160040c78d7b31789f19b122110a75eca3d4e8da0049e1/wrapt-1.17.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3d57c572081fed831ad2d26fd430d565b76aa277ed1d30ff4d40670b1c0dd984", size = 53307 }, + { url = "https://files.pythonhosted.org/packages/1b/7b/13369d42651b809389c1a7153baa01d9700430576c81a2f5c5e460df0ed9/wrapt-1.17.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b5e251054542ae57ac7f3fba5d10bfff615b6c2fb09abeb37d2f1463f841ae22", size = 38486 }, + { url = "https://files.pythonhosted.org/packages/62/bf/e0105016f907c30b4bd9e377867c48c34dc9c6c0c104556c9c9126bd89ed/wrapt-1.17.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:80dd7db6a7cb57ffbc279c4394246414ec99537ae81ffd702443335a61dbf3a7", size = 38777 }, + { url = "https://files.pythonhosted.org/packages/27/70/0f6e0679845cbf8b165e027d43402a55494779295c4b08414097b258ac87/wrapt-1.17.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a6e821770cf99cc586d33833b2ff32faebdbe886bd6322395606cf55153246c", size = 83314 }, + { url = "https://files.pythonhosted.org/packages/0f/77/0576d841bf84af8579124a93d216f55d6f74374e4445264cb378a6ed33eb/wrapt-1.17.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b60fb58b90c6d63779cb0c0c54eeb38941bae3ecf7a73c764c52c88c2dcb9d72", size = 74947 }, + { url = "https://files.pythonhosted.org/packages/90/ec/00759565518f268ed707dcc40f7eeec38637d46b098a1f5143bff488fe97/wrapt-1.17.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b870b5df5b71d8c3359d21be8f0d6c485fa0ebdb6477dda51a1ea54a9b558061", size = 82778 }, + { url = "https://files.pythonhosted.org/packages/f8/5a/7cffd26b1c607b0b0c8a9ca9d75757ad7620c9c0a9b4a25d3f8a1480fafc/wrapt-1.17.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:4011d137b9955791f9084749cba9a367c68d50ab8d11d64c50ba1688c9b457f2", size = 81716 }, + { url = "https://files.pythonhosted.org/packages/7e/09/dccf68fa98e862df7e6a60a61d43d644b7d095a5fc36dbb591bbd4a1c7b2/wrapt-1.17.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:1473400e5b2733e58b396a04eb7f35f541e1fb976d0c0724d0223dd607e0f74c", size = 74548 }, + { url = "https://files.pythonhosted.org/packages/b7/8e/067021fa3c8814952c5e228d916963c1115b983e21393289de15128e867e/wrapt-1.17.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3cedbfa9c940fdad3e6e941db7138e26ce8aad38ab5fe9dcfadfed9db7a54e62", size = 81334 }, + { url = "https://files.pythonhosted.org/packages/4b/0d/9d4b5219ae4393f718699ca1c05f5ebc0c40d076f7e65fd48f5f693294fb/wrapt-1.17.2-cp310-cp310-win32.whl", hash = "sha256:582530701bff1dec6779efa00c516496968edd851fba224fbd86e46cc6b73563", size = 36427 }, + { url = "https://files.pythonhosted.org/packages/72/6a/c5a83e8f61aec1e1aeef939807602fb880e5872371e95df2137142f5c58e/wrapt-1.17.2-cp310-cp310-win_amd64.whl", hash = "sha256:58705da316756681ad3c9c73fd15499aa4d8c69f9fd38dc8a35e06c12468582f", size = 38774 }, + { url = "https://files.pythonhosted.org/packages/cd/f7/a2aab2cbc7a665efab072344a8949a71081eed1d2f451f7f7d2b966594a2/wrapt-1.17.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ff04ef6eec3eee8a5efef2401495967a916feaa353643defcc03fc74fe213b58", size = 53308 }, + { url = "https://files.pythonhosted.org/packages/50/ff/149aba8365fdacef52b31a258c4dc1c57c79759c335eff0b3316a2664a64/wrapt-1.17.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4db983e7bca53819efdbd64590ee96c9213894272c776966ca6306b73e4affda", size = 38488 }, + { url = "https://files.pythonhosted.org/packages/65/46/5a917ce85b5c3b490d35c02bf71aedaa9f2f63f2d15d9949cc4ba56e8ba9/wrapt-1.17.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9abc77a4ce4c6f2a3168ff34b1da9b0f311a8f1cfd694ec96b0603dff1c79438", size = 38776 }, + { url = "https://files.pythonhosted.org/packages/ca/74/336c918d2915a4943501c77566db41d1bd6e9f4dbc317f356b9a244dfe83/wrapt-1.17.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b929ac182f5ace000d459c59c2c9c33047e20e935f8e39371fa6e3b85d56f4a", size = 83776 }, + { url = "https://files.pythonhosted.org/packages/09/99/c0c844a5ccde0fe5761d4305485297f91d67cf2a1a824c5f282e661ec7ff/wrapt-1.17.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f09b286faeff3c750a879d336fb6d8713206fc97af3adc14def0cdd349df6000", size = 75420 }, + { url = "https://files.pythonhosted.org/packages/b4/b0/9fc566b0fe08b282c850063591a756057c3247b2362b9286429ec5bf1721/wrapt-1.17.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a7ed2d9d039bd41e889f6fb9364554052ca21ce823580f6a07c4ec245c1f5d6", size = 83199 }, + { url = "https://files.pythonhosted.org/packages/9d/4b/71996e62d543b0a0bd95dda485219856def3347e3e9380cc0d6cf10cfb2f/wrapt-1.17.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:129a150f5c445165ff941fc02ee27df65940fcb8a22a61828b1853c98763a64b", size = 82307 }, + { url = "https://files.pythonhosted.org/packages/39/35/0282c0d8789c0dc9bcc738911776c762a701f95cfe113fb8f0b40e45c2b9/wrapt-1.17.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1fb5699e4464afe5c7e65fa51d4f99e0b2eadcc176e4aa33600a3df7801d6662", size = 75025 }, + { url = "https://files.pythonhosted.org/packages/4f/6d/90c9fd2c3c6fee181feecb620d95105370198b6b98a0770cba090441a828/wrapt-1.17.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9a2bce789a5ea90e51a02dfcc39e31b7f1e662bc3317979aa7e5538e3a034f72", size = 81879 }, + { url = "https://files.pythonhosted.org/packages/8f/fa/9fb6e594f2ce03ef03eddbdb5f4f90acb1452221a5351116c7c4708ac865/wrapt-1.17.2-cp311-cp311-win32.whl", hash = "sha256:4afd5814270fdf6380616b321fd31435a462019d834f83c8611a0ce7484c7317", size = 36419 }, + { url = "https://files.pythonhosted.org/packages/47/f8/fb1773491a253cbc123c5d5dc15c86041f746ed30416535f2a8df1f4a392/wrapt-1.17.2-cp311-cp311-win_amd64.whl", hash = "sha256:acc130bc0375999da18e3d19e5a86403667ac0c4042a094fefb7eec8ebac7cf3", size = 38773 }, + { url = "https://files.pythonhosted.org/packages/a1/bd/ab55f849fd1f9a58ed7ea47f5559ff09741b25f00c191231f9f059c83949/wrapt-1.17.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d5e2439eecc762cd85e7bd37161d4714aa03a33c5ba884e26c81559817ca0925", size = 53799 }, + { url = "https://files.pythonhosted.org/packages/53/18/75ddc64c3f63988f5a1d7e10fb204ffe5762bc663f8023f18ecaf31a332e/wrapt-1.17.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fc7cb4c1c744f8c05cd5f9438a3caa6ab94ce8344e952d7c45a8ed59dd88392", size = 38821 }, + { url = "https://files.pythonhosted.org/packages/48/2a/97928387d6ed1c1ebbfd4efc4133a0633546bec8481a2dd5ec961313a1c7/wrapt-1.17.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8fdbdb757d5390f7c675e558fd3186d590973244fab0c5fe63d373ade3e99d40", size = 38919 }, + { url = "https://files.pythonhosted.org/packages/73/54/3bfe5a1febbbccb7a2f77de47b989c0b85ed3a6a41614b104204a788c20e/wrapt-1.17.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bb1d0dbf99411f3d871deb6faa9aabb9d4e744d67dcaaa05399af89d847a91d", size = 88721 }, + { url = "https://files.pythonhosted.org/packages/25/cb/7262bc1b0300b4b64af50c2720ef958c2c1917525238d661c3e9a2b71b7b/wrapt-1.17.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d18a4865f46b8579d44e4fe1e2bcbc6472ad83d98e22a26c963d46e4c125ef0b", size = 80899 }, + { url = "https://files.pythonhosted.org/packages/2a/5a/04cde32b07a7431d4ed0553a76fdb7a61270e78c5fd5a603e190ac389f14/wrapt-1.17.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc570b5f14a79734437cb7b0500376b6b791153314986074486e0b0fa8d71d98", size = 89222 }, + { url = "https://files.pythonhosted.org/packages/09/28/2e45a4f4771fcfb109e244d5dbe54259e970362a311b67a965555ba65026/wrapt-1.17.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6d9187b01bebc3875bac9b087948a2bccefe464a7d8f627cf6e48b1bbae30f82", size = 86707 }, + { url = "https://files.pythonhosted.org/packages/c6/d2/dcb56bf5f32fcd4bd9aacc77b50a539abdd5b6536872413fd3f428b21bed/wrapt-1.17.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9e8659775f1adf02eb1e6f109751268e493c73716ca5761f8acb695e52a756ae", size = 79685 }, + { url = "https://files.pythonhosted.org/packages/80/4e/eb8b353e36711347893f502ce91c770b0b0929f8f0bed2670a6856e667a9/wrapt-1.17.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e8b2816ebef96d83657b56306152a93909a83f23994f4b30ad4573b00bd11bb9", size = 87567 }, + { url = "https://files.pythonhosted.org/packages/17/27/4fe749a54e7fae6e7146f1c7d914d28ef599dacd4416566c055564080fe2/wrapt-1.17.2-cp312-cp312-win32.whl", hash = "sha256:468090021f391fe0056ad3e807e3d9034e0fd01adcd3bdfba977b6fdf4213ea9", size = 36672 }, + { url = "https://files.pythonhosted.org/packages/15/06/1dbf478ea45c03e78a6a8c4be4fdc3c3bddea5c8de8a93bc971415e47f0f/wrapt-1.17.2-cp312-cp312-win_amd64.whl", hash = "sha256:ec89ed91f2fa8e3f52ae53cd3cf640d6feff92ba90d62236a81e4e563ac0e991", size = 38865 }, + { url = "https://files.pythonhosted.org/packages/ce/b9/0ffd557a92f3b11d4c5d5e0c5e4ad057bd9eb8586615cdaf901409920b14/wrapt-1.17.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6ed6ffac43aecfe6d86ec5b74b06a5be33d5bb9243d055141e8cabb12aa08125", size = 53800 }, + { url = "https://files.pythonhosted.org/packages/c0/ef/8be90a0b7e73c32e550c73cfb2fa09db62234227ece47b0e80a05073b375/wrapt-1.17.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:35621ae4c00e056adb0009f8e86e28eb4a41a4bfa8f9bfa9fca7d343fe94f998", size = 38824 }, + { url = "https://files.pythonhosted.org/packages/36/89/0aae34c10fe524cce30fe5fc433210376bce94cf74d05b0d68344c8ba46e/wrapt-1.17.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a604bf7a053f8362d27eb9fefd2097f82600b856d5abe996d623babd067b1ab5", size = 38920 }, + { url = "https://files.pythonhosted.org/packages/3b/24/11c4510de906d77e0cfb5197f1b1445d4fec42c9a39ea853d482698ac681/wrapt-1.17.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5cbabee4f083b6b4cd282f5b817a867cf0b1028c54d445b7ec7cfe6505057cf8", size = 88690 }, + { url = "https://files.pythonhosted.org/packages/71/d7/cfcf842291267bf455b3e266c0c29dcb675b5540ee8b50ba1699abf3af45/wrapt-1.17.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:49703ce2ddc220df165bd2962f8e03b84c89fee2d65e1c24a7defff6f988f4d6", size = 80861 }, + { url = "https://files.pythonhosted.org/packages/d5/66/5d973e9f3e7370fd686fb47a9af3319418ed925c27d72ce16b791231576d/wrapt-1.17.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8112e52c5822fc4253f3901b676c55ddf288614dc7011634e2719718eaa187dc", size = 89174 }, + { url = "https://files.pythonhosted.org/packages/a7/d3/8e17bb70f6ae25dabc1aaf990f86824e4fd98ee9cadf197054e068500d27/wrapt-1.17.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:9fee687dce376205d9a494e9c121e27183b2a3df18037f89d69bd7b35bcf59e2", size = 86721 }, + { url = "https://files.pythonhosted.org/packages/6f/54/f170dfb278fe1c30d0ff864513cff526d624ab8de3254b20abb9cffedc24/wrapt-1.17.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:18983c537e04d11cf027fbb60a1e8dfd5190e2b60cc27bc0808e653e7b218d1b", size = 79763 }, + { url = "https://files.pythonhosted.org/packages/4a/98/de07243751f1c4a9b15c76019250210dd3486ce098c3d80d5f729cba029c/wrapt-1.17.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:703919b1633412ab54bcf920ab388735832fdcb9f9a00ae49387f0fe67dad504", size = 87585 }, + { url = "https://files.pythonhosted.org/packages/f9/f0/13925f4bd6548013038cdeb11ee2cbd4e37c30f8bfd5db9e5a2a370d6e20/wrapt-1.17.2-cp313-cp313-win32.whl", hash = "sha256:abbb9e76177c35d4e8568e58650aa6926040d6a9f6f03435b7a522bf1c487f9a", size = 36676 }, + { url = "https://files.pythonhosted.org/packages/bf/ae/743f16ef8c2e3628df3ddfd652b7d4c555d12c84b53f3d8218498f4ade9b/wrapt-1.17.2-cp313-cp313-win_amd64.whl", hash = "sha256:69606d7bb691b50a4240ce6b22ebb319c1cfb164e5f6569835058196e0f3a845", size = 38871 }, + { url = "https://files.pythonhosted.org/packages/3d/bc/30f903f891a82d402ffb5fda27ec1d621cc97cb74c16fea0b6141f1d4e87/wrapt-1.17.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:4a721d3c943dae44f8e243b380cb645a709ba5bd35d3ad27bc2ed947e9c68192", size = 56312 }, + { url = "https://files.pythonhosted.org/packages/8a/04/c97273eb491b5f1c918857cd26f314b74fc9b29224521f5b83f872253725/wrapt-1.17.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:766d8bbefcb9e00c3ac3b000d9acc51f1b399513f44d77dfe0eb026ad7c9a19b", size = 40062 }, + { url = "https://files.pythonhosted.org/packages/4e/ca/3b7afa1eae3a9e7fefe499db9b96813f41828b9fdb016ee836c4c379dadb/wrapt-1.17.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e496a8ce2c256da1eb98bd15803a79bee00fc351f5dfb9ea82594a3f058309e0", size = 40155 }, + { url = "https://files.pythonhosted.org/packages/89/be/7c1baed43290775cb9030c774bc53c860db140397047cc49aedaf0a15477/wrapt-1.17.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d615e4fe22f4ad3528448c193b218e077656ca9ccb22ce2cb20db730f8d306", size = 113471 }, + { url = "https://files.pythonhosted.org/packages/32/98/4ed894cf012b6d6aae5f5cc974006bdeb92f0241775addad3f8cd6ab71c8/wrapt-1.17.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a5aaeff38654462bc4b09023918b7f21790efb807f54c000a39d41d69cf552cb", size = 101208 }, + { url = "https://files.pythonhosted.org/packages/ea/fd/0c30f2301ca94e655e5e057012e83284ce8c545df7661a78d8bfca2fac7a/wrapt-1.17.2-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a7d15bbd2bc99e92e39f49a04653062ee6085c0e18b3b7512a4f2fe91f2d681", size = 109339 }, + { url = "https://files.pythonhosted.org/packages/75/56/05d000de894c4cfcb84bcd6b1df6214297b8089a7bd324c21a4765e49b14/wrapt-1.17.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:e3890b508a23299083e065f435a492b5435eba6e304a7114d2f919d400888cc6", size = 110232 }, + { url = "https://files.pythonhosted.org/packages/53/f8/c3f6b2cf9b9277fb0813418e1503e68414cd036b3b099c823379c9575e6d/wrapt-1.17.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:8c8b293cd65ad716d13d8dd3624e42e5a19cc2a2f1acc74b30c2c13f15cb61a6", size = 100476 }, + { url = "https://files.pythonhosted.org/packages/a7/b1/0bb11e29aa5139d90b770ebbfa167267b1fc548d2302c30c8f7572851738/wrapt-1.17.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4c82b8785d98cdd9fed4cac84d765d234ed3251bd6afe34cb7ac523cb93e8b4f", size = 106377 }, + { url = "https://files.pythonhosted.org/packages/6a/e1/0122853035b40b3f333bbb25f1939fc1045e21dd518f7f0922b60c156f7c/wrapt-1.17.2-cp313-cp313t-win32.whl", hash = "sha256:13e6afb7fe71fe7485a4550a8844cc9ffbe263c0f1a1eea569bc7091d4898555", size = 37986 }, + { url = "https://files.pythonhosted.org/packages/09/5e/1655cf481e079c1f22d0cabdd4e51733679932718dc23bf2db175f329b76/wrapt-1.17.2-cp313-cp313t-win_amd64.whl", hash = "sha256:eaf675418ed6b3b31c7a989fd007fa7c3be66ce14e5c3b27336383604c9da85c", size = 40750 }, + { url = "https://files.pythonhosted.org/packages/2d/82/f56956041adef78f849db6b289b282e72b55ab8045a75abad81898c28d19/wrapt-1.17.2-py3-none-any.whl", hash = "sha256:b18f2d1533a71f069c7f82d524a52599053d4c7166e9dd374ae2136b7f40f7c8", size = 23594 }, +] + [[package]] name = "ya-tracker-client" version = "0.0.3" @@ -1106,6 +1206,7 @@ dev = [ { name = "pytest-cov" }, { name = "python-dotenv" }, { name = "ruff" }, + { name = "vcrpy" }, ] [package.metadata] @@ -1120,13 +1221,14 @@ requires-dist = [ dev = [ { name = "coverage", specifier = ">=7.3.1" }, { name = "gevent", specifier = ">=23.9.1" }, - { name = "polyfactory", specifier = ">=2.8.2" }, + { name = "polyfactory", specifier = ">=2.19.0" }, { name = "pre-commit", specifier = ">=3.4.0" }, { name = "pytest", specifier = ">=7.4.2" }, { name = "pytest-asyncio", specifier = ">=0.21.1" }, { name = "pytest-cov", specifier = ">=4.1.0" }, { name = "python-dotenv", specifier = ">=1.0.0" }, { name = "ruff", specifier = ">=0.9.7" }, + { name = "vcrpy", specifier = ">=7.0.0" }, ] [[package]] diff --git a/ya_tracker_client/domain/entities/component.py b/ya_tracker_client/domain/entities/component.py index 8962707..55dd8c5 100644 --- a/ya_tracker_client/domain/entities/component.py +++ b/ya_tracker_client/domain/entities/component.py @@ -9,6 +9,6 @@ class Component(AbstractEntity): version: int name: str queue: QueueShort - description: str + description: str | None = None # TODO: report to support - in docs its just string lead: UserShort | None = None assign_auto: bool diff --git a/ya_tracker_client/domain/entities/issue.py b/ya_tracker_client/domain/entities/issue.py index b88b5da..732cc7c 100644 --- a/ya_tracker_client/domain/entities/issue.py +++ b/ya_tracker_client/domain/entities/issue.py @@ -117,3 +117,39 @@ class IssueFindParameters(AbstractEntity): query: str | None = None keys: str | None = None queue: str | None = None + + +class ImportIssue(AbstractEntity): + summary: str + queue: QueueIdentifier | str | int + created_at: datetime | str + created_by: str | int + key: str | None = None + updated_at: datetime | str | None = None + updated_by: str | int | None = None + resolved_at: datetime | str | None = None + resolved_by: str | int | None = None + status: int | None = None + deadline: datetime | str | None = None + resolution: int | None = None + type: int | None = None + description: str | None = None + start: datetime | str | None = None + end: datetime | str | None = None + assignee: str | int | None = None + priority: int | None = None + affected_versions: list[int] | None = None + fix_versions: list[int] | None = None + components: list[int] | None = None + tags: list[str] | None = None + sprint: list[int] | None = None + followers: list[int | str] | None = None + access: list[int | str] | None = None + unique: str | None = None + following_maillists: list[str] | None = None + original_estimation: int | None = None + estimation: int | None = None + spent: int | None = None + story_points: float | None = None + voted_by: list[int | str] | None = None + favorite_by: list[int | str] | None = None diff --git a/ya_tracker_client/domain/entities/priority.py b/ya_tracker_client/domain/entities/priority.py index 9a7ae37..742e9ed 100644 --- a/ya_tracker_client/domain/entities/priority.py +++ b/ya_tracker_client/domain/entities/priority.py @@ -7,5 +7,5 @@ class Priority(AbstractEntity): key: str display: str | None = None version: int | None = None - name: str | dict | None = None + name: str | None = None order: int | None = None diff --git a/ya_tracker_client/domain/repositories/issue.py b/ya_tracker_client/domain/repositories/issue.py index d4ffd70..d9e2272 100644 --- a/ya_tracker_client/domain/repositories/issue.py +++ b/ya_tracker_client/domain/repositories/issue.py @@ -1,6 +1,14 @@ +from datetime import datetime from typing import Any -from ya_tracker_client.domain.entities.issue import Issue, IssueCreate, IssueEdit, IssueFindParameters, IssueShort +from ya_tracker_client.domain.entities.issue import ( + ImportIssue, + Issue, + IssueCreate, + IssueEdit, + IssueFindParameters, + IssueShort, +) from ya_tracker_client.domain.entities.issue_change_history import IssueChangeHistory, IssueChangeHistoryParameters from ya_tracker_client.domain.entities.issue_type import IssueType from ya_tracker_client.domain.entities.priority import Priority @@ -238,6 +246,9 @@ async def find_issues( keys: str | None = None, queue: str | None = None, ) -> list[Issue]: + """ + YC docs: https://yandex.ru/support/tracker/ru/concepts/issues/search-issues + """ params = {} if order: params['order'] = order @@ -256,3 +267,83 @@ async def find_issues( ).model_dump(exclude_none=True, by_alias=True), ) return self._decode(raw_response, Issue, plural=True) + + async def import_issue( + self, + summary: str, + queue: QueueIdentifier | str | int, + created_at: datetime | str, + created_by: str | int, + key: str | None = None, + updated_at: datetime | str | None = None, + updated_by: str | int | None = None, + resolved_at: datetime | str | None = None, + resolved_by: str | int | None = None, + status: int | None = None, + deadline: datetime | str | None = None, + resolution: int | None = None, + type: int | None = None, + description: str | None = None, + start: datetime | str | None = None, + end: datetime | str | None = None, + assignee: str | int | None = None, + priority: int | None = None, + affected_versions: list[int] | None = None, + fix_versions: list[int] | None = None, + components: list[int] | None = None, + tags: list[str] | None = None, + sprint: list[int] | None = None, + followers: list[int | str] | None = None, + access: list[int | str] | None = None, + unique: str | None = None, + following_maillists: list[str] | None = None, + original_estimation: int | None = None, + estimation: int | None = None, + spent: int | None = None, + story_points: float | None = None, + voted_by: list[int | str] | None = None, + favorite_by: list[int | str] | None = None, + ): + """ + YC docs: https://yandex.ru/support/tracker/ru/concepts/import/import-ticket + """ + raw_response = await self._client.request( + method='POST', + uri='/issues/_search', + payload=ImportIssue( + summary=summary, + queue=queue, + created_at=created_at, + created_by=created_by, + key=key, + updated_at=updated_at, + updated_by=updated_by, + resolved_at=resolved_at, + resolved_by=resolved_by, + status=status, + deadline=deadline, + resolution=resolution, + type=type, + description=description, + start=start, + end=end, + assignee=assignee, + priority=priority, + affected_versions=affected_versions, + fix_versions=fix_versions, + components=components, + tags=tags, + sprint=sprint, + followers=followers, + access=access, + unique=unique, + following_maillists=following_maillists, + original_estimation=original_estimation, + estimation=estimation, + spent=spent, + story_points=story_points, + voted_by=voted_by, + favorite_by=favorite_by, + ).model_dump(exclude_none=True, by_alias=True), + ) + return self._decode(raw_response, Issue, plural=True)