mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-22 15:45:35 +00:00
Upgrade Rust SDK to spec 1.11.0
This commit is contained in:
@ -112,6 +112,7 @@ docs/TransactionStatus.md
|
||||
docs/TransactionSteamInfo.md
|
||||
docs/TransactionSteamWalletInfo.md
|
||||
docs/TwoFactorAuthCode.md
|
||||
docs/TwoFactorEmailCode.md
|
||||
docs/UnityPackage.md
|
||||
docs/UpdateAvatarRequest.md
|
||||
docs/UpdateFavoriteGroupRequest.md
|
||||
@ -128,6 +129,7 @@ docs/UserState.md
|
||||
docs/UserStatus.md
|
||||
docs/UserSubscription.md
|
||||
docs/UsersApi.md
|
||||
docs/Verify2FaEmailCodeResult.md
|
||||
docs/Verify2FaResult.md
|
||||
docs/VerifyAuthTokenResult.md
|
||||
docs/World.md
|
||||
@ -253,6 +255,7 @@ src/models/transaction_status.rs
|
||||
src/models/transaction_steam_info.rs
|
||||
src/models/transaction_steam_wallet_info.rs
|
||||
src/models/two_factor_auth_code.rs
|
||||
src/models/two_factor_email_code.rs
|
||||
src/models/unity_package.rs
|
||||
src/models/update_avatar_request.rs
|
||||
src/models/update_favorite_group_request.rs
|
||||
@ -268,6 +271,7 @@ src/models/user_exists.rs
|
||||
src/models/user_state.rs
|
||||
src/models/user_status.rs
|
||||
src/models/user_subscription.rs
|
||||
src/models/verify2_fa_email_code_result.rs
|
||||
src/models/verify2_fa_result.rs
|
||||
src/models/verify_auth_token_result.rs
|
||||
src/models/world.rs
|
||||
|
@ -1,9 +1,9 @@
|
||||
[package]
|
||||
name = "vrchatapi"
|
||||
version = "1.10.1"
|
||||
version = "1.11.0"
|
||||
authors = ["me@ariesclark.com"]
|
||||
description = "VRChat API Client for Rust"
|
||||
license = "The MIT License (MIT)"
|
||||
license = "MIT"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
|
@ -5,10 +5,11 @@ All URIs are relative to *https://api.vrchat.cloud/api/1*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**check_user_exists**](AuthenticationApi.md#check_user_exists) | **GET** /auth/exists | Check User Exists
|
||||
[**delete_user**](AuthenticationApi.md#delete_user) | **PUT** /user/{userId}/delete | Delete User
|
||||
[**delete_user**](AuthenticationApi.md#delete_user) | **PUT** /users/{userId}/delete | Delete User
|
||||
[**get_current_user**](AuthenticationApi.md#get_current_user) | **GET** /auth/user | Login and/or Get Current User Info
|
||||
[**logout**](AuthenticationApi.md#logout) | **PUT** /logout | Logout
|
||||
[**verify2_fa**](AuthenticationApi.md#verify2_fa) | **POST** /auth/twofactorauth/totp/verify | Verify 2FA code
|
||||
[**verify2_fa_email_code**](AuthenticationApi.md#verify2_fa_email_code) | **POST** /auth/twofactorauth/emailotp/verify | Verify 2FA email code
|
||||
[**verify_auth_token**](AuthenticationApi.md#verify_auth_token) | **GET** /auth | Verify Auth Token
|
||||
[**verify_recovery_code**](AuthenticationApi.md#verify_recovery_code) | **POST** /auth/twofactorauth/otp/verify | Verify 2FA code with Recovery code
|
||||
|
||||
@ -161,6 +162,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)
|
||||
|
||||
|
||||
## verify2_fa_email_code
|
||||
|
||||
> crate::models::Verify2FaEmailCodeResult verify2_fa_email_code(two_factor_email_code)
|
||||
Verify 2FA email code
|
||||
|
||||
Finishes the login sequence with an 2FA email code.
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**two_factor_email_code** | Option<[**TwoFactorEmailCode**](TwoFactorEmailCode.md)> | | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**crate::models::Verify2FaEmailCodeResult**](Verify2FAEmailCodeResult.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[authCookie](../README.md#authCookie)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## verify_auth_token
|
||||
|
||||
> crate::models::VerifyAuthTokenResult verify_auth_token()
|
||||
|
11
docs/TwoFactorEmailCode.md
Normal file
11
docs/TwoFactorEmailCode.md
Normal file
@ -0,0 +1,11 @@
|
||||
# TwoFactorEmailCode
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **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)
|
||||
|
||||
|
11
docs/Verify2FaEmailCodeResult.md
Normal file
11
docs/Verify2FaEmailCodeResult.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Verify2FaEmailCodeResult
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**verified** | **bool** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -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;
|
||||
|
@ -196,6 +196,8 @@ pub mod transaction_steam_wallet_info;
|
||||
pub use self::transaction_steam_wallet_info::TransactionSteamWalletInfo;
|
||||
pub mod two_factor_auth_code;
|
||||
pub use self::two_factor_auth_code::TwoFactorAuthCode;
|
||||
pub mod two_factor_email_code;
|
||||
pub use self::two_factor_email_code::TwoFactorEmailCode;
|
||||
pub mod unity_package;
|
||||
pub use self::unity_package::UnityPackage;
|
||||
pub mod update_avatar_request;
|
||||
@ -226,6 +228,8 @@ pub mod user_status;
|
||||
pub use self::user_status::UserStatus;
|
||||
pub mod user_subscription;
|
||||
pub use self::user_subscription::UserSubscription;
|
||||
pub mod verify2_fa_email_code_result;
|
||||
pub use self::verify2_fa_email_code_result::Verify2FaEmailCodeResult;
|
||||
pub mod verify2_fa_result;
|
||||
pub use self::verify2_fa_result::Verify2FaResult;
|
||||
pub mod verify_auth_token_result;
|
||||
|
26
src/models/two_factor_email_code.rs
Normal file
26
src/models/two_factor_email_code.rs
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ariesclark.com
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct TwoFactorEmailCode {
|
||||
#[serde(rename = "code")]
|
||||
pub code: String,
|
||||
}
|
||||
|
||||
impl TwoFactorEmailCode {
|
||||
pub fn new(code: String) -> TwoFactorEmailCode {
|
||||
TwoFactorEmailCode {
|
||||
code,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
26
src/models/verify2_fa_email_code_result.rs
Normal file
26
src/models/verify2_fa_email_code_result.rs
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ariesclark.com
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct Verify2FaEmailCodeResult {
|
||||
#[serde(rename = "verified")]
|
||||
pub verified: bool,
|
||||
}
|
||||
|
||||
impl Verify2FaEmailCodeResult {
|
||||
pub fn new(verified: bool) -> Verify2FaEmailCodeResult {
|
||||
Verify2FaEmailCodeResult {
|
||||
verified,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user