Skip to content

Commit

Permalink
Annofab API v0.170.0に対応 (#584)
Browse files Browse the repository at this point in the history
* updatee swagger

* update python
  • Loading branch information
yuji38kwmt committed May 8, 2023
1 parent 6f160f1 commit a78179f
Show file tree
Hide file tree
Showing 6 changed files with 356 additions and 116 deletions.
2 changes: 1 addition & 1 deletion annofabapi/dataclass/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ProjectConfiguration(DataClassJsonMixin):
"""抜取受入率[%]。未指定の場合は100%として扱う。"""

private_storage_aws_iam_role_arn: Optional[str]
"""AWS IAMロール。ビジネスプランでのS3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。 """
"""AWS IAMロール。S3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。 """

plugin_id: Optional[str]
"""プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
Expand Down
87 changes: 69 additions & 18 deletions annofabapi/generated_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ def delete_project_job(
Args:
project_id (str): プロジェクトID (required)
job_type (ProjectJobType): ジョブの種別。[詳細はこちら](#section/ProjectJobType)。 (required)
job_type (str): このパラメータは互換性のために残されています。 この値は無視され、動作に影響を与えません。 (required)
job_id (str): ジョブID (required)
Returns:
Expand Down Expand Up @@ -938,7 +938,7 @@ def get_organization_job(
organization_name (str): 組織名 (required)
query_params (Dict[str, Any]): Query Parameters
type (str): 取得するジョブの種別。[詳細はこちら](#section/OrganizationJobType)。
limit (int): 1ページあたりの取得するデータ件数。 未指定時は1件のみ取得
limit (int): 1ページあたりの取得するデータ件数。 未指定時は30件取得
exclusive_start_created_datetime (str): 作成日時が、指定した日付より古いジョブを取得します。
Returns:
Expand Down Expand Up @@ -970,7 +970,7 @@ def get_project_job(
project_id (str): プロジェクトID (required)
query_params (Dict[str, Any]): Query Parameters
type (ProjectJobType): 取得するジョブの種別。[詳細はこちら](#section/ProjectJobType)。
limit (int): 1ページあたりの取得するデータ件数。 未指定時は1件のみ取得
limit (int): 1ページあたりの取得するデータ件数。 未指定時は30件取得
exclusive_start_created_datetime (str): 作成日時が、指定した日付より古いジョブを取得します。
Returns:
Expand Down Expand Up @@ -1038,6 +1038,60 @@ def get_my_member_in_project(self, project_id: str, **kwargs) -> Tuple[Any, requ
keyword_params.update(**kwargs)
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_my_notification_message(self, message_id: str, **kwargs) -> Tuple[Any, requests.Response]:
"""自分に届いているメッセージの取得
https://annofab.com/docs/api/#operation/getMyNotificationMessage
authorizations: Everyone
自分に届いているメッセージを取得します。
Args:
message_id (str): 通知メッセージID (required)
Returns:
Tuple[MyNotificationMessage, requests.Response]
"""
url_path = f"/my/messages/{message_id}"
http_method = "GET"
keyword_params: Dict[str, Any] = {}
keyword_params.update(**kwargs)
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_my_notification_messages(
self, query_params: Optional[Dict[str, Any]] = None, **kwargs
) -> Tuple[Any, requests.Response]:
"""自分に届いている通知メッセージの一括取得
https://annofab.com/docs/api/#operation/getMyNotificationMessages
authorizations: Everyone
自分に届いている通知メッセージを一括で取得します。 自身に届いている通知メッセージが上限(10000件)を超える場合、タイムスタンプが新しい順で上限を超える通知メッセージは取得できません。 また、上限を超える場合、開封済みの通知メッセージの数は、取得可能な通知メッセージ中の集計値となります。詳細はレスポンスの項目を参照ください。
Args:
query_params (Dict[str, Any]): Query Parameters
page (int): 表示するページ番号
limit (int): 1ページあたりの取得するデータ件数
Returns:
Tuple[GetMyMessagesResponse, requests.Response]
"""
url_path = f"/my/messages"
http_method = "GET"
keyword_params: Dict[str, Any] = {
"query_params": query_params,
}
keyword_params.update(**kwargs)
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_my_organizations(self, **kwargs) -> Tuple[Any, requests.Response]:
"""所属組織の一括取得
https://annofab.com/docs/api/#operation/getMyOrganizations
Expand Down Expand Up @@ -1144,32 +1198,29 @@ def put_my_account(self, request_body: Optional[Any] = None, **kwargs) -> Tuple[
keyword_params.update(**kwargs)
return self._request_wrapper(http_method, url_path, **keyword_params)

def update_organization(self, request_body: Optional[Any] = None, **kwargs) -> Tuple[Any, requests.Response]:
"""組織名の変更
https://annofab.com/docs/api/#operation/updateOrganization
def put_my_notification_message_opened(
self, message_id: str, request_body: Optional[Any] = None, **kwargs
) -> Tuple[Any, requests.Response]:
"""通知メッセージのステータス更新
https://annofab.com/docs/api/#operation/putMyNotificationMessageOpened
.. deprecated:: X
authorizations: OrganizationOwner
authorizations: Everyone
組織名を変更します。 2022/04/19以降に廃止する予定です
通知メッセージのステータスを更新します。 自分に届いた通知メッセージのみ更新できます
Args:
message_id (str): 通知メッセージID (required)
request_body (Any): Request Body
update_organization_name_request (UpdateOrganizationNameRequest): (required)
put_my_notification_message_opened_request (PutMyNotificationMessageOpenedRequest): (required)
Returns:
Tuple[Organization, requests.Response]
Tuple[, requests.Response]
"""
warnings.warn(
"annofabapi.AnnofabApi.update_organization() is deprecated and will be removed.",
FutureWarning,
stacklevel=2,
)
url_path = f"/my/organizations"
url_path = f"/my/messages/{message_id}/opened"
http_method = "PUT"
keyword_params: Dict[str, Any] = {
"request_body": request_body,
Expand All @@ -1190,7 +1241,7 @@ def create_new_organization(self, request_body: Optional[Any] = None, **kwargs)
authorizations: Everyone
組織を作成します。 リクエストボディの`price_plan`には、`free`のみ指定できます。 ビジネスプランの組織を作成する場合は、[セールスチーム](https://annofab.com/docs/forms/contact-sales.html)までお問い合わせください。 既に存在する組織名をリクエストボディに指定すると、400エラーが発生します。
組織を作成します。 既に存在する組織名をリクエストボディに指定すると、400エラーが発生します。
Args:
request_body (Any): Request Body
Expand Down
78 changes: 57 additions & 21 deletions annofabapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2721,6 +2721,27 @@ class DefaultAnnotationType(Enum):
"""

GetMyMessagesResponse = Dict[str, Any]
"""
自分に届いているユーザー通知の取得結果です。
Kyes of Dict
* values: List[MyNotificationMessage]
* opened: int
開封済みの通知メッセージの数。 over_limitがtrueの場合、メッセージのタイムスタンプが新しい順から10000件のメッセージをもとに集計される
* total: int
通知メッセージの総数
* page: int
messagesに含まれる通知メッセージが何ページ目のものか
* page_total: int
ページ数の総数
* over_limit: bool
通知メッセージの取得上限を超えているか
"""


class GraphType(Enum):
"""
Expand Down Expand Up @@ -2865,7 +2886,7 @@ class InputDataOrder(Enum):
* input_data_type: InputDataType
* private_storage_arn: str
AWS IAMロール。ビジネスプランでのS3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。
AWS IAMロール。S3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。
* updated_datetime: str
入力データセットの最終更新日時
Expand Down Expand Up @@ -3609,6 +3630,27 @@ class Lang(Enum):
"""

MyNotificationMessage = Dict[str, Any]
"""
自分への通知メッセージの情報です。
Kyes of Dict
* message_id: str
通知メッセージID。[値の制約についてはこちら。](#section/API-Convention/APIID)
* title: str
メッセージ通知のタイトル
* body: str
メッセージ通知の本文
* content_type: str
メッセージのコンテンツタイプ。 メッセージを表示する際のマークアップのヒントとして使われることを想定しています。
* opened: bool
自身がメッセージを開封したか(開封済みの場合true)
* timestamp: str
最後に通知メッセージ内容を更新した日時。更新がない場合はメッセージ作成日時
"""

MyOrganization = Dict[str, Any]
"""
Expand Down Expand Up @@ -3951,8 +3993,6 @@ class OrganizationMemberStatus(Enum):
組織名。[値の制約についてはこちら。](#section/API-Convention/APIID)
* organization_email: str
メールアドレス
* price_plan: PricePlan
"""

Expand Down Expand Up @@ -4326,7 +4366,7 @@ class PricePlan(Enum):
* sampling_acceptance_rate: int
抜取受入率[%]。未指定の場合は100%として扱う。
* private_storage_aws_iam_role_arn: str
AWS IAMロール。ビジネスプランでのS3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。
AWS IAMロール。S3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。
* plugin_id: str
プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID)
* custom_task_assignment_plugin_id: str
Expand Down Expand Up @@ -4730,7 +4770,7 @@ class ProjectStatus(Enum):
* input_data_type: InputDataType
* private_storage_arn: str
AWS IAMロール。ビジネスプランでのS3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。
AWS IAMロール。S3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。
* last_updated_datetime: str
新規作成時は未指定、更新時は必須(更新前の日時)
Expand Down Expand Up @@ -4783,6 +4823,17 @@ class ProjectStatus(Enum):
"""

PutMyNotificationMessageOpenedRequest = Dict[str, Any]
"""
Kyes of Dict
* opened: bool
メッセージの開封状態に対するアクション。 trueが指定された場合は開封済みの状態、falseが指定された場合は未開封の状態にします。
"""

PutOrganizationMemberRoleRequest = Dict[str, Any]
"""
Expand Down Expand Up @@ -5829,21 +5880,6 @@ class TaskStatus(Enum):
"""

UpdateOrganizationNameRequest = Dict[str, Any]
"""
Kyes of Dict
* organization_id: str
組織ID。[値の制約についてはこちら。](#section/API-Convention/APIID)
* organization_name: str
組織名。[値の制約についてはこちら。](#section/API-Convention/APIID)
* last_updated_datetime: str
新規作成時は未指定、更新時は必須(更新前の日時)
"""

UsageStatus = Dict[str, Any]
"""
利用状況
Expand Down Expand Up @@ -5921,7 +5957,7 @@ class TaskStatus(Enum):
Kyes of Dict
* type: str
ユーザー定義アノテーション種別の型を指定します。 指定可能な値と、その意味は下記の通りです。 * `BoundingBox2d` - 2次元の矩形 * `Polygon2d` - 2次元のポリゴン * `Polyline2d` - 2次元のポリライン * `SinglePoint2d` - 2次元の点 * `SemanticSegmentation2d` - 2次元のセマンティックセグメンテーション * `InstanceSegmentation2d` - 2次元のインスタンスセグメンテーション * `Range1d` - 1次元の範囲 * `Classification` - 全体アノテーション ユーザー定義アノテーション種別の型によって、使用可能なフィールドが決まっています。 ユーザー定義アノテーション種別ごとの、各フィールドの使用可否を下記の表で示します。 |ユーザー定義アノテーション種別の型 | 使用可能なフィールド定義 | |-----------------|:----------:| | BoundingBox2d | MinimumSize2dWithDefaultInsertPosition, VertexCountMinMax, MinimumArea2d, MarginOfErrorTolerance | | Polygon2d | MinimumSize2d, VertexCountMinMax, MinimumArea2d, MarginOfErrorTolerance | | Polyline2d | VertexCountMinMax, DisplayLineDirection, MarginOfErrorTolerance | | SinglePoint2d | MarginOfErrorTolerance | | SemanticSegmentation2d | AnnotationEditorFeature, MarginOfErrorTolerance | | InstanceSegmentation2d | AnnotationEditorFeature, MarginOfErrorTolerance | | Range1d | MarginOfErrorTolerance | | Classification | MarginOfErrorTolerance |
ユーザー定義アノテーション種別の型を指定します。 指定可能な値と、その意味は下記の通りです。 * `BoundingBox2d` - 2次元の矩形 * `Polygon2d` - 2次元のポリゴン * `Polyline2d` - 2次元のポリライン * `SinglePoint2d` - 2次元の点 * `SemanticSegmentation2d` - 2次元のセマンティックセグメンテーション * `InstanceSegmentation2d` - 2次元のインスタンスセグメンテーション * `Range1d` - 1次元の範囲 * `Classification` - 全体アノテーション * `Unknown` - その他のアノテーション種別 下記のフィールド定義は、すべてのアノテーション種別の型に対して使用可能です。 * `OneIntegerField` * `OneStringField` * `OneBooleanField` その他のフィールド定義は、使用可能なアノテーション種別の型に制限があります。 ユーザー定義アノテーション種別の型ごとの、使用可能なフィールド定義を下記の表で示します。 |ユーザー定義アノテーション種別の型 | 使用可能なフィールド定義 | |-----------------|:----------:| | BoundingBox2d | MinimumSize2dWithDefaultInsertPosition, VertexCountMinMax, MinimumArea2d, MarginOfErrorTolerance | | Polygon2d | MinimumSize2d, VertexCountMinMax, MinimumArea2d, MarginOfErrorTolerance | | Polyline2d | VertexCountMinMax, DisplayLineDirection, MarginOfErrorTolerance | | SinglePoint2d | MarginOfErrorTolerance | | SemanticSegmentation2d | AnnotationEditorFeature, MarginOfErrorTolerance | | InstanceSegmentation2d | AnnotationEditorFeature, MarginOfErrorTolerance | | Range1d | MarginOfErrorTolerance | | Classification | MarginOfErrorTolerance | | Unknown | - |
"""

Expand Down

0 comments on commit a78179f

Please sign in to comment.