diff --git a/Cargo.toml b/Cargo.toml index f36ce47..d0cd21b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" edition = "2021" [dependencies] -serde = { version = "^1.0", features = ["derive"] } +serde = {version = "^1.0", features = ["rc", "derive"] } serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" url = "^2.5" @@ -15,4 +15,6 @@ uuid = { version = "^1.8", features = ["serde", "v4"] } reqwest = { version = "^0.12", features = ["json", "cookies", "multipart"] } [dev-dependencies] -tokio = { version = '1', features = ['macros', 'rt-multi-thread'] } \ No newline at end of file +tokio = { version = '1', features = ['macros', 'rt-multi-thread'] } +[dependencies.log] +version = "0.4" diff --git a/docs/Group.md b/docs/Group.md index 2d93040..7f2859b 100644 --- a/docs/Group.md +++ b/docs/Group.md @@ -22,9 +22,9 @@ Name | Type | Description | Notes **member_count_synced_at** | Option<**String**> | | [optional] **is_verified** | Option<**bool**> | | [optional][default to false] **join_state** | Option<[**models::GroupJoinState**](GroupJoinState.md)> | | [optional] -**tags** | Option<**Vec**> | | [optional] +**tags** | Option<**Vec**> | | [optional] **transfer_target_id** | Option<**String**> | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | [optional] -**galleries** | Option<[**Vec**](GroupGallery.md)> | | [optional] +**galleries** | Option<[**Vec**](GroupGallery.md)> | | [optional] **created_at** | Option<**String**> | | [optional] **updated_at** | Option<**String**> | | [optional] **last_post_created_at** | Option<**String**> | | [optional] diff --git a/docs/UserExists.md b/docs/UserExists.md index 17b947c..62fd89f 100644 --- a/docs/UserExists.md +++ b/docs/UserExists.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user_exists** | **bool** | Status if a user exist with that username or userId. | [default to false] +**name_ok** | **bool** | Is the username valid? | [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generate.sh b/generate.sh index ebca09c..ad34808 100755 --- a/generate.sh +++ b/generate.sh @@ -41,7 +41,7 @@ echo "pub mod tags;" >> src/models/mod.rs sed -i 's/tags: Vec/tags: Vec/g' src/models/*.rs #replace Strings with Arc in tradeoff to Default impls sed -Ei 's/(:[a-zA-Z0-9 \-_<>]*)String/\1std::sync::Arc/g' src/models/*.rs -sed -Ei 's/serde = "(.*)"/serde = {version = "\1", features = ["rc"]}/g' Cargo.toml +sed -Ei 's/serde = \{ version = "(.*)", features = \[/serde = {version = "\1", features = ["rc", /g' Cargo.toml sed -Ei 's/#\[derive\((.*)(, )?Default(, )?/#[derive(\1/g' src/models/*.rs #add log crate. Used by tag impl echo "" >> Cargo.toml diff --git a/src/models/account_deletion_log.rs b/src/models/account_deletion_log.rs index 5d61480..e7e728d 100644 --- a/src/models/account_deletion_log.rs +++ b/src/models/account_deletion_log.rs @@ -9,17 +9,17 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccountDeletionLog { /// Typically \"Deletion requested\" or \"Deletion canceled\". Other messages like \"Deletion completed\" may exist, but are these are not possible to see as a regular user. #[serde(rename = "message", skip_serializing_if = "Option::is_none")] - pub message: Option, + pub message: Option>, /// When the deletion is scheduled to happen, standard is 14 days after the request. #[serde(rename = "deletionScheduled", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub deletion_scheduled: Option>, + pub deletion_scheduled: Option>>, /// Date and time of the deletion request. #[serde(rename = "dateTime", skip_serializing_if = "Option::is_none")] - pub date_time: Option, + pub date_time: Option>, } impl AccountDeletionLog { diff --git a/src/models/add_favorite_request.rs b/src/models/add_favorite_request.rs index 4aaea88..d1d43bd 100644 --- a/src/models/add_favorite_request.rs +++ b/src/models/add_favorite_request.rs @@ -9,20 +9,20 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddFavoriteRequest { #[serde(rename = "type")] pub r#type: models::FavoriteType, /// Must be either AvatarID, WorldID or UserID. #[serde(rename = "favoriteId")] - pub favorite_id: String, + pub favorite_id: std::sync::Arc, /// Tags indicate which group this favorite belongs to. Adding multiple groups makes it show up in all. Removing it from one in that case removes it from all. #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, } impl AddFavoriteRequest { - pub fn new(r#type: models::FavoriteType, favorite_id: String, tags: Vec) -> AddFavoriteRequest { + pub fn new(r#type: models::FavoriteType, favorite_id: std::sync::Arc, tags: Vec) -> AddFavoriteRequest { AddFavoriteRequest { r#type, favorite_id, diff --git a/src/models/add_group_gallery_image_request.rs b/src/models/add_group_gallery_image_request.rs index af105f2..fecebb4 100644 --- a/src/models/add_group_gallery_image_request.rs +++ b/src/models/add_group_gallery_image_request.rs @@ -9,14 +9,14 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AddGroupGalleryImageRequest { #[serde(rename = "fileId")] - pub file_id: String, + pub file_id: std::sync::Arc, } impl AddGroupGalleryImageRequest { - pub fn new(file_id: String) -> AddGroupGalleryImageRequest { + pub fn new(file_id: std::sync::Arc) -> AddGroupGalleryImageRequest { AddGroupGalleryImageRequest { file_id, } diff --git a/src/models/api_config.rs b/src/models/api_config.rs index 6cfd2b5..58dfc68 100644 --- a/src/models/api_config.rs +++ b/src/models/api_config.rs @@ -10,7 +10,7 @@ use crate::models; use serde::{Deserialize, Serialize}; /// ApiConfig : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiConfig { /// Unknown, probably voice optimization testing #[serde(rename = "VoiceEnableDegradation")] @@ -20,25 +20,25 @@ pub struct ApiConfig { pub voice_enable_receiver_limiting: bool, /// VRChat's office address #[serde(rename = "address")] - pub address: String, + pub address: std::sync::Arc, /// Public Announcements #[serde(rename = "announcements")] pub announcements: Vec, /// Game name #[serde(rename = "appName")] - pub app_name: String, + pub app_name: std::sync::Arc, /// List of supported Languages #[serde(rename = "availableLanguageCodes")] - pub available_language_codes: Vec, + pub available_language_codes: Vec>, /// List of supported Languages #[serde(rename = "availableLanguages")] - pub available_languages: Vec, + pub available_languages: Vec>, /// Build tag of the API server #[serde(rename = "buildVersionTag")] - pub build_version_tag: String, + pub build_version_tag: std::sync::Arc, /// apiKey to be used for all other requests #[serde(rename = "clientApiKey")] - pub client_api_key: String, + pub client_api_key: std::sync::Arc, /// Unknown #[serde(rename = "clientBPSCeiling")] pub client_bps_ceiling: i32, @@ -83,10 +83,10 @@ pub struct ApiConfig { pub client_sent_count_allowance: i32, /// VRChat's contact email #[serde(rename = "contactEmail")] - pub contact_email: String, + pub contact_email: std::sync::Arc, /// VRChat's copyright-issues-related email #[serde(rename = "copyrightEmail")] - pub copyright_email: String, + pub copyright_email: std::sync::Arc, /// Current version number of the Privacy Agreement #[serde(rename = "currentPrivacyVersion", skip_serializing_if = "Option::is_none")] pub current_privacy_version: Option, @@ -94,21 +94,21 @@ pub struct ApiConfig { #[serde(rename = "currentTOSVersion")] pub current_tos_version: i32, #[serde(rename = "defaultAvatar")] - pub default_avatar: String, + pub default_avatar: std::sync::Arc, #[serde(rename = "deploymentGroup")] pub deployment_group: models::DeploymentGroup, /// Unknown #[serde(rename = "devLanguageCodes", skip_serializing_if = "Option::is_none")] - pub dev_language_codes: Option>, + pub dev_language_codes: Option>>, /// Link to download the development SDK, use downloadUrls instead #[serde(rename = "devSdkUrl")] - pub dev_sdk_url: String, + pub dev_sdk_url: std::sync::Arc, /// Version of the development SDK #[serde(rename = "devSdkVersion")] - pub dev_sdk_version: String, + pub dev_sdk_version: std::sync::Arc, /// Unknown, \"dis\" maybe for disconnect? #[serde(rename = "dis-countdown")] - pub dis_countdown: String, + pub dis_countdown: std::sync::Arc, /// Unknown #[serde(rename = "disableAVProInProton", skip_serializing_if = "Option::is_none")] pub disable_av_pro_in_proton: Option, @@ -162,7 +162,7 @@ pub struct ApiConfig { pub disable_upgrade_account: bool, /// Download link for game on the Oculus Rift website. #[serde(rename = "downloadLinkWindows")] - pub download_link_windows: String, + pub download_link_windows: std::sync::Arc, #[serde(rename = "downloadUrls")] pub download_urls: Box, /// Array of DynamicWorldRow objects, used by the game to display the list of world rows @@ -170,10 +170,10 @@ pub struct ApiConfig { pub dynamic_world_rows: Vec, /// Unknown #[serde(rename = "economyPauseEnd", skip_serializing_if = "Option::is_none")] - pub economy_pause_end: Option, + pub economy_pause_end: Option>, /// Unknown #[serde(rename = "economyPauseStart", skip_serializing_if = "Option::is_none")] - pub economy_pause_start: Option, + pub economy_pause_start: Option>, /// Unknown #[serde(rename = "economyState", skip_serializing_if = "Option::is_none")] pub economy_state: Option, @@ -181,52 +181,52 @@ pub struct ApiConfig { pub events: Box, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "homeWorldId")] - pub home_world_id: String, + pub home_world_id: std::sync::Arc, /// Redirect target if you try to open the base API domain in your browser #[serde(rename = "homepageRedirectTarget")] - pub homepage_redirect_target: String, + pub homepage_redirect_target: std::sync::Arc, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "hubWorldId")] - pub hub_world_id: String, + pub hub_world_id: std::sync::Arc, /// A list of explicitly allowed origins that worlds can request images from via the Udon's [VRCImageDownloader#DownloadImage](https://creators.vrchat.com/worlds/udon/image-loading/#downloadimage). #[serde(rename = "imageHostUrlList")] - pub image_host_url_list: Vec, + pub image_host_url_list: Vec>, /// VRChat's job application email #[serde(rename = "jobsEmail")] - pub jobs_email: String, + pub jobs_email: std::sync::Arc, /// VRChat's moderation related email #[serde(rename = "moderationEmail")] - pub moderation_email: String, + pub moderation_email: std::sync::Arc, /// Used in-game to notify a user they aren't allowed to select avatars in private worlds #[serde(rename = "notAllowedToSelectAvatarInPrivateWorldMessage")] - pub not_allowed_to_select_avatar_in_private_world_message: String, + pub not_allowed_to_select_avatar_in_private_world_message: std::sync::Arc, /// Link to the developer FAQ #[serde(rename = "sdkDeveloperFaqUrl")] - pub sdk_developer_faq_url: String, + pub sdk_developer_faq_url: std::sync::Arc, /// Link to the official VRChat Discord #[serde(rename = "sdkDiscordUrl")] - pub sdk_discord_url: String, + pub sdk_discord_url: std::sync::Arc, /// Used in the SDK to notify a user they aren't allowed to upload avatars/worlds yet #[serde(rename = "sdkNotAllowedToPublishMessage")] - pub sdk_not_allowed_to_publish_message: String, + pub sdk_not_allowed_to_publish_message: std::sync::Arc, /// Unity version supported by the SDK #[serde(rename = "sdkUnityVersion")] - pub sdk_unity_version: String, + pub sdk_unity_version: std::sync::Arc, /// Server name of the API server currently responding #[serde(rename = "serverName")] - pub server_name: String, + pub server_name: std::sync::Arc, /// A list of explicitly allowed origins that worlds can request strings from via the Udon's [VRCStringDownloader.LoadUrl](https://creators.vrchat.com/worlds/udon/string-loading/#ivrcstringdownload). #[serde(rename = "stringHostUrlList")] - pub string_host_url_list: Vec, + pub string_host_url_list: Vec>, /// VRChat's support email #[serde(rename = "supportEmail")] - pub support_email: String, + pub support_email: std::sync::Arc, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "timeOutWorldId")] - pub time_out_world_id: String, + pub time_out_world_id: std::sync::Arc, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "tutorialWorldId")] - pub tutorial_world_id: String, + pub tutorial_world_id: std::sync::Arc, /// Unknown #[serde(rename = "updateRateMsMaximum")] pub update_rate_ms_maximum: i32, @@ -244,26 +244,26 @@ pub struct ApiConfig { pub upload_analysis_percent: i32, /// List of allowed URLs that bypass the \"Allow untrusted URL's\" setting in-game #[serde(rename = "urlList")] - pub url_list: Vec, + pub url_list: Vec>, /// Unknown #[serde(rename = "useReliableUdpForVoice")] pub use_reliable_udp_for_voice: bool, /// Download link for game on the Steam website. #[serde(rename = "viveWindowsUrl")] - pub vive_windows_url: String, + pub vive_windows_url: std::sync::Arc, /// List of allowed URLs that are allowed to host avatar assets #[serde(rename = "whiteListedAssetUrls")] - pub white_listed_asset_urls: Vec, + pub white_listed_asset_urls: Vec>, /// Currently used youtube-dl.exe version #[serde(rename = "player-url-resolver-version")] - pub player_url_resolver_version: String, + pub player_url_resolver_version: std::sync::Arc, /// Currently used youtube-dl.exe hash in SHA1-delimited format #[serde(rename = "player-url-resolver-sha1")] - pub player_url_resolver_sha1: String, + pub player_url_resolver_sha1: std::sync::Arc, } impl ApiConfig { - pub fn new(voice_enable_degradation: bool, voice_enable_receiver_limiting: bool, address: String, announcements: Vec, app_name: String, available_language_codes: Vec, available_languages: Vec, build_version_tag: String, client_api_key: String, client_bps_ceiling: i32, client_disconnect_timeout: i32, client_reserved_player_bps: i32, client_sent_count_allowance: i32, contact_email: String, copyright_email: String, current_tos_version: i32, default_avatar: String, deployment_group: models::DeploymentGroup, dev_sdk_url: String, dev_sdk_version: String, dis_countdown: String, disable_avatar_copying: bool, disable_avatar_gating: bool, disable_community_labs: bool, disable_community_labs_promotion: bool, disable_email: bool, disable_event_stream: bool, disable_feedback_gating: bool, disable_frontend_builds: bool, disable_hello: bool, disable_oculus_subs: bool, disable_registration: bool, disable_steam_networking: bool, disable_two_factor_auth: bool, disable_udon: bool, disable_upgrade_account: bool, download_link_windows: String, download_urls: models::ApiConfigDownloadUrlList, dynamic_world_rows: Vec, events: models::ApiConfigEvents, home_world_id: String, homepage_redirect_target: String, hub_world_id: String, image_host_url_list: Vec, jobs_email: String, moderation_email: String, not_allowed_to_select_avatar_in_private_world_message: String, sdk_developer_faq_url: String, sdk_discord_url: String, sdk_not_allowed_to_publish_message: String, sdk_unity_version: String, server_name: String, string_host_url_list: Vec, support_email: String, time_out_world_id: String, tutorial_world_id: String, update_rate_ms_maximum: i32, update_rate_ms_minimum: i32, update_rate_ms_normal: i32, update_rate_ms_udon_manual: i32, upload_analysis_percent: i32, url_list: Vec, use_reliable_udp_for_voice: bool, vive_windows_url: String, white_listed_asset_urls: Vec, player_url_resolver_version: String, player_url_resolver_sha1: String) -> ApiConfig { + pub fn new(voice_enable_degradation: bool, voice_enable_receiver_limiting: bool, address: std::sync::Arc, announcements: Vec, app_name: std::sync::Arc, available_language_codes: Vec>, available_languages: Vec>, build_version_tag: std::sync::Arc, client_api_key: std::sync::Arc, client_bps_ceiling: i32, client_disconnect_timeout: i32, client_reserved_player_bps: i32, client_sent_count_allowance: i32, contact_email: std::sync::Arc, copyright_email: std::sync::Arc, current_tos_version: i32, default_avatar: std::sync::Arc, deployment_group: models::DeploymentGroup, dev_sdk_url: std::sync::Arc, dev_sdk_version: std::sync::Arc, dis_countdown: std::sync::Arc, disable_avatar_copying: bool, disable_avatar_gating: bool, disable_community_labs: bool, disable_community_labs_promotion: bool, disable_email: bool, disable_event_stream: bool, disable_feedback_gating: bool, disable_frontend_builds: bool, disable_hello: bool, disable_oculus_subs: bool, disable_registration: bool, disable_steam_networking: bool, disable_two_factor_auth: bool, disable_udon: bool, disable_upgrade_account: bool, download_link_windows: std::sync::Arc, download_urls: models::ApiConfigDownloadUrlList, dynamic_world_rows: Vec, events: models::ApiConfigEvents, home_world_id: std::sync::Arc, homepage_redirect_target: std::sync::Arc, hub_world_id: std::sync::Arc, image_host_url_list: Vec>, jobs_email: std::sync::Arc, moderation_email: std::sync::Arc, not_allowed_to_select_avatar_in_private_world_message: std::sync::Arc, sdk_developer_faq_url: std::sync::Arc, sdk_discord_url: std::sync::Arc, sdk_not_allowed_to_publish_message: std::sync::Arc, sdk_unity_version: std::sync::Arc, server_name: std::sync::Arc, string_host_url_list: Vec>, support_email: std::sync::Arc, time_out_world_id: std::sync::Arc, tutorial_world_id: std::sync::Arc, update_rate_ms_maximum: i32, update_rate_ms_minimum: i32, update_rate_ms_normal: i32, update_rate_ms_udon_manual: i32, upload_analysis_percent: i32, url_list: Vec>, use_reliable_udp_for_voice: bool, vive_windows_url: std::sync::Arc, white_listed_asset_urls: Vec>, player_url_resolver_version: std::sync::Arc, player_url_resolver_sha1: std::sync::Arc) -> ApiConfig { ApiConfig { voice_enable_degradation, voice_enable_receiver_limiting, diff --git a/src/models/api_config_announcement.rs b/src/models/api_config_announcement.rs index 1151757..47b0aa1 100644 --- a/src/models/api_config_announcement.rs +++ b/src/models/api_config_announcement.rs @@ -10,19 +10,19 @@ use crate::models; use serde::{Deserialize, Serialize}; /// ApiConfigAnnouncement : Public Announcement -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiConfigAnnouncement { /// Announcement name #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, /// Announcement text #[serde(rename = "text")] - pub text: String, + pub text: std::sync::Arc, } impl ApiConfigAnnouncement { /// Public Announcement - pub fn new(name: String, text: String) -> ApiConfigAnnouncement { + pub fn new(name: std::sync::Arc, text: std::sync::Arc) -> ApiConfigAnnouncement { ApiConfigAnnouncement { name, text, diff --git a/src/models/api_config_download_url_list.rs b/src/models/api_config_download_url_list.rs index e0eb3e4..c4a99ee 100644 --- a/src/models/api_config_download_url_list.rs +++ b/src/models/api_config_download_url_list.rs @@ -10,28 +10,28 @@ use crate::models; use serde::{Deserialize, Serialize}; /// ApiConfigDownloadUrlList : Download links for various development assets. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiConfigDownloadUrlList { /// Download link for legacy SDK2 #[serde(rename = "sdk2")] - pub sdk2: String, + pub sdk2: std::sync::Arc, /// Download link for SDK3 for Avatars #[serde(rename = "sdk3-avatars")] - pub sdk3_avatars: String, + pub sdk3_avatars: std::sync::Arc, /// Download link for SDK3 for Worlds #[serde(rename = "sdk3-worlds")] - pub sdk3_worlds: String, + pub sdk3_worlds: std::sync::Arc, /// Download link for the Creator Companion #[serde(rename = "vcc")] - pub vcc: String, + pub vcc: std::sync::Arc, /// Download link for ??? #[serde(rename = "bootstrap")] - pub bootstrap: String, + pub bootstrap: std::sync::Arc, } impl ApiConfigDownloadUrlList { /// Download links for various development assets. - pub fn new(sdk2: String, sdk3_avatars: String, sdk3_worlds: String, vcc: String, bootstrap: String) -> ApiConfigDownloadUrlList { + pub fn new(sdk2: std::sync::Arc, sdk3_avatars: std::sync::Arc, sdk3_worlds: std::sync::Arc, vcc: std::sync::Arc, bootstrap: std::sync::Arc) -> ApiConfigDownloadUrlList { ApiConfigDownloadUrlList { sdk2, sdk3_avatars, diff --git a/src/models/api_config_events.rs b/src/models/api_config_events.rs index 3ac327e..bd27d70 100644 --- a/src/models/api_config_events.rs +++ b/src/models/api_config_events.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiConfigEvents { /// Unknown #[serde(rename = "distanceClose")] diff --git a/src/models/api_health.rs b/src/models/api_health.rs index cd89ca1..e58d7de 100644 --- a/src/models/api_health.rs +++ b/src/models/api_health.rs @@ -9,18 +9,18 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiHealth { #[serde(rename = "ok")] pub ok: bool, #[serde(rename = "serverName")] - pub server_name: String, + pub server_name: std::sync::Arc, #[serde(rename = "buildVersionTag")] - pub build_version_tag: String, + pub build_version_tag: std::sync::Arc, } impl ApiHealth { - pub fn new(ok: bool, server_name: String, build_version_tag: String) -> ApiHealth { + pub fn new(ok: bool, server_name: std::sync::Arc, build_version_tag: std::sync::Arc) -> ApiHealth { ApiHealth { ok, server_name, diff --git a/src/models/avatar.rs b/src/models/avatar.rs index 77f35e0..b76f43b 100644 --- a/src/models/avatar.rs +++ b/src/models/avatar.rs @@ -10,51 +10,51 @@ use crate::models; use serde::{Deserialize, Serialize}; /// Avatar : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Avatar { /// Not present from general serach `/avatars`, only on specific requests `/avatars/{avatarId}`. #[serde(rename = "assetUrl", skip_serializing_if = "Option::is_none")] - pub asset_url: Option, + pub asset_url: Option>, /// Not present from general serach `/avatars`, only on specific requests `/avatars/{avatarId}`. **Deprecation:** `Object` has unknown usage/fields, and is always empty. Use normal `Url` field instead. #[serde(rename = "assetUrlObject", skip_serializing_if = "Option::is_none")] pub asset_url_object: Option, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "authorId")] - pub author_id: String, + pub author_id: std::sync::Arc, #[serde(rename = "authorName")] - pub author_name: String, + pub author_name: std::sync::Arc, #[serde(rename = "created_at")] - pub created_at: String, + pub created_at: std::sync::Arc, #[serde(rename = "description")] - pub description: String, + pub description: std::sync::Arc, #[serde(rename = "featured")] pub featured: bool, #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "imageUrl")] - pub image_url: String, + pub image_url: std::sync::Arc, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, #[serde(rename = "releaseStatus")] pub release_status: models::ReleaseStatus, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "thumbnailImageUrl")] - pub thumbnail_image_url: String, + pub thumbnail_image_url: std::sync::Arc, #[serde(rename = "unityPackageUrl")] - pub unity_package_url: String, + pub unity_package_url: std::sync::Arc, #[serde(rename = "unityPackageUrlObject")] pub unity_package_url_object: Box, #[serde(rename = "unityPackages")] pub unity_packages: Vec, #[serde(rename = "updated_at")] - pub updated_at: String, + pub updated_at: std::sync::Arc, #[serde(rename = "version")] pub version: i32, } impl Avatar { - pub fn new(author_id: String, author_name: String, created_at: String, description: String, featured: bool, id: String, image_url: String, name: String, release_status: models::ReleaseStatus, tags: Vec, thumbnail_image_url: String, unity_package_url: String, unity_package_url_object: models::AvatarUnityPackageUrlObject, unity_packages: Vec, updated_at: String, version: i32) -> Avatar { + pub fn new(author_id: std::sync::Arc, author_name: std::sync::Arc, created_at: std::sync::Arc, description: std::sync::Arc, featured: bool, id: std::sync::Arc, image_url: std::sync::Arc, name: std::sync::Arc, release_status: models::ReleaseStatus, tags: Vec, thumbnail_image_url: std::sync::Arc, unity_package_url: std::sync::Arc, unity_package_url_object: models::AvatarUnityPackageUrlObject, unity_packages: Vec, updated_at: std::sync::Arc, version: i32) -> Avatar { Avatar { asset_url: None, asset_url_object: None, diff --git a/src/models/avatar_unity_package_url_object.rs b/src/models/avatar_unity_package_url_object.rs index 7c58797..a180d57 100644 --- a/src/models/avatar_unity_package_url_object.rs +++ b/src/models/avatar_unity_package_url_object.rs @@ -10,10 +10,10 @@ use crate::models; use serde::{Deserialize, Serialize}; /// AvatarUnityPackageUrlObject : **Deprecation:** `Object` has unknown usage/fields, and is always empty. Use normal `Url` field instead. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AvatarUnityPackageUrlObject { #[serde(rename = "unityPackageUrl", skip_serializing_if = "Option::is_none")] - pub unity_package_url: Option, + pub unity_package_url: Option>, } impl AvatarUnityPackageUrlObject { diff --git a/src/models/badge.rs b/src/models/badge.rs index b04849b..746a9d0 100644 --- a/src/models/badge.rs +++ b/src/models/badge.rs @@ -9,20 +9,20 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Badge { /// only present in CurrentUser badges #[serde(rename = "assignedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub assigned_at: Option>, + pub assigned_at: Option>>, #[serde(rename = "badgeDescription")] - pub badge_description: String, + pub badge_description: std::sync::Arc, #[serde(rename = "badgeId")] - pub badge_id: String, + pub badge_id: std::sync::Arc, /// direct url to image #[serde(rename = "badgeImageUrl")] - pub badge_image_url: String, + pub badge_image_url: std::sync::Arc, #[serde(rename = "badgeName")] - pub badge_name: String, + pub badge_name: std::sync::Arc, /// only present in CurrentUser badges #[serde(rename = "hidden", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub hidden: Option>, @@ -30,11 +30,11 @@ pub struct Badge { pub showcased: bool, /// only present in CurrentUser badges #[serde(rename = "updatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, + pub updated_at: Option>>, } impl Badge { - pub fn new(badge_description: String, badge_id: String, badge_image_url: String, badge_name: String, showcased: bool) -> Badge { + pub fn new(badge_description: std::sync::Arc, badge_id: std::sync::Arc, badge_image_url: std::sync::Arc, badge_name: std::sync::Arc, showcased: bool) -> Badge { Badge { assigned_at: None, badge_description, diff --git a/src/models/ban_group_member_request.rs b/src/models/ban_group_member_request.rs index 0cd9205..85ffb85 100644 --- a/src/models/ban_group_member_request.rs +++ b/src/models/ban_group_member_request.rs @@ -9,15 +9,15 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BanGroupMemberRequest { /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "userId")] - pub user_id: String, + pub user_id: std::sync::Arc, } impl BanGroupMemberRequest { - pub fn new(user_id: String) -> BanGroupMemberRequest { + pub fn new(user_id: std::sync::Arc) -> BanGroupMemberRequest { BanGroupMemberRequest { user_id, } diff --git a/src/models/create_avatar_request.rs b/src/models/create_avatar_request.rs index 5e8c888..f125fb5 100644 --- a/src/models/create_avatar_request.rs +++ b/src/models/create_avatar_request.rs @@ -9,32 +9,32 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateAvatarRequest { #[serde(rename = "assetUrl", skip_serializing_if = "Option::is_none")] - pub asset_url: Option, + pub asset_url: Option>, #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, #[serde(rename = "imageUrl")] - pub image_url: String, + pub image_url: std::sync::Arc, #[serde(rename = "releaseStatus", skip_serializing_if = "Option::is_none")] pub release_status: Option, #[serde(rename = "version", skip_serializing_if = "Option::is_none")] pub version: Option, #[serde(rename = "unityPackageUrl", skip_serializing_if = "Option::is_none")] - pub unity_package_url: Option, + pub unity_package_url: Option>, #[serde(rename = "unityVersion", skip_serializing_if = "Option::is_none")] - pub unity_version: Option, + pub unity_version: Option>, } impl CreateAvatarRequest { - pub fn new(name: String, image_url: String) -> CreateAvatarRequest { + pub fn new(name: std::sync::Arc, image_url: std::sync::Arc) -> CreateAvatarRequest { CreateAvatarRequest { asset_url: None, id: None, diff --git a/src/models/create_file_request.rs b/src/models/create_file_request.rs index f9edc05..3beffd9 100644 --- a/src/models/create_file_request.rs +++ b/src/models/create_file_request.rs @@ -9,20 +9,20 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateFileRequest { #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, #[serde(rename = "mimeType")] pub mime_type: models::MimeType, #[serde(rename = "extension")] - pub extension: String, + pub extension: std::sync::Arc, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, } impl CreateFileRequest { - pub fn new(name: String, mime_type: models::MimeType, extension: String) -> CreateFileRequest { + pub fn new(name: std::sync::Arc, mime_type: models::MimeType, extension: std::sync::Arc) -> CreateFileRequest { CreateFileRequest { name, mime_type, diff --git a/src/models/create_file_version_request.rs b/src/models/create_file_version_request.rs index 99ba461..b032424 100644 --- a/src/models/create_file_version_request.rs +++ b/src/models/create_file_version_request.rs @@ -9,20 +9,20 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateFileVersionRequest { #[serde(rename = "signatureMd5")] - pub signature_md5: String, + pub signature_md5: std::sync::Arc, #[serde(rename = "signatureSizeInBytes")] pub signature_size_in_bytes: f64, #[serde(rename = "fileMd5", skip_serializing_if = "Option::is_none")] - pub file_md5: Option, + pub file_md5: Option>, #[serde(rename = "fileSizeInBytes", skip_serializing_if = "Option::is_none")] pub file_size_in_bytes: Option, } impl CreateFileVersionRequest { - pub fn new(signature_md5: String, signature_size_in_bytes: f64) -> CreateFileVersionRequest { + pub fn new(signature_md5: std::sync::Arc, signature_size_in_bytes: f64) -> CreateFileVersionRequest { CreateFileVersionRequest { signature_md5, signature_size_in_bytes, diff --git a/src/models/create_group_announcement_request.rs b/src/models/create_group_announcement_request.rs index 22f941a..a77db3a 100644 --- a/src/models/create_group_announcement_request.rs +++ b/src/models/create_group_announcement_request.rs @@ -9,23 +9,23 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateGroupAnnouncementRequest { /// Announcement title #[serde(rename = "title")] - pub title: String, + pub title: std::sync::Arc, /// Announcement text #[serde(rename = "text", skip_serializing_if = "Option::is_none")] - pub text: Option, + pub text: Option>, #[serde(rename = "imageId", skip_serializing_if = "Option::is_none")] - pub image_id: Option, + pub image_id: Option>, /// Send notification to group members. #[serde(rename = "sendNotification", skip_serializing_if = "Option::is_none")] pub send_notification: Option, } impl CreateGroupAnnouncementRequest { - pub fn new(title: String) -> CreateGroupAnnouncementRequest { + pub fn new(title: std::sync::Arc) -> CreateGroupAnnouncementRequest { CreateGroupAnnouncementRequest { title, text: None, diff --git a/src/models/create_group_gallery_request.rs b/src/models/create_group_gallery_request.rs index cbe1249..5de6eb2 100644 --- a/src/models/create_group_gallery_request.rs +++ b/src/models/create_group_gallery_request.rs @@ -9,29 +9,29 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateGroupGalleryRequest { /// Name of the gallery. #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, /// Description of the gallery. #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, /// Whether the gallery is members only. #[serde(rename = "membersOnly", skip_serializing_if = "Option::is_none")] pub members_only: Option, #[serde(rename = "roleIdsToView", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_view: Option>>, + pub role_ids_to_view: Option>>>, #[serde(rename = "roleIdsToSubmit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_submit: Option>>, + pub role_ids_to_submit: Option>>>, #[serde(rename = "roleIdsToAutoApprove", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_auto_approve: Option>>, + pub role_ids_to_auto_approve: Option>>>, #[serde(rename = "roleIdsToManage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_manage: Option>>, + pub role_ids_to_manage: Option>>>, } impl CreateGroupGalleryRequest { - pub fn new(name: String) -> CreateGroupGalleryRequest { + pub fn new(name: std::sync::Arc) -> CreateGroupGalleryRequest { CreateGroupGalleryRequest { name, description: None, diff --git a/src/models/create_group_invite_request.rs b/src/models/create_group_invite_request.rs index 0c3487b..3a9e270 100644 --- a/src/models/create_group_invite_request.rs +++ b/src/models/create_group_invite_request.rs @@ -9,17 +9,17 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateGroupInviteRequest { /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "userId")] - pub user_id: String, + pub user_id: std::sync::Arc, #[serde(rename = "confirmOverrideBlock", skip_serializing_if = "Option::is_none")] pub confirm_override_block: Option, } impl CreateGroupInviteRequest { - pub fn new(user_id: String) -> CreateGroupInviteRequest { + pub fn new(user_id: std::sync::Arc) -> CreateGroupInviteRequest { CreateGroupInviteRequest { user_id, confirm_override_block: None, diff --git a/src/models/create_group_post_request.rs b/src/models/create_group_post_request.rs index e35a3a9..91785a1 100644 --- a/src/models/create_group_post_request.rs +++ b/src/models/create_group_post_request.rs @@ -9,27 +9,27 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateGroupPostRequest { /// Post title #[serde(rename = "title")] - pub title: String, + pub title: std::sync::Arc, /// Post text #[serde(rename = "text")] - pub text: String, + pub text: std::sync::Arc, #[serde(rename = "imageId", skip_serializing_if = "Option::is_none")] - pub image_id: Option, + pub image_id: Option>, /// Send notification to group members. #[serde(rename = "sendNotification")] pub send_notification: bool, #[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")] - pub role_ids: Option>, + pub role_ids: Option>>, #[serde(rename = "visibility")] pub visibility: models::GroupPostVisibility, } impl CreateGroupPostRequest { - pub fn new(title: String, text: String, send_notification: bool, visibility: models::GroupPostVisibility) -> CreateGroupPostRequest { + pub fn new(title: std::sync::Arc, text: std::sync::Arc, send_notification: bool, visibility: models::GroupPostVisibility) -> CreateGroupPostRequest { CreateGroupPostRequest { title, text, diff --git a/src/models/create_group_request.rs b/src/models/create_group_request.rs index 3348ecb..0941bce 100644 --- a/src/models/create_group_request.rs +++ b/src/models/create_group_request.rs @@ -9,20 +9,20 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateGroupRequest { #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, #[serde(rename = "shortCode")] - pub short_code: String, + pub short_code: std::sync::Arc, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "joinState", skip_serializing_if = "Option::is_none")] pub join_state: Option, #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_id: Option>, + pub icon_id: Option>>, #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_id: Option>, + pub banner_id: Option>>, #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")] pub privacy: Option, #[serde(rename = "roleTemplate")] @@ -30,7 +30,7 @@ pub struct CreateGroupRequest { } impl CreateGroupRequest { - pub fn new(name: String, short_code: String, role_template: models::GroupRoleTemplate) -> CreateGroupRequest { + pub fn new(name: std::sync::Arc, short_code: std::sync::Arc, role_template: models::GroupRoleTemplate) -> CreateGroupRequest { CreateGroupRequest { name, short_code, diff --git a/src/models/create_group_role_request.rs b/src/models/create_group_role_request.rs index 72a9f1d..4d7d9df 100644 --- a/src/models/create_group_role_request.rs +++ b/src/models/create_group_role_request.rs @@ -9,18 +9,18 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateGroupRoleRequest { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "isSelfAssignable", skip_serializing_if = "Option::is_none")] pub is_self_assignable: Option, #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option>, + pub permissions: Option>>, } impl CreateGroupRoleRequest { diff --git a/src/models/create_instance_request.rs b/src/models/create_instance_request.rs index 5ded5ef..9048299 100644 --- a/src/models/create_instance_request.rs +++ b/src/models/create_instance_request.rs @@ -9,28 +9,28 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateInstanceRequest { /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "worldId")] - pub world_id: String, + pub world_id: std::sync::Arc, #[serde(rename = "type")] pub r#type: models::InstanceType, #[serde(rename = "region")] pub region: models::InstanceRegion, /// A groupId if the instance type is \"group\", null if instance type is public, or a userId otherwise #[serde(rename = "ownerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub owner_id: Option>, + pub owner_id: Option>>, /// Group roleIds that are allowed to join if the type is \"group\" and groupAccessType is \"member\" #[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")] - pub role_ids: Option>, + pub role_ids: Option>>, #[serde(rename = "groupAccessType", skip_serializing_if = "Option::is_none")] pub group_access_type: Option, #[serde(rename = "queueEnabled", skip_serializing_if = "Option::is_none")] pub queue_enabled: Option, /// The time after which users won't be allowed to join the instance. This doesn't work for public instances. #[serde(rename = "closedAt", skip_serializing_if = "Option::is_none")] - pub closed_at: Option, + pub closed_at: Option>, /// Only applies to invite type instances to make them invite+ #[serde(rename = "canRequestInvite", skip_serializing_if = "Option::is_none")] pub can_request_invite: Option, @@ -42,7 +42,7 @@ pub struct CreateInstanceRequest { } impl CreateInstanceRequest { - pub fn new(world_id: String, r#type: models::InstanceType, region: models::InstanceRegion) -> CreateInstanceRequest { + pub fn new(world_id: std::sync::Arc, r#type: models::InstanceType, region: models::InstanceRegion) -> CreateInstanceRequest { CreateInstanceRequest { world_id, r#type, diff --git a/src/models/create_world_request.rs b/src/models/create_world_request.rs index 7f84409..2348ce7 100644 --- a/src/models/create_world_request.rs +++ b/src/models/create_world_request.rs @@ -9,43 +9,43 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateWorldRequest { #[serde(rename = "assetUrl")] - pub asset_url: String, + pub asset_url: std::sync::Arc, #[serde(rename = "assetVersion", skip_serializing_if = "Option::is_none")] pub asset_version: Option, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "authorId", skip_serializing_if = "Option::is_none")] - pub author_id: Option, + pub author_id: Option>, #[serde(rename = "authorName", skip_serializing_if = "Option::is_none")] - pub author_name: Option, + pub author_name: Option>, #[serde(rename = "capacity", skip_serializing_if = "Option::is_none")] pub capacity: Option, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "imageUrl")] - pub image_url: String, + pub image_url: std::sync::Arc, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, /// This can be `standalonewindows` or `android`, but can also pretty much be any random Unity verison such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. #[serde(rename = "platform", skip_serializing_if = "Option::is_none")] - pub platform: Option, + pub platform: Option>, #[serde(rename = "releaseStatus", skip_serializing_if = "Option::is_none")] pub release_status: Option, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, #[serde(rename = "unityPackageUrl", skip_serializing_if = "Option::is_none")] - pub unity_package_url: Option, + pub unity_package_url: Option>, #[serde(rename = "unityVersion", skip_serializing_if = "Option::is_none")] - pub unity_version: Option, + pub unity_version: Option>, } impl CreateWorldRequest { - pub fn new(asset_url: String, image_url: String, name: String) -> CreateWorldRequest { + pub fn new(asset_url: std::sync::Arc, image_url: std::sync::Arc, name: std::sync::Arc) -> CreateWorldRequest { CreateWorldRequest { asset_url, asset_version: None, diff --git a/src/models/current_user.rs b/src/models/current_user.rs index c3b8668..fbbb581 100644 --- a/src/models/current_user.rs +++ b/src/models/current_user.rs @@ -9,63 +9,63 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CurrentUser { #[serde(rename = "acceptedTOSVersion")] pub accepted_tos_version: i32, #[serde(rename = "acceptedPrivacyVersion", skip_serializing_if = "Option::is_none")] pub accepted_privacy_version: Option, #[serde(rename = "accountDeletionDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub account_deletion_date: Option>, + pub account_deletion_date: Option>>, #[serde(rename = "accountDeletionLog", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub account_deletion_log: Option>>, #[serde(rename = "activeFriends", skip_serializing_if = "Option::is_none")] - pub active_friends: Option>, + pub active_friends: Option>>, #[serde(rename = "allowAvatarCopying")] pub allow_avatar_copying: bool, #[serde(rename = "badges", skip_serializing_if = "Option::is_none")] pub badges: Option>, #[serde(rename = "bio")] - pub bio: String, + pub bio: std::sync::Arc, #[serde(rename = "bioLinks")] - pub bio_links: Vec, + pub bio_links: Vec>, #[serde(rename = "currentAvatar")] - pub current_avatar: String, + pub current_avatar: std::sync::Arc, #[serde(rename = "currentAvatarAssetUrl")] - pub current_avatar_asset_url: String, + pub current_avatar_asset_url: std::sync::Arc, /// When profilePicOverride is not empty, use it instead. #[serde(rename = "currentAvatarImageUrl")] - pub current_avatar_image_url: String, + pub current_avatar_image_url: std::sync::Arc, /// When profilePicOverride is not empty, use it instead. #[serde(rename = "currentAvatarThumbnailImageUrl")] - pub current_avatar_thumbnail_image_url: String, + pub current_avatar_thumbnail_image_url: std::sync::Arc, #[serde(rename = "currentAvatarTags")] - pub current_avatar_tags: Vec, + pub current_avatar_tags: Vec, #[serde(rename = "date_joined")] - pub date_joined: String, + pub date_joined: std::sync::Arc, #[serde(rename = "developerType")] pub developer_type: models::DeveloperType, #[serde(rename = "displayName")] - pub display_name: String, + pub display_name: std::sync::Arc, #[serde(rename = "emailVerified")] pub email_verified: bool, #[serde(rename = "fallbackAvatar", skip_serializing_if = "Option::is_none")] - pub fallback_avatar: Option, + pub fallback_avatar: Option>, /// Always empty array. #[serde(rename = "friendGroupNames")] - pub friend_group_names: Vec, + pub friend_group_names: Vec>, #[serde(rename = "friendKey")] - pub friend_key: String, + pub friend_key: std::sync::Arc, #[serde(rename = "friends")] - pub friends: Vec, + pub friends: Vec>, #[serde(rename = "hasBirthday")] pub has_birthday: bool, #[serde(rename = "hideContentFilterSettings", skip_serializing_if = "Option::is_none")] pub hide_content_filter_settings: Option, #[serde(rename = "userLanguage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub user_language: Option>, + pub user_language: Option>>, #[serde(rename = "userLanguageCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub user_language_code: Option>, + pub user_language_code: Option>>, #[serde(rename = "hasEmail")] pub has_email: bool, #[serde(rename = "hasLoggedInFromClient")] @@ -74,84 +74,84 @@ pub struct CurrentUser { pub has_pending_email: bool, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "homeLocation")] - pub home_location: String, + pub home_location: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "isBoopingEnabled", skip_serializing_if = "Option::is_none")] pub is_booping_enabled: Option, #[serde(rename = "isFriend")] pub is_friend: bool, #[serde(rename = "last_activity", skip_serializing_if = "Option::is_none")] - pub last_activity: Option, + pub last_activity: Option>, #[serde(rename = "last_login")] - pub last_login: String, + pub last_login: std::sync::Arc, #[serde(rename = "last_mobile", deserialize_with = "Option::deserialize")] - pub last_mobile: Option, + pub last_mobile: Option>, /// This can be `standalonewindows` or `android`, but can also pretty much be any random Unity verison such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. #[serde(rename = "last_platform")] - pub last_platform: String, + pub last_platform: std::sync::Arc, #[serde(rename = "obfuscatedEmail")] - pub obfuscated_email: String, + pub obfuscated_email: std::sync::Arc, #[serde(rename = "obfuscatedPendingEmail")] - pub obfuscated_pending_email: String, + pub obfuscated_pending_email: std::sync::Arc, #[serde(rename = "oculusId")] - pub oculus_id: String, + pub oculus_id: std::sync::Arc, #[serde(rename = "googleId", skip_serializing_if = "Option::is_none")] - pub google_id: Option, + pub google_id: Option>, #[serde(rename = "googleDetails", skip_serializing_if = "Option::is_none")] pub google_details: Option, #[serde(rename = "picoId", skip_serializing_if = "Option::is_none")] - pub pico_id: Option, + pub pico_id: Option>, #[serde(rename = "viveId", skip_serializing_if = "Option::is_none")] - pub vive_id: Option, + pub vive_id: Option>, #[serde(rename = "offlineFriends", skip_serializing_if = "Option::is_none")] - pub offline_friends: Option>, + pub offline_friends: Option>>, #[serde(rename = "onlineFriends", skip_serializing_if = "Option::is_none")] - pub online_friends: Option>, + pub online_friends: Option>>, #[serde(rename = "pastDisplayNames")] pub past_display_names: Vec, #[serde(rename = "presence", skip_serializing_if = "Option::is_none")] pub presence: Option>, #[serde(rename = "profilePicOverride")] - pub profile_pic_override: String, + pub profile_pic_override: std::sync::Arc, #[serde(rename = "profilePicOverrideThumbnail")] - pub profile_pic_override_thumbnail: String, + pub profile_pic_override_thumbnail: std::sync::Arc, #[serde(rename = "pronouns")] - pub pronouns: String, + pub pronouns: std::sync::Arc, #[serde(rename = "state")] pub state: models::UserState, #[serde(rename = "status")] pub status: models::UserStatus, #[serde(rename = "statusDescription")] - pub status_description: String, + pub status_description: std::sync::Arc, #[serde(rename = "statusFirstTime")] pub status_first_time: bool, #[serde(rename = "statusHistory")] - pub status_history: Vec, + pub status_history: Vec>, #[serde(rename = "steamDetails")] pub steam_details: serde_json::Value, #[serde(rename = "steamId")] - pub steam_id: String, + pub steam_id: std::sync::Arc, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "twoFactorAuthEnabled")] pub two_factor_auth_enabled: bool, #[serde(rename = "twoFactorAuthEnabledDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub two_factor_auth_enabled_date: Option>, + pub two_factor_auth_enabled_date: Option>>, #[serde(rename = "unsubscribe")] pub unsubscribe: bool, #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, + pub updated_at: Option>, #[serde(rename = "userIcon")] - pub user_icon: String, + pub user_icon: std::sync::Arc, /// -| **DEPRECATED:** VRChat API no longer return usernames of other users. [See issue by Tupper for more information](https://github.com/pypy-vrc/VRCX/issues/429). #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, + pub username: Option>, } impl CurrentUser { - pub fn new(accepted_tos_version: i32, allow_avatar_copying: bool, bio: String, bio_links: Vec, current_avatar: String, current_avatar_asset_url: String, current_avatar_image_url: String, current_avatar_thumbnail_image_url: String, current_avatar_tags: Vec, date_joined: String, developer_type: models::DeveloperType, display_name: String, email_verified: bool, friend_group_names: Vec, friend_key: String, friends: Vec, has_birthday: bool, has_email: bool, has_logged_in_from_client: bool, has_pending_email: bool, home_location: String, id: String, is_friend: bool, last_login: String, last_mobile: Option, last_platform: String, obfuscated_email: String, obfuscated_pending_email: String, oculus_id: String, past_display_names: Vec, profile_pic_override: String, profile_pic_override_thumbnail: String, pronouns: String, state: models::UserState, status: models::UserStatus, status_description: String, status_first_time: bool, status_history: Vec, steam_details: serde_json::Value, steam_id: String, tags: Vec, two_factor_auth_enabled: bool, unsubscribe: bool, user_icon: String) -> CurrentUser { + pub fn new(accepted_tos_version: i32, allow_avatar_copying: bool, bio: std::sync::Arc, bio_links: Vec>, current_avatar: std::sync::Arc, current_avatar_asset_url: std::sync::Arc, current_avatar_image_url: std::sync::Arc, current_avatar_thumbnail_image_url: std::sync::Arc, current_avatar_tags: Vec, date_joined: std::sync::Arc, developer_type: models::DeveloperType, display_name: std::sync::Arc, email_verified: bool, friend_group_names: Vec>, friend_key: std::sync::Arc, friends: Vec>, has_birthday: bool, has_email: bool, has_logged_in_from_client: bool, has_pending_email: bool, home_location: std::sync::Arc, id: std::sync::Arc, is_friend: bool, last_login: std::sync::Arc, last_mobile: Option>, last_platform: std::sync::Arc, obfuscated_email: std::sync::Arc, obfuscated_pending_email: std::sync::Arc, oculus_id: std::sync::Arc, past_display_names: Vec, profile_pic_override: std::sync::Arc, profile_pic_override_thumbnail: std::sync::Arc, pronouns: std::sync::Arc, state: models::UserState, status: models::UserStatus, status_description: std::sync::Arc, status_first_time: bool, status_history: Vec>, steam_details: serde_json::Value, steam_id: std::sync::Arc, tags: Vec, two_factor_auth_enabled: bool, unsubscribe: bool, user_icon: std::sync::Arc) -> CurrentUser { CurrentUser { accepted_tos_version, accepted_privacy_version: None, @@ -229,8 +229,8 @@ pub enum EitherUserOrTwoFactor{ RequiresTwoFactorAuth(RequiresTwoFactorAuth), } -#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct RequiresTwoFactorAuth{ #[serde(rename = "requiresTwoFactorAuth")] - pub requires_two_factor_auth: Vec + pub requires_two_factor_auth: Vec> } \ No newline at end of file diff --git a/src/models/current_user_presence.rs b/src/models/current_user_presence.rs index d177463..49a38ac 100644 --- a/src/models/current_user_presence.rs +++ b/src/models/current_user_presence.rs @@ -9,40 +9,40 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CurrentUserPresence { #[serde(rename = "avatarThumbnail", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub avatar_thumbnail: Option>, + pub avatar_thumbnail: Option>>, #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] - pub display_name: Option, + pub display_name: Option>, #[serde(rename = "groups", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub groups: Option>>, + pub groups: Option>>>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "instance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub instance: Option>, + pub instance: Option>>, /// either an InstanceType or an empty string #[serde(rename = "instanceType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub instance_type: Option>, + pub instance_type: Option>>, #[serde(rename = "isRejoining", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub is_rejoining: Option>, + pub is_rejoining: Option>>, /// either a Platform or an empty string #[serde(rename = "platform", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub platform: Option>, + pub platform: Option>>, #[serde(rename = "profilePicOverride", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub profile_pic_override: Option>, + pub profile_pic_override: Option>>, /// either a UserStatus or empty string #[serde(rename = "status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub status: Option>, + pub status: Option>>, #[serde(rename = "travelingToInstance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub traveling_to_instance: Option>, + pub traveling_to_instance: Option>>, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "travelingToWorld", skip_serializing_if = "Option::is_none")] - pub traveling_to_world: Option, + pub traveling_to_world: Option>, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "world", skip_serializing_if = "Option::is_none")] - pub world: Option, + pub world: Option>, } impl CurrentUserPresence { diff --git a/src/models/dynamic_content_row.rs b/src/models/dynamic_content_row.rs index 7300c57..f5b3605 100644 --- a/src/models/dynamic_content_row.rs +++ b/src/models/dynamic_content_row.rs @@ -9,31 +9,31 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DynamicContentRow { #[serde(rename = "index", skip_serializing_if = "Option::is_none")] pub index: Option, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, /// Usually \"ThisPlatformSupported\", but can also be other values such as \"all\" or platform specific identifiers. #[serde(rename = "platform")] - pub platform: String, + pub platform: std::sync::Arc, #[serde(rename = "sortHeading")] - pub sort_heading: String, + pub sort_heading: std::sync::Arc, #[serde(rename = "sortOrder")] - pub sort_order: String, + pub sort_order: std::sync::Arc, #[serde(rename = "sortOwnership")] - pub sort_ownership: String, + pub sort_ownership: std::sync::Arc, /// Tag to filter content for this row. #[serde(rename = "tag", skip_serializing_if = "Option::is_none")] - pub tag: Option, + pub tag: Option>, /// Type is not present if it is a world. #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub r#type: Option, + pub r#type: Option>, } impl DynamicContentRow { - pub fn new(name: String, platform: String, sort_heading: String, sort_order: String, sort_ownership: String) -> DynamicContentRow { + pub fn new(name: std::sync::Arc, platform: std::sync::Arc, sort_heading: std::sync::Arc, sort_order: std::sync::Arc, sort_ownership: std::sync::Arc) -> DynamicContentRow { DynamicContentRow { index: None, name, diff --git a/src/models/error.rs b/src/models/error.rs index 7612690..8fafb37 100644 --- a/src/models/error.rs +++ b/src/models/error.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Error { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option>, diff --git a/src/models/favorite.rs b/src/models/favorite.rs index 7f9584e..f19a67e 100644 --- a/src/models/favorite.rs +++ b/src/models/favorite.rs @@ -10,21 +10,21 @@ use crate::models; use serde::{Deserialize, Serialize}; /// Favorite : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Favorite { /// MUST be either AvatarID, UserID or WorldID. #[serde(rename = "favoriteId")] - pub favorite_id: String, + pub favorite_id: std::sync::Arc, #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "type")] pub r#type: models::FavoriteType, } impl Favorite { - pub fn new(favorite_id: String, id: String, tags: Vec, r#type: models::FavoriteType) -> Favorite { + pub fn new(favorite_id: std::sync::Arc, id: std::sync::Arc, tags: Vec, r#type: models::FavoriteType) -> Favorite { Favorite { favorite_id, id, diff --git a/src/models/favorite_group.rs b/src/models/favorite_group.rs index 2afd531..db58ae6 100644 --- a/src/models/favorite_group.rs +++ b/src/models/favorite_group.rs @@ -10,21 +10,21 @@ use crate::models; use serde::{Deserialize, Serialize}; /// FavoriteGroup : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FavoriteGroup { #[serde(rename = "displayName")] - pub display_name: String, + pub display_name: std::sync::Arc, #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, #[serde(rename = "ownerDisplayName")] - pub owner_display_name: String, + pub owner_display_name: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "ownerId")] - pub owner_id: String, + pub owner_id: std::sync::Arc, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "type")] pub r#type: models::FavoriteType, #[serde(rename = "visibility")] @@ -32,7 +32,7 @@ pub struct FavoriteGroup { } impl FavoriteGroup { - pub fn new(display_name: String, id: String, name: String, owner_display_name: String, owner_id: String, tags: Vec, r#type: models::FavoriteType, visibility: models::FavoriteGroupVisibility) -> FavoriteGroup { + pub fn new(display_name: std::sync::Arc, id: std::sync::Arc, name: std::sync::Arc, owner_display_name: std::sync::Arc, owner_id: std::sync::Arc, tags: Vec, r#type: models::FavoriteType, visibility: models::FavoriteGroupVisibility) -> FavoriteGroup { FavoriteGroup { display_name, id, diff --git a/src/models/file.rs b/src/models/file.rs index 4f203f0..7172f25 100644 --- a/src/models/file.rs +++ b/src/models/file.rs @@ -10,27 +10,27 @@ use crate::models; use serde::{Deserialize, Serialize}; /// File : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct File { #[serde(rename = "extension")] - pub extension: String, + pub extension: std::sync::Arc, #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "mimeType")] pub mime_type: models::MimeType, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "ownerId")] - pub owner_id: String, + pub owner_id: std::sync::Arc, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "versions")] pub versions: Vec, } impl File { - pub fn new(extension: String, id: String, mime_type: models::MimeType, name: String, owner_id: String, tags: Vec, versions: Vec) -> File { + pub fn new(extension: std::sync::Arc, id: std::sync::Arc, mime_type: models::MimeType, name: std::sync::Arc, owner_id: std::sync::Arc, tags: Vec, versions: Vec) -> File { File { extension, id, diff --git a/src/models/file_data.rs b/src/models/file_data.rs index c15ee83..e4133b8 100644 --- a/src/models/file_data.rs +++ b/src/models/file_data.rs @@ -10,26 +10,26 @@ use crate::models; use serde::{Deserialize, Serialize}; /// FileData : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FileData { #[serde(rename = "category")] pub category: Category, #[serde(rename = "fileName")] - pub file_name: String, + pub file_name: std::sync::Arc, #[serde(rename = "md5", skip_serializing_if = "Option::is_none")] - pub md5: Option, + pub md5: Option>, #[serde(rename = "sizeInBytes")] pub size_in_bytes: i32, #[serde(rename = "status")] pub status: models::FileStatus, #[serde(rename = "uploadId")] - pub upload_id: String, + pub upload_id: std::sync::Arc, #[serde(rename = "url")] - pub url: String, + pub url: std::sync::Arc, } impl FileData { - pub fn new(category: Category, file_name: String, size_in_bytes: i32, status: models::FileStatus, upload_id: String, url: String) -> FileData { + pub fn new(category: Category, file_name: std::sync::Arc, size_in_bytes: i32, status: models::FileStatus, upload_id: std::sync::Arc, url: std::sync::Arc) -> FileData { FileData { category, file_name, diff --git a/src/models/file_upload_url.rs b/src/models/file_upload_url.rs index 6d4dc43..7b1528d 100644 --- a/src/models/file_upload_url.rs +++ b/src/models/file_upload_url.rs @@ -10,14 +10,14 @@ use crate::models; use serde::{Deserialize, Serialize}; /// FileUploadUrl : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FileUploadUrl { #[serde(rename = "url")] - pub url: String, + pub url: std::sync::Arc, } impl FileUploadUrl { - pub fn new(url: String) -> FileUploadUrl { + pub fn new(url: std::sync::Arc) -> FileUploadUrl { FileUploadUrl { url, } diff --git a/src/models/file_version.rs b/src/models/file_version.rs index befc3e0..8fdf59e 100644 --- a/src/models/file_version.rs +++ b/src/models/file_version.rs @@ -10,10 +10,10 @@ use crate::models; use serde::{Deserialize, Serialize}; /// FileVersion : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FileVersion { #[serde(rename = "created_at")] - pub created_at: String, + pub created_at: std::sync::Arc, /// Usually only present if `true` #[serde(rename = "deleted", skip_serializing_if = "Option::is_none")] pub deleted: Option, @@ -31,7 +31,7 @@ pub struct FileVersion { } impl FileVersion { - pub fn new(created_at: String, status: models::FileStatus, version: i32) -> FileVersion { + pub fn new(created_at: std::sync::Arc, status: models::FileStatus, version: i32) -> FileVersion { FileVersion { created_at, deleted: None, diff --git a/src/models/file_version_upload_status.rs b/src/models/file_version_upload_status.rs index 41ed9d2..558255d 100644 --- a/src/models/file_version_upload_status.rs +++ b/src/models/file_version_upload_status.rs @@ -10,12 +10,12 @@ use crate::models; use serde::{Deserialize, Serialize}; /// FileVersionUploadStatus : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FileVersionUploadStatus { #[serde(rename = "uploadId")] - pub upload_id: String, + pub upload_id: std::sync::Arc, #[serde(rename = "fileName")] - pub file_name: String, + pub file_name: std::sync::Arc, #[serde(rename = "nextPartNumber")] pub next_part_number: f64, #[serde(rename = "maxParts")] @@ -28,7 +28,7 @@ pub struct FileVersionUploadStatus { } impl FileVersionUploadStatus { - pub fn new(upload_id: String, file_name: String, next_part_number: f64, max_parts: f64, parts: Vec, etags: Vec) -> FileVersionUploadStatus { + pub fn new(upload_id: std::sync::Arc, file_name: std::sync::Arc, next_part_number: f64, max_parts: f64, parts: Vec, etags: Vec) -> FileVersionUploadStatus { FileVersionUploadStatus { upload_id, file_name, diff --git a/src/models/finish_file_data_upload_request.rs b/src/models/finish_file_data_upload_request.rs index 5ec9d0e..54b5c3f 100644 --- a/src/models/finish_file_data_upload_request.rs +++ b/src/models/finish_file_data_upload_request.rs @@ -10,21 +10,21 @@ use crate::models; use serde::{Deserialize, Serialize}; /// FinishFileDataUploadRequest : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FinishFileDataUploadRequest { /// Array of ETags uploaded. #[serde(rename = "etags", skip_serializing_if = "Option::is_none")] - pub etags: Option>, + pub etags: Option>>, /// Always a zero in string form, despite how many parts uploaded. #[serde(rename = "nextPartNumber")] - pub next_part_number: String, + pub next_part_number: std::sync::Arc, /// Always a zero in string form, despite how many parts uploaded. #[serde(rename = "maxParts")] - pub max_parts: String, + pub max_parts: std::sync::Arc, } impl FinishFileDataUploadRequest { - pub fn new(next_part_number: String, max_parts: String) -> FinishFileDataUploadRequest { + pub fn new(next_part_number: std::sync::Arc, max_parts: std::sync::Arc) -> FinishFileDataUploadRequest { FinishFileDataUploadRequest { etags: None, next_part_number, diff --git a/src/models/friend_status.rs b/src/models/friend_status.rs index 72c3720..002df16 100644 --- a/src/models/friend_status.rs +++ b/src/models/friend_status.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FriendStatus { #[serde(rename = "incomingRequest")] pub incoming_request: bool, diff --git a/src/models/group.rs b/src/models/group.rs index 3b94caa..34fd88f 100644 --- a/src/models/group.rs +++ b/src/models/group.rs @@ -9,58 +9,58 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Group { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "shortCode", skip_serializing_if = "Option::is_none")] - pub short_code: Option, + pub short_code: Option>, #[serde(rename = "discriminator", skip_serializing_if = "Option::is_none")] - pub discriminator: Option, + pub discriminator: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "iconUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_url: Option>, + pub icon_url: Option>>, #[serde(rename = "bannerUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_url: Option>, + pub banner_url: Option>>, #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")] pub privacy: Option, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "ownerId", skip_serializing_if = "Option::is_none")] - pub owner_id: Option, + pub owner_id: Option>, #[serde(rename = "rules", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub rules: Option>, + pub rules: Option>>, #[serde(rename = "links", skip_serializing_if = "Option::is_none")] - pub links: Option>, + pub links: Option>>, #[serde(rename = "languages", skip_serializing_if = "Option::is_none")] - pub languages: Option>, + pub languages: Option>>, #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_id: Option>, + pub icon_id: Option>>, #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_id: Option>, + pub banner_id: Option>>, #[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")] pub member_count: Option, #[serde(rename = "memberCountSyncedAt", skip_serializing_if = "Option::is_none")] - pub member_count_synced_at: Option, + pub member_count_synced_at: Option>, #[serde(rename = "isVerified", skip_serializing_if = "Option::is_none")] pub is_verified: Option, #[serde(rename = "joinState", skip_serializing_if = "Option::is_none")] pub join_state: Option, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "transferTargetId", skip_serializing_if = "Option::is_none")] - pub transfer_target_id: Option, + pub transfer_target_id: Option>, #[serde(rename = "galleries", skip_serializing_if = "Option::is_none")] pub galleries: Option>, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, - #[serde(rename = "lastPostCreatedAt", skip_serializing_if = "Option::is_none")] - pub last_post_created_at: Option, + pub updated_at: Option>, + #[serde(rename = "lastPostCreatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub last_post_created_at: Option>>, #[serde(rename = "onlineMemberCount", skip_serializing_if = "Option::is_none")] pub online_member_count: Option, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] diff --git a/src/models/group_announcement.rs b/src/models/group_announcement.rs index 89eddee..01946fe 100644 --- a/src/models/group_announcement.rs +++ b/src/models/group_announcement.rs @@ -9,27 +9,27 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupAnnouncement { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "authorId", skip_serializing_if = "Option::is_none")] - pub author_id: Option, + pub author_id: Option>, #[serde(rename = "title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub title: Option>, + pub title: Option>>, #[serde(rename = "text", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub text: Option>, + pub text: Option>>, #[serde(rename = "imageId", skip_serializing_if = "Option::is_none")] - pub image_id: Option, + pub image_id: Option>, #[serde(rename = "imageUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub image_url: Option>, + pub image_url: Option>>, #[serde(rename = "createdAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, + pub created_at: Option>>, #[serde(rename = "updatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, + pub updated_at: Option>>, } impl GroupAnnouncement { diff --git a/src/models/group_audit_log_entry.rs b/src/models/group_audit_log_entry.rs index 861985f..93546db 100644 --- a/src/models/group_audit_log_entry.rs +++ b/src/models/group_audit_log_entry.rs @@ -9,28 +9,28 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupAuditLogEntry { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "actorId", skip_serializing_if = "Option::is_none")] - pub actor_id: Option, + pub actor_id: Option>, #[serde(rename = "actorDisplayName", skip_serializing_if = "Option::is_none")] - pub actor_display_name: Option, + pub actor_display_name: Option>, /// Typically GroupID or GroupRoleID, but could be other types of IDs. #[serde(rename = "targetId", skip_serializing_if = "Option::is_none")] - pub target_id: Option, + pub target_id: Option>, /// The type of event that occurred. This is a string that is prefixed with the type of object that the event occurred on. For example, a group role update event would be prefixed with `group.role`. #[serde(rename = "eventType", skip_serializing_if = "Option::is_none")] - pub event_type: Option, + pub event_type: Option>, /// A human-readable description of the event. #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, /// The data associated with the event. The format of this data is dependent on the event type. #[serde(rename = "data", skip_serializing_if = "Option::is_none")] pub data: Option, diff --git a/src/models/group_gallery.rs b/src/models/group_gallery.rs index 3381c82..0098bf6 100644 --- a/src/models/group_gallery.rs +++ b/src/models/group_gallery.rs @@ -9,31 +9,31 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupGallery { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, /// Name of the gallery. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, /// Description of the gallery. #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, /// Whether the gallery is members only. #[serde(rename = "membersOnly", skip_serializing_if = "Option::is_none")] pub members_only: Option, #[serde(rename = "roleIdsToView", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_view: Option>>, + pub role_ids_to_view: Option>>>, #[serde(rename = "roleIdsToSubmit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_submit: Option>>, + pub role_ids_to_submit: Option>>>, #[serde(rename = "roleIdsToAutoApprove", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_auto_approve: Option>>, + pub role_ids_to_auto_approve: Option>>>, #[serde(rename = "roleIdsToManage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_manage: Option>>, + pub role_ids_to_manage: Option>>>, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, + pub updated_at: Option>, } impl GroupGallery { diff --git a/src/models/group_gallery_image.rs b/src/models/group_gallery_image.rs index bde5170..93f848c 100644 --- a/src/models/group_gallery_image.rs +++ b/src/models/group_gallery_image.rs @@ -9,30 +9,30 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupGalleryImage { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, #[serde(rename = "galleryId", skip_serializing_if = "Option::is_none")] - pub gallery_id: Option, + pub gallery_id: Option>, #[serde(rename = "fileId", skip_serializing_if = "Option::is_none")] - pub file_id: Option, + pub file_id: Option>, #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")] - pub image_url: Option, + pub image_url: Option>, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "submittedByUserId", skip_serializing_if = "Option::is_none")] - pub submitted_by_user_id: Option, + pub submitted_by_user_id: Option>, #[serde(rename = "approved", skip_serializing_if = "Option::is_none")] pub approved: Option, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "approvedByUserId", skip_serializing_if = "Option::is_none")] - pub approved_by_user_id: Option, + pub approved_by_user_id: Option>, #[serde(rename = "approvedAt", skip_serializing_if = "Option::is_none")] - pub approved_at: Option, + pub approved_at: Option>, } impl GroupGalleryImage { diff --git a/src/models/group_instance.rs b/src/models/group_instance.rs index a983594..5755f4d 100644 --- a/src/models/group_instance.rs +++ b/src/models/group_instance.rs @@ -9,13 +9,13 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupInstance { #[serde(rename = "instanceId")] - pub instance_id: String, + pub instance_id: std::sync::Arc, /// InstanceID can be \"offline\" on User profiles if you are not friends with that user and \"private\" if you are friends and user is in private instance. #[serde(rename = "location")] - pub location: String, + pub location: std::sync::Arc, #[serde(rename = "world")] pub world: Box, #[serde(rename = "memberCount")] @@ -23,7 +23,7 @@ pub struct GroupInstance { } impl GroupInstance { - pub fn new(instance_id: String, location: String, world: models::World, member_count: i32) -> GroupInstance { + pub fn new(instance_id: std::sync::Arc, location: std::sync::Arc, world: models::World, member_count: i32) -> GroupInstance { GroupInstance { instance_id, location, diff --git a/src/models/group_limited_member.rs b/src/models/group_limited_member.rs index 828d933..1475358 100644 --- a/src/models/group_limited_member.rs +++ b/src/models/group_limited_member.rs @@ -9,41 +9,41 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupLimitedMember { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] - pub user_id: Option, + pub user_id: Option>, /// Whether the user is representing the group. This makes the group show up above the name tag in-game. #[serde(rename = "isRepresenting", skip_serializing_if = "Option::is_none")] pub is_representing: Option, #[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")] - pub role_ids: Option>, + pub role_ids: Option>>, #[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")] - pub m_role_ids: Option>, + pub m_role_ids: Option>>, #[serde(rename = "joinedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub joined_at: Option>, + pub joined_at: Option>>, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] pub membership_status: Option, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] - pub visibility: Option, + pub visibility: Option>, #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] pub is_subscribed_to_announcements: Option, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. #[serde(rename = "createdAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, + pub created_at: Option>>, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. #[serde(rename = "bannedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banned_at: Option>, + pub banned_at: Option>>, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. #[serde(rename = "managerNotes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub manager_notes: Option>, + pub manager_notes: Option>>, #[serde(rename = "lastPostReadAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub last_post_read_at: Option>, + pub last_post_read_at: Option>>, #[serde(rename = "hasJoinedFromPurchase", skip_serializing_if = "Option::is_none")] pub has_joined_from_purchase: Option, } diff --git a/src/models/group_member.rs b/src/models/group_member.rs index 6ef8489..ba8451e 100644 --- a/src/models/group_member.rs +++ b/src/models/group_member.rs @@ -9,43 +9,43 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupMember { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] - pub user_id: Option, + pub user_id: Option>, /// Whether the user is representing the group. This makes the group show up above the name tag in-game. #[serde(rename = "isRepresenting", skip_serializing_if = "Option::is_none")] pub is_representing: Option, #[serde(rename = "user", skip_serializing_if = "Option::is_none")] pub user: Option>, #[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")] - pub role_ids: Option>, + pub role_ids: Option>>, #[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")] - pub m_role_ids: Option>, + pub m_role_ids: Option>>, #[serde(rename = "joinedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub joined_at: Option>, + pub joined_at: Option>>, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] pub membership_status: Option, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] - pub visibility: Option, + pub visibility: Option>, #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] pub is_subscribed_to_announcements: Option, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. #[serde(rename = "createdAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, + pub created_at: Option>>, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. #[serde(rename = "bannedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banned_at: Option>, + pub banned_at: Option>>, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. #[serde(rename = "managerNotes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub manager_notes: Option>, + pub manager_notes: Option>>, #[serde(rename = "lastPostReadAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub last_post_read_at: Option>, + pub last_post_read_at: Option>>, #[serde(rename = "hasJoinedFromPurchase", skip_serializing_if = "Option::is_none")] pub has_joined_from_purchase: Option, } diff --git a/src/models/group_member_limited_user.rs b/src/models/group_member_limited_user.rs index 4606edd..516c875 100644 --- a/src/models/group_member_limited_user.rs +++ b/src/models/group_member_limited_user.rs @@ -10,23 +10,23 @@ use crate::models; use serde::{Deserialize, Serialize}; /// GroupMemberLimitedUser : Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupMemberLimitedUser { /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] - pub display_name: Option, + pub display_name: Option>, #[serde(rename = "thumbnailUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub thumbnail_url: Option>, + pub thumbnail_url: Option>>, #[serde(rename = "iconUrl", skip_serializing_if = "Option::is_none")] - pub icon_url: Option, + pub icon_url: Option>, #[serde(rename = "profilePicOverride", skip_serializing_if = "Option::is_none")] - pub profile_pic_override: Option, + pub profile_pic_override: Option>, #[serde(rename = "currentAvatarThumbnailImageUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub current_avatar_thumbnail_image_url: Option>, + pub current_avatar_thumbnail_image_url: Option>>, #[serde(rename = "currentAvatarTags", skip_serializing_if = "Option::is_none")] - pub current_avatar_tags: Option>, + pub current_avatar_tags: Option>>, } impl GroupMemberLimitedUser { diff --git a/src/models/group_my_member.rs b/src/models/group_my_member.rs index 33ae2af..5e26ace 100644 --- a/src/models/group_my_member.rs +++ b/src/models/group_my_member.rs @@ -9,48 +9,48 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupMyMember { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] - pub user_id: Option, + pub user_id: Option>, #[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")] - pub role_ids: Option>, - #[serde(rename = "acceptedByDisplayName", skip_serializing_if = "Option::is_none")] - pub accepted_by_display_name: Option, + pub role_ids: Option>>, + #[serde(rename = "acceptedByDisplayName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub accepted_by_display_name: Option>>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "acceptedById", skip_serializing_if = "Option::is_none")] - pub accepted_by_id: Option, + pub accepted_by_id: Option>, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, #[serde(rename = "managerNotes", skip_serializing_if = "Option::is_none")] - pub manager_notes: Option, + pub manager_notes: Option>, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] - pub membership_status: Option, + pub membership_status: Option>, #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] pub is_subscribed_to_announcements: Option, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] - pub visibility: Option, + pub visibility: Option>, #[serde(rename = "isRepresenting", skip_serializing_if = "Option::is_none")] pub is_representing: Option, #[serde(rename = "joinedAt", skip_serializing_if = "Option::is_none")] - pub joined_at: Option, + pub joined_at: Option>, #[serde(rename = "bannedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banned_at: Option>, + pub banned_at: Option>>, #[serde(rename = "has2FA", skip_serializing_if = "Option::is_none")] pub has2_fa: Option, #[serde(rename = "hasJoinedFromPurchase", skip_serializing_if = "Option::is_none")] pub has_joined_from_purchase: Option, - #[serde(rename = "lastPostReadAt", skip_serializing_if = "Option::is_none")] - pub last_post_read_at: Option, + #[serde(rename = "lastPostReadAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub last_post_read_at: Option>>, #[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")] - pub m_role_ids: Option>, + pub m_role_ids: Option>>, #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option>, + pub permissions: Option>>, } impl GroupMyMember { diff --git a/src/models/group_permission.rs b/src/models/group_permission.rs index 2c1f68c..3ed4f29 100644 --- a/src/models/group_permission.rs +++ b/src/models/group_permission.rs @@ -10,17 +10,17 @@ use crate::models; use serde::{Deserialize, Serialize}; /// GroupPermission : A permission that can be granted to a role in a group. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupPermission { /// The name of the permission. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, /// The display name of the permission. #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] - pub display_name: Option, + pub display_name: Option>, /// Human-readable description of the permission. #[serde(rename = "help", skip_serializing_if = "Option::is_none")] - pub help: Option, + pub help: Option>, /// Whether this permission is a \"management\" permission. #[serde(rename = "isManagementPermission", skip_serializing_if = "Option::is_none")] pub is_management_permission: Option, diff --git a/src/models/group_post.rs b/src/models/group_post.rs index 6b8c06f..421446d 100644 --- a/src/models/group_post.rs +++ b/src/models/group_post.rs @@ -9,34 +9,34 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupPost { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "authorId", skip_serializing_if = "Option::is_none")] - pub author_id: Option, + pub author_id: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "editorId", skip_serializing_if = "Option::is_none")] - pub editor_id: Option, + pub editor_id: Option>, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(rename = "roleId", skip_serializing_if = "Option::is_none")] - pub role_id: Option>, + pub role_id: Option>>, #[serde(rename = "title", skip_serializing_if = "Option::is_none")] - pub title: Option, + pub title: Option>, #[serde(rename = "text", skip_serializing_if = "Option::is_none")] - pub text: Option, + pub text: Option>, #[serde(rename = "imageId", skip_serializing_if = "Option::is_none")] - pub image_id: Option, + pub image_id: Option>, #[serde(rename = "imageUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub image_url: Option>, + pub image_url: Option>>, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, + pub updated_at: Option>, } impl GroupPost { diff --git a/src/models/group_role.rs b/src/models/group_role.rs index 7b92517..aabc748 100644 --- a/src/models/group_role.rs +++ b/src/models/group_role.rs @@ -9,20 +9,20 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupRole { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "isSelfAssignable", skip_serializing_if = "Option::is_none")] pub is_self_assignable: Option, #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option>, + pub permissions: Option>>, #[serde(rename = "isManagementRole", skip_serializing_if = "Option::is_none")] pub is_management_role: Option, #[serde(rename = "requiresTwoFactor", skip_serializing_if = "Option::is_none")] @@ -32,9 +32,9 @@ pub struct GroupRole { #[serde(rename = "order", skip_serializing_if = "Option::is_none")] pub order: Option, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, + pub updated_at: Option>, } impl GroupRole { diff --git a/src/models/info_push.rs b/src/models/info_push.rs index 4820756..03ad4d2 100644 --- a/src/models/info_push.rs +++ b/src/models/info_push.rs @@ -10,10 +10,10 @@ use crate::models; use serde::{Deserialize, Serialize}; /// InfoPush : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InfoPush { #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "isEnabled")] pub is_enabled: bool, #[serde(rename = "releaseStatus")] @@ -21,24 +21,24 @@ pub struct InfoPush { #[serde(rename = "priority")] pub priority: i32, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "data")] pub data: Box, /// Unknown usage, MD5 #[serde(rename = "hash")] - pub hash: String, + pub hash: std::sync::Arc, #[serde(rename = "createdAt")] - pub created_at: String, + pub created_at: std::sync::Arc, #[serde(rename = "updatedAt")] - pub updated_at: String, + pub updated_at: std::sync::Arc, #[serde(rename = "startDate", skip_serializing_if = "Option::is_none")] - pub start_date: Option, + pub start_date: Option>, #[serde(rename = "endDate", skip_serializing_if = "Option::is_none")] - pub end_date: Option, + pub end_date: Option>, } impl InfoPush { - pub fn new(id: String, is_enabled: bool, release_status: models::ReleaseStatus, priority: i32, tags: Vec, data: models::InfoPushData, hash: String, created_at: String, updated_at: String) -> InfoPush { + pub fn new(id: std::sync::Arc, is_enabled: bool, release_status: models::ReleaseStatus, priority: i32, tags: Vec, data: models::InfoPushData, hash: std::sync::Arc, created_at: std::sync::Arc, updated_at: std::sync::Arc) -> InfoPush { InfoPush { id, is_enabled, diff --git a/src/models/info_push_data.rs b/src/models/info_push_data.rs index a1327b9..0512883 100644 --- a/src/models/info_push_data.rs +++ b/src/models/info_push_data.rs @@ -10,22 +10,22 @@ use crate::models; use serde::{Deserialize, Serialize}; /// InfoPushData : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InfoPushData { #[serde(rename = "contentList", skip_serializing_if = "Option::is_none")] pub content_list: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")] - pub image_url: Option, + pub image_url: Option>, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "onPressed", skip_serializing_if = "Option::is_none")] pub on_pressed: Option>, #[serde(rename = "template", skip_serializing_if = "Option::is_none")] - pub template: Option, + pub template: Option>, #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, + pub version: Option>, #[serde(rename = "article", skip_serializing_if = "Option::is_none")] pub article: Option>, } diff --git a/src/models/info_push_data_article.rs b/src/models/info_push_data_article.rs index 0970fe1..eafc21a 100644 --- a/src/models/info_push_data_article.rs +++ b/src/models/info_push_data_article.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InfoPushDataArticle { #[serde(rename = "content", skip_serializing_if = "Option::is_none")] pub content: Option>, diff --git a/src/models/info_push_data_article_content.rs b/src/models/info_push_data_article_content.rs index 1780437..1499d4d 100644 --- a/src/models/info_push_data_article_content.rs +++ b/src/models/info_push_data_article_content.rs @@ -9,12 +9,12 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InfoPushDataArticleContent { #[serde(rename = "text", skip_serializing_if = "Option::is_none")] - pub text: Option, + pub text: Option>, #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")] - pub image_url: Option, + pub image_url: Option>, #[serde(rename = "onPressed", skip_serializing_if = "Option::is_none")] pub on_pressed: Option>, } diff --git a/src/models/info_push_data_clickable.rs b/src/models/info_push_data_clickable.rs index a736f90..61ae3b5 100644 --- a/src/models/info_push_data_clickable.rs +++ b/src/models/info_push_data_clickable.rs @@ -9,13 +9,13 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InfoPushDataClickable { #[serde(rename = "command")] pub command: Command, /// In case of OpenURL, this would contain the link. #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] - pub parameters: Option>, + pub parameters: Option>>, } impl InfoPushDataClickable { diff --git a/src/models/instance.rs b/src/models/instance.rs index 4e4e107..0f8144c 100644 --- a/src/models/instance.rs +++ b/src/models/instance.rs @@ -10,7 +10,7 @@ use crate::models; use serde::{Deserialize, Serialize}; /// Instance : * `hidden` field is only present if InstanceType is `hidden` aka \"Friends+\", and is instance creator. * `friends` field is only present if InstanceType is `friends` aka \"Friends\", and is instance creator. * `private` field is only present if InstanceType is `private` aka \"Invite\" or \"Invite+\", and is instance creator. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Instance { #[serde(rename = "active")] pub active: bool, @@ -20,24 +20,24 @@ pub struct Instance { pub capacity: i32, /// Always returns \"unknown\". #[serde(rename = "clientNumber")] - pub client_number: String, + pub client_number: std::sync::Arc, #[serde(rename = "full")] pub full: bool, /// InstanceID can be \"offline\" on User profiles if you are not friends with that user and \"private\" if you are friends and user is in private instance. #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "instanceId")] - pub instance_id: String, + pub instance_id: std::sync::Arc, /// InstanceID can be \"offline\" on User profiles if you are not friends with that user and \"private\" if you are friends and user is in private instance. #[serde(rename = "location")] - pub location: String, + pub location: std::sync::Arc, #[serde(rename = "n_users")] pub n_users: i32, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, /// A groupId if the instance type is \"group\", null if instance type is public, or a userId otherwise #[serde(rename = "ownerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub owner_id: Option>, + pub owner_id: Option>>, #[serde(rename = "permanent")] pub permanent: bool, #[serde(rename = "photonRegion")] @@ -47,26 +47,26 @@ pub struct Instance { #[serde(rename = "region")] pub region: models::InstanceRegion, #[serde(rename = "secureName")] - pub secure_name: String, + pub secure_name: std::sync::Arc, #[serde(rename = "shortName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub short_name: Option>, + pub short_name: Option>>, /// The tags array on Instances usually contain the language tags of the people in the instance. #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "type")] pub r#type: models::InstanceType, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "worldId")] - pub world_id: String, + pub world_id: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "hidden", skip_serializing_if = "Option::is_none")] - pub hidden: Option, + pub hidden: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "friends", skip_serializing_if = "Option::is_none")] - pub friends: Option, + pub friends: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "private", skip_serializing_if = "Option::is_none")] - pub private: Option, + pub private: Option>, #[serde(rename = "queueEnabled")] pub queue_enabled: bool, #[serde(rename = "queueSize")] @@ -89,16 +89,16 @@ pub struct Instance { #[serde(rename = "hasCapacityForYou", skip_serializing_if = "Option::is_none")] pub has_capacity_for_you: Option, #[serde(rename = "nonce", skip_serializing_if = "Option::is_none")] - pub nonce: Option, + pub nonce: Option>, #[serde(rename = "closedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub closed_at: Option>, + pub closed_at: Option>>, #[serde(rename = "hardClose", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub hard_close: Option>, } impl Instance { /// * `hidden` field is only present if InstanceType is `hidden` aka \"Friends+\", and is instance creator. * `friends` field is only present if InstanceType is `friends` aka \"Friends\", and is instance creator. * `private` field is only present if InstanceType is `private` aka \"Invite\" or \"Invite+\", and is instance creator. - pub fn new(active: bool, can_request_invite: bool, capacity: i32, client_number: String, full: bool, id: String, instance_id: String, location: String, n_users: i32, name: String, permanent: bool, photon_region: models::Region, platforms: models::InstancePlatforms, region: models::InstanceRegion, secure_name: String, tags: Vec, r#type: models::InstanceType, world_id: String, queue_enabled: bool, queue_size: i32, recommended_capacity: i32, strict: bool, user_count: i32, world: models::World) -> Instance { + pub fn new(active: bool, can_request_invite: bool, capacity: i32, client_number: std::sync::Arc, full: bool, id: std::sync::Arc, instance_id: std::sync::Arc, location: std::sync::Arc, n_users: i32, name: std::sync::Arc, permanent: bool, photon_region: models::Region, platforms: models::InstancePlatforms, region: models::InstanceRegion, secure_name: std::sync::Arc, tags: Vec, r#type: models::InstanceType, world_id: std::sync::Arc, queue_enabled: bool, queue_size: i32, recommended_capacity: i32, strict: bool, user_count: i32, world: models::World) -> Instance { Instance { active, can_request_invite, diff --git a/src/models/instance_platforms.rs b/src/models/instance_platforms.rs index 4d65645..f43e59d 100644 --- a/src/models/instance_platforms.rs +++ b/src/models/instance_platforms.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InstancePlatforms { #[serde(rename = "android")] pub android: i32, diff --git a/src/models/instance_short_name_response.rs b/src/models/instance_short_name_response.rs index 78240ba..d5c8bea 100644 --- a/src/models/instance_short_name_response.rs +++ b/src/models/instance_short_name_response.rs @@ -9,16 +9,16 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InstanceShortNameResponse { #[serde(rename = "secureName")] - pub secure_name: String, + pub secure_name: std::sync::Arc, #[serde(rename = "shortName", skip_serializing_if = "Option::is_none")] - pub short_name: Option, + pub short_name: Option>, } impl InstanceShortNameResponse { - pub fn new(secure_name: String) -> InstanceShortNameResponse { + pub fn new(secure_name: std::sync::Arc) -> InstanceShortNameResponse { InstanceShortNameResponse { secure_name, short_name: None, diff --git a/src/models/invite_message.rs b/src/models/invite_message.rs index 3943e90..60ccc58 100644 --- a/src/models/invite_message.rs +++ b/src/models/invite_message.rs @@ -10,14 +10,14 @@ use crate::models; use serde::{Deserialize, Serialize}; /// InviteMessage : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InviteMessage { #[serde(rename = "canBeUpdated")] pub can_be_updated: bool, #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "message")] - pub message: String, + pub message: std::sync::Arc, #[serde(rename = "messageType")] pub message_type: models::InviteMessageType, /// Changes to 60 when updated, although probably server-side configurable. @@ -26,11 +26,11 @@ pub struct InviteMessage { #[serde(rename = "slot")] pub slot: i32, #[serde(rename = "updatedAt")] - pub updated_at: String, + pub updated_at: std::sync::Arc, } impl InviteMessage { - pub fn new(can_be_updated: bool, id: String, message: String, message_type: models::InviteMessageType, remaining_cooldown_minutes: i32, slot: i32, updated_at: String) -> InviteMessage { + pub fn new(can_be_updated: bool, id: std::sync::Arc, message: std::sync::Arc, message_type: models::InviteMessageType, remaining_cooldown_minutes: i32, slot: i32, updated_at: std::sync::Arc) -> InviteMessage { InviteMessage { can_be_updated, id, diff --git a/src/models/invite_request.rs b/src/models/invite_request.rs index 99e045c..0db6374 100644 --- a/src/models/invite_request.rs +++ b/src/models/invite_request.rs @@ -9,17 +9,17 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InviteRequest { /// InstanceID can be \"offline\" on User profiles if you are not friends with that user and \"private\" if you are friends and user is in private instance. #[serde(rename = "instanceId")] - pub instance_id: String, + pub instance_id: std::sync::Arc, #[serde(rename = "messageSlot", skip_serializing_if = "Option::is_none")] pub message_slot: Option, } impl InviteRequest { - pub fn new(instance_id: String) -> InviteRequest { + pub fn new(instance_id: std::sync::Arc) -> InviteRequest { InviteRequest { instance_id, message_slot: None, diff --git a/src/models/invite_response.rs b/src/models/invite_response.rs index ede5719..b87ff5c 100644 --- a/src/models/invite_response.rs +++ b/src/models/invite_response.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InviteResponse { #[serde(rename = "responseSlot")] pub response_slot: i32, diff --git a/src/models/license.rs b/src/models/license.rs index d4252b5..1ad2658 100644 --- a/src/models/license.rs +++ b/src/models/license.rs @@ -9,21 +9,21 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct License { /// Either a AvatarID, LicenseGroupID, PermissionID or ProductID. This depends on the `forType` field. #[serde(rename = "forId")] - pub for_id: String, + pub for_id: std::sync::Arc, #[serde(rename = "forType")] pub for_type: models::LicenseType, #[serde(rename = "forName")] - pub for_name: String, + pub for_name: std::sync::Arc, #[serde(rename = "forAction")] pub for_action: models::LicenseAction, } impl License { - pub fn new(for_id: String, for_type: models::LicenseType, for_name: String, for_action: models::LicenseAction) -> License { + pub fn new(for_id: std::sync::Arc, for_type: models::LicenseType, for_name: std::sync::Arc, for_action: models::LicenseAction) -> License { License { for_id, for_type, diff --git a/src/models/license_group.rs b/src/models/license_group.rs index 1759e7e..780e6ff 100644 --- a/src/models/license_group.rs +++ b/src/models/license_group.rs @@ -10,20 +10,20 @@ use crate::models; use serde::{Deserialize, Serialize}; /// LicenseGroup : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LicenseGroup { #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, #[serde(rename = "description")] - pub description: String, + pub description: std::sync::Arc, #[serde(rename = "licenses")] pub licenses: Vec, } impl LicenseGroup { - pub fn new(id: String, name: String, description: String, licenses: Vec) -> LicenseGroup { + pub fn new(id: std::sync::Arc, name: std::sync::Arc, description: std::sync::Arc, licenses: Vec) -> LicenseGroup { LicenseGroup { id, name, diff --git a/src/models/limited_group.rs b/src/models/limited_group.rs index 59df18f..90cf9c2 100644 --- a/src/models/limited_group.rs +++ b/src/models/limited_group.rs @@ -9,37 +9,37 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitedGroup { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "shortCode", skip_serializing_if = "Option::is_none")] - pub short_code: Option, + pub short_code: Option>, #[serde(rename = "discriminator", skip_serializing_if = "Option::is_none")] - pub discriminator: Option, + pub discriminator: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "iconUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_url: Option>, + pub icon_url: Option>>, #[serde(rename = "bannerUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_url: Option>, + pub banner_url: Option>>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "ownerId", skip_serializing_if = "Option::is_none")] - pub owner_id: Option, + pub owner_id: Option>, #[serde(rename = "rules", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub rules: Option>, + pub rules: Option>>, #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_id: Option>, + pub icon_id: Option>>, #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_id: Option>, + pub banner_id: Option>>, #[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")] pub member_count: Option, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] pub membership_status: Option, #[serde(rename = "isSearchable", skip_serializing_if = "Option::is_none")] diff --git a/src/models/limited_unity_package.rs b/src/models/limited_unity_package.rs index d671080..aee948f 100644 --- a/src/models/limited_unity_package.rs +++ b/src/models/limited_unity_package.rs @@ -10,17 +10,17 @@ use crate::models; use serde::{Deserialize, Serialize}; /// LimitedUnityPackage : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitedUnityPackage { /// This can be `standalonewindows` or `android`, but can also pretty much be any random Unity verison such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. #[serde(rename = "platform")] - pub platform: String, + pub platform: std::sync::Arc, #[serde(rename = "unityVersion")] - pub unity_version: String, + pub unity_version: std::sync::Arc, } impl LimitedUnityPackage { - pub fn new(platform: String, unity_version: String) -> LimitedUnityPackage { + pub fn new(platform: std::sync::Arc, unity_version: std::sync::Arc) -> LimitedUnityPackage { LimitedUnityPackage { platform, unity_version, diff --git a/src/models/limited_user.rs b/src/models/limited_user.rs index d444f30..7af36d9 100644 --- a/src/models/limited_user.rs +++ b/src/models/limited_user.rs @@ -10,58 +10,58 @@ use crate::models; use serde::{Deserialize, Serialize}; /// LimitedUser : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitedUser { #[serde(rename = "bio", skip_serializing_if = "Option::is_none")] - pub bio: Option, + pub bio: Option>, #[serde(rename = "bioLinks", skip_serializing_if = "Option::is_none")] - pub bio_links: Option>, + pub bio_links: Option>>, /// When profilePicOverride is not empty, use it instead. #[serde(rename = "currentAvatarImageUrl", skip_serializing_if = "Option::is_none")] - pub current_avatar_image_url: Option, + pub current_avatar_image_url: Option>, /// When profilePicOverride is not empty, use it instead. #[serde(rename = "currentAvatarThumbnailImageUrl", skip_serializing_if = "Option::is_none")] - pub current_avatar_thumbnail_image_url: Option, + pub current_avatar_thumbnail_image_url: Option>, #[serde(rename = "currentAvatarTags", skip_serializing_if = "Option::is_none")] - pub current_avatar_tags: Option>, + pub current_avatar_tags: Option>>, #[serde(rename = "developerType")] pub developer_type: models::DeveloperType, #[serde(rename = "displayName")] - pub display_name: String, + pub display_name: std::sync::Arc, #[serde(rename = "fallbackAvatar", skip_serializing_if = "Option::is_none")] - pub fallback_avatar: Option, + pub fallback_avatar: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "isFriend")] pub is_friend: bool, /// This can be `standalonewindows` or `android`, but can also pretty much be any random Unity verison such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. #[serde(rename = "last_platform")] - pub last_platform: String, + pub last_platform: std::sync::Arc, #[serde(rename = "profilePicOverride", skip_serializing_if = "Option::is_none")] - pub profile_pic_override: Option, + pub profile_pic_override: Option>, #[serde(rename = "pronouns", skip_serializing_if = "Option::is_none")] - pub pronouns: Option, + pub pronouns: Option>, #[serde(rename = "status")] pub status: models::UserStatus, #[serde(rename = "statusDescription")] - pub status_description: String, + pub status_description: std::sync::Arc, /// <- Always empty. #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "userIcon", skip_serializing_if = "Option::is_none")] - pub user_icon: Option, + pub user_icon: Option>, /// -| **DEPRECATED:** VRChat API no longer return usernames of other users. [See issue by Tupper for more information](https://github.com/pypy-vrc/VRCX/issues/429). #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, + pub username: Option>, #[serde(rename = "location", skip_serializing_if = "Option::is_none")] - pub location: Option, + pub location: Option>, #[serde(rename = "friendKey", skip_serializing_if = "Option::is_none")] - pub friend_key: Option, + pub friend_key: Option>, } impl LimitedUser { - pub fn new(developer_type: models::DeveloperType, display_name: String, id: String, is_friend: bool, last_platform: String, status: models::UserStatus, status_description: String, tags: Vec) -> LimitedUser { + pub fn new(developer_type: models::DeveloperType, display_name: std::sync::Arc, id: std::sync::Arc, is_friend: bool, last_platform: std::sync::Arc, status: models::UserStatus, status_description: std::sync::Arc, tags: Vec) -> LimitedUser { LimitedUser { bio: None, bio_links: None, diff --git a/src/models/limited_user_groups.rs b/src/models/limited_user_groups.rs index df37168..08dd67b 100644 --- a/src/models/limited_user_groups.rs +++ b/src/models/limited_user_groups.rs @@ -9,45 +9,45 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitedUserGroups { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "shortCode", skip_serializing_if = "Option::is_none")] - pub short_code: Option, + pub short_code: Option>, #[serde(rename = "discriminator", skip_serializing_if = "Option::is_none")] - pub discriminator: Option, + pub discriminator: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_id: Option>, + pub icon_id: Option>>, #[serde(rename = "iconUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_url: Option>, + pub icon_url: Option>>, #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_id: Option>, + pub banner_id: Option>>, #[serde(rename = "bannerUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_url: Option>, + pub banner_url: Option>>, #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")] - pub privacy: Option, + pub privacy: Option>, #[serde(rename = "lastPostCreatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub last_post_created_at: Option>, + pub last_post_created_at: Option>>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "ownerId", skip_serializing_if = "Option::is_none")] - pub owner_id: Option, + pub owner_id: Option>, #[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")] pub member_count: Option, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, #[serde(rename = "memberVisibility", skip_serializing_if = "Option::is_none")] - pub member_visibility: Option, + pub member_visibility: Option>, #[serde(rename = "isRepresenting", skip_serializing_if = "Option::is_none")] pub is_representing: Option, #[serde(rename = "mutualGroup", skip_serializing_if = "Option::is_none")] pub mutual_group: Option, #[serde(rename = "lastPostReadAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub last_post_read_at: Option>, + pub last_post_read_at: Option>>, } impl LimitedUserGroups { diff --git a/src/models/limited_world.rs b/src/models/limited_world.rs index de89bac..1090178 100644 --- a/src/models/limited_world.rs +++ b/src/models/limited_world.rs @@ -10,19 +10,19 @@ use crate::models; use serde::{Deserialize, Serialize}; /// LimitedWorld : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitedWorld { /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "authorId")] - pub author_id: String, + pub author_id: std::sync::Arc, #[serde(rename = "authorName")] - pub author_name: String, + pub author_name: std::sync::Arc, #[serde(rename = "capacity")] pub capacity: i32, #[serde(rename = "recommendedCapacity", skip_serializing_if = "Option::is_none")] pub recommended_capacity: Option, #[serde(rename = "created_at")] - pub created_at: String, + pub created_at: std::sync::Arc, #[serde(rename = "favorites")] pub favorites: i32, #[serde(rename = "visits", skip_serializing_if = "Option::is_none")] @@ -31,39 +31,39 @@ pub struct LimitedWorld { pub heat: i32, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "imageUrl")] - pub image_url: String, + pub image_url: std::sync::Arc, #[serde(rename = "labsPublicationDate")] - pub labs_publication_date: String, + pub labs_publication_date: std::sync::Arc, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, #[serde(rename = "occupants")] pub occupants: i32, #[serde(rename = "organization")] - pub organization: String, + pub organization: std::sync::Arc, #[serde(rename = "popularity")] pub popularity: i32, #[serde(rename = "previewYoutubeId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub preview_youtube_id: Option>, + pub preview_youtube_id: Option>>, #[serde(rename = "publicationDate")] - pub publication_date: String, + pub publication_date: std::sync::Arc, #[serde(rename = "releaseStatus")] pub release_status: models::ReleaseStatus, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "thumbnailImageUrl")] - pub thumbnail_image_url: String, + pub thumbnail_image_url: std::sync::Arc, #[serde(rename = "unityPackages")] pub unity_packages: Vec, #[serde(rename = "updated_at")] - pub updated_at: String, + pub updated_at: std::sync::Arc, #[serde(rename = "udonProducts", skip_serializing_if = "Option::is_none")] - pub udon_products: Option>, + pub udon_products: Option>>, } impl LimitedWorld { - pub fn new(author_id: String, author_name: String, capacity: i32, created_at: String, favorites: i32, heat: i32, id: String, image_url: String, labs_publication_date: String, name: String, occupants: i32, organization: String, popularity: i32, publication_date: String, release_status: models::ReleaseStatus, tags: Vec, thumbnail_image_url: String, unity_packages: Vec, updated_at: String) -> LimitedWorld { + pub fn new(author_id: std::sync::Arc, author_name: std::sync::Arc, capacity: i32, created_at: std::sync::Arc, favorites: i32, heat: i32, id: std::sync::Arc, image_url: std::sync::Arc, labs_publication_date: std::sync::Arc, name: std::sync::Arc, occupants: i32, organization: std::sync::Arc, popularity: i32, publication_date: std::sync::Arc, release_status: models::ReleaseStatus, tags: Vec, thumbnail_image_url: std::sync::Arc, unity_packages: Vec, updated_at: std::sync::Arc) -> LimitedWorld { LimitedWorld { author_id, author_name, diff --git a/src/models/mod.rs b/src/models/mod.rs index 7a6c28e..489b472 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -278,3 +278,4 @@ pub mod world_metadata; pub use self::world_metadata::WorldMetadata; pub mod world_publish_status; pub use self::world_publish_status::WorldPublishStatus; +pub mod tags; diff --git a/src/models/moderate_user_request.rs b/src/models/moderate_user_request.rs index 298a5fd..ed30f67 100644 --- a/src/models/moderate_user_request.rs +++ b/src/models/moderate_user_request.rs @@ -9,17 +9,17 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ModerateUserRequest { /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "moderated")] - pub moderated: String, + pub moderated: std::sync::Arc, #[serde(rename = "type")] pub r#type: models::PlayerModerationType, } impl ModerateUserRequest { - pub fn new(moderated: String, r#type: models::PlayerModerationType) -> ModerateUserRequest { + pub fn new(moderated: std::sync::Arc, r#type: models::PlayerModerationType) -> ModerateUserRequest { ModerateUserRequest { moderated, r#type, diff --git a/src/models/notification.rs b/src/models/notification.rs index 064d8b0..28a8a02 100644 --- a/src/models/notification.rs +++ b/src/models/notification.rs @@ -10,35 +10,35 @@ use crate::models; use serde::{Deserialize, Serialize}; /// Notification : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Notification { #[serde(rename = "created_at")] - pub created_at: String, + pub created_at: std::sync::Arc, /// **NOTICE:** This is not a JSON object when received from the REST API, but it is when received from the Websocket API. When received from the REST API, this is a json **encoded** object, meaning you have to json-de-encode to get the NotificationDetail object depending on the NotificationType. #[serde(rename = "details")] - pub details: String, + pub details: std::sync::Arc, #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "message")] - pub message: String, + pub message: std::sync::Arc, /// Not included in notification objects received from the Websocket API #[serde(rename = "seen", skip_serializing_if = "Option::is_none")] pub seen: Option, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "receiverUserId", skip_serializing_if = "Option::is_none")] - pub receiver_user_id: Option, + pub receiver_user_id: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "senderUserId")] - pub sender_user_id: String, + pub sender_user_id: std::sync::Arc, /// -| **DEPRECATED:** VRChat API no longer return usernames of other users. [See issue by Tupper for more information](https://github.com/pypy-vrc/VRCX/issues/429). #[serde(rename = "senderUsername", skip_serializing_if = "Option::is_none")] - pub sender_username: Option, + pub sender_username: Option>, #[serde(rename = "type")] pub r#type: models::NotificationType, } impl Notification { - pub fn new(created_at: String, details: String, id: String, message: String, sender_user_id: String, r#type: models::NotificationType) -> Notification { + pub fn new(created_at: std::sync::Arc, details: std::sync::Arc, id: std::sync::Arc, message: std::sync::Arc, sender_user_id: std::sync::Arc, r#type: models::NotificationType) -> Notification { Notification { created_at, details, diff --git a/src/models/notification_detail_invite.rs b/src/models/notification_detail_invite.rs index b4b6445..a4971fb 100644 --- a/src/models/notification_detail_invite.rs +++ b/src/models/notification_detail_invite.rs @@ -9,19 +9,19 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NotificationDetailInvite { #[serde(rename = "inviteMessage", skip_serializing_if = "Option::is_none")] - pub invite_message: Option, + pub invite_message: Option>, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "worldId")] - pub world_id: String, + pub world_id: std::sync::Arc, #[serde(rename = "worldName")] - pub world_name: String, + pub world_name: std::sync::Arc, } impl NotificationDetailInvite { - pub fn new(world_id: String, world_name: String) -> NotificationDetailInvite { + pub fn new(world_id: std::sync::Arc, world_name: std::sync::Arc) -> NotificationDetailInvite { NotificationDetailInvite { invite_message: None, world_id, diff --git a/src/models/notification_detail_invite_response.rs b/src/models/notification_detail_invite_response.rs index f231bcd..a2326c2 100644 --- a/src/models/notification_detail_invite_response.rs +++ b/src/models/notification_detail_invite_response.rs @@ -9,16 +9,16 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NotificationDetailInviteResponse { #[serde(rename = "inResponseTo")] - pub in_response_to: String, + pub in_response_to: std::sync::Arc, #[serde(rename = "responseMessage")] - pub response_message: String, + pub response_message: std::sync::Arc, } impl NotificationDetailInviteResponse { - pub fn new(in_response_to: String, response_message: String) -> NotificationDetailInviteResponse { + pub fn new(in_response_to: std::sync::Arc, response_message: std::sync::Arc) -> NotificationDetailInviteResponse { NotificationDetailInviteResponse { in_response_to, response_message, diff --git a/src/models/notification_detail_request_invite.rs b/src/models/notification_detail_request_invite.rs index 0c36c63..a11e862 100644 --- a/src/models/notification_detail_request_invite.rs +++ b/src/models/notification_detail_request_invite.rs @@ -9,14 +9,14 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NotificationDetailRequestInvite { /// TODO: Does this still exist? #[serde(rename = "platform", skip_serializing_if = "Option::is_none")] - pub platform: Option, + pub platform: Option>, /// Used when using InviteMessage Slot. #[serde(rename = "requestMessage", skip_serializing_if = "Option::is_none")] - pub request_message: Option, + pub request_message: Option>, } impl NotificationDetailRequestInvite { diff --git a/src/models/notification_detail_request_invite_response.rs b/src/models/notification_detail_request_invite_response.rs index d8c90bb..42fd467 100644 --- a/src/models/notification_detail_request_invite_response.rs +++ b/src/models/notification_detail_request_invite_response.rs @@ -9,17 +9,17 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NotificationDetailRequestInviteResponse { #[serde(rename = "inResponseTo")] - pub in_response_to: String, + pub in_response_to: std::sync::Arc, /// Used when using InviteMessage Slot. #[serde(rename = "requestMessage", skip_serializing_if = "Option::is_none")] - pub request_message: Option, + pub request_message: Option>, } impl NotificationDetailRequestInviteResponse { - pub fn new(in_response_to: String) -> NotificationDetailRequestInviteResponse { + pub fn new(in_response_to: std::sync::Arc) -> NotificationDetailRequestInviteResponse { NotificationDetailRequestInviteResponse { in_response_to, request_message: None, diff --git a/src/models/notification_detail_vote_to_kick.rs b/src/models/notification_detail_vote_to_kick.rs index 7352345..b5397d5 100644 --- a/src/models/notification_detail_vote_to_kick.rs +++ b/src/models/notification_detail_vote_to_kick.rs @@ -9,18 +9,18 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NotificationDetailVoteToKick { /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "initiatorUserId")] - pub initiator_user_id: String, + pub initiator_user_id: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "userToKickId")] - pub user_to_kick_id: String, + pub user_to_kick_id: std::sync::Arc, } impl NotificationDetailVoteToKick { - pub fn new(initiator_user_id: String, user_to_kick_id: String) -> NotificationDetailVoteToKick { + pub fn new(initiator_user_id: std::sync::Arc, user_to_kick_id: std::sync::Arc) -> NotificationDetailVoteToKick { NotificationDetailVoteToKick { initiator_user_id, user_to_kick_id, diff --git a/src/models/paginated_group_audit_log_entry_list.rs b/src/models/paginated_group_audit_log_entry_list.rs index c801d35..99c2643 100644 --- a/src/models/paginated_group_audit_log_entry_list.rs +++ b/src/models/paginated_group_audit_log_entry_list.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PaginatedGroupAuditLogEntryList { #[serde(rename = "results", skip_serializing_if = "Option::is_none")] pub results: Option>, diff --git a/src/models/past_display_name.rs b/src/models/past_display_name.rs index 62bdf29..143aacb 100644 --- a/src/models/past_display_name.rs +++ b/src/models/past_display_name.rs @@ -9,16 +9,16 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PastDisplayName { #[serde(rename = "displayName")] - pub display_name: String, + pub display_name: std::sync::Arc, #[serde(rename = "updated_at")] - pub updated_at: String, + pub updated_at: std::sync::Arc, } impl PastDisplayName { - pub fn new(display_name: String, updated_at: String) -> PastDisplayName { + pub fn new(display_name: std::sync::Arc, updated_at: std::sync::Arc) -> PastDisplayName { PastDisplayName { display_name, updated_at, diff --git a/src/models/permission.rs b/src/models/permission.rs index e37afd2..d4c6fda 100644 --- a/src/models/permission.rs +++ b/src/models/permission.rs @@ -10,23 +10,23 @@ use crate::models; use serde::{Deserialize, Serialize}; /// Permission : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Permission { #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "ownerDisplayName")] - pub owner_display_name: String, + pub owner_display_name: std::sync::Arc, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "ownerId")] - pub owner_id: String, + pub owner_id: std::sync::Arc, #[serde(rename = "data", skip_serializing_if = "Option::is_none")] pub data: Option, } impl Permission { - pub fn new(id: String, owner_display_name: String, name: String, owner_id: String) -> Permission { + pub fn new(id: std::sync::Arc, owner_display_name: std::sync::Arc, name: std::sync::Arc, owner_id: std::sync::Arc) -> Permission { Permission { id, owner_display_name, diff --git a/src/models/player_moderation.rs b/src/models/player_moderation.rs index 1b2082e..4dd1db1 100644 --- a/src/models/player_moderation.rs +++ b/src/models/player_moderation.rs @@ -9,28 +9,28 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PlayerModeration { #[serde(rename = "created")] - pub created: String, + pub created: std::sync::Arc, #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "sourceDisplayName")] - pub source_display_name: String, + pub source_display_name: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "sourceUserId")] - pub source_user_id: String, + pub source_user_id: std::sync::Arc, #[serde(rename = "targetDisplayName")] - pub target_display_name: String, + pub target_display_name: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "targetUserId")] - pub target_user_id: String, + pub target_user_id: std::sync::Arc, #[serde(rename = "type")] pub r#type: models::PlayerModerationType, } impl PlayerModeration { - pub fn new(created: String, id: String, source_display_name: String, source_user_id: String, target_display_name: String, target_user_id: String, r#type: models::PlayerModerationType) -> PlayerModeration { + pub fn new(created: std::sync::Arc, id: std::sync::Arc, source_display_name: std::sync::Arc, source_user_id: std::sync::Arc, target_display_name: std::sync::Arc, target_user_id: std::sync::Arc, r#type: models::PlayerModerationType) -> PlayerModeration { PlayerModeration { created, id, diff --git a/src/models/represented_group.rs b/src/models/represented_group.rs index 01ccd45..b1de54f 100644 --- a/src/models/represented_group.rs +++ b/src/models/represented_group.rs @@ -9,33 +9,33 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RepresentedGroup { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "shortCode", skip_serializing_if = "Option::is_none")] - pub short_code: Option, + pub short_code: Option>, #[serde(rename = "discriminator", skip_serializing_if = "Option::is_none")] - pub discriminator: Option, + pub discriminator: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_id: Option>, + pub icon_id: Option>>, #[serde(rename = "iconUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_url: Option>, + pub icon_url: Option>>, #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_id: Option>, + pub banner_id: Option>>, #[serde(rename = "bannerUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_url: Option>, + pub banner_url: Option>>, #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")] pub privacy: Option, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "ownerId", skip_serializing_if = "Option::is_none")] - pub owner_id: Option, + pub owner_id: Option>, #[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")] pub member_count: Option, #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] - pub group_id: Option, + pub group_id: Option>, #[serde(rename = "memberVisibility", skip_serializing_if = "Option::is_none")] pub member_visibility: Option, #[serde(rename = "isRepresenting", skip_serializing_if = "Option::is_none")] diff --git a/src/models/request_invite_request.rs b/src/models/request_invite_request.rs index c52de69..3ffcfe0 100644 --- a/src/models/request_invite_request.rs +++ b/src/models/request_invite_request.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RequestInviteRequest { #[serde(rename = "messageSlot", skip_serializing_if = "Option::is_none")] pub message_slot: Option, diff --git a/src/models/respond_group_join_request.rs b/src/models/respond_group_join_request.rs index bed29c9..0ca674c 100644 --- a/src/models/respond_group_join_request.rs +++ b/src/models/respond_group_join_request.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RespondGroupJoinRequest { #[serde(rename = "action")] pub action: models::GroupJoinRequestAction, diff --git a/src/models/response.rs b/src/models/response.rs index 7d72400..06d80c9 100644 --- a/src/models/response.rs +++ b/src/models/response.rs @@ -9,10 +9,10 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Response { #[serde(rename = "message", skip_serializing_if = "Option::is_none")] - pub message: Option, + pub message: Option>, #[serde(rename = "status_code")] pub status_code: i32, } diff --git a/src/models/sent_notification.rs b/src/models/sent_notification.rs index 07ba5ac..32bccdc 100644 --- a/src/models/sent_notification.rs +++ b/src/models/sent_notification.rs @@ -10,31 +10,31 @@ use crate::models; use serde::{Deserialize, Serialize}; /// SentNotification : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SentNotification { #[serde(rename = "created_at")] - pub created_at: String, + pub created_at: std::sync::Arc, #[serde(rename = "details")] pub details: serde_json::Value, #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "message")] - pub message: String, + pub message: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "receiverUserId")] - pub receiver_user_id: String, + pub receiver_user_id: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "senderUserId")] - pub sender_user_id: String, + pub sender_user_id: std::sync::Arc, /// -| **DEPRECATED:** VRChat API no longer return usernames of other users. [See issue by Tupper for more information](https://github.com/pypy-vrc/VRCX/issues/429). #[serde(rename = "senderUsername", skip_serializing_if = "Option::is_none")] - pub sender_username: Option, + pub sender_username: Option>, #[serde(rename = "type")] pub r#type: models::NotificationType, } impl SentNotification { - pub fn new(created_at: String, details: serde_json::Value, id: String, message: String, receiver_user_id: String, sender_user_id: String, r#type: models::NotificationType) -> SentNotification { + pub fn new(created_at: std::sync::Arc, details: serde_json::Value, id: std::sync::Arc, message: std::sync::Arc, receiver_user_id: std::sync::Arc, sender_user_id: std::sync::Arc, r#type: models::NotificationType) -> SentNotification { SentNotification { created_at, details, diff --git a/src/models/subscription.rs b/src/models/subscription.rs index aba7cc0..c66e116 100644 --- a/src/models/subscription.rs +++ b/src/models/subscription.rs @@ -10,24 +10,24 @@ use crate::models; use serde::{Deserialize, Serialize}; /// Subscription : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Subscription { #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "steamItemId")] - pub steam_item_id: String, + pub steam_item_id: std::sync::Arc, #[serde(rename = "oculusSku", skip_serializing_if = "Option::is_none")] - pub oculus_sku: Option, + pub oculus_sku: Option>, #[serde(rename = "googleProductId", skip_serializing_if = "Option::is_none")] - pub google_product_id: Option, + pub google_product_id: Option>, #[serde(rename = "googlePlanId", skip_serializing_if = "Option::is_none")] - pub google_plan_id: Option, + pub google_plan_id: Option>, #[serde(rename = "picoSku", skip_serializing_if = "Option::is_none")] - pub pico_sku: Option, + pub pico_sku: Option>, #[serde(rename = "amount")] pub amount: f64, #[serde(rename = "description")] - pub description: String, + pub description: std::sync::Arc, #[serde(rename = "period")] pub period: models::SubscriptionPeriod, #[serde(rename = "tier")] @@ -35,7 +35,7 @@ pub struct Subscription { } impl Subscription { - pub fn new(id: String, steam_item_id: String, amount: f64, description: String, period: models::SubscriptionPeriod, tier: f64) -> Subscription { + pub fn new(id: std::sync::Arc, steam_item_id: std::sync::Arc, amount: f64, description: std::sync::Arc, period: models::SubscriptionPeriod, tier: f64) -> Subscription { Subscription { id, steam_item_id, diff --git a/src/models/success.rs b/src/models/success.rs index 4e52df7..1244772 100644 --- a/src/models/success.rs +++ b/src/models/success.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Success { #[serde(rename = "success", skip_serializing_if = "Option::is_none")] pub success: Option>, diff --git a/src/models/tags.rs b/src/models/tags.rs new file mode 100644 index 0000000..0e9700d --- /dev/null +++ b/src/models/tags.rs @@ -0,0 +1,1059 @@ +use std::fmt::{Display, Formatter}; +use std::sync::Arc; +use serde::{Deserialize, Serialize}; +macro_rules! impl_into_str { + ($type_from:ty, $type_to:ty) => { +impl From<&$type_from> for $type_to{ + fn from(value: &$type_from) -> Self { + value.get_tag() + } +} +impl From<$type_from> for $type_to{ + fn from(value: $type_from) -> Self { + value.get_tag() + } +} + }; +} +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(try_from = "&str", into = "String")] +pub enum Tags{ + ///User Tag + ///Instance Tag + Language(LanguageTags), + ///User Tag + Show(ShowTags), + ///Avatar Tag + ///World Tag + Content(ContentTags), + ///User Tag + Admin(AdminTags), + ///World Tag + Author(AuthorTags), + ///World Debugging has been enabled by author, allowing to see state of triggers + ///World Tag + DebugAllowed, + //Favorite Group Start + Group(String), + World(String), + Avatars(String), + //Favorite Group end + ///User Tag + System(SystemTags), + ///other (mostly fun or undocumented) tags, such as: "system_neuralink_beta", "ඞ", "'; DROP DATABASE tags; --", "we've been trying to reach you about your car's extended warranty" and others. + Other(Arc) +} +impl Tags{ + pub fn get_tag(&self) -> String { + match self { + Tags::Language(language) => format!("language_{}", language.get_tag()), + Tags::Show(show) => format!("show_{}", show.get_tag()), + Tags::Content(content) => format!("content_{}", content.get_tag()), + Tags::Admin(admin) => format!("admin_{}", admin.get_tag()), + Tags::Author(author) => format!("author_{}", author.get_tag()), + Tags::DebugAllowed => "debug_allowed".to_string(), + Tags::Group(group) => format!("group_{group}"), + Tags::World(world) => format!("worlds{world}"), + Tags::Avatars(avatar) => format!("avatars{avatar}"), + Tags::System(system) => format!("system_{}", system.get_tag()), + Tags::Other(other) => other.to_string() + } + } +} + +impl Display for Tags { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Self::Language(language) => write!(f, "Language: {language}"), + Self::Show(show) => write!(f, "Show: {show}"), + Self::Content(content) => write!(f, "Content Warning: {content}"), + Self::Admin(admin) => write!(f, "Admin: {admin}"), + Self::Author(author) => write!(f, "Author: {author}"), + Self::Group(i) => write!(f, "User: {i}"), + Self::DebugAllowed => write!(f, "World Debugging Allowed"), + Self::World(i) => write!(f, "World: {i}"), + Self::Avatars(i) => write!(f, "Avatars: {i}"), + Self::System(system) => write!(f, "System: {system}"), + Tags::Other(other) => write!(f, "Other: {other}"), + } + } +} + +impl<'a> core::convert::From<&'a str> for Tags{ + fn from(value: &'a str) -> Self { + if let Some(lang) = value.strip_prefix("language_"){ + Self::Language(LanguageTags::from(lang)) + } else if let Some(system) = value.strip_prefix("system_"){ + match core::convert::TryFrom::try_from(system) { + Ok(tag) => Self::System(tag), + Err(_) => Self::Other(Arc::from(value)), + } + } else if let Some(show) = value.strip_prefix("show_"){ + match core::convert::TryFrom::try_from(show) { + Ok(tag) => Self::Show(tag), + Err(_) => Self::Other(Arc::from(value)), + } + } else if let Some(content) = value.strip_prefix("content_"){ + match core::convert::TryFrom::try_from(content) { + Ok(tag) => Self::Content(tag), + Err(_) => Self::Other(Arc::from(value)), + } + }else if let Some(admin) = value.strip_prefix("admin_"){ + Self::Admin(AdminTags::from(admin)) + }else if let Some(author) = value.strip_prefix("author_"){ + Self::Author(AuthorTags::from(author)) + }else if let Some(group) = value.strip_prefix("group_"){ + Self::Group(group.to_string()) + }else if let Some(world) = value.strip_prefix("worlds"){ + Self::World(world.to_string()) + }else if let Some(avatar) = value.strip_prefix("avatars"){ + Self::Avatars(avatar.to_string()) + } else { + match value{ + "debug_allowed" => Self::DebugAllowed, + other => { + log::error!("New or Fun Tag: {other}"); + Self::Other(Arc::from(other)) + } + } + } + } +} +impl_into_str!(Tags, String); + +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(from = "&str", into = "String")] +pub enum LanguageTags{ + ///English / English + English, + ///한국어 / Korean + Korean, + ///Русский / Russian + Russian, + ///Español / Spanish + Spanish, + ///Português / Portuguese + Portuguese, + ///中文 / Chinese + Chinese, + ///Deutsch / German + German, + ///日本語 / Japanese + Japanese, + ///Français / French + French, + ///Svenska / Swedish + Swedish, + ///Nederlands / Dutch + Dutch, + ///Polski / Polish + Polish, + ///Dansk / Danish + Danish, + ///Norsk / Norwegian + Norwegian, + ///Italiano / Italian + Italian, + ///ภาษาไทย / Thai + Thai, + ///Suomi / Finnish + Finnish, + ///Magyar / Hungarian + Hungarian, + ///Čeština / Czech + Czech, + ///Türkçe / Turkish + Turkish, + ///العربية / Arabic + Arabic, + ///Română / Romanian + Romanian, + ///Tiếng Việt / Vietnamese + Vietnamese, + ///American Sign Language + AmericanSignLanguage, + ///British Sign Language + BritishSignLanguage, + ///Dutch Sign Language + DutchSignLanguage, + ///French Sign Language + FrenchSignLanguage, + ///Korean Sign Language + KoreanSignLanguage, + ///Other Undocumented Languages + Other(Arc), +} + +impl LanguageTags{ + pub fn get_tag(&self) -> String { + match self { + Self::English => "eng".to_string(), + Self::Korean => "kor".to_string(), + Self::Russian => "rus".to_string(), + Self::Spanish => "spa".to_string(), + Self::Portuguese => "por".to_string(), + Self::Chinese => "zho".to_string(), + Self::German => "deu".to_string(), + Self::Japanese => "jpn".to_string(), + Self::French => "fra".to_string(), + Self::Swedish => "swe".to_string(), + Self::Dutch => "nld".to_string(), + Self::Polish => "pol".to_string(), + Self::Danish => "dan".to_string(), + Self::Norwegian => "nor".to_string(), + Self::Italian => "ita".to_string(), + Self::Thai => "tha".to_string(), + Self::Finnish => "fin".to_string(), + Self::Hungarian => "hun".to_string(), + Self::Czech => "ces".to_string(), + Self::Turkish => "tur".to_string(), + Self::Arabic => "ara".to_string(), + Self::Romanian => "ron".to_string(), + Self::Vietnamese => "vie".to_string(), + Self::AmericanSignLanguage => "ase".to_string(), + Self::BritishSignLanguage => "bfi".to_string(), + Self::DutchSignLanguage => "dse".to_string(), + Self::FrenchSignLanguage => "fsl".to_string(), + Self::KoreanSignLanguage => "kvk".to_string(), + Self::Other(other) => other.to_string(), + } + } +} + +impl Display for LanguageTags{ + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self{ + Self::English => write!(f, "English / English"), + Self::Korean => write!(f, "한국어 / Korean"), + Self::Russian => write!(f, "Русский / Russian"), + Self::Spanish => write!(f, "Español / Spanish"), + Self::Portuguese => write!(f, "Português / Portuguese"), + Self::Chinese => write!(f, "中文 / Chinese"), + Self::German => write!(f, "Deutsch / German"), + Self::Japanese => write!(f, "日本語 / Japanese"), + Self::French => write!(f, "Français / French"), + Self::Swedish => write!(f, "Svenska / Swedish"), + Self::Dutch => write!(f, "Nederlands / Dutch"), + Self::Polish => write!(f, "Polski / Polish"), + Self::Danish => write!(f, "Dansk / Danish"), + Self::Norwegian => write!(f, "Norsk / Norwegian"), + Self::Italian => write!(f, "Italiano / Italian"), + Self::Thai => write!(f, "ภาษาไทย / Thai"), + Self::Finnish => write!(f, "Suomi / Finnish"), + Self::Hungarian => write!(f, "Magyar / Hungarian"), + Self::Czech => write!(f, "Čeština / Czech"), + Self::Turkish => write!(f, "Türkçe / Turkish"), + Self::Arabic => write!(f, "العربية / Arabic"), + Self::Romanian => write!(f, "Română / Romanian"), + Self::Vietnamese => write!(f, "Tiếng Việt / Vietnamese"), + Self::AmericanSignLanguage => write!(f, "American Sign Language"), + Self::BritishSignLanguage => write!(f, "British Sign Language"), + Self::DutchSignLanguage => write!(f, "Dutch Sign Language"), + Self::FrenchSignLanguage => write!(f, "French Sign Language"), + Self::KoreanSignLanguage => write!(f, "Korean Sign Language"), + Self::Other(other) => write!(f, "Other: {other}"), + } + } +} +impl<'a> core::convert::From<&'a str> for LanguageTags{ + fn from(value: &'a str) -> Self { + match value { + "eng" => Self::English, + "kor" => Self::Korean, + "rus" => Self::Russian, + "spa" => Self::Spanish, + "por" => Self::Portuguese, + "zho" => Self::Chinese, + "deu" => Self::German, + "jpn" => Self::Japanese, + "fra" => Self::French, + "swe" => Self::Swedish, + "nld" => Self::Dutch, + "pol" => Self::Polish, + "dan" => Self::Danish, + "nor" => Self::Norwegian, + "ita" => Self::Italian, + "tha" => Self::Thai, + "fin" => Self::Finnish, + "hun" => Self::Hungarian, + "ces" => Self::Czech, + "tur" => Self::Turkish, + "ara" => Self::Arabic, + "ron" => Self::Romanian, + "vie" => Self::Vietnamese, + "ase" => Self::AmericanSignLanguage, + "bfi" => Self::BritishSignLanguage, + "dse" => Self::DutchSignLanguage, + "fsl" => Self::FrenchSignLanguage, + "kvk" => Self::KoreanSignLanguage, + other => Self::Other(Arc::from(other)), + } + } +} +impl_into_str!(LanguageTags, String); +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(try_from = "&str", into = "&str")] +pub enum ShowTags{ + ///Toggle whether to show the user’s real social rank + /// (Deprecated: This is now a registry key and sent over Photon) + ///User Tag + #[deprecated] + SocialRank, + ///Toggle whether to show the Red Staff nameplate + ///User Tag + ModTag, +} + +impl ShowTags{ + pub const fn get_tag(&self) -> &'static str { + match self { + #[allow(deprecated)] + Self::SocialRank => "social_rank", + Self::ModTag => "mod_tag", + } + } +} + +impl Display for ShowTags{ + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self{ + #[allow(deprecated)] + Self::SocialRank => write!(f, "Show Social Rank"), + Self::ModTag => write!(f, "Show Mod Tag"), + } + } +} +impl<'a> core::convert::TryFrom<&'a str> for ShowTags{ + type Error = &'a str; + fn try_from(value: &'a str) -> Result { + match value { + #[allow(deprecated)] + "social_rank" => Ok(Self::SocialRank), + "mod_tag" => Ok(Self::ModTag), + other => { + log::error!("NEW UNKNOWN TAG: show_{}", value); + Err(other) + } + } + } +} +impl_into_str!(ShowTags, &'static str); + +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(try_from = "&str", into = "&str")] +pub enum ContentTags{ + ///World Tag + Sex, + Adult, + ///World Tag + Violence, + ///World Tag + Gore, + Horror, + ///World Tag + Other, +} + +impl ContentTags{ + pub const fn get_tag(&self) -> &'static str { + match self { + Self::Sex => "sex", + Self::Adult => "adult", + Self::Violence => "violence", + Self::Gore => "gore", + Self::Horror => "horror", + Self::Other => "other", + } + } +} + +impl Display for ContentTags{ + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self{ + Self::Sex => write!(f, "Sexually Suggestive"), + Self::Adult => write!(f, "Adult Language and Themes"), + Self::Violence => write!(f, "Graphic Violence"), + Self::Gore => write!(f, "Excessive Gore"), + Self::Horror => write!(f, "Extreme Horror"), + Self::Other => write!(f, "Other Content Warning"), + } + } +} +impl<'a> core::convert::TryFrom<&'a str> for ContentTags{ + type Error = &'a str; + fn try_from(value: &'a str) -> Result { + match value { + "sex" => Ok(Self::Sex), + "adult" => Ok(Self::Adult), + "violence" => Ok(Self::Violence), + "gore" => Ok(Self::Gore), + "horror" => Ok(Self::Horror), + "other" => Ok(Self::Other), + other => { + log::error!("NEW UNKNOWN TAG: content_{}", value); + Err(other) + } + } + } +} +impl_into_str!(ContentTags, &'static str); + +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(from = "&str", into = "String")] +pub enum AdminTags{ + ///User Tag + Access(AdminAccess), + ///User can give out licenses to other users + ///User Tag + CanGrantLicenses, + ///User’s tags have been locked and cannot be edited by the user + ///User Tag + LockTags, + ///User’s Trust rank has been locked and can no longer be changed automatically + ///User Tag + LockLevel, + ///User is part of the VRChat Staff team + ///User Tag + Moderator, + ///Replaces the users profile picture with the VRChat logo + ///User Tag + OfficialThumbnail, + ///World was manually been selected by staff as avatar world (Deprecated) + /// World Tag + #[deprecated] + AvatarWorld, + ///World has been manually selected by staff to appear in the “Featured” world category + ///World Tag + Featured, + ///World has been manually approved by staff + ///World Tag + Approved, + ///World has been manually selected by staff to appear in “Spotlight” row + ///World Tag + CommunitySpotlight, + ///World will always be hidden from search + ///World Tag + Hidden, + ///World will be hidden from “Active” row + ///World Tag + HideActive, + ///World will be hidden from “Recently Updated Worlds” row when updated + ///World Tag + HideNew, + ///World will be hidden from “Popular Worlds” row + ///World Tag + HidePopular, + ///Hides both online members and total number of members in the group. Used for the VRCHAT.0000 staff group. + ///Group Tag + HideMemberCount, + ContentReviewed, + QuestFallbackExtended, + FeaturedCategory(FeaturedTags), + ///Worlds can also have a range of different event-specific tags such as admin_vket2021 for the Vket row, admin_muzzfesst for the MUZZFEST event, or admin_halloween_2019 for the 2019 Halloween row. These are not listed because it would be impossible to accurately keep such list up-to-date, and each tag is of little use outside of that specific event. + ///World Tag + Other(Arc) +} + +impl AdminTags{ + pub fn get_tag(&self) -> String { + match self { + Self::ContentReviewed => String::from("content_reviewed"), + Self::QuestFallbackExtended => String::from("quest_fallback_extended"), + Self::FeaturedCategory(feature) => format!("featured_{}", feature.get_tag()), + Self::Access(access) => format!("{}_access", access.get_tag()), + Self::CanGrantLicenses => "can_grant_licenses".to_string(), + Self::LockTags => "lock_tags".to_string(), + Self::LockLevel => "lock_level".to_string(), + Self::Moderator => "moderator".to_string(), + Self::OfficialThumbnail => "official_thumbnail".to_string(), + #[allow(deprecated)] + Self::AvatarWorld => "avatar_world".to_string(), + Self::Featured => "featured".to_string(), + Self::Approved => "approved".to_string(), + Self::CommunitySpotlight => "community_spotlight".to_string(), + Self::Hidden => "hidden".to_string(), + Self::HideActive => "hide_active".to_string(), + Self::HideNew => "hide_new".to_string(), + Self::HidePopular => "hide_popular".to_string(), + Self::HideMemberCount => "hide_member_count".to_string(), + Self::Other(other) => other.to_string(), + } + } +} + +impl<'a> core::convert::From<&'a str> for AdminTags { + fn from(value: &'a str) -> Self { + if let Some(featured) = value.strip_prefix("featured_"){ + match core::convert::TryFrom::try_from(featured) { + Ok(tag) => Self::FeaturedCategory(tag), + Err(_) => Self::Other(Arc::from(value)), + } + } else if let Some(access) = value.strip_suffix("_access"){ + match core::convert::TryFrom::try_from(access) { + Ok(tag) => Self::Access(tag), + Err(_) => Self::Other(Arc::from(value)), + } + } else{ + match value { + "content_reviewed" => Self::ContentReviewed, + "quest_fallback_extended" => Self::QuestFallbackExtended, + "can_grant_licenses" => Self::CanGrantLicenses, + "lock_tags" => Self::LockTags, + "lock_level" => Self::LockLevel, + "moderator" => Self::Moderator, + "official_thumbnail" => Self::OfficialThumbnail, + #[allow(deprecated)] + "avatar_world" => Self::AvatarWorld, + "featured" => Self::Featured, + "approved" => Self::Approved, + "community_spotlight" => Self::CommunitySpotlight, + "hidden" => Self::Hidden, + "hide_active" => Self::HideActive, + "hide_new" => Self::HideNew, + "hide_popular" => Self::HidePopular, + "hide_member_count" => Self::HideMemberCount, + other => Self::Other(Arc::from(other)) + } + } + } +} +impl_into_str!(AdminTags, String); + +impl Display for AdminTags{ + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self{ + Self::ContentReviewed => write!(f, "Content Reviewed"), + Self::QuestFallbackExtended => write!(f, "Extended Quest Fallback"), + Self::FeaturedCategory(featured) => write!(f, "Featured: {featured}"), + Self::Access(access) => write!(f, "Access: {access}"), + Self::CanGrantLicenses => write!(f, "Can Grant Licenses"), + Self::LockTags => write!(f, "Locked Tags"), + Self::LockLevel => write!(f, "Locked Level"), + Self::Moderator => write!(f, "Moderator"), + Self::OfficialThumbnail => write!(f, "Official Thumbnail"), + #[allow(deprecated)] + Self::AvatarWorld => write!(f, "Avatar World"), + Self::Featured => write!(f, "Manually Featured"), + Self::Approved => write!(f, "Manually Approved"), + Self::CommunitySpotlight => write!(f, "Manually Community Spotlight"), + Self::Hidden => write!(f, "Hidden from Search"), + Self::HideActive => write!(f, "Hidden from Active"), + Self::HideNew => write!(f, "Hidden from Recently Updated Worlds"), + Self::HidePopular => write!(f, "Hidden from Popular Worlds"), + Self::HideMemberCount => write!(f, "Hidden Group Member Count"), + Self::Other(other) => write!(f, "Other: {other}"), + } + } +} +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(try_from = "&str", into = "&str")] +pub enum AdminAccess{ + ///User can upload Avatars without needing the neccesary trust rank + Avatar, + ///User can access Canny without needing the neccesary trust rank + Canny, + ///User can upload user-made scripts (Deprecated) + #[deprecated] + Scripting, + ///User can upload Worlds without needing the neccesary trust rank + WorldAccess, +} + +impl AdminAccess{ + pub const fn get_tag(&self) -> &'static str { + match self { + Self::Avatar => "avatar", + Self::Canny => "canny", + #[allow(deprecated)] + Self::Scripting => "scripting", + Self::WorldAccess => "world", + } + } +} + +impl<'a> core::convert::TryFrom<&'a str> for AdminAccess { + type Error = &'a str; + fn try_from(value: &'a str) -> Result { + match value { + "avatar" => Ok(Self::Avatar), + "canny" => Ok(Self::Canny), + #[allow(deprecated)] + "scripting" => Ok(Self::Scripting), + "world" => Ok(Self::WorldAccess), + other => Err(other), + } + } +} +impl_into_str!(AdminAccess, &'static str); + +impl Display for AdminAccess{ + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self{ + Self::Avatar => write!(f, "Avatar Upload Access without Trust Rank"), + Self::Canny => write!(f, "Canny Access without Trust Rank"), + #[allow(deprecated)] + Self::Scripting => write!(f, "Can upload custom User Scripts"), + Self::WorldAccess => write!(f, "World Upload Access without Trust Rank"), + } + } +} + +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(try_from = "&str", into = "&str")] +pub enum FeaturedTags { + LegacyContent, + Quest, +} + +impl FeaturedTags{ + pub const fn get_tag(&self) -> &'static str { + match self { + Self::LegacyContent => "legacy", + Self::Quest => "quest", + } + } +} + +impl<'a> core::convert::TryFrom<&'a str> for FeaturedTags{ + type Error = &'a str; + fn try_from(value: &'a str) -> Result { + match value { + "legacy" => Ok(Self::LegacyContent), + "quest" => Ok(Self::Quest), + other => { + log::error!("NEW UNKNOWN TAG: admin_featured_{value}"); + Err(other) + } + } + } +} +impl_into_str!(FeaturedTags, &'static str); + +impl Display for FeaturedTags { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Self::LegacyContent => write!(f, "Legacy Content"), + Self::Quest => write!(f, "Quest"), + } + } +} + +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(from = "&str", into = "String")] +pub enum AuthorTags { + QuestFallback, + ///World will show up in “Avatar Worlds” row + ///World Tag + TagAvatar, + ///World will show up in the “Games” world row + ///World Tag + TagGame, + ///World Tag + Other(Arc) +} + + +impl AuthorTags{ + pub fn get_tag(&self) -> String { + match self { + Self::QuestFallback => "quest_fallback".to_string(), + Self::TagAvatar => "tag_avatar".to_string(), + Self::TagGame => "tag_game".to_string(), + Self::Other(other) => other.to_string(), + } + } +} +impl<'a> core::convert::From<&'a str> for AuthorTags { + fn from(value: &'a str) -> Self { + match value { + "quest_fallback" => Self::QuestFallback, + "tag_avatar" => Self::TagAvatar, + "tag_game" => Self::TagGame, + other => Self::Other(Arc::from(other)) + } + } +} +impl_into_str!(AuthorTags, String); + +impl Display for AuthorTags { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Self::QuestFallback => write!(f, "Quest Fallback"), + Self::TagAvatar => write!(f, "Avatar World"), + Self::TagGame => write!(f, "Game World"), + Self::Other(other) => write!(f, "Custom Tag: {other}"), + } + } +} + +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(try_from = "&str", into = "String")] +pub enum SystemTags { + ///User Tag + Access(SystemAccess), + ///User Tag + Trust(SystemTrust), + Jam(String), + ///User can upload user-made scripts (Deprecated) + ///User Tag + #[deprecated] + ScriptingAccess, + ///User bought VRC+ in the early period of it’s launch, around December 2020 + ///User Tag + EarlyAdopter, + ///User has been reported multiple times and is (probably) a troll + ///User Tag + ProbableTroll, + ///User is a confirmed troll + ///User Tag + Troll, + ///User has an active VRC+ subscription + ///User Tag + Supporter, + ///User is an Experienced player and was active during the Summer of 2018 + /// (Tag removed in 2022-05-05) + ///User Tag + Legend, + ///World has been automatically approved through the Community Labs + ///World Tag + Approved, + ///World was recently created + ///World Tag + CreatedRecently, + ///World has been submitted to Community Labs + /// World Tag + Labs, + ///World has been recently updated and will show up in “Updated Recently” worlds row if also system approved + /// World Tag + UpdatedRecently, + NoCaptcha, +} +impl SystemTags{ + pub fn get_tag(&self) -> String { + match self { + Self::Access(access) => format!("{}_access", access.get_tag()), + Self::Trust(trust) => format!("trust_{}", trust.get_tag()), + Self::Jam(id) => format!("jam{id}"), + #[allow(deprecated)] + Self::ScriptingAccess => "scripting_access".to_string(), + Self::ProbableTroll => "probable_troll".to_string(), + Self::Troll => "troll".to_string(), + Self::EarlyAdopter => "early_adopter".to_string(), + Self::Supporter => "supporter".to_string(), + Self::Legend => "legend".to_string(), + Self::NoCaptcha => "no_captcha".to_string(), + Self::Approved => "approved".to_string(), + Self::CreatedRecently => "created_recently".to_string(), + Self::Labs => "labs".to_string(), + Self::UpdatedRecently => "updated_recently".to_string(), + } + } +} +impl Display for SystemTags { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Self::Access(access) => write!(f, "{access}"), + Self::Trust(trust) => write!(f, "Trust: {trust}"), + Self::Jam(jam) => write!(f, "Jam: {jam}"), + #[allow(deprecated)] + Self::ScriptingAccess => write!(f, "Scripting Access"), + Self::ProbableTroll => write!(f, "Probable Troll"), + Self::Troll => write!(f, "Troll"), + Self::EarlyAdopter => write!(f, "EarlyAdopter"), + Self::Supporter => write!(f, "Supporter"), + Self::Legend => write!(f, "Legend"), + Self::NoCaptcha => write!(f, "NoCaptcha"), + Self::Approved => write!(f, "Approved"), + Self::CreatedRecently => write!(f, "Created Recently"), + Self::Labs => write!(f, "Labs"), + Self::UpdatedRecently => write!(f, "Updated Recently") + } + } +} + +impl<'a> core::convert::TryFrom<&'a str> for SystemTags{ + type Error = &'a str; + fn try_from(value: &'a str) -> Result { + if let Some(access) = value.strip_suffix("_access") { + match core::convert::TryFrom::try_from(access) { + Ok(tag) => Ok(Self::Access(tag)), + Err(_) => Err(value), + } + } else if let Some(trust) = value.strip_prefix("trust_") { + match core::convert::TryFrom::try_from(trust) { + Ok(tag) => Ok(Self::Trust(tag)), + Err(_) => Err(value), + } + }else if let Some(jam) = value.strip_prefix("jam") { + Ok(Self::Jam(jam.to_string())) + } else { + match value{ + #[allow(deprecated)] + "scripting_access" => Ok(Self::ScriptingAccess), + "probable_troll" => Ok(Self::ProbableTroll), + "troll" => Ok(Self::Troll), + "early_adopter" => Ok(Self::EarlyAdopter), + "supporter" => Ok(Self::Supporter), + "legend" => Ok(Self::Legend), + "no_captcha" => Ok(Self::NoCaptcha), + "approved" => Ok(Self::Approved), + "created_recently" => Ok(Self::CreatedRecently), + "labs" => Ok(Self::Labs), + "updated_recently" => Ok(Self::UpdatedRecently), + value=> { + log::error!("NEW UNKNOWN TAG: system_{}", value); + Err(value) + }, + } + } + } +} +impl_into_str!(SystemTags, String); + +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(try_from = "&str", into = "&str")] +pub enum SystemTrust { + ///User is “Veteran User” (gold color) Trust rank + /// (Role was removed in Sep 2018. Tag removed in 2022-05-05) + #[deprecated] + Ledgend, + ///Unknown + /// (Tag removed in 2022-05-05) + #[deprecated] + Advanced, + ///Unknown + /// (Tag removed in 2022-05-05) + #[deprecated] + Intermediate, + ///User is “Trusted User” (purple) Trust rank + Veteran, + ///User is “Known User” (orange) Trust rank + Trusted, + /// User is “User” (green) Trust rank + Known, + ///User is “New User” (blue) Trust rank + Basic, + //Visitors have no Trust tag +} +impl SystemTrust{ + pub const fn get_tag(&self) -> &'static str { + match self { + Self::Basic => "basic", + Self::Known => "known", + Self::Trusted => "trusted", + Self::Veteran => "veteran", + #[allow(deprecated)] + Self::Intermediate => "intermediate", + #[allow(deprecated)] + Self::Advanced => "advanced", + #[allow(deprecated)] + Self::Ledgend => "legend", + } + } +} +impl Display for SystemTrust { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Self::Basic => write!(f, "New User"), + Self::Known => write!(f, "User"), + Self::Trusted => write!(f, "Known User"), + Self::Veteran => write!(f, "Trusted User"), + #[allow(deprecated)] + Self::Intermediate => write!(f, "Intermediate User"), + #[allow(deprecated)] + Self::Advanced => write!(f,"Advanced User"), + #[allow(deprecated)] + Self::Ledgend => write!(f, "Legend User"), + } + } +} + +impl<'a> core::convert::TryFrom<&'a str> for SystemTrust { + type Error = &'a str; + fn try_from(value: &'a str) -> Result { + match value { + "basic" => Ok(Self::Basic), + "known" => Ok(Self::Known), + "trusted" => Ok(Self::Trusted), + "veteran" => Ok(Self::Veteran), + other => { + log::error!("NEW UNKNOWN TAG: system_trust_{}", value); + Err(other) + } + } + } +} +impl_into_str!(SystemTrust, &'static str); + +#[non_exhaustive] +#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Hash, Clone, Deserialize, Serialize)] +#[serde(try_from = "&str", into = "&str")] +pub enum SystemAccess { + ///User can upload and publish Avatars + Avatar, + ///User can upload and publish Worlds + World, + ///User can send Feedback + Feedback, +} +impl SystemAccess{ + pub const fn get_tag(&self) -> &'static str { + match self { + Self::Avatar => "avatar", + Self::World => "world", + Self::Feedback => "feedback", + } + } +} +impl Display for SystemAccess { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Self::Avatar => write!(f, "Avatar Access"), + Self::World => write!(f, "World Access"), + Self::Feedback => write!(f, "Feedback Access"), + } + } +} + +impl<'a> core::convert::TryFrom<&'a str> for SystemAccess{ + type Error = &'a str; + fn try_from(value: &'a str) -> Result { + match value { + "avatar" => Ok(Self::Avatar), + "world" => Ok(Self::World), + "feedback" => Ok(Self::Feedback), + other => { + log::error!("NEW UNKNOWN TAG: system_{}_access", value); + Err(other) + } + } + } +} +impl_into_str!(SystemAccess, &'static str); + + +#[cfg(test)] +mod test{ + use std::sync::Arc; + + #[test] + #[allow(deprecated)] + fn test(){ + for (tag, expected) in [ + //User Tags + ("admin_avatar_access", super::Tags::Admin(super::AdminTags::Access(super::AdminAccess::Avatar))), + ("admin_canny_access", super::Tags::Admin(super::AdminTags::Access(super::AdminAccess::Canny))), + ("admin_scripting_access", super::Tags::Admin(super::AdminTags::Access(super::AdminAccess::Scripting))), + ("admin_world_access", super::Tags::Admin(super::AdminTags::Access(super::AdminAccess::WorldAccess))), + ("admin_can_grant_licenses", super::Tags::Admin(super::AdminTags::CanGrantLicenses)), + ("admin_lock_tags", super::Tags::Admin(super::AdminTags::LockTags)), + ("admin_lock_level", super::Tags::Admin(super::AdminTags::LockLevel)), + ("admin_moderator", super::Tags::Admin(super::AdminTags::Moderator)), + ("admin_official_thumbnail", super::Tags::Admin(super::AdminTags::OfficialThumbnail)), + ("system_scripting_access", super::Tags::System(super::SystemTags::ScriptingAccess)), + ("show_social_rank", super::Tags::Show(super::ShowTags::SocialRank)), + ("show_mod_tag", super::Tags::Show(super::ShowTags::ModTag)), + ("system_early_adopter", super::Tags::System(super::SystemTags::EarlyAdopter)), + ("system_avatar_access", super::Tags::System(super::SystemTags::Access(super::SystemAccess::Avatar))), + ("system_feedback_access", super::Tags::System(super::SystemTags::Access(super::SystemAccess::Feedback))), + ("system_world_access", super::Tags::System(super::SystemTags::Access(super::SystemAccess::World))), + ("system_probable_troll", super::Tags::System(super::SystemTags::ProbableTroll)), + ("system_troll", super::Tags::System(super::SystemTags::Troll)), + ("system_supporter", super::Tags::System(super::SystemTags::Supporter)), + ("system_legend", super::Tags::System(super::SystemTags::Legend)), + ("system_trust_basic", super::Tags::System(super::SystemTags::Trust(super::SystemTrust::Basic))), + //World Tags + ("author_tag_", super::Tags::Author(super::AuthorTags::Other(Arc::from("tag_")))), + ("author_tag_*", super::Tags::Author(super::AuthorTags::Other(Arc::from("tag_*")))), + ("author_tag_avatar", super::Tags::Author(super::AuthorTags::TagAvatar)), + ("author_tag_game", super::Tags::Author(super::AuthorTags::TagGame)), + ("admin_featured", super::Tags::Admin(super::AdminTags::Featured)), + ("admin_approved", super::Tags::Admin(super::AdminTags::Approved)), + ("admin_avatar_world", super::Tags::Admin(super::AdminTags::AvatarWorld)), + ("admin_community_spotlight", super::Tags::Admin(super::AdminTags::CommunitySpotlight)), + ("admin_hide_popular", super::Tags::Admin(super::AdminTags::HidePopular)), + ("debug_allowed", super::Tags::DebugAllowed), + ("system_approved", super::Tags::System(super::SystemTags::Approved)), + ("system_created_recently", super::Tags::System(super::SystemTags::CreatedRecently)), + ("system_labs", super::Tags::System(super::SystemTags::Labs)), + ("system_updated_recently", super::Tags::System(super::SystemTags::UpdatedRecently)), + ("content_sex", super::Tags::Content(super::ContentTags::Sex)), + ("content_adult", super::Tags::Content(super::ContentTags::Adult)), + ("content_violence", super::Tags::Content(super::ContentTags::Violence)), + ("content_gore", super::Tags::Content(super::ContentTags::Gore)), + ("content_horror", super::Tags::Content(super::ContentTags::Horror)), + ("content_other", super::Tags::Content(super::ContentTags::Other)), + //Languages + ("language_eng", super::Tags::Language(super::LanguageTags::English)), + ("language_kor", super::Tags::Language(super::LanguageTags::Korean)), + ("language_rus", super::Tags::Language(super::LanguageTags::Russian)), + ("language_spa", super::Tags::Language(super::LanguageTags::Spanish)), + ("language_por", super::Tags::Language(super::LanguageTags::Portuguese)), + ("language_zho", super::Tags::Language(super::LanguageTags::Chinese)), + ("language_deu", super::Tags::Language(super::LanguageTags::German)), + ("language_jpn", super::Tags::Language(super::LanguageTags::Japanese)), + ("language_fra", super::Tags::Language(super::LanguageTags::French)), + ("language_swe", super::Tags::Language(super::LanguageTags::Swedish)), + ("language_nld", super::Tags::Language(super::LanguageTags::Dutch)), + ("language_pol", super::Tags::Language(super::LanguageTags::Polish)), + ("language_dan", super::Tags::Language(super::LanguageTags::Danish)), + ("language_nor", super::Tags::Language(super::LanguageTags::Norwegian)), + ("language_ita", super::Tags::Language(super::LanguageTags::Italian)), + ("language_tha", super::Tags::Language(super::LanguageTags::Thai)), + ("language_fin", super::Tags::Language(super::LanguageTags::Finnish)), + ("language_hun", super::Tags::Language(super::LanguageTags::Hungarian)), + ("language_ces", super::Tags::Language(super::LanguageTags::Czech)), + ("language_tur", super::Tags::Language(super::LanguageTags::Turkish)), + ("language_ara", super::Tags::Language(super::LanguageTags::Arabic)), + ("language_ron", super::Tags::Language(super::LanguageTags::Romanian)), + ("language_vie", super::Tags::Language(super::LanguageTags::Vietnamese)), + ("language_ase", super::Tags::Language(super::LanguageTags::AmericanSignLanguage)), + ("language_bfi", super::Tags::Language(super::LanguageTags::BritishSignLanguage)), + ("language_dse", super::Tags::Language(super::LanguageTags::DutchSignLanguage)), + ("language_fsl", super::Tags::Language(super::LanguageTags::FrenchSignLanguage)), + ("language_kvk", super::Tags::Language(super::LanguageTags::KoreanSignLanguage)), + ("language_other", super::Tags::Language(super::LanguageTags::Other(Arc::from("other")))), + //Group Tags + ("admin_hide_member_count", super::Tags::Admin(super::AdminTags::HideMemberCount)), + //Fun Tags + (r#"system_neuralink_beta"#, super::Tags::Other(Arc::from(r#"system_neuralink_beta"#))), + (r#"system_extremely_cool_guy"#, super::Tags::Other(Arc::from(r#"system_extremely_cool_guy"#))), + (r#"system_stop_being_nosy"#, super::Tags::Other(Arc::from(r#"system_stop_being_nosy"#))), + (r#"system_notamod"#, super::Tags::Other(Arc::from(r#"system_notamod"#))), + (r#"system_no_seriously_im_not_a_mod_how_many_times_do_i_have_to_tell_people"#, super::Tags::Other(Arc::from(r#"system_no_seriously_im_not_a_mod_how_many_times_do_i_have_to_tell_people"#))), + (r#"system_the_tag_is_just_named_that"#, super::Tags::Other(Arc::from(r#"system_the_tag_is_just_named_that"#))), + (r#"system_haha_you_have_to_document_this_one_too"#, super::Tags::Other(Arc::from(r#"system_haha_you_have_to_document_this_one_too"#))), + (r#"system_legen_wait_for_it_dary"#, super::Tags::Other(Arc::from(r#"system_legen_wait_for_it_dary"#))), + (r#"system_cute_robot"#, super::Tags::Other(Arc::from(r#"system_cute_robot"#))), + (r#"Never gonna give you up"#, super::Tags::Other(Arc::from(r#"Never gonna give you up"#))), + (r#"system_not_cute"#, super::Tags::Other(Arc::from(r#"system_not_cute"#))), + (r#"'; DROP DATABASE tags; --"#, super::Tags::Other(Arc::from(r#"'; DROP DATABASE tags; --"#))), + (r#""'; DROP TABLE tags; --"#, super::Tags::Other(Arc::from(r#""'; DROP TABLE tags; --"#))), + (r#""¯\_(ツ)_/¯"#, super::Tags::Other(Arc::from(r#""¯\_(ツ)_/¯"#))), + (r#"ඞ"#, super::Tags::Other(Arc::from(r#"ඞ"#))), + (r#"we've been trying to reach you about your car's extended warranty"#, super::Tags::Other(Arc::from(r#"we've been trying to reach you about your car's extended warranty"#))), + (r#"""#, super::Tags::Other(Arc::from(r#"""#))), + (r#"eeeeeeeeee"#, super::Tags::Other(Arc::from(r#"eeeeeeeeee"#))), + (r#"if you're reading this, you've been in a coma for almost 20 years now. we're trying a new technique. we don't know where this message will end up in your dream, but we hope we're getting through. please wake up-"#, super::Tags::Other(Arc::from(r#"if you're reading this, you've been in a coma for almost 20 years now. we're trying a new technique. we don't know where this message will end up in your dream, but we hope we're getting through. please wake up-"#))), + (r#"system_smart_fridge_beta"#, super::Tags::Other(Arc::from(r#"system_smart_fridge_beta"#))), + (r#"system_hey_mom_look_im_in_a_git_commit"#, super::Tags::Other(Arc::from(r#"system_hey_mom_look_im_in_a_git_commit"#))), + (r#"system_trust_sussy"#, super::Tags::Other(Arc::from(r#"system_trust_sussy"#))), + (r#"system_lizard"#, super::Tags::Other(Arc::from(r#"system_lizard"#))), + (r#"system_me_I_read_them"#, super::Tags::Other(Arc::from(r#"system_me_I_read_them"#))), + (r#"system_slug"#, super::Tags::Other(Arc::from(r#"system_slug"#))), + ]{ + assert_eq!(super::Tags::from(tag).get_tag(), expected.get_tag(), "Failed to verify tag {tag} against {:#?}.", expected.to_string()); + assert_eq!(tag, String::from(expected.clone()), "Failed to verify tag {tag} against {:#?}.", expected.to_string()); + } + } +} \ No newline at end of file diff --git a/src/models/transaction.rs b/src/models/transaction.rs index 8ea976e..005ad8a 100644 --- a/src/models/transaction.rs +++ b/src/models/transaction.rs @@ -10,15 +10,15 @@ use crate::models; use serde::{Deserialize, Serialize}; /// Transaction : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Transaction { #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] - pub user_id: Option, + pub user_id: Option>, #[serde(rename = "userDisplayName", skip_serializing_if = "Option::is_none")] - pub user_display_name: Option, + pub user_display_name: Option>, #[serde(rename = "status")] pub status: models::TransactionStatus, #[serde(rename = "subscription")] @@ -26,15 +26,15 @@ pub struct Transaction { #[serde(rename = "sandbox")] pub sandbox: bool, #[serde(rename = "created_at")] - pub created_at: String, + pub created_at: std::sync::Arc, #[serde(rename = "updated_at")] - pub updated_at: String, + pub updated_at: std::sync::Arc, #[serde(rename = "steam", skip_serializing_if = "Option::is_none")] pub steam: Option>, #[serde(rename = "agreement", skip_serializing_if = "Option::is_none")] pub agreement: Option>, #[serde(rename = "error")] - pub error: String, + pub error: std::sync::Arc, #[serde(rename = "isGift", skip_serializing_if = "Option::is_none")] pub is_gift: Option, #[serde(rename = "isTokens", skip_serializing_if = "Option::is_none")] @@ -42,7 +42,7 @@ pub struct Transaction { } impl Transaction { - pub fn new(id: String, status: models::TransactionStatus, subscription: models::Subscription, sandbox: bool, created_at: String, updated_at: String, error: String) -> Transaction { + pub fn new(id: std::sync::Arc, status: models::TransactionStatus, subscription: models::Subscription, sandbox: bool, created_at: std::sync::Arc, updated_at: std::sync::Arc, error: std::sync::Arc) -> Transaction { Transaction { id, user_id: None, diff --git a/src/models/transaction_agreement.rs b/src/models/transaction_agreement.rs index cfb4b46..dfe7f9b 100644 --- a/src/models/transaction_agreement.rs +++ b/src/models/transaction_agreement.rs @@ -10,37 +10,37 @@ use crate::models; use serde::{Deserialize, Serialize}; /// TransactionAgreement : Represents a single Transaction, which is likely between VRChat and Steam. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TransactionAgreement { #[serde(rename = "agreementId")] - pub agreement_id: String, + pub agreement_id: std::sync::Arc, #[serde(rename = "itemId")] pub item_id: f64, #[serde(rename = "agreement")] - pub agreement: String, + pub agreement: std::sync::Arc, /// This is NOT TransactionStatus, but whatever Steam return. #[serde(rename = "status")] - pub status: String, + pub status: std::sync::Arc, #[serde(rename = "period")] - pub period: String, + pub period: std::sync::Arc, #[serde(rename = "frequency")] pub frequency: f64, #[serde(rename = "billingType")] - pub billing_type: String, + pub billing_type: std::sync::Arc, #[serde(rename = "startDate")] - pub start_date: String, + pub start_date: std::sync::Arc, #[serde(rename = "endDate")] - pub end_date: String, + pub end_date: std::sync::Arc, #[serde(rename = "recurringAmt")] pub recurring_amt: f64, #[serde(rename = "currency")] - pub currency: String, + pub currency: std::sync::Arc, #[serde(rename = "timeCreated")] - pub time_created: String, + pub time_created: std::sync::Arc, #[serde(rename = "nextPayment")] - pub next_payment: String, + pub next_payment: std::sync::Arc, #[serde(rename = "lastPayment")] - pub last_payment: String, + pub last_payment: std::sync::Arc, #[serde(rename = "lastAmount")] pub last_amount: f64, #[serde(rename = "lastAmountVat")] @@ -53,7 +53,7 @@ pub struct TransactionAgreement { impl TransactionAgreement { /// Represents a single Transaction, which is likely between VRChat and Steam. - pub fn new(agreement_id: String, item_id: f64, agreement: String, status: String, period: String, frequency: f64, billing_type: String, start_date: String, end_date: String, recurring_amt: f64, currency: String, time_created: String, next_payment: String, last_payment: String, last_amount: f64, last_amount_vat: f64, outstanding: f64, failed_attempts: f64) -> TransactionAgreement { + pub fn new(agreement_id: std::sync::Arc, item_id: f64, agreement: std::sync::Arc, status: std::sync::Arc, period: std::sync::Arc, frequency: f64, billing_type: std::sync::Arc, start_date: std::sync::Arc, end_date: std::sync::Arc, recurring_amt: f64, currency: std::sync::Arc, time_created: std::sync::Arc, next_payment: std::sync::Arc, last_payment: std::sync::Arc, last_amount: f64, last_amount_vat: f64, outstanding: f64, failed_attempts: f64) -> TransactionAgreement { TransactionAgreement { agreement_id, item_id, diff --git a/src/models/transaction_steam_info.rs b/src/models/transaction_steam_info.rs index 8ef17cd..54c560c 100644 --- a/src/models/transaction_steam_info.rs +++ b/src/models/transaction_steam_info.rs @@ -10,26 +10,26 @@ use crate::models; use serde::{Deserialize, Serialize}; /// TransactionSteamInfo : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TransactionSteamInfo { #[serde(rename = "walletInfo")] pub wallet_info: Box, /// Steam User ID #[serde(rename = "steamId")] - pub steam_id: String, + pub steam_id: std::sync::Arc, /// Steam Order ID #[serde(rename = "orderId")] - pub order_id: String, + pub order_id: std::sync::Arc, /// Empty #[serde(rename = "steamUrl")] - pub steam_url: String, + pub steam_url: std::sync::Arc, /// Steam Transaction ID, NOT the same as VRChat TransactionID #[serde(rename = "transId")] - pub trans_id: String, + pub trans_id: std::sync::Arc, } 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: std::sync::Arc, order_id: std::sync::Arc, steam_url: std::sync::Arc, trans_id: std::sync::Arc) -> TransactionSteamInfo { TransactionSteamInfo { wallet_info: Box::new(wallet_info), steam_id, diff --git a/src/models/transaction_steam_wallet_info.rs b/src/models/transaction_steam_wallet_info.rs index 5234d06..c3ab09c 100644 --- a/src/models/transaction_steam_wallet_info.rs +++ b/src/models/transaction_steam_wallet_info.rs @@ -10,20 +10,20 @@ use crate::models; use serde::{Deserialize, Serialize}; /// TransactionSteamWalletInfo : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TransactionSteamWalletInfo { #[serde(rename = "state")] - pub state: String, + pub state: std::sync::Arc, #[serde(rename = "country")] - pub country: String, + pub country: std::sync::Arc, #[serde(rename = "currency")] - pub currency: String, + pub currency: std::sync::Arc, #[serde(rename = "status")] - pub status: String, + pub status: std::sync::Arc, } impl TransactionSteamWalletInfo { - pub fn new(state: String, country: String, currency: String, status: String) -> TransactionSteamWalletInfo { + pub fn new(state: std::sync::Arc, country: std::sync::Arc, currency: std::sync::Arc, status: std::sync::Arc) -> TransactionSteamWalletInfo { TransactionSteamWalletInfo { state, country, diff --git a/src/models/two_factor_auth_code.rs b/src/models/two_factor_auth_code.rs index 0c1aa3a..6d90248 100644 --- a/src/models/two_factor_auth_code.rs +++ b/src/models/two_factor_auth_code.rs @@ -9,14 +9,14 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorAuthCode { #[serde(rename = "code")] - pub code: String, + pub code: std::sync::Arc, } impl TwoFactorAuthCode { - pub fn new(code: String) -> TwoFactorAuthCode { + pub fn new(code: std::sync::Arc) -> TwoFactorAuthCode { TwoFactorAuthCode { code, } diff --git a/src/models/two_factor_email_code.rs b/src/models/two_factor_email_code.rs index 6c35ef0..94dd6df 100644 --- a/src/models/two_factor_email_code.rs +++ b/src/models/two_factor_email_code.rs @@ -9,14 +9,14 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorEmailCode { #[serde(rename = "code")] - pub code: String, + pub code: std::sync::Arc, } impl TwoFactorEmailCode { - pub fn new(code: String) -> TwoFactorEmailCode { + pub fn new(code: std::sync::Arc) -> TwoFactorEmailCode { TwoFactorEmailCode { code, } diff --git a/src/models/unity_package.rs b/src/models/unity_package.rs index 2d2f5d2..21a60b9 100644 --- a/src/models/unity_package.rs +++ b/src/models/unity_package.rs @@ -10,39 +10,39 @@ use crate::models; use serde::{Deserialize, Serialize}; /// UnityPackage : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnityPackage { #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "assetUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub asset_url: Option>, + pub asset_url: Option>>, #[serde(rename = "assetUrlObject", skip_serializing_if = "Option::is_none")] pub asset_url_object: Option, #[serde(rename = "assetVersion")] pub asset_version: i32, #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, + pub created_at: Option>, /// This can be `standalonewindows` or `android`, but can also pretty much be any random Unity verison such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. #[serde(rename = "platform")] - pub platform: String, + pub platform: std::sync::Arc, #[serde(rename = "pluginUrl", skip_serializing_if = "Option::is_none")] - pub plugin_url: Option, + pub plugin_url: Option>, #[serde(rename = "pluginUrlObject", skip_serializing_if = "Option::is_none")] pub plugin_url_object: Option, #[serde(rename = "unitySortNumber", skip_serializing_if = "Option::is_none")] pub unity_sort_number: Option, #[serde(rename = "unityVersion")] - pub unity_version: String, + pub unity_version: std::sync::Arc, #[serde(rename = "impostorUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub impostor_url: Option>, + pub impostor_url: Option>>, #[serde(rename = "scanStatus", skip_serializing_if = "Option::is_none")] - pub scan_status: Option, + pub scan_status: Option>, #[serde(rename = "variant", skip_serializing_if = "Option::is_none")] - pub variant: Option, + pub variant: Option>, } impl UnityPackage { - pub fn new(id: String, asset_version: i32, platform: String, unity_version: String) -> UnityPackage { + pub fn new(id: std::sync::Arc, asset_version: i32, platform: std::sync::Arc, unity_version: std::sync::Arc) -> UnityPackage { UnityPackage { id, asset_url: None, diff --git a/src/models/update_avatar_request.rs b/src/models/update_avatar_request.rs index e0e6aac..1d873c8 100644 --- a/src/models/update_avatar_request.rs +++ b/src/models/update_avatar_request.rs @@ -9,28 +9,28 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateAvatarRequest { #[serde(rename = "assetUrl", skip_serializing_if = "Option::is_none")] - pub asset_url: Option, + pub asset_url: Option>, #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option>, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")] - pub image_url: Option, + pub image_url: Option>, #[serde(rename = "releaseStatus", skip_serializing_if = "Option::is_none")] pub release_status: Option, #[serde(rename = "version", skip_serializing_if = "Option::is_none")] pub version: Option, #[serde(rename = "unityPackageUrl", skip_serializing_if = "Option::is_none")] - pub unity_package_url: Option, + pub unity_package_url: Option>, #[serde(rename = "unityVersion", skip_serializing_if = "Option::is_none")] - pub unity_version: Option, + pub unity_version: Option>, } impl UpdateAvatarRequest { diff --git a/src/models/update_favorite_group_request.rs b/src/models/update_favorite_group_request.rs index 12ff3e0..4109596 100644 --- a/src/models/update_favorite_group_request.rs +++ b/src/models/update_favorite_group_request.rs @@ -9,15 +9,15 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateFavoriteGroupRequest { #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] - pub display_name: Option, + pub display_name: Option>, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, /// Tags on FavoriteGroups are believed to do nothing. #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, } impl UpdateFavoriteGroupRequest { diff --git a/src/models/update_group_gallery_request.rs b/src/models/update_group_gallery_request.rs index 946b454..e1611f4 100644 --- a/src/models/update_group_gallery_request.rs +++ b/src/models/update_group_gallery_request.rs @@ -9,25 +9,25 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateGroupGalleryRequest { /// Name of the gallery. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, /// Description of the gallery. #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, /// Whether the gallery is members only. #[serde(rename = "membersOnly", skip_serializing_if = "Option::is_none")] pub members_only: Option, #[serde(rename = "roleIdsToView", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_view: Option>>, + pub role_ids_to_view: Option>>>, #[serde(rename = "roleIdsToSubmit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_submit: Option>>, + pub role_ids_to_submit: Option>>>, #[serde(rename = "roleIdsToAutoApprove", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_auto_approve: Option>>, + pub role_ids_to_auto_approve: Option>>>, #[serde(rename = "roleIdsToManage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub role_ids_to_manage: Option>>, + pub role_ids_to_manage: Option>>>, } impl UpdateGroupGalleryRequest { diff --git a/src/models/update_group_member_request.rs b/src/models/update_group_member_request.rs index ac65ede..f3d0d52 100644 --- a/src/models/update_group_member_request.rs +++ b/src/models/update_group_member_request.rs @@ -9,14 +9,14 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateGroupMemberRequest { #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] pub is_subscribed_to_announcements: Option, #[serde(rename = "managerNotes", skip_serializing_if = "Option::is_none")] - pub manager_notes: Option, + pub manager_notes: Option>, } impl UpdateGroupMemberRequest { diff --git a/src/models/update_group_request.rs b/src/models/update_group_request.rs index 7abe9a4..8c58afe 100644 --- a/src/models/update_group_request.rs +++ b/src/models/update_group_request.rs @@ -9,29 +9,29 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateGroupRequest { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "shortCode", skip_serializing_if = "Option::is_none")] - pub short_code: Option, + pub short_code: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "joinState", skip_serializing_if = "Option::is_none")] pub join_state: Option, #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub icon_id: Option>, + pub icon_id: Option>>, #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_id: Option>, + pub banner_id: Option>>, /// 3 letter language code #[serde(rename = "languages", skip_serializing_if = "Option::is_none")] - pub languages: Option>, + pub languages: Option>>, #[serde(rename = "links", skip_serializing_if = "Option::is_none")] - pub links: Option>, + pub links: Option>>, #[serde(rename = "rules", skip_serializing_if = "Option::is_none")] - pub rules: Option, + pub rules: Option>, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, } impl UpdateGroupRequest { diff --git a/src/models/update_group_role_request.rs b/src/models/update_group_role_request.rs index e6e0d3f..103662f 100644 --- a/src/models/update_group_role_request.rs +++ b/src/models/update_group_role_request.rs @@ -9,16 +9,16 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateGroupRoleRequest { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "isSelfAssignable", skip_serializing_if = "Option::is_none")] pub is_self_assignable: Option, #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option>, + pub permissions: Option>>, #[serde(rename = "order", skip_serializing_if = "Option::is_none")] pub order: Option, } diff --git a/src/models/update_invite_message_request.rs b/src/models/update_invite_message_request.rs index 3fed8c6..4b74f1d 100644 --- a/src/models/update_invite_message_request.rs +++ b/src/models/update_invite_message_request.rs @@ -9,14 +9,14 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateInviteMessageRequest { #[serde(rename = "message")] - pub message: String, + pub message: std::sync::Arc, } impl UpdateInviteMessageRequest { - pub fn new(message: String) -> UpdateInviteMessageRequest { + pub fn new(message: std::sync::Arc) -> UpdateInviteMessageRequest { UpdateInviteMessageRequest { message, } diff --git a/src/models/update_user_request.rs b/src/models/update_user_request.rs index d0c3d8b..dc587c1 100644 --- a/src/models/update_user_request.rs +++ b/src/models/update_user_request.rs @@ -9,31 +9,31 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateUserRequest { #[serde(rename = "email", skip_serializing_if = "Option::is_none")] - pub email: Option, + pub email: Option>, #[serde(rename = "birthday", skip_serializing_if = "Option::is_none")] - pub birthday: Option, + pub birthday: Option>, #[serde(rename = "acceptedTOSVersion", skip_serializing_if = "Option::is_none")] pub accepted_tos_version: Option, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, #[serde(rename = "status", skip_serializing_if = "Option::is_none")] pub status: Option, #[serde(rename = "statusDescription", skip_serializing_if = "Option::is_none")] - pub status_description: Option, + pub status_description: Option>, #[serde(rename = "bio", skip_serializing_if = "Option::is_none")] - pub bio: Option, + pub bio: Option>, #[serde(rename = "bioLinks", skip_serializing_if = "Option::is_none")] - pub bio_links: Option>, + pub bio_links: Option>>, #[serde(rename = "pronouns", skip_serializing_if = "Option::is_none")] - pub pronouns: Option, + pub pronouns: Option>, #[serde(rename = "isBoopingEnabled", skip_serializing_if = "Option::is_none")] pub is_booping_enabled: Option, /// MUST be a valid VRChat /file/ url. #[serde(rename = "userIcon", skip_serializing_if = "Option::is_none")] - pub user_icon: Option, + pub user_icon: Option>, } impl UpdateUserRequest { diff --git a/src/models/update_world_request.rs b/src/models/update_world_request.rs index d20c350..04a5fc0 100644 --- a/src/models/update_world_request.rs +++ b/src/models/update_world_request.rs @@ -9,36 +9,36 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateWorldRequest { #[serde(rename = "assetUrl", skip_serializing_if = "Option::is_none")] - pub asset_url: Option, + pub asset_url: Option>, #[serde(rename = "assetVersion", skip_serializing_if = "Option::is_none")] - pub asset_version: Option, + pub asset_version: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "authorId", skip_serializing_if = "Option::is_none")] - pub author_id: Option, + pub author_id: Option>, #[serde(rename = "authorName", skip_serializing_if = "Option::is_none")] - pub author_name: Option, + pub author_name: Option>, #[serde(rename = "capacity", skip_serializing_if = "Option::is_none")] pub capacity: Option, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, + pub description: Option>, #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")] - pub image_url: Option, + pub image_url: Option>, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, /// This can be `standalonewindows` or `android`, but can also pretty much be any random Unity verison such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. #[serde(rename = "platform", skip_serializing_if = "Option::is_none")] - pub platform: Option, + pub platform: Option>, #[serde(rename = "releaseStatus", skip_serializing_if = "Option::is_none")] pub release_status: Option, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>>, #[serde(rename = "unityPackageUrl", skip_serializing_if = "Option::is_none")] - pub unity_package_url: Option, + pub unity_package_url: Option>, #[serde(rename = "unityVersion", skip_serializing_if = "Option::is_none")] - pub unity_version: Option, + pub unity_version: Option>, } impl UpdateWorldRequest { diff --git a/src/models/user.rs b/src/models/user.rs index d679ada..bca5c16 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -9,92 +9,92 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "allowAvatarCopying")] pub allow_avatar_copying: bool, #[serde(rename = "badges", skip_serializing_if = "Option::is_none")] pub badges: Option>, #[serde(rename = "bio")] - pub bio: String, + pub bio: std::sync::Arc, #[serde(rename = "bioLinks")] - pub bio_links: Vec, + pub bio_links: Vec>, /// When profilePicOverride is not empty, use it instead. #[serde(rename = "currentAvatarImageUrl")] - pub current_avatar_image_url: String, + pub current_avatar_image_url: std::sync::Arc, /// When profilePicOverride is not empty, use it instead. #[serde(rename = "currentAvatarThumbnailImageUrl")] - pub current_avatar_thumbnail_image_url: String, + pub current_avatar_thumbnail_image_url: std::sync::Arc, #[serde(rename = "currentAvatarTags")] - pub current_avatar_tags: Vec, + pub current_avatar_tags: Vec, #[serde(rename = "date_joined")] - pub date_joined: String, + pub date_joined: std::sync::Arc, #[serde(rename = "developerType")] pub developer_type: models::DeveloperType, /// A users visual display name. This is what shows up in-game, and can different from their `username`. Changing display name is restricted to a cooldown period. #[serde(rename = "displayName")] - pub display_name: String, + pub display_name: std::sync::Arc, #[serde(rename = "friendKey")] - pub friend_key: String, + pub friend_key: std::sync::Arc, #[serde(rename = "friendRequestStatus", skip_serializing_if = "Option::is_none")] - pub friend_request_status: Option, + pub friend_request_status: Option>, /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, /// InstanceID can be \"offline\" on User profiles if you are not friends with that user and \"private\" if you are friends and user is in private instance. #[serde(rename = "instanceId", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, + pub instance_id: Option>, /// Either their `friendKey`, or empty string if you are not friends. Unknown usage. #[serde(rename = "isFriend")] pub is_friend: bool, /// Either a date-time or empty string. #[serde(rename = "last_activity")] - pub last_activity: String, + pub last_activity: std::sync::Arc, /// Either a date-time or empty string. #[serde(rename = "last_login")] - pub last_login: String, + pub last_login: std::sync::Arc, /// This can be `standalonewindows` or `android`, but can also pretty much be any random Unity verison such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. #[serde(rename = "last_platform")] - pub last_platform: String, + pub last_platform: std::sync::Arc, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "location", skip_serializing_if = "Option::is_none")] - pub location: Option, + pub location: Option>, #[serde(rename = "note", skip_serializing_if = "Option::is_none")] - pub note: Option, + pub note: Option>, #[serde(rename = "platform")] - pub platform: String, + pub platform: std::sync::Arc, #[serde(rename = "profilePicOverride")] - pub profile_pic_override: String, + pub profile_pic_override: std::sync::Arc, #[serde(rename = "profilePicOverrideThumbnail")] - pub profile_pic_override_thumbnail: String, + pub profile_pic_override_thumbnail: std::sync::Arc, #[serde(rename = "pronouns")] - pub pronouns: String, + pub pronouns: std::sync::Arc, #[serde(rename = "state")] pub state: models::UserState, #[serde(rename = "status")] pub status: models::UserStatus, #[serde(rename = "statusDescription")] - pub status_description: String, + pub status_description: std::sync::Arc, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "travelingToInstance", skip_serializing_if = "Option::is_none")] - pub traveling_to_instance: Option, + pub traveling_to_instance: Option>, #[serde(rename = "travelingToLocation", skip_serializing_if = "Option::is_none")] - pub traveling_to_location: Option, + pub traveling_to_location: Option>, #[serde(rename = "travelingToWorld", skip_serializing_if = "Option::is_none")] - pub traveling_to_world: Option, + pub traveling_to_world: Option>, #[serde(rename = "userIcon")] - pub user_icon: String, + pub user_icon: std::sync::Arc, /// -| A users unique name, used during login. This is different from `displayName` which is what shows up in-game. A users `username` can never be changed.' **DEPRECATED:** VRChat API no longer return usernames of other users. [See issue by Tupper for more information](https://github.com/pypy-vrc/VRCX/issues/429). #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, + pub username: Option>, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "worldId", skip_serializing_if = "Option::is_none")] - pub world_id: Option, + pub world_id: Option>, } impl User { - pub fn new(allow_avatar_copying: bool, bio: String, bio_links: Vec, current_avatar_image_url: String, current_avatar_thumbnail_image_url: String, current_avatar_tags: Vec, date_joined: String, developer_type: models::DeveloperType, display_name: String, friend_key: String, id: String, is_friend: bool, last_activity: String, last_login: String, last_platform: String, platform: String, profile_pic_override: String, profile_pic_override_thumbnail: String, pronouns: String, state: models::UserState, status: models::UserStatus, status_description: String, tags: Vec, user_icon: String) -> User { + pub fn new(allow_avatar_copying: bool, bio: std::sync::Arc, bio_links: Vec>, current_avatar_image_url: std::sync::Arc, current_avatar_thumbnail_image_url: std::sync::Arc, current_avatar_tags: Vec, date_joined: std::sync::Arc, developer_type: models::DeveloperType, display_name: std::sync::Arc, friend_key: std::sync::Arc, id: std::sync::Arc, is_friend: bool, last_activity: std::sync::Arc, last_login: std::sync::Arc, last_platform: std::sync::Arc, platform: std::sync::Arc, profile_pic_override: std::sync::Arc, profile_pic_override_thumbnail: std::sync::Arc, pronouns: std::sync::Arc, state: models::UserState, status: models::UserStatus, status_description: std::sync::Arc, tags: Vec, user_icon: std::sync::Arc) -> User { User { allow_avatar_copying, badges: None, diff --git a/src/models/user_exists.rs b/src/models/user_exists.rs index b1675a9..ab6716b 100644 --- a/src/models/user_exists.rs +++ b/src/models/user_exists.rs @@ -10,18 +10,22 @@ use crate::models; use serde::{Deserialize, Serialize}; /// UserExists : Status object representing if a queried user by username or userId exists or not. This model is primarily used by the `/auth/exists` endpoint, which in turn is used during registration. Please see the documentation on that endpoint for more information on usage. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserExists { /// Status if a user exist with that username or userId. #[serde(rename = "userExists")] pub user_exists: bool, + /// Is the username valid? + #[serde(rename = "nameOk")] + pub name_ok: bool, } impl UserExists { /// Status object representing if a queried user by username or userId exists or not. This model is primarily used by the `/auth/exists` endpoint, which in turn is used during registration. Please see the documentation on that endpoint for more information on usage. - pub fn new(user_exists: bool) -> UserExists { + pub fn new(user_exists: bool, name_ok: bool) -> UserExists { UserExists { user_exists, + name_ok, } } } diff --git a/src/models/user_subscription.rs b/src/models/user_subscription.rs index 6c8fa42..39e92bd 100644 --- a/src/models/user_subscription.rs +++ b/src/models/user_subscription.rs @@ -10,21 +10,21 @@ use crate::models; use serde::{Deserialize, Serialize}; /// UserSubscription : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserSubscription { #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "transactionId")] - pub transaction_id: String, + pub transaction_id: std::sync::Arc, /// Which \"Store\" it came from. Right now only Stores are \"Steam\" and \"Admin\". #[serde(rename = "store")] - pub store: String, + pub store: std::sync::Arc, #[serde(rename = "steamItemId", skip_serializing_if = "Option::is_none")] - pub steam_item_id: Option, + pub steam_item_id: Option>, #[serde(rename = "amount")] pub amount: f64, #[serde(rename = "description")] - pub description: String, + pub description: std::sync::Arc, #[serde(rename = "period")] pub period: models::SubscriptionPeriod, #[serde(rename = "tier")] @@ -34,21 +34,21 @@ pub struct UserSubscription { #[serde(rename = "status")] pub status: models::TransactionStatus, #[serde(rename = "starts", skip_serializing_if = "Option::is_none")] - pub starts: Option, + pub starts: Option>, #[serde(rename = "expires")] - pub expires: String, + pub expires: std::sync::Arc, #[serde(rename = "created_at")] - pub created_at: String, + pub created_at: std::sync::Arc, #[serde(rename = "updated_at")] - pub updated_at: String, + pub updated_at: std::sync::Arc, #[serde(rename = "licenseGroups")] - pub license_groups: Vec, + pub license_groups: Vec>, #[serde(rename = "isGift")] pub is_gift: bool, } impl UserSubscription { - pub fn new(id: String, transaction_id: String, store: String, amount: f64, description: String, period: models::SubscriptionPeriod, tier: f64, active: bool, status: models::TransactionStatus, expires: String, created_at: String, updated_at: String, license_groups: Vec, is_gift: bool) -> UserSubscription { + pub fn new(id: std::sync::Arc, transaction_id: std::sync::Arc, store: std::sync::Arc, amount: f64, description: std::sync::Arc, period: models::SubscriptionPeriod, tier: f64, active: bool, status: models::TransactionStatus, expires: std::sync::Arc, created_at: std::sync::Arc, updated_at: std::sync::Arc, license_groups: Vec>, is_gift: bool) -> UserSubscription { UserSubscription { id, transaction_id, diff --git a/src/models/verify2_fa_email_code_result.rs b/src/models/verify2_fa_email_code_result.rs index da6e29e..401be21 100644 --- a/src/models/verify2_fa_email_code_result.rs +++ b/src/models/verify2_fa_email_code_result.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Verify2FaEmailCodeResult { #[serde(rename = "verified")] pub verified: bool, diff --git a/src/models/verify2_fa_result.rs b/src/models/verify2_fa_result.rs index bc22e5c..c9290c0 100644 --- a/src/models/verify2_fa_result.rs +++ b/src/models/verify2_fa_result.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Verify2FaResult { #[serde(rename = "verified")] pub verified: bool, diff --git a/src/models/verify_auth_token_result.rs b/src/models/verify_auth_token_result.rs index 1e5f491..53451f0 100644 --- a/src/models/verify_auth_token_result.rs +++ b/src/models/verify_auth_token_result.rs @@ -9,16 +9,16 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VerifyAuthTokenResult { #[serde(rename = "ok")] pub ok: bool, #[serde(rename = "token")] - pub token: String, + pub token: std::sync::Arc, } impl VerifyAuthTokenResult { - pub fn new(ok: bool, token: String) -> VerifyAuthTokenResult { + pub fn new(ok: bool, token: std::sync::Arc) -> VerifyAuthTokenResult { VerifyAuthTokenResult { ok, token, diff --git a/src/models/world.rs b/src/models/world.rs index 733e3b8..8db5aed 100644 --- a/src/models/world.rs +++ b/src/models/world.rs @@ -10,21 +10,21 @@ use crate::models; use serde::{Deserialize, Serialize}; /// World : -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct World { /// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. #[serde(rename = "authorId")] - pub author_id: String, + pub author_id: std::sync::Arc, #[serde(rename = "authorName")] - pub author_name: String, + pub author_name: std::sync::Arc, #[serde(rename = "capacity")] pub capacity: i32, #[serde(rename = "recommendedCapacity")] pub recommended_capacity: i32, #[serde(rename = "created_at")] - pub created_at: String, + pub created_at: std::sync::Arc, #[serde(rename = "description")] - pub description: String, + pub description: std::sync::Arc, #[serde(rename = "favorites", skip_serializing_if = "Option::is_none")] pub favorites: Option, #[serde(rename = "featured")] @@ -33,27 +33,27 @@ pub struct World { pub heat: i32, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "imageUrl")] - pub image_url: String, + pub image_url: std::sync::Arc, /// Will always be an empty list when unauthenticated. #[serde(rename = "instances", skip_serializing_if = "Option::is_none")] pub instances: Option>>, #[serde(rename = "labsPublicationDate")] - pub labs_publication_date: String, + pub labs_publication_date: std::sync::Arc, #[serde(rename = "name")] - pub name: String, + pub name: std::sync::Arc, #[serde(rename = "namespace", skip_serializing_if = "Option::is_none")] - pub namespace: Option, + pub namespace: Option>, /// Will always be `0` when unauthenticated. #[serde(rename = "occupants", skip_serializing_if = "Option::is_none")] pub occupants: Option, #[serde(rename = "organization")] - pub organization: String, + pub organization: std::sync::Arc, #[serde(rename = "popularity")] pub popularity: i32, #[serde(rename = "previewYoutubeId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub preview_youtube_id: Option>, + pub preview_youtube_id: Option>>, /// Will always be `0` when unauthenticated. #[serde(rename = "privateOccupants", skip_serializing_if = "Option::is_none")] pub private_occupants: Option, @@ -61,28 +61,28 @@ pub struct World { #[serde(rename = "publicOccupants", skip_serializing_if = "Option::is_none")] pub public_occupants: Option, #[serde(rename = "publicationDate")] - pub publication_date: String, + pub publication_date: std::sync::Arc, #[serde(rename = "releaseStatus")] pub release_status: models::ReleaseStatus, #[serde(rename = "tags")] - pub tags: Vec, + pub tags: Vec, #[serde(rename = "thumbnailImageUrl")] - pub thumbnail_image_url: String, + pub thumbnail_image_url: std::sync::Arc, /// Empty if unauthenticated. #[serde(rename = "unityPackages", skip_serializing_if = "Option::is_none")] pub unity_packages: Option>, #[serde(rename = "updated_at")] - pub updated_at: String, + pub updated_at: std::sync::Arc, #[serde(rename = "version")] pub version: i32, #[serde(rename = "visits")] pub visits: i32, #[serde(rename = "udonProducts", skip_serializing_if = "Option::is_none")] - pub udon_products: Option>, + pub udon_products: Option>>, } impl World { - pub fn new(author_id: String, author_name: String, capacity: i32, recommended_capacity: i32, created_at: String, description: String, featured: bool, heat: i32, id: String, image_url: String, labs_publication_date: String, name: String, organization: String, popularity: i32, publication_date: String, release_status: models::ReleaseStatus, tags: Vec, thumbnail_image_url: String, updated_at: String, version: i32, visits: i32) -> World { + pub fn new(author_id: std::sync::Arc, author_name: std::sync::Arc, capacity: i32, recommended_capacity: i32, created_at: std::sync::Arc, description: std::sync::Arc, featured: bool, heat: i32, id: std::sync::Arc, image_url: std::sync::Arc, labs_publication_date: std::sync::Arc, name: std::sync::Arc, organization: std::sync::Arc, popularity: i32, publication_date: std::sync::Arc, release_status: models::ReleaseStatus, tags: Vec, thumbnail_image_url: std::sync::Arc, updated_at: std::sync::Arc, version: i32, visits: i32) -> World { World { author_id, author_name, diff --git a/src/models/world_metadata.rs b/src/models/world_metadata.rs index c6acf86..0f4cd18 100644 --- a/src/models/world_metadata.rs +++ b/src/models/world_metadata.rs @@ -9,17 +9,17 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorldMetadata { /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "id")] - pub id: String, + pub id: std::sync::Arc, #[serde(rename = "metadata")] pub metadata: serde_json::Value, } impl WorldMetadata { - pub fn new(id: String, metadata: serde_json::Value) -> WorldMetadata { + pub fn new(id: std::sync::Arc, metadata: serde_json::Value) -> WorldMetadata { WorldMetadata { id, metadata, diff --git a/src/models/world_publish_status.rs b/src/models/world_publish_status.rs index bf6a7d2..3573f84 100644 --- a/src/models/world_publish_status.rs +++ b/src/models/world_publish_status.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorldPublishStatus { #[serde(rename = "canPublish")] pub can_publish: bool,