mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-22 23:55:33 +00:00
Upgrade Rust SDK to spec 1.17.0
This commit is contained in:
@ -35,9 +35,9 @@ pub struct Instance {
|
||||
pub n_users: i32,
|
||||
#[serde(rename = "name")]
|
||||
pub name: 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 = "ownerId", skip_serializing_if = "Option::is_none")]
|
||||
pub owner_id: Option<String>,
|
||||
/// 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<Option<String>>,
|
||||
#[serde(rename = "permanent")]
|
||||
pub permanent: bool,
|
||||
#[serde(rename = "photonRegion")]
|
||||
@ -48,8 +48,8 @@ pub struct Instance {
|
||||
pub region: crate::models::Region,
|
||||
#[serde(rename = "secureName")]
|
||||
pub secure_name: String,
|
||||
#[serde(rename = "shortName", skip_serializing_if = "Option::is_none")]
|
||||
pub short_name: Option<String>,
|
||||
#[serde(rename = "shortName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub short_name: Option<Option<String>>,
|
||||
/// The tags array on Instances usually contain the language tags of the people in the instance.
|
||||
#[serde(rename = "tags")]
|
||||
pub tags: Vec<String>,
|
||||
@ -73,8 +73,8 @@ pub struct Instance {
|
||||
pub queue_size: i32,
|
||||
#[serde(rename = "recommendedCapacity")]
|
||||
pub recommended_capacity: i32,
|
||||
#[serde(rename = "roleRestricted")]
|
||||
pub role_restricted: bool,
|
||||
#[serde(rename = "roleRestricted", skip_serializing_if = "Option::is_none")]
|
||||
pub role_restricted: Option<bool>,
|
||||
#[serde(rename = "strict")]
|
||||
pub strict: bool,
|
||||
#[serde(rename = "userCount")]
|
||||
@ -84,11 +84,21 @@ pub struct Instance {
|
||||
/// The users field is present on instances created by the requesting user.
|
||||
#[serde(rename = "users", skip_serializing_if = "Option::is_none")]
|
||||
pub users: Option<Vec<crate::models::LimitedUser>>,
|
||||
#[serde(rename = "groupAccessType", skip_serializing_if = "Option::is_none")]
|
||||
pub group_access_type: Option<crate::models::GroupAccessType>,
|
||||
#[serde(rename = "hasCapacityForYou", skip_serializing_if = "Option::is_none")]
|
||||
pub has_capacity_for_you: Option<bool>,
|
||||
#[serde(rename = "nonce", skip_serializing_if = "Option::is_none")]
|
||||
pub nonce: Option<String>,
|
||||
#[serde(rename = "closedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub closed_at: Option<Option<String>>,
|
||||
#[serde(rename = "hardClose", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub hard_close: Option<Option<bool>>,
|
||||
}
|
||||
|
||||
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: crate::models::Region, platforms: crate::models::InstancePlatforms, region: crate::models::Region, secure_name: String, tags: Vec<String>, r#type: crate::models::InstanceType, world_id: String, queue_enabled: bool, queue_size: i32, recommended_capacity: i32, role_restricted: bool, strict: bool, user_count: i32, world: crate::models::World) -> Instance {
|
||||
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: crate::models::Region, platforms: crate::models::InstancePlatforms, region: crate::models::Region, secure_name: String, tags: Vec<String>, r#type: crate::models::InstanceType, world_id: String, queue_enabled: bool, queue_size: i32, recommended_capacity: i32, strict: bool, user_count: i32, world: crate::models::World) -> Instance {
|
||||
Instance {
|
||||
active,
|
||||
can_request_invite,
|
||||
@ -116,11 +126,16 @@ impl Instance {
|
||||
queue_enabled,
|
||||
queue_size,
|
||||
recommended_capacity,
|
||||
role_restricted,
|
||||
role_restricted: None,
|
||||
strict,
|
||||
user_count,
|
||||
world: Box::new(world),
|
||||
users: None,
|
||||
group_access_type: None,
|
||||
has_capacity_for_you: None,
|
||||
nonce: None,
|
||||
closed_at: None,
|
||||
hard_close: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user