vrchatapi 1.20.8-nightly.15

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreatePropRequest {
    #[serde(rename = "assetUrl")]
    pub asset_url: String,
    #[serde(rename = "assetVersion")]
    pub asset_version: i32,
    #[serde(rename = "description")]
    pub description: String,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "imageUrl")]
    pub image_url: String,
    #[serde(rename = "name")]
    pub name: 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")]
    pub platform: String,
    #[serde(rename = "propSignature", skip_serializing_if = "Option::is_none")]
    pub prop_signature: Option<String>,
    /// How a prop is summoned and interacted with. 0: the prop fixed to some surface in the world 1: the prop is a pickup and may be held by users 2: ???
    #[serde(rename = "spawnType")]
    pub spawn_type: i32,
    #[serde(rename = "tags")]
    pub tags: Vec<String>,
    #[serde(rename = "unityVersion")]
    pub unity_version: String,
    /// Bitmask for restrictions on what world surfaces a prop may be summoned. 0: no restrictions 1: floors 2: walls 4: ceilings
    #[serde(rename = "worldPlacementMask")]
    pub world_placement_mask: i32,
}

impl CreatePropRequest {
    pub fn new(
        asset_url: String,
        asset_version: i32,
        description: String,
        id: String,
        image_url: String,
        name: String,
        platform: String,
        spawn_type: i32,
        tags: Vec<String>,
        unity_version: String,
        world_placement_mask: i32,
    ) -> CreatePropRequest {
        CreatePropRequest {
            asset_url,
            asset_version,
            description,
            id,
            image_url,
            name,
            platform,
            prop_signature: None,
            spawn_type,
            tags,
            unity_version,
            world_placement_mask,
        }
    }
}