diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 9de2a91..bc8e8d6 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -49,6 +49,7 @@ docs/GroupAnnouncement.md docs/GroupAuditLogEntry.md docs/GroupGallery.md docs/GroupGalleryImage.md +docs/GroupJoinRequestAction.md docs/GroupJoinState.md docs/GroupLimitedMember.md docs/GroupMember.md @@ -202,6 +203,7 @@ src/models/group_announcement.rs src/models/group_audit_log_entry.rs src/models/group_gallery.rs src/models/group_gallery_image.rs +src/models/group_join_request_action.rs src/models/group_join_state.rs src/models/group_limited_member.rs src/models/group_member.rs diff --git a/Cargo.toml b/Cargo.toml index f0b8f2e..a4be008 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vrchatapi" -version = "1.16.7" +version = "1.16.8" authors = ["vrchatapi.lpv0t@aries.fyi"] description = "VRChat API Client for Rust" license = "MIT" diff --git a/docs/AuthenticationApi.md b/docs/AuthenticationApi.md index b6618b8..fb7c0c4 100644 --- a/docs/AuthenticationApi.md +++ b/docs/AuthenticationApi.md @@ -144,7 +144,7 @@ Finishes the login sequence with a normal 2FA-generated code for accounts with 2 Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**two_factor_auth_code** | Option<[**TwoFactorAuthCode**](TwoFactorAuthCode.md)> | | | +**two_factor_auth_code** | [**TwoFactorAuthCode**](TwoFactorAuthCode.md) | | [required] | ### Return type @@ -174,7 +174,7 @@ Finishes the login sequence with an 2FA email code. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**two_factor_email_code** | Option<[**TwoFactorEmailCode**](TwoFactorEmailCode.md)> | | | +**two_factor_email_code** | [**TwoFactorEmailCode**](TwoFactorEmailCode.md) | | [required] | ### Return type @@ -231,7 +231,7 @@ Finishes the login sequence with an OTP (One Time Password) recovery code for ac Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**two_factor_auth_code** | Option<[**TwoFactorAuthCode**](TwoFactorAuthCode.md)> | | | +**two_factor_auth_code** | [**TwoFactorAuthCode**](TwoFactorAuthCode.md) | | [required] | ### Return type diff --git a/docs/GroupJoinRequestAction.md b/docs/GroupJoinRequestAction.md new file mode 100644 index 0000000..778786c --- /dev/null +++ b/docs/GroupJoinRequestAction.md @@ -0,0 +1,10 @@ +# GroupJoinRequestAction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/docs/GroupLimitedMember.md b/docs/GroupLimitedMember.md index a717227..8ec3daa 100644 --- a/docs/GroupLimitedMember.md +++ b/docs/GroupLimitedMember.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **role_ids** | Option<**Vec**> | | [optional] **m_role_ids** | Option<**Vec**> | | [optional] **joined_at** | Option<**String**> | | [optional] -**membership_status** | Option<**String**> | | [optional] +**membership_status** | Option<[**crate::models::GroupMemberStatus**](GroupMemberStatus.md)> | | [optional] **visibility** | Option<**String**> | | [optional] **is_subscribed_to_announcements** | Option<**bool**> | | [optional][default to false] **created_at** | Option<**String**> | Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. | [optional] diff --git a/docs/GroupMember.md b/docs/GroupMember.md index a96e5d9..1ca3e3b 100644 --- a/docs/GroupMember.md +++ b/docs/GroupMember.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **role_ids** | Option<**Vec**> | | [optional] **m_role_ids** | Option<**Vec**> | | [optional] **joined_at** | Option<**String**> | | [optional] -**membership_status** | Option<**String**> | | [optional] +**membership_status** | Option<[**crate::models::GroupMemberStatus**](GroupMemberStatus.md)> | | [optional] **visibility** | Option<**String**> | | [optional] **is_subscribed_to_announcements** | Option<**bool**> | | [optional][default to false] **created_at** | Option<**String**> | Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. | [optional] diff --git a/docs/GroupsApi.md b/docs/GroupsApi.md index df1a2e5..d94a5fb 100644 --- a/docs/GroupsApi.md +++ b/docs/GroupsApi.md @@ -58,7 +58,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **String** | Must be a valid group ID. | [required] | **group_gallery_id** | **String** | Must be a valid group gallery ID. | [required] | -**add_group_gallery_image_request** | Option<[**AddGroupGalleryImageRequest**](AddGroupGalleryImageRequest.md)> | | | +**add_group_gallery_image_request** | [**AddGroupGalleryImageRequest**](AddGroupGalleryImageRequest.md) | | [required] | ### Return type @@ -121,7 +121,7 @@ Bans a user from a Group. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **String** | Must be a valid group ID. | [required] | -**ban_group_member_request** | Option<[**BanGroupMemberRequest**](BanGroupMemberRequest.md)> | | | +**ban_group_member_request** | [**BanGroupMemberRequest**](BanGroupMemberRequest.md) | | [required] | ### Return type @@ -181,7 +181,7 @@ Creates a Group and returns a Group object. **Requires VRC+ Subscription.** Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**create_group_request** | Option<[**CreateGroupRequest**](CreateGroupRequest.md)> | | | +**create_group_request** | [**CreateGroupRequest**](CreateGroupRequest.md) | | [required] | ### Return type @@ -212,7 +212,7 @@ Creates an Announcement for a Group. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **String** | Must be a valid group ID. | [required] | -**create_group_announcement_request** | Option<[**CreateGroupAnnouncementRequest**](CreateGroupAnnouncementRequest.md)> | | | +**create_group_announcement_request** | [**CreateGroupAnnouncementRequest**](CreateGroupAnnouncementRequest.md) | | [required] | ### Return type @@ -243,7 +243,7 @@ Creates a gallery for a Group. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **String** | Must be a valid group ID. | [required] | -**create_group_gallery_request** | Option<[**CreateGroupGalleryRequest**](CreateGroupGalleryRequest.md)> | | | +**create_group_gallery_request** | [**CreateGroupGalleryRequest**](CreateGroupGalleryRequest.md) | | [required] | ### Return type @@ -274,7 +274,7 @@ Sends an invite to a user to join the group. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **String** | Must be a valid group ID. | [required] | -**create_group_invite_request** | Option<[**CreateGroupInviteRequest**](CreateGroupInviteRequest.md)> | | | +**create_group_invite_request** | [**CreateGroupInviteRequest**](CreateGroupInviteRequest.md) | | [required] | ### Return type @@ -305,7 +305,7 @@ Create a Group role. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **String** | Must be a valid group ID. | [required] | -**create_group_role_request** | Option<[**CreateGroupRoleRequest**](CreateGroupRoleRequest.md)> | | | +**create_group_role_request** | [**CreateGroupRoleRequest**](CreateGroupRoleRequest.md) | | [required] | ### Return type @@ -994,7 +994,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **group_id** | **String** | Must be a valid group ID. | [required] | **user_id** | **String** | Must be a valid user ID. | [required] | -**respond_group_join_request** | Option<[**RespondGroupJoinRequest**](RespondGroupJoinRequest.md)> | | | +**respond_group_join_request** | [**RespondGroupJoinRequest**](RespondGroupJoinRequest.md) | | [required] | ### Return type diff --git a/docs/Instance.md b/docs/Instance.md index 7b9ae82..dbdb89e 100644 --- a/docs/Instance.md +++ b/docs/Instance.md @@ -27,6 +27,14 @@ Name | Type | Description | Notes **hidden** | 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] **friends** | 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] **private** | 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] +**queue_enabled** | **bool** | | +**queue_size** | **i32** | | +**recommended_capacity** | **i32** | | +**role_restricted** | **bool** | | +**strict** | **bool** | | +**user_count** | **i32** | | +**world** | [**crate::models::World**](World.md) | | +**users** | Option<[**Vec**](LimitedUser.md)> | The users field is present on instances created by the requesting user. | [optional] [[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/docs/InviteApi.md b/docs/InviteApi.md index 1169efd..f98ecf9 100644 --- a/docs/InviteApi.md +++ b/docs/InviteApi.md @@ -122,7 +122,7 @@ Sends an invite to a user. Returns the Notification of type `invite` that was se Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **String** | Must be a valid user ID. | [required] | -**invite_request** | Option<[**InviteRequest**](InviteRequest.md)> | Slot number of the Invite Message to use when inviting a user. | | +**invite_request** | [**InviteRequest**](InviteRequest.md) | Slot number of the Invite Message to use when inviting a user. | [required] | ### Return type @@ -216,7 +216,7 @@ Respond to an invite request by sending a world invite to the requesting user. ` Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **notification_id** | **String** | Must be a valid notification ID. | [required] | -**invite_response** | Option<[**InviteResponse**](InviteResponse.md)> | Slot number of the Response Message to use when responding to a user. | | +**invite_response** | [**InviteResponse**](InviteResponse.md) | Slot number of the Response Message to use when responding to a user. | [required] | ### Return type diff --git a/docs/PlayermoderationApi.md b/docs/PlayermoderationApi.md index 077f8d1..8b55cfc 100644 --- a/docs/PlayermoderationApi.md +++ b/docs/PlayermoderationApi.md @@ -143,7 +143,7 @@ Moderate a user, e.g. unmute them or show their avatar. Please see the [Player Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**moderate_user_request** | Option<[**ModerateUserRequest**](ModerateUserRequest.md)> | | | +**moderate_user_request** | [**ModerateUserRequest**](ModerateUserRequest.md) | | [required] | ### Return type @@ -173,7 +173,7 @@ Removes a player moderation previously added through `moderateUser`. E.g if you Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**moderate_user_request** | Option<[**ModerateUserRequest**](ModerateUserRequest.md)> | | | +**moderate_user_request** | [**ModerateUserRequest**](ModerateUserRequest.md) | | [required] | ### Return type diff --git a/docs/RespondGroupJoinRequest.md b/docs/RespondGroupJoinRequest.md index 972cd02..d03d95b 100644 --- a/docs/RespondGroupJoinRequest.md +++ b/docs/RespondGroupJoinRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | Option<**String**> | | [optional] +**action** | [**crate::models::GroupJoinRequestAction**](GroupJoinRequestAction.md) | | [[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/docs/World.md b/docs/World.md index 7d00345..c76c526 100644 --- a/docs/World.md +++ b/docs/World.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **instances** | Option<[**Vec>**](array.md)> | Will always be an empty list when unauthenticated. | [optional] **labs_publication_date** | **String** | | **name** | **String** | | -**namespace** | **String** | | +**namespace** | Option<**String**> | | [optional] **occupants** | Option<**i32**> | Will always be `0` when unauthenticated. | [optional][default to 0] **organization** | **String** | | [default to vrchat] **popularity** | **i32** | | [default to 0] diff --git a/src/apis/authentication_api.rs b/src/apis/authentication_api.rs index 54e5274..d060057 100644 --- a/src/apis/authentication_api.rs +++ b/src/apis/authentication_api.rs @@ -206,7 +206,7 @@ pub fn logout(configuration: &configuration::Configuration, ) -> Result) -> Result> { +pub fn verify2_fa(configuration: &configuration::Configuration, two_factor_auth_code: crate::models::TwoFactorAuthCode) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -235,7 +235,7 @@ pub fn verify2_fa(configuration: &configuration::Configuration, two_factor_auth_ } /// Finishes the login sequence with an 2FA email code. -pub fn verify2_fa_email_code(configuration: &configuration::Configuration, two_factor_email_code: Option) -> Result> { +pub fn verify2_fa_email_code(configuration: &configuration::Configuration, two_factor_email_code: crate::models::TwoFactorEmailCode) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -292,7 +292,7 @@ pub fn verify_auth_token(configuration: &configuration::Configuration, ) -> Resu } /// Finishes the login sequence with an OTP (One Time Password) recovery code for accounts with 2FA-protection enabled. -pub fn verify_recovery_code(configuration: &configuration::Configuration, two_factor_auth_code: Option) -> Result> { +pub fn verify_recovery_code(configuration: &configuration::Configuration, two_factor_auth_code: crate::models::TwoFactorAuthCode) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/src/apis/groups_api.rs b/src/apis/groups_api.rs index eaee919..e5873e7 100644 --- a/src/apis/groups_api.rs +++ b/src/apis/groups_api.rs @@ -352,7 +352,7 @@ pub enum UpdateGroupRoleError { /// Adds an image to a Group gallery. -pub fn add_group_gallery_image(configuration: &configuration::Configuration, group_id: &str, group_gallery_id: &str, add_group_gallery_image_request: Option) -> Result> { +pub fn add_group_gallery_image(configuration: &configuration::Configuration, group_id: &str, group_gallery_id: &str, add_group_gallery_image_request: crate::models::AddGroupGalleryImageRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -409,7 +409,7 @@ pub fn add_group_member_role(configuration: &configuration::Configuration, group } /// Bans a user from a Group. -pub fn ban_group_member(configuration: &configuration::Configuration, group_id: &str, ban_group_member_request: Option) -> Result> { +pub fn ban_group_member(configuration: &configuration::Configuration, group_id: &str, ban_group_member_request: crate::models::BanGroupMemberRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -466,7 +466,7 @@ pub fn cancel_group_request(configuration: &configuration::Configuration, group_ } /// Creates a Group and returns a Group object. **Requires VRC+ Subscription.** -pub fn create_group(configuration: &configuration::Configuration, create_group_request: Option) -> Result> { +pub fn create_group(configuration: &configuration::Configuration, create_group_request: crate::models::CreateGroupRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -495,7 +495,7 @@ pub fn create_group(configuration: &configuration::Configuration, create_group_r } /// Creates an Announcement for a Group. -pub fn create_group_announcement(configuration: &configuration::Configuration, group_id: &str, create_group_announcement_request: Option) -> Result> { +pub fn create_group_announcement(configuration: &configuration::Configuration, group_id: &str, create_group_announcement_request: crate::models::CreateGroupAnnouncementRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -524,7 +524,7 @@ pub fn create_group_announcement(configuration: &configuration::Configuration, g } /// Creates a gallery for a Group. -pub fn create_group_gallery(configuration: &configuration::Configuration, group_id: &str, create_group_gallery_request: Option) -> Result> { +pub fn create_group_gallery(configuration: &configuration::Configuration, group_id: &str, create_group_gallery_request: crate::models::CreateGroupGalleryRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -553,7 +553,7 @@ pub fn create_group_gallery(configuration: &configuration::Configuration, group_ } /// Sends an invite to a user to join the group. -pub fn create_group_invite(configuration: &configuration::Configuration, group_id: &str, create_group_invite_request: Option) -> Result<(), Error> { +pub fn create_group_invite(configuration: &configuration::Configuration, group_id: &str, create_group_invite_request: crate::models::CreateGroupInviteRequest) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -582,7 +582,7 @@ pub fn create_group_invite(configuration: &configuration::Configuration, group_i } /// Create a Group role. -pub fn create_group_role(configuration: &configuration::Configuration, group_id: &str, create_group_role_request: Option) -> Result> { +pub fn create_group_role(configuration: &configuration::Configuration, group_id: &str, create_group_role_request: crate::models::CreateGroupRoleRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -1250,7 +1250,7 @@ pub fn remove_group_member_role(configuration: &configuration::Configuration, gr } /// Responds to a Group Join Request with Accept/Deny -pub fn respond_group_join_request(configuration: &configuration::Configuration, group_id: &str, user_id: &str, respond_group_join_request: Option) -> Result<(), Error> { +pub fn respond_group_join_request(configuration: &configuration::Configuration, group_id: &str, user_id: &str, respond_group_join_request: crate::models::RespondGroupJoinRequest) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/src/apis/invite_api.rs b/src/apis/invite_api.rs index cbe4a49..bc22da2 100644 --- a/src/apis/invite_api.rs +++ b/src/apis/invite_api.rs @@ -172,7 +172,7 @@ pub fn invite_myself_to(configuration: &configuration::Configuration, world_id: } /// Sends an invite to a user. Returns the Notification of type `invite` that was sent. -pub fn invite_user(configuration: &configuration::Configuration, user_id: &str, invite_request: Option) -> Result> { +pub fn invite_user(configuration: &configuration::Configuration, user_id: &str, invite_request: crate::models::InviteRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -258,7 +258,7 @@ pub fn reset_invite_message(configuration: &configuration::Configuration, user_i } /// Respond to an invite request by sending a world invite to the requesting user. `:notificationId` is the ID of the requesting notification. -pub fn respond_invite(configuration: &configuration::Configuration, notification_id: &str, invite_response: Option) -> Result> { +pub fn respond_invite(configuration: &configuration::Configuration, notification_id: &str, invite_response: crate::models::InviteResponse) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/src/apis/playermoderation_api.rs b/src/apis/playermoderation_api.rs index 6af6404..337d7df 100644 --- a/src/apis/playermoderation_api.rs +++ b/src/apis/playermoderation_api.rs @@ -183,7 +183,7 @@ pub fn get_player_moderations(configuration: &configuration::Configuration, r#ty } /// Moderate a user, e.g. unmute them or show their avatar. Please see the [Player Moderation docs](https://vrchatapi.github.io/docs/api/#tag--playermoderation) on what playerModerations are, and how they differ from staff moderations. -pub fn moderate_user(configuration: &configuration::Configuration, moderate_user_request: Option) -> Result> { +pub fn moderate_user(configuration: &configuration::Configuration, moderate_user_request: crate::models::ModerateUserRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -212,7 +212,7 @@ pub fn moderate_user(configuration: &configuration::Configuration, moderate_user } /// Removes a player moderation previously added through `moderateUser`. E.g if you previously have shown their avatar, but now want to reset it to default. -pub fn unmoderate_user(configuration: &configuration::Configuration, moderate_user_request: Option) -> Result> { +pub fn unmoderate_user(configuration: &configuration::Configuration, moderate_user_request: crate::models::ModerateUserRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/src/models/group_join_request_action.rs b/src/models/group_join_request_action.rs new file mode 100644 index 0000000..fd953ae --- /dev/null +++ b/src/models/group_join_request_action.rs @@ -0,0 +1,37 @@ +/* + * VRChat API Documentation + * + * + * Contact: vrchatapi.lpv0t@aries.fyi + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum GroupJoinRequestAction { + #[serde(rename = "accept")] + Accept, + #[serde(rename = "reject")] + Reject, + +} + +impl ToString for GroupJoinRequestAction { + fn to_string(&self) -> String { + match self { + Self::Accept => String::from("accept"), + Self::Reject => String::from("reject"), + } + } +} + +impl Default for GroupJoinRequestAction { + fn default() -> GroupJoinRequestAction { + Self::Accept + } +} + + + + diff --git a/src/models/group_limited_member.rs b/src/models/group_limited_member.rs index 0e3a415..69a2a8e 100644 --- a/src/models/group_limited_member.rs +++ b/src/models/group_limited_member.rs @@ -28,7 +28,7 @@ pub struct GroupLimitedMember { #[serde(rename = "joinedAt", skip_serializing_if = "Option::is_none")] pub joined_at: Option, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] - pub membership_status: Option, + pub membership_status: Option, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] diff --git a/src/models/group_member.rs b/src/models/group_member.rs index 1438a02..c470c7c 100644 --- a/src/models/group_member.rs +++ b/src/models/group_member.rs @@ -27,10 +27,10 @@ pub struct GroupMember { pub role_ids: Option>, #[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")] pub m_role_ids: Option>, - #[serde(rename = "joinedAt", skip_serializing_if = "Option::is_none")] - pub joined_at: Option, + #[serde(rename = "joinedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub joined_at: Option>, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] - pub membership_status: Option, + pub membership_status: Option, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] diff --git a/src/models/group_member_limited_user.rs b/src/models/group_member_limited_user.rs index 88e5ade..be42a28 100644 --- a/src/models/group_member_limited_user.rs +++ b/src/models/group_member_limited_user.rs @@ -23,8 +23,8 @@ pub struct GroupMemberLimitedUser { pub icon_url: Option, #[serde(rename = "profilePicOverride", skip_serializing_if = "Option::is_none")] pub profile_pic_override: Option, - #[serde(rename = "currentAvatarThumbnailImageUrl", skip_serializing_if = "Option::is_none")] - pub current_avatar_thumbnail_image_url: Option, + #[serde(rename = "currentAvatarThumbnailImageUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub current_avatar_thumbnail_image_url: Option>, #[serde(rename = "currentAvatarTags", skip_serializing_if = "Option::is_none")] pub current_avatar_tags: Option>, } diff --git a/src/models/group_member_status.rs b/src/models/group_member_status.rs index 002eba1..eec3807 100644 --- a/src/models/group_member_status.rs +++ b/src/models/group_member_status.rs @@ -18,6 +18,8 @@ pub enum GroupMemberStatus { Requested, #[serde(rename = "invited")] Invited, + #[serde(rename = "banned")] + Banned, } @@ -28,6 +30,7 @@ impl ToString for GroupMemberStatus { Self::Member => String::from("member"), Self::Requested => String::from("requested"), Self::Invited => String::from("invited"), + Self::Banned => String::from("banned"), } } } diff --git a/src/models/instance.rs b/src/models/instance.rs index 943f6eb..017650c 100644 --- a/src/models/instance.rs +++ b/src/models/instance.rs @@ -67,11 +67,28 @@ pub struct Instance { /// 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, + #[serde(rename = "queueEnabled")] + pub queue_enabled: bool, + #[serde(rename = "queueSize")] + pub queue_size: i32, + #[serde(rename = "recommendedCapacity")] + pub recommended_capacity: i32, + #[serde(rename = "roleRestricted")] + pub role_restricted: bool, + #[serde(rename = "strict")] + pub strict: bool, + #[serde(rename = "userCount")] + pub user_count: i32, + #[serde(rename = "world")] + pub world: Box, + /// The users field is present on instances created by the requesting user. + #[serde(rename = "users", skip_serializing_if = "Option::is_none")] + pub users: 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: crate::models::Region, platforms: crate::models::InstancePlatforms, region: crate::models::Region, secure_name: String, tags: Vec, r#type: crate::models::InstanceType, world_id: String) -> 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, 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 { Instance { active, can_request_invite, @@ -96,6 +113,14 @@ impl Instance { hidden: None, friends: None, private: None, + queue_enabled, + queue_size, + recommended_capacity, + role_restricted, + strict, + user_count, + world: Box::new(world), + users: None, } } } diff --git a/src/models/mod.rs b/src/models/mod.rs index af67c74..abc651a 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -84,6 +84,8 @@ pub mod group_gallery; pub use self::group_gallery::GroupGallery; pub mod group_gallery_image; pub use self::group_gallery_image::GroupGalleryImage; +pub mod group_join_request_action; +pub use self::group_join_request_action::GroupJoinRequestAction; pub mod group_join_state; pub use self::group_join_state::GroupJoinState; pub mod group_limited_member; diff --git a/src/models/respond_group_join_request.rs b/src/models/respond_group_join_request.rs index bf29dbd..7a00956 100644 --- a/src/models/respond_group_join_request.rs +++ b/src/models/respond_group_join_request.rs @@ -11,14 +11,14 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct RespondGroupJoinRequest { - #[serde(rename = "action", skip_serializing_if = "Option::is_none")] - pub action: Option, + #[serde(rename = "action")] + pub action: crate::models::GroupJoinRequestAction, } impl RespondGroupJoinRequest { - pub fn new() -> RespondGroupJoinRequest { + pub fn new(action: crate::models::GroupJoinRequestAction) -> RespondGroupJoinRequest { RespondGroupJoinRequest { - action: None, + action, } } } diff --git a/src/models/world.rs b/src/models/world.rs index fee23e6..7788792 100644 --- a/src/models/world.rs +++ b/src/models/world.rs @@ -43,8 +43,8 @@ pub struct World { pub labs_publication_date: String, #[serde(rename = "name")] pub name: String, - #[serde(rename = "namespace")] - pub namespace: String, + #[serde(rename = "namespace", skip_serializing_if = "Option::is_none")] + pub namespace: Option, /// Will always be `0` when unauthenticated. #[serde(rename = "occupants", skip_serializing_if = "Option::is_none")] pub occupants: Option, @@ -84,7 +84,7 @@ pub struct World { 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, namespace: String, organization: String, popularity: i32, publication_date: String, release_status: crate::models::ReleaseStatus, tags: Vec, thumbnail_image_url: String, updated_at: String, version: i32, visits: i32) -> 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: crate::models::ReleaseStatus, tags: Vec, thumbnail_image_url: String, updated_at: String, version: i32, visits: i32) -> World { World { author_id, author_name, @@ -100,7 +100,7 @@ impl World { instances: None, labs_publication_date, name, - namespace, + namespace: None, occupants: None, organization, popularity,