mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-22 23:55:33 +00:00
Upgrade Rust SDK to spec 1.11.0
This commit is contained in:
@ -53,6 +53,14 @@ pub enum Verify2FaError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`verify2_fa_email_code`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum Verify2FaEmailCodeError {
|
||||
Status401(crate::models::Error),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`verify_auth_token`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
@ -116,7 +124,7 @@ pub fn delete_user(configuration: &configuration::Configuration, user_id: &str)
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user/{userId}/delete", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id));
|
||||
let local_var_uri_str = format!("{}/users/{userId}/delete", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id));
|
||||
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 {
|
||||
@ -226,6 +234,35 @@ pub fn verify2_fa(configuration: &configuration::Configuration, two_factor_auth_
|
||||
}
|
||||
}
|
||||
|
||||
/// Finishes the login sequence with an 2FA email code.
|
||||
pub fn verify2_fa_email_code(configuration: &configuration::Configuration, two_factor_email_code: Option<crate::models::TwoFactorEmailCode>) -> Result<crate::models::Verify2FaEmailCodeResult, Error<Verify2FaEmailCodeError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/auth/twofactorauth/emailotp/verify", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
local_var_req_builder = local_var_req_builder.json(&two_factor_email_code);
|
||||
|
||||
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<Verify2FaEmailCodeError> = 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))
|
||||
}
|
||||
}
|
||||
|
||||
/// Verify whether the currently provided Auth Token is valid.
|
||||
pub fn verify_auth_token(configuration: &configuration::Configuration, ) -> Result<crate::models::VerifyAuthTokenResult, Error<VerifyAuthTokenError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
Reference in New Issue
Block a user