From da82cf912e37affb713b74b1faf28bd763c7a3d0 Mon Sep 17 00:00:00 2001 From: paradox8599 Date: Thu, 17 Oct 2024 02:14:43 +1100 Subject: [PATCH 1/4] fix: invalid text 'null' in request when no args given in these requests, if the optional args are None, instead of passing a empty request body, a text 'null' will be added, which results in 400 response saying ``` { "error": { "message": "JSON failed to parse.", "status_code": 400 } } ``` --- src/apis/files_api.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/apis/files_api.rs b/src/apis/files_api.rs index 09646c8..533314d 100644 --- a/src/apis/files_api.rs +++ b/src/apis/files_api.rs @@ -104,7 +104,10 @@ pub async fn create_file( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - local_var_req_builder = local_var_req_builder.json(&create_file_request); + + if let Some(create_file_request) = create_file_request { + local_var_req_builder = local_var_req_builder.json(&create_file_request); + } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -148,7 +151,9 @@ pub async fn create_file_version( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - local_var_req_builder = local_var_req_builder.json(&create_file_version_request); + if let Some(create_file_version_request) = create_file_version_request { + local_var_req_builder = local_var_req_builder.json(&create_file_version_request); + } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -326,7 +331,10 @@ pub async fn finish_file_data_upload( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - local_var_req_builder = local_var_req_builder.json(&finish_file_data_upload_request); + + if let Some(finish_file_data_upload_request) = finish_file_data_upload_request { + local_var_req_builder = local_var_req_builder.json(&finish_file_data_upload_request); + } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; From 32a57bc3cd90eab4be80348f9f907477a69ec9ba Mon Sep 17 00:00:00 2001 From: paradox8599 Date: Thu, 17 Oct 2024 12:56:06 +1100 Subject: [PATCH 2/4] Revert "fix: invalid text 'null' in request when no args given" This reverts commit da82cf912e37affb713b74b1faf28bd763c7a3d0. --- src/apis/files_api.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/apis/files_api.rs b/src/apis/files_api.rs index 533314d..09646c8 100644 --- a/src/apis/files_api.rs +++ b/src/apis/files_api.rs @@ -104,10 +104,7 @@ pub async fn create_file( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - - if let Some(create_file_request) = create_file_request { - local_var_req_builder = local_var_req_builder.json(&create_file_request); - } + local_var_req_builder = local_var_req_builder.json(&create_file_request); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -151,9 +148,7 @@ pub async fn create_file_version( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - if let Some(create_file_version_request) = create_file_version_request { - local_var_req_builder = local_var_req_builder.json(&create_file_version_request); - } + local_var_req_builder = local_var_req_builder.json(&create_file_version_request); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -331,10 +326,7 @@ pub async fn finish_file_data_upload( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - - if let Some(finish_file_data_upload_request) = finish_file_data_upload_request { - local_var_req_builder = local_var_req_builder.json(&finish_file_data_upload_request); - } + local_var_req_builder = local_var_req_builder.json(&finish_file_data_upload_request); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; From 1c6636f69629314dfbdfe49866e623e80df87c3b Mon Sep 17 00:00:00 2001 From: paradox8599 Date: Thu, 17 Oct 2024 12:58:00 +1100 Subject: [PATCH 3/4] fix: invalid text 'null' in request when no args given In these requests, if the optional args are None, instead of passing a empty request body, a text 'null' will be added, which results in 400 response saying ``` { "error": { "message": "JSON failed to parse.", "status_code": 400 } } ``` This fix checks for the optional args, and only write to the request body if they have values. It is mainly for `finish_file_data_upload` as it allows an emty body, but the other two will still fail anyway. --- .openapi-generator/FILES | 10 ++ docs/FavoritedWorld.md | 38 +++++++ docs/Jam.md | 20 ++++ docs/JamStateChangeDates.md | 14 +++ docs/JamsApi.md | 101 +++++++++++++++++ docs/LimitedWorld.md | 1 - docs/NotificationsApi.md | 31 ++++++ docs/PlayermoderationApi.md | 62 ----------- docs/Submission.md | 17 +++ docs/World.md | 1 - docs/WorldsApi.md | 4 +- generate.sh | 3 + src/apis/files_api.rs | 12 +- src/apis/jams_api.rs | 159 +++++++++++++++++++++++++++ src/apis/mod.rs | 1 + src/apis/notifications_api.rs | 51 +++++++++ src/apis/playermoderation_api.rs | 102 ----------------- src/apis/worlds_api.rs | 2 +- src/models/favorited_world.rs | 141 ++++++++++++++++++++++++ src/models/jam.rs | 67 +++++++++++ src/models/jam_state_change_dates.rs | 53 +++++++++ src/models/limited_world.rs | 4 - src/models/mod.rs | 8 ++ src/models/submission.rs | 52 +++++++++ src/models/world.rs | 4 - 25 files changed, 778 insertions(+), 180 deletions(-) create mode 100644 docs/FavoritedWorld.md create mode 100644 docs/Jam.md create mode 100644 docs/JamStateChangeDates.md create mode 100644 docs/JamsApi.md create mode 100644 docs/Submission.md create mode 100644 src/apis/jams_api.rs create mode 100644 src/models/favorited_world.rs create mode 100644 src/models/jam.rs create mode 100644 src/models/jam_state_change_dates.rs create mode 100644 src/models/submission.rs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 45d4c31..80a6f92 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -48,6 +48,7 @@ docs/Favorite.md docs/FavoriteGroup.md docs/FavoriteGroupVisibility.md docs/FavoriteType.md +docs/FavoritedWorld.md docs/FavoritesApi.md docs/File.md docs/FileData.md @@ -98,6 +99,9 @@ docs/InviteMessage.md docs/InviteMessageType.md docs/InviteRequest.md docs/InviteResponse.md +docs/Jam.md +docs/JamStateChangeDates.md +docs/JamsApi.md docs/License.md docs/LicenseAction.md docs/LicenseGroup.md @@ -137,6 +141,7 @@ docs/RespondGroupJoinRequest.md docs/Response.md docs/SentNotification.md docs/SortOption.md +docs/Submission.md docs/Subscription.md docs/SubscriptionPeriod.md docs/Success.md @@ -182,6 +187,7 @@ src/apis/friends_api.rs src/apis/groups_api.rs src/apis/instances_api.rs src/apis/invite_api.rs +src/apis/jams_api.rs src/apis/mod.rs src/apis/notifications_api.rs src/apis/permissions_api.rs @@ -235,6 +241,7 @@ src/models/favorite.rs src/models/favorite_group.rs src/models/favorite_group_visibility.rs src/models/favorite_type.rs +src/models/favorited_world.rs src/models/file.rs src/models/file_data.rs src/models/file_status.rs @@ -279,6 +286,8 @@ src/models/invite_message.rs src/models/invite_message_type.rs src/models/invite_request.rs src/models/invite_response.rs +src/models/jam.rs +src/models/jam_state_change_dates.rs src/models/license.rs src/models/license_action.rs src/models/license_group.rs @@ -316,6 +325,7 @@ src/models/respond_group_join_request.rs src/models/response.rs src/models/sent_notification.rs src/models/sort_option.rs +src/models/submission.rs src/models/subscription.rs src/models/subscription_period.rs src/models/success.rs diff --git a/docs/FavoritedWorld.md b/docs/FavoritedWorld.md new file mode 100644 index 0000000..22ab37a --- /dev/null +++ b/docs/FavoritedWorld.md @@ -0,0 +1,38 @@ +# FavoritedWorld + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | +**author_name** | **String** | | +**capacity** | **i32** | | +**description** | **String** | | +**recommended_capacity** | Option<**i32**> | | [optional] +**created_at** | **String** | | +**favorites** | **i32** | | [default to 0] +**favorite_group** | **String** | | +**favorite_id** | **String** | | +**featured** | **bool** | | [default to false] +**visits** | Option<**i32**> | | [optional][default to 0] +**heat** | **i32** | | [default to 0] +**id** | **String** | WorldID be \"offline\" on User profiles if you are not friends with that user. | +**image_url** | **String** | | +**labs_publication_date** | **String** | | +**name** | **String** | | +**occupants** | **i32** | | [default to 0] +**organization** | **String** | | [default to vrchat] +**popularity** | **i32** | | [default to 0] +**preview_youtube_id** | Option<**String**> | | [optional] +**publication_date** | **String** | | +**release_status** | [**models::ReleaseStatus**](ReleaseStatus.md) | | +**tags** | **Vec** | | +**thumbnail_image_url** | **String** | | +**unity_packages** | [**Vec**](UnityPackage.md) | | +**updated_at** | **String** | | +**udon_products** | Option<**Vec**> | | [optional] +**version** | **i32** | | + +[[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/Jam.md b/docs/Jam.md new file mode 100644 index 0000000..95898f5 --- /dev/null +++ b/docs/Jam.md @@ -0,0 +1,20 @@ +# Jam + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **String** | | +**id** | **String** | | +**is_visible** | **bool** | | +**more_info** | **String** | | +**state** | **String** | One of: - submissions_open - closed | +**state_change_dates** | [**models::JamStateChangeDates**](Jam_stateChangeDates.md) | | +**submission_content_gate_date** | Option<**String**> | | +**submission_content_gated** | **bool** | | +**title** | **String** | | +**updated_at** | **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/JamStateChangeDates.md b/docs/JamStateChangeDates.md new file mode 100644 index 0000000..5f33f87 --- /dev/null +++ b/docs/JamStateChangeDates.md @@ -0,0 +1,14 @@ +# JamStateChangeDates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**closed** | Option<**String**> | | [optional] +**submissions_closed** | Option<**String**> | | [optional] +**submissions_opened** | Option<**String**> | | [optional] +**winners_selected** | 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/JamsApi.md b/docs/JamsApi.md new file mode 100644 index 0000000..9828caa --- /dev/null +++ b/docs/JamsApi.md @@ -0,0 +1,101 @@ +# \JamsApi + +All URIs are relative to *https://vrchat.com/api/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_jam**](JamsApi.md#get_jam) | **GET** /jams/{jamId} | Show jam information +[**get_jam_submissions**](JamsApi.md#get_jam_submissions) | **GET** /jams/{jamId}/submissions | Show jam submissions +[**get_jams**](JamsApi.md#get_jams) | **GET** /jams | Show jams list + + + +## get_jam + +> models::Jam get_jam(jam_id) +Show jam information + +Returns a jam. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**jam_id** | **String** | Must be a valid query ID. | [required] | + +### Return type + +[**models::Jam**](Jam.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### 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_jam_submissions + +> Vec get_jam_submissions(jam_id) +Show jam submissions + +Returns all submissions of a jam. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**jam_id** | **String** | Must be a valid query ID. | [required] | + +### Return type + +[**Vec**](Submission.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### 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_jams + +> Vec get_jams(r#type) +Show jams list + +Lists World Jams or Avatar Jams, both currently running and ones that have ended. `isActive` is used to select only active or already ended jams. `type` is used to select only world or avatar jams, and can only take `world` or `avatar`. `` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**r#type** | Option<**String**> | Only show jams of this type (`avatar` or `world`). | | + +### Return type + +[**Vec**](Jam.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### 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) + diff --git a/docs/LimitedWorld.md b/docs/LimitedWorld.md index c121cfa..9fc0a47 100644 --- a/docs/LimitedWorld.md +++ b/docs/LimitedWorld.md @@ -22,7 +22,6 @@ Name | Type | Description | Notes **preview_youtube_id** | Option<**String**> | | [optional] **publication_date** | **String** | | **release_status** | [**models::ReleaseStatus**](ReleaseStatus.md) | | -**store_id** | Option<**String**> | | **tags** | **Vec** | | **thumbnail_image_url** | **String** | | **unity_packages** | [**Vec**](LimitedUnityPackage.md) | | diff --git a/docs/NotificationsApi.md b/docs/NotificationsApi.md index 517b20d..a622603 100644 --- a/docs/NotificationsApi.md +++ b/docs/NotificationsApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**accept_friend_request**](NotificationsApi.md#accept_friend_request) | **PUT** /auth/user/notifications/{notificationId}/accept | Accept Friend Request [**clear_notifications**](NotificationsApi.md#clear_notifications) | **PUT** /auth/user/notifications/clear | Clear All Notifications [**delete_notification**](NotificationsApi.md#delete_notification) | **PUT** /auth/user/notifications/{notificationId}/hide | Delete Notification +[**get_notification**](NotificationsApi.md#get_notification) | **GET** /auth/user/notifications/{notificationId} | Show notification [**get_notifications**](NotificationsApi.md#get_notifications) | **GET** /auth/user/notifications | List Notifications [**mark_notification_as_read**](NotificationsApi.md#mark_notification_as_read) | **PUT** /auth/user/notifications/{notificationId}/see | Mark Notification As Read @@ -99,6 +100,36 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## get_notification + +> models::Notification get_notification(notification_id) +Show notification + +Get a notification by notification `not_` ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**notification_id** | **String** | Must be a valid notification ID. | [required] | + +### Return type + +[**models::Notification**](Notification.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### 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_notifications > Vec get_notifications(r#type, sent, hidden, after, n, offset) diff --git a/docs/PlayermoderationApi.md b/docs/PlayermoderationApi.md index 4a103e9..f9e9361 100644 --- a/docs/PlayermoderationApi.md +++ b/docs/PlayermoderationApi.md @@ -5,8 +5,6 @@ All URIs are relative to *https://vrchat.com/api/1* Method | HTTP request | Description ------------- | ------------- | ------------- [**clear_all_player_moderations**](PlayermoderationApi.md#clear_all_player_moderations) | **DELETE** /auth/user/playermoderations | Clear All Player Moderations -[**delete_player_moderation**](PlayermoderationApi.md#delete_player_moderation) | **DELETE** /auth/user/playermoderations/{playerModerationId} | Delete Player Moderation -[**get_player_moderation**](PlayermoderationApi.md#get_player_moderation) | **GET** /auth/user/playermoderations/{playerModerationId} | Get Player Moderation [**get_player_moderations**](PlayermoderationApi.md#get_player_moderations) | **GET** /auth/user/playermoderations | Search Player Moderations [**moderate_user**](PlayermoderationApi.md#moderate_user) | **POST** /auth/user/playermoderations | Moderate User [**unmoderate_user**](PlayermoderationApi.md#unmoderate_user) | **PUT** /auth/user/unplayermoderate | Unmoderate User @@ -40,66 +38,6 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## delete_player_moderation - -> models::Success delete_player_moderation(player_moderation_id) -Delete Player Moderation - -Deletes a specific player moderation based on it's `pmod_` ID. The website uses `unmoderateUser` instead. You can delete the same player moderation multiple times successfully. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**player_moderation_id** | **String** | Must be a valid `pmod_` ID. | [required] | - -### Return type - -[**models::Success**](Success.md) - -### Authorization - -[authCookie](../README.md#authCookie) - -### 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_player_moderation - -> models::PlayerModeration get_player_moderation(player_moderation_id) -Get Player Moderation - -Returns a single Player Moderation. This returns the exact same amount of information as the more generalised `getPlayerModerations`. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**player_moderation_id** | **String** | Must be a valid `pmod_` ID. | [required] | - -### Return type - -[**models::PlayerModeration**](PlayerModeration.md) - -### Authorization - -[authCookie](../README.md#authCookie) - -### 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_player_moderations > Vec get_player_moderations(r#type, target_user_id) diff --git a/docs/Submission.md b/docs/Submission.md new file mode 100644 index 0000000..db2c4c3 --- /dev/null +++ b/docs/Submission.md @@ -0,0 +1,17 @@ +# Submission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content_id** | **String** | Either world ID or avatar ID | +**created_at** | **String** | | +**description** | **String** | | +**id** | **String** | | +**jam_id** | **String** | | +**rating_score** | Option<**i32**> | | [optional] +**submitter_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | + +[[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/World.md b/docs/World.md index ab1048c..640d855 100644 --- a/docs/World.md +++ b/docs/World.md @@ -27,7 +27,6 @@ Name | Type | Description | Notes **public_occupants** | Option<**i32**> | Will always be `0` when unauthenticated. | [optional][default to 0] **publication_date** | **String** | | **release_status** | [**models::ReleaseStatus**](ReleaseStatus.md) | | -**store_id** | Option<**String**> | | **tags** | **Vec** | | **thumbnail_image_url** | **String** | | **unity_packages** | Option<[**Vec**](UnityPackage.md)> | Empty if unauthenticated. | [optional] diff --git a/docs/WorldsApi.md b/docs/WorldsApi.md index 2ad2aba..f585716 100644 --- a/docs/WorldsApi.md +++ b/docs/WorldsApi.md @@ -123,7 +123,7 @@ Name | Type | Description | Required | Notes ## get_favorited_worlds -> Vec get_favorited_worlds(featured, sort, n, order, offset, search, tag, notag, release_status, max_unity_version, min_unity_version, platform, user_id) +> Vec get_favorited_worlds(featured, sort, n, order, offset, search, tag, notag, release_status, max_unity_version, min_unity_version, platform, user_id) List Favorited Worlds Search and list favorited worlds by query filters. @@ -149,7 +149,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](LimitedWorld.md) +[**Vec**](FavoritedWorld.md) ### Authorization diff --git a/generate.sh b/generate.sh index 552f7fc..d0c6acf 100755 --- a/generate.sh +++ b/generate.sh @@ -39,6 +39,9 @@ cat patches/2FA_Current_User.rs >> src/models/current_user.rs sed -i 's/pub use self::current_user::CurrentUser;/pub use self::current_user::{EitherUserOrTwoFactor, CurrentUser};/g' src/models/mod.rs sed -i 's/Result>/Result>/g' src/apis/authentication_api.rs +# https://github.com/vrchatapi/vrchatapi-rust/pull/29 +sed -i "s/local_var_req_builder = local_var_req_builder.json(&\(.*\));/if let Some(\1) = \1 { \0 }/g" src/apis/files_api.rs + cargo fmt cargo build cargo test diff --git a/src/apis/files_api.rs b/src/apis/files_api.rs index 09646c8..7648f3d 100644 --- a/src/apis/files_api.rs +++ b/src/apis/files_api.rs @@ -104,7 +104,9 @@ pub async fn create_file( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - local_var_req_builder = local_var_req_builder.json(&create_file_request); + if let Some(create_file_request) = create_file_request { + local_var_req_builder = local_var_req_builder.json(&create_file_request); + } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -148,7 +150,9 @@ pub async fn create_file_version( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - local_var_req_builder = local_var_req_builder.json(&create_file_version_request); + if let Some(create_file_version_request) = create_file_version_request { + local_var_req_builder = local_var_req_builder.json(&create_file_version_request); + } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -326,7 +330,9 @@ pub async fn finish_file_data_upload( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - local_var_req_builder = local_var_req_builder.json(&finish_file_data_upload_request); + if let Some(finish_file_data_upload_request) = finish_file_data_upload_request { + local_var_req_builder = local_var_req_builder.json(&finish_file_data_upload_request); + } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; diff --git a/src/apis/jams_api.rs b/src/apis/jams_api.rs new file mode 100644 index 0000000..a6f70e8 --- /dev/null +++ b/src/apis/jams_api.rs @@ -0,0 +1,159 @@ +/* + * VRChat API Documentation + * + * + * Contact: vrchatapi.lpv0t@aries.fyi + * Generated by: https://openapi-generator.tech + */ + +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`get_jam`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetJamError { + Status404(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_jam_submissions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetJamSubmissionsError { + Status404(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_jams`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetJamsError { + UnknownValue(serde_json::Value), +} + +/// Returns a jam. +pub async fn get_jam( + configuration: &configuration::Configuration, + jam_id: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/jams/{jamId}", + local_var_configuration.base_path, + jamId = crate::apis::urlencode(jam_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()); + } + + 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)) + } +} + +/// Returns all submissions of a jam. +pub async fn get_jam_submissions( + configuration: &configuration::Configuration, + jam_id: &str, +) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/jams/{jamId}/submissions", + local_var_configuration.base_path, + jamId = crate::apis::urlencode(jam_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()); + } + + 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)) + } +} + +/// Lists World Jams or Avatar Jams, both currently running and ones that have ended. `isActive` is used to select only active or already ended jams. `type` is used to select only world or avatar jams, and can only take `world` or `avatar`. `` +pub async fn get_jams( + configuration: &configuration::Configuration, + r#type: Option<&str>, +) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/jams", 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) = r#type { + local_var_req_builder = + local_var_req_builder.query(&[("type", &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()); + } + + 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)) + } +} diff --git a/src/apis/mod.rs b/src/apis/mod.rs index 7b80d97..b87bc7d 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -101,6 +101,7 @@ pub mod friends_api; pub mod groups_api; pub mod instances_api; pub mod invite_api; +pub mod jams_api; pub mod notifications_api; pub mod permissions_api; pub mod playermoderation_api; diff --git a/src/apis/notifications_api.rs b/src/apis/notifications_api.rs index be73fb3..5b9c041 100644 --- a/src/apis/notifications_api.rs +++ b/src/apis/notifications_api.rs @@ -36,6 +36,15 @@ pub enum DeleteNotificationError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_notification`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetNotificationError { + Status401(models::Error), + Status404(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_notifications`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -176,6 +185,48 @@ pub async fn delete_notification( } } +/// Get a notification by notification `not_` ID. +pub async fn get_notification( + configuration: &configuration::Configuration, + notification_id: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/auth/user/notifications/{notificationId}", + local_var_configuration.base_path, + notificationId = crate::apis::urlencode(notification_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()); + } + + 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)) + } +} + /// Retrieve all of the current user's notifications. pub async fn get_notifications( configuration: &configuration::Configuration, diff --git a/src/apis/playermoderation_api.rs b/src/apis/playermoderation_api.rs index 925bf68..d83b964 100644 --- a/src/apis/playermoderation_api.rs +++ b/src/apis/playermoderation_api.rs @@ -19,24 +19,6 @@ pub enum ClearAllPlayerModerationsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`delete_player_moderation`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeletePlayerModerationError { - Status401(models::Error), - Status403(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_player_moderation`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetPlayerModerationError { - Status401(models::Error), - Status404(models::Error), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`get_player_moderations`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -101,90 +83,6 @@ pub async fn clear_all_player_moderations( } } -/// Deletes a specific player moderation based on it's `pmod_` ID. The website uses `unmoderateUser` instead. You can delete the same player moderation multiple times successfully. -pub async fn delete_player_moderation( - configuration: &configuration::Configuration, - player_moderation_id: &str, -) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!( - "{}/auth/user/playermoderations/{playerModerationId}", - local_var_configuration.base_path, - playerModerationId = crate::apis::urlencode(player_moderation_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()); - } - - 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)) - } -} - -/// Returns a single Player Moderation. This returns the exact same amount of information as the more generalised `getPlayerModerations`. -pub async fn get_player_moderation( - configuration: &configuration::Configuration, - player_moderation_id: &str, -) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!( - "{}/auth/user/playermoderations/{playerModerationId}", - local_var_configuration.base_path, - playerModerationId = crate::apis::urlencode(player_moderation_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()); - } - - 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)) - } -} - /// Returns a list of all player moderations made by **you**. This endpoint does not have pagination, and will return *all* results. Use query parameters to limit your query if needed. pub async fn get_player_moderations( configuration: &configuration::Configuration, diff --git a/src/apis/worlds_api.rs b/src/apis/worlds_api.rs index aae5cb0..3b2aba9 100644 --- a/src/apis/worlds_api.rs +++ b/src/apis/worlds_api.rs @@ -315,7 +315,7 @@ pub async fn get_favorited_worlds( min_unity_version: Option<&str>, platform: Option<&str>, user_id: Option<&str>, -) -> Result, Error> { +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/src/models/favorited_world.rs b/src/models/favorited_world.rs new file mode 100644 index 0000000..47d7761 --- /dev/null +++ b/src/models/favorited_world.rs @@ -0,0 +1,141 @@ +/* + * VRChat API Documentation + * + * + * Contact: vrchatapi.lpv0t@aries.fyi + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// FavoritedWorld : +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FavoritedWorld { + /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. + #[serde(rename = "authorId")] + pub author_id: String, + #[serde(rename = "authorName")] + pub author_name: String, + #[serde(rename = "capacity")] + pub capacity: i32, + #[serde(rename = "description")] + pub description: String, + #[serde( + rename = "recommendedCapacity", + skip_serializing_if = "Option::is_none" + )] + pub recommended_capacity: Option, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "favorites")] + pub favorites: i32, + #[serde(rename = "favoriteGroup")] + pub favorite_group: String, + #[serde(rename = "favoriteId")] + pub favorite_id: String, + #[serde(rename = "featured")] + pub featured: bool, + #[serde(rename = "visits", skip_serializing_if = "Option::is_none")] + pub visits: Option, + #[serde(rename = "heat")] + pub heat: i32, + /// WorldID be \"offline\" on User profiles if you are not friends with that user. + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "imageUrl")] + pub image_url: String, + #[serde(rename = "labsPublicationDate")] + pub labs_publication_date: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "occupants")] + pub occupants: i32, + #[serde(rename = "organization")] + pub organization: String, + #[serde(rename = "popularity")] + pub popularity: i32, + #[serde( + rename = "previewYoutubeId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub preview_youtube_id: Option>, + #[serde(rename = "publicationDate")] + pub publication_date: String, + #[serde(rename = "releaseStatus")] + pub release_status: models::ReleaseStatus, + #[serde(rename = "tags")] + pub tags: Vec, + #[serde(rename = "thumbnailImageUrl")] + pub thumbnail_image_url: String, + #[serde(rename = "unityPackages")] + pub unity_packages: Vec, + #[serde(rename = "updated_at")] + pub updated_at: String, + #[serde(rename = "udonProducts", skip_serializing_if = "Option::is_none")] + pub udon_products: Option>, + #[serde(rename = "version")] + pub version: i32, +} + +impl FavoritedWorld { + pub fn new( + author_id: String, + author_name: String, + capacity: i32, + description: String, + created_at: String, + favorites: i32, + favorite_group: String, + favorite_id: String, + featured: bool, + heat: i32, + id: String, + image_url: String, + labs_publication_date: String, + name: String, + occupants: i32, + organization: String, + popularity: i32, + publication_date: String, + release_status: models::ReleaseStatus, + tags: Vec, + thumbnail_image_url: String, + unity_packages: Vec, + updated_at: String, + version: i32, + ) -> FavoritedWorld { + FavoritedWorld { + author_id, + author_name, + capacity, + description, + recommended_capacity: None, + created_at, + favorites, + favorite_group, + favorite_id, + featured, + visits: None, + heat, + id, + image_url, + labs_publication_date, + name, + occupants, + organization, + popularity, + preview_youtube_id: None, + publication_date, + release_status, + tags, + thumbnail_image_url, + unity_packages, + updated_at, + udon_products: None, + version, + } + } +} diff --git a/src/models/jam.rs b/src/models/jam.rs new file mode 100644 index 0000000..9601153 --- /dev/null +++ b/src/models/jam.rs @@ -0,0 +1,67 @@ +/* + * VRChat API Documentation + * + * + * Contact: vrchatapi.lpv0t@aries.fyi + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Jam : +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Jam { + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "isVisible")] + pub is_visible: bool, + #[serde(rename = "moreInfo")] + pub more_info: String, + /// One of: - submissions_open - closed + #[serde(rename = "state")] + pub state: String, + #[serde(rename = "stateChangeDates")] + pub state_change_dates: models::JamStateChangeDates, + #[serde( + rename = "submissionContentGateDate", + deserialize_with = "Option::deserialize" + )] + pub submission_content_gate_date: Option, + #[serde(rename = "submissionContentGated")] + pub submission_content_gated: bool, + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "updated_at")] + pub updated_at: String, +} + +impl Jam { + pub fn new( + description: String, + id: String, + is_visible: bool, + more_info: String, + state: String, + state_change_dates: models::JamStateChangeDates, + submission_content_gate_date: Option, + submission_content_gated: bool, + title: String, + updated_at: String, + ) -> Jam { + Jam { + description, + id, + is_visible, + more_info, + state, + state_change_dates, + submission_content_gate_date, + submission_content_gated, + title, + updated_at, + } + } +} diff --git a/src/models/jam_state_change_dates.rs b/src/models/jam_state_change_dates.rs new file mode 100644 index 0000000..971d890 --- /dev/null +++ b/src/models/jam_state_change_dates.rs @@ -0,0 +1,53 @@ +/* + * VRChat API Documentation + * + * + * Contact: vrchatapi.lpv0t@aries.fyi + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct JamStateChangeDates { + #[serde( + rename = "closed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub closed: Option>, + #[serde( + rename = "submissionsClosed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub submissions_closed: Option>, + #[serde( + rename = "submissionsOpened", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub submissions_opened: Option>, + #[serde( + rename = "winnersSelected", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub winners_selected: Option>, +} + +impl JamStateChangeDates { + pub fn new() -> JamStateChangeDates { + JamStateChangeDates { + closed: None, + submissions_closed: None, + submissions_opened: None, + winners_selected: None, + } + } +} diff --git a/src/models/limited_world.rs b/src/models/limited_world.rs index ce263b6..42ddf14 100644 --- a/src/models/limited_world.rs +++ b/src/models/limited_world.rs @@ -58,8 +58,6 @@ pub struct LimitedWorld { pub publication_date: String, #[serde(rename = "releaseStatus")] pub release_status: models::ReleaseStatus, - #[serde(rename = "storeId", deserialize_with = "Option::deserialize")] - pub store_id: Option, #[serde(rename = "tags")] pub tags: Vec, #[serde(rename = "thumbnailImageUrl")] @@ -89,7 +87,6 @@ impl LimitedWorld { popularity: i32, publication_date: String, release_status: models::ReleaseStatus, - store_id: Option, tags: Vec, thumbnail_image_url: String, unity_packages: Vec, @@ -114,7 +111,6 @@ impl LimitedWorld { preview_youtube_id: None, publication_date, release_status, - store_id, tags, thumbnail_image_url, unity_packages, diff --git a/src/models/mod.rs b/src/models/mod.rs index 64aaae1..1755fe2 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -88,6 +88,8 @@ pub mod favorite_group_visibility; pub use self::favorite_group_visibility::FavoriteGroupVisibility; pub mod favorite_type; pub use self::favorite_type::FavoriteType; +pub mod favorited_world; +pub use self::favorited_world::FavoritedWorld; pub mod file; pub use self::file::File; pub mod file_data; @@ -176,6 +178,10 @@ pub mod invite_request; pub use self::invite_request::InviteRequest; pub mod invite_response; pub use self::invite_response::InviteResponse; +pub mod jam; +pub use self::jam::Jam; +pub mod jam_state_change_dates; +pub use self::jam_state_change_dates::JamStateChangeDates; pub mod license; pub use self::license::License; pub mod license_action; @@ -248,6 +254,8 @@ pub mod sent_notification; pub use self::sent_notification::SentNotification; pub mod sort_option; pub use self::sort_option::SortOption; +pub mod submission; +pub use self::submission::Submission; pub mod subscription; pub use self::subscription::Subscription; pub mod subscription_period; diff --git a/src/models/submission.rs b/src/models/submission.rs new file mode 100644 index 0000000..2d371b0 --- /dev/null +++ b/src/models/submission.rs @@ -0,0 +1,52 @@ +/* + * VRChat API Documentation + * + * + * Contact: vrchatapi.lpv0t@aries.fyi + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Submission : +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Submission { + /// Either world ID or avatar ID + #[serde(rename = "contentId")] + pub content_id: String, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "jamId")] + pub jam_id: String, + #[serde(rename = "ratingScore", skip_serializing_if = "Option::is_none")] + pub rating_score: Option, + /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. + #[serde(rename = "submitterId")] + pub submitter_id: String, +} + +impl Submission { + pub fn new( + content_id: String, + created_at: String, + description: String, + id: String, + jam_id: String, + submitter_id: String, + ) -> Submission { + Submission { + content_id, + created_at, + description, + id, + jam_id, + rating_score: None, + submitter_id, + } + } +} diff --git a/src/models/world.rs b/src/models/world.rs index 305f790..424e2ba 100644 --- a/src/models/world.rs +++ b/src/models/world.rs @@ -69,8 +69,6 @@ pub struct World { pub publication_date: String, #[serde(rename = "releaseStatus")] pub release_status: models::ReleaseStatus, - #[serde(rename = "storeId", deserialize_with = "Option::deserialize")] - pub store_id: Option, #[serde(rename = "tags")] pub tags: Vec, #[serde(rename = "thumbnailImageUrl")] @@ -106,7 +104,6 @@ impl World { popularity: i32, publication_date: String, release_status: models::ReleaseStatus, - store_id: Option, tags: Vec, thumbnail_image_url: String, updated_at: String, @@ -137,7 +134,6 @@ impl World { public_occupants: None, publication_date, release_status, - store_id, tags, thumbnail_image_url, unity_packages: None, From 196e8c06bee2314f08ff1f719cc08615daab7dcb Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:41:55 +0200 Subject: [PATCH 4/4] regenerate from 1.18.5 spec Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> --- .openapi-generator/FILES | 10 -- docs/FavoritedWorld.md | 38 ------- docs/Jam.md | 20 ---- docs/JamStateChangeDates.md | 14 --- docs/JamsApi.md | 101 ----------------- docs/LimitedWorld.md | 1 + docs/NotificationsApi.md | 31 ------ docs/PlayermoderationApi.md | 62 +++++++++++ docs/Submission.md | 17 --- docs/World.md | 1 + docs/WorldsApi.md | 4 +- src/apis/jams_api.rs | 159 --------------------------- src/apis/mod.rs | 1 - src/apis/notifications_api.rs | 51 --------- src/apis/playermoderation_api.rs | 102 +++++++++++++++++ src/apis/worlds_api.rs | 2 +- src/models/favorited_world.rs | 141 ------------------------ src/models/jam.rs | 67 ----------- src/models/jam_state_change_dates.rs | 53 --------- src/models/limited_world.rs | 4 + src/models/mod.rs | 8 -- src/models/submission.rs | 52 --------- src/models/world.rs | 4 + 23 files changed, 177 insertions(+), 766 deletions(-) delete mode 100644 docs/FavoritedWorld.md delete mode 100644 docs/Jam.md delete mode 100644 docs/JamStateChangeDates.md delete mode 100644 docs/JamsApi.md delete mode 100644 docs/Submission.md delete mode 100644 src/apis/jams_api.rs delete mode 100644 src/models/favorited_world.rs delete mode 100644 src/models/jam.rs delete mode 100644 src/models/jam_state_change_dates.rs delete mode 100644 src/models/submission.rs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 80a6f92..45d4c31 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -48,7 +48,6 @@ docs/Favorite.md docs/FavoriteGroup.md docs/FavoriteGroupVisibility.md docs/FavoriteType.md -docs/FavoritedWorld.md docs/FavoritesApi.md docs/File.md docs/FileData.md @@ -99,9 +98,6 @@ docs/InviteMessage.md docs/InviteMessageType.md docs/InviteRequest.md docs/InviteResponse.md -docs/Jam.md -docs/JamStateChangeDates.md -docs/JamsApi.md docs/License.md docs/LicenseAction.md docs/LicenseGroup.md @@ -141,7 +137,6 @@ docs/RespondGroupJoinRequest.md docs/Response.md docs/SentNotification.md docs/SortOption.md -docs/Submission.md docs/Subscription.md docs/SubscriptionPeriod.md docs/Success.md @@ -187,7 +182,6 @@ src/apis/friends_api.rs src/apis/groups_api.rs src/apis/instances_api.rs src/apis/invite_api.rs -src/apis/jams_api.rs src/apis/mod.rs src/apis/notifications_api.rs src/apis/permissions_api.rs @@ -241,7 +235,6 @@ src/models/favorite.rs src/models/favorite_group.rs src/models/favorite_group_visibility.rs src/models/favorite_type.rs -src/models/favorited_world.rs src/models/file.rs src/models/file_data.rs src/models/file_status.rs @@ -286,8 +279,6 @@ src/models/invite_message.rs src/models/invite_message_type.rs src/models/invite_request.rs src/models/invite_response.rs -src/models/jam.rs -src/models/jam_state_change_dates.rs src/models/license.rs src/models/license_action.rs src/models/license_group.rs @@ -325,7 +316,6 @@ src/models/respond_group_join_request.rs src/models/response.rs src/models/sent_notification.rs src/models/sort_option.rs -src/models/submission.rs src/models/subscription.rs src/models/subscription_period.rs src/models/success.rs diff --git a/docs/FavoritedWorld.md b/docs/FavoritedWorld.md deleted file mode 100644 index 22ab37a..0000000 --- a/docs/FavoritedWorld.md +++ /dev/null @@ -1,38 +0,0 @@ -# FavoritedWorld - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | -**author_name** | **String** | | -**capacity** | **i32** | | -**description** | **String** | | -**recommended_capacity** | Option<**i32**> | | [optional] -**created_at** | **String** | | -**favorites** | **i32** | | [default to 0] -**favorite_group** | **String** | | -**favorite_id** | **String** | | -**featured** | **bool** | | [default to false] -**visits** | Option<**i32**> | | [optional][default to 0] -**heat** | **i32** | | [default to 0] -**id** | **String** | WorldID be \"offline\" on User profiles if you are not friends with that user. | -**image_url** | **String** | | -**labs_publication_date** | **String** | | -**name** | **String** | | -**occupants** | **i32** | | [default to 0] -**organization** | **String** | | [default to vrchat] -**popularity** | **i32** | | [default to 0] -**preview_youtube_id** | Option<**String**> | | [optional] -**publication_date** | **String** | | -**release_status** | [**models::ReleaseStatus**](ReleaseStatus.md) | | -**tags** | **Vec** | | -**thumbnail_image_url** | **String** | | -**unity_packages** | [**Vec**](UnityPackage.md) | | -**updated_at** | **String** | | -**udon_products** | Option<**Vec**> | | [optional] -**version** | **i32** | | - -[[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/Jam.md b/docs/Jam.md deleted file mode 100644 index 95898f5..0000000 --- a/docs/Jam.md +++ /dev/null @@ -1,20 +0,0 @@ -# Jam - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | **String** | | -**id** | **String** | | -**is_visible** | **bool** | | -**more_info** | **String** | | -**state** | **String** | One of: - submissions_open - closed | -**state_change_dates** | [**models::JamStateChangeDates**](Jam_stateChangeDates.md) | | -**submission_content_gate_date** | Option<**String**> | | -**submission_content_gated** | **bool** | | -**title** | **String** | | -**updated_at** | **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/JamStateChangeDates.md b/docs/JamStateChangeDates.md deleted file mode 100644 index 5f33f87..0000000 --- a/docs/JamStateChangeDates.md +++ /dev/null @@ -1,14 +0,0 @@ -# JamStateChangeDates - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**closed** | Option<**String**> | | [optional] -**submissions_closed** | Option<**String**> | | [optional] -**submissions_opened** | Option<**String**> | | [optional] -**winners_selected** | 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/JamsApi.md b/docs/JamsApi.md deleted file mode 100644 index 9828caa..0000000 --- a/docs/JamsApi.md +++ /dev/null @@ -1,101 +0,0 @@ -# \JamsApi - -All URIs are relative to *https://vrchat.com/api/1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_jam**](JamsApi.md#get_jam) | **GET** /jams/{jamId} | Show jam information -[**get_jam_submissions**](JamsApi.md#get_jam_submissions) | **GET** /jams/{jamId}/submissions | Show jam submissions -[**get_jams**](JamsApi.md#get_jams) | **GET** /jams | Show jams list - - - -## get_jam - -> models::Jam get_jam(jam_id) -Show jam information - -Returns a jam. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**jam_id** | **String** | Must be a valid query ID. | [required] | - -### Return type - -[**models::Jam**](Jam.md) - -### Authorization - -[authCookie](../README.md#authCookie) - -### 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_jam_submissions - -> Vec get_jam_submissions(jam_id) -Show jam submissions - -Returns all submissions of a jam. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**jam_id** | **String** | Must be a valid query ID. | [required] | - -### Return type - -[**Vec**](Submission.md) - -### Authorization - -[authCookie](../README.md#authCookie) - -### 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_jams - -> Vec get_jams(r#type) -Show jams list - -Lists World Jams or Avatar Jams, both currently running and ones that have ended. `isActive` is used to select only active or already ended jams. `type` is used to select only world or avatar jams, and can only take `world` or `avatar`. `` - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**r#type** | Option<**String**> | Only show jams of this type (`avatar` or `world`). | | - -### Return type - -[**Vec**](Jam.md) - -### Authorization - -[authCookie](../README.md#authCookie) - -### 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) - diff --git a/docs/LimitedWorld.md b/docs/LimitedWorld.md index 9fc0a47..c121cfa 100644 --- a/docs/LimitedWorld.md +++ b/docs/LimitedWorld.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **preview_youtube_id** | Option<**String**> | | [optional] **publication_date** | **String** | | **release_status** | [**models::ReleaseStatus**](ReleaseStatus.md) | | +**store_id** | Option<**String**> | | **tags** | **Vec** | | **thumbnail_image_url** | **String** | | **unity_packages** | [**Vec**](LimitedUnityPackage.md) | | diff --git a/docs/NotificationsApi.md b/docs/NotificationsApi.md index a622603..517b20d 100644 --- a/docs/NotificationsApi.md +++ b/docs/NotificationsApi.md @@ -7,7 +7,6 @@ Method | HTTP request | Description [**accept_friend_request**](NotificationsApi.md#accept_friend_request) | **PUT** /auth/user/notifications/{notificationId}/accept | Accept Friend Request [**clear_notifications**](NotificationsApi.md#clear_notifications) | **PUT** /auth/user/notifications/clear | Clear All Notifications [**delete_notification**](NotificationsApi.md#delete_notification) | **PUT** /auth/user/notifications/{notificationId}/hide | Delete Notification -[**get_notification**](NotificationsApi.md#get_notification) | **GET** /auth/user/notifications/{notificationId} | Show notification [**get_notifications**](NotificationsApi.md#get_notifications) | **GET** /auth/user/notifications | List Notifications [**mark_notification_as_read**](NotificationsApi.md#mark_notification_as_read) | **PUT** /auth/user/notifications/{notificationId}/see | Mark Notification As Read @@ -100,36 +99,6 @@ 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_notification - -> models::Notification get_notification(notification_id) -Show notification - -Get a notification by notification `not_` ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**notification_id** | **String** | Must be a valid notification ID. | [required] | - -### Return type - -[**models::Notification**](Notification.md) - -### Authorization - -[authCookie](../README.md#authCookie) - -### 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_notifications > Vec get_notifications(r#type, sent, hidden, after, n, offset) diff --git a/docs/PlayermoderationApi.md b/docs/PlayermoderationApi.md index f9e9361..4a103e9 100644 --- a/docs/PlayermoderationApi.md +++ b/docs/PlayermoderationApi.md @@ -5,6 +5,8 @@ All URIs are relative to *https://vrchat.com/api/1* Method | HTTP request | Description ------------- | ------------- | ------------- [**clear_all_player_moderations**](PlayermoderationApi.md#clear_all_player_moderations) | **DELETE** /auth/user/playermoderations | Clear All Player Moderations +[**delete_player_moderation**](PlayermoderationApi.md#delete_player_moderation) | **DELETE** /auth/user/playermoderations/{playerModerationId} | Delete Player Moderation +[**get_player_moderation**](PlayermoderationApi.md#get_player_moderation) | **GET** /auth/user/playermoderations/{playerModerationId} | Get Player Moderation [**get_player_moderations**](PlayermoderationApi.md#get_player_moderations) | **GET** /auth/user/playermoderations | Search Player Moderations [**moderate_user**](PlayermoderationApi.md#moderate_user) | **POST** /auth/user/playermoderations | Moderate User [**unmoderate_user**](PlayermoderationApi.md#unmoderate_user) | **PUT** /auth/user/unplayermoderate | Unmoderate User @@ -38,6 +40,66 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## delete_player_moderation + +> models::Success delete_player_moderation(player_moderation_id) +Delete Player Moderation + +Deletes a specific player moderation based on it's `pmod_` ID. The website uses `unmoderateUser` instead. You can delete the same player moderation multiple times successfully. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**player_moderation_id** | **String** | Must be a valid `pmod_` ID. | [required] | + +### Return type + +[**models::Success**](Success.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### 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_player_moderation + +> models::PlayerModeration get_player_moderation(player_moderation_id) +Get Player Moderation + +Returns a single Player Moderation. This returns the exact same amount of information as the more generalised `getPlayerModerations`. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**player_moderation_id** | **String** | Must be a valid `pmod_` ID. | [required] | + +### Return type + +[**models::PlayerModeration**](PlayerModeration.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### 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_player_moderations > Vec get_player_moderations(r#type, target_user_id) diff --git a/docs/Submission.md b/docs/Submission.md deleted file mode 100644 index db2c4c3..0000000 --- a/docs/Submission.md +++ /dev/null @@ -1,17 +0,0 @@ -# Submission - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content_id** | **String** | Either world ID or avatar ID | -**created_at** | **String** | | -**description** | **String** | | -**id** | **String** | | -**jam_id** | **String** | | -**rating_score** | Option<**i32**> | | [optional] -**submitter_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | - -[[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/World.md b/docs/World.md index 640d855..ab1048c 100644 --- a/docs/World.md +++ b/docs/World.md @@ -27,6 +27,7 @@ Name | Type | Description | Notes **public_occupants** | Option<**i32**> | Will always be `0` when unauthenticated. | [optional][default to 0] **publication_date** | **String** | | **release_status** | [**models::ReleaseStatus**](ReleaseStatus.md) | | +**store_id** | Option<**String**> | | **tags** | **Vec** | | **thumbnail_image_url** | **String** | | **unity_packages** | Option<[**Vec**](UnityPackage.md)> | Empty if unauthenticated. | [optional] diff --git a/docs/WorldsApi.md b/docs/WorldsApi.md index f585716..2ad2aba 100644 --- a/docs/WorldsApi.md +++ b/docs/WorldsApi.md @@ -123,7 +123,7 @@ Name | Type | Description | Required | Notes ## get_favorited_worlds -> Vec get_favorited_worlds(featured, sort, n, order, offset, search, tag, notag, release_status, max_unity_version, min_unity_version, platform, user_id) +> Vec get_favorited_worlds(featured, sort, n, order, offset, search, tag, notag, release_status, max_unity_version, min_unity_version, platform, user_id) List Favorited Worlds Search and list favorited worlds by query filters. @@ -149,7 +149,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](FavoritedWorld.md) +[**Vec**](LimitedWorld.md) ### Authorization diff --git a/src/apis/jams_api.rs b/src/apis/jams_api.rs deleted file mode 100644 index a6f70e8..0000000 --- a/src/apis/jams_api.rs +++ /dev/null @@ -1,159 +0,0 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{Deserialize, Serialize}; - -/// struct for typed errors of method [`get_jam`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetJamError { - Status404(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_jam_submissions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetJamSubmissionsError { - Status404(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_jams`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetJamsError { - UnknownValue(serde_json::Value), -} - -/// Returns a jam. -pub async fn get_jam( - configuration: &configuration::Configuration, - jam_id: &str, -) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!( - "{}/jams/{jamId}", - local_var_configuration.base_path, - jamId = crate::apis::urlencode(jam_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()); - } - - 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)) - } -} - -/// Returns all submissions of a jam. -pub async fn get_jam_submissions( - configuration: &configuration::Configuration, - jam_id: &str, -) -> Result, Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!( - "{}/jams/{jamId}/submissions", - local_var_configuration.base_path, - jamId = crate::apis::urlencode(jam_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()); - } - - 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)) - } -} - -/// Lists World Jams or Avatar Jams, both currently running and ones that have ended. `isActive` is used to select only active or already ended jams. `type` is used to select only world or avatar jams, and can only take `world` or `avatar`. `` -pub async fn get_jams( - configuration: &configuration::Configuration, - r#type: Option<&str>, -) -> Result, Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/jams", 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) = r#type { - local_var_req_builder = - local_var_req_builder.query(&[("type", &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()); - } - - 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)) - } -} diff --git a/src/apis/mod.rs b/src/apis/mod.rs index b87bc7d..7b80d97 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -101,7 +101,6 @@ pub mod friends_api; pub mod groups_api; pub mod instances_api; pub mod invite_api; -pub mod jams_api; pub mod notifications_api; pub mod permissions_api; pub mod playermoderation_api; diff --git a/src/apis/notifications_api.rs b/src/apis/notifications_api.rs index 5b9c041..be73fb3 100644 --- a/src/apis/notifications_api.rs +++ b/src/apis/notifications_api.rs @@ -36,15 +36,6 @@ pub enum DeleteNotificationError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`get_notification`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetNotificationError { - Status401(models::Error), - Status404(models::Error), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`get_notifications`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -185,48 +176,6 @@ pub async fn delete_notification( } } -/// Get a notification by notification `not_` ID. -pub async fn get_notification( - configuration: &configuration::Configuration, - notification_id: &str, -) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!( - "{}/auth/user/notifications/{notificationId}", - local_var_configuration.base_path, - notificationId = crate::apis::urlencode(notification_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()); - } - - 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)) - } -} - /// Retrieve all of the current user's notifications. pub async fn get_notifications( configuration: &configuration::Configuration, diff --git a/src/apis/playermoderation_api.rs b/src/apis/playermoderation_api.rs index d83b964..925bf68 100644 --- a/src/apis/playermoderation_api.rs +++ b/src/apis/playermoderation_api.rs @@ -19,6 +19,24 @@ pub enum ClearAllPlayerModerationsError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`delete_player_moderation`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeletePlayerModerationError { + Status401(models::Error), + Status403(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_player_moderation`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPlayerModerationError { + Status401(models::Error), + Status404(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_player_moderations`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -83,6 +101,90 @@ pub async fn clear_all_player_moderations( } } +/// Deletes a specific player moderation based on it's `pmod_` ID. The website uses `unmoderateUser` instead. You can delete the same player moderation multiple times successfully. +pub async fn delete_player_moderation( + configuration: &configuration::Configuration, + player_moderation_id: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/auth/user/playermoderations/{playerModerationId}", + local_var_configuration.base_path, + playerModerationId = crate::apis::urlencode(player_moderation_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()); + } + + 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)) + } +} + +/// Returns a single Player Moderation. This returns the exact same amount of information as the more generalised `getPlayerModerations`. +pub async fn get_player_moderation( + configuration: &configuration::Configuration, + player_moderation_id: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/auth/user/playermoderations/{playerModerationId}", + local_var_configuration.base_path, + playerModerationId = crate::apis::urlencode(player_moderation_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()); + } + + 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)) + } +} + /// Returns a list of all player moderations made by **you**. This endpoint does not have pagination, and will return *all* results. Use query parameters to limit your query if needed. pub async fn get_player_moderations( configuration: &configuration::Configuration, diff --git a/src/apis/worlds_api.rs b/src/apis/worlds_api.rs index 3b2aba9..aae5cb0 100644 --- a/src/apis/worlds_api.rs +++ b/src/apis/worlds_api.rs @@ -315,7 +315,7 @@ pub async fn get_favorited_worlds( min_unity_version: Option<&str>, platform: Option<&str>, user_id: Option<&str>, -) -> Result, Error> { +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/src/models/favorited_world.rs b/src/models/favorited_world.rs deleted file mode 100644 index 47d7761..0000000 --- a/src/models/favorited_world.rs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// FavoritedWorld : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FavoritedWorld { - /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. - #[serde(rename = "authorId")] - pub author_id: String, - #[serde(rename = "authorName")] - pub author_name: String, - #[serde(rename = "capacity")] - pub capacity: i32, - #[serde(rename = "description")] - pub description: String, - #[serde( - rename = "recommendedCapacity", - skip_serializing_if = "Option::is_none" - )] - pub recommended_capacity: Option, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "favorites")] - pub favorites: i32, - #[serde(rename = "favoriteGroup")] - pub favorite_group: String, - #[serde(rename = "favoriteId")] - pub favorite_id: String, - #[serde(rename = "featured")] - pub featured: bool, - #[serde(rename = "visits", skip_serializing_if = "Option::is_none")] - pub visits: Option, - #[serde(rename = "heat")] - pub heat: i32, - /// WorldID be \"offline\" on User profiles if you are not friends with that user. - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "imageUrl")] - pub image_url: String, - #[serde(rename = "labsPublicationDate")] - pub labs_publication_date: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "occupants")] - pub occupants: i32, - #[serde(rename = "organization")] - pub organization: String, - #[serde(rename = "popularity")] - pub popularity: i32, - #[serde( - rename = "previewYoutubeId", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub preview_youtube_id: Option>, - #[serde(rename = "publicationDate")] - pub publication_date: String, - #[serde(rename = "releaseStatus")] - pub release_status: models::ReleaseStatus, - #[serde(rename = "tags")] - pub tags: Vec, - #[serde(rename = "thumbnailImageUrl")] - pub thumbnail_image_url: String, - #[serde(rename = "unityPackages")] - pub unity_packages: Vec, - #[serde(rename = "updated_at")] - pub updated_at: String, - #[serde(rename = "udonProducts", skip_serializing_if = "Option::is_none")] - pub udon_products: Option>, - #[serde(rename = "version")] - pub version: i32, -} - -impl FavoritedWorld { - pub fn new( - author_id: String, - author_name: String, - capacity: i32, - description: String, - created_at: String, - favorites: i32, - favorite_group: String, - favorite_id: String, - featured: bool, - heat: i32, - id: String, - image_url: String, - labs_publication_date: String, - name: String, - occupants: i32, - organization: String, - popularity: i32, - publication_date: String, - release_status: models::ReleaseStatus, - tags: Vec, - thumbnail_image_url: String, - unity_packages: Vec, - updated_at: String, - version: i32, - ) -> FavoritedWorld { - FavoritedWorld { - author_id, - author_name, - capacity, - description, - recommended_capacity: None, - created_at, - favorites, - favorite_group, - favorite_id, - featured, - visits: None, - heat, - id, - image_url, - labs_publication_date, - name, - occupants, - organization, - popularity, - preview_youtube_id: None, - publication_date, - release_status, - tags, - thumbnail_image_url, - unity_packages, - updated_at, - udon_products: None, - version, - } - } -} diff --git a/src/models/jam.rs b/src/models/jam.rs deleted file mode 100644 index 9601153..0000000 --- a/src/models/jam.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Jam : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Jam { - #[serde(rename = "description")] - pub description: String, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "isVisible")] - pub is_visible: bool, - #[serde(rename = "moreInfo")] - pub more_info: String, - /// One of: - submissions_open - closed - #[serde(rename = "state")] - pub state: String, - #[serde(rename = "stateChangeDates")] - pub state_change_dates: models::JamStateChangeDates, - #[serde( - rename = "submissionContentGateDate", - deserialize_with = "Option::deserialize" - )] - pub submission_content_gate_date: Option, - #[serde(rename = "submissionContentGated")] - pub submission_content_gated: bool, - #[serde(rename = "title")] - pub title: String, - #[serde(rename = "updated_at")] - pub updated_at: String, -} - -impl Jam { - pub fn new( - description: String, - id: String, - is_visible: bool, - more_info: String, - state: String, - state_change_dates: models::JamStateChangeDates, - submission_content_gate_date: Option, - submission_content_gated: bool, - title: String, - updated_at: String, - ) -> Jam { - Jam { - description, - id, - is_visible, - more_info, - state, - state_change_dates, - submission_content_gate_date, - submission_content_gated, - title, - updated_at, - } - } -} diff --git a/src/models/jam_state_change_dates.rs b/src/models/jam_state_change_dates.rs deleted file mode 100644 index 971d890..0000000 --- a/src/models/jam_state_change_dates.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct JamStateChangeDates { - #[serde( - rename = "closed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub closed: Option>, - #[serde( - rename = "submissionsClosed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub submissions_closed: Option>, - #[serde( - rename = "submissionsOpened", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub submissions_opened: Option>, - #[serde( - rename = "winnersSelected", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub winners_selected: Option>, -} - -impl JamStateChangeDates { - pub fn new() -> JamStateChangeDates { - JamStateChangeDates { - closed: None, - submissions_closed: None, - submissions_opened: None, - winners_selected: None, - } - } -} diff --git a/src/models/limited_world.rs b/src/models/limited_world.rs index 42ddf14..ce263b6 100644 --- a/src/models/limited_world.rs +++ b/src/models/limited_world.rs @@ -58,6 +58,8 @@ pub struct LimitedWorld { pub publication_date: String, #[serde(rename = "releaseStatus")] pub release_status: models::ReleaseStatus, + #[serde(rename = "storeId", deserialize_with = "Option::deserialize")] + pub store_id: Option, #[serde(rename = "tags")] pub tags: Vec, #[serde(rename = "thumbnailImageUrl")] @@ -87,6 +89,7 @@ impl LimitedWorld { popularity: i32, publication_date: String, release_status: models::ReleaseStatus, + store_id: Option, tags: Vec, thumbnail_image_url: String, unity_packages: Vec, @@ -111,6 +114,7 @@ impl LimitedWorld { preview_youtube_id: None, publication_date, release_status, + store_id, tags, thumbnail_image_url, unity_packages, diff --git a/src/models/mod.rs b/src/models/mod.rs index 1755fe2..64aaae1 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -88,8 +88,6 @@ pub mod favorite_group_visibility; pub use self::favorite_group_visibility::FavoriteGroupVisibility; pub mod favorite_type; pub use self::favorite_type::FavoriteType; -pub mod favorited_world; -pub use self::favorited_world::FavoritedWorld; pub mod file; pub use self::file::File; pub mod file_data; @@ -178,10 +176,6 @@ pub mod invite_request; pub use self::invite_request::InviteRequest; pub mod invite_response; pub use self::invite_response::InviteResponse; -pub mod jam; -pub use self::jam::Jam; -pub mod jam_state_change_dates; -pub use self::jam_state_change_dates::JamStateChangeDates; pub mod license; pub use self::license::License; pub mod license_action; @@ -254,8 +248,6 @@ pub mod sent_notification; pub use self::sent_notification::SentNotification; pub mod sort_option; pub use self::sort_option::SortOption; -pub mod submission; -pub use self::submission::Submission; pub mod subscription; pub use self::subscription::Subscription; pub mod subscription_period; diff --git a/src/models/submission.rs b/src/models/submission.rs deleted file mode 100644 index 2d371b0..0000000 --- a/src/models/submission.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Submission : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Submission { - /// Either world ID or avatar ID - #[serde(rename = "contentId")] - pub content_id: String, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "description")] - pub description: String, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "jamId")] - pub jam_id: String, - #[serde(rename = "ratingScore", skip_serializing_if = "Option::is_none")] - pub rating_score: Option, - /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. - #[serde(rename = "submitterId")] - pub submitter_id: String, -} - -impl Submission { - pub fn new( - content_id: String, - created_at: String, - description: String, - id: String, - jam_id: String, - submitter_id: String, - ) -> Submission { - Submission { - content_id, - created_at, - description, - id, - jam_id, - rating_score: None, - submitter_id, - } - } -} diff --git a/src/models/world.rs b/src/models/world.rs index 424e2ba..305f790 100644 --- a/src/models/world.rs +++ b/src/models/world.rs @@ -69,6 +69,8 @@ pub struct World { pub publication_date: String, #[serde(rename = "releaseStatus")] pub release_status: models::ReleaseStatus, + #[serde(rename = "storeId", deserialize_with = "Option::deserialize")] + pub store_id: Option, #[serde(rename = "tags")] pub tags: Vec, #[serde(rename = "thumbnailImageUrl")] @@ -104,6 +106,7 @@ impl World { popularity: i32, publication_date: String, release_status: models::ReleaseStatus, + store_id: Option, tags: Vec, thumbnail_image_url: String, updated_at: String, @@ -134,6 +137,7 @@ impl World { public_occupants: None, publication_date, release_status, + store_id, tags, thumbnail_image_url, unity_packages: None,