Skip to content

Commit 8bec4dc

Browse files
authored
Annofab v0.199.0に対応しました (#705)
* update swagger * update pydantic_models * MyOrganizationのテストを追加 * update ruff
1 parent bec40ab commit 8bec4dc

8 files changed

+56
-34
lines changed

annofabapi/pydantic_models/my_organization.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ class MyOrganization(BaseModel):
2929
MyOrganization
3030
"""
3131

32-
organization_id: Optional[StrictStr] = Field(default=None, description="組織ID。[値の制約についてはこちら。](#section/API-Convention/APIID) ")
33-
name: Optional[StrictStr] = None
34-
email: Optional[StrictStr] = None
35-
price_plan: Optional[PricePlan] = None
36-
summary: Optional[Dict[str, Any]] = Field(default=None, description="廃止予定のプロパティです。常に中身は空です。 ")
37-
created_datetime: Optional[str] = Field(default=None, description="作成日時")
38-
updated_datetime: Optional[str] = Field(default=None, description="更新日時")
39-
my_role: Optional[OrganizationMemberRole] = None
40-
my_status: Optional[OrganizationMemberStatus] = None
32+
organization_id: StrictStr = Field(description="組織ID。[値の制約についてはこちら。](#section/API-Convention/APIID) ")
33+
name: StrictStr
34+
email: StrictStr
35+
price_plan: PricePlan
36+
summary: Dict[str, Any] = Field(description="廃止予定のプロパティです。常に中身は空です。 ")
37+
created_datetime: str = Field(description="作成日時")
38+
updated_datetime: str = Field(description="更新日時")
39+
my_role: OrganizationMemberRole
40+
my_status: OrganizationMemberStatus
4141
__properties: ClassVar[List[str]] = [
4242
"organization_id",
4343
"name",

annofabapi/pydantic_models/project_task_counts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ProjectTaskCounts(BaseModel):
2727
ProjectTaskCounts
2828
"""
2929

30-
task_counts: Optional[List[ProjectTaskCountsTaskCountsInner]] = None
30+
task_counts: List[ProjectTaskCountsTaskCountsInner]
3131
__properties: ClassVar[List[str]] = ["task_counts"]
3232

3333
model_config = ConfigDict(

annofabapi/pydantic_models/project_task_counts_task_counts_inner.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class ProjectTaskCountsTaskCountsInner(BaseModel):
2828
ProjectTaskCountsTaskCountsInner
2929
"""
3030

31-
phase: Optional[TaskPhase] = None
32-
status: Optional[TaskStatus] = None
33-
count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="該当するタスクの数")
31+
phase: TaskPhase
32+
status: TaskStatus
33+
count: Union[StrictFloat, StrictInt] = Field(description="該当するタスクの数")
3434
__properties: ClassVar[List[str]] = ["phase", "status", "count"]
3535

3636
model_config = ConfigDict(

generate/swagger/swagger-api-components.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,16 @@ components:
13251325
* `{projectId}`
13261326
MyOrganization:
13271327
type: object
1328+
required:
1329+
- organization_id
1330+
- name
1331+
- email
1332+
- price_plan
1333+
- summary
1334+
- created_datetime
1335+
- updated_datetime
1336+
- my_role
1337+
- my_status
13281338
properties:
13291339
organization_id:
13301340
$ref: "#/components/schemas/OrganizationId"
@@ -7703,11 +7713,17 @@ components:
77037713
example: "IllegalState"
77047714
ProjectTaskCounts:
77057715
type: object
7716+
required:
7717+
- task_counts
77067718
properties:
77077719
task_counts:
77087720
type: array
77097721
items:
77107722
type: object
7723+
required:
7724+
- phase
7725+
- status
7726+
- count
77117727
properties:
77127728
phase:
77137729
$ref: "#/components/schemas/TaskPhase"

generate/swagger/swagger.v2.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ info:
115115
116116
上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。
117117
118-
version: 0.197.2
118+
version: 0.199.0
119119
title: Annofab Web API
120120
x-logo:
121121
url: "https://annofab.com/resource/images/logo_landscape.png"

generate/swagger/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ info:
118118
上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。
119119
また、AggregationResultの集約の件数は、合計で10000件以下に制限されており、それを超える件数がある場合は上位10000件が取得されます。もし、省略された部分を取得したい場合は、検索条件を縛って結果に上る集約の数を減らしてください。
120120
121-
version: 0.197.2
121+
version: 0.199.0
122122
title: Annofab Web API
123123
x-logo:
124124
url: "https://annofab.com/resource/images/logo_landscape.png"

poetry.lock

+19-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test_pydantic_models.py

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import annofabapi
55
from annofabapi.pydantic_models.annotation_specs_v3 import AnnotationSpecsV3
66
from annofabapi.pydantic_models.input_data import InputData
7+
from annofabapi.pydantic_models.my_organization import MyOrganization
78
from annofabapi.pydantic_models.project import Project
89
from annofabapi.pydantic_models.project_member import ProjectMember
910
from annofabapi.pydantic_models.simple_annotation import SimpleAnnotation
@@ -67,3 +68,8 @@ def test__SimpleAnnotation():
6768
with open("tests/data/simple-annotation/sample_1/c86205d1-bdd4-4110-ae46-194e661d622b.json") as f:
6869
content = json.load(f)
6970
SimpleAnnotation.from_dict(content)
71+
72+
73+
def test__MyOrganization():
74+
organizations, _ = service.api.get_my_organizations()
75+
MyOrganization.from_dict(organizations["list"][0])

0 commit comments

Comments
 (0)