Skip to content

Commit

Permalink
Annofab v0.125.0対応。統計APIの新規追加と廃止予定 (#366)
Browse files Browse the repository at this point in the history
* update swagger

* update

* update

* 廃止予定を追加

* add wrapper

* add

* decoratorを追加

* update test

* 不要なテストメソッドの追加

* update docstring

* update test

* version up
  • Loading branch information
yuji38kwmt committed Nov 6, 2021
1 parent 0a293b5 commit bfaa505
Show file tree
Hide file tree
Showing 9 changed files with 901 additions and 27 deletions.
2 changes: 1 addition & 1 deletion annofabapi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.49.0"
__version__ = "0.50.0"
201 changes: 196 additions & 5 deletions annofabapi/generated_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2370,10 +2370,41 @@ def put_project_member(
# NOTE: This method is auto generated by OpenAPI Generator
#########################################

def get_account_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
def get_account_daily_statistics(
self, project_id: str, query_params: Optional[Dict[str, Any]] = None, **kwargs
) -> Tuple[Any, requests.Response]:
"""ユーザー別タスク集計取得
https://annofab.com/docs/api/#operation/getAccountDailyStatistics
authorizations: AllProjectMember
指定した期間の [ユーザー別タスク集計データ](#section/ArrayOfProjectAccountStatistics) を取得できるAPI。取得期間は最大3か月です。
Args:
project_id (str): プロジェクトID (required)
query_params (Dict[str, Any]): Query Parameters
_from (str): 取得する統計の区間の開始日 - `YYYY-MM-DD` (required)
to (str): 取得する統計の区間の終了日 - `YYYY-MM-DD` 。この日は含まれます。 (required)
Returns:
Tuple[List[ProjectAccountStatistics], requests.Response]
"""
url_path = f"/projects/{project_id}/statistics/accounts/daily"
http_method = "GET"
keyword_params: Dict[str, Any] = {
"query_params": query_params,
}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_account_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
"""ユーザー別タスク集計ファイルへのURL取得
https://annofab.com/docs/api/#operation/getAccountStatistics
.. deprecated:: X
authorizations: AllProjectMember
Expand All @@ -2388,15 +2419,47 @@ def get_account_statistics(self, project_id: str, **kwargs) -> Tuple[Any, reques
"""
warnings.warn("deprecated", FutureWarning)
url_path = f"/projects/{project_id}/statistics/accounts"
http_method = "GET"
keyword_params: Dict[str, Any] = {}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_inspection_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
def get_inspection_daily_statistics(
self, project_id: str, query_params: Optional[Dict[str, Any]] = None, **kwargs
) -> Tuple[Any, requests.Response]:
"""検査コメント集計取得
https://annofab.com/docs/api/#operation/getInspectionDailyStatistics
authorizations: AllProjectMember
指定した期間の [検査コメント集計データ](#section/ArrayOfInspectionStatistics) を取得できるAPI。取得期間は最大3か月です。
Args:
project_id (str): プロジェクトID (required)
query_params (Dict[str, Any]): Query Parameters
_from (str): 取得する統計の区間の開始日 - `YYYY-MM-DD` (required)
to (str): 取得する統計の区間の終了日 - `YYYY-MM-DD` 。この日は含まれます。 (required)
Returns:
Tuple[List[InspectionStatistics], requests.Response]
"""
url_path = f"/projects/{project_id}/statistics/inspections/daily"
http_method = "GET"
keyword_params: Dict[str, Any] = {
"query_params": query_params,
}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_inspection_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
"""検査コメント集計ファイルへのURL取得
https://annofab.com/docs/api/#operation/getInspectionStatistics
.. deprecated:: X
authorizations: AllProjectMember
Expand All @@ -2411,6 +2474,7 @@ def get_inspection_statistics(self, project_id: str, **kwargs) -> Tuple[Any, req
"""
warnings.warn("deprecated", FutureWarning)
url_path = f"/projects/{project_id}/statistics/inspections"
http_method = "GET"
keyword_params: Dict[str, Any] = {}
Expand Down Expand Up @@ -2462,10 +2526,71 @@ def get_markers(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response
keyword_params: Dict[str, Any] = {}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_task_phase_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
def get_phase_daily_statistics(
self, project_id: str, query_params: Optional[Dict[str, Any]] = None, **kwargs
) -> Tuple[Any, requests.Response]:
"""フェーズ別タスク集計取得
https://annofab.com/docs/api/#operation/getPhaseDailyStatistics
authorizations: AllProjectMember
指定した期間の [フェーズ別タスク集計データ](#section/ArrayOfTaskPhaseStatistics) を取得できるAPI。取得期間は最大3か月です。
Args:
project_id (str): プロジェクトID (required)
query_params (Dict[str, Any]): Query Parameters
_from (str): 取得する統計の区間の開始日 - `YYYY-MM-DD` (required)
to (str): 取得する統計の区間の終了日 - `YYYY-MM-DD` 。この日は含まれます。 (required)
Returns:
Tuple[List[TaskPhaseStatistics], requests.Response]
"""
url_path = f"/projects/{project_id}/statistics/task-phases/daily"
http_method = "GET"
keyword_params: Dict[str, Any] = {
"query_params": query_params,
}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_task_daily_statistics(
self, project_id: str, query_params: Optional[Dict[str, Any]] = None, **kwargs
) -> Tuple[Any, requests.Response]:
"""タスク集計取得
https://annofab.com/docs/api/#operation/getTaskDailyStatistics
authorizations: AllProjectMember
指定した期間の [タスク集計データ](#section/ArrayOfProjectTaskStatisticsHistory) を取得できるAPI。取得期間は最大3か月です。
Args:
project_id (str): プロジェクトID (required)
query_params (Dict[str, Any]): Query Parameters
_from (str): 取得する統計の区間の開始日 - `YYYY-MM-DD` (required)
to (str): 取得する統計の区間の終了日 - `YYYY-MM-DD` 。この日は含まれます。 (required)
Returns:
Tuple[List[ProjectTaskStatisticsHistory], requests.Response]
"""
url_path = f"/projects/{project_id}/statistics/tasks/daily"
http_method = "GET"
keyword_params: Dict[str, Any] = {
"query_params": query_params,
}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_task_phase_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
"""フェーズ別タスク集計ファイルへのURL取得
https://annofab.com/docs/api/#operation/getTaskPhaseStatistics
.. deprecated:: X
authorizations: AllProjectMember
Expand All @@ -2480,15 +2605,17 @@ def get_task_phase_statistics(self, project_id: str, **kwargs) -> Tuple[Any, req
"""
warnings.warn("deprecated", FutureWarning)
url_path = f"/projects/{project_id}/statistics/task-phases"
http_method = "GET"
keyword_params: Dict[str, Any] = {}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_task_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
"""タスク集計取得
"""タスク集計ファイルへのURL取得
https://annofab.com/docs/api/#operation/getTaskStatistics
.. deprecated:: X
authorizations: AllProjectMember
Expand All @@ -2503,15 +2630,78 @@ def get_task_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.
"""
warnings.warn("deprecated", FutureWarning)
url_path = f"/projects/{project_id}/statistics/tasks"
http_method = "GET"
keyword_params: Dict[str, Any] = {}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_worktime_daily_statistics(
self, project_id: str, query_params: Optional[Dict[str, Any]] = None, **kwargs
) -> Tuple[Any, requests.Response]:
"""プロジェクト単位のフェーズ別タスク集計取得
https://annofab.com/docs/api/#operation/getWorktimeDailyStatistics
authorizations: AllProjectMember
指定したプロジェクトのタスク作業時間集計データを指定した期間分取得できるAPI。取得期間は最大3か月です。
Args:
project_id (str): プロジェクトID (required)
query_params (Dict[str, Any]): Query Parameters
_from (str): 取得する統計の区間の開始日 - `YYYY-MM-DD` (required)
to (str): 取得する統計の区間の終了日 - `YYYY-MM-DD` 。この日は含まれます。 (required)
Returns:
Tuple[WorktimeStatisticsByProject, requests.Response]
"""
url_path = f"/projects/{project_id}/statistics/worktimes/daily"
http_method = "GET"
keyword_params: Dict[str, Any] = {
"query_params": query_params,
}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_worktime_daily_statistics_by_account(
self, project_id: str, account_id: str, query_params: Optional[Dict[str, Any]] = None, **kwargs
) -> Tuple[Any, requests.Response]:
"""プロジェクトメンバー単位のフェーズ別タスク集計取得
https://annofab.com/docs/api/#operation/getWorktimeDailyStatisticsByAccount
authorizations: AllProjectMember
指定したプロジェクトメンバーのタスク作業時間集計データを指定した期間分取得できるAPI。取得期間は最大3か月です。
Args:
project_id (str): プロジェクトID (required)
account_id (str): アカウントID (required)
query_params (Dict[str, Any]): Query Parameters
_from (str): 取得する統計の区間の開始日 - `YYYY-MM-DD` (required)
to (str): 取得する統計の区間の終了日 - `YYYY-MM-DD` 。この日は含まれます。 (required)
Returns:
Tuple[WorktimeStatisticsByAccount, requests.Response]
"""
url_path = f"/projects/{project_id}/statistics/worktimes-by-account/{account_id}/daily"
http_method = "GET"
keyword_params: Dict[str, Any] = {
"query_params": query_params,
}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_worktime_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
"""タスク作業時間集計取得
"""タスク作業時間集計ファイルへのURL取得
https://annofab.com/docs/api/#operation/getWorktimeStatistics
.. deprecated:: X
authorizations: AllProjectMember
Expand All @@ -2526,6 +2716,7 @@ def get_worktime_statistics(self, project_id: str, **kwargs) -> Tuple[Any, reque
"""
warnings.warn("deprecated", FutureWarning)
url_path = f"/projects/{project_id}/statistics/worktimes"
http_method = "GET"
keyword_params: Dict[str, Any] = {}
Expand Down
45 changes: 45 additions & 0 deletions annofabapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4678,6 +4678,51 @@ class WebhookStatus(Enum):
"""

WorktimeStatisticsByAccount = Dict[str, Any]
"""
Kyes of Dict
* project_id: str
プロジェクトID。[値の制約についてはこちら。](#section/API-Convention/APIID)
* account_id: str
* data_series: List[WorktimeStatisticsData]
プロジェクトメンバーの日毎の作業時間統計データ
"""

WorktimeStatisticsByProject = Dict[str, Any]
"""
Kyes of Dict
* project_id: str
プロジェクトID。[値の制約についてはこちら。](#section/API-Convention/APIID)
* data_series: List[WorktimeStatisticsData]
プロジェクトの日毎の作業時間統計データ
"""

WorktimeStatisticsData = Dict[str, Any]
"""
Kyes of Dict
* date: str
* grouped_by_input: List[WorktimeStatisticsItem]
ユーザごとの画像1個当たりの作業時間情報(動画プロジェクトの場合は空リスト)
* grouped_by_task: List[WorktimeStatisticsItem]
ユーザごとのタスク1個当たりの作業時間情報(動画プロジェクトの場合は空リスト)
* grouped_by_minute: List[WorktimeStatisticsItem]
ユーザごとの動画1分当たりの作業時間情報(画像プロジェクトの場合は空リスト)
"""

WorktimeStatisticsItem = Dict[str, Any]
"""
Expand Down

0 comments on commit bfaa505

Please sign in to comment.