Skip to content

Commit d65df92

Browse files
committed
Upgrade Rust SDK to spec 1.20.7-nightly.28
1 parent 86af32e commit d65df92

12 files changed

Lines changed: 152 additions & 25 deletions

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,14 @@ docs/PropUnityPackage.md
225225
docs/PropsApi.md
226226
docs/PurchaseProductListingRequest.md
227227
docs/Region.md
228+
docs/RegisterUserAccount200Response.md
228229
docs/RegisterUserAccountRequest.md
229230
docs/ReleaseStatus.md
230231
docs/ReportCategory.md
231232
docs/ReportReason.md
232233
docs/RepresentedGroup.md
233234
docs/RequestInviteRequest.md
235+
docs/RequiresTwoFactorAuth.md
234236
docs/RespondGroupJoinRequest.md
235237
docs/RespondNotificationV2Request.md
236238
docs/Response.md
@@ -260,6 +262,7 @@ docs/TransactionStatus.md
260262
docs/TransactionSteamInfo.md
261263
docs/TransactionSteamWalletInfo.md
262264
docs/TwoFactorAuthCode.md
265+
docs/TwoFactorAuthType.md
263266
docs/TwoFactorEmailCode.md
264267
docs/TwoFactorRecoveryCodes.md
265268
docs/TwoFactorRecoveryCodesOtpInner.md
@@ -528,12 +531,14 @@ src/models/prop.rs
528531
src/models/prop_unity_package.rs
529532
src/models/purchase_product_listing_request.rs
530533
src/models/region.rs
534+
src/models/register_user_account_200_response.rs
531535
src/models/register_user_account_request.rs
532536
src/models/release_status.rs
533537
src/models/report_category.rs
534538
src/models/report_reason.rs
535539
src/models/represented_group.rs
536540
src/models/request_invite_request.rs
541+
src/models/requires_two_factor_auth.rs
537542
src/models/respond_group_join_request.rs
538543
src/models/respond_notification_v2_request.rs
539544
src/models/response.rs
@@ -563,6 +568,7 @@ src/models/transaction_status.rs
563568
src/models/transaction_steam_info.rs
564569
src/models/transaction_steam_wallet_info.rs
565570
src/models/two_factor_auth_code.rs
571+
src/models/two_factor_auth_type.rs
566572
src/models/two_factor_email_code.rs
567573
src/models/two_factor_recovery_codes.rs
568574
src/models/two_factor_recovery_codes_otp_inner.rs

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
repository="https://github.com/vrchatapi/vrchatapi-rust"
33
name = "vrchatapi"
4-
version = "1.20.7-nightly.16"
4+
version = "1.20.7-nightly.28"
55
authors = ["vrchatapi.lpv0t@aries.fyi"]
66
description = "VRChat API Client for Rust"
77
license = "MIT"

docs/AuthenticationApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ This endpoint does not need any parameter.
298298

299299
## get_current_user
300300

301-
> models::CurrentUser get_current_user()
301+
> models::RegisterUserAccount200Response get_current_user()
302302
Login and/or Get Current User Info
303303

304304
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. The auth string after `Authorization: Basic {string}` is a base64-encoded string of the username and password, both individually url-encoded, and then joined with a colon. > base64(urlencode(username):urlencode(password)) **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.
@@ -309,7 +309,7 @@ This endpoint does not need any parameter.
309309

310310
### Return type
311311

312-
[**models::CurrentUser**](CurrentUser.md)
312+
[**models::RegisterUserAccount200Response**](registerUserAccount_200_response.md)
313313

314314
### Authorization
315315

@@ -440,7 +440,7 @@ This endpoint does not need any parameter.
440440

441441
## register_user_account
442442

443-
> models::CurrentUser register_user_account(register_user_account_request)
443+
> models::RegisterUserAccount200Response register_user_account(register_user_account_request)
444444
Register User Account
445445

446446
~~Register a new user account.~~ **DEPRECATED:** Automated creation of accounts has no legitimate public third-party use case, and would be in violation of ToS §13.2: *By using the Platform, you agree not to: i. [...] use the Platform in a manner inconsistent with individual human usage* This endpoint is documented in the interest of completeness
@@ -454,7 +454,7 @@ Name | Type | Description | Required | Notes
454454

455455
### Return type
456456

457-
[**models::CurrentUser**](CurrentUser.md)
457+
[**models::RegisterUserAccount200Response**](registerUserAccount_200_response.md)
458458

