diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 843617f..0effee7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -2,6 +2,7 @@ docs/README.md docs/ActiveOAuth2Token.md docs/ActivityApi.md docs/ActivityTimelineMessage.md +docs/AddUserGroupMemberRequest.md docs/AuthenticationApi.md docs/Bot.md docs/BotApi.md @@ -17,6 +18,7 @@ docs/ChannelApi.md docs/ChannelEvent.md docs/ChannelEventDetail.md docs/ChannelList.md +docs/ChannelPath.md docs/ChannelStats.md docs/ChannelStatsStamp.md docs/ChannelStatsUser.md @@ -108,7 +110,27 @@ docs/PutChannelTopicRequest.md docs/PutMyPasswordRequest.md docs/PutNotifyCitationRequest.md docs/PutUserPasswordRequest.md +docs/QallApi.md +docs/QallEndpointResponse.md +docs/QallMetadataRequest.md +docs/QallMetadataResponse.md +docs/QallParticipant.md +docs/QallParticipantRequest.md +docs/QallParticipantRequestUsersInner.md +docs/QallParticipantResponse.md +docs/QallParticipantResponseResultsInner.md +docs/QallRoomStateChangedEvent.md +docs/QallRoomStateChangedEventRoomStatesInner.md +docs/QallRoomStateChangedEventRoomStatesInnerParticipantsInner.md +docs/QallRoomWithParticipants.md +docs/QallSoundboardItemCreatedEvent.md +docs/QallSoundboardItemDeletedEvent.md +docs/QallTokenResponse.md docs/Session.md +docs/SoundboardItem.md +docs/SoundboardPlayRequest.md +docs/SoundboardPlayResponse.md +docs/SoundboardUploadResponse.md docs/Stamp.md docs/StampApi.md docs/StampHistoryEntry.md @@ -159,6 +181,7 @@ src/apis/oauth2_api.rs src/apis/ogp_api.rs src/apis/pin_api.rs src/apis/public_api.rs +src/apis/qall_api.rs src/apis/stamp_api.rs src/apis/star_api.rs src/apis/user_api.rs @@ -168,6 +191,7 @@ src/apis/webrtc_api.rs src/lib.rs src/models/active_o_auth2_token.rs src/models/activity_timeline_message.rs +src/models/add_user_group_member_request.rs src/models/bot.rs src/models/bot_detail.rs src/models/bot_event_log.rs @@ -180,6 +204,7 @@ src/models/channel.rs src/models/channel_event.rs src/models/channel_event_detail.rs src/models/channel_list.rs +src/models/channel_path.rs src/models/channel_stats.rs src/models/channel_stats_stamp.rs src/models/channel_stats_user.rs @@ -262,7 +287,26 @@ 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/qall_endpoint_response.rs +src/models/qall_metadata_request.rs +src/models/qall_metadata_response.rs +src/models/qall_participant.rs +src/models/qall_participant_request.rs +src/models/qall_participant_request_users_inner.rs +src/models/qall_participant_response.rs +src/models/qall_participant_response_results_inner.rs +src/models/qall_room_state_changed_event.rs +src/models/qall_room_state_changed_event_room_states_inner.rs +src/models/qall_room_state_changed_event_room_states_inner_participants_inner.rs +src/models/qall_room_with_participants.rs +src/models/qall_soundboard_item_created_event.rs +src/models/qall_soundboard_item_deleted_event.rs +src/models/qall_token_response.rs src/models/session.rs +src/models/soundboard_item.rs +src/models/soundboard_play_request.rs +src/models/soundboard_play_response.rs +src/models/soundboard_upload_response.rs src/models/stamp.rs src/models/stamp_history_entry.rs src/models/stamp_palette.rs diff --git a/docs/AddUserGroupMemberRequest.md b/docs/AddUserGroupMemberRequest.md new file mode 100644 index 0000000..c86a80d --- /dev/null +++ b/docs/AddUserGroupMemberRequest.md @@ -0,0 +1,12 @@ +# AddUserGroupMemberRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | [**uuid::Uuid**](uuid::Uuid.md) | ユーザーUUID | +**role** | **String** | ユーザーの役割 | + +[[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/BotApi.md b/docs/BotApi.md index ddf1c7d..598ffac 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** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MB,`Config.Imaging.MaxPixels`(default: 2560*1600)までのpng, jpeg, gif) | [required] | ### Return type diff --git a/docs/ChannelApi.md b/docs/ChannelApi.md index 21d0a73..ba9790e 100644 --- a/docs/ChannelApi.md +++ b/docs/ChannelApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**get_channel**](ChannelApi.md#get_channel) | **GET** /channels/{channelId} | チャンネル情報を取得 [**get_channel_bots**](ChannelApi.md#get_channel_bots) | **GET** /channels/{channelId}/bots | チャンネル参加中のBOTのリストを取得 [**get_channel_events**](ChannelApi.md#get_channel_events) | **GET** /channels/{channelId}/events | チャンネルイベントのリストを取得 +[**get_channel_path**](ChannelApi.md#get_channel_path) | **GET** /channels/{channelId}/path | 指定したチャンネルパスを取得 [**get_channel_pins**](ChannelApi.md#get_channel_pins) | **GET** /channels/{channelId}/pins | チャンネルピンのリストを取得 [**get_channel_stats**](ChannelApi.md#get_channel_stats) | **GET** /channels/{channelId}/stats | チャンネル統計情報を取得 [**get_channel_subscribers**](ChannelApi.md#get_channel_subscribers) | **GET** /channels/{channelId}/subscribers | チャンネルの通知購読者のリストを取得 @@ -243,6 +244,34 @@ 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) +## get_channel_path + +> crate::models::ChannelPath get_channel_path(channel_id) +指定したチャンネルパスを取得 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**channel_id** | **uuid::Uuid** | チャンネルUUID | [required] | + +### Return type + +[**crate::models::ChannelPath**](ChannelPath.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_channel_pins > Vec get_channel_pins(channel_id) @@ -275,7 +304,7 @@ Name | Type | Description | Required | Notes ## get_channel_stats -> crate::models::ChannelStats get_channel_stats(channel_id) +> crate::models::ChannelStats get_channel_stats(channel_id, exclude_deleted_messages) チャンネル統計情報を取得 指定したチャンネルの統計情報を取得します。 @@ -286,6 +315,7 @@ Name | Type | Description | Required | Notes Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **channel_id** | **uuid::Uuid** | チャンネルUUID | [required] | +**exclude_deleted_messages** | Option<**bool**> | 削除されたメッセージを除外するかどうか(デフォルト false) | | ### Return type @@ -395,7 +425,7 @@ Name | Type | Description | Required | Notes ## get_channels -> crate::models::ChannelList get_channels(include_dm) +> crate::models::ChannelList get_channels(include_dm, path) チャンネルリストを取得 チャンネルのリストを取得します。 @@ -406,6 +436,7 @@ Name | Type | Description | Required | Notes Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **include_dm** | Option<**bool**> | ダイレクトメッセージチャンネルをレスポンスに含めるかどうか | |[default to false] +**path** | Option<**String**> | パスが一致するチャンネルのみを取得する | | ### Return type diff --git a/docs/ChannelPath.md b/docs/ChannelPath.md new file mode 100644 index 0000000..8fe2296 --- /dev/null +++ b/docs/ChannelPath.md @@ -0,0 +1,11 @@ +# ChannelPath + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path** | **String** | チャンネルパス | + +[[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/GroupApi.md b/docs/GroupApi.md index 2b5e7b9..30bd558 100644 --- a/docs/GroupApi.md +++ b/docs/GroupApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**get_user_groups**](GroupApi.md#get_user_groups) | **GET** /groups | ユーザーグループのリストを取得 [**remove_user_group_admin**](GroupApi.md#remove_user_group_admin) | **DELETE** /groups/{groupId}/admins/{userId} | グループ管理者を削除 [**remove_user_group_member**](GroupApi.md#remove_user_group_member) | **DELETE** /groups/{groupId}/members/{userId} | グループメンバーを削除 +[**remove_user_group_members**](GroupApi.md#remove_user_group_members) | **DELETE** /groups/{groupId}/members | グループメンバーを一括削除 @@ -53,7 +54,7 @@ Name | Type | Description | Required | Notes ## add_user_group_member -> add_user_group_member(group_id, user_group_member) +> add_user_group_member(group_id, add_user_group_member_request) グループメンバーを追加 指定したグループにメンバーを追加します。 対象のユーザーグループの管理者権限が必要です。 @@ -64,7 +65,7 @@ Name | Type | Description | Required | Notes Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **uuid::Uuid** | ユーザーグループUUID | [required] | -**user_group_member** | Option<[**UserGroupMember**](UserGroupMember.md)> | | | +**add_user_group_member_request** | Option<[**AddUserGroupMemberRequest**](AddUserGroupMemberRequest.md)> | | | ### Return type @@ -95,7 +96,7 @@ Name | Type | Description | Required | Notes Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **uuid::Uuid** | ユーザーグループUUID | [required] | -**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MB,`Config.Imaging.MaxPixels`(default: 2560*1600)までのpng, jpeg, gif) | [required] | ### Return type @@ -414,3 +415,33 @@ 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) + +## remove_user_group_members + +> remove_user_group_members(group_id) +グループメンバーを一括削除 + +指定したグループから全てのメンバーを削除します。 対象のユーザーグループの管理者権限が必要です。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**group_id** | **uuid::Uuid** | ユーザーグループ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) + diff --git a/docs/MeApi.md b/docs/MeApi.md index c5b8807..5e423fe 100644 --- a/docs/MeApi.md +++ b/docs/MeApi.md @@ -110,7 +110,7 @@ Name | Type | Description | Required | Notes Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MB,`Config.Imaging.MaxPixels`(default: 2560*1600)までのpng, jpeg, gif) | [required] | ### Return type diff --git a/docs/MessageApi.md b/docs/MessageApi.md index 4edc6d1..9c17efe 100644 --- a/docs/MessageApi.md +++ b/docs/MessageApi.md @@ -476,8 +476,8 @@ Name | Type | Description | Required | Notes **after** | Option<**String**> | 投稿日時が指定日時より後 | | **before** | Option<**String**> | 投稿日時が指定日時より前 | | **r#in** | Option<**uuid::Uuid**> | メッセージが投稿されたチャンネル | | -**to** | Option<**uuid::Uuid**> | メンションされたユーザー | | -**from** | Option<**uuid::Uuid**> | メッセージを投稿したユーザー | | +**to** | Option<[**Vec**](uuid::Uuid.md)> | メンションされたユーザー | | +**from** | Option<[**Vec**](uuid::Uuid.md)> | メッセージを投稿したユーザー | | **citation** | Option<**uuid::Uuid**> | 引用しているメッセージ | | **bot** | Option<**bool**> | メッセージを投稿したユーザーがBotかどうか | | **has_url** | Option<**bool**> | メッセージがURLを含むか | | diff --git a/docs/NotificationApi.md b/docs/NotificationApi.md index b5cc03c..6023009 100644 --- a/docs/NotificationApi.md +++ b/docs/NotificationApi.md @@ -286,7 +286,7 @@ Name | Type | Description | Required | Notes > ws() WebSocket通知ストリームに接続します -# WebSocketプロトコル ## 送信 `コマンド:引数1:引数2:...`のような形式のTextMessageをサーバーに送信することで、このWebSocketセッションに対する設定が実行できる。 ### `viewstate`コマンド このWebSocketセッションが見ているチャンネル(イベントを受け取るチャンネル)を設定する。 現時点では1つのセッションに対して1つのチャンネルしか設定できない。 `viewstate:{チャンネルID}:{閲覧状態}` + チャンネルID: 対象のチャンネルID + 閲覧状態: `none`, `monitoring`, `editing` 最初の`viewstate`コマンドを送る前、または`viewstate:null`, `viewstate:`を送信した後は、このセッションはどこのチャンネルも見ていないことになる。 ### `rtcstate`コマンド 自分のWebRTC状態を変更する。 他のコネクションが既に状態を保持している場合、変更することができません。 `rtcstate:{チャンネルID}:({状態}:{セッションID})*` コネクションが切断された場合、自分のWebRTC状態はリセットされます。 ### `timeline_streaming`コマンド 全てのパブリックチャンネルの`MESSAGE_CREATED`イベントを受け取るかどうかを設定する。 初期状態は`off`です。 `timeline_streaming:(on|off|true|false)` ## 受信 TextMessageとして各種イベントが`type`と`body`を持つJSONとして非同期に送られます。 例: ```json {\"type\":\"USER_ONLINE\",\"body\":{\"id\":\"7dd8e07f-7f5d-4331-9176-b56a4299768b\"}} ``` ## イベント一覧 ### `USER_JOINED` ユーザーが新規登録された。 対象: 全員 + `id`: 登録されたユーザーのId ### `USER_UPDATED` ユーザーの情報が更新された。 対象: 全員 + `id`: 情報が更新されたユーザーのId ### `USER_TAGS_UPDATED` ユーザーのタグが更新された。 対象: 全員 + `id`: タグが更新されたユーザーのId + `tag_id`: 更新されたタグのId ### `USER_ICON_UPDATED` ユーザーのアイコンが更新された。 対象: 全員 + `id`: アイコンが更新されたユーザーのId ### `USER_WEBRTC_STATE_CHANGED` ユーザーのWebRTCの状態が変化した 対象: 全員 + `user_id`: 変更があったユーザーのId + `channel_id`: ユーザーの変更後の接続チャンネルのId + `sessions`: ユーザーの変更後の状態(配列) + `state`: 状態 + `sessionId`: セッションID ### `USER_VIEWSTATE_CHANGED` ユーザーのチャンネルの閲覧状態が変化した 対象: 変化したWSセッションを含めた、該当ユーザーのWSセッション全て + `view_states`: 変化したWSセッションを含めた、該当ユーザーの変更後の状態(配列) + `key`: WSセッションの識別子 + `channel_id`: 閲覧しているチャンネルId + `state`: 閲覧状態 ### `USER_ONLINE` ユーザーがオンラインになった。 対象: 全員 + `id`: オンラインになったユーザーのId ### `USER_OFFLINE` ユーザーがオフラインになった。 対象: 全員 + `id`: オフラインになったユーザーのId ### `USER_GROUP_CREATED` ユーザーグループが作成された 対象: 全員 + `id`: 作成されたユーザーグループのId ### `USER_GROUP_UPDATED` ユーザーグループが更新された 対象: 全員 + `id`: 作成されたユーザーグループのId ### `USER_GROUP_DELETED` ユーザーグループが削除された 対象: 全員 + `id`: 削除されたユーザーグループのId ### `CHANNEL_CREATED` チャンネルが新規作成された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 作成されたチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_UPDATED` チャンネルの情報が変更された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 変更があったチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_DELETED` チャンネルが削除された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 削除されたチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_STARED` 自分がチャンネルをスターした。 対象: 自分 + `id`: スターしたチャンネルのId ### `CHANNEL_UNSTARED` 自分がチャンネルのスターを解除した。 対象: 自分 + `id`: スターしたチャンネルのId ### `CHANNEL_VIEWERS_CHANGED` チャンネルの閲覧者が変化した。 対象: 該当チャンネルを閲覧しているユーザー + `id`: 変化したチャンネルのId + `viewers`: 変化後の閲覧者(配列) + `userId`: ユーザーId + `state`: 閲覧状態 + `updatedAt`: 閲覧状態の更新日時 ### `CHANNEL_SUBSCRIBERS_CHANGED` チャンネルの購読者が変化した。 対象: 該当チャンネルを閲覧しているユーザー + `id`: 変化したチャンネルのId ### `MESSAGE_CREATED` メッセージが投稿された。 対象: 投稿チャンネルを閲覧しているユーザー・投稿チャンネルに通知をつけているユーザー・メンションを受けたユーザー + `id`: 投稿されたメッセージのId + `is_citing`: 投稿されたメッセージがWebSocketを接続しているユーザーの投稿を引用しているかどうか ### `MESSAGE_UPDATED` メッセージが更新された。 対象: 投稿チャンネルを閲覧しているユーザー + `id`: 更新されたメッセージのId ### `MESSAGE_DELETED` メッセージが削除された。 対象: 投稿チャンネルを閲覧しているユーザー + `id`: 削除されたメッセージのId ### `MESSAGE_STAMPED` メッセージにスタンプが押された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: メッセージId + `user_id`: スタンプを押したユーザーのId + `stamp_id`: スタンプのId + `count`: そのユーザーが押した数 + `created_at`: そのユーザーがそのスタンプをそのメッセージに最初に押した日時 ### `MESSAGE_UNSTAMPED` メッセージからスタンプが外された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: メッセージId + `user_id`: スタンプを押したユーザーのId + `stamp_id`: スタンプのId ### `MESSAGE_PINNED` メッセージがピン留めされた。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: ピンされたメッセージのID + `channel_id`: ピンされたメッセージのチャンネルID ### `MESSAGE_UNPINNED` ピン留めされたメッセージのピンが外された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: ピンが外されたメッセージのID + `channel_id`: ピンが外されたメッセージのチャンネルID ### `MESSAGE_READ` 自分があるチャンネルのメッセージを読んだ。 対象: 自分 + `id`: 読んだチャンネルId ### `STAMP_CREATED` スタンプが新しく追加された。 対象: 全員 + `id`: 作成されたスタンプのId ### `STAMP_UPDATED` スタンプが修正された。 対象: 全員 + `id`: 修正されたスタンプのId ### `STAMP_DELETED` スタンプが削除された。 対象: 全員 + `id`: 削除されたスタンプのId ### `STAMP_PALETTE_CREATED` スタンプパレットが新しく追加された。 対象: 自分 + `id`: 作成されたスタンプパレットのId ### `STAMP_PALETTE_UPDATED` スタンプパレットが修正された。 対象: 自分 + `id`: 修正されたスタンプパレットのId ### `STAMP_PALETTE_DELETED` スタンプパレットが削除された。 対象: 自分 + `id`: 削除されたスタンプパレットのId ### `CLIP_FOLDER_CREATED` クリップフォルダーが作成された。 対象:自分 + `id`: 作成されたクリップフォルダーのId ### `CLIP_FOLDER_UPDATED` クリップフォルダーが修正された。 対象: 自分 + `id`: 更新されたクリップフォルダーのId ### `CLIP_FOLDER_DELETED` クリップフォルダーが削除された。 対象: 自分 + `id`: 削除されたクリップフォルダーのId ### `CLIP_FOLDER_MESSAGE_DELETED` クリップフォルダーからメッセージが除外された。 対象: 自分 + `folder_id`: メッセージが除外されたクリップフォルダーのId + `message_id`: クリップフォルダーから除外されたメッセージのId ### `CLIP_FOLDER_MESSAGE_ADDED` クリップフォルダーにメッセージが追加された。 対象: 自分 + `folder_id`: メッセージが追加されたクリップフォルダーのId + `message_id`: クリップフォルダーに追加されたメッセージのId +# WebSocketプロトコル ## 送信 `コマンド:引数1:引数2:...`のような形式のTextMessageをサーバーに送信することで、このWebSocketセッションに対する設定が実行できる。 ### `viewstate`コマンド このWebSocketセッションが見ているチャンネル(イベントを受け取るチャンネル)を設定する。 現時点では1つのセッションに対して1つのチャンネルしか設定できない。 `viewstate:{チャンネルID}:{閲覧状態}` + チャンネルID: 対象のチャンネルID + 閲覧状態: `none`, `monitoring`, `editing` 最初の`viewstate`コマンドを送る前、または`viewstate:null`, `viewstate:`を送信した後は、このセッションはどこのチャンネルも見ていないことになる。 ### `rtcstate`コマンド 自分のWebRTC状態を変更する。 他のコネクションが既に状態を保持している場合、変更することができません。 `rtcstate:{チャンネルID}:({状態}:{セッションID})*` コネクションが切断された場合、自分のWebRTC状態はリセットされます。 ### `timeline_streaming`コマンド 全てのパブリックチャンネルの`MESSAGE_CREATED`イベントを受け取るかどうかを設定する。 初期状態は`off`です。 `timeline_streaming:(on|off|true|false)` ## 受信 TextMessageとして各種イベントが`type`と`body`を持つJSONとして非同期に送られます。 例: ```json {\"type\":\"USER_ONLINE\",\"body\":{\"id\":\"7dd8e07f-7f5d-4331-9176-b56a4299768b\"}} ``` ## イベント一覧 ### `USER_JOINED` ユーザーが新規登録された。 対象: 全員 + `id`: 登録されたユーザーのId ### `USER_UPDATED` ユーザーの情報が更新された。 対象: 全員 + `id`: 情報が更新されたユーザーのId ### `USER_TAGS_UPDATED` ユーザーのタグが更新された。 対象: 全員 + `id`: タグが更新されたユーザーのId + `tag_id`: 更新されたタグのId ### `USER_ICON_UPDATED` ユーザーのアイコンが更新された。 対象: 全員 + `id`: アイコンが更新されたユーザーのId ### `USER_WEBRTC_STATE_CHANGED` ユーザーのWebRTCの状態が変化した 対象: 全員 + `user_id`: 変更があったユーザーのId + `channel_id`: ユーザーの変更後の接続チャンネルのId + `sessions`: ユーザーの変更後の状態(配列) + `state`: 状態 + `sessionId`: セッションID ### `USER_VIEWSTATE_CHANGED` ユーザーのチャンネルの閲覧状態が変化した 対象: 変化したWSセッションを含めた、該当ユーザーのWSセッション全て + `view_states`: 変化したWSセッションを含めた、該当ユーザーの変更後の状態(配列) + `key`: WSセッションの識別子 + `channel_id`: 閲覧しているチャンネルId + `state`: 閲覧状態 ### `USER_ONLINE` ユーザーがオンラインになった。 対象: 全員 + `id`: オンラインになったユーザーのId ### `USER_OFFLINE` ユーザーがオフラインになった。 対象: 全員 + `id`: オフラインになったユーザーのId ### `USER_GROUP_CREATED` ユーザーグループが作成された 対象: 全員 + `id`: 作成されたユーザーグループのId ### `USER_GROUP_UPDATED` ユーザーグループが更新された 対象: 全員 + `id`: 作成されたユーザーグループのId ### `USER_GROUP_DELETED` ユーザーグループが削除された 対象: 全員 + `id`: 削除されたユーザーグループのId ### `CHANNEL_CREATED` チャンネルが新規作成された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 作成されたチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_UPDATED` チャンネルの情報が変更された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 変更があったチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_DELETED` チャンネルが削除された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 削除されたチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_STARED` 自分がチャンネルをスターした。 対象: 自分 + `id`: スターしたチャンネルのId ### `CHANNEL_UNSTARED` 自分がチャンネルのスターを解除した。 対象: 自分 + `id`: スターしたチャンネルのId ### `CHANNEL_VIEWERS_CHANGED` チャンネルの閲覧者が変化した。 対象: 該当チャンネルを閲覧しているユーザー + `id`: 変化したチャンネルのId + `viewers`: 変化後の閲覧者(配列) + `userId`: ユーザーId + `state`: 閲覧状態 + `updatedAt`: 閲覧状態の更新日時 ### `CHANNEL_SUBSCRIBERS_CHANGED` チャンネルの購読者が変化した。 対象: 該当チャンネルを閲覧しているユーザー + `id`: 変化したチャンネルのId ### `MESSAGE_CREATED` メッセージが投稿された。 対象: 投稿チャンネルを閲覧しているユーザー・投稿チャンネルに通知をつけているユーザー・メンションを受けたユーザー + `id`: 投稿されたメッセージのId + `is_citing`: 投稿されたメッセージがWebSocketを接続しているユーザーの投稿を引用しているかどうか ### `MESSAGE_UPDATED` メッセージが更新された。 対象: 投稿チャンネルを閲覧しているユーザー + `id`: 更新されたメッセージのId ### `MESSAGE_DELETED` メッセージが削除された。 対象: 投稿チャンネルを閲覧しているユーザー + `id`: 削除されたメッセージのId ### `MESSAGE_STAMPED` メッセージにスタンプが押された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: メッセージId + `user_id`: スタンプを押したユーザーのId + `stamp_id`: スタンプのId + `count`: そのユーザーが押した数 + `created_at`: そのユーザーがそのスタンプをそのメッセージに最初に押した日時 ### `MESSAGE_UNSTAMPED` メッセージからスタンプが外された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: メッセージId + `user_id`: スタンプを押したユーザーのId + `stamp_id`: スタンプのId ### `MESSAGE_PINNED` メッセージがピン留めされた。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: ピンされたメッセージのID + `channel_id`: ピンされたメッセージのチャンネルID ### `MESSAGE_UNPINNED` ピン留めされたメッセージのピンが外された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: ピンが外されたメッセージのID + `channel_id`: ピンが外されたメッセージのチャンネルID ### `MESSAGE_READ` 自分があるチャンネルのメッセージを読んだ。 対象: 自分 + `id`: 読んだチャンネルId ### `STAMP_CREATED` スタンプが新しく追加された。 対象: 全員 + `id`: 作成されたスタンプのId ### `STAMP_UPDATED` スタンプが修正された。 対象: 全員 + `id`: 修正されたスタンプのId ### `STAMP_DELETED` スタンプが削除された。 対象: 全員 + `id`: 削除されたスタンプのId ### `STAMP_PALETTE_CREATED` スタンプパレットが新しく追加された。 対象: 自分 + `id`: 作成されたスタンプパレットのId ### `STAMP_PALETTE_UPDATED` スタンプパレットが修正された。 対象: 自分 + `id`: 修正されたスタンプパレットのId ### `STAMP_PALETTE_DELETED` スタンプパレットが削除された。 対象: 自分 + `id`: 削除されたスタンプパレットのId ### `CLIP_FOLDER_CREATED` クリップフォルダーが作成された。 対象:自分 + `id`: 作成されたクリップフォルダーのId ### `CLIP_FOLDER_UPDATED` クリップフォルダーが修正された。 対象: 自分 + `id`: 更新されたクリップフォルダーのId ### `CLIP_FOLDER_DELETED` クリップフォルダーが削除された。 対象: 自分 + `id`: 削除されたクリップフォルダーのId ### `CLIP_FOLDER_MESSAGE_DELETED` クリップフォルダーからメッセージが除外された。 対象: 自分 + `folder_id`: メッセージが除外されたクリップフォルダーのId + `message_id`: クリップフォルダーから除外されたメッセージのId ### `CLIP_FOLDER_MESSAGE_ADDED` クリップフォルダーにメッセージが追加された。 対象: 自分 + `folder_id`: メッセージが追加されたクリップフォルダーのId + `message_id`: クリップフォルダーに追加されたメッセージのId ### `QALL_ROOM_STATE_CHANGED` ルーム状態が変更された。 対象: 全員 + `room_id`: 変更されたルームのId + `state`: 変更後のルーム状態 + `roomId`: ルームのID + `participants`: ルーム内の参加者(配列) + `identity`: ユーザーID_RandomUUID + `name`: 表示名 + `joinedAt`: 参加した時刻 + `attributes`: ユーザーに関連付けられたカスタム属性 + `canPublish`: 発言権限 + `isWebinar`: ウェビナールームかどうか + `metadata`: ルームに関連付けられたカスタム属性 ### `QALL_SOUNDBOARD_ITEM_CREATED` サウンドボードアイテムが作成された。 対象: 全員 + `sound_id`: 作成されたサウンドのId + `name`: サウンド名 + `creator_id`: 作成者のId ### `QALL_SOUNDBOARD_ITEM_DELETED` サウンドボードアイテムが削除された。 対象: 全員 + `sound_id`: 削除されたサウンドのId ### Parameters diff --git a/docs/QallApi.md b/docs/QallApi.md new file mode 100644 index 0000000..1f17041 --- /dev/null +++ b/docs/QallApi.md @@ -0,0 +1,314 @@ +# \QallApi + +All URIs are relative to *https://q.trap.jp/api/v3* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**change_participant_role**](QallApi.md#change_participant_role) | **PATCH** /qall/rooms/{roomId}/participants | ルームでの発言権限を変更 +[**get_live_kit_token**](QallApi.md#get_live_kit_token) | **GET** /qall/token | LiveKitトークンを取得 +[**get_qall_endpoints**](QallApi.md#get_qall_endpoints) | **GET** /qall/endpoints | LiveKitエンドポイントを取得 +[**get_room_metadata**](QallApi.md#get_room_metadata) | **GET** /qall/rooms/{roomId}/metadata | ルームのメタデータを取得 +[**get_rooms**](QallApi.md#get_rooms) | **GET** /qall/rooms | ルームと参加者の一覧を取得 +[**get_soundboard_list**](QallApi.md#get_soundboard_list) | **GET** /qall/soundboard | サウンドボード用の音声一覧を取得 +[**live_kit_webhook**](QallApi.md#live_kit_webhook) | **POST** /qall/webhook | LiveKit Webhook受信 +[**post_soundboard**](QallApi.md#post_soundboard) | **POST** /qall/soundboard | サウンドボード用の短い音声ファイルをアップロード +[**post_soundboard_play**](QallApi.md#post_soundboard_play) | **POST** /qall/soundboard/play | アップロード済み音声を LiveKit ルームで再生 +[**update_room_metadata**](QallApi.md#update_room_metadata) | **PATCH** /qall/rooms/{roomId}/metadata | ルームのメタデータを更新 + + + +## change_participant_role + +> crate::models::QallParticipantResponse change_participant_role(room_id, qall_participant_request) +ルームでの発言権限を変更 + +ルーム内の参加者の発言権限を変更します。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**room_id** | **uuid::Uuid** | ルームUUID | [required] | +**qall_participant_request** | [**Vec**](qallParticipantRequest.md) | 発言権限を変更する参加者の情報 | [required] | + +### Return type + +[**crate::models::QallParticipantResponse**](qallParticipantResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **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_live_kit_token + +> crate::models::QallTokenResponse get_live_kit_token(room_id, is_webinar) +LiveKitトークンを取得 + +指定したルームに参加するためのLiveKitトークンを取得します。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**room_id** | Option<**uuid::Uuid**> | ルームUUID | | +**is_webinar** | Option<**bool**> | ウェビナールームかどうか(デフォルト false) | | + +### Return type + +[**crate::models::QallTokenResponse**](qallTokenResponse.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_qall_endpoints + +> crate::models::QallEndpointResponse get_qall_endpoints() +LiveKitエンドポイントを取得 + +接続可能なLiveKitエンドポイントを取得します。 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::QallEndpointResponse**](qallEndpointResponse.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_room_metadata + +> crate::models::QallMetadataResponse get_room_metadata(room_id) +ルームのメタデータを取得 + +ルームのメタデータを取得します。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**room_id** | **uuid::Uuid** | ルームUUID | [required] | + +### Return type + +[**crate::models::QallMetadataResponse**](qallMetadataResponse.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_rooms + +> Vec get_rooms() +ルームと参加者の一覧を取得 + +現在存在する(またはアクティブな)ルームと、そのルームに所属している参加者情報を取得します。 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](qallRoomWithParticipants.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_soundboard_list + +> Vec get_soundboard_list() +サウンドボード用の音声一覧を取得 + +DBに保存されたサウンドボード情報を取得します。 各アイテムには soundId, soundName, stampId が含まれます。 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](soundboardItem.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) + + +## live_kit_webhook + +> live_kit_webhook(body) +LiveKit Webhook受信 + +LiveKit側で設定したWebhookから呼び出されるエンドポイントです。 参加者の入室・退出などのイベントを受け取り、サーバ内で処理を行います。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | **serde_json::Value** | | [required] | + +### Return type + + (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/webhook+json +- **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) + + +## post_soundboard + +> crate::models::SoundboardUploadResponse post_soundboard(audio, sound_name, stamp_id) +サウンドボード用の短い音声ファイルをアップロード + +15秒程度の短い音声ファイルを multipart/form-data で送信し、S3(互換ストレージ)にアップロードします。 クライアントは「soundName」というフィールドを送信し、それをDBに保存して関連付けを行います。 また、サーバ側で soundId を自動生成し、S3のファイル名に使用します。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**audio** | **std::path::PathBuf** | アップロードする音声ファイル(20秒以内) | [required] | +**sound_name** | **String** | ユーザが自由につけるサウンド名 | [required] | +**stamp_id** | Option<**String**> | アイコンスタンプID | | + +### Return type + +[**crate::models::SoundboardUploadResponse**](soundboardUploadResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **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) + + +## post_soundboard_play + +> crate::models::SoundboardPlayResponse post_soundboard_play(soundboard_play_request) +アップロード済み音声を LiveKit ルームで再生 + +S3上にある音声ファイルの署名付きURLを生成し、 Ingressを介して指定ルームに音声を流します。 該当ルームに参加しているユーザであれば再生可能とします。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**soundboard_play_request** | [**SoundboardPlayRequest**](SoundboardPlayRequest.md) | | [required] | + +### Return type + +[**crate::models::SoundboardPlayResponse**](soundboardPlayResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## update_room_metadata + +> update_room_metadata(room_id, qall_metadata_request) +ルームのメタデータを更新 + +ルームのメタデータを更新します。 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**room_id** | **uuid::Uuid** | ルームUUID | [required] | +**qall_metadata_request** | [**QallMetadataRequest**](QallMetadataRequest.md) | ルームのメタデータ | [required] | + +### Return type + + (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + diff --git a/docs/QallEndpointResponse.md b/docs/QallEndpointResponse.md new file mode 100644 index 0000000..95a8072 --- /dev/null +++ b/docs/QallEndpointResponse.md @@ -0,0 +1,11 @@ +# QallEndpointResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint** | **String** | LiveKitのエンドポイント | + +[[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/QallMetadataRequest.md b/docs/QallMetadataRequest.md new file mode 100644 index 0000000..2096fe0 --- /dev/null +++ b/docs/QallMetadataRequest.md @@ -0,0 +1,11 @@ +# QallMetadataRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata** | Option<**String**> | ルームに関連付けられたカスタム属性 | [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/QallMetadataResponse.md b/docs/QallMetadataResponse.md new file mode 100644 index 0000000..aed99a1 --- /dev/null +++ b/docs/QallMetadataResponse.md @@ -0,0 +1,11 @@ +# QallMetadataResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata** | Option<**String**> | ルームに関連付けられたカスタム属性 | [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/QallParticipant.md b/docs/QallParticipant.md new file mode 100644 index 0000000..8a27fab --- /dev/null +++ b/docs/QallParticipant.md @@ -0,0 +1,15 @@ +# QallParticipant + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identity** | Option<**String**> | ユーザーID_RandomUUID | [optional] +**name** | Option<**String**> | 表示名 | [optional] +**joined_at** | Option<**String**> | 参加した時刻 | [optional] +**attributes** | Option<**::std::collections::HashMap**> | ユーザーに関連付けられたカスタム属性 | [optional] +**can_publish** | Option<**bool**> | 発言権限 | [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/QallParticipantRequest.md b/docs/QallParticipantRequest.md new file mode 100644 index 0000000..3bcecde --- /dev/null +++ b/docs/QallParticipantRequest.md @@ -0,0 +1,11 @@ +# QallParticipantRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**Vec**](qallParticipantRequest_users_inner.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/QallParticipantRequestUsersInner.md b/docs/QallParticipantRequestUsersInner.md new file mode 100644 index 0000000..8128eaa --- /dev/null +++ b/docs/QallParticipantRequestUsersInner.md @@ -0,0 +1,12 @@ +# QallParticipantRequestUsersInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | Option<**String**> | ユーザーID | [optional] +**can_publish** | Option<**bool**> | 発言権限 | [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/QallParticipantResponse.md b/docs/QallParticipantResponse.md new file mode 100644 index 0000000..60da99c --- /dev/null +++ b/docs/QallParticipantResponse.md @@ -0,0 +1,11 @@ +# QallParticipantResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | Option<[**Vec**](qallParticipantResponse_results_inner.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/QallParticipantResponseResultsInner.md b/docs/QallParticipantResponseResultsInner.md new file mode 100644 index 0000000..ce2e4c8 --- /dev/null +++ b/docs/QallParticipantResponseResultsInner.md @@ -0,0 +1,13 @@ +# QallParticipantResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**participant_id** | Option<**String**> | 対象参加者ID | [optional] +**status** | Option<**String**> | success もしくは error | [optional] +**error_message** | Option<**String**> | エラーがある場合の詳細 | [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/QallRoomStateChangedEvent.md b/docs/QallRoomStateChangedEvent.md new file mode 100644 index 0000000..48a773b --- /dev/null +++ b/docs/QallRoomStateChangedEvent.md @@ -0,0 +1,11 @@ +# QallRoomStateChangedEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**room_states** | [**Vec**](QallRoomStateChangedEvent_roomStates_inner.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/QallRoomStateChangedEventRoomStatesInner.md b/docs/QallRoomStateChangedEventRoomStatesInner.md new file mode 100644 index 0000000..1f69526 --- /dev/null +++ b/docs/QallRoomStateChangedEventRoomStatesInner.md @@ -0,0 +1,14 @@ +# QallRoomStateChangedEventRoomStatesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**room_id** | [**uuid::Uuid**](uuid::Uuid.md) | ルームのID | +**participants** | [**Vec**](QallRoomStateChangedEvent_roomStates_inner_participants_inner.md) | | +**is_webinar** | **bool** | ウェビナールームかどうか | +**metadata** | Option<**String**> | ルームに関連付けられたカスタム属性 | [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/QallRoomStateChangedEventRoomStatesInnerParticipantsInner.md b/docs/QallRoomStateChangedEventRoomStatesInnerParticipantsInner.md new file mode 100644 index 0000000..fa2d855 --- /dev/null +++ b/docs/QallRoomStateChangedEventRoomStatesInnerParticipantsInner.md @@ -0,0 +1,15 @@ +# QallRoomStateChangedEventRoomStatesInnerParticipantsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identity** | **String** | ユーザーID_RandomUUID | +**name** | **String** | 表示名 | +**joined_at** | **String** | 参加した時刻 | +**attributes** | Option<**::std::collections::HashMap**> | | [optional] +**can_publish** | **bool** | 発言権限 | + +[[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/QallRoomWithParticipants.md b/docs/QallRoomWithParticipants.md new file mode 100644 index 0000000..bf79ddb --- /dev/null +++ b/docs/QallRoomWithParticipants.md @@ -0,0 +1,14 @@ +# QallRoomWithParticipants + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**room_id** | [**uuid::Uuid**](uuid::Uuid.md) | ルームのID | +**participants** | [**Vec**](qallParticipant.md) | | +**is_webinar** | Option<**bool**> | ウェビナールームかどうか | [optional] +**metadata** | Option<**String**> | ルームに関連付けられたカスタム属性 | [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/QallSoundboardItemCreatedEvent.md b/docs/QallSoundboardItemCreatedEvent.md new file mode 100644 index 0000000..afd0583 --- /dev/null +++ b/docs/QallSoundboardItemCreatedEvent.md @@ -0,0 +1,13 @@ +# QallSoundboardItemCreatedEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sound_id** | [**uuid::Uuid**](uuid::Uuid.md) | 作成されたサウンドボードアイテムのId | +**name** | **String** | 作成されたサウンドボードアイテムの名前 | +**creator_id** | [**uuid::Uuid**](uuid::Uuid.md) | 作成者の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/QallSoundboardItemDeletedEvent.md b/docs/QallSoundboardItemDeletedEvent.md new file mode 100644 index 0000000..ee4d267 --- /dev/null +++ b/docs/QallSoundboardItemDeletedEvent.md @@ -0,0 +1,11 @@ +# QallSoundboardItemDeletedEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sound_id** | [**uuid::Uuid**](uuid::Uuid.md) | 削除されたサウンドボードアイテムの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/QallTokenResponse.md b/docs/QallTokenResponse.md new file mode 100644 index 0000000..fa88d7f --- /dev/null +++ b/docs/QallTokenResponse.md @@ -0,0 +1,11 @@ +# QallTokenResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **String** | LiveKit用のJWTトークン | + +[[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 e3bb719..1f3d266 100644 --- a/docs/README.md +++ b/docs/README.md @@ -57,6 +57,7 @@ Class | Method | HTTP request | Description *ChannelApi* | [**get_channel**](ChannelApi.md#get_channel) | **GET** /channels/{channelId} | チャンネル情報を取得 *ChannelApi* | [**get_channel_bots**](ChannelApi.md#get_channel_bots) | **GET** /channels/{channelId}/bots | チャンネル参加中のBOTのリストを取得 *ChannelApi* | [**get_channel_events**](ChannelApi.md#get_channel_events) | **GET** /channels/{channelId}/events | チャンネルイベントのリストを取得 +*ChannelApi* | [**get_channel_path**](ChannelApi.md#get_channel_path) | **GET** /channels/{channelId}/path | 指定したチャンネルパスを取得 *ChannelApi* | [**get_channel_pins**](ChannelApi.md#get_channel_pins) | **GET** /channels/{channelId}/pins | チャンネルピンのリストを取得 *ChannelApi* | [**get_channel_stats**](ChannelApi.md#get_channel_stats) | **GET** /channels/{channelId}/stats | チャンネル統計情報を取得 *ChannelApi* | [**get_channel_subscribers**](ChannelApi.md#get_channel_subscribers) | **GET** /channels/{channelId}/subscribers | チャンネルの通知購読者のリストを取得 @@ -95,6 +96,7 @@ Class | Method | HTTP request | Description *GroupApi* | [**get_user_groups**](GroupApi.md#get_user_groups) | **GET** /groups | ユーザーグループのリストを取得 *GroupApi* | [**remove_user_group_admin**](GroupApi.md#remove_user_group_admin) | **DELETE** /groups/{groupId}/admins/{userId} | グループ管理者を削除 *GroupApi* | [**remove_user_group_member**](GroupApi.md#remove_user_group_member) | **DELETE** /groups/{groupId}/members/{userId} | グループメンバーを削除 +*GroupApi* | [**remove_user_group_members**](GroupApi.md#remove_user_group_members) | **DELETE** /groups/{groupId}/members | グループメンバーを一括削除 *MeApi* | [**add_my_star**](MeApi.md#add_my_star) | **POST** /users/me/stars | チャンネルをスターに追加 *MeApi* | [**add_my_user_tag**](MeApi.md#add_my_user_tag) | **POST** /users/me/tags | 自分にタグを追加 *MeApi* | [**change_my_icon**](MeApi.md#change_my_icon) | **PUT** /users/me/icon | 自分のアイコン画像を変更 @@ -172,6 +174,16 @@ Class | Method | HTTP request | Description *PinApi* | [**remove_pin**](PinApi.md#remove_pin) | **DELETE** /messages/{messageId}/pin | ピン留めを外す *PublicApi* | [**get_public_user_icon**](PublicApi.md#get_public_user_icon) | **GET** /public/icon/{username} | ユーザーのアイコン画像を取得 *PublicApi* | [**get_server_version**](PublicApi.md#get_server_version) | **GET** /version | バージョンを取得 +*QallApi* | [**change_participant_role**](QallApi.md#change_participant_role) | **PATCH** /qall/rooms/{roomId}/participants | ルームでの発言権限を変更 +*QallApi* | [**get_live_kit_token**](QallApi.md#get_live_kit_token) | **GET** /qall/token | LiveKitトークンを取得 +*QallApi* | [**get_qall_endpoints**](QallApi.md#get_qall_endpoints) | **GET** /qall/endpoints | LiveKitエンドポイントを取得 +*QallApi* | [**get_room_metadata**](QallApi.md#get_room_metadata) | **GET** /qall/rooms/{roomId}/metadata | ルームのメタデータを取得 +*QallApi* | [**get_rooms**](QallApi.md#get_rooms) | **GET** /qall/rooms | ルームと参加者の一覧を取得 +*QallApi* | [**get_soundboard_list**](QallApi.md#get_soundboard_list) | **GET** /qall/soundboard | サウンドボード用の音声一覧を取得 +*QallApi* | [**live_kit_webhook**](QallApi.md#live_kit_webhook) | **POST** /qall/webhook | LiveKit Webhook受信 +*QallApi* | [**post_soundboard**](QallApi.md#post_soundboard) | **POST** /qall/soundboard | サウンドボード用の短い音声ファイルをアップロード +*QallApi* | [**post_soundboard_play**](QallApi.md#post_soundboard_play) | **POST** /qall/soundboard/play | アップロード済み音声を LiveKit ルームで再生 +*QallApi* | [**update_room_metadata**](QallApi.md#update_room_metadata) | **PATCH** /qall/rooms/{roomId}/metadata | ルームのメタデータを更新 *StampApi* | [**add_message_stamp**](StampApi.md#add_message_stamp) | **POST** /messages/{messageId}/stamps/{stampId} | スタンプを押す *StampApi* | [**change_stamp_image**](StampApi.md#change_stamp_image) | **PUT** /stamps/{stampId}/image | スタンプ画像を変更 *StampApi* | [**create_stamp**](StampApi.md#create_stamp) | **POST** /stamps | スタンプを作成 @@ -219,6 +231,7 @@ Class | Method | HTTP request | Description *WebhookApi* | [**change_webhook_icon**](WebhookApi.md#change_webhook_icon) | **PUT** /webhooks/{webhookId}/icon | Webhookのアイコンを変更 *WebhookApi* | [**create_webhook**](WebhookApi.md#create_webhook) | **POST** /webhooks | Webhookを新規作成 *WebhookApi* | [**delete_webhook**](WebhookApi.md#delete_webhook) | **DELETE** /webhooks/{webhookId} | Webhookを削除 +*WebhookApi* | [**delete_webhook_message**](WebhookApi.md#delete_webhook_message) | **DELETE** /webhooks/:webhookID/messages/:messageID | Webhookの投稿メッセージを削除 *WebhookApi* | [**edit_webhook**](WebhookApi.md#edit_webhook) | **PATCH** /webhooks/{webhookId} | Webhook情報を変更 *WebhookApi* | [**get_webhook**](WebhookApi.md#get_webhook) | **GET** /webhooks/{webhookId} | Webhook情報を取得 *WebhookApi* | [**get_webhook_icon**](WebhookApi.md#get_webhook_icon) | **GET** /webhooks/{webhookId}/icon | Webhookのアイコンを取得 @@ -233,6 +246,7 @@ Class | Method | HTTP request | Description - [ActiveOAuth2Token](ActiveOAuth2Token.md) - [ActivityTimelineMessage](ActivityTimelineMessage.md) + - [AddUserGroupMemberRequest](AddUserGroupMemberRequest.md) - [Bot](Bot.md) - [BotDetail](BotDetail.md) - [BotEventLog](BotEventLog.md) @@ -245,6 +259,7 @@ Class | Method | HTTP request | Description - [ChannelEvent](ChannelEvent.md) - [ChannelEventDetail](ChannelEventDetail.md) - [ChannelList](ChannelList.md) + - [ChannelPath](ChannelPath.md) - [ChannelStats](ChannelStats.md) - [ChannelStatsStamp](ChannelStatsStamp.md) - [ChannelStatsUser](ChannelStatsUser.md) @@ -326,7 +341,26 @@ Class | Method | HTTP request | Description - [PutMyPasswordRequest](PutMyPasswordRequest.md) - [PutNotifyCitationRequest](PutNotifyCitationRequest.md) - [PutUserPasswordRequest](PutUserPasswordRequest.md) + - [QallEndpointResponse](QallEndpointResponse.md) + - [QallMetadataRequest](QallMetadataRequest.md) + - [QallMetadataResponse](QallMetadataResponse.md) + - [QallParticipant](QallParticipant.md) + - [QallParticipantRequest](QallParticipantRequest.md) + - [QallParticipantRequestUsersInner](QallParticipantRequestUsersInner.md) + - [QallParticipantResponse](QallParticipantResponse.md) + - [QallParticipantResponseResultsInner](QallParticipantResponseResultsInner.md) + - [QallRoomStateChangedEvent](QallRoomStateChangedEvent.md) + - [QallRoomStateChangedEventRoomStatesInner](QallRoomStateChangedEventRoomStatesInner.md) + - [QallRoomStateChangedEventRoomStatesInnerParticipantsInner](QallRoomStateChangedEventRoomStatesInnerParticipantsInner.md) + - [QallRoomWithParticipants](QallRoomWithParticipants.md) + - [QallSoundboardItemCreatedEvent](QallSoundboardItemCreatedEvent.md) + - [QallSoundboardItemDeletedEvent](QallSoundboardItemDeletedEvent.md) + - [QallTokenResponse](QallTokenResponse.md) - [Session](Session.md) + - [SoundboardItem](SoundboardItem.md) + - [SoundboardPlayRequest](SoundboardPlayRequest.md) + - [SoundboardPlayResponse](SoundboardPlayResponse.md) + - [SoundboardUploadResponse](SoundboardUploadResponse.md) - [Stamp](Stamp.md) - [StampHistoryEntry](StampHistoryEntry.md) - [StampPalette](StampPalette.md) diff --git a/docs/SoundboardItem.md b/docs/SoundboardItem.md new file mode 100644 index 0000000..4db5068 --- /dev/null +++ b/docs/SoundboardItem.md @@ -0,0 +1,14 @@ +# SoundboardItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sound_id** | **String** | サーバが発行したサウンドID | +**sound_name** | **String** | ユーザが指定した表示用のサウンド名 | +**stamp_id** | **String** | 任意のスタンプID等、サウンドに紐づく拡張情報 | +**creator_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/SoundboardPlayRequest.md b/docs/SoundboardPlayRequest.md new file mode 100644 index 0000000..87bbc7b --- /dev/null +++ b/docs/SoundboardPlayRequest.md @@ -0,0 +1,12 @@ +# SoundboardPlayRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sound_id** | **String** | サウンドID (DB登録済み) | +**room_name** | [**uuid::Uuid**](uuid::Uuid.md) | 再生させたいルームのUUID | + +[[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/SoundboardPlayResponse.md b/docs/SoundboardPlayResponse.md new file mode 100644 index 0000000..c19bd07 --- /dev/null +++ b/docs/SoundboardPlayResponse.md @@ -0,0 +1,13 @@ +# SoundboardPlayResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ingress_id** | **String** | 作成された Ingress のID | +**url** | Option<**String**> | 作成された Ingress のストリームURL等 | [optional] +**stream_key** | Option<**String**> | RTMP配信の場合のstream key | [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/SoundboardUploadResponse.md b/docs/SoundboardUploadResponse.md new file mode 100644 index 0000000..5467ec2 --- /dev/null +++ b/docs/SoundboardUploadResponse.md @@ -0,0 +1,11 @@ +# SoundboardUploadResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sound_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 4833713..97107f6 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** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MB,`Config.Imaging.MaxPixels`(default: 2560*1600)までのpng, jpeg, gif) | [required] | ### Return type diff --git a/docs/WebhookApi.md b/docs/WebhookApi.md index 15464f0..09e5574 100644 --- a/docs/WebhookApi.md +++ b/docs/WebhookApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**change_webhook_icon**](WebhookApi.md#change_webhook_icon) | **PUT** /webhooks/{webhookId}/icon | Webhookのアイコンを変更 [**create_webhook**](WebhookApi.md#create_webhook) | **POST** /webhooks | Webhookを新規作成 [**delete_webhook**](WebhookApi.md#delete_webhook) | **DELETE** /webhooks/{webhookId} | Webhookを削除 +[**delete_webhook_message**](WebhookApi.md#delete_webhook_message) | **DELETE** /webhooks/:webhookID/messages/:messageID | Webhookの投稿メッセージを削除 [**edit_webhook**](WebhookApi.md#edit_webhook) | **PATCH** /webhooks/{webhookId} | Webhook情報を変更 [**get_webhook**](WebhookApi.md#get_webhook) | **GET** /webhooks/{webhookId} | Webhook情報を取得 [**get_webhook_icon**](WebhookApi.md#get_webhook_icon) | **GET** /webhooks/{webhookId}/icon | Webhookのアイコンを取得 @@ -29,7 +30,7 @@ Webhookのアイコンを変更 Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **webhook_id** | **uuid::Uuid** | WebhookUUID | [required] | -**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] | +**file** | **std::path::PathBuf** | アイコン画像(2MB,`Config.Imaging.MaxPixels`(default: 2560*1600)までのpng, jpeg, gif) | [required] | ### Return type @@ -107,6 +108,35 @@ 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) +## delete_webhook_message + +> delete_webhook_message(webhook_id, message_id) +Webhookの投稿メッセージを削除 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**webhook_id** | **uuid::Uuid** | WebhookUUID | [required] | +**message_id** | **uuid::Uuid** | メッセージ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) + + ## edit_webhook > edit_webhook(webhook_id, patch_webhook_request) diff --git a/src/apis/bot_api.rs b/src/apis/bot_api.rs index 427effe..48903e0 100644 --- a/src/apis/bot_api.rs +++ b/src/apis/bot_api.rs @@ -199,7 +199,7 @@ pub async fn activate_bot( pub async fn change_bot_icon( configuration: &configuration::Configuration, bot_id: &str, - _file: std::path::PathBuf, + file: std::path::PathBuf, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -223,7 +223,7 @@ pub async fn change_bot_icon( 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_form = reqwest::multipart::Form::new(); + let mut local_var_form = reqwest::multipart::Form::new(); // TODO: support file upload for 'file' parameter local_var_req_builder = local_var_req_builder.multipart(local_var_form); diff --git a/src/apis/channel_api.rs b/src/apis/channel_api.rs index bb684b1..adc2bd5 100644 --- a/src/apis/channel_api.rs +++ b/src/apis/channel_api.rs @@ -78,6 +78,14 @@ pub enum GetChannelEventsError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_channel_path`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetChannelPathError { + Status404(), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_channel_pins`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -531,6 +539,53 @@ pub async fn get_channel_events( } } +pub async fn get_channel_path( + configuration: &configuration::Configuration, + channel_id: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/channels/{channelId}/path", + local_var_configuration.base_path, + channelId = crate::apis::urlencode(channel_id) + ); + 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_channel_pins( configuration: &configuration::Configuration, @@ -583,6 +638,7 @@ pub async fn get_channel_pins( pub async fn get_channel_stats( configuration: &configuration::Configuration, channel_id: &str, + exclude_deleted_messages: Option, ) -> Result> { let local_var_configuration = configuration; @@ -596,6 +652,10 @@ pub async fn get_channel_stats( 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_str) = exclude_deleted_messages { + local_var_req_builder = local_var_req_builder + .query(&[("exclude-deleted-messages", &local_var_str.to_string())]); + } 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()); @@ -775,6 +835,7 @@ pub async fn get_channel_viewers( pub async fn get_channels( configuration: &configuration::Configuration, include_dm: Option, + path: Option<&str>, ) -> Result> { let local_var_configuration = configuration; @@ -788,6 +849,10 @@ pub async fn get_channels( local_var_req_builder = local_var_req_builder.query(&[("include-dm", &local_var_str.to_string())]); } + if let Some(ref local_var_str) = path { + local_var_req_builder = + local_var_req_builder.query(&[("path", &local_var_str.to_string())]); + } 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()); diff --git a/src/apis/file_api.rs b/src/apis/file_api.rs index c2c6cd6..1011223 100644 --- a/src/apis/file_api.rs +++ b/src/apis/file_api.rs @@ -11,7 +11,7 @@ use reqwest; use super::{configuration, Error}; -use crate::{apis::ResponseContent, models::ThumbnailType}; +use crate::apis::ResponseContent; /// struct for typed errors of method [`delete_file`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -352,7 +352,7 @@ pub async fn get_thumbnail_image( /// 指定したチャンネルにファイルをアップロードします。 アーカイブされているチャンネルにはアップロード出来ません。 pub async fn post_file( configuration: &configuration::Configuration, - _file: std::path::PathBuf, + file: std::path::PathBuf, channel_id: &str, ) -> Result> { let local_var_configuration = configuration; diff --git a/src/apis/group_api.rs b/src/apis/group_api.rs index 0978d18..d369905 100644 --- a/src/apis/group_api.rs +++ b/src/apis/group_api.rs @@ -133,6 +133,15 @@ pub enum RemoveUserGroupMemberError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`remove_user_group_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveUserGroupMembersError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + /// 指定したグループに管理者を追加します。 対象のユーザーグループの管理者権限が必要です。 pub async fn add_user_group_admin( configuration: &configuration::Configuration, @@ -187,7 +196,7 @@ pub async fn add_user_group_admin( pub async fn add_user_group_member( configuration: &configuration::Configuration, group_id: &str, - user_group_member: Option, + add_user_group_member_request: Option, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -211,7 +220,7 @@ pub async fn add_user_group_member( 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()); }; - local_var_req_builder = local_var_req_builder.json(&user_group_member); + local_var_req_builder = local_var_req_builder.json(&add_user_group_member_request); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -237,7 +246,7 @@ pub async fn add_user_group_member( pub async fn change_user_group_icon( configuration: &configuration::Configuration, group_id: &str, - _file: std::path::PathBuf, + file: std::path::PathBuf, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -261,7 +270,7 @@ pub async fn change_user_group_icon( 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_form = reqwest::multipart::Form::new(); + let mut local_var_form = reqwest::multipart::Form::new(); // TODO: support file upload for 'file' parameter local_var_req_builder = local_var_req_builder.multipart(local_var_form); @@ -766,3 +775,51 @@ pub async fn remove_user_group_member( Err(Error::ResponseError(local_var_error)) } } + +/// 指定したグループから全てのメンバーを削除します。 対象のユーザーグループの管理者権限が必要です。 +pub async fn remove_user_group_members( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/groups/{groupId}/members", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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)) + } +} diff --git a/src/apis/me_api.rs b/src/apis/me_api.rs index 19075b4..df28a4e 100644 --- a/src/apis/me_api.rs +++ b/src/apis/me_api.rs @@ -343,7 +343,7 @@ pub async fn add_my_user_tag( /// 自分のアイコン画像を変更します。 pub async fn change_my_icon( configuration: &configuration::Configuration, - _file: std::path::PathBuf, + file: std::path::PathBuf, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -363,7 +363,7 @@ pub async fn change_my_icon( 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_form = reqwest::multipart::Form::new(); + let mut local_var_form = reqwest::multipart::Form::new(); // TODO: support file upload for 'file' parameter local_var_req_builder = local_var_req_builder.multipart(local_var_form); diff --git a/src/apis/message_api.rs b/src/apis/message_api.rs index 5ad7585..c294cd6 100644 --- a/src/apis/message_api.rs +++ b/src/apis/message_api.rs @@ -894,8 +894,8 @@ pub async fn search_messages( after: Option, before: Option, r#in: Option<&str>, - to: Option<&str>, - from: Option<&str>, + to: Option>, + from: Option>, citation: Option<&str>, bot: Option, has_url: Option, @@ -931,11 +931,42 @@ pub async fn search_messages( local_var_req_builder = local_var_req_builder.query(&[("in", &local_var_str.to_string())]); } if let Some(ref local_var_str) = to { - local_var_req_builder = local_var_req_builder.query(&[("to", &local_var_str.to_string())]); + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query( + &local_var_str + .into_iter() + .map(|p| ("to".to_owned(), p.to_string())) + .collect::>(), + ), + _ => local_var_req_builder.query(&[( + "to", + &local_var_str + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; } if let Some(ref local_var_str) = from { - local_var_req_builder = - local_var_req_builder.query(&[("from", &local_var_str.to_string())]); + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query( + &local_var_str + .into_iter() + .map(|p| ("from".to_owned(), p.to_string())) + .collect::>(), + ), + _ => local_var_req_builder.query(&[( + "from", + &local_var_str + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; } if let Some(ref local_var_str) = citation { local_var_req_builder = diff --git a/src/apis/mod.rs b/src/apis/mod.rs index 071f519..a7e26cd 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -106,6 +106,7 @@ pub mod oauth2_api; pub mod ogp_api; pub mod pin_api; pub mod public_api; +pub mod qall_api; pub mod stamp_api; pub mod star_api; pub mod user_api; diff --git a/src/apis/notification_api.rs b/src/apis/notification_api.rs index 173a864..a91f672 100644 --- a/src/apis/notification_api.rs +++ b/src/apis/notification_api.rs @@ -518,7 +518,7 @@ pub async fn set_channel_subscribers( } } -/// # WebSocketプロトコル ## 送信 `コマンド:引数1:引数2:...`のような形式のTextMessageをサーバーに送信することで、このWebSocketセッションに対する設定が実行できる。 ### `viewstate`コマンド このWebSocketセッションが見ているチャンネル(イベントを受け取るチャンネル)を設定する。 現時点では1つのセッションに対して1つのチャンネルしか設定できない。 `viewstate:{チャンネルID}:{閲覧状態}` + チャンネルID: 対象のチャンネルID + 閲覧状態: `none`, `monitoring`, `editing` 最初の`viewstate`コマンドを送る前、または`viewstate:null`, `viewstate:`を送信した後は、このセッションはどこのチャンネルも見ていないことになる。 ### `rtcstate`コマンド 自分のWebRTC状態を変更する。 他のコネクションが既に状態を保持している場合、変更することができません。 `rtcstate:{チャンネルID}:({状態}:{セッションID})*` コネクションが切断された場合、自分のWebRTC状態はリセットされます。 ### `timeline_streaming`コマンド 全てのパブリックチャンネルの`MESSAGE_CREATED`イベントを受け取るかどうかを設定する。 初期状態は`off`です。 `timeline_streaming:(on|off|true|false)` ## 受信 TextMessageとして各種イベントが`type`と`body`を持つJSONとして非同期に送られます。 例: ```json {\"type\":\"USER_ONLINE\",\"body\":{\"id\":\"7dd8e07f-7f5d-4331-9176-b56a4299768b\"}} ``` ## イベント一覧 ### `USER_JOINED` ユーザーが新規登録された。 対象: 全員 + `id`: 登録されたユーザーのId ### `USER_UPDATED` ユーザーの情報が更新された。 対象: 全員 + `id`: 情報が更新されたユーザーのId ### `USER_TAGS_UPDATED` ユーザーのタグが更新された。 対象: 全員 + `id`: タグが更新されたユーザーのId + `tag_id`: 更新されたタグのId ### `USER_ICON_UPDATED` ユーザーのアイコンが更新された。 対象: 全員 + `id`: アイコンが更新されたユーザーのId ### `USER_WEBRTC_STATE_CHANGED` ユーザーのWebRTCの状態が変化した 対象: 全員 + `user_id`: 変更があったユーザーのId + `channel_id`: ユーザーの変更後の接続チャンネルのId + `sessions`: ユーザーの変更後の状態(配列) + `state`: 状態 + `sessionId`: セッションID ### `USER_VIEWSTATE_CHANGED` ユーザーのチャンネルの閲覧状態が変化した 対象: 変化したWSセッションを含めた、該当ユーザーのWSセッション全て + `view_states`: 変化したWSセッションを含めた、該当ユーザーの変更後の状態(配列) + `key`: WSセッションの識別子 + `channel_id`: 閲覧しているチャンネルId + `state`: 閲覧状態 ### `USER_ONLINE` ユーザーがオンラインになった。 対象: 全員 + `id`: オンラインになったユーザーのId ### `USER_OFFLINE` ユーザーがオフラインになった。 対象: 全員 + `id`: オフラインになったユーザーのId ### `USER_GROUP_CREATED` ユーザーグループが作成された 対象: 全員 + `id`: 作成されたユーザーグループのId ### `USER_GROUP_UPDATED` ユーザーグループが更新された 対象: 全員 + `id`: 作成されたユーザーグループのId ### `USER_GROUP_DELETED` ユーザーグループが削除された 対象: 全員 + `id`: 削除されたユーザーグループのId ### `CHANNEL_CREATED` チャンネルが新規作成された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 作成されたチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_UPDATED` チャンネルの情報が変更された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 変更があったチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_DELETED` チャンネルが削除された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 削除されたチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_STARED` 自分がチャンネルをスターした。 対象: 自分 + `id`: スターしたチャンネルのId ### `CHANNEL_UNSTARED` 自分がチャンネルのスターを解除した。 対象: 自分 + `id`: スターしたチャンネルのId ### `CHANNEL_VIEWERS_CHANGED` チャンネルの閲覧者が変化した。 対象: 該当チャンネルを閲覧しているユーザー + `id`: 変化したチャンネルのId + `viewers`: 変化後の閲覧者(配列) + `userId`: ユーザーId + `state`: 閲覧状態 + `updatedAt`: 閲覧状態の更新日時 ### `CHANNEL_SUBSCRIBERS_CHANGED` チャンネルの購読者が変化した。 対象: 該当チャンネルを閲覧しているユーザー + `id`: 変化したチャンネルのId ### `MESSAGE_CREATED` メッセージが投稿された。 対象: 投稿チャンネルを閲覧しているユーザー・投稿チャンネルに通知をつけているユーザー・メンションを受けたユーザー + `id`: 投稿されたメッセージのId + `is_citing`: 投稿されたメッセージがWebSocketを接続しているユーザーの投稿を引用しているかどうか ### `MESSAGE_UPDATED` メッセージが更新された。 対象: 投稿チャンネルを閲覧しているユーザー + `id`: 更新されたメッセージのId ### `MESSAGE_DELETED` メッセージが削除された。 対象: 投稿チャンネルを閲覧しているユーザー + `id`: 削除されたメッセージのId ### `MESSAGE_STAMPED` メッセージにスタンプが押された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: メッセージId + `user_id`: スタンプを押したユーザーのId + `stamp_id`: スタンプのId + `count`: そのユーザーが押した数 + `created_at`: そのユーザーがそのスタンプをそのメッセージに最初に押した日時 ### `MESSAGE_UNSTAMPED` メッセージからスタンプが外された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: メッセージId + `user_id`: スタンプを押したユーザーのId + `stamp_id`: スタンプのId ### `MESSAGE_PINNED` メッセージがピン留めされた。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: ピンされたメッセージのID + `channel_id`: ピンされたメッセージのチャンネルID ### `MESSAGE_UNPINNED` ピン留めされたメッセージのピンが外された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: ピンが外されたメッセージのID + `channel_id`: ピンが外されたメッセージのチャンネルID ### `MESSAGE_READ` 自分があるチャンネルのメッセージを読んだ。 対象: 自分 + `id`: 読んだチャンネルId ### `STAMP_CREATED` スタンプが新しく追加された。 対象: 全員 + `id`: 作成されたスタンプのId ### `STAMP_UPDATED` スタンプが修正された。 対象: 全員 + `id`: 修正されたスタンプのId ### `STAMP_DELETED` スタンプが削除された。 対象: 全員 + `id`: 削除されたスタンプのId ### `STAMP_PALETTE_CREATED` スタンプパレットが新しく追加された。 対象: 自分 + `id`: 作成されたスタンプパレットのId ### `STAMP_PALETTE_UPDATED` スタンプパレットが修正された。 対象: 自分 + `id`: 修正されたスタンプパレットのId ### `STAMP_PALETTE_DELETED` スタンプパレットが削除された。 対象: 自分 + `id`: 削除されたスタンプパレットのId ### `CLIP_FOLDER_CREATED` クリップフォルダーが作成された。 対象:自分 + `id`: 作成されたクリップフォルダーのId ### `CLIP_FOLDER_UPDATED` クリップフォルダーが修正された。 対象: 自分 + `id`: 更新されたクリップフォルダーのId ### `CLIP_FOLDER_DELETED` クリップフォルダーが削除された。 対象: 自分 + `id`: 削除されたクリップフォルダーのId ### `CLIP_FOLDER_MESSAGE_DELETED` クリップフォルダーからメッセージが除外された。 対象: 自分 + `folder_id`: メッセージが除外されたクリップフォルダーのId + `message_id`: クリップフォルダーから除外されたメッセージのId ### `CLIP_FOLDER_MESSAGE_ADDED` クリップフォルダーにメッセージが追加された。 対象: 自分 + `folder_id`: メッセージが追加されたクリップフォルダーのId + `message_id`: クリップフォルダーに追加されたメッセージのId +/// # WebSocketプロトコル ## 送信 `コマンド:引数1:引数2:...`のような形式のTextMessageをサーバーに送信することで、このWebSocketセッションに対する設定が実行できる。 ### `viewstate`コマンド このWebSocketセッションが見ているチャンネル(イベントを受け取るチャンネル)を設定する。 現時点では1つのセッションに対して1つのチャンネルしか設定できない。 `viewstate:{チャンネルID}:{閲覧状態}` + チャンネルID: 対象のチャンネルID + 閲覧状態: `none`, `monitoring`, `editing` 最初の`viewstate`コマンドを送る前、または`viewstate:null`, `viewstate:`を送信した後は、このセッションはどこのチャンネルも見ていないことになる。 ### `rtcstate`コマンド 自分のWebRTC状態を変更する。 他のコネクションが既に状態を保持している場合、変更することができません。 `rtcstate:{チャンネルID}:({状態}:{セッションID})*` コネクションが切断された場合、自分のWebRTC状態はリセットされます。 ### `timeline_streaming`コマンド 全てのパブリックチャンネルの`MESSAGE_CREATED`イベントを受け取るかどうかを設定する。 初期状態は`off`です。 `timeline_streaming:(on|off|true|false)` ## 受信 TextMessageとして各種イベントが`type`と`body`を持つJSONとして非同期に送られます。 例: ```json {\"type\":\"USER_ONLINE\",\"body\":{\"id\":\"7dd8e07f-7f5d-4331-9176-b56a4299768b\"}} ``` ## イベント一覧 ### `USER_JOINED` ユーザーが新規登録された。 対象: 全員 + `id`: 登録されたユーザーのId ### `USER_UPDATED` ユーザーの情報が更新された。 対象: 全員 + `id`: 情報が更新されたユーザーのId ### `USER_TAGS_UPDATED` ユーザーのタグが更新された。 対象: 全員 + `id`: タグが更新されたユーザーのId + `tag_id`: 更新されたタグのId ### `USER_ICON_UPDATED` ユーザーのアイコンが更新された。 対象: 全員 + `id`: アイコンが更新されたユーザーのId ### `USER_WEBRTC_STATE_CHANGED` ユーザーのWebRTCの状態が変化した 対象: 全員 + `user_id`: 変更があったユーザーのId + `channel_id`: ユーザーの変更後の接続チャンネルのId + `sessions`: ユーザーの変更後の状態(配列) + `state`: 状態 + `sessionId`: セッションID ### `USER_VIEWSTATE_CHANGED` ユーザーのチャンネルの閲覧状態が変化した 対象: 変化したWSセッションを含めた、該当ユーザーのWSセッション全て + `view_states`: 変化したWSセッションを含めた、該当ユーザーの変更後の状態(配列) + `key`: WSセッションの識別子 + `channel_id`: 閲覧しているチャンネルId + `state`: 閲覧状態 ### `USER_ONLINE` ユーザーがオンラインになった。 対象: 全員 + `id`: オンラインになったユーザーのId ### `USER_OFFLINE` ユーザーがオフラインになった。 対象: 全員 + `id`: オフラインになったユーザーのId ### `USER_GROUP_CREATED` ユーザーグループが作成された 対象: 全員 + `id`: 作成されたユーザーグループのId ### `USER_GROUP_UPDATED` ユーザーグループが更新された 対象: 全員 + `id`: 作成されたユーザーグループのId ### `USER_GROUP_DELETED` ユーザーグループが削除された 対象: 全員 + `id`: 削除されたユーザーグループのId ### `CHANNEL_CREATED` チャンネルが新規作成された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 作成されたチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_UPDATED` チャンネルの情報が変更された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 変更があったチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_DELETED` チャンネルが削除された。 対象: 該当チャンネルを閲覧可能な全員 + `id`: 削除されたチャンネルのId + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId ### `CHANNEL_STARED` 自分がチャンネルをスターした。 対象: 自分 + `id`: スターしたチャンネルのId ### `CHANNEL_UNSTARED` 自分がチャンネルのスターを解除した。 対象: 自分 + `id`: スターしたチャンネルのId ### `CHANNEL_VIEWERS_CHANGED` チャンネルの閲覧者が変化した。 対象: 該当チャンネルを閲覧しているユーザー + `id`: 変化したチャンネルのId + `viewers`: 変化後の閲覧者(配列) + `userId`: ユーザーId + `state`: 閲覧状態 + `updatedAt`: 閲覧状態の更新日時 ### `CHANNEL_SUBSCRIBERS_CHANGED` チャンネルの購読者が変化した。 対象: 該当チャンネルを閲覧しているユーザー + `id`: 変化したチャンネルのId ### `MESSAGE_CREATED` メッセージが投稿された。 対象: 投稿チャンネルを閲覧しているユーザー・投稿チャンネルに通知をつけているユーザー・メンションを受けたユーザー + `id`: 投稿されたメッセージのId + `is_citing`: 投稿されたメッセージがWebSocketを接続しているユーザーの投稿を引用しているかどうか ### `MESSAGE_UPDATED` メッセージが更新された。 対象: 投稿チャンネルを閲覧しているユーザー + `id`: 更新されたメッセージのId ### `MESSAGE_DELETED` メッセージが削除された。 対象: 投稿チャンネルを閲覧しているユーザー + `id`: 削除されたメッセージのId ### `MESSAGE_STAMPED` メッセージにスタンプが押された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: メッセージId + `user_id`: スタンプを押したユーザーのId + `stamp_id`: スタンプのId + `count`: そのユーザーが押した数 + `created_at`: そのユーザーがそのスタンプをそのメッセージに最初に押した日時 ### `MESSAGE_UNSTAMPED` メッセージからスタンプが外された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: メッセージId + `user_id`: スタンプを押したユーザーのId + `stamp_id`: スタンプのId ### `MESSAGE_PINNED` メッセージがピン留めされた。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: ピンされたメッセージのID + `channel_id`: ピンされたメッセージのチャンネルID ### `MESSAGE_UNPINNED` ピン留めされたメッセージのピンが外された。 対象: 投稿チャンネルを閲覧しているユーザー + `message_id`: ピンが外されたメッセージのID + `channel_id`: ピンが外されたメッセージのチャンネルID ### `MESSAGE_READ` 自分があるチャンネルのメッセージを読んだ。 対象: 自分 + `id`: 読んだチャンネルId ### `STAMP_CREATED` スタンプが新しく追加された。 対象: 全員 + `id`: 作成されたスタンプのId ### `STAMP_UPDATED` スタンプが修正された。 対象: 全員 + `id`: 修正されたスタンプのId ### `STAMP_DELETED` スタンプが削除された。 対象: 全員 + `id`: 削除されたスタンプのId ### `STAMP_PALETTE_CREATED` スタンプパレットが新しく追加された。 対象: 自分 + `id`: 作成されたスタンプパレットのId ### `STAMP_PALETTE_UPDATED` スタンプパレットが修正された。 対象: 自分 + `id`: 修正されたスタンプパレットのId ### `STAMP_PALETTE_DELETED` スタンプパレットが削除された。 対象: 自分 + `id`: 削除されたスタンプパレットのId ### `CLIP_FOLDER_CREATED` クリップフォルダーが作成された。 対象:自分 + `id`: 作成されたクリップフォルダーのId ### `CLIP_FOLDER_UPDATED` クリップフォルダーが修正された。 対象: 自分 + `id`: 更新されたクリップフォルダーのId ### `CLIP_FOLDER_DELETED` クリップフォルダーが削除された。 対象: 自分 + `id`: 削除されたクリップフォルダーのId ### `CLIP_FOLDER_MESSAGE_DELETED` クリップフォルダーからメッセージが除外された。 対象: 自分 + `folder_id`: メッセージが除外されたクリップフォルダーのId + `message_id`: クリップフォルダーから除外されたメッセージのId ### `CLIP_FOLDER_MESSAGE_ADDED` クリップフォルダーにメッセージが追加された。 対象: 自分 + `folder_id`: メッセージが追加されたクリップフォルダーのId + `message_id`: クリップフォルダーに追加されたメッセージのId ### `QALL_ROOM_STATE_CHANGED` ルーム状態が変更された。 対象: 全員 + `room_id`: 変更されたルームのId + `state`: 変更後のルーム状態 + `roomId`: ルームのID + `participants`: ルーム内の参加者(配列) + `identity`: ユーザーID_RandomUUID + `name`: 表示名 + `joinedAt`: 参加した時刻 + `attributes`: ユーザーに関連付けられたカスタム属性 + `canPublish`: 発言権限 + `isWebinar`: ウェビナールームかどうか + `metadata`: ルームに関連付けられたカスタム属性 ### `QALL_SOUNDBOARD_ITEM_CREATED` サウンドボードアイテムが作成された。 対象: 全員 + `sound_id`: 作成されたサウンドのId + `name`: サウンド名 + `creator_id`: 作成者のId ### `QALL_SOUNDBOARD_ITEM_DELETED` サウンドボードアイテムが削除された。 対象: 全員 + `sound_id`: 削除されたサウンドのId pub async fn ws(configuration: &configuration::Configuration) -> Result<(), Error> { let local_var_configuration = configuration; diff --git a/src/apis/oauth2_api.rs b/src/apis/oauth2_api.rs index 5242c82..67e242f 100644 --- a/src/apis/oauth2_api.rs +++ b/src/apis/oauth2_api.rs @@ -11,10 +11,7 @@ use reqwest; use super::{configuration, Error}; -use crate::{ - apis::ResponseContent, - models::{OAuth2Prompt, OAuth2ResponseType}, -}; +use crate::apis::ResponseContent; /// struct for typed errors of method [`create_client`] #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/src/apis/qall_api.rs b/src/apis/qall_api.rs new file mode 100644 index 0000000..a66d683 --- /dev/null +++ b/src/apis/qall_api.rs @@ -0,0 +1,579 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +use reqwest; + +use super::{configuration, Error}; +use crate::apis::ResponseContent; + +/// struct for typed errors of method [`change_participant_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ChangeParticipantRoleError { + Status400(), + Status401(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_live_kit_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetLiveKitTokenError { + Status400(), + Status401(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_qall_endpoints`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetQallEndpointsError { + Status404(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_room_metadata`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRoomMetadataError { + Status404(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_rooms`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRoomsError { + Status404(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_soundboard_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSoundboardListError { + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`live_kit_webhook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LiveKitWebhookError { + Status400(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`post_soundboard`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PostSoundboardError { + Status400(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`post_soundboard_play`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PostSoundboardPlayError { + Status400(), + Status401(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_room_metadata`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateRoomMetadataError { + Status400(), + Status401(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// ルーム内の参加者の発言権限を変更します。 +pub async fn change_participant_role( + configuration: &configuration::Configuration, + room_id: &str, + qall_participant_request: Vec, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/qall/rooms/{roomId}/participants", + local_var_configuration.base_path, + roomId = crate::apis::urlencode(room_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PATCH, 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()); + }; + local_var_req_builder = local_var_req_builder.json(&qall_participant_request); + + 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)) + } +} + +/// 指定したルームに参加するためのLiveKitトークンを取得します。 +pub async fn get_live_kit_token( + configuration: &configuration::Configuration, + room_id: Option<&str>, + is_webinar: Option, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/qall/token", 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_str) = room_id { + local_var_req_builder = + local_var_req_builder.query(&[("roomId", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = is_webinar { + local_var_req_builder = + local_var_req_builder.query(&[("isWebinar", &local_var_str.to_string())]); + } + 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)) + } +} + +/// 接続可能なLiveKitエンドポイントを取得します。 +pub async fn get_qall_endpoints( + configuration: &configuration::Configuration, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/qall/endpoints", 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_room_metadata( + configuration: &configuration::Configuration, + room_id: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/qall/rooms/{roomId}/metadata", + local_var_configuration.base_path, + roomId = crate::apis::urlencode(room_id) + ); + 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_rooms( + configuration: &configuration::Configuration, +) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/qall/rooms", 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)) + } +} + +/// DBに保存されたサウンドボード情報を取得します。 各アイテムには soundId, soundName, stampId が含まれます。 +pub async fn get_soundboard_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/qall/soundboard", 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)) + } +} + +/// LiveKit側で設定したWebhookから呼び出されるエンドポイントです。 参加者の入室・退出などのイベントを受け取り、サーバ内で処理を行います。 +pub async fn live_kit_webhook( + configuration: &configuration::Configuration, + body: serde_json::Value, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/qall/webhook", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + 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)) + } +} + +/// 15秒程度の短い音声ファイルを multipart/form-data で送信し、S3(互換ストレージ)にアップロードします。 クライアントは「soundName」というフィールドを送信し、それをDBに保存して関連付けを行います。 また、サーバ側で soundId を自動生成し、S3のファイル名に使用します。 +pub async fn post_soundboard( + configuration: &configuration::Configuration, + audio: std::path::PathBuf, + sound_name: &str, + stamp_id: Option<&str>, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/qall/soundboard", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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 mut local_var_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'audio' parameter + local_var_form = local_var_form.text("soundName", sound_name.to_string()); + if let Some(local_var_param_value) = stamp_id { + local_var_form = local_var_form.text("stampId", local_var_param_value.to_string()); + } + local_var_req_builder = local_var_req_builder.multipart(local_var_form); + + 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)) + } +} + +/// S3上にある音声ファイルの署名付きURLを生成し、 Ingressを介して指定ルームに音声を流します。 該当ルームに参加しているユーザであれば再生可能とします。 +pub async fn post_soundboard_play( + configuration: &configuration::Configuration, + soundboard_play_request: crate::models::SoundboardPlayRequest, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/qall/soundboard/play", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + }; + local_var_req_builder = local_var_req_builder.json(&soundboard_play_request); + + 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 update_room_metadata( + configuration: &configuration::Configuration, + room_id: &str, + qall_metadata_request: crate::models::QallMetadataRequest, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/qall/rooms/{roomId}/metadata", + local_var_configuration.base_path, + roomId = crate::apis::urlencode(room_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PATCH, 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()); + }; + local_var_req_builder = local_var_req_builder.json(&qall_metadata_request); + + 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)) + } +} diff --git a/src/apis/stamp_api.rs b/src/apis/stamp_api.rs index 81baeab..da1f981 100644 --- a/src/apis/stamp_api.rs +++ b/src/apis/stamp_api.rs @@ -214,7 +214,7 @@ pub async fn add_message_stamp( pub async fn change_stamp_image( configuration: &configuration::Configuration, stamp_id: &str, - _file: std::path::PathBuf, + file: std::path::PathBuf, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -238,7 +238,7 @@ pub async fn change_stamp_image( 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_form = reqwest::multipart::Form::new(); + let mut local_var_form = reqwest::multipart::Form::new(); // TODO: support file upload for 'file' parameter local_var_req_builder = local_var_req_builder.multipart(local_var_form); @@ -266,7 +266,7 @@ pub async fn change_stamp_image( pub async fn create_stamp( configuration: &configuration::Configuration, name: &str, - _file: std::path::PathBuf, + file: std::path::PathBuf, ) -> Result> { let local_var_configuration = configuration; diff --git a/src/apis/user_api.rs b/src/apis/user_api.rs index 61a133d..0881736 100644 --- a/src/apis/user_api.rs +++ b/src/apis/user_api.rs @@ -203,7 +203,7 @@ pub async fn add_user_tag( pub async fn change_user_icon( configuration: &configuration::Configuration, user_id: &str, - _file: std::path::PathBuf, + file: std::path::PathBuf, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -227,7 +227,7 @@ pub async fn change_user_icon( 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_form = reqwest::multipart::Form::new(); + let mut local_var_form = reqwest::multipart::Form::new(); // TODO: support file upload for 'file' parameter local_var_req_builder = local_var_req_builder.multipart(local_var_form); diff --git a/src/apis/webhook_api.rs b/src/apis/webhook_api.rs index 76bf370..8e460d9 100644 --- a/src/apis/webhook_api.rs +++ b/src/apis/webhook_api.rs @@ -39,6 +39,15 @@ pub enum DeleteWebhookError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`delete_webhook_message`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteWebhookMessageError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`edit_webhook`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -93,7 +102,7 @@ pub enum PostWebhookError { pub async fn change_webhook_icon( configuration: &configuration::Configuration, webhook_id: &str, - _file: std::path::PathBuf, + file: std::path::PathBuf, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -117,7 +126,7 @@ pub async fn change_webhook_icon( 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_form = reqwest::multipart::Form::new(); + let mut local_var_form = reqwest::multipart::Form::new(); // TODO: support file upload for 'file' parameter local_var_req_builder = local_var_req_builder.multipart(local_var_form); @@ -234,6 +243,55 @@ pub async fn delete_webhook( } } +pub async fn delete_webhook_message( + configuration: &configuration::Configuration, + webhook_id: &str, + message_id: &str, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/webhooks/:webhookID/messages/:messageID", + local_var_configuration.base_path, + webhookId = crate::apis::urlencode(webhook_id), + messageId = crate::apis::urlencode(message_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)) + } +} + /// 指定したWebhookの情報を変更します。 pub async fn edit_webhook( configuration: &configuration::Configuration, diff --git a/src/models/add_user_group_member_request.rs b/src/models/add_user_group_member_request.rs new file mode 100644 index 0000000..c9fb945 --- /dev/null +++ b/src/models/add_user_group_member_request.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 AddUserGroupMemberRequest { + /// ユーザーUUID + #[serde(rename = "id")] + pub id: uuid::Uuid, + /// ユーザーの役割 + #[serde(rename = "role")] + pub role: String, +} + +impl AddUserGroupMemberRequest { + pub fn new(id: uuid::Uuid, role: String) -> AddUserGroupMemberRequest { + AddUserGroupMemberRequest { id, role } + } +} diff --git a/src/models/bot_state.rs b/src/models/bot_state.rs index 16f091e..03f04df 100644 --- a/src/models/bot_state.rs +++ b/src/models/bot_state.rs @@ -8,33 +8,31 @@ * Generated by: https://openapi-generator.tech */ -use serde_repr::{Deserialize_repr, Serialize_repr}; - /// BotState : BOT状態 0: 停止 1: 有効 2: 一時停止 /// BOT状態 0: 停止 1: 有効 2: 一時停止 -#[derive( - Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, -)] -#[repr(u8)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum BotState { - Deactivated = 0, - Active = 1, - Suspended = 2, + #[serde(rename = "0")] + deactivated, + #[serde(rename = "1")] + active, + #[serde(rename = "2")] + suspended, } impl ToString for BotState { fn to_string(&self) -> String { match self { - Self::Deactivated => String::from("0"), - Self::Active => String::from("1"), - Self::Suspended => String::from("2"), + Self::deactivated => String::from("0"), + Self::active => String::from("1"), + Self::suspended => String::from("2"), } } } impl Default for BotState { fn default() -> BotState { - Self::Deactivated + Self::deactivated } } diff --git a/src/models/channel_path.rs b/src/models/channel_path.rs new file mode 100644 index 0000000..d490d18 --- /dev/null +++ b/src/models/channel_path.rs @@ -0,0 +1,25 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// ChannelPath : チャンネルパス + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ChannelPath { + /// チャンネルパス + #[serde(rename = "path")] + pub path: String, +} + +impl ChannelPath { + /// チャンネルパス + pub fn new(path: String) -> ChannelPath { + ChannelPath { path } + } +} diff --git a/src/models/channel_subscribe_level.rs b/src/models/channel_subscribe_level.rs index 701c646..f3c0b66 100644 --- a/src/models/channel_subscribe_level.rs +++ b/src/models/channel_subscribe_level.rs @@ -8,33 +8,31 @@ * Generated by: https://openapi-generator.tech */ -use serde_repr::{Deserialize_repr, Serialize_repr}; - /// ChannelSubscribeLevel : チャンネル購読レベル 0:無し 1:未読管理 2:未読管理+通知 /// チャンネル購読レベル 0:無し 1:未読管理 2:未読管理+通知 -#[derive( - Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, -)] -#[repr(u8)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum ChannelSubscribeLevel { - None = 0, - Subscribed = 1, - Notified = 2, + #[serde(rename = "0")] + none, + #[serde(rename = "1")] + subscribed, + #[serde(rename = "2")] + notified, } impl ToString for ChannelSubscribeLevel { fn to_string(&self) -> String { match self { - Self::None => String::from("0"), - Self::Subscribed => String::from("1"), - Self::Notified => String::from("2"), + Self::none => String::from("0"), + Self::subscribed => String::from("1"), + Self::notified => String::from("2"), } } } impl Default for ChannelSubscribeLevel { fn default() -> ChannelSubscribeLevel { - Self::None + Self::none } } diff --git a/src/models/file_info.rs b/src/models/file_info.rs index 9a97bbb..b15cdd4 100644 --- a/src/models/file_info.rs +++ b/src/models/file_info.rs @@ -69,7 +69,11 @@ impl FileInfo { is_animated_image, created_at, thumbnails, - thumbnail: thumbnail.map(Box::new), + thumbnail: if let Some(x) = thumbnail { + Some(Box::new(x)) + } else { + None + }, channel_id, uploader_id, } diff --git a/src/models/mod.rs b/src/models/mod.rs index 05628e9..6ab5266 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -2,6 +2,8 @@ pub mod active_o_auth2_token; pub use self::active_o_auth2_token::ActiveOAuth2Token; pub mod activity_timeline_message; pub use self::activity_timeline_message::ActivityTimelineMessage; +pub mod add_user_group_member_request; +pub use self::add_user_group_member_request::AddUserGroupMemberRequest; pub mod bot; pub use self::bot::Bot; pub mod bot_detail; @@ -26,6 +28,8 @@ pub mod channel_event_detail; pub use self::channel_event_detail::ChannelEventDetail; pub mod channel_list; pub use self::channel_list::ChannelList; +pub mod channel_path; +pub use self::channel_path::ChannelPath; pub mod channel_stats; pub use self::channel_stats::ChannelStats; pub mod channel_stats_stamp; @@ -188,8 +192,46 @@ 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 qall_endpoint_response; +pub use self::qall_endpoint_response::QallEndpointResponse; +pub mod qall_metadata_request; +pub use self::qall_metadata_request::QallMetadataRequest; +pub mod qall_metadata_response; +pub use self::qall_metadata_response::QallMetadataResponse; +pub mod qall_participant; +pub use self::qall_participant::QallParticipant; +pub mod qall_participant_request; +pub use self::qall_participant_request::QallParticipantRequest; +pub mod qall_participant_request_users_inner; +pub use self::qall_participant_request_users_inner::QallParticipantRequestUsersInner; +pub mod qall_participant_response; +pub use self::qall_participant_response::QallParticipantResponse; +pub mod qall_participant_response_results_inner; +pub use self::qall_participant_response_results_inner::QallParticipantResponseResultsInner; +pub mod qall_room_state_changed_event; +pub use self::qall_room_state_changed_event::QallRoomStateChangedEvent; +pub mod qall_room_state_changed_event_room_states_inner; +pub use self::qall_room_state_changed_event_room_states_inner::QallRoomStateChangedEventRoomStatesInner; +pub mod qall_room_state_changed_event_room_states_inner_participants_inner; +pub use self::qall_room_state_changed_event_room_states_inner_participants_inner::QallRoomStateChangedEventRoomStatesInnerParticipantsInner; +pub mod qall_room_with_participants; +pub use self::qall_room_with_participants::QallRoomWithParticipants; +pub mod qall_soundboard_item_created_event; +pub use self::qall_soundboard_item_created_event::QallSoundboardItemCreatedEvent; +pub mod qall_soundboard_item_deleted_event; +pub use self::qall_soundboard_item_deleted_event::QallSoundboardItemDeletedEvent; +pub mod qall_token_response; +pub use self::qall_token_response::QallTokenResponse; pub mod session; pub use self::session::Session; +pub mod soundboard_item; +pub use self::soundboard_item::SoundboardItem; +pub mod soundboard_play_request; +pub use self::soundboard_play_request::SoundboardPlayRequest; +pub mod soundboard_play_response; +pub use self::soundboard_play_response::SoundboardPlayResponse; +pub mod soundboard_upload_response; +pub use self::soundboard_upload_response::SoundboardUploadResponse; pub mod stamp; pub use self::stamp::Stamp; pub mod stamp_history_entry; diff --git a/src/models/qall_endpoint_response.rs b/src/models/qall_endpoint_response.rs new file mode 100644 index 0000000..27a5330 --- /dev/null +++ b/src/models/qall_endpoint_response.rs @@ -0,0 +1,22 @@ +/* + * 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 QallEndpointResponse { + /// LiveKitのエンドポイント + #[serde(rename = "endpoint")] + pub endpoint: String, +} + +impl QallEndpointResponse { + pub fn new(endpoint: String) -> QallEndpointResponse { + QallEndpointResponse { endpoint } + } +} diff --git a/src/models/qall_metadata_request.rs b/src/models/qall_metadata_request.rs new file mode 100644 index 0000000..8bd9ec3 --- /dev/null +++ b/src/models/qall_metadata_request.rs @@ -0,0 +1,22 @@ +/* + * 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 QallMetadataRequest { + /// ルームに関連付けられたカスタム属性 + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} + +impl QallMetadataRequest { + pub fn new() -> QallMetadataRequest { + QallMetadataRequest { metadata: None } + } +} diff --git a/src/models/qall_metadata_response.rs b/src/models/qall_metadata_response.rs new file mode 100644 index 0000000..7d103a9 --- /dev/null +++ b/src/models/qall_metadata_response.rs @@ -0,0 +1,22 @@ +/* + * 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 QallMetadataResponse { + /// ルームに関連付けられたカスタム属性 + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} + +impl QallMetadataResponse { + pub fn new() -> QallMetadataResponse { + QallMetadataResponse { metadata: None } + } +} diff --git a/src/models/qall_participant.rs b/src/models/qall_participant.rs new file mode 100644 index 0000000..da296dd --- /dev/null +++ b/src/models/qall_participant.rs @@ -0,0 +1,43 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// QallParticipant : ルーム内の参加者一覧 + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct QallParticipant { + /// ユーザーID_RandomUUID + #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] + pub identity: Option, + /// 表示名 + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// 参加した時刻 + #[serde(rename = "joinedAt", skip_serializing_if = "Option::is_none")] + pub joined_at: Option, + /// ユーザーに関連付けられたカスタム属性 + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option<::std::collections::HashMap>, + /// 発言権限 + #[serde(rename = "canPublish", skip_serializing_if = "Option::is_none")] + pub can_publish: Option, +} + +impl QallParticipant { + /// ルーム内の参加者一覧 + pub fn new() -> QallParticipant { + QallParticipant { + identity: None, + name: None, + joined_at: None, + attributes: None, + can_publish: None, + } + } +} diff --git a/src/models/qall_participant_request.rs b/src/models/qall_participant_request.rs new file mode 100644 index 0000000..ff6d648 --- /dev/null +++ b/src/models/qall_participant_request.rs @@ -0,0 +1,23 @@ +/* + * 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 QallParticipantRequest { + #[serde(rename = "users")] + pub users: Vec, +} + +impl QallParticipantRequest { + pub fn new( + users: Vec, + ) -> QallParticipantRequest { + QallParticipantRequest { users } + } +} diff --git a/src/models/qall_participant_request_users_inner.rs b/src/models/qall_participant_request_users_inner.rs new file mode 100644 index 0000000..9c07a7a --- /dev/null +++ b/src/models/qall_participant_request_users_inner.rs @@ -0,0 +1,28 @@ +/* + * 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 QallParticipantRequestUsersInner { + /// ユーザーID + #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] + pub user_id: Option, + /// 発言権限 + #[serde(rename = "canPublish", skip_serializing_if = "Option::is_none")] + pub can_publish: Option, +} + +impl QallParticipantRequestUsersInner { + pub fn new() -> QallParticipantRequestUsersInner { + QallParticipantRequestUsersInner { + user_id: None, + can_publish: None, + } + } +} diff --git a/src/models/qall_participant_response.rs b/src/models/qall_participant_response.rs new file mode 100644 index 0000000..6acecb5 --- /dev/null +++ b/src/models/qall_participant_response.rs @@ -0,0 +1,21 @@ +/* + * 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 QallParticipantResponse { + #[serde(rename = "results", skip_serializing_if = "Option::is_none")] + pub results: Option>, +} + +impl QallParticipantResponse { + pub fn new() -> QallParticipantResponse { + QallParticipantResponse { results: None } + } +} diff --git a/src/models/qall_participant_response_results_inner.rs b/src/models/qall_participant_response_results_inner.rs new file mode 100644 index 0000000..29507f8 --- /dev/null +++ b/src/models/qall_participant_response_results_inner.rs @@ -0,0 +1,32 @@ +/* + * 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 QallParticipantResponseResultsInner { + /// 対象参加者ID + #[serde(rename = "participantId", skip_serializing_if = "Option::is_none")] + pub participant_id: Option, + /// success もしくは error + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// エラーがある場合の詳細 + #[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")] + pub error_message: Option, +} + +impl QallParticipantResponseResultsInner { + pub fn new() -> QallParticipantResponseResultsInner { + QallParticipantResponseResultsInner { + participant_id: None, + status: None, + error_message: None, + } + } +} diff --git a/src/models/qall_room_state_changed_event.rs b/src/models/qall_room_state_changed_event.rs new file mode 100644 index 0000000..d42de0a --- /dev/null +++ b/src/models/qall_room_state_changed_event.rs @@ -0,0 +1,26 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// QallRoomStateChangedEvent : Qallのルーム状態が変更された + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct QallRoomStateChangedEvent { + #[serde(rename = "roomStates")] + pub room_states: Vec, +} + +impl QallRoomStateChangedEvent { + /// Qallのルーム状態が変更された + pub fn new( + room_states: Vec, + ) -> QallRoomStateChangedEvent { + QallRoomStateChangedEvent { room_states } + } +} diff --git a/src/models/qall_room_state_changed_event_room_states_inner.rs b/src/models/qall_room_state_changed_event_room_states_inner.rs new file mode 100644 index 0000000..f101c12 --- /dev/null +++ b/src/models/qall_room_state_changed_event_room_states_inner.rs @@ -0,0 +1,39 @@ +/* + * 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 QallRoomStateChangedEventRoomStatesInner { + /// ルームのID + #[serde(rename = "roomId")] + pub room_id: uuid::Uuid, + #[serde(rename = "participants")] + pub participants: Vec, + /// ウェビナールームかどうか + #[serde(rename = "isWebinar")] + pub is_webinar: bool, + /// ルームに関連付けられたカスタム属性 + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} + +impl QallRoomStateChangedEventRoomStatesInner { + pub fn new( + room_id: uuid::Uuid, + participants: Vec, + is_webinar: bool, + ) -> QallRoomStateChangedEventRoomStatesInner { + QallRoomStateChangedEventRoomStatesInner { + room_id, + participants, + is_webinar, + metadata: None, + } + } +} diff --git a/src/models/qall_room_state_changed_event_room_states_inner_participants_inner.rs b/src/models/qall_room_state_changed_event_room_states_inner_participants_inner.rs new file mode 100644 index 0000000..b6a7ccc --- /dev/null +++ b/src/models/qall_room_state_changed_event_room_states_inner_participants_inner.rs @@ -0,0 +1,44 @@ +/* + * 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 QallRoomStateChangedEventRoomStatesInnerParticipantsInner { + /// ユーザーID_RandomUUID + #[serde(rename = "identity")] + pub identity: String, + /// 表示名 + #[serde(rename = "name")] + pub name: String, + /// 参加した時刻 + #[serde(rename = "joinedAt")] + pub joined_at: String, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option<::std::collections::HashMap>, + /// 発言権限 + #[serde(rename = "canPublish")] + pub can_publish: bool, +} + +impl QallRoomStateChangedEventRoomStatesInnerParticipantsInner { + pub fn new( + identity: String, + name: String, + joined_at: String, + can_publish: bool, + ) -> QallRoomStateChangedEventRoomStatesInnerParticipantsInner { + QallRoomStateChangedEventRoomStatesInnerParticipantsInner { + identity, + name, + joined_at, + attributes: None, + can_publish, + } + } +} diff --git a/src/models/qall_room_with_participants.rs b/src/models/qall_room_with_participants.rs new file mode 100644 index 0000000..55c487b --- /dev/null +++ b/src/models/qall_room_with_participants.rs @@ -0,0 +1,38 @@ +/* + * 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 QallRoomWithParticipants { + /// ルームのID + #[serde(rename = "roomId")] + pub room_id: uuid::Uuid, + #[serde(rename = "participants")] + pub participants: Vec, + /// ウェビナールームかどうか + #[serde(rename = "isWebinar", skip_serializing_if = "Option::is_none")] + pub is_webinar: Option, + /// ルームに関連付けられたカスタム属性 + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} + +impl QallRoomWithParticipants { + pub fn new( + room_id: uuid::Uuid, + participants: Vec, + ) -> QallRoomWithParticipants { + QallRoomWithParticipants { + room_id, + participants, + is_webinar: None, + metadata: None, + } + } +} diff --git a/src/models/qall_soundboard_item_created_event.rs b/src/models/qall_soundboard_item_created_event.rs new file mode 100644 index 0000000..919dd38 --- /dev/null +++ b/src/models/qall_soundboard_item_created_event.rs @@ -0,0 +1,39 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// QallSoundboardItemCreatedEvent : Qallのサウンドボードアイテムが作成された + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct QallSoundboardItemCreatedEvent { + /// 作成されたサウンドボードアイテムのId + #[serde(rename = "soundId")] + pub sound_id: uuid::Uuid, + /// 作成されたサウンドボードアイテムの名前 + #[serde(rename = "name")] + pub name: String, + /// 作成者のId + #[serde(rename = "creatorId")] + pub creator_id: uuid::Uuid, +} + +impl QallSoundboardItemCreatedEvent { + /// Qallのサウンドボードアイテムが作成された + pub fn new( + sound_id: uuid::Uuid, + name: String, + creator_id: uuid::Uuid, + ) -> QallSoundboardItemCreatedEvent { + QallSoundboardItemCreatedEvent { + sound_id, + name, + creator_id, + } + } +} diff --git a/src/models/qall_soundboard_item_deleted_event.rs b/src/models/qall_soundboard_item_deleted_event.rs new file mode 100644 index 0000000..7b4f69a --- /dev/null +++ b/src/models/qall_soundboard_item_deleted_event.rs @@ -0,0 +1,25 @@ +/* + * traQ v3 + * + * traQ v3 API + * + * The version of the OpenAPI document: 3.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// QallSoundboardItemDeletedEvent : Qallのサウンドボードアイテムが削除された + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct QallSoundboardItemDeletedEvent { + /// 削除されたサウンドボードアイテムのId + #[serde(rename = "soundId")] + pub sound_id: uuid::Uuid, +} + +impl QallSoundboardItemDeletedEvent { + /// Qallのサウンドボードアイテムが削除された + pub fn new(sound_id: uuid::Uuid) -> QallSoundboardItemDeletedEvent { + QallSoundboardItemDeletedEvent { sound_id } + } +} diff --git a/src/models/qall_token_response.rs b/src/models/qall_token_response.rs new file mode 100644 index 0000000..6322e8d --- /dev/null +++ b/src/models/qall_token_response.rs @@ -0,0 +1,22 @@ +/* + * 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 QallTokenResponse { + /// LiveKit用のJWTトークン + #[serde(rename = "token")] + pub token: String, +} + +impl QallTokenResponse { + pub fn new(token: String) -> QallTokenResponse { + QallTokenResponse { token } + } +} diff --git a/src/models/soundboard_item.rs b/src/models/soundboard_item.rs new file mode 100644 index 0000000..8943eed --- /dev/null +++ b/src/models/soundboard_item.rs @@ -0,0 +1,41 @@ +/* + * 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 SoundboardItem { + /// サーバが発行したサウンドID + #[serde(rename = "soundId")] + pub sound_id: String, + /// ユーザが指定した表示用のサウンド名 + #[serde(rename = "soundName")] + pub sound_name: String, + /// 任意のスタンプID等、サウンドに紐づく拡張情報 + #[serde(rename = "stampId")] + pub stamp_id: String, + /// 作成者のユーザID + #[serde(rename = "creatorId")] + pub creator_id: String, +} + +impl SoundboardItem { + pub fn new( + sound_id: String, + sound_name: String, + stamp_id: String, + creator_id: String, + ) -> SoundboardItem { + SoundboardItem { + sound_id, + sound_name, + stamp_id, + creator_id, + } + } +} diff --git a/src/models/soundboard_play_request.rs b/src/models/soundboard_play_request.rs new file mode 100644 index 0000000..0a7ea71 --- /dev/null +++ b/src/models/soundboard_play_request.rs @@ -0,0 +1,28 @@ +/* + * 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 SoundboardPlayRequest { + /// サウンドID (DB登録済み) + #[serde(rename = "soundId")] + pub sound_id: String, + /// 再生させたいルームのUUID + #[serde(rename = "roomName")] + pub room_name: uuid::Uuid, +} + +impl SoundboardPlayRequest { + pub fn new(sound_id: String, room_name: uuid::Uuid) -> SoundboardPlayRequest { + SoundboardPlayRequest { + sound_id, + room_name, + } + } +} diff --git a/src/models/soundboard_play_response.rs b/src/models/soundboard_play_response.rs new file mode 100644 index 0000000..0b0b6ac --- /dev/null +++ b/src/models/soundboard_play_response.rs @@ -0,0 +1,32 @@ +/* + * 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 SoundboardPlayResponse { + /// 作成された Ingress のID + #[serde(rename = "ingressId")] + pub ingress_id: String, + /// 作成された Ingress のストリームURL等 + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + /// RTMP配信の場合のstream key + #[serde(rename = "streamKey", skip_serializing_if = "Option::is_none")] + pub stream_key: Option, +} + +impl SoundboardPlayResponse { + pub fn new(ingress_id: String) -> SoundboardPlayResponse { + SoundboardPlayResponse { + ingress_id, + url: None, + stream_key: None, + } + } +} diff --git a/src/models/soundboard_upload_response.rs b/src/models/soundboard_upload_response.rs new file mode 100644 index 0000000..775e2f2 --- /dev/null +++ b/src/models/soundboard_upload_response.rs @@ -0,0 +1,22 @@ +/* + * 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 SoundboardUploadResponse { + /// 登録されたサウンドID (ファイル名) + #[serde(rename = "soundId")] + pub sound_id: String, +} + +impl SoundboardUploadResponse { + pub fn new(sound_id: String) -> SoundboardUploadResponse { + SoundboardUploadResponse { sound_id } + } +} diff --git a/src/models/user_account_state.rs b/src/models/user_account_state.rs index a2f77cb..ebc7d43 100644 --- a/src/models/user_account_state.rs +++ b/src/models/user_account_state.rs @@ -8,33 +8,31 @@ * Generated by: https://openapi-generator.tech */ -use serde_repr::{Deserialize_repr, Serialize_repr}; - /// UserAccountState : ユーザーアカウント状態 0: 停止 1: 有効 2: 一時停止 /// ユーザーアカウント状態 0: 停止 1: 有効 2: 一時停止 -#[derive( - Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, -)] -#[repr(u8)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UserAccountState { - Deactivated = 0, - Active = 1, - Suspended = 2, + #[serde(rename = "0")] + deactivated, + #[serde(rename = "1")] + active, + #[serde(rename = "2")] + suspended, } impl ToString for UserAccountState { fn to_string(&self) -> String { match self { - Self::Deactivated => String::from("0"), - Self::Active => String::from("1"), - Self::Suspended => String::from("2"), + Self::deactivated => String::from("0"), + Self::active => String::from("1"), + Self::suspended => String::from("2"), } } } impl Default for UserAccountState { fn default() -> UserAccountState { - Self::Deactivated + Self::deactivated } }