Upgrade Rust SDK to spec 1.4.1

This commit is contained in:
Foorack
2021-10-08 12:05:31 +02:00
parent 760d14e93c
commit 0f5ba98772
117 changed files with 1221 additions and 836 deletions

View File

@ -2,7 +2,7 @@
* VRChat API Documentation
*
*
* The version of the OpenAPI document: 1.3.0
* The version of the OpenAPI document: 1.4.1
* Contact: me@ruby.js.org
* Generated by: https://openapi-generator.tech
*/
@ -14,6 +14,14 @@ use crate::apis::ResponseContent;
use super::{Error, configuration};
/// struct for typed errors of method `check_user_exists`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CheckUserExistsError {
Status400(crate::models::Error),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `delete_user`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@ -63,6 +71,45 @@ pub enum VerifyRecoveryCodeError {
}
/// Checks if a user by a given `username`, `displayName` or `email` exist. This is used during registration to check if a username has already been taken, during change of displayName to check if a displayName is available, and during change of email to check if the email is already used. In the later two cases the `excludeUserId` is used to exclude oneself, otherwise the result would always be true. It is **REQUIRED** to include **AT LEAST** `username`, `displayName` **or** `email` query parameter. Although they can be combined - in addition with `excludeUserId` (generally to exclude yourself) - to further fine-tune the search.
pub fn check_user_exists(configuration: &configuration::Configuration, email: Option<&str>, display_name: Option<&str>, user_id: Option<&str>, exclude_user_id: Option<&str>) -> Result<crate::models::UserExists, Error<CheckUserExistsError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!("{}/auth/exists", 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) = email {
local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = display_name {
local_var_req_builder = local_var_req_builder.query(&[("displayName", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = user_id {
local_var_req_builder = local_var_req_builder.query(&[("userId", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = exclude_user_id {
local_var_req_builder = local_var_req_builder.query(&[("excludeUserId", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = 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<CheckUserExistsError> = 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))
}
}
/// Deletes the account with given ID. Normal users only have permission to delete their own account. Account deletion is 14 days from this request, and will be cancelled if you do an authenticated request with the account afterwards. **VRC+ NOTE:** Despite the 14-days cooldown, any VRC+ subscription will be cancelled **immediately**. **METHOD NOTE:** Despite this being a Delete action, the method type required is PUT.
pub fn delete_user(configuration: &configuration::Configuration, user_id: &str) -> Result<crate::models::CurrentUser, Error<DeleteUserError>> {
@ -90,7 +137,7 @@ pub fn delete_user(configuration: &configuration::Configuration, user_id: &str)
}
}
/// Login and/or Get user data from your VRChat account. If `Authorization` header is present then a new login session will be generated, and a new `auth` cookie is returned. **WARNING: Session Limit:** Each authentication with login credentials counts as a separate session, out of which you have a limited amount. Make sure to save and reuse the `auth` cookie whenever you can, and avoid sending the Authorization header unless strictly neccesary. While the exact number of simultaneous open sessions is secret, expect to **very fast** run into the rate-limit and be temporarily blocked from making new sessions until the old ones expire.
/// This endpoint does the following two operations: 1) Checks if you are already logged in by looking for a valid `auth` cookie. If you are have a valid auth cookie then no additional auth-related actions are taken. If you are **not** logged in then it will log you in with the `Authorization` header and set the `auth` cookie. The `auth` cookie will only be sent once. 2) If logged in, this function will also return the CurrentUser object containing detailed information about the currently logged in user. **WARNING: Session Limit:** Each authentication with login credentials counts as a separate session, out of which you have a limited amount. Make sure to save and reuse the `auth` cookie if you are often restarting the program. The provided API libraries automatically save cookies during runtime, but does not persist during restart. While it can be fine to use username/password during development, expect in production to very fast run into the rate-limit and be temporarily blocked from making new sessions until older ones expire. The exact number of simultaneous sessions is unknown/undisclosed.
pub fn get_current_user(configuration: &configuration::Configuration, ) -> Result<crate::models::CurrentUser, Error<GetCurrentUserError>> {
let local_var_client = &configuration.client;