mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-22 15:45:35 +00:00
Avoid boxing (#19)
* prevent boxing Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> * Apply Changes --------- Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com>
This commit is contained in:
@ -5,7 +5,7 @@ rm src/apis src/models docs -rf
|
|||||||
|
|
||||||
./node_modules/\@openapitools/openapi-generator-cli/main.js generate \
|
./node_modules/\@openapitools/openapi-generator-cli/main.js generate \
|
||||||
-g rust \
|
-g rust \
|
||||||
--additional-properties=packageName=vrchatapi,supportAsync=true \
|
--additional-properties=packageName=vrchatapi,supportAsync=true,avoidBoxedModels=true \
|
||||||
--git-user-id=vrchatapi \
|
--git-user-id=vrchatapi \
|
||||||
--git-repo-id=vrchatapi-rust \
|
--git-repo-id=vrchatapi-rust \
|
||||||
-o . \
|
-o . \
|
||||||
|
@ -164,7 +164,7 @@ pub struct ApiConfig {
|
|||||||
#[serde(rename = "downloadLinkWindows")]
|
#[serde(rename = "downloadLinkWindows")]
|
||||||
pub download_link_windows: String,
|
pub download_link_windows: String,
|
||||||
#[serde(rename = "downloadUrls")]
|
#[serde(rename = "downloadUrls")]
|
||||||
pub download_urls: Box<models::ApiConfigDownloadUrlList>,
|
pub download_urls: models::ApiConfigDownloadUrlList,
|
||||||
/// Array of DynamicWorldRow objects, used by the game to display the list of world rows
|
/// Array of DynamicWorldRow objects, used by the game to display the list of world rows
|
||||||
#[serde(rename = "dynamicWorldRows")]
|
#[serde(rename = "dynamicWorldRows")]
|
||||||
pub dynamic_world_rows: Vec<models::DynamicContentRow>,
|
pub dynamic_world_rows: Vec<models::DynamicContentRow>,
|
||||||
@ -178,7 +178,7 @@ pub struct ApiConfig {
|
|||||||
#[serde(rename = "economyState", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "economyState", skip_serializing_if = "Option::is_none")]
|
||||||
pub economy_state: Option<i32>,
|
pub economy_state: Option<i32>,
|
||||||
#[serde(rename = "events")]
|
#[serde(rename = "events")]
|
||||||
pub events: Box<models::ApiConfigEvents>,
|
pub events: models::ApiConfigEvents,
|
||||||
/// WorldID be \"offline\" on User profiles if you are not friends with that user.
|
/// WorldID be \"offline\" on User profiles if you are not friends with that user.
|
||||||
#[serde(rename = "homeWorldId")]
|
#[serde(rename = "homeWorldId")]
|
||||||
pub home_world_id: String,
|
pub home_world_id: String,
|
||||||
@ -316,12 +316,12 @@ impl ApiConfig {
|
|||||||
disable_udon,
|
disable_udon,
|
||||||
disable_upgrade_account,
|
disable_upgrade_account,
|
||||||
download_link_windows,
|
download_link_windows,
|
||||||
download_urls: Box::new(download_urls),
|
download_urls,
|
||||||
dynamic_world_rows,
|
dynamic_world_rows,
|
||||||
economy_pause_end: None,
|
economy_pause_end: None,
|
||||||
economy_pause_start: None,
|
economy_pause_start: None,
|
||||||
economy_state: None,
|
economy_state: None,
|
||||||
events: Box::new(events),
|
events,
|
||||||
home_world_id,
|
home_world_id,
|
||||||
homepage_redirect_target,
|
homepage_redirect_target,
|
||||||
hub_world_id,
|
hub_world_id,
|
||||||
|
@ -44,7 +44,7 @@ pub struct Avatar {
|
|||||||
#[serde(rename = "unityPackageUrl")]
|
#[serde(rename = "unityPackageUrl")]
|
||||||
pub unity_package_url: String,
|
pub unity_package_url: String,
|
||||||
#[serde(rename = "unityPackageUrlObject")]
|
#[serde(rename = "unityPackageUrlObject")]
|
||||||
pub unity_package_url_object: Box<models::AvatarUnityPackageUrlObject>,
|
pub unity_package_url_object: models::AvatarUnityPackageUrlObject,
|
||||||
#[serde(rename = "unityPackages")]
|
#[serde(rename = "unityPackages")]
|
||||||
pub unity_packages: Vec<models::UnityPackage>,
|
pub unity_packages: Vec<models::UnityPackage>,
|
||||||
#[serde(rename = "updated_at")]
|
#[serde(rename = "updated_at")]
|
||||||
@ -70,7 +70,7 @@ impl Avatar {
|
|||||||
tags,
|
tags,
|
||||||
thumbnail_image_url,
|
thumbnail_image_url,
|
||||||
unity_package_url,
|
unity_package_url,
|
||||||
unity_package_url_object: Box::new(unity_package_url_object),
|
unity_package_url_object,
|
||||||
unity_packages,
|
unity_packages,
|
||||||
updated_at,
|
updated_at,
|
||||||
version,
|
version,
|
||||||
|
@ -112,7 +112,7 @@ pub struct CurrentUser {
|
|||||||
#[serde(rename = "pastDisplayNames")]
|
#[serde(rename = "pastDisplayNames")]
|
||||||
pub past_display_names: Vec<models::PastDisplayName>,
|
pub past_display_names: Vec<models::PastDisplayName>,
|
||||||
#[serde(rename = "presence", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "presence", skip_serializing_if = "Option::is_none")]
|
||||||
pub presence: Option<Box<models::CurrentUserPresence>>,
|
pub presence: Option<models::CurrentUserPresence>,
|
||||||
#[serde(rename = "profilePicOverride")]
|
#[serde(rename = "profilePicOverride")]
|
||||||
pub profile_pic_override: String,
|
pub profile_pic_override: String,
|
||||||
#[serde(rename = "profilePicOverrideThumbnail")]
|
#[serde(rename = "profilePicOverrideThumbnail")]
|
||||||
|
@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
#[serde(rename = "error", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "error", skip_serializing_if = "Option::is_none")]
|
||||||
pub error: Option<Box<models::Response>>,
|
pub error: Option<models::Response>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Error {
|
impl Error {
|
||||||
|
@ -18,11 +18,11 @@ pub struct FileVersion {
|
|||||||
#[serde(rename = "deleted", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "deleted", skip_serializing_if = "Option::is_none")]
|
||||||
pub deleted: Option<bool>,
|
pub deleted: Option<bool>,
|
||||||
#[serde(rename = "delta", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "delta", skip_serializing_if = "Option::is_none")]
|
||||||
pub delta: Option<Box<models::FileData>>,
|
pub delta: Option<models::FileData>,
|
||||||
#[serde(rename = "file", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "file", skip_serializing_if = "Option::is_none")]
|
||||||
pub file: Option<Box<models::FileData>>,
|
pub file: Option<models::FileData>,
|
||||||
#[serde(rename = "signature", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "signature", skip_serializing_if = "Option::is_none")]
|
||||||
pub signature: Option<Box<models::FileData>>,
|
pub signature: Option<models::FileData>,
|
||||||
#[serde(rename = "status")]
|
#[serde(rename = "status")]
|
||||||
pub status: models::FileStatus,
|
pub status: models::FileStatus,
|
||||||
/// Incremental version counter, can only be increased.
|
/// Incremental version counter, can only be increased.
|
||||||
|
@ -66,7 +66,7 @@ pub struct Group {
|
|||||||
#[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")]
|
||||||
pub membership_status: Option<models::GroupMemberStatus>,
|
pub membership_status: Option<models::GroupMemberStatus>,
|
||||||
#[serde(rename = "myMember", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "myMember", skip_serializing_if = "Option::is_none")]
|
||||||
pub my_member: Option<Box<models::GroupMyMember>>,
|
pub my_member: Option<models::GroupMyMember>,
|
||||||
/// Only returned if ?includeRoles=true is specified.
|
/// Only returned if ?includeRoles=true is specified.
|
||||||
#[serde(rename = "roles", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "roles", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||||
pub roles: Option<Option<Vec<models::GroupRole>>>,
|
pub roles: Option<Option<Vec<models::GroupRole>>>,
|
||||||
|
@ -17,7 +17,7 @@ pub struct GroupInstance {
|
|||||||
#[serde(rename = "location")]
|
#[serde(rename = "location")]
|
||||||
pub location: String,
|
pub location: String,
|
||||||
#[serde(rename = "world")]
|
#[serde(rename = "world")]
|
||||||
pub world: Box<models::World>,
|
pub world: models::World,
|
||||||
#[serde(rename = "memberCount")]
|
#[serde(rename = "memberCount")]
|
||||||
pub member_count: i32,
|
pub member_count: i32,
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@ impl GroupInstance {
|
|||||||
GroupInstance {
|
GroupInstance {
|
||||||
instance_id,
|
instance_id,
|
||||||
location,
|
location,
|
||||||
world: Box::new(world),
|
world,
|
||||||
member_count,
|
member_count,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ pub struct GroupMember {
|
|||||||
#[serde(rename = "isRepresenting", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "isRepresenting", skip_serializing_if = "Option::is_none")]
|
||||||
pub is_representing: Option<bool>,
|
pub is_representing: Option<bool>,
|
||||||
#[serde(rename = "user", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "user", skip_serializing_if = "Option::is_none")]
|
||||||
pub user: Option<Box<models::GroupMemberLimitedUser>>,
|
pub user: Option<models::GroupMemberLimitedUser>,
|
||||||
#[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")]
|
||||||
pub role_ids: Option<Vec<String>>,
|
pub role_ids: Option<Vec<String>>,
|
||||||
#[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")]
|
||||||
|
@ -23,7 +23,7 @@ pub struct InfoPush {
|
|||||||
#[serde(rename = "tags")]
|
#[serde(rename = "tags")]
|
||||||
pub tags: Vec<String>,
|
pub tags: Vec<String>,
|
||||||
#[serde(rename = "data")]
|
#[serde(rename = "data")]
|
||||||
pub data: Box<models::InfoPushData>,
|
pub data: models::InfoPushData,
|
||||||
/// Unknown usage, MD5
|
/// Unknown usage, MD5
|
||||||
#[serde(rename = "hash")]
|
#[serde(rename = "hash")]
|
||||||
pub hash: String,
|
pub hash: String,
|
||||||
@ -45,7 +45,7 @@ impl InfoPush {
|
|||||||
release_status,
|
release_status,
|
||||||
priority,
|
priority,
|
||||||
tags,
|
tags,
|
||||||
data: Box::new(data),
|
data,
|
||||||
hash,
|
hash,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at,
|
updated_at,
|
||||||
|
@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InfoPushData {
|
pub struct InfoPushData {
|
||||||
#[serde(rename = "contentList", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "contentList", skip_serializing_if = "Option::is_none")]
|
||||||
pub content_list: Option<Box<models::DynamicContentRow>>,
|
pub content_list: Option<models::DynamicContentRow>,
|
||||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
#[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
|
||||||
@ -21,13 +21,13 @@ pub struct InfoPushData {
|
|||||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
#[serde(rename = "onPressed", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "onPressed", skip_serializing_if = "Option::is_none")]
|
||||||
pub on_pressed: Option<Box<models::InfoPushDataClickable>>,
|
pub on_pressed: Option<models::InfoPushDataClickable>,
|
||||||
#[serde(rename = "template", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "template", skip_serializing_if = "Option::is_none")]
|
||||||
pub template: Option<String>,
|
pub template: Option<String>,
|
||||||
#[serde(rename = "version", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "version", skip_serializing_if = "Option::is_none")]
|
||||||
pub version: Option<String>,
|
pub version: Option<String>,
|
||||||
#[serde(rename = "article", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "article", skip_serializing_if = "Option::is_none")]
|
||||||
pub article: Option<Box<models::InfoPushDataArticle>>,
|
pub article: Option<models::InfoPushDataArticle>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InfoPushData {
|
impl InfoPushData {
|
||||||
|
@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InfoPushDataArticle {
|
pub struct InfoPushDataArticle {
|
||||||
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
||||||
pub content: Option<Box<models::InfoPushDataArticleContent>>,
|
pub content: Option<models::InfoPushDataArticleContent>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InfoPushDataArticle {
|
impl InfoPushDataArticle {
|
||||||
|
@ -16,7 +16,7 @@ pub struct InfoPushDataArticleContent {
|
|||||||
#[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
|
||||||
pub image_url: Option<String>,
|
pub image_url: Option<String>,
|
||||||
#[serde(rename = "onPressed", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "onPressed", skip_serializing_if = "Option::is_none")]
|
||||||
pub on_pressed: Option<Box<models::InfoPushDataClickable>>,
|
pub on_pressed: Option<models::InfoPushDataClickable>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InfoPushDataArticleContent {
|
impl InfoPushDataArticleContent {
|
||||||
|
@ -43,7 +43,7 @@ pub struct Instance {
|
|||||||
#[serde(rename = "photonRegion")]
|
#[serde(rename = "photonRegion")]
|
||||||
pub photon_region: models::Region,
|
pub photon_region: models::Region,
|
||||||
#[serde(rename = "platforms")]
|
#[serde(rename = "platforms")]
|
||||||
pub platforms: Box<models::InstancePlatforms>,
|
pub platforms: models::InstancePlatforms,
|
||||||
#[serde(rename = "region")]
|
#[serde(rename = "region")]
|
||||||
pub region: models::InstanceRegion,
|
pub region: models::InstanceRegion,
|
||||||
#[serde(rename = "secureName")]
|
#[serde(rename = "secureName")]
|
||||||
@ -80,7 +80,7 @@ pub struct Instance {
|
|||||||
#[serde(rename = "userCount")]
|
#[serde(rename = "userCount")]
|
||||||
pub user_count: i32,
|
pub user_count: i32,
|
||||||
#[serde(rename = "world")]
|
#[serde(rename = "world")]
|
||||||
pub world: Box<models::World>,
|
pub world: models::World,
|
||||||
/// The users field is present on instances created by the requesting user.
|
/// The users field is present on instances created by the requesting user.
|
||||||
#[serde(rename = "users", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "users", skip_serializing_if = "Option::is_none")]
|
||||||
pub users: Option<Vec<models::LimitedUser>>,
|
pub users: Option<Vec<models::LimitedUser>>,
|
||||||
@ -113,7 +113,7 @@ impl Instance {
|
|||||||
owner_id: None,
|
owner_id: None,
|
||||||
permanent,
|
permanent,
|
||||||
photon_region,
|
photon_region,
|
||||||
platforms: Box::new(platforms),
|
platforms,
|
||||||
region,
|
region,
|
||||||
secure_name,
|
secure_name,
|
||||||
short_name: None,
|
short_name: None,
|
||||||
@ -129,7 +129,7 @@ impl Instance {
|
|||||||
role_restricted: None,
|
role_restricted: None,
|
||||||
strict,
|
strict,
|
||||||
user_count,
|
user_count,
|
||||||
world: Box::new(world),
|
world,
|
||||||
users: None,
|
users: None,
|
||||||
group_access_type: None,
|
group_access_type: None,
|
||||||
has_capacity_for_you: None,
|
has_capacity_for_you: None,
|
||||||
|
@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Success {
|
pub struct Success {
|
||||||
#[serde(rename = "success", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "success", skip_serializing_if = "Option::is_none")]
|
||||||
pub success: Option<Box<models::Response>>,
|
pub success: Option<models::Response>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Success {
|
impl Success {
|
||||||
|
@ -22,7 +22,7 @@ pub struct Transaction {
|
|||||||
#[serde(rename = "status")]
|
#[serde(rename = "status")]
|
||||||
pub status: models::TransactionStatus,
|
pub status: models::TransactionStatus,
|
||||||
#[serde(rename = "subscription")]
|
#[serde(rename = "subscription")]
|
||||||
pub subscription: Box<models::Subscription>,
|
pub subscription: models::Subscription,
|
||||||
#[serde(rename = "sandbox")]
|
#[serde(rename = "sandbox")]
|
||||||
pub sandbox: bool,
|
pub sandbox: bool,
|
||||||
#[serde(rename = "created_at")]
|
#[serde(rename = "created_at")]
|
||||||
@ -30,9 +30,9 @@ pub struct Transaction {
|
|||||||
#[serde(rename = "updated_at")]
|
#[serde(rename = "updated_at")]
|
||||||
pub updated_at: String,
|
pub updated_at: String,
|
||||||
#[serde(rename = "steam", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "steam", skip_serializing_if = "Option::is_none")]
|
||||||
pub steam: Option<Box<models::TransactionSteamInfo>>,
|
pub steam: Option<models::TransactionSteamInfo>,
|
||||||
#[serde(rename = "agreement", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "agreement", skip_serializing_if = "Option::is_none")]
|
||||||
pub agreement: Option<Box<models::TransactionAgreement>>,
|
pub agreement: Option<models::TransactionAgreement>,
|
||||||
#[serde(rename = "error")]
|
#[serde(rename = "error")]
|
||||||
pub error: String,
|
pub error: String,
|
||||||
#[serde(rename = "isGift", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "isGift", skip_serializing_if = "Option::is_none")]
|
||||||
@ -48,7 +48,7 @@ impl Transaction {
|
|||||||
user_id: None,
|
user_id: None,
|
||||||
user_display_name: None,
|
user_display_name: None,
|
||||||
status,
|
status,
|
||||||
subscription: Box::new(subscription),
|
subscription,
|
||||||
sandbox,
|
sandbox,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at,
|
updated_at,
|
||||||
|
@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct TransactionSteamInfo {
|
pub struct TransactionSteamInfo {
|
||||||
#[serde(rename = "walletInfo")]
|
#[serde(rename = "walletInfo")]
|
||||||
pub wallet_info: Box<models::TransactionSteamWalletInfo>,
|
pub wallet_info: models::TransactionSteamWalletInfo,
|
||||||
/// Steam User ID
|
/// Steam User ID
|
||||||
#[serde(rename = "steamId")]
|
#[serde(rename = "steamId")]
|
||||||
pub steam_id: String,
|
pub steam_id: String,
|
||||||
@ -31,7 +31,7 @@ pub struct TransactionSteamInfo {
|
|||||||
impl TransactionSteamInfo {
|
impl TransactionSteamInfo {
|
||||||
pub fn new(wallet_info: models::TransactionSteamWalletInfo, steam_id: String, order_id: String, steam_url: String, trans_id: String) -> TransactionSteamInfo {
|
pub fn new(wallet_info: models::TransactionSteamWalletInfo, steam_id: String, order_id: String, steam_url: String, trans_id: String) -> TransactionSteamInfo {
|
||||||
TransactionSteamInfo {
|
TransactionSteamInfo {
|
||||||
wallet_info: Box::new(wallet_info),
|
wallet_info,
|
||||||
steam_id,
|
steam_id,
|
||||||
order_id,
|
order_id,
|
||||||
steam_url,
|
steam_url,
|
||||||
|
Reference in New Issue
Block a user