From 2b9002b3cd9eb7e6ebbf7ae385d8664a8335194f Mon Sep 17 00:00:00 2001 From: H1rono <54711422+H1rono@users.noreply.github.com> Date: Thu, 25 Jul 2024 07:15:21 +0000 Subject: [PATCH] CI: regenerate --- .openapi-generator/FILES | 8 ++- docs/BotApi.md | 2 +- docs/ChannelApi.md | 2 +- docs/GetClient200Response.md | 1 + docs/GroupApi.md | 2 +- docs/MeApi.md | 30 ++++++++++- docs/OAuth2Client.md | 1 + docs/OAuth2ClientDetail.md | 1 + docs/Oauth2Api.md | 31 +++++++++++ docs/OidcTraqUserInfo.md | 21 ++++++++ docs/OidcUserInfo.md | 16 ++++++ docs/PatchBotRequest.md | 1 + docs/PatchClientRequest.md | 1 + docs/PostClientRequest.md | 1 + docs/README.md | 6 ++- docs/Session.md | 12 +++++ docs/UserApi.md | 4 +- docs/WebRtcUserState.md | 2 +- docs/WebhookApi.md | 2 +- src/apis/me_api.rs | 50 +++++++++++++++++ src/apis/oauth2_api.rs | 56 +++++++++++++++++++ src/models/get_client_200_response.rs | 5 ++ src/models/mod.rs | 8 ++- src/models/o_auth2_client.rs | 5 ++ src/models/o_auth2_client_detail.rs | 5 ++ src/models/o_auth2_scope.rs | 8 ++- src/models/oidc_traq_user_info.rs | 78 +++++++++++++++++++++++++++ src/models/oidc_user_info.rs | 51 ++++++++++++++++++ src/models/patch_bot_request.rs | 4 ++ src/models/patch_client_request.rs | 4 ++ src/models/post_client_request.rs | 4 ++ src/models/session.rs | 25 +++++++++ src/models/user_permission.rs | 6 +++ src/models/web_rtc_user_state.rs | 4 +- 34 files changed, 441 insertions(+), 16 deletions(-) create mode 100644 docs/OidcTraqUserInfo.md create mode 100644 docs/OidcUserInfo.md create mode 100644 docs/Session.md create mode 100644 src/models/oidc_traq_user_info.rs create mode 100644 src/models/oidc_user_info.rs create mode 100644 src/models/session.rs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 1c5f771..843617f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -60,6 +60,8 @@ docs/Oauth2Api.md docs/Ogp.md docs/OgpApi.md docs/OgpMedia.md +docs/OidcTraqUserInfo.md +docs/OidcUserInfo.md docs/ParentChangedEvent.md docs/PatchBotRequest.md docs/PatchChannelRequest.md @@ -106,6 +108,7 @@ docs/PutChannelTopicRequest.md docs/PutMyPasswordRequest.md docs/PutNotifyCitationRequest.md docs/PutUserPasswordRequest.md +docs/Session.md docs/Stamp.md docs/StampApi.md docs/StampHistoryEntry.md @@ -137,7 +140,6 @@ docs/VersionFlags.md docs/VisibilityChangedEvent.md docs/WebRtcAuthenticateResult.md docs/WebRtcUserState.md -docs/WebRtcUserStateSessionsInner.md docs/Webhook.md docs/WebhookApi.md docs/WebrtcApi.md @@ -214,6 +216,8 @@ src/models/o_auth2_scope.rs src/models/o_auth2_token.rs src/models/ogp.rs src/models/ogp_media.rs +src/models/oidc_traq_user_info.rs +src/models/oidc_user_info.rs src/models/parent_changed_event.rs src/models/patch_bot_request.rs src/models/patch_channel_request.rs @@ -258,6 +262,7 @@ src/models/put_channel_topic_request.rs src/models/put_my_password_request.rs src/models/put_notify_citation_request.rs src/models/put_user_password_request.rs +src/models/session.rs src/models/stamp.rs src/models/stamp_history_entry.rs src/models/stamp_palette.rs @@ -285,5 +290,4 @@ src/models/version_flags.rs src/models/visibility_changed_event.rs src/models/web_rtc_authenticate_result.rs src/models/web_rtc_user_state.rs -src/models/web_rtc_user_state_sessions_inner.rs src/models/webhook.rs diff --git a/docs/BotApi.md b/docs/BotApi.md index 3f1e359..ddf1c7d 100644 --- a/docs/BotApi.md +++ b/docs/BotApi.md @@ -65,7 +65,7 @@ BOTのアイコン画像を変更 Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **bot_id** | **uuid::Uuid** | BOTUUID | [required] | -**file** | **std::path::PathBuf** | アイコン画像(1MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | ### Return type diff --git a/docs/ChannelApi.md b/docs/ChannelApi.md index 7152384..21d0a73 100644 --- a/docs/ChannelApi.md +++ b/docs/ChannelApi.md @@ -471,7 +471,7 @@ DMチャンネル情報を取得 Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **String** | | [required] | +**user_id** | **uuid::Uuid** | | [required] | ### Return type diff --git a/docs/GetClient200Response.md b/docs/GetClient200Response.md index 2dfd76e..0d97a83 100644 --- a/docs/GetClient200Response.md +++ b/docs/GetClient200Response.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **description** | **String** | 説明 | **developer_id** | [**uuid::Uuid**](uuid::Uuid.md) | クライアント開発者UUID | **scopes** | [**Vec**](OAuth2Scope.md) | 要求スコープの配列 | +**confidential** | **bool** | confidential client なら true, public client なら false | **callback_url** | **String** | コールバックURL | **secret** | **String** | クライアントシークレット | diff --git a/docs/GroupApi.md b/docs/GroupApi.md index 29057de..2b5e7b9 100644 --- a/docs/GroupApi.md +++ b/docs/GroupApi.md @@ -95,7 +95,7 @@ Name | Type | Description | Required | Notes Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **uuid::Uuid** | ユーザーグループUUID | [required] | -**file** | **std::path::PathBuf** | アイコン画像(1MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | ### Return type diff --git a/docs/MeApi.md b/docs/MeApi.md index af7561e..c5b8807 100644 --- a/docs/MeApi.md +++ b/docs/MeApi.md @@ -24,6 +24,7 @@ Method | HTTP request | Description [**get_my_unread_channels**](MeApi.md#get_my_unread_channels) | **GET** /users/me/unread | 未読チャンネルを取得 [**get_my_user_tags**](MeApi.md#get_my_user_tags) | **GET** /users/me/tags | 自分のタグリストを取得 [**get_my_view_states**](MeApi.md#get_my_view_states) | **GET** /users/me/view-states | 自身のチャンネル閲覧状態一覧を取得 +[**get_oidc_user_info**](MeApi.md#get_oidc_user_info) | **GET** /users/me/oidc | 自分のユーザー詳細を取得 (OIDC UserInfo) [**get_user_settings**](MeApi.md#get_user_settings) | **GET** /users/me/settings | ユーザー設定を取得 [**link_external_account**](MeApi.md#link_external_account) | **POST** /users/me/ex-accounts/link | 外部ログインアカウントを紐付ける [**read_channel**](MeApi.md#read_channel) | **DELETE** /users/me/unread/{channelId} | チャンネルを既読にする @@ -109,7 +110,7 @@ Name | Type | Description | Required | Notes Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**file** | **std::path::PathBuf** | アイコン画像(1MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | ### Return type @@ -605,6 +606,33 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## get_oidc_user_info + +> crate::models::OidcUserInfo get_oidc_user_info() +自分のユーザー詳細を取得 (OIDC UserInfo) + +OIDCトークンを用いてユーザー詳細を取得します。 OIDC UserInfo Endpointです。 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::OidcUserInfo**](OIDCUserInfo.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## get_user_settings > crate::models::UserSettings get_user_settings() diff --git a/docs/OAuth2Client.md b/docs/OAuth2Client.md index 39e7999..d5fabc8 100644 --- a/docs/OAuth2Client.md +++ b/docs/OAuth2Client.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **description** | **String** | 説明 | **developer_id** | [**uuid::Uuid**](uuid::Uuid.md) | クライアント開発者UUID | **scopes** | [**Vec**](OAuth2Scope.md) | 要求スコープの配列 | +**confidential** | **bool** | confidential client なら true, public client なら false | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OAuth2ClientDetail.md b/docs/OAuth2ClientDetail.md index 8e6a284..25b64c0 100644 --- a/docs/OAuth2ClientDetail.md +++ b/docs/OAuth2ClientDetail.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **scopes** | [**Vec**](OAuth2Scope.md) | 要求スコープの配列 | **callback_url** | **String** | コールバックURL | **secret** | **String** | クライアントシークレット | +**confidential** | **bool** | confidential client なら true, public client なら false | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Oauth2Api.md b/docs/Oauth2Api.md index 37b7624..2b0da8e 100644 --- a/docs/Oauth2Api.md +++ b/docs/Oauth2Api.md @@ -14,6 +14,7 @@ Method | HTTP request | Description [**post_o_auth2_authorize**](Oauth2Api.md#post_o_auth2_authorize) | **POST** /oauth2/authorize | OAuth2 認可エンドポイント [**post_o_auth2_authorize_decide**](Oauth2Api.md#post_o_auth2_authorize_decide) | **POST** /oauth2/authorize/decide | OAuth2 認可承諾API [**post_o_auth2_token**](Oauth2Api.md#post_o_auth2_token) | **POST** /oauth2/token | OAuth2 トークンエンドポイント +[**revoke_client_tokens**](Oauth2Api.md#revoke_client_tokens) | **DELETE** /clients/{clientId}/tokens | OAuthクライアントのトークンを削除 [**revoke_my_token**](Oauth2Api.md#revoke_my_token) | **DELETE** /users/me/tokens/{tokenId} | トークンの認可を取り消す [**revoke_o_auth2_token**](Oauth2Api.md#revoke_o_auth2_token) | **POST** /oauth2/revoke | OAuth2 トークン無効化エンドポイント @@ -343,6 +344,36 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## revoke_client_tokens + +> revoke_client_tokens(client_id) +OAuthクライアントのトークンを削除 + +自分が許可している指定したOAuthクライアントのアクセストークンを全てRevokeします。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**client_id** | **String** | OAuth2クライアントUUID | [required] | + +### Return type + + (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## revoke_my_token > revoke_my_token(token_id) diff --git a/docs/OidcTraqUserInfo.md b/docs/OidcTraqUserInfo.md new file mode 100644 index 0000000..ce5cf96 --- /dev/null +++ b/docs/OidcTraqUserInfo.md @@ -0,0 +1,21 @@ +# OidcTraqUserInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bio** | **String** | 自己紹介(biography) | +**groups** | [**Vec**](uuid::Uuid.md) | 所属グループのUUIDの配列 | +**tags** | [**Vec**](UserTag.md) | タグリスト | +**last_online** | Option<**String**> | 最終オンライン日時 | +**twitter_id** | **String** | Twitter ID | +**display_name** | **String** | ユーザー表示名 | +**icon_file_id** | [**uuid::Uuid**](uuid::Uuid.md) | アイコンファイルUUID | +**bot** | **bool** | BOTかどうか | +**state** | [**crate::models::UserAccountState**](UserAccountState.md) | | +**permissions** | [**Vec**](UserPermission.md) | 所有している権限の配列 | +**home_channel** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ホームチャンネル | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OidcUserInfo.md b/docs/OidcUserInfo.md new file mode 100644 index 0000000..0e1bef8 --- /dev/null +++ b/docs/OidcUserInfo.md @@ -0,0 +1,16 @@ +# OidcUserInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sub** | [**uuid::Uuid**](uuid::Uuid.md) | ユーザーUUID | +**name** | **String** | ユーザー名 | +**preferred_username** | **String** | ユーザー名 | +**picture** | **String** | アイコン画像URL | +**updated_at** | Option<**i64**> | 更新日時 | [optional] +**traq** | Option<[**crate::models::OidcTraqUserInfo**](OIDCTraqUserInfo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PatchBotRequest.md b/docs/PatchBotRequest.md index 6020370..df2f705 100644 --- a/docs/PatchBotRequest.md +++ b/docs/PatchBotRequest.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **endpoint** | Option<**String**> | BOTサーバーエンドポイント | [optional] **developer_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | 移譲先の開発者UUID | [optional] **subscribe_events** | Option<**Vec**> | 購読するイベント | [optional] +**bio** | Option<**String**> | 自己紹介(biography) | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PatchClientRequest.md b/docs/PatchClientRequest.md index 8c2d421..1f90d21 100644 --- a/docs/PatchClientRequest.md +++ b/docs/PatchClientRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **description** | Option<**String**> | 説明 | [optional] **callback_url** | Option<**String**> | コールバックURL | [optional] **developer_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | クライアント開発者UUID | [optional] +**confidential** | Option<**bool**> | confidential client なら true, public client なら false | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PostClientRequest.md b/docs/PostClientRequest.md index 05587ec..f721c14 100644 --- a/docs/PostClientRequest.md +++ b/docs/PostClientRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **callback_url** | **String** | コールバックURL | **scopes** | [**Vec**](OAuth2Scope.md) | 要求スコープの配列 | **description** | **String** | 説明 | +**confidential** | Option<**bool**> | confidential client なら true, public cleint なら false | [optional][default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/README.md b/docs/README.md index b03128f..e3bb719 100644 --- a/docs/README.md +++ b/docs/README.md @@ -115,6 +115,7 @@ Class | Method | HTTP request | Description *MeApi* | [**get_my_unread_channels**](MeApi.md#get_my_unread_channels) | **GET** /users/me/unread | 未読チャンネルを取得 *MeApi* | [**get_my_user_tags**](MeApi.md#get_my_user_tags) | **GET** /users/me/tags | 自分のタグリストを取得 *MeApi* | [**get_my_view_states**](MeApi.md#get_my_view_states) | **GET** /users/me/view-states | 自身のチャンネル閲覧状態一覧を取得 +*MeApi* | [**get_oidc_user_info**](MeApi.md#get_oidc_user_info) | **GET** /users/me/oidc | 自分のユーザー詳細を取得 (OIDC UserInfo) *MeApi* | [**get_user_settings**](MeApi.md#get_user_settings) | **GET** /users/me/settings | ユーザー設定を取得 *MeApi* | [**link_external_account**](MeApi.md#link_external_account) | **POST** /users/me/ex-accounts/link | 外部ログインアカウントを紐付ける *MeApi* | [**read_channel**](MeApi.md#read_channel) | **DELETE** /users/me/unread/{channelId} | チャンネルを既読にする @@ -160,6 +161,7 @@ Class | Method | HTTP request | Description *Oauth2Api* | [**post_o_auth2_authorize**](Oauth2Api.md#post_o_auth2_authorize) | **POST** /oauth2/authorize | OAuth2 認可エンドポイント *Oauth2Api* | [**post_o_auth2_authorize_decide**](Oauth2Api.md#post_o_auth2_authorize_decide) | **POST** /oauth2/authorize/decide | OAuth2 認可承諾API *Oauth2Api* | [**post_o_auth2_token**](Oauth2Api.md#post_o_auth2_token) | **POST** /oauth2/token | OAuth2 トークンエンドポイント +*Oauth2Api* | [**revoke_client_tokens**](Oauth2Api.md#revoke_client_tokens) | **DELETE** /clients/{clientId}/tokens | OAuthクライアントのトークンを削除 *Oauth2Api* | [**revoke_my_token**](Oauth2Api.md#revoke_my_token) | **DELETE** /users/me/tokens/{tokenId} | トークンの認可を取り消す *Oauth2Api* | [**revoke_o_auth2_token**](Oauth2Api.md#revoke_o_auth2_token) | **POST** /oauth2/revoke | OAuth2 トークン無効化エンドポイント *OgpApi* | [**delete_ogp_cache**](OgpApi.md#delete_ogp_cache) | **DELETE** /ogp/cache | OGP情報のキャッシュを削除 @@ -278,6 +280,8 @@ Class | Method | HTTP request | Description - [OAuth2Token](OAuth2Token.md) - [Ogp](Ogp.md) - [OgpMedia](OgpMedia.md) + - [OidcTraqUserInfo](OidcTraqUserInfo.md) + - [OidcUserInfo](OidcUserInfo.md) - [ParentChangedEvent](ParentChangedEvent.md) - [PatchBotRequest](PatchBotRequest.md) - [PatchChannelRequest](PatchChannelRequest.md) @@ -322,6 +326,7 @@ Class | Method | HTTP request | Description - [PutMyPasswordRequest](PutMyPasswordRequest.md) - [PutNotifyCitationRequest](PutNotifyCitationRequest.md) - [PutUserPasswordRequest](PutUserPasswordRequest.md) + - [Session](Session.md) - [Stamp](Stamp.md) - [StampHistoryEntry](StampHistoryEntry.md) - [StampPalette](StampPalette.md) @@ -349,7 +354,6 @@ Class | Method | HTTP request | Description - [VisibilityChangedEvent](VisibilityChangedEvent.md) - [WebRtcAuthenticateResult](WebRtcAuthenticateResult.md) - [WebRtcUserState](WebRtcUserState.md) - - [WebRtcUserStateSessionsInner](WebRtcUserStateSessionsInner.md) - [Webhook](Webhook.md) diff --git a/docs/Session.md b/docs/Session.md new file mode 100644 index 0000000..b53aae2 --- /dev/null +++ b/docs/Session.md @@ -0,0 +1,12 @@ +# Session + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**state** | **String** | 状態 | +**session_id** | **String** | セッションID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserApi.md b/docs/UserApi.md index 5ed54bd..4833713 100644 --- a/docs/UserApi.md +++ b/docs/UserApi.md @@ -66,7 +66,7 @@ Name | Type | Description | Required | Notes Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **uuid::Uuid** | ユーザーUUID | [required] | -**file** | **std::path::PathBuf** | アイコン画像(1MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | ### Return type @@ -286,7 +286,7 @@ DMチャンネル情報を取得 Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **String** | | [required] | +**user_id** | **uuid::Uuid** | | [required] | ### Return type diff --git a/docs/WebRtcUserState.md b/docs/WebRtcUserState.md index 3ba8fde..e85e336 100644 --- a/docs/WebRtcUserState.md +++ b/docs/WebRtcUserState.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user_id** | [**uuid::Uuid**](uuid::Uuid.md) | ユーザーUUID | **channel_id** | [**uuid::Uuid**](uuid::Uuid.md) | チャンネルUUID | -**sessions** | [**Vec**](WebRTCUserState_sessions_inner.md) | セッションの配列 | +**sessions** | [**Vec**](Session.md) | セッションの配列 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WebhookApi.md b/docs/WebhookApi.md index 798939b..15464f0 100644 --- a/docs/WebhookApi.md +++ b/docs/WebhookApi.md @@ -29,7 +29,7 @@ Webhookのアイコンを変更 Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **webhook_id** | **uuid::Uuid** | WebhookUUID | [required] | -**file** | **std::path::PathBuf** | アイコン画像(1MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | ### Return type diff --git a/src/apis/me_api.rs b/src/apis/me_api.rs index e1cf65c..19075b4 100644 --- a/src/apis/me_api.rs +++ b/src/apis/me_api.rs @@ -165,6 +165,13 @@ pub enum GetMyViewStatesError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_oidc_user_info`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetOidcUserInfoError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_user_settings`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1144,6 +1151,49 @@ pub async fn get_my_view_states( } } +/// OIDCトークンを用いてユーザー詳細を取得します。 OIDC UserInfo Endpointです。 +pub async fn get_oidc_user_info( + configuration: &configuration::Configuration, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/me/oidc", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + /// ユーザー設定を取得します。 pub async fn get_user_settings( configuration: &configuration::Configuration, diff --git a/src/apis/oauth2_api.rs b/src/apis/oauth2_api.rs index 3522549..5242c82 100644 --- a/src/apis/oauth2_api.rs +++ b/src/apis/oauth2_api.rs @@ -102,6 +102,14 @@ pub enum PostOAuth2TokenError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`revoke_client_tokens`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RevokeClientTokensError { + Status404(), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`revoke_my_token`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -700,6 +708,54 @@ pub async fn post_o_auth2_token( } } +/// 自分が許可している指定したOAuthクライアントのアクセストークンを全てRevokeします。 +pub async fn revoke_client_tokens( + configuration: &configuration::Configuration, + client_id: &str, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/clients/{clientId}/tokens", + local_var_configuration.base_path, + clientId = crate::apis::urlencode(client_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + /// 自分の指定したトークンの認可を取り消します。 pub async fn revoke_my_token( configuration: &configuration::Configuration, diff --git a/src/models/get_client_200_response.rs b/src/models/get_client_200_response.rs index 4704dc7..f8237dc 100644 --- a/src/models/get_client_200_response.rs +++ b/src/models/get_client_200_response.rs @@ -25,6 +25,9 @@ pub struct GetClient200Response { /// 要求スコープの配列 #[serde(rename = "scopes")] pub scopes: Vec, + /// confidential client なら true, public client なら false + #[serde(rename = "confidential")] + pub confidential: bool, /// コールバックURL #[serde(rename = "callbackUrl")] pub callback_url: String, @@ -40,6 +43,7 @@ impl GetClient200Response { description: String, developer_id: uuid::Uuid, scopes: Vec, + confidential: bool, callback_url: String, secret: String, ) -> GetClient200Response { @@ -49,6 +53,7 @@ impl GetClient200Response { description, developer_id, scopes, + confidential, callback_url, secret, } diff --git a/src/models/mod.rs b/src/models/mod.rs index d53757d..05628e9 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -96,6 +96,10 @@ pub mod ogp; pub use self::ogp::Ogp; pub mod ogp_media; pub use self::ogp_media::OgpMedia; +pub mod oidc_traq_user_info; +pub use self::oidc_traq_user_info::OidcTraqUserInfo; +pub mod oidc_user_info; +pub use self::oidc_user_info::OidcUserInfo; pub mod parent_changed_event; pub use self::parent_changed_event::ParentChangedEvent; pub mod patch_bot_request; @@ -184,6 +188,8 @@ pub mod put_notify_citation_request; pub use self::put_notify_citation_request::PutNotifyCitationRequest; pub mod put_user_password_request; pub use self::put_user_password_request::PutUserPasswordRequest; +pub mod session; +pub use self::session::Session; pub mod stamp; pub use self::stamp::Stamp; pub mod stamp_history_entry; @@ -238,7 +244,5 @@ pub mod web_rtc_authenticate_result; pub use self::web_rtc_authenticate_result::WebRtcAuthenticateResult; pub mod web_rtc_user_state; pub use self::web_rtc_user_state::WebRtcUserState; -pub mod web_rtc_user_state_sessions_inner; -pub use self::web_rtc_user_state_sessions_inner::WebRtcUserStateSessionsInner; pub mod webhook; pub use self::webhook::Webhook; diff --git a/src/models/o_auth2_client.rs b/src/models/o_auth2_client.rs index 87addef..4fff63d 100644 --- a/src/models/o_auth2_client.rs +++ b/src/models/o_auth2_client.rs @@ -27,6 +27,9 @@ pub struct OAuth2Client { /// 要求スコープの配列 #[serde(rename = "scopes")] pub scopes: Vec, + /// confidential client なら true, public client なら false + #[serde(rename = "confidential")] + pub confidential: bool, } impl OAuth2Client { @@ -37,6 +40,7 @@ impl OAuth2Client { description: String, developer_id: uuid::Uuid, scopes: Vec, + confidential: bool, ) -> OAuth2Client { OAuth2Client { id, @@ -44,6 +48,7 @@ impl OAuth2Client { description, developer_id, scopes, + confidential, } } } diff --git a/src/models/o_auth2_client_detail.rs b/src/models/o_auth2_client_detail.rs index b6e9b88..cd41547 100644 --- a/src/models/o_auth2_client_detail.rs +++ b/src/models/o_auth2_client_detail.rs @@ -33,6 +33,9 @@ pub struct OAuth2ClientDetail { /// クライアントシークレット #[serde(rename = "secret")] pub secret: String, + /// confidential client なら true, public client なら false + #[serde(rename = "confidential")] + pub confidential: bool, } impl OAuth2ClientDetail { @@ -45,6 +48,7 @@ impl OAuth2ClientDetail { scopes: Vec, callback_url: String, secret: String, + confidential: bool, ) -> OAuth2ClientDetail { OAuth2ClientDetail { id, @@ -54,6 +58,7 @@ impl OAuth2ClientDetail { scopes, callback_url, secret, + confidential, } } } diff --git a/src/models/o_auth2_scope.rs b/src/models/o_auth2_scope.rs index 63ab039..c839cbf 100644 --- a/src/models/o_auth2_scope.rs +++ b/src/models/o_auth2_scope.rs @@ -13,6 +13,10 @@ /// OAuth2スコープ #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum OAuth2Scope { + #[serde(rename = "openid")] + Openid, + #[serde(rename = "profile")] + Profile, #[serde(rename = "read")] Read, #[serde(rename = "write")] @@ -24,6 +28,8 @@ pub enum OAuth2Scope { impl ToString for OAuth2Scope { fn to_string(&self) -> String { match self { + Self::Openid => String::from("openid"), + Self::Profile => String::from("profile"), Self::Read => String::from("read"), Self::Write => String::from("write"), Self::ManageBot => String::from("manage_bot"), @@ -33,6 +39,6 @@ impl ToString for OAuth2Scope { impl Default for OAuth2Scope { fn default() -> OAuth2Scope { - Self::Read + Self::Openid } } diff --git a/src/models/oidc_traq_user_info.rs b/src/models/oidc_traq_user_info.rs new file mode 100644 index 0000000..275e1fb --- /dev/null +++ b/src/models/oidc_traq_user_info.rs @@ -0,0 +1,78 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// OidcTraqUserInfo : traQ特有のユーザー詳細情報 + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OidcTraqUserInfo { + /// 自己紹介(biography) + #[serde(rename = "bio")] + pub bio: String, + /// 所属グループのUUIDの配列 + #[serde(rename = "groups")] + pub groups: Vec, + /// タグリスト + #[serde(rename = "tags")] + pub tags: Vec, + /// 最終オンライン日時 + #[serde(rename = "last_online", deserialize_with = "Option::deserialize")] + pub last_online: Option, + /// Twitter ID + #[serde(rename = "twitter_id")] + pub twitter_id: String, + /// ユーザー表示名 + #[serde(rename = "display_name")] + pub display_name: String, + /// アイコンファイルUUID + #[serde(rename = "icon_file_id")] + pub icon_file_id: uuid::Uuid, + /// BOTかどうか + #[serde(rename = "bot")] + pub bot: bool, + #[serde(rename = "state")] + pub state: crate::models::UserAccountState, + /// 所有している権限の配列 + #[serde(rename = "permissions")] + pub permissions: Vec, + /// ホームチャンネル + #[serde(rename = "home_channel", deserialize_with = "Option::deserialize")] + pub home_channel: Option, +} + +impl OidcTraqUserInfo { + /// traQ特有のユーザー詳細情報 + pub fn new( + bio: String, + groups: Vec, + tags: Vec, + last_online: Option, + twitter_id: String, + display_name: String, + icon_file_id: uuid::Uuid, + bot: bool, + state: crate::models::UserAccountState, + permissions: Vec, + home_channel: Option, + ) -> OidcTraqUserInfo { + OidcTraqUserInfo { + bio, + groups, + tags, + last_online, + twitter_id, + display_name, + icon_file_id, + bot, + state, + permissions, + home_channel, + } + } +} diff --git a/src/models/oidc_user_info.rs b/src/models/oidc_user_info.rs new file mode 100644 index 0000000..858bc16 --- /dev/null +++ b/src/models/oidc_user_info.rs @@ -0,0 +1,51 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// OidcUserInfo : 自分のユーザー詳細情報 + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OidcUserInfo { + /// ユーザーUUID + #[serde(rename = "sub")] + pub sub: uuid::Uuid, + /// ユーザー名 + #[serde(rename = "name")] + pub name: String, + /// ユーザー名 + #[serde(rename = "preferred_username")] + pub preferred_username: String, + /// アイコン画像URL + #[serde(rename = "picture")] + pub picture: String, + /// 更新日時 + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "traq", skip_serializing_if = "Option::is_none")] + pub traq: Option>, +} + +impl OidcUserInfo { + /// 自分のユーザー詳細情報 + pub fn new( + sub: uuid::Uuid, + name: String, + preferred_username: String, + picture: String, + ) -> OidcUserInfo { + OidcUserInfo { + sub, + name, + preferred_username, + picture, + updated_at: None, + traq: None, + } + } +} diff --git a/src/models/patch_bot_request.rs b/src/models/patch_bot_request.rs index 3b9a299..af89454 100644 --- a/src/models/patch_bot_request.rs +++ b/src/models/patch_bot_request.rs @@ -32,6 +32,9 @@ pub struct PatchBotRequest { /// 購読するイベント #[serde(rename = "subscribeEvents", skip_serializing_if = "Option::is_none")] pub subscribe_events: Option>, + /// 自己紹介(biography) + #[serde(rename = "bio", skip_serializing_if = "Option::is_none")] + pub bio: Option, } impl PatchBotRequest { @@ -45,6 +48,7 @@ impl PatchBotRequest { endpoint: None, developer_id: None, subscribe_events: None, + bio: None, } } } diff --git a/src/models/patch_client_request.rs b/src/models/patch_client_request.rs index 40dcbbe..a422f23 100644 --- a/src/models/patch_client_request.rs +++ b/src/models/patch_client_request.rs @@ -24,6 +24,9 @@ pub struct PatchClientRequest { /// クライアント開発者UUID #[serde(rename = "developerId", skip_serializing_if = "Option::is_none")] pub developer_id: Option, + /// confidential client なら true, public client なら false + #[serde(rename = "confidential", skip_serializing_if = "Option::is_none")] + pub confidential: Option, } impl PatchClientRequest { @@ -34,6 +37,7 @@ impl PatchClientRequest { description: None, callback_url: None, developer_id: None, + confidential: None, } } } diff --git a/src/models/post_client_request.rs b/src/models/post_client_request.rs index ac6d497..e40e672 100644 --- a/src/models/post_client_request.rs +++ b/src/models/post_client_request.rs @@ -24,6 +24,9 @@ pub struct PostClientRequest { /// 説明 #[serde(rename = "description")] pub description: String, + /// confidential client なら true, public cleint なら false + #[serde(rename = "confidential", skip_serializing_if = "Option::is_none")] + pub confidential: Option, } impl PostClientRequest { @@ -39,6 +42,7 @@ impl PostClientRequest { callback_url, scopes, description, + confidential: None, } } } diff --git a/src/models/session.rs b/src/models/session.rs new file mode 100644 index 0000000..123edc5 --- /dev/null +++ b/src/models/session.rs @@ -0,0 +1,25 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Session { + /// 状態 + #[serde(rename = "state")] + pub state: String, + /// セッションID + #[serde(rename = "sessionId")] + pub session_id: String, +} + +impl Session { + pub fn new(state: String, session_id: String) -> Session { + Session { state, session_id } + } +} diff --git a/src/models/user_permission.rs b/src/models/user_permission.rs index 27a4444..25a1df9 100644 --- a/src/models/user_permission.rs +++ b/src/models/user_permission.rs @@ -107,6 +107,8 @@ pub enum UserPermission { EditStampCreatedByOthers, #[serde(rename = "delete_stamp")] DeleteStamp, + #[serde(rename = "delete_my_stamp")] + DeleteMyStamp, #[serde(rename = "add_message_stamp")] AddMessageStamp, #[serde(rename = "remove_message_stamp")] @@ -127,6 +129,8 @@ pub enum UserPermission { RegisterUser, #[serde(rename = "get_me")] GetMe, + #[serde(rename = "get_oidc_userinfo")] + GetOIDCUserInfo, #[serde(rename = "edit_me")] EditMe, #[serde(rename = "change_my_icon")] @@ -227,6 +231,7 @@ impl ToString for UserPermission { Self::EditStamp => String::from("edit_stamp"), Self::EditStampCreatedByOthers => String::from("edit_stamp_created_by_others"), Self::DeleteStamp => String::from("delete_stamp"), + Self::DeleteMyStamp => String::from("delete_my_stamp"), Self::AddMessageStamp => String::from("add_message_stamp"), Self::RemoveMessageStamp => String::from("remove_message_stamp"), Self::GetMyStampHistory => String::from("get_my_stamp_history"), @@ -237,6 +242,7 @@ impl ToString for UserPermission { Self::GetUser => String::from("get_user"), Self::RegisterUser => String::from("register_user"), Self::GetMe => String::from("get_me"), + Self::GetOIDCUserInfo => String::from("get_oidc_userinfo"), Self::EditMe => String::from("edit_me"), Self::ChangeMyIcon => String::from("change_my_icon"), Self::ChangeMyPassword => String::from("change_my_password"), diff --git a/src/models/web_rtc_user_state.rs b/src/models/web_rtc_user_state.rs index 36f58dc..09c9c7e 100644 --- a/src/models/web_rtc_user_state.rs +++ b/src/models/web_rtc_user_state.rs @@ -20,7 +20,7 @@ pub struct WebRtcUserState { pub channel_id: uuid::Uuid, /// セッションの配列 #[serde(rename = "sessions")] - pub sessions: Vec, + pub sessions: Vec, } impl WebRtcUserState { @@ -28,7 +28,7 @@ impl WebRtcUserState { pub fn new( user_id: uuid::Uuid, channel_id: uuid::Uuid, - sessions: Vec, + sessions: Vec, ) -> WebRtcUserState { WebRtcUserState { user_id,