vrchatapi 1.20.8-nightly.11

VRChat API Client for Rust
Documentation
use crate::models;
use serde::{Deserialize, Serialize};

/// LimitedUserInstance : User object received when querying your own instance
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LimitedUserInstance {
    #[serde(rename = "ageVerificationStatus")]
    pub age_verification_status: models::AgeVerificationStatus,
    /// `true` if, user is age verified (not 18+).
    #[serde(rename = "ageVerified")]
    pub age_verified: bool,
    #[serde(rename = "allowAvatarCopying")]
    pub allow_avatar_copying: bool,
    #[serde(rename = "bio", skip_serializing_if = "Option::is_none")]
    pub bio: Option<String>,
    #[serde(rename = "bioLinks", skip_serializing_if = "Option::is_none")]
    pub bio_links: Option<Vec<String>>,
    /// When profilePicOverride is not empty, use it instead.
    #[serde(rename = "currentAvatarImageUrl")]
    pub current_avatar_image_url: String,
    #[serde(rename = "currentAvatarTags")]
    pub current_avatar_tags: Vec<String>,
    /// When profilePicOverride is not empty, use it instead.
    #[serde(rename = "currentAvatarThumbnailImageUrl")]
    pub current_avatar_thumbnail_image_url: String,
    #[serde(rename = "date_joined", deserialize_with = "Option::deserialize")]
    pub date_joined: Option<String>,
    #[serde(rename = "developerType")]
    pub developer_type: models::DeveloperType,
    #[serde(rename = "displayName")]
    pub display_name: String,
    #[serde(rename = "friendKey")]
    pub friend_key: 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.
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
    pub image_url: Option<String>,
    #[serde(rename = "isFriend")]
    pub is_friend: bool,
    #[serde(rename = "last_activity", deserialize_with = "Option::deserialize")]
    pub last_activity: Option<String>,
    #[serde(
        rename = "last_mobile",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_mobile: Option<Option<String>>,
    /// This is normally `android`, `ios`, `standalonewindows`, `web`, or the empty value ``, but also supposedly can be any random Unity version such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`.
    #[serde(rename = "last_platform")]
    pub last_platform: String,
    /// This is normally `android`, `ios`, `standalonewindows`, `web`, or the empty value ``, but also supposedly can be any random Unity version 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<String>,
    #[serde(rename = "profilePicOverride", skip_serializing_if = "Option::is_none")]
    pub profile_pic_override: Option<String>,
    #[serde(
        rename = "profilePicOverrideThumbnail",
        skip_serializing_if = "Option::is_none"
    )]
    pub profile_pic_override_thumbnail: Option<String>,
    #[serde(rename = "pronouns")]
    pub pronouns: String,
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<models::UserState>,
    #[serde(rename = "status")]
    pub status: models::UserStatus,
    #[serde(rename = "statusDescription")]
    pub status_description: String,
    #[serde(rename = "tags")]
    pub tags: Vec<String>,
    #[serde(rename = "userIcon", skip_serializing_if = "Option::is_none")]
    pub user_icon: Option<String>,
}

impl LimitedUserInstance {
    /// User object received when querying your own instance
    pub fn new(
        age_verification_status: models::AgeVerificationStatus,
        age_verified: bool,
        allow_avatar_copying: bool,
        current_avatar_image_url: String,
        current_avatar_tags: Vec<String>,
        current_avatar_thumbnail_image_url: String,
        date_joined: Option<String>,
        developer_type: models::DeveloperType,
        display_name: String,
        friend_key: String,
        id: String,
        is_friend: bool,
        last_activity: Option<String>,
        last_platform: String,
        pronouns: String,
        status: models::UserStatus,
        status_description: String,
        tags: Vec<String>,
    ) -> LimitedUserInstance {
        LimitedUserInstance {
            age_verification_status,
            age_verified,
            allow_avatar_copying,
            bio: None,
            bio_links: None,
            current_avatar_image_url,
            current_avatar_tags,
            current_avatar_thumbnail_image_url,
            date_joined,
            developer_type,
            display_name,
            friend_key,
            id,
            image_url: None,
            is_friend,
            last_activity,
            last_mobile: None,
            last_platform,
            platform: None,
            profile_pic_override: None,
            profile_pic_override_thumbnail: None,
            pronouns,
            state: None,
            status,
            status_description,
            tags,
            user_icon: None,
        }
    }
}