vrchatapi 1.23.1-nightly.7

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

/// User object received when searching
#[serde_with::serde_as]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LimitedUserSearch {
    /// Six hexadecimal digits, without a leading `#`. May be empty.
    #[serde(rename = "bannerColor", skip_serializing_if = "Option::is_none")]
    pub banner_color: Option<String>,
    #[serde(rename = "bannerType", skip_serializing_if = "Option::is_none")]
    pub banner_type: Option<models::BannerType>,
    #[serde(rename = "bannerUrl", skip_serializing_if = "Option::is_none")]
    pub banner_url: Option<String>,
    #[serde(rename = "developerType")]
    pub developer_type: models::DeveloperType,
    #[serde(rename = "displayName")]
    pub display_name: String,
    #[serde(rename = "iconFrame", skip_serializing_if = "Option::is_none")]
    pub icon_frame: Option<String>,
    #[serde(rename = "iconUrl", skip_serializing_if = "Option::is_none")]
    pub icon_url: 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.
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "isFriend")]
    pub is_friend: bool,
    /// 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,
    #[serde(rename = "nameplateEffect", skip_serializing_if = "Option::is_none")]
    pub nameplate_effect: Option<String>,
    #[serde(rename = "profileEffect", skip_serializing_if = "Option::is_none")]
    pub profile_effect: Option<String>,
    #[serde(rename = "pronouns", skip_serializing_if = "Option::is_none")]
    pub pronouns: Option<String>,
    #[serde(rename = "status")]
    pub status: models::UserStatus,
    #[serde(rename = "statusDescription")]
    pub status_description: String,
    /// <- Always empty.
    #[serde(rename = "tags")]
    pub tags: Vec<String>,
}

impl LimitedUserSearch {
    /// User object received when searching
    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<String>,
    ) -> LimitedUserSearch {
        LimitedUserSearch {
            banner_color: None,
            banner_type: None,
            banner_url: None,
            developer_type,
            display_name,
            icon_frame: None,
            icon_url: None,
            id,
            is_friend,
            last_platform,
            nameplate_effect: None,
            profile_effect: None,
            pronouns: None,
            status,
            status_description,
            tags,
        }
    }
}