459459
### Authorization
460460

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# RegisterUserAccount200Response
2+
3+
## Enum Variants
4+
5+
| Name | Description |
6+
|---- | -----|
7+
| CurrentUser | |
8+
| RequiresTwoFactorAuth | |
9+
10+
[[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+
12+

docs/RequiresTwoFactorAuth.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RequiresTwoFactorAuth
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**requires_two_factor_auth** | Option<[**Vec<models::TwoFactorAuthType>**](TwoFactorAuthType.md)> | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/TwoFactorAuthType.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# TwoFactorAuthType
2+
3+
## Enum Variants
4+
5+
| Name | Value |
6+
|---- | -----|
7+
| EmailOtp | emailOtp |
8+
| Otp | otp |
9+
| Totp | totp |
10+
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

src/apis/authentication_api.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ pub async fn enable2_fa(
627627
/// 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. The auth string after `Authorization: Basic {string}` is a base64-encoded string of the username and password, both individually url-encoded, and then joined with a colon. > base64(urlencode(username):urlencode(password)) **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.
628628
pub async fn get_current_user(
629629
configuration: &configuration::Configuration,
630-
) -> Result<models::EitherUserOrTwoFactor, Error<GetCurrentUserError>> {
630+
) -> Result<models::RegisterUserAccount200Response, Error<GetCurrentUserError>> {
631631
let uri_str = format!("{}/auth/user", configuration.base_path);
632632
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
633633

@@ -653,8 +653,8 @@ pub async fn get_current_user(
653653
let content = resp.text().await?;
654654
match content_type {
655655
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
656-
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CurrentUser`"))),
657-
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CurrentUser`")))),
656+
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterUserAccount200Response`"))),
657+
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegisterUserAccount200Response`")))),
658658
}
659659
} else {
660660
let content = resp.text().await?;
@@ -859,7 +859,7 @@ pub async fn logout(
859859
pub async fn register_user_account(
860860
configuration: &configuration::Configuration,
861861
register_user_account_request: models::RegisterUserAccountRequest,
862-
) -> Result<models::CurrentUser, Error<RegisterUserAccountError>> {
862+
) -> Result<models::RegisterUserAccount200Response, Error<RegisterUserAccountError>> {
863863
// add a prefix to parameters to efficiently prevent name collisions
864864
let p_body_register_user_account_request = register_user_account_request;
865865

@@ -888,8 +888,8 @@ pub async fn register_user_account(
888888
let content = resp.text().await?;
889889
match content_type {
890890
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
891-
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CurrentUser`"))),
892-
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CurrentUser`")))),
891+
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterUserAccount200Response`"))),
892+
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegisterUserAccount200Response`")))),
893893
}
894894
} else {
895895
let content = resp.text().await?;

src/models/current_user.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -346,16 +346,3 @@ impl CurrentUser {
346346
}
347347
}
348348
}
349-
350-
#[derive(Serialize, Deserialize)]
351-
#[serde(untagged)]
352-
pub enum EitherUserOrTwoFactor {
353-
CurrentUser(CurrentUser),
354-
RequiresTwoFactorAuth(RequiresTwoFactorAuth),
355-
}
356-
357-
#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
358-
pub struct RequiresTwoFactorAuth {
359-
#[serde(rename = "requiresTwoFactorAuth")]
360-
pub requires_two_factor_auth: Vec<String>,
361-
}

src/models/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub use self::create_instance_request::CreateInstanceRequest;
131131
pub mod create_world_request;
132132
pub use self::create_world_request::CreateWorldRequest;
133133
pub mod current_user;
134-
pub use self::current_user::{CurrentUser, EitherUserOrTwoFactor};
134+
pub use self::current_user::CurrentUser;
135135
pub mod current_user_platform_history_inner;
136136
pub use self::current_user_platform_history_inner::CurrentUserPlatformHistoryInner;
137137
pub mod current_user_presence;
@@ -414,6 +414,8 @@ pub mod purchase_product_listing_request;
414414
pub use self::purchase_product_listing_request::PurchaseProductListingRequest;
415415
pub mod region;
416416
pub use self::region::Region;
417+
pub mod register_user_account_200_response;
418+
pub use self::register_user_account_200_response::RegisterUserAccount200Response;
417419
pub mod register_user_account_request;
418420
pub use self::register_user_account_request::RegisterUserAccountRequest;
419421
pub mod release_status;
@@ -426,6 +428,8 @@ pub mod represented_group;
426428
pub use self::represented_group::RepresentedGroup;
427429
pub mod request_invite_request;
428430
pub use self::request_invite_request::RequestInviteRequest;
431+
pub mod requires_two_factor_auth;
432+
pub use self::requires_two_factor_auth::RequiresTwoFactorAuth;
429433
pub mod respond_group_join_request;
430434
pub use self::respond_group_join_request::RespondGroupJoinRequest;
431435
pub mod respond_notification_v2_request;
@@ -484,6 +488,8 @@ pub mod transaction_steam_wallet_info;
484488
pub use self::transaction_steam_wallet_info::TransactionSteamWalletInfo;
485489
pub mod two_factor_auth_code;
486490
pub use self::two_factor_auth_code::TwoFactorAuthCode;
491+
pub mod two_factor_auth_type;
492+
pub use self::two_factor_auth_type::TwoFactorAuthType;
487493
pub mod two_factor_email_code;
488494
pub use self::two_factor_email_code::TwoFactorEmailCode;
489495
pub mod two_factor_recovery_codes;
@@ -552,3 +558,8 @@ pub mod world_metadata;
552558
pub use self::world_metadata::WorldMetadata;
553559
pub mod world_publish_status;
554560
pub use self::world_publish_status::WorldPublishStatus;
561+
#[deprecated(
562+
since = "1.20.7-nightly.28",
563+
note = "Use RegisterUserAccount200Response directly. This re-export is only provided as a transition-help!"
564+
)]
565+
pub use self::RegisterUserAccount200Response as EitherUserOrTwoFactor;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* VRChat API Documentation
3+
*
4+
*
5+
* Contact: vrchatapi.lpv0t@aries.fyi
6+
* Generated by: https://openapi-generator.tech
7+
*/
8+
9+
use crate::models;
10+
use serde::{Deserialize, Serialize};
11+
12+
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
13+
#[serde(untagged)]
14+
pub enum RegisterUserAccount200Response {
15+
CurrentUser(models::CurrentUser),
16+
RequiresTwoFactorAuth(models::RequiresTwoFactorAuth),
17+
}
18+
19+
impl Default for RegisterUserAccount200Response {
20+
fn default() -> Self {
21+
Self::CurrentUser(Default::default())
22+
}
23+
}

0 commit comments

Comments
 (0)