diff --git a/annofabapi/dataclass/annotation_specs.py b/annofabapi/dataclass/annotation_specs.py index a755b27f..5e82e2de 100644 --- a/annofabapi/dataclass/annotation_specs.py +++ b/annofabapi/dataclass/annotation_specs.py @@ -280,7 +280,7 @@ class AnnotationEditorFeature(DataClassJsonMixin): """塗りつぶしの「矩形」機能が使えるか否か""" polygon_fill: bool - """塗りつぶしの「ポリゴン」機能が使えるか否か""" + """塗りつぶしの「自由形状」機能が使えるか否か""" fill_near: bool """「近似色塗りつぶし」機能を有効にするかどうか""" diff --git a/annofabapi/dataclass/job.py b/annofabapi/dataclass/job.py deleted file mode 100644 index ad9b94a4..00000000 --- a/annofabapi/dataclass/job.py +++ /dev/null @@ -1,49 +0,0 @@ -# ruff: noqa: E501 -# pylint: disable=too-many-lines,trailing-whitespace - -""" -annofabapiのmodelをDataClassで定義したクラス - -Note: - このファイルはopenapi-generatorで自動生成される。詳細は generate/README.mdを参照. - oneOf, allOfなどは正しく表現できない可能性がある。 -""" - -from dataclasses import dataclass -from typing import Any, Optional # pylint: disable=unused-import - -from dataclasses_json import DataClassJsonMixin - -from annofabapi.models import Errors, JobStatus, ProjectJobType - - -@dataclass -class ProjectJobInfo(DataClassJsonMixin): - """ """ - - project_id: str - """プロジェクトID。[値の制約についてはこちら。](#section/API-Convention/APIID) """ - - job_type: ProjectJobType - """""" - - job_id: str - """ジョブID。[値の制約についてはこちら。](#section/API-Convention/APIID) """ - - job_status: JobStatus - """""" - - job_execution: Optional[dict[str, Any]] - """ジョブの内部情報""" - - job_detail: Optional[dict[str, Any]] - """ジョブ結果の内部情報""" - - errors: Errors - """""" - - created_datetime: str - """作成日時""" - - updated_datetime: str - """更新日時""" diff --git a/annofabapi/dataclass/project.py b/annofabapi/dataclass/project.py deleted file mode 100644 index 5d59343c..00000000 --- a/annofabapi/dataclass/project.py +++ /dev/null @@ -1,120 +0,0 @@ -# ruff: noqa: E501 -# pylint: disable=too-many-lines,trailing-whitespace - -""" -annofabapiのmodelをDataClassで定義したクラス - -Note: - このファイルはopenapi-generatorで自動生成される。詳細は generate/README.mdを参照. - oneOf, allOfなどは正しく表現できない可能性がある。 -""" - -from dataclasses import dataclass -from typing import Optional # pylint: disable=unused-import - -from dataclasses_json import DataClassJsonMixin - -from annofabapi.models import AssigneeRuleOfResubmittedTask, InputDataType, ProjectStatus, TaskAssignmentProperty, TaskAssignmentType - - -@dataclass -class ProjectSummary(DataClassJsonMixin): - """ - プロジェクトのサマリー情報 - """ - - last_tasks_updated_datetime: Optional[str] - """タスクの最終更新日時""" - - -@dataclass -class ProjectConfiguration(DataClassJsonMixin): - """ - プロジェクトの設定情報 - """ - - number_of_inspections: Optional[int] - """検査回数。 * 0回:教師付け -> 受入 * 1回:教師付け -> 検査 -> 受入 * n回(n >= 2):教師付け -> 検査1 -> ... -> 検査n -> 受入 """ - - assignee_rule_of_resubmitted_task: Optional[AssigneeRuleOfResubmittedTask] - """""" - - task_assignment_type: Optional[TaskAssignmentType] - """""" - - task_assignment_property: Optional[TaskAssignmentProperty] - """""" - - max_tasks_per_member: Optional[int] - """保留中のタスクを除き、1人(オーナー以外)に割り当てられるタスク数の上限。 """ - - max_tasks_per_member_including_hold: Optional[int] - """保留中のタスクを含めて、1人(オーナー以外)に割り当てられるタスク数上限の保留分。 割り当て時の上限チェックは、max_tasks_per_memberとこの数字の合計で行われます。 例えばmax_tasks_per_memberが10、max_tasks_per_member_including_holdが20の場合、保留中を含むタスク数の割り当て上限は30になります。 """ - - input_data_set_id_list: Optional[list[str]] - """システム内部用のプロパティ。 [putProject](#operation/putProject) APIでプロジェクトを更新する際は、[getProject](#operation/getProject) APIで取得した値を指定してください。 """ - - input_data_max_long_side_length: Optional[int] - """入力データ画像の長辺の最大値(未指定時は4096px)。 画像をアップロードすると、長辺がこの値になるように画像が自動で圧縮されます。 アノテーションの座標は、もとの解像度の画像でつけたものに復元されます。 大きな数値を設定すると入力データ画像のサイズが大きくなり、生産性低下やブラウザで画像を表示できない懸念があります。注意して設定してください。 """ - - sampling_inspection_rate: Optional[int] - """抜取検査率[%]。未指定の場合は100%として扱う。""" - - sampling_acceptance_rate: Optional[int] - """抜取受入率[%]。未指定の場合は100%として扱う。""" - - private_storage_aws_iam_role_arn: Optional[str] - """AWS IAMロール。S3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。 """ - - plugin_id: Optional[str] - """プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID) """ - - custom_task_assignment_plugin_id: Optional[str] - """プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID) """ - - custom_specs_plugin_id: Optional[str] - """プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID) """ - - extended_specs_plugin_id: Optional[str] - """プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID) """ - - editor_version: Optional[str] - """標準アノテーションエディタのバージョン。 * `stable` * 安定版。通常はこちらを利用してください。 * `preview` * 最新版。新機能やUI変更の先行リリース版。 プロジェクト更新時に未指定の場合は `stable` が指定されたものとみなします。 """ - - use_beginner_navigation: Optional[bool] - """true の場合、プロジェクトの画面でナビゲーションUIを表示します(ログインユーザーがプロジェクトオーナーの場合のみ)。 """ - - -@dataclass -class Project(DataClassJsonMixin): - """ """ - - project_id: str - """プロジェクトID。[値の制約についてはこちら。](#section/API-Convention/APIID) """ - - organization_id: str - """組織ID。[値の制約についてはこちら。](#section/API-Convention/APIID) """ - - title: str - """プロジェクトのタイトル""" - - overview: Optional[str] - """プロジェクトの概要""" - - project_status: ProjectStatus - """""" - - input_data_type: InputDataType - """""" - - configuration: ProjectConfiguration - """""" - - created_datetime: str - """作成日時""" - - updated_datetime: str - """更新日時""" - - summary: ProjectSummary - """""" diff --git a/annofabapi/dataclass/task.py b/annofabapi/dataclass/task.py index d1116076..60d6116f 100644 --- a/annofabapi/dataclass/task.py +++ b/annofabapi/dataclass/task.py @@ -116,5 +116,5 @@ class Task(DataClassJsonMixin): sampling: Optional[str] """検査抜取検査/抜取受入によって、どのフェーズがスキップされたか * `inspection_skipped` - 抜取検査の対象外となり、検査フェーズがスキップされた * `inspection_stages_skipped` - 抜取検査の対象外となり、検査フェーズのステージの一部がスキップされた * `acceptance_skipped` - 抜取受入の対象外となり、受入フェーズがスキップされた * `inspection_and_acceptance_skipped` - 抜取検査・抜取受入の対象外となり、検査・受入フェーズがスキップされた 未指定ならば、どのフェーズもスキップされていません。 """ - metadata: Optional[dict[str, dict[str, Any]]] + metadata: Optional[dict[str, Any]] """ユーザーが自由に登録できるkey-value型のメタデータです。 keyにはメタデータ名、valueには値を指定してください。 keyに指定できる文字種は次の通りです。 * 半角英数字 * `_` (アンダースコア) * `-` (ハイフン) valueに指定できる値は次の通りです。 * 文字列 * 数値 * 真偽値 """ diff --git a/annofabapi/generated_api.py b/annofabapi/generated_api.py index 603dbec1..f18a74bd 100644 --- a/annofabapi/generated_api.py +++ b/annofabapi/generated_api.py @@ -1,6 +1,3 @@ -# ruff: noqa: E501, ANN401 -# pylint: disable=too-many-lines,trailing-whitespace - """ AbstractAnnofabApiのヘッダ部分 @@ -1446,6 +1443,89 @@ def put_organization(self, organization_name: str, request_body: Optional[Any] = keyword_params.update(**kwargs) return self._request_wrapper(http_method, url_path, **keyword_params) + ######################################### + # Public Method : AfOrganizationIdpApi + # NOTE: This method is auto generated by OpenAPI Generator + ######################################### + + def delete_organization_idp(self, organization_name: str, id: str, **kwargs) -> tuple[Any, requests.Response]: + """組織のIDプロバイダーを削除 + https://annofab.com/docs/api/#operation/deleteOrganizationIdp + + + authorizations: OrganizationAdministrator, OrganizationOwner + + + 組織のIDプロバイダーを削除します。 **このAPIは Annofab に許可された組織だけで使用できます。また、予告なく変更されることがあります。** + + Args: + organization_name (str): 組織名 (required) + id (str): (required) + + Returns: + tuple[OrganizationOidcIdp, requests.Response] + + + """ + url_path = f"/organizations/{organization_name}/id-providers/{id}" + http_method = "DELETE" + keyword_params: dict[str, Any] = {} + keyword_params.update(**kwargs) + return self._request_wrapper(http_method, url_path, **keyword_params) + + def get_organization_idp_list(self, organization_name: str, **kwargs) -> tuple[Any, requests.Response]: + """組織のIDプロバイダー一覧取得 + https://annofab.com/docs/api/#operation/getOrganizationIdpList + + + authorizations: AllOrganizationMember + + + 組織のIDプロバイダー一覧を取得します。 2024/10現在、一つの組織が持つことのできるIDプロバイダーは1つのみです。 **このAPIは Annofab に許可された組織だけで使用できます。また、予告なく変更されることがあります。** + + Args: + organization_name (str): 組織名 (required) + + Returns: + tuple[list[OrganizationOidcIdp], requests.Response] + + + """ + url_path = f"/organizations/{organization_name}/id-providers" + http_method = "GET" + keyword_params: dict[str, Any] = {} + keyword_params.update(**kwargs) + return self._request_wrapper(http_method, url_path, **keyword_params) + + def put_organization_idp(self, organization_name: str, id: str, request_body: Optional[Any] = None, **kwargs) -> tuple[Any, requests.Response]: + """組織のIDプロバイダーを作成・更新 + https://annofab.com/docs/api/#operation/putOrganizationIdp + + + authorizations: OrganizationAdministrator, OrganizationOwner + + + 組織のIDプロバイダーを作成または更新します。 2024/10現在、一つの組織が持つことのできるIDプロバイダーは1つのみです。 **このAPIは Annofab に許可された組織だけで使用できます。また、予告なく変更されることがあります。** + + Args: + organization_name (str): 組織名 (required) + id (str): (required) + request_body (Any): Request Body + put_organization_idp_body (PutOrganizationIdpBody): (required) + + Returns: + tuple[OrganizationOidcIdp, requests.Response] + + + """ + url_path = f"/organizations/{organization_name}/id-providers/{id}" + http_method = "PUT" + keyword_params: dict[str, Any] = { + "request_body": request_body, + } + keyword_params.update(**kwargs) + return self._request_wrapper(http_method, url_path, **keyword_params) + ######################################### # Public Method : AfOrganizationInputApi # NOTE: This method is auto generated by OpenAPI Generator diff --git a/annofabapi/generated_api2.py b/annofabapi/generated_api2.py index 019b3c17..253e7c8d 100644 --- a/annofabapi/generated_api2.py +++ b/annofabapi/generated_api2.py @@ -1,6 +1,3 @@ -# ruff: noqa: E501, ANN401 -# pylint: disable=too-many-lines,trailing-whitespace - """ AbstractAnnofabApi2のヘッダ部分 diff --git a/annofabapi/models.py b/annofabapi/models.py index eba18bcc..83e77887 100644 --- a/annofabapi/models.py +++ b/annofabapi/models.py @@ -1,6 +1,3 @@ -# ruff: noqa: E501, W293, W291 -# pylint: disable=too-many-lines,trailing-whitespace - """ annofabapiのmodel(swagger.yamlの ``components.schemes`` ) enumならば列挙体として定義する。 @@ -617,6 +614,27 @@ class AdditionalDataDefinitionType(Enum): """ +AllOidcEndpoints = dict[str, Any] +""" +OIDCエンドポイント + +Kyes of dict + +* type: str + +* issuer: str + RFC 8414で定義されるissuerの値。 `.well-known/openid-configuration`のissuer。 +* authorize_url: str + RFC 8414(及びRFC6749)で定義される、authorization_endpointのURL +* token_url: str + RFC 8414(及びRFC6749)で定義される、token_endpointのURL +* userinfo_url: str + OpenID Connect Core 1.0で定義される、UserInfo EndpointのURL +* jwks_url: str + RFC 8414で定義される、jwks_uriの値 + +""" + class AnnotationDataHoldingType(Enum): """ @@ -926,7 +944,7 @@ class AnnotationDataHoldingType(Enum): * rectangle_fill: bool 塗りつぶしの「矩形」機能が使えるか否か * polygon_fill: bool - 塗りつぶしの「ポリゴン」機能が使えるか否か + 塗りつぶしの「自由形状」機能が使えるか否か * fill_near: bool 「近似色塗りつぶし」機能を有効にするかどうか @@ -2414,6 +2432,25 @@ class DefaultAnnotationType(Enum): """ +ExternalIdpDeterminant = dict[str, Any] +""" + + +Kyes of dict + +* type: str + +* name: str + +* organization_name: str + 組織名。[値の制約についてはこちら。](#section/API-Convention/APIID) +* provider_id: str + 組織IDプロバイダーのID。[値の制約についてはこちら。](#section/API-Convention/APIID) +* user_id: str + ユーザーID。[値の制約についてはこちら。](#section/API-Convention/APIID) + +""" + FullAnnotation = dict[str, Any] """ @@ -2722,6 +2759,19 @@ class DefaultAnnotationType(Enum): """ +GlobalIdpNameDeterminant = dict[str, Any] +""" +Annofab全体で利用するIDプロバイダー名を元に外部IDプロバイダーを特定する決定因子 + +Kyes of dict + +* type: str + +* name: str + + +""" + class GraphType(Enum): """ @@ -3359,6 +3409,113 @@ class InspectionSummary(Enum): """ +IssuerOnlyOidcEndpoints = dict[str, Any] +""" +OIDCエンドポイント + +Kyes of dict + +* type: str + +* issuer: str + RFC 8414で定義されるissuerの値。 `.well-known/openid-configuration`のissuer。 + +""" + +JobDetail = dict[str, Any] +""" +ジョブ結果の内部情報 + +Kyes of dict + +* request: ProjectCopyRequest + +* generated_task_count: int + +* src_organization_id: str + +* dest_organization_id: str + +* src_input_data_set_id: str + +* dest_input_data_set_id: str + +* webhook: Webhook + +* message: str + +* replaced_body: str + + +""" + +JobDetailCopyProject = dict[str, Any] +""" + + +Kyes of dict + +* request: ProjectCopyRequest + + +""" + +JobDetailGenInputs = dict[str, Any] +""" + + +Kyes of dict + +* request: InputDataRequest + + +""" + +JobDetailGenTasks = dict[str, Any] +""" + + +Kyes of dict + +* request: TaskGenerateRequest + +* generated_task_count: int + + +""" + +JobDetailInvokeHook = dict[str, Any] +""" + + +Kyes of dict + +* webhook: Webhook + +* message: str + +* replaced_body: str + + +""" + +JobDetailMoveProject = dict[str, Any] +""" + + +Kyes of dict + +* src_organization_id: str + +* dest_organization_id: str + +* src_input_data_set_id: str + +* dest_input_data_set_id: str + + +""" + class JobStatus(Enum): """ @@ -3634,8 +3791,8 @@ class Lang(Enum): * job_execution: __DictStrKeyAnyValue__ ジョブの内部情報 -* job_detail: __DictStrKeyAnyValue__ - ジョブ結果の内部情報 +* job_detail: JobDetail + * errors: Errors * created_datetime: str @@ -3820,6 +3977,40 @@ class Lang(Enum): """ +OidcAttributeMapping = dict[str, Any] +""" +外部IDプロバイダー上の属性と、Annofabが認識する属性のマッピング + +Kyes of dict + +* email: str + Eメールアドレスを表す外部IDプロバイダー上の属性名 +* name: str + ユーザーの表示名を表す外部IDプロバイダー上の属性名 + +""" + +OidcEndpoints = dict[str, Any] +""" + + +Kyes of dict + +* type: str + +* issuer: str + RFC 8414で定義されるissuerの値。 `.well-known/openid-configuration`のissuer。 +* authorize_url: str + RFC 8414(及びRFC6749)で定義される、authorization_endpointのURL +* token_url: str + RFC 8414(及びRFC6749)で定義される、token_endpointのURL +* userinfo_url: str + OpenID Connect Core 1.0で定義される、UserInfo EndpointのURL +* jwks_url: str + RFC 8414で定義される、jwks_uriの値 + +""" + Organization = dict[str, Any] """ @@ -3873,6 +4064,21 @@ class Lang(Enum): * organization: str +""" + +OrganizationIdpIdDeterminant = dict[str, Any] +""" +組織名とIDプロバイダーIDを元に外部IDプロバイダーを特定する決定因子 + +Kyes of dict + +* type: str + +* organization_name: str + 組織名。[値の制約についてはこちら。](#section/API-Convention/APIID) +* provider_id: str + 組織IDプロバイダーのID。[値の制約についてはこちら。](#section/API-Convention/APIID) + """ OrganizationJobInfo = dict[str, Any] @@ -3891,8 +4097,8 @@ class Lang(Enum): * job_execution: __DictStrKeyAnyValue__ ジョブの内部情報 -* job_detail: __DictStrKeyAnyValue__ - ジョブ結果の内部情報 +* job_detail: JobDetail + * errors: Errors * created_datetime: str @@ -3984,6 +4190,35 @@ class OrganizationMemberStatus(Enum): INACTIVE = "inactive" +OrganizationOidcIdp = dict[str, Any] +""" +組織が利用する外部IDプロバイダー設定 + +Kyes of dict + +* id: str + 組織IDプロバイダーのID。[値の制約についてはこちら。](#section/API-Convention/APIID) +* organization_name: str + 組織名。[値の制約についてはこちら。](#section/API-Convention/APIID) +* client_id: str + 外部IDプロバイダーで指定されたクライアントID +* client_secret: str + 外部IDプロバイダーで指定されたクライアントシークレット +* attributes_request_method: str + ユーザー属性を取得する際に利用するリクエストメソッド +* endpoints: OidcEndpoints + +* attribute_mapping: OidcAttributeMapping + +* sign_up_url: str + 組織IDプロバイダーを用いたユーザ登録時、ユーザがアクセスすべきURL +* created_datetime: str + IDプロバイダー設定の作成日時 +* updated_datetime: str + IDプロバイダー設定の更新日時 + +""" + OrganizationPlugin = dict[str, Any] """ @@ -4488,7 +4723,7 @@ class PricePlan(Enum): * input_data_type: InputDataType -* configuration: ProjectConfiguration +* configuration: ProjectConfigurationGet * created_datetime: str 作成日時 @@ -4554,7 +4789,16 @@ class PricePlan(Enum): """ -ProjectConfiguration = dict[str, Any] +ProjectConfigurationGet = dict[str, Any] +""" + + +Kyes of dict + + +""" + +ProjectConfigurationPut = dict[str, Any] """ プロジェクトの設定情報 @@ -4694,8 +4938,8 @@ class PricePlan(Enum): * job_execution: __DictStrKeyAnyValue__ ジョブの内部情報 -* job_detail: __DictStrKeyAnyValue__ - ジョブ結果の内部情報 +* job_detail: JobDetail + * errors: Errors * created_datetime: str @@ -5047,6 +5291,25 @@ class ProjectStatus(Enum): * opened: bool メッセージの開封状態に対するアクション。 trueが指定された場合は開封済みの状態、falseが指定された場合は未開封の状態にします。 +""" + +PutOrganizationIdpBody = dict[str, Any] +""" +組織が利用するIDプロバイダー設定 + +Kyes of dict + +* client_id: str + 外部IDプロバイダーで指定されたクライアントID +* client_secret: str + 外部IDプロバイダーで指定されたクライアントシークレット +* attributes_request_method: str + ユーザー属性を取得する際に利用するリクエストメソッド +* endpoints: OidcEndpoints + +* attribute_mapping: OidcAttributeMapping + + """ PutOrganizationMemberRoleRequest = dict[str, Any] @@ -5108,7 +5371,7 @@ class ProjectStatus(Enum): * organization_name: str プロジェクトの所属組織を変更する場合は、ここに変更先の組織名を指定します。 * 所属組織を変更する前にプロジェクトを停止する必要があります。 * APIを呼び出すアカウントは、変更先組織の管理者またはオーナーである必要があります。 * 変更後の組織に所属していないプロジェクトメンバーも残りますが、作業はできません。あらためて組織に招待してください。 -* configuration: ProjectConfiguration +* configuration: ProjectConfigurationPut * last_updated_datetime: str 新規作成時は未指定、更新時は必須(更新前の日時) @@ -5149,7 +5412,7 @@ class ProjectStatus(Enum): * headers: list[WebhookHeader] Webhookが送信するHTTPリクエストのヘッダー * body: str - Webhookが送信するHTTPリクエストのボディ + Webhookが送信するHTTPリクエストのボディ。methodがGETの場合は指定不可。 * url: str Webhookの送信先URL * created_datetime: str @@ -5753,7 +6016,7 @@ class TaskAssignmentType(Enum): * input_data_type: InputDataType -* configuration: ProjectConfiguration +* configuration: ProjectConfigurationGet * created_datetime: str 作成日時 @@ -6249,6 +6512,19 @@ class TaskStatus(Enum): * label: InternationalizationMessage +""" + +UserIdDeterminant = dict[str, Any] +""" +ユーザーIDを元に外部IDプロバイダーを特定する決定因子。 指定されたユーザが利用すべき外部IDプロバイダーが一つに定まる場合に、その一つを特定する。 + +Kyes of dict + +* type: str + +* user_id: str + ユーザーID。[値の制約についてはこちら。](#section/API-Convention/APIID) + """ ValidationError = dict[str, Any] diff --git a/generate/generate.sh b/generate/generate.sh index 5803aaf7..ea809f65 100755 --- a/generate/generate.sh +++ b/generate/generate.sh @@ -190,6 +190,7 @@ declare -a model_files=(${MODELS_DIR}/keybind.py \ ${MODELS_DIR}/annotation_specs_v2.py \ ${MODELS_DIR}/label_v3.py \ ${MODELS_DIR}/annotation_specs_v3.py \ + ) cat partial-header/dataclass/common.py partial-header/dataclass/annotation_specs.py \ ${model_files[@]} > ../annofabapi/dataclass/annotation_specs.py @@ -205,11 +206,6 @@ declare -a model_files=(${MODELS_DIR}/resolution.py ${MODELS_DIR}/input_data.py) cat partial-header/dataclass/common.py partial-header/dataclass/input.py \ ${model_files[@]} > ../annofabapi/dataclass/input.py -# Job -declare -a model_files=(${MODELS_DIR}/project_job_info.py) -cat partial-header/dataclass/common.py partial-header/dataclass/job.py \ - ${model_files[@]} > ../annofabapi/dataclass/job.py - # Organization declare -a model_files=(${MODELS_DIR}/organization.py) cat partial-header/dataclass/common.py partial-header/dataclass/organization.py \ @@ -220,11 +216,6 @@ declare -a model_files=(${MODELS_DIR}/organization_member.py) cat partial-header/dataclass/common.py partial-header/dataclass/organization_member.py \ ${model_files[@]} > ../annofabapi/dataclass/organization_member.py -# Project -declare -a model_files=(${MODELS_DIR}/project_summary.py ${MODELS_DIR}/project_configuration.py ${MODELS_DIR}/project.py) -cat partial-header/dataclass/common.py partial-header/dataclass/project.py \ - ${model_files[@]} > ../annofabapi/dataclass/project.py - # Project Member declare -a model_files=(${MODELS_DIR}/project_member.py) cat partial-header/dataclass/common.py partial-header/dataclass/project_member.py \ @@ -243,13 +234,13 @@ cat partial-header/dataclass/common.py partial-header/dataclass/task.py \ # `dict(str, int)` を `dict[str, int]`のように置換する sed -E -e "s/dict\((.*)\)/dict\[\1\]/g" ../annofabapi/dataclass/*.py --in-place # Task.metadataなどでは、`__DictStrKeyAnyValue__`を`dict[str, Any]`に置換すると正しい型にならないので、無理やり正しい型に置換する -sed -e "s/Dict\[str, __DictStrKeyAnyValue__\]/dict[str, Any]/g" ../annofabapi/dataclass/*.py --in-place +sed -e "s/dict\[str, __DictStrKeyAnyValue__\]/dict[str, Any]/g" ../annofabapi/dataclass/*.py --in-place # `__DictStrKeyAnyValue__`を`dict[str, Any]`に置換する sed -e "s/__DictStrKeyAnyValue__/dict[str,Any]/g" ../annofabapi/dataclass/*.py --in-place -rm -Rf out/openapi_client +# rm -Rf out/openapi_client cd ../ diff --git a/generate/partial-header/dataclass/job.py b/generate/partial-header/dataclass/job.py deleted file mode 100644 index 6b467bf0..00000000 --- a/generate/partial-header/dataclass/job.py +++ /dev/null @@ -1,2 +0,0 @@ -from annofabapi._utils import deprecated_class -from annofabapi.models import JobStatus, ProjectJobType, Errors \ No newline at end of file diff --git a/generate/partial-header/dataclass/project.py b/generate/partial-header/dataclass/project.py deleted file mode 100644 index 76fcee9d..00000000 --- a/generate/partial-header/dataclass/project.py +++ /dev/null @@ -1 +0,0 @@ -from annofabapi.models import AssigneeRuleOfResubmittedTask, ProjectStatus, InputDataType, TaskAssignmentType, TaskAssignmentProperty diff --git a/generate/partial-header/generated_api_partial_header_v1.py b/generate/partial-header/generated_api_partial_header_v1.py index 8c2acb36..2d7d32fb 100644 --- a/generate/partial-header/generated_api_partial_header_v1.py +++ b/generate/partial-header/generated_api_partial_header_v1.py @@ -1,6 +1,3 @@ -# ruff: noqa: E501, ANN401 -# pylint: disable=too-many-lines,trailing-whitespace - """ AbstractAnnofabApiのヘッダ部分 diff --git a/generate/partial-header/generated_api_partial_header_v2.py b/generate/partial-header/generated_api_partial_header_v2.py index 18e3f812..ee0192a3 100644 --- a/generate/partial-header/generated_api_partial_header_v2.py +++ b/generate/partial-header/generated_api_partial_header_v2.py @@ -1,6 +1,3 @@ -# ruff: noqa: E501, ANN401 -# pylint: disable=too-many-lines,trailing-whitespace - """ AbstractAnnofabApi2のヘッダ部分 diff --git a/generate/partial-header/models_partial_header_v1.py b/generate/partial-header/models_partial_header_v1.py index 9c01d2ee..ffe54f55 100644 --- a/generate/partial-header/models_partial_header_v1.py +++ b/generate/partial-header/models_partial_header_v1.py @@ -1,6 +1,3 @@ -# ruff: noqa: E501, W293, W291 -# pylint: disable=too-many-lines,trailing-whitespace - """ annofabapiのmodel(swagger.yamlの ``components.schemes`` ) enumならば列挙体として定義する。 diff --git a/generate/swagger/swagger-api-components.yaml b/generate/swagger/swagger-api-components.yaml index 2db5ddcd..3c7a6bbc 100644 --- a/generate/swagger/swagger-api-components.yaml +++ b/generate/swagger/swagger-api-components.yaml @@ -1576,7 +1576,7 @@ components: input_data_type: $ref: "#/components/schemas/InputDataType" configuration: - $ref: "#/components/schemas/ProjectConfiguration" + $ref: "#/components/schemas/ProjectConfigurationGet" created_datetime: type: string format: date-time @@ -1607,6 +1607,7 @@ components: 再提出されたタスクの検査/受入担当者の割当方法 * `no_assignee` - 以前の担当者で固定せず、未割当てにします。 * `fixed` - 以前の担当者が再度担当します。以前の担当者がいない(1回目の検査/受入)場合は未割当てになります。 + default: no_assignee InputDataType: type: string description: | @@ -1618,111 +1619,145 @@ components: - image - movie - custom - ProjectConfiguration: + MaxTasksPerMember: + type: integer + description: | + 保留中のタスクを除き、1人(オーナー以外)に割り当てられるタスク数の上限。 + default: 10 + minimum: 1 + maximum: 100 + NumberOfInspections: + type: integer + description: | + 検査回数。 + * 0回:教師付け -> 受入 + * 1回:教師付け -> 検査 -> 受入 + * n回(n >= 2):教師付け -> 検査1 -> ... -> 検査n -> 受入 + default: 0 + minimum: 0 + MaxTasksPerMemberIncludingHold: + type: integer + description: | + 保留中のタスクを含めて、1人(オーナー以外)に割り当てられるタスク数上限の保留分。 + 割り当て時の上限チェックは、max_tasks_per_memberとこの数字の合計で行われます。 + + 例えばmax_tasks_per_memberが10、max_tasks_per_member_including_holdが20の場合、保留中を含むタスク数の割り当て上限は30になります。 + default: 20 + minimum: 1 + maximum: 100 + InputDataSetIdList: + description: | + システム内部用のプロパティ。 + [putProject](#operation/putProject) APIでプロジェクトを更新する際は、[getProject](#operation/getProject) APIで取得した値を指定してください。 + type: array + items: + $ref: "#/components/schemas/InputDataSetId" + example: [] + InputDataMaxLongSideLength: + type: integer + description: | + 入力データ画像の長辺の最大値(未指定時は4096px)。 + + 画像をアップロードすると、長辺がこの値になるように画像が自動で圧縮されます。 + アノテーションの座標は、もとの解像度の画像でつけたものに復元されます。 + + 大きな数値を設定すると入力データ画像のサイズが大きくなり、生産性低下やブラウザで画像を表示できない懸念があります。注意して設定してください。 + minimum: 0 + SamplingInspectionRate: + type: integer + description: 抜取検査率[%]。未指定の場合は100%として扱う。 + minimum: 0 + maximum: 100 + SamplingAcceptanceRate: + type: integer + description: 抜取受入率[%]。未指定の場合は100%として扱う。 + minimum: 0 + maximum: 100 + PrivateStorageAwsIamRoleArn: + type: string + description: | + AWS IAMロール。S3プライベートストレージの認可で使います。 + [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。 + example: "arn:aws:iam::123456789012:role/AnnofabPrivateStorageAccessor" + ProjectConfigurationPluginId: + $ref: "#/components/schemas/PluginId" + description: | + カスタムアノテーションエディタのプラグインID。カスタムプロジェクトの場合は必須です。 + ProjectConfigurationCustomTaskAssignmentPluginId: + $ref: "#/components/schemas/PluginId" + description: | + `task_assignment_type`に`custom`を設定している場合のみ、カスタムタスク割当のプラグインIDを設定してください。 + `custom`以外の場合は空文字とするか、値を設定しないでください。 + ProjectConfigurationCustomSpecsPluginId: + $ref: "#/components/schemas/PluginId" + description: カスタムアノテーション仕様のプラグインID。 + ProjectConfigurationExtendedSpecsPluginId: + $ref: "#/components/schemas/PluginId" + description: アノテーション種類を新しく定義できるようにするためのプラグインID。 + EditorVersion: + type: string + description: | + 標準アノテーションエディタのバージョン。 + + * `stable` + * 安定版。通常はこちらを利用してください。 + * `preview` + * 最新版。新機能やUI変更の先行リリース版。 + + プロジェクト更新時に未指定の場合は `stable` が指定されたものとみなします。 + UseBeginnerNavigation: + type: boolean + description: | + true の場合、プロジェクトの画面でナビゲーションUIを表示します(ログインユーザーがプロジェクトオーナーの場合のみ)。 + default: false + ProjectConfigurationPut: description: プロジェクトの設定情報 type: object properties: number_of_inspections: - description: | - 検査回数。 - * 0回:教師付け -> 受入 - * 1回:教師付け -> 検査 -> 受入 - * n回(n >= 2):教師付け -> 検査1 -> ... -> 検査n -> 受入 - type: integer - default: 0 - minimum: 0 + $ref: "#/components/schemas/NumberOfInspections" assignee_rule_of_resubmitted_task: $ref: "#/components/schemas/AssigneeRuleOfResubmittedTask" - default: no_assignee task_assignment_type: $ref: "#/components/schemas/TaskAssignmentType" task_assignment_property: $ref: "#/components/schemas/TaskAssignmentProperty" max_tasks_per_member: - description: | - 保留中のタスクを除き、1人(オーナー以外)に割り当てられるタスク数の上限。 - type: integer - default: 10 - minimum: 1 - maximum: 100 + $ref: "#/components/schemas/MaxTasksPerMember" max_tasks_per_member_including_hold: - description: | - 保留中のタスクを含めて、1人(オーナー以外)に割り当てられるタスク数上限の保留分。 - 割り当て時の上限チェックは、max_tasks_per_memberとこの数字の合計で行われます。 - - 例えばmax_tasks_per_memberが10、max_tasks_per_member_including_holdが20の場合、保留中を含むタスク数の割り当て上限は30になります。 - type: integer - default: 20 - minimum: 1 - maximum: 100 + $ref: "#/components/schemas/MaxTasksPerMemberIncludingHold" input_data_set_id_list: - description: | - システム内部用のプロパティ。 - [putProject](#operation/putProject) APIでプロジェクトを更新する際は、[getProject](#operation/getProject) APIで取得した値を指定してください。 - type: array - items: - $ref: "#/components/schemas/InputDataSetId" - example: [] + $ref: "#/components/schemas/InputDataSetIdList" input_data_max_long_side_length: - description: | - 入力データ画像の長辺の最大値(未指定時は4096px)。 - - 画像をアップロードすると、長辺がこの値になるように画像が自動で圧縮されます。 - アノテーションの座標は、もとの解像度の画像でつけたものに復元されます。 - - 大きな数値を設定すると入力データ画像のサイズが大きくなり、生産性低下やブラウザで画像を表示できない懸念があります。注意して設定してください。 - type: integer - minimum: 0 + $ref: "#/components/schemas/InputDataMaxLongSideLength" sampling_inspection_rate: - description: 抜取検査率[%]。未指定の場合は100%として扱う。 - type: integer - minimum: 0 - maximum: 100 + $ref: "#/components/schemas/SamplingInspectionRate" sampling_acceptance_rate: - description: 抜取受入率[%]。未指定の場合は100%として扱う。 - type: integer - minimum: 0 - maximum: 100 + $ref: "#/components/schemas/SamplingAcceptanceRate" private_storage_aws_iam_role_arn: - type: string - description: | - AWS IAMロール。S3プライベートストレージの認可で使います。 - [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。 - example: "arn:aws:iam::123456789012:role/AnnofabPrivateStorageAccessor" + $ref: "#/components/schemas/PrivateStorageAwsIamRoleArn" plugin_id: - $ref: "#/components/schemas/PluginId" - description: | - カスタムアノテーションエディタのプラグインID。カスタムプロジェクトの場合は必須です。 + $ref: "#/components/schemas/ProjectConfigurationPluginId" custom_task_assignment_plugin_id: - $ref: "#/components/schemas/PluginId" - description: | - `task_assignment_type`に`custom`を設定している場合のみ、カスタムタスク割当のプラグインIDを設定してください。 - `custom`以外の場合は空文字とするか、値を設定しないでください。 + $ref: "#/components/schemas/ProjectConfigurationCustomTaskAssignmentPluginId" custom_specs_plugin_id: - $ref: "#/components/schemas/PluginId" - description: | - カスタムアノテーション仕様のプラグインID。 + $ref: "#/components/schemas/ProjectConfigurationCustomSpecsPluginId" extended_specs_plugin_id: - $ref: "#/components/schemas/PluginId" - description: | - アノテーション種類を新しく定義できるようにするためのプラグインID。 + $ref: "#/components/schemas/ProjectConfigurationExtendedSpecsPluginId" editor_version: - type: string - description: | - 標準アノテーションエディタのバージョン。 - - * `stable` - * 安定版。通常はこちらを利用してください。 - * `preview` - * 最新版。新機能やUI変更の先行リリース版。 - - プロジェクト更新時に未指定の場合は `stable` が指定されたものとみなします。 + $ref: "#/components/schemas/EditorVersion" use_beginner_navigation: - type: boolean - default: false - description: | - true の場合、プロジェクトの画面でナビゲーションUIを表示します(ログインユーザーがプロジェクトオーナーの場合のみ)。 - + $ref: "#/components/schemas/UseBeginnerNavigation" + ProjectConfigurationGet: + allOf: + - $ref: "#/components/schemas/ProjectConfigurationPut" + - type: object + required: + - number_of_inspections + - assignee_rule_of_resubmitted_task + - task_assignment_type + - input_data_set_id_list + - use_beginner_navigation ProjectSummary: type: object description: プロジェクトのサマリー情報 @@ -1801,8 +1836,7 @@ components: type: object description: ジョブの内部情報 job_detail: - type: object - description: ジョブ結果の内部情報 + $ref: "#/components/schemas/JobDetail" errors: $ref: "#/components/schemas/Errors" description: | @@ -1830,8 +1864,7 @@ components: type: object description: ジョブの内部情報 job_detail: - type: object - description: ジョブ結果の内部情報 + $ref: "#/components/schemas/JobDetail" errors: $ref: "#/components/schemas/Errors" created_datetime: @@ -1941,7 +1974,73 @@ components: description: | ジョブの同時実行制御のために用いる、ジョブの種別。 (現在はまだ、この種別に該当するものはありません) - + JobDetail: + type: object + description: ジョブ結果の内部情報 + discriminator: + propertyName: "_type" + mapping: + GenInputs: '#/components/schemas/JobDetailGenInputs' + GenTasks: '#/components/schemas/JobDetailGenTasks' + CopyProject: '#/components/schemas/JobDetailCopyProject' + MoveProject: '#/components/schemas/JobDetailMoveProject' + InvokeHook: '#/components/schemas/JobDetailInvokeHook' + oneOf: + - $ref: '#/components/schemas/JobDetailGenInputs' + - $ref: '#/components/schemas/JobDetailGenTasks' + - $ref: '#/components/schemas/JobDetailCopyProject' + - $ref: '#/components/schemas/JobDetailMoveProject' + - $ref: '#/components/schemas/JobDetailInvokeHook' + JobDetailGenInputs: + type: object + properties: + request: + $ref: '#/components/schemas/InputDataRequest' + required: + - request + JobDetailGenTasks: + type: object + required: + - request + properties: + request: + $ref: '#/components/schemas/TaskGenerateRequest' + generated_task_count: + type: integer + JobDetailCopyProject: + type: object + required: + - request + properties: + request: + $ref: '#/components/schemas/ProjectCopyRequest' + JobDetailMoveProject: + type: object + required: + - src_organization_id + - dest_organization_id + - src_input_data_set_id + - dest_input_data_set_id + properties: + src_organization_id: + type: string + dest_organization_id: + type: string + src_input_data_set_id: + type: string + dest_input_data_set_id: + type: string + JobDetailInvokeHook: + type: object + required: + - webhook + properties: + webhook: + $ref: '#/components/schemas/Webhook' + message: + type: string + replaced_body: + type: string JobStatus: type: string enum: @@ -2094,7 +2193,7 @@ components: items: $ref: "#/components/schemas/WebhookHeader" body: - description: Webhookが送信するHTTPリクエストのボディ + description: Webhookが送信するHTTPリクエストのボディ。methodがGETの場合は指定不可。 type: string example: '{"message": "{{PROJECT_ID}} is updated at {{COMPLETE_DATETIME}}"}' url: @@ -2183,7 +2282,7 @@ components: * APIを呼び出すアカウントは、変更先組織の管理者またはオーナーである必要があります。 * 変更後の組織に所属していないプロジェクトメンバーも残りますが、作業はできません。あらためて組織に招待してください。 configuration: - $ref: "#/components/schemas/ProjectConfiguration" + $ref: "#/components/schemas/ProjectConfigurationPut" last_updated_datetime: $ref: "#/components/schemas/LastUpdatedDatetime" force_suspend: @@ -4018,7 +4117,7 @@ components: description: 塗りつぶしの「矩形」機能が使えるか否か polygon_fill: type: boolean - description: 塗りつぶしの「ポリゴン」機能が使えるか否か + description: 塗りつぶしの「自由形状」機能が使えるか否か fill_near: type: boolean description: 「近似色塗りつぶし」機能を有効にするかどうか @@ -8330,3 +8429,205 @@ components: _type: type: string enum: ["All"] + OrganizationIdpId: + type: string + description: 組織IDプロバイダーのID。[値の制約についてはこちら。](#section/API-Convention/APIID) + OidcIssuer: + type: string + format: uri + description: RFC 8414で定義されるissuerの値。 `.well-known/openid-configuration`のissuer。 + OidcEndpoints: + oneOf: + - $ref: "#/components/schemas/IssuerOnlyOidcEndpoints" + - $ref: "#/components/schemas/AllOidcEndpoints" + discriminator: + propertyName: "_type" + mapping: + IssuerOnly: "#/components/schemas/IssuerOnlyOidcEndpoints" + All: "#/components/schemas/AllOidcEndpoints" + IssuerOnlyOidcEndpoints: + type: object + description: OIDCエンドポイント + required: + - _type + - issuer + properties: + _type: + type: string + enum: ["IssuerOnly"] + issuer: + $ref: "#/components/schemas/OidcIssuer" + AllOidcEndpoints: + type: object + description: OIDCエンドポイント + required: + - _type + - issuer + - authorize_url + - token_url + - userinfo_url + - jwks_url + properties: + _type: + type: string + enum: ["All"] + issuer: + $ref: "#/components/schemas/OidcIssuer" + authorize_url: + type: string + format: uri + description: RFC 8414(及びRFC6749)で定義される、authorization_endpointのURL + token_url: + type: string + format: uri + description: RFC 8414(及びRFC6749)で定義される、token_endpointのURL + userinfo_url: + type: string + format: uri + description: OpenID Connect Core 1.0で定義される、UserInfo EndpointのURL + jwks_url: + type: string + format: uri + description: RFC 8414で定義される、jwks_uriの値 + OidcAttributeMapping: + type: object + description: 外部IDプロバイダー上の属性と、Annofabが認識する属性のマッピング + required: + - name + - email + properties: + email: + type: string + description: Eメールアドレスを表す外部IDプロバイダー上の属性名 + name: + type: string + description: ユーザーの表示名を表す外部IDプロバイダー上の属性名 + OrganizationOidcIdp: + type: object + description: 組織が利用する外部IDプロバイダー設定 + required: + - id + - organization_name + - client_id + - client_secret + - attributes_request_method + - endpoints + - attribute_mapping + - sign_up_url + - created_datetime + - updated_datetime + properties: + id: + $ref: "#/components/schemas/OrganizationIdpId" + organization_name: + $ref: "#/components/schemas/OrganizationName" + description: 組織IDプロバイダーが所属する組織名 + client_id: + type: string + description: 外部IDプロバイダーで指定されたクライアントID + client_secret: + type: string + description: 外部IDプロバイダーで指定されたクライアントシークレット + attributes_request_method: + type: string + enum: ["GET", "POST"] + description: | + ユーザー属性を取得する際に利用するリクエストメソッド + endpoints: + $ref: "#/components/schemas/OidcEndpoints" + attribute_mapping: + $ref: "#/components/schemas/OidcAttributeMapping" + sign_up_url: + type: string + format: uri + description: | + 組織IDプロバイダーを用いたユーザ登録時、ユーザがアクセスすべきURL + created_datetime: + type: string + format: date-time + description: IDプロバイダー設定の作成日時 + updated_datetime: + type: string + format: date-time + description: IDプロバイダー設定の更新日時 + PutOrganizationIdpBody: + type: object + description: 組織が利用するIDプロバイダー設定 + required: + - client_id + - client_secret + - attributes_request_method + - endpoints + - attribute_mapping + properties: + client_id: + type: string + description: 外部IDプロバイダーで指定されたクライアントID + client_secret: + type: string + description: 外部IDプロバイダーで指定されたクライアントシークレット + attributes_request_method: + type: string + enum: ["GET", "POST"] + description: | + ユーザー属性を取得する際に利用するリクエストメソッド + endpoints: + $ref: "#/components/schemas/OidcEndpoints" + attribute_mapping: + $ref: "#/components/schemas/OidcAttributeMapping" + ExternalIdpDeterminant: + oneOf: + - $ref: "#/components/schemas/GlobalIdpNameDeterminant" + - $ref: "#/components/schemas/OrganizationIdpIdDeterminant" + - $ref: "#/components/schemas/UserIdDeterminant" + discriminator: + propertyName: "_type" + mapping: + GlobalIdpName: "#/components/schemas/GlobalIdpNameDeterminant" + OrganizationIdpId: "#/components/schemas/OrganizationIdpIdDeterminant" + UserId: "#/components/schemas/UserIdDeterminant" + GlobalIdpNameDeterminant: + type: object + description: Annofab全体で利用するIDプロバイダー名を元に外部IDプロバイダーを特定する決定因子 + required: + - _type + - name + properties: + _type: + type: string + enum: ["GlobalIdpName"] + name: + type: string + enum: ["Google"] + OrganizationIdpIdDeterminant: + type: object + description: 組織名とIDプロバイダーIDを元に外部IDプロバイダーを特定する決定因子 + required: + - _type + - organization_name + - provider_id + properties: + _type: + type: string + enum: ["OrganizationIdpId"] + organization_name: + $ref: "#/components/schemas/OrganizationName" + description: 組織名 + provider_id: + $ref: "#/components/schemas/OrganizationIdpId" + description: 組織IDプロバイダーのID + UserIdDeterminant: + type: object + description: ユーザーIDを元に外部IDプロバイダーを特定する決定因子。 指定されたユーザが利用すべき外部IDプロバイダーが一つに定まる場合に、その一つを特定する。 + required: + - _type + - user_id + properties: + _type: + type: string + enum: ["UserId"] + user_id: + $ref: "#/components/schemas/UserId" + description: ユーザーID + + diff --git a/generate/swagger/swagger.v2.yaml b/generate/swagger/swagger.v2.yaml index 5eec97b6..1d02392d 100644 --- a/generate/swagger/swagger.v2.yaml +++ b/generate/swagger/swagger.v2.yaml @@ -115,7 +115,7 @@ info: 上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。 - version: 0.192.0 + version: 0.197.2 title: Annofab Web API x-logo: url: "https://annofab.com/resource/images/logo_landscape.png" diff --git a/generate/swagger/swagger.yaml b/generate/swagger/swagger.yaml index 0b5f31fc..37873d00 100644 --- a/generate/swagger/swagger.yaml +++ b/generate/swagger/swagger.yaml @@ -85,6 +85,7 @@ info: ジョブID | プロジェクト内で一意 入力データセットID | 組織内で一意 プラグインID | 組織内で一意 + 組織IDプロバイダーID | 組織内で一意 パーソナルアクセストークンID | アカウント内で一意 ## 検索結果の集約を表す AggregationResult @@ -117,7 +118,7 @@ info: 上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。 また、AggregationResultの集約の件数は、合計で10000件以下に制限されており、それを超える件数がある場合は上位10000件が取得されます。もし、省略された部分を取得したい場合は、検索条件を縛って結果に上る集約の数を減らしてください。 - version: 0.192.0 + version: 0.197.2 title: Annofab Web API x-logo: url: "https://annofab.com/resource/images/logo_landscape.png" @@ -162,6 +163,12 @@ tags: - name: af-organization x-displayName: Organization description: 組織に対する操作 +- name: af-organization-idp + x-displayName: Organization IdP + description: | + 組織で使用するIDプロバイダーに対する操作 + + **このAPIは Annofab に許可された組織だけで使用できます。また、予告なく変更されることがあります。** - name: af-organization-input x-displayName: Organization Input description: | @@ -332,6 +339,7 @@ x-tagGroups: - af-login - af-my - af-organization + - af-organization-idp - af-organization-input - af-organization-member - af-organization-plugin @@ -3348,6 +3356,135 @@ paths: $ref: "swagger-api-components.yaml#/components/responses/ErrorMissingResource" "503": $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" + /organizations/{organization_name}/id-providers: + get: + operationId: getOrganizationIdpList + summary: 組織のIDプロバイダー一覧取得 + description: | + 組織のIDプロバイダー一覧を取得します。 + 2024/10現在、一つの組織が持つことのできるIDプロバイダーは1つのみです。 + + **このAPIは Annofab に許可された組織だけで使用できます。また、予告なく変更されることがあります。** + tags: + - af-organization-idp + security: + - AllOrganizationMember: [] + parameters: + - name: organization_name + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationName" + description: 組織名 + responses: + "200": + description: 正常 + content: + application/json: + schema: + type: array + items: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationOidcIdp" + "400": + $ref: "swagger-api-components.yaml#/components/responses/ErrorInvalidRequest" + "401": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi" + "404": + $ref: "swagger-api-components.yaml#/components/responses/ErrorMissingResource" + "409": + $ref: "swagger-api-components.yaml#/components/responses/ErrorStateMismatch" + "503": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" + /organizations/{organization_name}/id-providers/{id}: + put: + operationId: putOrganizationIdp + summary: 組織のIDプロバイダーを作成・更新 + description: | + 組織のIDプロバイダーを作成または更新します。 + 2024/10現在、一つの組織が持つことのできるIDプロバイダーは1つのみです。 + + **このAPIは Annofab に許可された組織だけで使用できます。また、予告なく変更されることがあります。** + tags: + - af-organization-idp + security: + - OrganizationAdministrator: [] + - OrganizationOwner: [] + parameters: + - name: organization_name + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationName" + description: 組織名 + - name: id + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationIdpId" + requestBody: + required: true + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/PutOrganizationIdpBody" + responses: + "200": + description: 正常 + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationOidcIdp" + "400": + $ref: "swagger-api-components.yaml#/components/responses/ErrorInvalidRequest" + "401": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi" + "404": + $ref: "swagger-api-components.yaml#/components/responses/ErrorMissingResource" + "409": + $ref: "swagger-api-components.yaml#/components/responses/ErrorStateMismatch" + "503": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" + delete: + operationId: deleteOrganizationIdp + summary: 組織のIDプロバイダーを削除 + description: | + 組織のIDプロバイダーを削除します。 + + **このAPIは Annofab に許可された組織だけで使用できます。また、予告なく変更されることがあります。** + tags: + - af-organization-idp + security: + - OrganizationAdministrator: [] + - OrganizationOwner: [] + parameters: + - name: organization_name + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationName" + description: 組織名 + - name: id + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationIdpId" + responses: + "200": + description: 正常 + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationOidcIdp" + "400": + $ref: "swagger-api-components.yaml#/components/responses/ErrorInvalidRequest" + "401": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi" + "404": + $ref: "swagger-api-components.yaml#/components/responses/ErrorMissingResource" + "409": + $ref: "swagger-api-components.yaml#/components/responses/ErrorStateMismatch" + "503": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" /projects/{project_id}/jobs: get: tags: diff --git a/pylintrc b/pylintrc index c81c80b9..7ca6e21a 100644 --- a/pylintrc +++ b/pylintrc @@ -1,4 +1,9 @@ [pylint] +# 自動生成しているファイルは無視する +ignore-paths= + annofabapi/generated_.*.py, + annofabapi/models.py, + disable = # ===== May not modify ===== fixme, # TODO remains diff --git a/pyproject.toml b/pyproject.toml index a5dccd80..78b0c710 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -132,6 +132,23 @@ select = [ "PLC2401", # non-ascii-name, メソッド名に日本語を利用するため ] +# 以下のファイルは自動生成されるので、いくかのルールを無視する +"annofabapi/generated*.py" = [ + "A002", # builtin-argument-shadowing + "ANN401", # any-type + "E501", # line-too-long + "W293", # blank-line-with-whitespace + "W291", # trailing-whitespace +] +"annofabapi/models.py" = [ + "A002", # builtin-argument-shadowing + "ANN401", # any-type + "E501", # line-too-long + "W293", # blank-line-with-whitespace + "W291", # trailing-whitespace +] + + [tool.ruff.lint.pydocstyle] convention = "google"