Skip to content

Commit 61b65d2

Browse files
authored
Annofab v0.155.0対応 (#506)
* swagger * webapiの追加 * comment dataclassを追加 * download_project_task_history_events_url関数の警告を無視する * commentのテストコードを追加 * dataclassの警告表示 * Inspection dataclassのテストコードを削除 * instructionも不要にする * ジョブ関係のテストコードを修正 * テストコードの移植 * テストコードんの修正 * poetry update * dataclass関係のテストコードの削除 * version up
1 parent 5e27735 commit 61b65d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+656
-3287
lines changed

annofabapi/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.62.1"
1+
__version__ = "0.63.0"

annofabapi/dataclass/comment.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# flake8: noqa: W291
2+
# pylint: disable=too-many-lines,trailing-whitespace
3+
4+
"""
5+
annofabapiのmodelをDataClassで定義したクラス
6+
7+
Note:
8+
このファイルはopenapi-generatorで自動生成される。詳細は generate/README.mdを参照.
9+
oneOf, allOfなどは正しく表現できない可能性がある。
10+
"""
11+
12+
import warnings # pylint: disable=unused-import
13+
from dataclasses import dataclass
14+
from typing import Any, Dict, List, NewType, Optional, Tuple, Union # pylint: disable=unused-import
15+
16+
from dataclasses_json import DataClassJsonMixin
17+
18+
from annofabapi.models import CommentType, TaskPhase
19+
20+
CommentNode = Dict[str, Any]
21+
22+
23+
@dataclass
24+
class Comment(DataClassJsonMixin):
25+
"""
26+
コメント
27+
"""
28+
29+
project_id: str
30+
"""プロジェクトID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
31+
32+
task_id: str
33+
"""タスクID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
34+
35+
input_data_id: str
36+
"""入力データID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
37+
38+
comment_id: str
39+
"""コメントのID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
40+
41+
phase: TaskPhase
42+
""""""
43+
44+
phase_stage: int
45+
"""コメントを作成したときのフェーズのステージ。"""
46+
47+
account_id: str
48+
"""アカウントID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
49+
50+
comment_type: CommentType
51+
""""""
52+
53+
phrases: Optional[List[str]]
54+
"""`comment_type` の値によって扱いが異なります。 * `onhold` の場合 * 使用しません(空配列) * `inspection` の場合 * 参照している定型指摘のIDリスト """
55+
56+
comment: str
57+
"""コメント本文。 """
58+
59+
comment_node: CommentNode
60+
""""""
61+
62+
datetime_for_sorting: str
63+
"""コメントのソート順を決める日時。 Annofab標準エディタでは、コメントはここで指定した日時にしたがってスレッドごとに昇順で表示されます。 """
64+
65+
created_datetime: str
66+
"""コメントの作成日時。"""
67+
68+
updated_datetime: str
69+
"""コメントの更新日時。"""

annofabapi/dataclass/instruction.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
from dataclasses_json import DataClassJsonMixin
1717

18+
warnings.warn("'annofabapi.dataclass.instruction'モジュールは2022-12-01以降に廃止する予定です。", FutureWarning, stacklevel=2)
19+
1820

1921
@dataclass
2022
class Instruction(DataClassJsonMixin):

annofabapi/dataclass/my.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
from annofabapi.models import KeyLayout, Lang, OrganizationMemberRole, OrganizationMemberStatus, PricePlan
1919

20+
warnings.warn("'annofabapi.dataclass.my'モジュールは2022-12-01以降に廃止する予定です。", FutureWarning, stacklevel=2)
21+
2022

2123
@dataclass
2224
class MyOrganization(DataClassJsonMixin):
@@ -78,8 +80,8 @@ class MyAccount(DataClassJsonMixin):
7880
authority: str
7981
"""システム内部用のプロパティ"""
8082

81-
is_external_account: bool
82-
"""[外部アカウントだけで作成したアカウント](/docs/faq/#v1u344)の場合はtrue。 外部アカウント連携していないAnnofabアカウントや、後から[外部アカウントとの紐付け](/docs/faq/#yyyub0)をしたAnnofabアカウントの場合はfalse。 """
83+
account_type: str
84+
"""アカウントの種別 * `annofab` - 通常の手順で登録されたアカウント。後から[外部アカウントとの紐付け](/docs/faq/#yyyub0)をしたアカウントの場合もこちらになります。 * `external` - [外部アカウントだけで作成したアカウント](/docs/faq/#v1u344) * `project_guest` - [issueProjectGuestUserToken](#operation/issueProjectGuestUserToken)によって作成されたされたアカウント """
8385

8486
updated_datetime: str
8587
"""更新日時"""

annofabapi/dataclass/organization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
from dataclasses_json import DataClassJsonMixin
1717

18+
from annofabapi._utils import deprecated_class
1819
from annofabapi.models import PricePlan
1920

2021

22+
@deprecated_class(deprecated_date="2022-12-01")
2123
@dataclass
2224
class OrganizationActivity(DataClassJsonMixin):
2325
""" """

annofabapi/dataclass/statistics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
from annofabapi.models import GraphType, TaskPhase, TaskStatus
1919

20+
warnings.warn("'annofabapi.dataclass.statistics'モジュールは2022-12-01以降に廃止する予定です。", FutureWarning, stacklevel=2)
21+
2022

2123
@dataclass
2224
class ProjectTaskStatistics(DataClassJsonMixin):

annofabapi/dataclass/webhook.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
from annofabapi.models import WebhookEventType, WebhookHttpMethod, WebhookStatus
1919

20+
warnings.warn("'annofabapi.dataclass.webhook'モジュールは2022-12-01以降に廃止する予定です。", FutureWarning, stacklevel=2)
21+
2022

2123
@dataclass
2224
class WebhookHeader(DataClassJsonMixin):

0 commit comments

Comments
 (0)