From 540380355dfa26b640e1509f797d1c54e32626e9 Mon Sep 17 00:00:00 2001 From: VRCCat Date: Sat, 24 Feb 2024 15:11:17 +0000 Subject: [PATCH] Upgrade Rust SDK to spec 1.16.6 --- .openapi-generator/FILES | 2 + Cargo.toml | 2 +- docs/CreateAvatarRequest.md | 1 + docs/GroupAuditLogEntry.md | 2 +- docs/RepresentedGroup.md | 24 +++++++++++ docs/UpdateAvatarRequest.md | 1 + docs/UsersApi.md | 31 ++++++++++++++ src/apis/users_api.rs | 36 ++++++++++++++++ src/models/create_avatar_request.rs | 3 ++ src/models/group_audit_log_entry.rs | 6 +-- src/models/mod.rs | 2 + src/models/represented_group.rs | 66 +++++++++++++++++++++++++++++ src/models/update_avatar_request.rs | 3 ++ 13 files changed, 174 insertions(+), 5 deletions(-) create mode 100644 docs/RepresentedGroup.md create mode 100644 src/models/represented_group.rs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index a24a69f..9de2a91 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -100,6 +100,7 @@ docs/PlayerModerationType.md docs/PlayermoderationApi.md docs/Region.md docs/ReleaseStatus.md +docs/RepresentedGroup.md docs/RequestInviteRequest.md docs/RespondGroupJoinRequest.md docs/Response.md @@ -247,6 +248,7 @@ src/models/player_moderation.rs src/models/player_moderation_type.rs src/models/region.rs src/models/release_status.rs +src/models/represented_group.rs src/models/request_invite_request.rs src/models/respond_group_join_request.rs src/models/response.rs diff --git a/Cargo.toml b/Cargo.toml index fd4afc3..5679e12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vrchatapi" -version = "1.16.5" +version = "1.16.6" authors = ["vrchatapi.lpv0t@aries.fyi"] description = "VRChat API Client for Rust" license = "MIT" diff --git a/docs/CreateAvatarRequest.md b/docs/CreateAvatarRequest.md index 9453f79..af2818d 100644 --- a/docs/CreateAvatarRequest.md +++ b/docs/CreateAvatarRequest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **release_status** | Option<[**crate::models::ReleaseStatus**](ReleaseStatus.md)> | | [optional] **version** | Option<**f32**> | | [optional][default to 1] **unity_package_url** | Option<**String**> | | [optional] +**unity_version** | Option<**String**> | | [optional][default to 5.3.4p1] [[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/GroupAuditLogEntry.md b/docs/GroupAuditLogEntry.md index 7f64dda..d938661 100644 --- a/docs/GroupAuditLogEntry.md +++ b/docs/GroupAuditLogEntry.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **created_at** | Option<**String**> | | [optional] **group_id** | Option<**String**> | | [optional] **actor_id** | 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] -**actor_displayname** | Option<**String**> | | [optional] +**actor_display_name** | Option<**String**> | | [optional] **target_id** | Option<**String**> | Typically GroupID or GroupRoleID, but could be other types of IDs. | [optional] **event_type** | Option<**String**> | The type of event that occurred. This is a string that is prefixed with the type of object that the event occurred on. For example, a group role update event would be prefixed with `group.role`. | [optional][default to group.update] **description** | Option<**String**> | A human-readable description of the event. | [optional] diff --git a/docs/RepresentedGroup.md b/docs/RepresentedGroup.md new file mode 100644 index 0000000..2b9aa3f --- /dev/null +++ b/docs/RepresentedGroup.md @@ -0,0 +1,24 @@ +# RepresentedGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | | [optional] +**short_code** | Option<**String**> | | [optional] +**discriminator** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**icon_id** | Option<**String**> | | [optional] +**icon_url** | Option<**String**> | | [optional] +**banner_id** | Option<**String**> | | [optional] +**banner_url** | Option<**String**> | | [optional] +**privacy** | Option<[**crate::models::GroupPrivacy**](GroupPrivacy.md)> | | [optional] +**owner_id** | 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] +**member_count** | Option<**i32**> | | [optional] +**group_id** | Option<**String**> | | [optional] +**member_visibility** | Option<[**crate::models::GroupUserVisibility**](GroupUserVisibility.md)> | | [optional] +**is_representing** | Option<**bool**> | | [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/UpdateAvatarRequest.md b/docs/UpdateAvatarRequest.md index 570ad6f..f4466c9 100644 --- a/docs/UpdateAvatarRequest.md +++ b/docs/UpdateAvatarRequest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **release_status** | Option<[**crate::models::ReleaseStatus**](ReleaseStatus.md)> | | [optional] **version** | Option<**f32**> | | [optional][default to 1] **unity_package_url** | Option<**String**> | | [optional] +**unity_version** | Option<**String**> | | [optional][default to 5.3.4p1] [[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/UsersApi.md b/docs/UsersApi.md index 65063ef..e840b38 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**get_user_by_name**](UsersApi.md#get_user_by_name) | **GET** /users/{username}/name | Get User by Username [**get_user_group_requests**](UsersApi.md#get_user_group_requests) | **GET** /users/{userId}/groups/requested | Get User Group Requests [**get_user_groups**](UsersApi.md#get_user_groups) | **GET** /users/{userId}/groups | Get User Groups +[**get_user_represented_group**](UsersApi.md#get_user_represented_group) | **GET** /users/{userId}/groups/represented | Get user's current represented group [**search_users**](UsersApi.md#search_users) | **GET** /users | Search All Users [**update_user**](UsersApi.md#update_user) | **PUT** /users/{userId} | Update User Info @@ -133,6 +134,36 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## get_user_represented_group + +> crate::models::RepresentedGroup get_user_represented_group(user_id) +Get user's current represented group + +Returns the current group that the user is currently representing + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **String** | Must be a valid user ID. | [required] | + +### Return type + +[**crate::models::RepresentedGroup**](representedGroup.md) + +### Authorization + +[authCookie](../README.md#authCookie) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## search_users > Vec search_users(search, developer_type, n, offset) diff --git a/src/apis/users_api.rs b/src/apis/users_api.rs index d8f403a..dc9c240 100644 --- a/src/apis/users_api.rs +++ b/src/apis/users_api.rs @@ -45,6 +45,14 @@ pub enum GetUserGroupsError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_user_represented_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserRepresentedGroupError { + Status401(crate::models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`search_users`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -175,6 +183,34 @@ pub fn get_user_groups(configuration: &configuration::Configuration, user_id: &s } } +/// Returns the current group that the user is currently representing +pub fn get_user_represented_group(configuration: &configuration::Configuration, user_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userId}/groups/represented", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let mut local_var_resp = local_var_client.execute(local_var_req)?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text()?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + /// Search and list any users by text query pub fn search_users(configuration: &configuration::Configuration, search: Option<&str>, developer_type: Option<&str>, n: Option, offset: Option) -> Result, Error> { let local_var_configuration = configuration; diff --git a/src/models/create_avatar_request.rs b/src/models/create_avatar_request.rs index 6289962..a346c1a 100644 --- a/src/models/create_avatar_request.rs +++ b/src/models/create_avatar_request.rs @@ -30,6 +30,8 @@ pub struct CreateAvatarRequest { pub version: Option, #[serde(rename = "unityPackageUrl", skip_serializing_if = "Option::is_none")] pub unity_package_url: Option, + #[serde(rename = "unityVersion", skip_serializing_if = "Option::is_none")] + pub unity_version: Option, } impl CreateAvatarRequest { @@ -44,6 +46,7 @@ impl CreateAvatarRequest { release_status: None, version: None, unity_package_url: None, + unity_version: None, } } } diff --git a/src/models/group_audit_log_entry.rs b/src/models/group_audit_log_entry.rs index fe51f54..b98952b 100644 --- a/src/models/group_audit_log_entry.rs +++ b/src/models/group_audit_log_entry.rs @@ -20,8 +20,8 @@ pub struct GroupAuditLogEntry { /// 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 = "actorId", skip_serializing_if = "Option::is_none")] pub actor_id: Option, - #[serde(rename = "actorDisplayname", skip_serializing_if = "Option::is_none")] - pub actor_displayname: Option, + #[serde(rename = "actorDisplayName", skip_serializing_if = "Option::is_none")] + pub actor_display_name: Option, /// Typically GroupID or GroupRoleID, but could be other types of IDs. #[serde(rename = "targetId", skip_serializing_if = "Option::is_none")] pub target_id: Option, @@ -43,7 +43,7 @@ impl GroupAuditLogEntry { created_at: None, group_id: None, actor_id: None, - actor_displayname: None, + actor_display_name: None, target_id: None, event_type: None, description: None, diff --git a/src/models/mod.rs b/src/models/mod.rs index 7f4abb8..af67c74 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -174,6 +174,8 @@ pub mod region; pub use self::region::Region; pub mod release_status; pub use self::release_status::ReleaseStatus; +pub mod represented_group; +pub use self::represented_group::RepresentedGroup; pub mod request_invite_request; pub use self::request_invite_request::RequestInviteRequest; pub mod respond_group_join_request; diff --git a/src/models/represented_group.rs b/src/models/represented_group.rs new file mode 100644 index 0000000..66b64db --- /dev/null +++ b/src/models/represented_group.rs @@ -0,0 +1,66 @@ +/* + * VRChat API Documentation + * + * + * Contact: vrchatapi.lpv0t@aries.fyi + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RepresentedGroup { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "shortCode", skip_serializing_if = "Option::is_none")] + pub short_code: Option, + #[serde(rename = "discriminator", skip_serializing_if = "Option::is_none")] + pub discriminator: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub icon_id: Option>, + #[serde(rename = "iconUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub icon_url: Option>, + #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub banner_id: Option>, + #[serde(rename = "bannerUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub banner_url: Option>, + #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")] + pub privacy: Option, + /// 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, + #[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")] + pub member_count: Option, + #[serde(rename = "groupId", skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[serde(rename = "memberVisibility", skip_serializing_if = "Option::is_none")] + pub member_visibility: Option, + #[serde(rename = "isRepresenting", skip_serializing_if = "Option::is_none")] + pub is_representing: Option, +} + +impl RepresentedGroup { + pub fn new() -> RepresentedGroup { + RepresentedGroup { + name: None, + short_code: None, + discriminator: None, + description: None, + icon_id: None, + icon_url: None, + banner_id: None, + banner_url: None, + privacy: None, + owner_id: None, + member_count: None, + group_id: None, + member_visibility: None, + is_representing: None, + } + } +} + + diff --git a/src/models/update_avatar_request.rs b/src/models/update_avatar_request.rs index 8a27e1f..cb68d7d 100644 --- a/src/models/update_avatar_request.rs +++ b/src/models/update_avatar_request.rs @@ -30,6 +30,8 @@ pub struct UpdateAvatarRequest { pub version: Option, #[serde(rename = "unityPackageUrl", skip_serializing_if = "Option::is_none")] pub unity_package_url: Option, + #[serde(rename = "unityVersion", skip_serializing_if = "Option::is_none")] + pub unity_version: Option, } impl UpdateAvatarRequest { @@ -44,6 +46,7 @@ impl UpdateAvatarRequest { release_status: None, version: None, unity_package_url: None, + unity_version: None, } } }