Skip to content

Commit 0e7e241

Browse files
authored
AnnoFab v0.89.3対応
`api.put_project` メソッドに、query_params引数追加
1 parent 8addf25 commit 0e7e241

21 files changed

+8061
-10845
lines changed

annofabapi/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.33.1"
1+
__version__ = "0.34.0"

annofabapi/dataclass/annotation.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
TaskStatus,
2525
)
2626

27-
OneOfstringFullAnnotationData = Union[str, Dict[str, Any]]
27+
AnnotationData = Union[str, Dict[str, Any]]
2828
FullAnnotationData = Dict[str, Any]
2929
AdditionalDataValue = Dict[str, Any]
3030

@@ -152,7 +152,7 @@ class AdditionalData:
152152
"""
153153

154154
additional_data_definition_id: str
155-
"""属性ID。[アノテーション仕様](#tag/af-annotation-specs)で定義されます。"""
155+
""""""
156156

157157
flag: Optional[bool]
158158
"""`additional_data_definition`の`type`が`flag`のときの属性値。 """
@@ -164,7 +164,7 @@ class AdditionalData:
164164
"""`additional_data_definition`の`type`が`text`,`comment`,`link` または `tracking`のときの属性値。 """
165165

166166
choice: Optional[str]
167-
"""`additional_data_definition`の`type`が`choice` または `select `のときの属性値(選択肢ID)。 """
167+
""""""
168168

169169

170170
@dataclass_json
@@ -387,19 +387,19 @@ class AnnotationDetail:
387387
"""アノテーションID。[値の制約についてはこちら。](#section/API-Convention/APIID)<br> annotation_type が classification の場合は label_id と同じ値が格納されます。 """
388388

389389
account_id: str
390-
"""アノテーションを作成したユーザのアカウントID。"""
390+
""""""
391391

392392
label_id: str
393-
"""ラベルID。[アノテーション仕様](#tag/af-annotation-specs)で定義されます。"""
393+
""""""
394394

395395
is_protected: bool
396396
"""`true`の場合、アノテーションをアノテーションエディタ上での削除から保護できます。 外部から取り込んだアノテーションに属性を追加するときなどに指定すると、データの削除を防げます。 """
397397

398398
data_holding_type: AnnotationDataHoldingType
399399
""""""
400400

401-
data: Optional[OneOfstringFullAnnotationData]
402-
"""アノテーションの座標値や区間などのデータ。レスポンスの場合は`string`形式、[putAnnotation](#operation/putAnnotation) APIのリクエストボディに渡す場合は`string`または`object`形式です。 `annotation_type`に応じて`string`,`object`の形式が変わります。 <table> <tr><th>annotation_type</th><th>data_holding_type</th><th>string形式</th><th>object形式</th></tr> <tr><td>bounding_box </td><td>inner</td><td><code>左上x,左上y,右下x,右下y</code></td><td><code>FullAnnotationDataBoundingBox</code></td></tr> <tr><td>point</td><td>inner</td><td><code>x1,y1</code></td><td><code>FullAnnotationDataSinglePoint</code></td></tr> <tr><td>polygon / polyline </td><td>inner</td><td><code>x1,y1,x2,y2, ... </code></td><td><code>FullAnnotationDataPoints</code></td></tr> <tr><td>range </td><td>inner</td><td><code>開始時間(ミリ秒),終了時間(ミリ秒) </code></td><td><code>FullAnnotationDataRange</code></td></tr> <tr><td>classification </td><td>inner</td><td><code>null </code></td><td><code>FullAnnotationDataClassification</code> / <code>null </code></td></tr> <tr><td>segmentation</td><td>outer</td><td><code>null </code></td><td><code>FullAnnotationDataSegmentation</code> / <code>null </code></td></tr> <tr><td>segmentation_v2 </td><td>outer</td><td><code>null </code></td><td><code>FullAnnotationDataSegmentationV2</code> / <code>null </code></td></tr> </table> """
401+
data: Optional[AnnotationData]
402+
""""""
403403

404404
path: Optional[str]
405405
"""外部ファイルに保存されたアノテーションのパス。`data_holding_type`が`inner`の場合は未指定です。 レスポンスの場合は`annotation_id`と同じ値が格納されます。 [putAnnotation](#operation/putAnnotation) APIのリクエストボディに渡す場合は、[createTempPath](#operation/createTempPath) APIで取得できる一時データ保存先S3パスを格納してください。 更新しない場合は、[getEditorAnnotation](#operation/getEditorAnnotation) APIで取得した`path`をそのまま渡せます。 外部ファイルのフォーマットは下表の通りです。 <table> <tr><th>annotation_type</th><th>形式</th></tr> <tr><td>segmentation / segmentation_v2 </td><td>PNG画像。塗りつぶした部分は<code>rgba(255, 255, 255, 1) </code>、塗りつぶしていない部分は<code>rgba(0, 0, 0, 0) </code>。</td></tr> </table> """

annofabapi/dataclass/annotation_specs.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from annofabapi.models import AdditionalDataDefinitionType, AnnotationType
1919

20-
OneOfbooleanintegerstring = Union[bool, int, str]
20+
AdditionalDataDefaultType = Union[bool, int, str]
2121

2222
AdditionalDataRestrictionCondition = Dict[str, Any]
2323

@@ -226,8 +226,8 @@ class AdditionalDataDefinitionV1:
226226
name: Optional[InternationalizationMessage]
227227
""""""
228228

229-
default: Optional[OneOfbooleanintegerstring]
230-
"""属性の初期値です。 初期値を指定する場合、属性の種類に応じて次の値を指定します。初期値を設定しない場合には空文字を指定します。 * type が flag の場合: 真偽値(`true` or `false`) * type が integer の場合: 整数値 * type が text の場合: 文字列 * type が comment の場合: 文字列 * type が choice の場合: 選択肢(`choices`)の `choice_id` * type が select の場合: 選択肢(`choices`)の `choice_id` 属性の種類に対して有効でない初期値を設定した場合、その設定は無視されます。 なお、トラッキングとリンクには初期値を設定できません。 """
229+
default: Optional[AdditionalDataDefaultType]
230+
""""""
231231

232232
keybind: Optional[List[Keybind]]
233233
""""""
@@ -264,8 +264,8 @@ class AdditionalDataDefinitionV2:
264264
name: Optional[InternationalizationMessage]
265265
""""""
266266

267-
default: Optional[OneOfbooleanintegerstring]
268-
"""属性の初期値です。 初期値を指定する場合、属性の種類に応じて次の値を指定します。初期値を設定しない場合には空文字を指定します。 * type が flag の場合: 真偽値(`true` or `false`) * type が integer の場合: 整数値 * type が text の場合: 文字列 * type が comment の場合: 文字列 * type が choice の場合: 選択肢(`choices`)の `choice_id` * type が select の場合: 選択肢(`choices`)の `choice_id` 属性の種類に対して有効でない初期値を設定した場合、その設定は無視されます。 なお、トラッキングとリンクには初期値を設定できません。 """
267+
default: Optional[AdditionalDataDefaultType]
268+
""""""
269269

270270
keybind: Optional[List[Keybind]]
271271
""""""

annofabapi/dataclass/input.py

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
from dataclasses_json import dataclass_json
1717

18+
SystemMetadata = Dict[str, Any]
19+
1820

1921
@dataclass_json
2022
@dataclass
@@ -75,3 +77,6 @@ class InputData:
7577

7678
metadata: Optional[Dict[str, str]]
7779
"""ユーザーが自由に登録できるkey-value型のメタデータです。主にカスタムエディタで使われることを想定しています。 """
80+
81+
system_metadata: Optional[SystemMetadata]
82+
""""""

annofabapi/dataclass/inspection.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from annofabapi.models import InspectionStatus, TaskPhase
1919

20-
OneOfInspectionDataPointInspectionDataPolylineInspectionDataTime = Dict[str, Any]
20+
InspectionData = Dict[str, Any]
2121

2222

2323
@dataclass_json
@@ -40,22 +40,22 @@ class Inspection:
4040
"""検査ID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
4141

4242
phase: TaskPhase
43-
"""検査コメントを付与したときのタスクフェーズ。[詳細はこちら](#section/TaskPhase)"""
43+
""""""
4444

4545
phase_stage: int
4646
"""検査コメントを付与したときのフェーズのステージ"""
4747

4848
commenter_account_id: str
49-
"""検査コメントを付与したユーザのアカウントID"""
49+
""""""
5050

5151
annotation_id: Optional[str]
52-
"""検査コメントに紐づくアノテーションのID。アノテーションに紐付けられていない場合(アノテーションの付け忘れに対する指定など)は未指定。 [詳細はこちら](#section/AnnotationId)。 """
52+
"""アノテーションID。[値の制約についてはこちら。](#section/API-Convention/APIID)<br> annotation_type が classification の場合は label_id と同じ値が格納されます。 """
5353

54-
data: OneOfInspectionDataPointInspectionDataPolylineInspectionDataTime
55-
"""検査コメントの座標値や区間。 * `InspectionDataPoint`:点で検査コメントを付与したときの座標値 * `InspectionDataPolyline`:ポリラインで検査コメントを付与したときの座標値 * `InspectionDataTime`:検査コメントを付与した区間(動画プロジェクトの場合) """
54+
data: InspectionData
55+
""""""
5656

5757
parent_inspection_id: Optional[str]
58-
"""返信先の検査コメントの検査ID。返信先の検査コメントは「スレッド内の直前のコメント」ではなく「スレッドの先頭のコメント」を指します。 """
58+
"""検査ID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
5959

6060
phrases: Optional[List[str]]
6161
"""参照している定型指摘のID。"""

0 commit comments

Comments
 (0)