From 7567269b87544038e2e14c07e9b2bb833262fc67 Mon Sep 17 00:00:00 2001 From: VRCCat Date: Sun, 31 Oct 2021 00:43:01 +0000 Subject: [PATCH] Upgrade Rust SDK to spec 1.5.1 --- .openapi-generator/FILES | 6 + Cargo.toml | 2 +- docs/InlineResponse404.md | 11 ++ docs/InstancesApi.md | 104 ++++++++++++++++ docs/InviteApi.md | 27 +++-- docs/PlayermoderationApi.md | 4 +- docs/SystemApi.md | 10 +- docs/UpdateInviteMessageRequest.md | 11 ++ src/apis/instances_api.rs | 124 ++++++++++++++++++++ src/apis/invite_api.rs | 19 +-- src/apis/mod.rs | 1 + src/apis/playermoderation_api.rs | 2 +- src/apis/system_api.rs | 6 +- src/models/inline_response_404.rs | 26 ++++ src/models/mod.rs | 4 + src/models/update_invite_message_request.rs | 26 ++++ 16 files changed, 350 insertions(+), 33 deletions(-) create mode 100644 docs/InlineResponse404.md create mode 100644 docs/InstancesApi.md create mode 100644 docs/UpdateInviteMessageRequest.md create mode 100644 src/apis/instances_api.rs create mode 100644 src/models/inline_response_404.rs create mode 100644 src/models/update_invite_message_request.rs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 3e01408..36ec247 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -33,8 +33,10 @@ docs/FilesApi.md docs/FinishFileDataUploadRequest.md docs/FriendStatus.md docs/FriendsApi.md +docs/InlineResponse404.md docs/Instance.md docs/InstancePlatforms.md +docs/InstancesApi.md docs/InviteApi.md docs/InviteMessage.md docs/InviteMessageType.md @@ -63,6 +65,7 @@ docs/TwoFactorAuthCode.md docs/UnityPackage.md docs/UpdateAvatarRequest.md docs/UpdateFavoriteGroupRequest.md +docs/UpdateInviteMessageRequest.md docs/UpdateUserRequest.md docs/UpdateWorldRequest.md docs/User.md @@ -83,6 +86,7 @@ src/apis/configuration.rs src/apis/favorites_api.rs src/apis/files_api.rs src/apis/friends_api.rs +src/apis/instances_api.rs src/apis/invite_api.rs src/apis/mod.rs src/apis/notifications_api.rs @@ -120,6 +124,7 @@ src/models/file_version.rs src/models/file_version_upload_status.rs src/models/finish_file_data_upload_request.rs src/models/friend_status.rs +src/models/inline_response_404.rs src/models/instance.rs src/models/instance_platforms.rs src/models/invite_message.rs @@ -146,6 +151,7 @@ src/models/two_factor_auth_code.rs src/models/unity_package.rs src/models/update_avatar_request.rs src/models/update_favorite_group_request.rs +src/models/update_invite_message_request.rs src/models/update_user_request.rs src/models/update_world_request.rs src/models/user.rs diff --git a/Cargo.toml b/Cargo.toml index 042b419..e88e884 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vrchatapi" -version = "1.5.0" +version = "1.5.1" authors = ["OpenAPI Generator team and contributors"] license = "MIT" edition = "2018" diff --git a/docs/InlineResponse404.md b/docs/InlineResponse404.md new file mode 100644 index 0000000..2727fee --- /dev/null +++ b/docs/InlineResponse404.md @@ -0,0 +1,11 @@ +# InlineResponse404 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**crate::models::Error**](Error.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/InstancesApi.md b/docs/InstancesApi.md new file mode 100644 index 0000000..a02fdf2 --- /dev/null +++ b/docs/InstancesApi.md @@ -0,0 +1,104 @@ +# \InstancesApi + +All URIs are relative to *https://api.vrchat.cloud/api/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_instance**](InstancesApi.md#get_instance) | **GET** /instances/{worldId}:{instanceId} | Get Instance +[**get_short_name**](InstancesApi.md#get_short_name) | **GET** /instances/{worldId}:{instanceId}/shortName | Get Instance Short Name +[**send_self_invite**](InstancesApi.md#send_self_invite) | **POST** /instances/{worldId}:{instanceId}/invite | Send Self Invite + + + +## get_instance + +> crate::models::Instance get_instance(world_id, instance_id) +Get Instance + +Returns an instance. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**world_id** | **String** | | [required] | +**instance_id** | **String** | | [required] | + +### Return type + +[**crate::models::Instance**](Instance.md) + +### Authorization + +[apiKeyCookie](../README.md#apiKeyCookie), [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_short_name + +> String get_short_name(world_id, instance_id) +Get Instance Short Name + +Returns an instance short name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**world_id** | **String** | | [required] | +**instance_id** | **String** | | [required] | + +### Return type + +**String** + +### Authorization + +[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain, 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) + + +## send_self_invite + +> crate::models::Success send_self_invite(world_id, instance_id) +Send Self Invite + +Sends an invite to the instance to yourself. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**world_id** | **String** | | [required] | +**instance_id** | **String** | | [required] | + +### Return type + +[**crate::models::Success**](Success.md) + +### Authorization + +[apiKeyCookie](../README.md#apiKeyCookie), [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/InviteApi.md b/docs/InviteApi.md index 966bc8e..4128482 100644 --- a/docs/InviteApi.md +++ b/docs/InviteApi.md @@ -4,20 +4,20 @@ All URIs are relative to *https://api.vrchat.cloud/api/1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**get_invite_message**](InviteApi.md#get_invite_message) | **GET** /message/{userId}/{messageType}/{messageId} | Get Invite Messages +[**get_invite_message**](InviteApi.md#get_invite_message) | **GET** /message/{userId}/{messageType}/{slot} | Get Invite Message [**get_invite_messages**](InviteApi.md#get_invite_messages) | **GET** /message/{userId}/{messageType} | List Invite Messages [**invite_user**](InviteApi.md#invite_user) | **POST** /invite/{userId} | Invite User [**request_invite**](InviteApi.md#request_invite) | **POST** /requestInvite/{userId} | Request Invite -[**reset_invite_message**](InviteApi.md#reset_invite_message) | **DELETE** /message/{userId}/{messageType}/{messageId} | Reset Invite Message +[**reset_invite_message**](InviteApi.md#reset_invite_message) | **DELETE** /message/{userId}/{messageType}/{slot} | Reset Invite Message [**respond_invite**](InviteApi.md#respond_invite) | **POST** /invite/{notificationId}/response | Respond Invite -[**update_invite_message**](InviteApi.md#update_invite_message) | **PUT** /message/{userId}/{messageType}/{messageId} | Update Invite Message +[**update_invite_message**](InviteApi.md#update_invite_message) | **PUT** /message/{userId}/{messageType}/{slot} | Update Invite Message ## get_invite_message -> crate::models::InviteMessage get_invite_message(user_id, message_type, message_id) -Get Invite Messages +> crate::models::InviteMessage get_invite_message(user_id, message_type, slot) +Get Invite Message Returns a single Invite Message. This returns the exact same information but less than `getInviteMessages`. Admin Credentials are required to view messages of other users! Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite @@ -28,7 +28,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **String** | | [required] | **message_type** | **String** | | [required] | -**message_id** | **i32** | | [required] | +**slot** | **i32** | | [required] | ### Return type @@ -140,10 +140,10 @@ Name | Type | Description | Required | Notes ## reset_invite_message -> Vec reset_invite_message(user_id, message_type, message_id) +> Vec reset_invite_message(user_id, message_type, slot) Reset Invite Message -Resets a single Invite Message back to it's original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, but resetting it does not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 Too Fast Error. Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite +Resets a single Invite Message back to it's original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, so it is not possible to reset within the 60 minutes countdown. Resetting it does however not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite The DELETE endpoint does not have/require any request body. ### Parameters @@ -152,7 +152,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **String** | | [required] | **message_type** | **String** | | [required] | -**message_id** | **i32** | | [required] | +**slot** | **i32** | | [required] | ### Return type @@ -203,10 +203,10 @@ Name | Type | Description | Required | Notes ## update_invite_message -> Vec update_invite_message(user_id, message_type, message_id) +> Vec update_invite_message(user_id, message_type, slot, update_invite_message_request) Update Invite Message -Updates a single Invite Message and then returns a list of all of them. Admin Credentials are required to update messages of other users! Updating a message automatically sets the cooldown timer to 60 minutes. Trying to edit a message before the cooldown timer expires results in a 429 Too Fast Error. Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite +Updates a single Invite Message and then returns a list of all of them. Admin Credentials are required to update messages of other users! Updating a message automatically sets the cooldown timer to 60 minutes. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite ### Parameters @@ -215,7 +215,8 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **String** | | [required] | **message_type** | **String** | | [required] | -**message_id** | **i32** | | [required] | +**slot** | **i32** | | [required] | +**update_invite_message_request** | Option<[**UpdateInviteMessageRequest**](UpdateInviteMessageRequest.md)> | Message of what to set the invite message to. | | ### Return type @@ -227,7 +228,7 @@ Name | Type | Description | Required | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **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) diff --git a/docs/PlayermoderationApi.md b/docs/PlayermoderationApi.md index 4faf800..72783ac 100644 --- a/docs/PlayermoderationApi.md +++ b/docs/PlayermoderationApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description ## clear_all_player_moderations -> crate::models::Error clear_all_player_moderations() +> crate::models::Success clear_all_player_moderations() Clear All Player Moderations ⚠️ **This will delete every single player moderation you've ever made.** @@ -26,7 +26,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::Error**](Error.md) +[**crate::models::Success**](Success.md) ### Authorization diff --git a/docs/SystemApi.md b/docs/SystemApi.md index 5e24620..642a4bc 100644 --- a/docs/SystemApi.md +++ b/docs/SystemApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://api.vrchat.cloud/api/1* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_config**](SystemApi.md#get_config) | **GET** /config | Fetch API Config -[**get_css**](SystemApi.md#get_css) | **GET** /css/app.js | Download CSS +[**get_css**](SystemApi.md#get_css) | **GET** /css/app.css | Download CSS [**get_current_online_users**](SystemApi.md#get_current_online_users) | **GET** /visits | Current Online Users [**get_health**](SystemApi.md#get_health) | **GET** /health | Check API Health [**get_java_script**](SystemApi.md#get_java_script) | **GET** /js/app.js | Download JavaScript @@ -76,7 +76,7 @@ No authorization required > i32 get_current_online_users() Current Online Users -Returns in plain format the number of currently online users. **NOTE:** The response type is not of JSON, but is an integer in plain ASCII format. +Returns the current number of online users. **NOTE:** The response type is not a JSON object, but a simple JSON integer. ### Parameters @@ -93,7 +93,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: text/plain +- **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) @@ -161,7 +161,7 @@ No authorization required > String get_system_time() Current System Time -Returns in plain format the current time of the API server. **NOTE:** The response type is not of JSON, but is a string in plain ASCII format. +Returns the current time of the API server. **NOTE:** The response type is not a JSON object, but a simple JSON string. ### Parameters @@ -178,7 +178,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: text/plain +- **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/UpdateInviteMessageRequest.md b/docs/UpdateInviteMessageRequest.md new file mode 100644 index 0000000..9ef25d5 --- /dev/null +++ b/docs/UpdateInviteMessageRequest.md @@ -0,0 +1,11 @@ +# UpdateInviteMessageRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **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/src/apis/instances_api.rs b/src/apis/instances_api.rs new file mode 100644 index 0000000..dc563cc --- /dev/null +++ b/src/apis/instances_api.rs @@ -0,0 +1,124 @@ +/* + * VRChat API Documentation + * + * + * Contact: me@ruby.js.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_instance`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetInstanceError { + Status401(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_short_name`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetShortNameError { + Status401(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`send_self_invite`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SendSelfInviteError { + Status401(crate::models::Error), + UnknownValue(serde_json::Value), +} + + +/// Returns an instance. +pub fn get_instance(configuration: &configuration::Configuration, world_id: &str, instance_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/instances/{worldId}:{instanceId}", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_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 mut local_var_resp = local_var_client.execute(local_var_req)?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text()?; + + 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 an instance short name. +pub fn get_short_name(configuration: &configuration::Configuration, world_id: &str, instance_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/instances/{worldId}:{instanceId}/shortName", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_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 mut local_var_resp = local_var_client.execute(local_var_req)?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text()?; + + 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)) + } +} + +/// Sends an invite to the instance to yourself. +pub fn send_self_invite(configuration: &configuration::Configuration, world_id: &str, instance_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/instances/{worldId}:{instanceId}/invite", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_id)); + 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()); + } + + let local_var_req = local_var_req_builder.build()?; + let mut local_var_resp = local_var_client.execute(local_var_req)?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text()?; + + 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/invite_api.rs b/src/apis/invite_api.rs index fa9e348..ba45275 100644 --- a/src/apis/invite_api.rs +++ b/src/apis/invite_api.rs @@ -19,6 +19,7 @@ use super::{Error, configuration}; pub enum GetInviteMessageError { Status400(crate::models::Error), Status401(crate::models::Error), + Status404(crate::models::Error), UnknownValue(serde_json::Value), } @@ -53,6 +54,7 @@ pub enum RequestInviteError { pub enum ResetInviteMessageError { Status400(crate::models::Error), Status401(crate::models::Error), + Status404(crate::models::InlineResponse404), Status429(crate::models::Error), UnknownValue(serde_json::Value), } @@ -77,12 +79,12 @@ pub enum UpdateInviteMessageError { /// Returns a single Invite Message. This returns the exact same information but less than `getInviteMessages`. Admin Credentials are required to view messages of other users! Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite -pub fn get_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: &str, message_id: i32) -> Result> { +pub fn get_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: &str, slot: i32) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{messageId}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=crate::apis::urlencode(message_type), messageId=message_id); + let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{slot}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=crate::apis::urlencode(message_type), slot=slot); 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 { @@ -189,13 +191,13 @@ pub fn request_invite(configuration: &configuration::Configuration, user_id: &st } } -/// Resets a single Invite Message back to it's original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, but resetting it does not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 Too Fast Error. Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite -pub fn reset_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: &str, message_id: i32) -> Result, Error> { +/// Resets a single Invite Message back to it's original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, so it is not possible to reset within the 60 minutes countdown. Resetting it does however not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite The DELETE endpoint does not have/require any request body. +pub fn reset_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: &str, slot: i32) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{messageId}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=crate::apis::urlencode(message_type), messageId=message_id); + let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{slot}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=crate::apis::urlencode(message_type), slot=slot); 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 { @@ -246,18 +248,19 @@ pub fn respond_invite(configuration: &configuration::Configuration, notification } } -/// Updates a single Invite Message and then returns a list of all of them. Admin Credentials are required to update messages of other users! Updating a message automatically sets the cooldown timer to 60 minutes. Trying to edit a message before the cooldown timer expires results in a 429 Too Fast Error. Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite -pub fn update_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: &str, message_id: i32) -> Result, Error> { +/// Updates a single Invite Message and then returns a list of all of them. Admin Credentials are required to update messages of other users! Updating a message automatically sets the cooldown timer to 60 minutes. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite +pub fn update_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: &str, slot: i32, update_invite_message_request: Option) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{messageId}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=crate::apis::urlencode(message_type), messageId=message_id); + let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{slot}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=crate::apis::urlencode(message_type), slot=slot); let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, 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()); } + local_var_req_builder = local_var_req_builder.json(&update_invite_message_request); let local_var_req = local_var_req_builder.build()?; let mut local_var_resp = local_var_client.execute(local_var_req)?; diff --git a/src/apis/mod.rs b/src/apis/mod.rs index 998a8d9..bb881a0 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -66,6 +66,7 @@ pub mod avatars_api; pub mod favorites_api; pub mod files_api; pub mod friends_api; +pub mod instances_api; pub mod invite_api; pub mod notifications_api; pub mod permissions_api; diff --git a/src/apis/playermoderation_api.rs b/src/apis/playermoderation_api.rs index 7706363..c5d550f 100644 --- a/src/apis/playermoderation_api.rs +++ b/src/apis/playermoderation_api.rs @@ -65,7 +65,7 @@ pub enum UnmoderateUserError { /// ⚠️ **This will delete every single player moderation you've ever made.** -pub fn clear_all_player_moderations(configuration: &configuration::Configuration, ) -> Result> { +pub fn clear_all_player_moderations(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/src/apis/system_api.rs b/src/apis/system_api.rs index ec246e8..75b6e98 100644 --- a/src/apis/system_api.rs +++ b/src/apis/system_api.rs @@ -92,7 +92,7 @@ pub fn get_css(configuration: &configuration::Configuration, variant: Option<&st let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/css/app.js", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/css/app.css", 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) = variant { @@ -120,7 +120,7 @@ pub fn get_css(configuration: &configuration::Configuration, variant: Option<&st } } -/// Returns in plain format the number of currently online users. **NOTE:** The response type is not of JSON, but is an integer in plain ASCII format. +/// Returns the current number of online users. **NOTE:** The response type is not a JSON object, but a simple JSON integer. pub fn get_current_online_users(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; @@ -210,7 +210,7 @@ pub fn get_java_script(configuration: &configuration::Configuration, variant: Op } } -/// Returns in plain format the current time of the API server. **NOTE:** The response type is not of JSON, but is a string in plain ASCII format. +/// Returns the current time of the API server. **NOTE:** The response type is not a JSON object, but a simple JSON string. pub fn get_system_time(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; diff --git a/src/models/inline_response_404.rs b/src/models/inline_response_404.rs new file mode 100644 index 0000000..bc9a1ad --- /dev/null +++ b/src/models/inline_response_404.rs @@ -0,0 +1,26 @@ +/* + * VRChat API Documentation + * + * + * Contact: me@ruby.js.org + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct InlineResponse404 { + #[serde(rename = "error")] + pub error: Box, +} + +impl InlineResponse404 { + pub fn new(error: crate::models::Error) -> InlineResponse404 { + InlineResponse404 { + error: Box::new(error), + } + } +} + + diff --git a/src/models/mod.rs b/src/models/mod.rs index e8c64fb..e3d7cbf 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -54,6 +54,8 @@ pub mod finish_file_data_upload_request; pub use self::finish_file_data_upload_request::FinishFileDataUploadRequest; pub mod friend_status; pub use self::friend_status::FriendStatus; +pub mod inline_response_404; +pub use self::inline_response_404::InlineResponse404; pub mod instance; pub use self::instance::Instance; pub mod instance_platforms; @@ -104,6 +106,8 @@ pub mod update_avatar_request; pub use self::update_avatar_request::UpdateAvatarRequest; pub mod update_favorite_group_request; pub use self::update_favorite_group_request::UpdateFavoriteGroupRequest; +pub mod update_invite_message_request; +pub use self::update_invite_message_request::UpdateInviteMessageRequest; pub mod update_user_request; pub use self::update_user_request::UpdateUserRequest; pub mod update_world_request; diff --git a/src/models/update_invite_message_request.rs b/src/models/update_invite_message_request.rs new file mode 100644 index 0000000..e8e3a56 --- /dev/null +++ b/src/models/update_invite_message_request.rs @@ -0,0 +1,26 @@ +/* + * VRChat API Documentation + * + * + * Contact: me@ruby.js.org + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpdateInviteMessageRequest { + #[serde(rename = "message")] + pub message: String, +} + +impl UpdateInviteMessageRequest { + pub fn new(message: String) -> UpdateInviteMessageRequest { + UpdateInviteMessageRequest { + message, + } + } +} + +