From 91c411ec0e3ca24536f14b7449db233cfb6f2973 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Sat, 27 Jul 2024 01:14:19 +0200 Subject: [PATCH] Add formatting Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> --- docs/Group.md | 4 +- docs/UserExists.md | 1 + examples/online.rs | 20 +- generate.sh | 1 + src/apis/authentication_api.rs | 203 ++- src/apis/avatars_api.rs | 315 +++-- src/apis/configuration.rs | 9 +- src/apis/economy_api.rs | 122 +- src/apis/favorites_api.rs | 228 +++- src/apis/files_api.rs | 281 +++- src/apis/friends_api.rs | 134 +- src/apis/groups_api.rs | 1209 +++++++++++++---- src/apis/instances_api.rs | 174 ++- src/apis/invite_api.rs | 236 +++- src/apis/mod.rs | 16 +- src/apis/notifications_api.rs | 155 ++- src/apis/permissions_api.rs | 53 +- src/apis/playermoderation_api.rs | 166 ++- src/apis/system_api.rs | 162 ++- src/apis/users_api.rs | 194 ++- src/apis/worlds_api.rs | 500 +++++-- src/lib.rs | 2 +- src/models/account_deletion_log.rs | 8 +- src/models/add_favorite_request.rs | 7 +- src/models/add_group_gallery_image_request.rs | 5 +- src/models/api_config.rs | 113 +- src/models/api_config_announcement.rs | 6 +- src/models/api_config_download_url_list.rs | 9 +- src/models/api_config_events.rs | 14 +- src/models/api_health.rs | 1 - src/models/avatar.rs | 22 +- src/models/avatar_unity_package_url_object.rs | 1 - src/models/badge.rs | 30 +- src/models/ban_group_member_request.rs | 5 +- src/models/create_avatar_request.rs | 1 - src/models/create_file_request.rs | 1 - src/models/create_file_version_request.rs | 1 - .../create_group_announcement_request.rs | 1 - src/models/create_group_gallery_request.rs | 29 +- src/models/create_group_invite_request.rs | 6 +- src/models/create_group_post_request.rs | 8 +- src/models/create_group_request.rs | 21 +- src/models/create_group_role_request.rs | 1 - src/models/create_instance_request.rs | 14 +- src/models/create_world_request.rs | 1 - src/models/current_user.rs | 100 +- src/models/current_user_presence.rs | 64 +- src/models/deployment_group.rs | 2 - src/models/developer_type.rs | 2 - src/models/dynamic_content_row.rs | 9 +- src/models/error.rs | 5 +- src/models/favorite.rs | 10 +- src/models/favorite_group.rs | 14 +- src/models/favorite_group_visibility.rs | 2 - src/models/favorite_type.rs | 2 - src/models/file.rs | 13 +- src/models/file_data.rs | 12 +- src/models/file_status.rs | 2 - src/models/file_upload_url.rs | 7 +- src/models/file_version.rs | 3 +- src/models/file_version_upload_status.rs | 12 +- src/models/finish_file_data_upload_request.rs | 3 +- src/models/friend_status.rs | 1 - src/models/group.rs | 57 +- src/models/group_access_type.rs | 2 - src/models/group_announcement.rs | 36 +- src/models/group_audit_log_entry.rs | 1 - src/models/group_gallery.rs | 29 +- src/models/group_gallery_image.rs | 1 - src/models/group_instance.rs | 8 +- src/models/group_join_request_action.rs | 2 - src/models/group_join_state.rs | 2 - src/models/group_limited_member.rs | 46 +- src/models/group_member.rs | 46 +- src/models/group_member_limited_user.rs | 15 +- src/models/group_member_status.rs | 2 - src/models/group_my_member.rs | 36 +- src/models/group_permission.rs | 6 +- src/models/group_post.rs | 8 +- src/models/group_post_visibility.rs | 2 - src/models/group_privacy.rs | 2 - src/models/group_role.rs | 1 - src/models/group_role_template.rs | 2 - src/models/group_search_sort.rs | 2 - src/models/group_user_visibility.rs | 2 - src/models/info_push.rs | 15 +- src/models/info_push_data.rs | 3 +- src/models/info_push_data_article.rs | 5 +- src/models/info_push_data_article_content.rs | 1 - src/models/info_push_data_clickable.rs | 1 - src/models/instance.rs | 58 +- src/models/instance_platforms.rs | 1 - src/models/instance_region.rs | 2 - src/models/instance_short_name_response.rs | 1 - src/models/instance_type.rs | 4 +- src/models/invite_message.rs | 13 +- src/models/invite_message_type.rs | 4 +- src/models/invite_request.rs | 1 - src/models/invite_response.rs | 5 +- src/models/license.rs | 8 +- src/models/license_action.rs | 2 - src/models/license_group.rs | 10 +- src/models/license_type.rs | 2 - src/models/limited_group.rs | 36 +- src/models/limited_unity_package.rs | 3 +- src/models/limited_user.rs | 24 +- src/models/limited_user_groups.rs | 43 +- src/models/limited_world.rs | 37 +- src/models/mime_type.rs | 2 - src/models/mod.rs | 2 +- src/models/moderate_user_request.rs | 6 +- src/models/notification.rs | 12 +- src/models/notification_detail_invite.rs | 1 - .../notification_detail_invite_response.rs | 6 +- .../notification_detail_request_invite.rs | 1 - ...fication_detail_request_invite_response.rs | 1 - .../notification_detail_vote_to_kick.rs | 1 - src/models/notification_type.rs | 2 - src/models/order_option.rs | 2 - .../paginated_group_audit_log_entry_list.rs | 1 - src/models/past_display_name.rs | 1 - src/models/permission.rs | 10 +- src/models/player_moderation.rs | 11 +- src/models/player_moderation_type.rs | 2 - src/models/region.rs | 2 - src/models/release_status.rs | 2 - src/models/represented_group.rs | 29 +- src/models/request_invite_request.rs | 5 +- src/models/respond_group_join_request.rs | 1 - src/models/response.rs | 1 - src/models/sent_notification.rs | 13 +- src/models/sort_option.rs | 2 - src/models/subscription.rs | 12 +- src/models/subscription_period.rs | 2 - src/models/success.rs | 5 +- src/models/transaction.rs | 13 +- src/models/transaction_agreement.rs | 22 +- src/models/transaction_status.rs | 2 - src/models/transaction_steam_info.rs | 11 +- src/models/transaction_steam_wallet_info.rs | 10 +- src/models/two_factor_auth_code.rs | 5 +- src/models/two_factor_email_code.rs | 5 +- src/models/unity_package.rs | 24 +- src/models/update_avatar_request.rs | 1 - src/models/update_favorite_group_request.rs | 1 - src/models/update_group_gallery_request.rs | 29 +- src/models/update_group_member_request.rs | 6 +- src/models/update_group_request.rs | 15 +- src/models/update_group_role_request.rs | 1 - src/models/update_invite_message_request.rs | 5 +- src/models/update_user_request.rs | 1 - src/models/update_world_request.rs | 1 - src/models/user.rs | 43 +- src/models/user_exists.rs | 7 +- src/models/user_state.rs | 2 - src/models/user_status.rs | 2 - src/models/user_subscription.rs | 20 +- src/models/verify2_fa_email_code_result.rs | 5 +- src/models/verify2_fa_result.rs | 5 +- src/models/verify_auth_token_result.rs | 6 +- src/models/world.rs | 34 +- src/models/world_metadata.rs | 6 +- src/models/world_publish_status.rs | 5 +- 163 files changed, 4316 insertions(+), 1446 deletions(-) diff --git a/docs/Group.md b/docs/Group.md index 2d93040..7f2859b 100644 --- a/docs/Group.md +++ b/docs/Group.md @@ -22,9 +22,9 @@ Name | Type | Description | Notes **member_count_synced_at** | Option<**String**> | | [optional] **is_verified** | Option<**bool**> | | [optional][default to false] **join_state** | Option<[**models::GroupJoinState**](GroupJoinState.md)> | | [optional] -**tags** | Option<**Vec**> | | [optional] +**tags** | Option<**Vec**> | | [optional] **transfer_target_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] -**galleries** | Option<[**Vec**](GroupGallery.md)> | | [optional] +**galleries** | Option<[**Vec**](GroupGallery.md)> | | [optional] **created_at** | Option<**String**> | | [optional] **updated_at** | Option<**String**> | | [optional] **last_post_created_at** | Option<**String**> | | [optional] diff --git a/docs/UserExists.md b/docs/UserExists.md index 17b947c..62fd89f 100644 --- a/docs/UserExists.md +++ b/docs/UserExists.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user_exists** | **bool** | Status if a user exist with that username or userId. | [default to false] +**name_ok** | **bool** | Is the username valid? | [default to false] [[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/examples/online.rs b/examples/online.rs index 387bcfb..0a1ad52 100644 --- a/examples/online.rs +++ b/examples/online.rs @@ -5,11 +5,21 @@ async fn main() { let mut config = apis::configuration::Configuration::default(); config.basic_auth = Some((String::from("username"), Some(String::from("password")))); - match apis::authentication_api::get_current_user(&config).await.unwrap() { - vrchatapi::models::EitherUserOrTwoFactor::CurrentUser(me) => println!("Username: {}", me.username.unwrap()), - vrchatapi::models::EitherUserOrTwoFactor::RequiresTwoFactorAuth(requires_auth) => println!("The Username requires Auth: {:?}", requires_auth.requires_two_factor_auth) + match apis::authentication_api::get_current_user(&config) + .await + .unwrap() + { + vrchatapi::models::EitherUserOrTwoFactor::CurrentUser(me) => { + println!("Username: {}", me.username.unwrap()) + } + vrchatapi::models::EitherUserOrTwoFactor::RequiresTwoFactorAuth(requires_auth) => println!( + "The Username requires Auth: {:?}", + requires_auth.requires_two_factor_auth + ), } - let online = apis::system_api::get_current_online_users(&config).await.unwrap(); + let online = apis::system_api::get_current_online_users(&config) + .await + .unwrap(); println!("Current Online Users: {}", online); -} \ No newline at end of file +} diff --git a/generate.sh b/generate.sh index b11be0f..eb448e0 100755 --- a/generate.sh +++ b/generate.sh @@ -35,5 +35,6 @@ cat patches/2FA_Current_User.rs >> src/models/current_user.rs sed -i 's/pub use self::current_user::CurrentUser;/pub use self::current_user::{EitherUserOrTwoFactor, CurrentUser};/g' src/models/mod.rs sed -i 's/Result>/Result>/g' src/apis/authentication_api.rs +cargo fmt cargo build cargo test diff --git a/src/apis/authentication_api.rs b/src/apis/authentication_api.rs index 7b63769..bd8bf72 100644 --- a/src/apis/authentication_api.rs +++ b/src/apis/authentication_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`check_user_exists`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -77,30 +75,41 @@ pub enum VerifyRecoveryCodeError { UnknownValue(serde_json::Value), } - /// Checks if a user by a given `username`, `displayName` or `email` exist. This is used during registration to check if a username has already been taken, during change of displayName to check if a displayName is available, and during change of email to check if the email is already used. In the later two cases the `excludeUserId` is used to exclude oneself, otherwise the result would always be true. It is **REQUIRED** to include **AT LEAST** `username`, `displayName` **or** `email` query parameter. Although they can be combined - in addition with `excludeUserId` (generally to exclude yourself) - to further fine-tune the search. -pub async fn check_user_exists(configuration: &configuration::Configuration, email: Option<&str>, display_name: Option<&str>, username: Option<&str>, exclude_user_id: Option<&str>) -> Result> { +pub async fn check_user_exists( + configuration: &configuration::Configuration, + email: Option<&str>, + display_name: Option<&str>, + username: Option<&str>, + exclude_user_id: Option<&str>, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/auth/exists", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = email { - local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("email", &local_var_str.to_string())]); } if let Some(ref local_var_str) = display_name { - local_var_req_builder = local_var_req_builder.query(&[("displayName", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("displayName", &local_var_str.to_string())]); } if let Some(ref local_var_str) = username { - local_var_req_builder = local_var_req_builder.query(&[("username", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("username", &local_var_str.to_string())]); } if let Some(ref local_var_str) = exclude_user_id { - local_var_req_builder = local_var_req_builder.query(&[("excludeUserId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("excludeUserId", &local_var_str.to_string())]); } 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()); + 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()?; @@ -112,23 +121,37 @@ pub async fn check_user_exists(configuration: &configuration::Configuration, ema 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 }; + 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)) } } /// Deletes the account with given ID. Normal users only have permission to delete their own account. Account deletion is 14 days from this request, and will be cancelled if you do an authenticated request with the account afterwards. **VRC+ NOTE:** Despite the 14-days cooldown, any VRC+ subscription will be cancelled **immediately**. **METHOD NOTE:** Despite this being a Delete action, the method type required is PUT. -pub async fn delete_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn delete_user( + 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}/delete", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/users/{userId}/delete", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -140,26 +163,38 @@ pub async fn delete_user(configuration: &configuration::Configuration, user_id: 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 }; + 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)) } } /// This endpoint does the following two operations: 1) Checks if you are already logged in by looking for a valid `auth` cookie. If you are have a valid auth cookie then no additional auth-related actions are taken. If you are **not** logged in then it will log you in with the `Authorization` header and set the `auth` cookie. The `auth` cookie will only be sent once. 2) If logged in, this function will also return the CurrentUser object containing detailed information about the currently logged in user. The auth string after `Authorization: Basic {string}` is a base64-encoded string of the username and password, both individually url-encoded, and then joined with a colon. > base64(urlencode(username):urlencode(password)) **WARNING: Session Limit:** Each authentication with login credentials counts as a separate session, out of which you have a limited amount. Make sure to save and reuse the `auth` cookie if you are often restarting the program. The provided API libraries automatically save cookies during runtime, but does not persist during restart. While it can be fine to use username/password during development, expect in production to very fast run into the rate-limit and be temporarily blocked from making new sessions until older ones expire. The exact number of simultaneous sessions is unknown/undisclosed. -pub async fn get_current_user(configuration: &configuration::Configuration, ) -> Result> { +pub async fn get_current_user( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/auth/user", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + local_var_req_builder = local_var_req_builder.basic_auth( + local_var_auth_conf.0.to_owned(), + local_var_auth_conf.1.to_owned(), + ); }; let local_var_req = local_var_req_builder.build()?; @@ -171,23 +206,32 @@ pub async fn get_current_user(configuration: &configuration::Configuration, ) -> 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 }; + 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)) } } /// Invalidates the login session. -pub async fn logout(configuration: &configuration::Configuration, ) -> Result> { +pub async fn logout( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/logout", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -200,22 +244,34 @@ pub async fn logout(configuration: &configuration::Configuration, ) -> Result = 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } /// Finishes the login sequence with a normal 2FA-generated code for accounts with 2FA-protection enabled. -pub async fn verify2_fa(configuration: &configuration::Configuration, two_factor_auth_code: models::TwoFactorAuthCode) -> Result> { +pub async fn verify2_fa( + configuration: &configuration::Configuration, + two_factor_auth_code: models::TwoFactorAuthCode, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/twofactorauth/totp/verify", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/twofactorauth/totp/verify", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&two_factor_auth_code); @@ -228,23 +284,36 @@ pub async fn verify2_fa(configuration: &configuration::Configuration, two_factor 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 }; + 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)) } } /// Finishes the login sequence with an 2FA email code. -pub async fn verify2_fa_email_code(configuration: &configuration::Configuration, two_factor_email_code: models::TwoFactorEmailCode) -> Result> { +pub async fn verify2_fa_email_code( + configuration: &configuration::Configuration, + two_factor_email_code: models::TwoFactorEmailCode, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/twofactorauth/emailotp/verify", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/twofactorauth/emailotp/verify", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&two_factor_email_code); @@ -257,23 +326,32 @@ pub async fn verify2_fa_email_code(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Verify whether the currently provided Auth Token is valid. -pub async fn verify_auth_token(configuration: &configuration::Configuration, ) -> Result> { +pub async fn verify_auth_token( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/auth", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + 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()?; @@ -285,23 +363,36 @@ pub async fn verify_auth_token(configuration: &configuration::Configuration, ) - 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 }; + 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)) } } /// Finishes the login sequence with an OTP (One Time Password) recovery code for accounts with 2FA-protection enabled. -pub async fn verify_recovery_code(configuration: &configuration::Configuration, two_factor_auth_code: models::TwoFactorAuthCode) -> Result> { +pub async fn verify_recovery_code( + configuration: &configuration::Configuration, + two_factor_auth_code: models::TwoFactorAuthCode, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/twofactorauth/otp/verify", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/twofactorauth/otp/verify", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&two_factor_auth_code); @@ -314,9 +405,13 @@ pub async fn verify_recovery_code(configuration: &configuration::Configuration, 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 }; + 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)) } } - diff --git a/src/apis/avatars_api.rs b/src/apis/avatars_api.rs index c6595ce..69cc726 100644 --- a/src/apis/avatars_api.rs +++ b/src/apis/avatars_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`create_avatar`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -93,18 +91,22 @@ pub enum UpdateAvatarError { UnknownValue(serde_json::Value), } - /// Create an avatar. It's possible to optionally specify a ID if you want a custom one. Attempting to create an Avatar with an already claimed ID will result in a DB error. -pub async fn create_avatar(configuration: &configuration::Configuration, create_avatar_request: Option) -> Result> { +pub async fn create_avatar( + configuration: &configuration::Configuration, + create_avatar_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/avatars", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_avatar_request); @@ -117,23 +119,37 @@ pub async fn create_avatar(configuration: &configuration::Configuration, create_ 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 }; + 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)) } } /// Delete an avatar. Notice an avatar is never fully \"deleted\", only its ReleaseStatus is set to \"hidden\" and the linked Files are deleted. The AvatarID is permanently reserved. -pub async fn delete_avatar(configuration: &configuration::Configuration, avatar_id: &str) -> Result> { +pub async fn delete_avatar( + configuration: &configuration::Configuration, + avatar_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/avatars/{avatarId}", local_var_configuration.base_path, avatarId=crate::apis::urlencode(avatar_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/avatars/{avatarId}", + local_var_configuration.base_path, + avatarId = crate::apis::urlencode(avatar_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -145,23 +161,37 @@ pub async fn delete_avatar(configuration: &configuration::Configuration, avatar_ 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 }; + 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)) } } /// Get information about a specific Avatar. -pub async fn get_avatar(configuration: &configuration::Configuration, avatar_id: &str) -> Result> { +pub async fn get_avatar( + configuration: &configuration::Configuration, + avatar_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/avatars/{avatarId}", local_var_configuration.base_path, avatarId=crate::apis::urlencode(avatar_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/avatars/{avatarId}", + local_var_configuration.base_path, + avatarId = crate::apis::urlencode(avatar_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()); + 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()?; @@ -173,62 +203,95 @@ pub async fn get_avatar(configuration: &configuration::Configuration, avatar_id: 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 }; + 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 favorited avatars by query filters. -pub async fn get_favorited_avatars(configuration: &configuration::Configuration, featured: Option, sort: Option, n: Option, order: Option, offset: Option, search: Option<&str>, tag: Option<&str>, notag: Option<&str>, release_status: Option, max_unity_version: Option<&str>, min_unity_version: Option<&str>, platform: Option<&str>, user_id: Option<&str>) -> Result, Error> { +pub async fn get_favorited_avatars( + configuration: &configuration::Configuration, + featured: Option, + sort: Option, + n: Option, + order: Option, + offset: Option, + search: Option<&str>, + tag: Option<&str>, + notag: Option<&str>, + release_status: Option, + max_unity_version: Option<&str>, + min_unity_version: Option<&str>, + platform: Option<&str>, + user_id: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/avatars/favorites", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = featured { - local_var_req_builder = local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); } if let Some(ref local_var_str) = sort { - local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = order { - local_var_req_builder = local_var_req_builder.query(&[("order", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("order", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = search { - local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("search", &local_var_str.to_string())]); } if let Some(ref local_var_str) = tag { local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = notag { - local_var_req_builder = local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = release_status { - local_var_req_builder = local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = min_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = platform { - local_var_req_builder = local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); } if let Some(ref local_var_str) = user_id { - local_var_req_builder = local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); } 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()); + 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()?; @@ -240,23 +303,37 @@ pub async fn get_favorited_avatars(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Get the current avatar for the user. This will return an error for any other user than the one logged in. -pub async fn get_own_avatar(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn get_own_avatar( + 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}/avatar", 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()); + let local_var_uri_str = format!( + "{}/users/{userId}/avatar", + 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()); + 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()?; @@ -268,62 +345,95 @@ pub async fn get_own_avatar(configuration: &configuration::Configuration, user_i 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 }; + 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 avatars by query filters. You can only search your own or featured avatars. It is not possible as a normal user to search other peoples avatars. -pub async fn search_avatars(configuration: &configuration::Configuration, featured: Option, sort: Option, user: Option<&str>, user_id: Option<&str>, n: Option, order: Option, offset: Option, tag: Option<&str>, notag: Option<&str>, release_status: Option, max_unity_version: Option<&str>, min_unity_version: Option<&str>, platform: Option<&str>) -> Result, Error> { +pub async fn search_avatars( + configuration: &configuration::Configuration, + featured: Option, + sort: Option, + user: Option<&str>, + user_id: Option<&str>, + n: Option, + order: Option, + offset: Option, + tag: Option<&str>, + notag: Option<&str>, + release_status: Option, + max_unity_version: Option<&str>, + min_unity_version: Option<&str>, + platform: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/avatars", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = featured { - local_var_req_builder = local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); } if let Some(ref local_var_str) = sort { - local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); } if let Some(ref local_var_str) = user { - local_var_req_builder = local_var_req_builder.query(&[("user", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("user", &local_var_str.to_string())]); } if let Some(ref local_var_str) = user_id { - local_var_req_builder = local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = order { - local_var_req_builder = local_var_req_builder.query(&[("order", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("order", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = tag { local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = notag { - local_var_req_builder = local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = release_status { - local_var_req_builder = local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = min_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = platform { - local_var_req_builder = local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); } 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()); + 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()?; @@ -335,23 +445,37 @@ pub async fn search_avatars(configuration: &configuration::Configuration, featur 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 }; + 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)) } } /// Switches into that avatar. -pub async fn select_avatar(configuration: &configuration::Configuration, avatar_id: &str) -> Result> { +pub async fn select_avatar( + configuration: &configuration::Configuration, + avatar_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/avatars/{avatarId}/select", local_var_configuration.base_path, avatarId=crate::apis::urlencode(avatar_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/avatars/{avatarId}/select", + local_var_configuration.base_path, + avatarId = crate::apis::urlencode(avatar_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -363,23 +487,37 @@ pub async fn select_avatar(configuration: &configuration::Configuration, avatar_ 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 }; + 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)) } } /// Switches into that avatar as your fallback avatar. -pub async fn select_fallback_avatar(configuration: &configuration::Configuration, avatar_id: &str) -> Result> { +pub async fn select_fallback_avatar( + configuration: &configuration::Configuration, + avatar_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/avatars/{avatarId}/selectFallback", local_var_configuration.base_path, avatarId=crate::apis::urlencode(avatar_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/avatars/{avatarId}/selectFallback", + local_var_configuration.base_path, + avatarId = crate::apis::urlencode(avatar_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -391,23 +529,38 @@ pub async fn select_fallback_avatar(configuration: &configuration::Configuration 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 }; + 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)) } } /// Update information about a specific avatar. -pub async fn update_avatar(configuration: &configuration::Configuration, avatar_id: &str, update_avatar_request: Option) -> Result> { +pub async fn update_avatar( + configuration: &configuration::Configuration, + avatar_id: &str, + update_avatar_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/avatars/{avatarId}", local_var_configuration.base_path, avatarId=crate::apis::urlencode(avatar_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/avatars/{avatarId}", + local_var_configuration.base_path, + avatarId = crate::apis::urlencode(avatar_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_avatar_request); @@ -420,9 +573,13 @@ pub async fn update_avatar(configuration: &configuration::Configuration, avatar_ 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 }; + 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)) } } - diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs index 4496c7b..dcd92e0 100644 --- a/src/apis/configuration.rs +++ b/src/apis/configuration.rs @@ -6,8 +6,6 @@ * Generated by: https://openapi-generator.tech */ - - #[derive(Debug, Clone)] pub struct Configuration { pub base_path: String, @@ -28,7 +26,6 @@ pub struct ApiKey { pub key: String, } - impl Configuration { pub fn new() -> Configuration { Configuration::default() @@ -40,12 +37,14 @@ impl Default for Configuration { Configuration { base_path: "https://vrchat.com/api/1".to_owned(), user_agent: Some("vrchatapi-rust".to_owned()), - client: reqwest::Client::builder().cookie_store(true).build().unwrap(), + client: reqwest::Client::builder() + .cookie_store(true) + .build() + .unwrap(), basic_auth: None, oauth_access_token: None, bearer_access_token: None, api_key: None, - } } } diff --git a/src/apis/economy_api.rs b/src/apis/economy_api.rs index ae46112..c440110 100644 --- a/src/apis/economy_api.rs +++ b/src/apis/economy_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`get_current_subscriptions`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -53,18 +51,24 @@ pub enum GetSubscriptionsError { UnknownValue(serde_json::Value), } - /// Get a list of all current user subscriptions. -pub async fn get_current_subscriptions(configuration: &configuration::Configuration, ) -> Result, Error> { +pub async fn get_current_subscriptions( + configuration: &configuration::Configuration, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/subscription", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/subscription", + local_var_configuration.base_path + ); + 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()); + 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()?; @@ -76,23 +80,37 @@ pub async fn get_current_subscriptions(configuration: &configuration::Configurat 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 }; + 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)) } } /// Get a single License Group by given ID. -pub async fn get_license_group(configuration: &configuration::Configuration, license_group_id: &str) -> Result> { +pub async fn get_license_group( + configuration: &configuration::Configuration, + license_group_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/licenseGroups/{licenseGroupId}", local_var_configuration.base_path, licenseGroupId=crate::apis::urlencode(license_group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/licenseGroups/{licenseGroupId}", + local_var_configuration.base_path, + licenseGroupId = crate::apis::urlencode(license_group_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()); + 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()?; @@ -104,23 +122,37 @@ pub async fn get_license_group(configuration: &configuration::Configuration, lic 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 }; + 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)) } } /// Get a single Steam transactions by ID. This returns the exact same information as `getSteamTransactions`, so no point in using this endpoint. -pub async fn get_steam_transaction(configuration: &configuration::Configuration, transaction_id: &str) -> Result> { +pub async fn get_steam_transaction( + configuration: &configuration::Configuration, + transaction_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/Steam/transactions/{transactionId}", local_var_configuration.base_path, transactionId=crate::apis::urlencode(transaction_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/Steam/transactions/{transactionId}", + local_var_configuration.base_path, + transactionId = crate::apis::urlencode(transaction_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()); + 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()?; @@ -132,23 +164,32 @@ pub async fn get_steam_transaction(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Get all own Steam transactions. -pub async fn get_steam_transactions(configuration: &configuration::Configuration, ) -> Result, Error> { +pub async fn get_steam_transactions( + configuration: &configuration::Configuration, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/Steam/transactions", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + 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()?; @@ -160,23 +201,32 @@ pub async fn get_steam_transactions(configuration: &configuration::Configuration 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 }; + 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)) } } /// List all existing Subscriptions. For example, \"vrchatplus-monthly\" and \"vrchatplus-yearly\". -pub async fn get_subscriptions(configuration: &configuration::Configuration, ) -> Result, Error> { +pub async fn get_subscriptions( + configuration: &configuration::Configuration, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/subscriptions", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + 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()?; @@ -188,9 +238,13 @@ pub async fn get_subscriptions(configuration: &configuration::Configuration, ) - 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 }; + 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)) } } - diff --git a/src/apis/favorites_api.rs b/src/apis/favorites_api.rs index 1b8b37e..aeb9f93 100644 --- a/src/apis/favorites_api.rs +++ b/src/apis/favorites_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`add_favorite`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -77,18 +75,22 @@ pub enum UpdateFavoriteGroupError { UnknownValue(serde_json::Value), } - /// Add a new favorite. Friend groups are named `group_0` through `group_3`. Avatar and World groups are named `avatars1` to `avatars4` and `worlds1` to `worlds4`. You cannot add people whom you are not friends with to your friends list. Destroying a friendship removes the person as favorite on both sides. -pub async fn add_favorite(configuration: &configuration::Configuration, add_favorite_request: Option) -> Result> { +pub async fn add_favorite( + configuration: &configuration::Configuration, + add_favorite_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/favorites", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&add_favorite_request); @@ -101,23 +103,41 @@ pub async fn add_favorite(configuration: &configuration::Configuration, add_favo 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 }; + 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)) } } /// Clear ALL contents of a specific favorite group. -pub async fn clear_favorite_group(configuration: &configuration::Configuration, favorite_group_type: &str, favorite_group_name: &str, user_id: &str) -> Result> { +pub async fn clear_favorite_group( + configuration: &configuration::Configuration, + favorite_group_type: &str, + favorite_group_name: &str, + user_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/favorite/group/{favoriteGroupType}/{favoriteGroupName}/{userId}", local_var_configuration.base_path, favoriteGroupType=crate::apis::urlencode(favorite_group_type), favoriteGroupName=crate::apis::urlencode(favorite_group_name), userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/favorite/group/{favoriteGroupType}/{favoriteGroupName}/{userId}", + local_var_configuration.base_path, + favoriteGroupType = crate::apis::urlencode(favorite_group_type), + favoriteGroupName = crate::apis::urlencode(favorite_group_name), + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -129,23 +149,37 @@ pub async fn clear_favorite_group(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Return information about a specific Favorite. -pub async fn get_favorite(configuration: &configuration::Configuration, favorite_id: &str) -> Result> { +pub async fn get_favorite( + configuration: &configuration::Configuration, + favorite_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/favorites/{favoriteId}", local_var_configuration.base_path, favoriteId=crate::apis::urlencode(favorite_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/favorites/{favoriteId}", + local_var_configuration.base_path, + favoriteId = crate::apis::urlencode(favorite_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()); + 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()?; @@ -157,23 +191,41 @@ pub async fn get_favorite(configuration: &configuration::Configuration, favorite 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 }; + 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)) } } /// Fetch information about a specific favorite group. -pub async fn get_favorite_group(configuration: &configuration::Configuration, favorite_group_type: &str, favorite_group_name: &str, user_id: &str) -> Result> { +pub async fn get_favorite_group( + configuration: &configuration::Configuration, + favorite_group_type: &str, + favorite_group_name: &str, + user_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/favorite/group/{favoriteGroupType}/{favoriteGroupName}/{userId}", local_var_configuration.base_path, favoriteGroupType=crate::apis::urlencode(favorite_group_type), favoriteGroupName=crate::apis::urlencode(favorite_group_name), 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()); + let local_var_uri_str = format!( + "{}/favorite/group/{favoriteGroupType}/{favoriteGroupName}/{userId}", + local_var_configuration.base_path, + favoriteGroupType = crate::apis::urlencode(favorite_group_type), + favoriteGroupName = crate::apis::urlencode(favorite_group_name), + 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()); + 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()?; @@ -185,32 +237,46 @@ pub async fn get_favorite_group(configuration: &configuration::Configuration, fa 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 }; + 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)) } } /// Return a list of favorite groups owned by a user. Returns the same information as `getFavoriteGroups`. -pub async fn get_favorite_groups(configuration: &configuration::Configuration, n: Option, offset: Option, owner_id: Option<&str>) -> Result, Error> { +pub async fn get_favorite_groups( + configuration: &configuration::Configuration, + n: Option, + offset: Option, + owner_id: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/favorite/groups", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = owner_id { - local_var_req_builder = local_var_req_builder.query(&[("ownerId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("ownerId", &local_var_str.to_string())]); } 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()); + 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()?; @@ -222,35 +288,50 @@ pub async fn get_favorite_groups(configuration: &configuration::Configuration, n 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 }; + 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)) } } /// Returns a list of favorites. -pub async fn get_favorites(configuration: &configuration::Configuration, n: Option, offset: Option, r#type: Option<&str>, tag: Option<&str>) -> Result, Error> { +pub async fn get_favorites( + configuration: &configuration::Configuration, + n: Option, + offset: Option, + r#type: Option<&str>, + tag: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/favorites", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = r#type { - local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("type", &local_var_str.to_string())]); } if let Some(ref local_var_str) = tag { local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]); } 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()); + 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()?; @@ -262,23 +343,37 @@ pub async fn get_favorites(configuration: &configuration::Configuration, n: Opti 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 }; + 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)) } } /// Remove a favorite from your favorites list. -pub async fn remove_favorite(configuration: &configuration::Configuration, favorite_id: &str) -> Result> { +pub async fn remove_favorite( + configuration: &configuration::Configuration, + favorite_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/favorites/{favoriteId}", local_var_configuration.base_path, favoriteId=crate::apis::urlencode(favorite_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/favorites/{favoriteId}", + local_var_configuration.base_path, + favoriteId = crate::apis::urlencode(favorite_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -290,23 +385,42 @@ pub async fn remove_favorite(configuration: &configuration::Configuration, favor 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 }; + 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)) } } /// Update information about a specific favorite group. -pub async fn update_favorite_group(configuration: &configuration::Configuration, favorite_group_type: &str, favorite_group_name: &str, user_id: &str, update_favorite_group_request: Option) -> Result<(), Error> { +pub async fn update_favorite_group( + configuration: &configuration::Configuration, + favorite_group_type: &str, + favorite_group_name: &str, + user_id: &str, + update_favorite_group_request: Option, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/favorite/group/{favoriteGroupType}/{favoriteGroupName}/{userId}", local_var_configuration.base_path, favoriteGroupType=crate::apis::urlencode(favorite_group_type), favoriteGroupName=crate::apis::urlencode(favorite_group_name), userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/favorite/group/{favoriteGroupType}/{favoriteGroupName}/{userId}", + local_var_configuration.base_path, + favoriteGroupType = crate::apis::urlencode(favorite_group_type), + favoriteGroupName = crate::apis::urlencode(favorite_group_name), + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_favorite_group_request); @@ -319,9 +433,13 @@ pub async fn update_favorite_group(configuration: &configuration::Configuration, if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } - diff --git a/src/apis/files_api.rs b/src/apis/files_api.rs index edff673..09646c8 100644 --- a/src/apis/files_api.rs +++ b/src/apis/files_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`create_file`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -89,18 +87,22 @@ pub enum StartFileDataUploadError { UnknownValue(serde_json::Value), } - /// Creates a new File object -pub async fn create_file(configuration: &configuration::Configuration, create_file_request: Option) -> Result> { +pub async fn create_file( + configuration: &configuration::Configuration, + create_file_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/file", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_file_request); @@ -113,23 +115,38 @@ pub async fn create_file(configuration: &configuration::Configuration, create_fi 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 }; + 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)) } } /// Creates a new FileVersion. Once a Version has been created, proceed to the `/file/{fileId}/{versionId}/file/start` endpoint to start a file upload. -pub async fn create_file_version(configuration: &configuration::Configuration, file_id: &str, create_file_version_request: Option) -> Result> { +pub async fn create_file_version( + configuration: &configuration::Configuration, + file_id: &str, + create_file_version_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/file/{fileId}", local_var_configuration.base_path, fileId=crate::apis::urlencode(file_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/file/{fileId}", + local_var_configuration.base_path, + fileId = crate::apis::urlencode(file_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_file_version_request); @@ -142,23 +159,37 @@ pub async fn create_file_version(configuration: &configuration::Configuration, f 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 }; + 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)) } } /// Deletes a File object. -pub async fn delete_file(configuration: &configuration::Configuration, file_id: &str) -> Result> { +pub async fn delete_file( + configuration: &configuration::Configuration, + file_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/file/{fileId}", local_var_configuration.base_path, fileId=crate::apis::urlencode(file_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/file/{fileId}", + local_var_configuration.base_path, + fileId = crate::apis::urlencode(file_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -170,23 +201,39 @@ pub async fn delete_file(configuration: &configuration::Configuration, file_id: 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 }; + 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)) } } /// Delete a specific version of a file. You can only delete the latest version. -pub async fn delete_file_version(configuration: &configuration::Configuration, file_id: &str, version_id: i32) -> Result> { +pub async fn delete_file_version( + configuration: &configuration::Configuration, + file_id: &str, + version_id: i32, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/file/{fileId}/{versionId}", local_var_configuration.base_path, fileId=crate::apis::urlencode(file_id), versionId=version_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/file/{fileId}/{versionId}", + local_var_configuration.base_path, + fileId = crate::apis::urlencode(file_id), + versionId = version_id + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -198,23 +245,39 @@ pub async fn delete_file_version(configuration: &configuration::Configuration, f 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 }; + 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)) } } /// Downloads the file with the provided version number. **Version Note:** Version 0 is always when the file was created. The real data is usually always located in version 1 and up. **Extension Note:** Files are not guaranteed to have a file extensions. UnityPackage files tends to have it, images through this endpoint do not. You are responsible for appending file extension from the `extension` field when neccesary. -pub async fn download_file_version(configuration: &configuration::Configuration, file_id: &str, version_id: i32) -> Result<(), Error> { +pub async fn download_file_version( + configuration: &configuration::Configuration, + file_id: &str, + version_id: i32, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/file/{fileId}/{versionId}", local_var_configuration.base_path, fileId=crate::apis::urlencode(file_id), versionId=version_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/file/{fileId}/{versionId}", + local_var_configuration.base_path, + fileId = crate::apis::urlencode(file_id), + versionId = version_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()); + 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()?; @@ -226,23 +289,42 @@ pub async fn download_file_version(configuration: &configuration::Configuration, if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } /// Finish an upload of a FileData. This will mark it as \"complete\". After uploading the `file` for Avatars and Worlds you then have to upload a `signature` file. -pub async fn finish_file_data_upload(configuration: &configuration::Configuration, file_id: &str, version_id: i32, file_type: &str, finish_file_data_upload_request: Option) -> Result> { +pub async fn finish_file_data_upload( + configuration: &configuration::Configuration, + file_id: &str, + version_id: i32, + file_type: &str, + finish_file_data_upload_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/file/{fileId}/{versionId}/{fileType}/finish", local_var_configuration.base_path, fileId=crate::apis::urlencode(file_id), versionId=version_id, fileType=crate::apis::urlencode(file_type)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/file/{fileId}/{versionId}/{fileType}/finish", + local_var_configuration.base_path, + fileId = crate::apis::urlencode(file_id), + versionId = version_id, + fileType = crate::apis::urlencode(file_type) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&finish_file_data_upload_request); @@ -255,23 +337,37 @@ pub async fn finish_file_data_upload(configuration: &configuration::Configuratio 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 }; + 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)) } } /// Shows general information about the \"File\" object. Each File can have several \"Version\"'s, and each Version can have multiple real files or \"Data\" blobs. -pub async fn get_file(configuration: &configuration::Configuration, file_id: &str) -> Result> { +pub async fn get_file( + configuration: &configuration::Configuration, + file_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/file/{fileId}", local_var_configuration.base_path, fileId=crate::apis::urlencode(file_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/file/{fileId}", + local_var_configuration.base_path, + fileId = crate::apis::urlencode(file_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()); + 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()?; @@ -284,22 +380,39 @@ pub async fn get_file(configuration: &configuration::Configuration, file_id: &st 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } /// Retrieves the upload status for file upload. Can currently only be accessed when `status` is `waiting`. Trying to access it on a file version already uploaded currently times out. -pub async fn get_file_data_upload_status(configuration: &configuration::Configuration, file_id: &str, version_id: i32, file_type: &str) -> Result> { +pub async fn get_file_data_upload_status( + configuration: &configuration::Configuration, + file_id: &str, + version_id: i32, + file_type: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/file/{fileId}/{versionId}/{fileType}/status", local_var_configuration.base_path, fileId=crate::apis::urlencode(file_id), versionId=version_id, fileType=crate::apis::urlencode(file_type)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/file/{fileId}/{versionId}/{fileType}/status", + local_var_configuration.base_path, + fileId = crate::apis::urlencode(file_id), + versionId = version_id, + fileType = crate::apis::urlencode(file_type) + ); + 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()); + 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()?; @@ -311,35 +424,50 @@ pub async fn get_file_data_upload_status(configuration: &configuration::Configur 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 }; + 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)) } } /// Returns a list of files -pub async fn get_files(configuration: &configuration::Configuration, tag: Option<&str>, user_id: Option<&str>, n: Option, offset: Option) -> Result, Error> { +pub async fn get_files( + configuration: &configuration::Configuration, + tag: Option<&str>, + user_id: Option<&str>, + n: Option, + offset: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/files", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = tag { local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = user_id { - local_var_req_builder = local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } 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()); + 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()?; @@ -352,25 +480,44 @@ pub async fn get_files(configuration: &configuration::Configuration, tag: Option 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } /// Starts an upload of a specific FilePart. This endpoint will return an AWS URL which you can PUT data to. You need to call this and receive a new AWS API URL for each `partNumber`. Please see AWS's REST documentation on \"PUT Object to S3\" on how to upload. Once all parts has been uploaded, proceed to `/finish` endpoint. **Note:** `nextPartNumber` seems like it is always ignored. Despite it returning 0, first partNumber is always 1. -pub async fn start_file_data_upload(configuration: &configuration::Configuration, file_id: &str, version_id: i32, file_type: &str, part_number: Option) -> Result> { +pub async fn start_file_data_upload( + configuration: &configuration::Configuration, + file_id: &str, + version_id: i32, + file_type: &str, + part_number: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/file/{fileId}/{versionId}/{fileType}/start", local_var_configuration.base_path, fileId=crate::apis::urlencode(file_id), versionId=version_id, fileType=crate::apis::urlencode(file_type)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/file/{fileId}/{versionId}/{fileType}/start", + local_var_configuration.base_path, + fileId = crate::apis::urlencode(file_id), + versionId = version_id, + fileType = crate::apis::urlencode(file_type) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); if let Some(ref local_var_str) = part_number { - local_var_req_builder = local_var_req_builder.query(&[("partNumber", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("partNumber", &local_var_str.to_string())]); } 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()); + 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()?; @@ -382,9 +529,13 @@ pub async fn start_file_data_upload(configuration: &configuration::Configuration 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 }; + 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)) } } - diff --git a/src/apis/friends_api.rs b/src/apis/friends_api.rs index edd1f90..98ef77d 100644 --- a/src/apis/friends_api.rs +++ b/src/apis/friends_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`delete_friend_request`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -57,18 +55,26 @@ pub enum UnfriendError { UnknownValue(serde_json::Value), } - /// Deletes an outgoing pending friend request to another user. To delete an incoming friend request, use the `deleteNotification` endpoint instead. -pub async fn delete_friend_request(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn delete_friend_request( + 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!("{}/user/{userId}/friendRequest", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/user/{userId}/friendRequest", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -80,23 +86,37 @@ pub async fn delete_friend_request(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Send a friend request to another user. -pub async fn friend(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn friend( + 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!("{}/user/{userId}/friendRequest", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/user/{userId}/friendRequest", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + 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()?; @@ -109,22 +129,35 @@ pub async fn friend(configuration: &configuration::Configuration, user_id: &str) 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } /// Retrieve if the user is currently a friend with a given user, if they have an outgoing friend request, and if they have an incoming friend request. The proper way to receive and accept friend request is by checking if the user has an incoming `Notification` of type `friendRequest`, and then accepting that notification. -pub async fn get_friend_status(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn get_friend_status( + 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!("{}/user/{userId}/friendStatus", 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()); + let local_var_uri_str = format!( + "{}/user/{userId}/friendStatus", + 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()); + 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()?; @@ -136,32 +169,46 @@ pub async fn get_friend_status(configuration: &configuration::Configuration, use 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 }; + 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)) } } /// List information about friends. -pub async fn get_friends(configuration: &configuration::Configuration, offset: Option, n: Option, offline: Option) -> Result, Error> { +pub async fn get_friends( + configuration: &configuration::Configuration, + offset: Option, + n: Option, + offline: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/auth/user/friends", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offline { - local_var_req_builder = local_var_req_builder.query(&[("offline", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offline", &local_var_str.to_string())]); } 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()); + 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()?; @@ -173,23 +220,37 @@ pub async fn get_friends(configuration: &configuration::Configuration, offset: O 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 }; + 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)) } } /// Unfriend a user by ID. -pub async fn unfriend(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn unfriend( + 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!("{}/auth/user/friends/{userId}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/friends/{userId}", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -202,8 +263,11 @@ pub async fn unfriend(configuration: &configuration::Configuration, user_id: &st 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } - diff --git a/src/apis/groups_api.rs b/src/apis/groups_api.rs index 2bc86e6..b785784 100644 --- a/src/apis/groups_api.rs +++ b/src/apis/groups_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`add_group_gallery_image`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -399,18 +397,29 @@ pub enum UpdateGroupRoleError { UnknownValue(serde_json::Value), } - /// Adds an image to a Group gallery. -pub async fn add_group_gallery_image(configuration: &configuration::Configuration, group_id: &str, group_gallery_id: &str, add_group_gallery_image_request: models::AddGroupGalleryImageRequest) -> Result> { +pub async fn add_group_gallery_image( + configuration: &configuration::Configuration, + group_id: &str, + group_gallery_id: &str, + add_group_gallery_image_request: models::AddGroupGalleryImageRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/galleries/{groupGalleryId}/images", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), groupGalleryId=crate::apis::urlencode(group_gallery_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/galleries/{groupGalleryId}/images", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + groupGalleryId = crate::apis::urlencode(group_gallery_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&add_group_gallery_image_request); @@ -423,23 +432,41 @@ pub async fn add_group_gallery_image(configuration: &configuration::Configuratio 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 }; + 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)) } } /// Adds a Role to a Group Member -pub async fn add_group_member_role(configuration: &configuration::Configuration, group_id: &str, user_id: &str, group_role_id: &str) -> Result, Error> { +pub async fn add_group_member_role( + configuration: &configuration::Configuration, + group_id: &str, + user_id: &str, + group_role_id: &str, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/members/{userId}/roles/{groupRoleId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), userId=crate::apis::urlencode(user_id), groupRoleId=crate::apis::urlencode(group_role_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/members/{userId}/roles/{groupRoleId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + userId = crate::apis::urlencode(user_id), + groupRoleId = crate::apis::urlencode(group_role_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -451,23 +478,38 @@ pub async fn add_group_member_role(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Create a post in a Group. -pub async fn add_group_post(configuration: &configuration::Configuration, group_id: &str, create_group_post_request: models::CreateGroupPostRequest) -> Result> { +pub async fn add_group_post( + configuration: &configuration::Configuration, + group_id: &str, + create_group_post_request: models::CreateGroupPostRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/posts", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/posts", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_group_post_request); @@ -480,23 +522,38 @@ pub async fn add_group_post(configuration: &configuration::Configuration, group_ 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 }; + 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)) } } /// Bans a user from a Group. -pub async fn ban_group_member(configuration: &configuration::Configuration, group_id: &str, ban_group_member_request: models::BanGroupMemberRequest) -> Result> { +pub async fn ban_group_member( + configuration: &configuration::Configuration, + group_id: &str, + ban_group_member_request: models::BanGroupMemberRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/bans", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/bans", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&ban_group_member_request); @@ -509,23 +566,37 @@ pub async fn ban_group_member(configuration: &configuration::Configuration, grou 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 }; + 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)) } } /// Cancels a request sent to join the group. -pub async fn cancel_group_request(configuration: &configuration::Configuration, group_id: &str) -> Result<(), Error> { +pub async fn cancel_group_request( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/requests", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/requests", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -537,23 +608,33 @@ pub async fn cancel_group_request(configuration: &configuration::Configuration, if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } /// Creates a Group and returns a Group object. **Requires VRC+ Subscription.** -pub async fn create_group(configuration: &configuration::Configuration, create_group_request: models::CreateGroupRequest) -> Result> { +pub async fn create_group( + configuration: &configuration::Configuration, + create_group_request: models::CreateGroupRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/groups", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_group_request); @@ -566,23 +647,38 @@ pub async fn create_group(configuration: &configuration::Configuration, create_g 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 }; + 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)) } } /// Creates an Announcement for a Group. -pub async fn create_group_announcement(configuration: &configuration::Configuration, group_id: &str, create_group_announcement_request: models::CreateGroupAnnouncementRequest) -> Result> { +pub async fn create_group_announcement( + configuration: &configuration::Configuration, + group_id: &str, + create_group_announcement_request: models::CreateGroupAnnouncementRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/announcement", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/announcement", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_group_announcement_request); @@ -595,23 +691,38 @@ pub async fn create_group_announcement(configuration: &configuration::Configurat 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 }; + 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)) } } /// Creates a gallery for a Group. -pub async fn create_group_gallery(configuration: &configuration::Configuration, group_id: &str, create_group_gallery_request: models::CreateGroupGalleryRequest) -> Result> { +pub async fn create_group_gallery( + configuration: &configuration::Configuration, + group_id: &str, + create_group_gallery_request: models::CreateGroupGalleryRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/galleries", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/galleries", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_group_gallery_request); @@ -624,23 +735,38 @@ pub async fn create_group_gallery(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Sends an invite to a user to join the group. -pub async fn create_group_invite(configuration: &configuration::Configuration, group_id: &str, create_group_invite_request: models::CreateGroupInviteRequest) -> Result<(), Error> { +pub async fn create_group_invite( + configuration: &configuration::Configuration, + group_id: &str, + create_group_invite_request: models::CreateGroupInviteRequest, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/invites", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/invites", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_group_invite_request); @@ -653,23 +779,38 @@ pub async fn create_group_invite(configuration: &configuration::Configuration, g if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } /// Create a Group role. -pub async fn create_group_role(configuration: &configuration::Configuration, group_id: &str, create_group_role_request: models::CreateGroupRoleRequest) -> Result> { +pub async fn create_group_role( + configuration: &configuration::Configuration, + group_id: &str, + create_group_role_request: models::CreateGroupRoleRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/roles", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/roles", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_group_role_request); @@ -682,23 +823,37 @@ pub async fn create_group_role(configuration: &configuration::Configuration, gro 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 }; + 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)) } } /// Deletes a Group. -pub async fn delete_group(configuration: &configuration::Configuration, group_id: &str) -> Result> { +pub async fn delete_group( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -710,23 +865,37 @@ pub async fn delete_group(configuration: &configuration::Configuration, group_id 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 }; + 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)) } } /// Deletes the announcement for a Group. -pub async fn delete_group_announcement(configuration: &configuration::Configuration, group_id: &str) -> Result> { +pub async fn delete_group_announcement( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/announcement", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/announcement", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -738,23 +907,39 @@ pub async fn delete_group_announcement(configuration: &configuration::Configurat 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 }; + 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)) } } /// Deletes a gallery for a Group. -pub async fn delete_group_gallery(configuration: &configuration::Configuration, group_id: &str, group_gallery_id: &str) -> Result> { +pub async fn delete_group_gallery( + configuration: &configuration::Configuration, + group_id: &str, + group_gallery_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/galleries/{groupGalleryId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), groupGalleryId=crate::apis::urlencode(group_gallery_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/galleries/{groupGalleryId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + groupGalleryId = crate::apis::urlencode(group_gallery_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -766,23 +951,41 @@ pub async fn delete_group_gallery(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Deletes an image from a Group gallery. -pub async fn delete_group_gallery_image(configuration: &configuration::Configuration, group_id: &str, group_gallery_id: &str, group_gallery_image_id: &str) -> Result> { +pub async fn delete_group_gallery_image( + configuration: &configuration::Configuration, + group_id: &str, + group_gallery_id: &str, + group_gallery_image_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/galleries/{groupGalleryId}/images/{groupGalleryImageId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), groupGalleryId=crate::apis::urlencode(group_gallery_id), groupGalleryImageId=crate::apis::urlencode(group_gallery_image_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/galleries/{groupGalleryId}/images/{groupGalleryImageId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + groupGalleryId = crate::apis::urlencode(group_gallery_id), + groupGalleryImageId = crate::apis::urlencode(group_gallery_image_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -794,23 +997,39 @@ pub async fn delete_group_gallery_image(configuration: &configuration::Configura 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 }; + 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)) } } /// Deletes an Group invite sent to a User -pub async fn delete_group_invite(configuration: &configuration::Configuration, group_id: &str, user_id: &str) -> Result<(), Error> { +pub async fn delete_group_invite( + configuration: &configuration::Configuration, + group_id: &str, + user_id: &str, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/invites/{userId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/invites/{userId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -822,23 +1041,39 @@ pub async fn delete_group_invite(configuration: &configuration::Configuration, g if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } /// Delete a Group post -pub async fn delete_group_post(configuration: &configuration::Configuration, group_id: &str, notification_id: &str) -> Result> { +pub async fn delete_group_post( + configuration: &configuration::Configuration, + group_id: &str, + notification_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/posts/{notificationId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), notificationId=crate::apis::urlencode(notification_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/posts/{notificationId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + notificationId = crate::apis::urlencode(notification_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -850,23 +1085,39 @@ pub async fn delete_group_post(configuration: &configuration::Configuration, gro 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 }; + 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)) } } /// Deletes a Group Role by ID and returns the remaining roles. -pub async fn delete_group_role(configuration: &configuration::Configuration, group_id: &str, group_role_id: &str) -> Result, Error> { +pub async fn delete_group_role( + configuration: &configuration::Configuration, + group_id: &str, + group_role_id: &str, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/roles/{groupRoleId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), groupRoleId=crate::apis::urlencode(group_role_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/roles/{groupRoleId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + groupRoleId = crate::apis::urlencode(group_role_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -878,26 +1129,42 @@ pub async fn delete_group_role(configuration: &configuration::Configuration, gro 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 }; + 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)) } } /// Returns a single Group by ID. -pub async fn get_group(configuration: &configuration::Configuration, group_id: &str, include_roles: Option) -> Result> { +pub async fn get_group( + configuration: &configuration::Configuration, + group_id: &str, + include_roles: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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_str) = include_roles { - local_var_req_builder = local_var_req_builder.query(&[("includeRoles", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("includeRoles", &local_var_str.to_string())]); } 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()); + 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()?; @@ -910,22 +1177,35 @@ pub async fn get_group(configuration: &configuration::Configuration, group_id: & 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } /// Returns the announcement for a Group. If no announcement has been made, then it returns **empty object**. If an announcement exists, then it will always return all fields except `imageId` and `imageUrl` which may be null. -pub async fn get_group_announcements(configuration: &configuration::Configuration, group_id: &str) -> Result> { +pub async fn get_group_announcements( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/announcement", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/announcement", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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()); + 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()?; @@ -937,35 +1217,56 @@ pub async fn get_group_announcements(configuration: &configuration::Configuratio 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 }; + 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)) } } /// Returns a list of audit logs for a Group. -pub async fn get_group_audit_logs(configuration: &configuration::Configuration, group_id: &str, n: Option, offset: Option, start_date: Option, end_date: Option) -> Result> { +pub async fn get_group_audit_logs( + configuration: &configuration::Configuration, + group_id: &str, + n: Option, + offset: Option, + start_date: Option, + end_date: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/auditLogs", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/auditLogs", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = start_date { - local_var_req_builder = local_var_req_builder.query(&[("startDate", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("startDate", &local_var_str.to_string())]); } if let Some(ref local_var_str) = end_date { - local_var_req_builder = local_var_req_builder.query(&[("endDate", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("endDate", &local_var_str.to_string())]); } 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()); + 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()?; @@ -977,29 +1278,46 @@ pub async fn get_group_audit_logs(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Returns a list of banned users for a Group. -pub async fn get_group_bans(configuration: &configuration::Configuration, group_id: &str, n: Option, offset: Option) -> Result, Error> { +pub async fn get_group_bans( + configuration: &configuration::Configuration, + group_id: &str, + n: Option, + offset: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/bans", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/bans", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } 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()); + 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()?; @@ -1011,32 +1329,53 @@ pub async fn get_group_bans(configuration: &configuration::Configuration, group_ 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 }; + 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)) } } /// Returns a list of images for a Group gallery. -pub async fn get_group_gallery_images(configuration: &configuration::Configuration, group_id: &str, group_gallery_id: &str, n: Option, offset: Option, approved: Option) -> Result, Error> { +pub async fn get_group_gallery_images( + configuration: &configuration::Configuration, + group_id: &str, + group_gallery_id: &str, + n: Option, + offset: Option, + approved: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/galleries/{groupGalleryId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), groupGalleryId=crate::apis::urlencode(group_gallery_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/galleries/{groupGalleryId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + groupGalleryId = crate::apis::urlencode(group_gallery_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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = approved { - local_var_req_builder = local_var_req_builder.query(&[("approved", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("approved", &local_var_str.to_string())]); } 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()); + 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()?; @@ -1048,23 +1387,37 @@ pub async fn get_group_gallery_images(configuration: &configuration::Configurati 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 }; + 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)) } } /// Returns a list of group instances -pub async fn get_group_instances(configuration: &configuration::Configuration, group_id: &str) -> Result, Error> { +pub async fn get_group_instances( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/instances", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/instances", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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()); + 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()?; @@ -1076,29 +1429,46 @@ pub async fn get_group_instances(configuration: &configuration::Configuration, g 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 }; + 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)) } } /// Returns a list of members that have been invited to the Group. -pub async fn get_group_invites(configuration: &configuration::Configuration, group_id: &str, n: Option, offset: Option) -> Result, Error> { +pub async fn get_group_invites( + configuration: &configuration::Configuration, + group_id: &str, + n: Option, + offset: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/invites", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/invites", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } 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()); + 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()?; @@ -1110,23 +1480,39 @@ pub async fn get_group_invites(configuration: &configuration::Configuration, gro 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 }; + 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)) } } /// Returns a LimitedGroup Member. -pub async fn get_group_member(configuration: &configuration::Configuration, group_id: &str, user_id: &str) -> Result> { +pub async fn get_group_member( + configuration: &configuration::Configuration, + group_id: &str, + user_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/members/{userId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), 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()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/members/{userId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + 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()); + 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()?; @@ -1138,32 +1524,51 @@ pub async fn get_group_member(configuration: &configuration::Configuration, grou 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 }; + 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)) } } /// Returns a List of all **other** Group Members. This endpoint will never return the user calling the endpoint. Information about the user calling the endpoint must be found in the `myMember` field of the Group object. -pub async fn get_group_members(configuration: &configuration::Configuration, group_id: &str, n: Option, offset: Option, sort: Option) -> Result, Error> { +pub async fn get_group_members( + configuration: &configuration::Configuration, + group_id: &str, + n: Option, + offset: Option, + sort: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/members", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/members", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = sort { - local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); } 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()); + 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()?; @@ -1175,23 +1580,37 @@ pub async fn get_group_members(configuration: &configuration::Configuration, gro 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 }; + 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)) } } /// Returns a List of all possible/available permissions for a Group. -pub async fn get_group_permissions(configuration: &configuration::Configuration, group_id: &str) -> Result, Error> { +pub async fn get_group_permissions( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/permissions", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/permissions", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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()); + 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()?; @@ -1203,32 +1622,51 @@ pub async fn get_group_permissions(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Get posts from a Group -pub async fn get_group_post(configuration: &configuration::Configuration, group_id: &str, n: Option, offset: Option, public_only: Option) -> Result> { +pub async fn get_group_post( + configuration: &configuration::Configuration, + group_id: &str, + n: Option, + offset: Option, + public_only: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/posts", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/posts", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = public_only { - local_var_req_builder = local_var_req_builder.query(&[("publicOnly", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("publicOnly", &local_var_str.to_string())]); } 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()); + 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()?; @@ -1240,32 +1678,51 @@ pub async fn get_group_post(configuration: &configuration::Configuration, group_ 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 }; + 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)) } } /// Returns a list of members that have requested to join the Group. -pub async fn get_group_requests(configuration: &configuration::Configuration, group_id: &str, n: Option, offset: Option, blocked: Option) -> Result, Error> { +pub async fn get_group_requests( + configuration: &configuration::Configuration, + group_id: &str, + n: Option, + offset: Option, + blocked: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/requests", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/requests", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = blocked { - local_var_req_builder = local_var_req_builder.query(&[("blocked", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("blocked", &local_var_str.to_string())]); } 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()); + 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()?; @@ -1277,23 +1734,37 @@ pub async fn get_group_requests(configuration: &configuration::Configuration, gr 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 }; + 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)) } } /// Returns a Group Role by ID. -pub async fn get_group_roles(configuration: &configuration::Configuration, group_id: &str) -> Result, Error> { +pub async fn get_group_roles( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/roles", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/roles", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_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()); + 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()?; @@ -1305,23 +1776,37 @@ pub async fn get_group_roles(configuration: &configuration::Configuration, group 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 }; + 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)) } } /// Join a Group by ID and returns the member object. -pub async fn join_group(configuration: &configuration::Configuration, group_id: &str) -> Result> { +pub async fn join_group( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/join", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/join", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + 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()?; @@ -1333,23 +1818,39 @@ pub async fn join_group(configuration: &configuration::Configuration, group_id: 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 }; + 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)) } } /// Kicks a Group Member from the Group. The current user must have the \"Remove Group Members\" permission. -pub async fn kick_group_member(configuration: &configuration::Configuration, group_id: &str, user_id: &str) -> Result<(), Error> { +pub async fn kick_group_member( + configuration: &configuration::Configuration, + group_id: &str, + user_id: &str, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/members/{userId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/members/{userId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -1361,23 +1862,37 @@ pub async fn kick_group_member(configuration: &configuration::Configuration, gro if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } /// Leave a group by ID. -pub async fn leave_group(configuration: &configuration::Configuration, group_id: &str) -> Result<(), Error> { +pub async fn leave_group( + configuration: &configuration::Configuration, + group_id: &str, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/leave", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/leave", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + 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()?; @@ -1389,23 +1904,41 @@ pub async fn leave_group(configuration: &configuration::Configuration, group_id: if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } /// Removes a Role from a Group Member -pub async fn remove_group_member_role(configuration: &configuration::Configuration, group_id: &str, user_id: &str, group_role_id: &str) -> Result, Error> { +pub async fn remove_group_member_role( + configuration: &configuration::Configuration, + group_id: &str, + user_id: &str, + group_role_id: &str, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/members/{userId}/roles/{groupRoleId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), userId=crate::apis::urlencode(user_id), groupRoleId=crate::apis::urlencode(group_role_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/members/{userId}/roles/{groupRoleId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + userId = crate::apis::urlencode(user_id), + groupRoleId = crate::apis::urlencode(group_role_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -1417,23 +1950,40 @@ pub async fn remove_group_member_role(configuration: &configuration::Configurati 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 }; + 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)) } } /// Responds to a Group Join Request with Accept/Deny -pub async fn respond_group_join_request(configuration: &configuration::Configuration, group_id: &str, user_id: &str, respond_group_join_request: models::RespondGroupJoinRequest) -> Result<(), Error> { +pub async fn respond_group_join_request( + configuration: &configuration::Configuration, + group_id: &str, + user_id: &str, + respond_group_join_request: models::RespondGroupJoinRequest, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/requests/{userId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/requests/{userId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&respond_group_join_request); @@ -1446,32 +1996,46 @@ pub async fn respond_group_join_request(configuration: &configuration::Configura if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } /// Searches Groups by name or shortCode -pub async fn search_groups(configuration: &configuration::Configuration, query: Option<&str>, offset: Option, n: Option) -> Result, Error> { +pub async fn search_groups( + configuration: &configuration::Configuration, + query: Option<&str>, + offset: Option, + n: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/groups", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = query { - local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("query", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } 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()); + 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()?; @@ -1483,23 +2047,39 @@ pub async fn search_groups(configuration: &configuration::Configuration, query: 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 }; + 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)) } } /// Unbans a user from a Group. -pub async fn unban_group_member(configuration: &configuration::Configuration, group_id: &str, user_id: &str) -> Result> { +pub async fn unban_group_member( + configuration: &configuration::Configuration, + group_id: &str, + user_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/bans/{userId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/bans/{userId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -1511,23 +2091,38 @@ pub async fn unban_group_member(configuration: &configuration::Configuration, gr 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 }; + 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)) } } /// Updates a Group and returns it. -pub async fn update_group(configuration: &configuration::Configuration, group_id: &str, update_group_request: Option) -> Result> { +pub async fn update_group( + configuration: &configuration::Configuration, + group_id: &str, + update_group_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_group_request); @@ -1540,23 +2135,40 @@ pub async fn update_group(configuration: &configuration::Configuration, group_id 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 }; + 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)) } } /// Updates a gallery for a Group. -pub async fn update_group_gallery(configuration: &configuration::Configuration, group_id: &str, group_gallery_id: &str, update_group_gallery_request: Option) -> Result> { +pub async fn update_group_gallery( + configuration: &configuration::Configuration, + group_id: &str, + group_gallery_id: &str, + update_group_gallery_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/galleries/{groupGalleryId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), groupGalleryId=crate::apis::urlencode(group_gallery_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/galleries/{groupGalleryId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + groupGalleryId = crate::apis::urlencode(group_gallery_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_group_gallery_request); @@ -1569,23 +2181,40 @@ pub async fn update_group_gallery(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Updates a Group Member -pub async fn update_group_member(configuration: &configuration::Configuration, group_id: &str, user_id: &str, update_group_member_request: Option) -> Result> { +pub async fn update_group_member( + configuration: &configuration::Configuration, + group_id: &str, + user_id: &str, + update_group_member_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/members/{userId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/members/{userId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_group_member_request); @@ -1598,23 +2227,40 @@ pub async fn update_group_member(configuration: &configuration::Configuration, g 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 }; + 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)) } } /// Edits a Group post -pub async fn update_group_post(configuration: &configuration::Configuration, group_id: &str, notification_id: &str, create_group_post_request: models::CreateGroupPostRequest) -> Result> { +pub async fn update_group_post( + configuration: &configuration::Configuration, + group_id: &str, + notification_id: &str, + create_group_post_request: models::CreateGroupPostRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/posts/{notificationId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), notificationId=crate::apis::urlencode(notification_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/posts/{notificationId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + notificationId = crate::apis::urlencode(notification_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_group_post_request); @@ -1627,23 +2273,40 @@ pub async fn update_group_post(configuration: &configuration::Configuration, gro 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 }; + 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)) } } /// Updates a group role by ID. -pub async fn update_group_role(configuration: &configuration::Configuration, group_id: &str, group_role_id: &str, update_group_role_request: Option) -> Result, Error> { +pub async fn update_group_role( + configuration: &configuration::Configuration, + group_id: &str, + group_role_id: &str, + update_group_role_request: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/groups/{groupId}/roles/{groupRoleId}", local_var_configuration.base_path, groupId=crate::apis::urlencode(group_id), groupRoleId=crate::apis::urlencode(group_role_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/groups/{groupId}/roles/{groupRoleId}", + local_var_configuration.base_path, + groupId = crate::apis::urlencode(group_id), + groupRoleId = crate::apis::urlencode(group_role_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_group_role_request); @@ -1656,9 +2319,13 @@ pub async fn update_group_role(configuration: &configuration::Configuration, gro 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 }; + 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)) } } - diff --git a/src/apis/instances_api.rs b/src/apis/instances_api.rs index fdff048..89a55ca 100644 --- a/src/apis/instances_api.rs +++ b/src/apis/instances_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`close_instance`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -64,24 +62,38 @@ pub enum SendSelfInviteError { UnknownValue(serde_json::Value), } - /// Close an instance or update the closedAt time when it will be closed. You can only close an instance if the ownerId is yourself or if the instance owner is a group and you have the `group-instance-moderate` permission. -pub async fn close_instance(configuration: &configuration::Configuration, world_id: &str, instance_id: &str, hard_close: Option, closed_at: Option) -> Result> { +pub async fn close_instance( + configuration: &configuration::Configuration, + world_id: &str, + instance_id: &str, + hard_close: Option, + closed_at: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/instances/{worldId}:{instanceId}", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/instances/{worldId}:{instanceId}", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id), + instanceId = crate::apis::urlencode(instance_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); if let Some(ref local_var_str) = hard_close { - local_var_req_builder = local_var_req_builder.query(&[("hardClose", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("hardClose", &local_var_str.to_string())]); } if let Some(ref local_var_str) = closed_at { - local_var_req_builder = local_var_req_builder.query(&[("closedAt", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("closedAt", &local_var_str.to_string())]); } 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()); + 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()?; @@ -93,23 +105,33 @@ pub async fn close_instance(configuration: &configuration::Configuration, world_ 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 }; + 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)) } } /// Create an instance -pub async fn create_instance(configuration: &configuration::Configuration, create_instance_request: models::CreateInstanceRequest) -> Result> { +pub async fn create_instance( + configuration: &configuration::Configuration, + create_instance_request: models::CreateInstanceRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/instances", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_instance_request); @@ -122,23 +144,39 @@ pub async fn create_instance(configuration: &configuration::Configuration, creat 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 }; + 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)) } } /// Returns an instance. Please read [Instances Tutorial](https://vrchatapi.github.io/tutorials/instances/) for more information on Instances. If an invalid instanceId is provided, this endpoint will simply return \"null\"! -pub async fn get_instance(configuration: &configuration::Configuration, world_id: &str, instance_id: &str) -> Result> { +pub async fn get_instance( + configuration: &configuration::Configuration, + world_id: &str, + instance_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/instances/{worldId}:{instanceId}", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/instances/{worldId}:{instanceId}", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id), + instanceId = crate::apis::urlencode(instance_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()); + 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()?; @@ -150,23 +188,37 @@ pub async fn get_instance(configuration: &configuration::Configuration, world_id 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 }; + 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)) } } /// Returns an instance. Please read [Instances Tutorial](https://vrchatapi.github.io/tutorials/instances/) for more information on Instances. -pub async fn get_instance_by_short_name(configuration: &configuration::Configuration, short_name: &str) -> Result> { +pub async fn get_instance_by_short_name( + configuration: &configuration::Configuration, + short_name: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/instances/s/{shortName}", local_var_configuration.base_path, shortName=crate::apis::urlencode(short_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/instances/s/{shortName}", + local_var_configuration.base_path, + shortName = crate::apis::urlencode(short_name) + ); + 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()); + 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()?; @@ -178,23 +230,39 @@ pub async fn get_instance_by_short_name(configuration: &configuration::Configura 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 }; + 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)) } } /// Returns an instance short name. -pub async fn get_short_name(configuration: &configuration::Configuration, world_id: &str, instance_id: &str) -> Result> { +pub async fn get_short_name( + configuration: &configuration::Configuration, + world_id: &str, + instance_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/instances/{worldId}:{instanceId}/shortName", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/instances/{worldId}:{instanceId}/shortName", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id), + instanceId = crate::apis::urlencode(instance_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()); + 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()?; @@ -206,23 +274,39 @@ pub async fn get_short_name(configuration: &configuration::Configuration, world_ 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 }; + 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)) } } /// Sends an invite to the instance to yourself. -pub async fn send_self_invite(configuration: &configuration::Configuration, world_id: &str, instance_id: &str) -> Result> { +pub async fn send_self_invite( + configuration: &configuration::Configuration, + world_id: &str, + instance_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/instances/{worldId}:{instanceId}/invite", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/instances/{worldId}:{instanceId}/invite", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id), + instanceId = crate::apis::urlencode(instance_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + 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()?; @@ -234,9 +318,13 @@ pub async fn send_self_invite(configuration: &configuration::Configuration, worl 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 }; + 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)) } } - diff --git a/src/apis/invite_api.rs b/src/apis/invite_api.rs index 5e7a82b..01d7e4c 100644 --- a/src/apis/invite_api.rs +++ b/src/apis/invite_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`get_invite_message`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -86,18 +84,30 @@ pub enum UpdateInviteMessageError { UnknownValue(serde_json::Value), } - /// Returns a single Invite Message. This returns the exact same information but less than `getInviteMessages`. Admin Credentials are required to view messages of other users! Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite -pub async fn get_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: models::InviteMessageType, slot: i32) -> Result> { +pub async fn get_invite_message( + configuration: &configuration::Configuration, + user_id: &str, + message_type: models::InviteMessageType, + slot: i32, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{slot}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=message_type.to_string(), slot=slot); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/message/{userId}/{messageType}/{slot}", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id), + messageType = message_type.to_string(), + slot = slot + ); + 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()); + 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()?; @@ -109,23 +119,39 @@ pub async fn get_invite_message(configuration: &configuration::Configuration, us 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 }; + 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)) } } /// Returns a list of all the users Invite Messages. Admin Credentials are required to view messages of other users! Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite -pub async fn get_invite_messages(configuration: &configuration::Configuration, user_id: &str, message_type: models::InviteMessageType) -> Result, Error> { +pub async fn get_invite_messages( + configuration: &configuration::Configuration, + user_id: &str, + message_type: models::InviteMessageType, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/message/{userId}/{messageType}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=message_type.to_string()); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/message/{userId}/{messageType}", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id), + messageType = message_type.to_string() + ); + 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()); + 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()?; @@ -137,23 +163,39 @@ pub async fn get_invite_messages(configuration: &configuration::Configuration, u 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 }; + 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)) } } /// Sends self an invite to an instance -pub async fn invite_myself_to(configuration: &configuration::Configuration, world_id: &str, instance_id: &str) -> Result> { +pub async fn invite_myself_to( + configuration: &configuration::Configuration, + world_id: &str, + instance_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/invite/myself/to/{worldId}:{instanceId}", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/invite/myself/to/{worldId}:{instanceId}", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id), + instanceId = crate::apis::urlencode(instance_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + 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()?; @@ -165,23 +207,38 @@ pub async fn invite_myself_to(configuration: &configuration::Configuration, worl 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 }; + 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)) } } /// Sends an invite to a user. Returns the Notification of type `invite` that was sent. -pub async fn invite_user(configuration: &configuration::Configuration, user_id: &str, invite_request: models::InviteRequest) -> Result> { +pub async fn invite_user( + configuration: &configuration::Configuration, + user_id: &str, + invite_request: models::InviteRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/invite/{userId}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/invite/{userId}", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&invite_request); @@ -194,23 +251,38 @@ pub async fn invite_user(configuration: &configuration::Configuration, user_id: 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 }; + 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)) } } /// Requests an invite from a user. Returns the Notification of type `requestInvite` that was sent. -pub async fn request_invite(configuration: &configuration::Configuration, user_id: &str, request_invite_request: Option) -> Result> { +pub async fn request_invite( + configuration: &configuration::Configuration, + user_id: &str, + request_invite_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/requestInvite/{userId}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/requestInvite/{userId}", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&request_invite_request); @@ -223,23 +295,41 @@ pub async fn request_invite(configuration: &configuration::Configuration, user_i 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 }; + 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)) } } /// Resets a single Invite Message back to its original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, so it is not possible to reset within the 60 minutes countdown. Resetting it does however not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite The DELETE endpoint does not have/require any request body. -pub async fn reset_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: models::InviteMessageType, slot: i32) -> Result, Error> { +pub async fn reset_invite_message( + configuration: &configuration::Configuration, + user_id: &str, + message_type: models::InviteMessageType, + slot: i32, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{slot}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=message_type.to_string(), slot=slot); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/message/{userId}/{messageType}/{slot}", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id), + messageType = message_type.to_string(), + slot = slot + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -251,23 +341,38 @@ pub async fn reset_invite_message(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Respond to an invite request by sending a world invite to the requesting user. `:notificationId` is the ID of the requesting notification. -pub async fn respond_invite(configuration: &configuration::Configuration, notification_id: &str, invite_response: models::InviteResponse) -> Result> { +pub async fn respond_invite( + configuration: &configuration::Configuration, + notification_id: &str, + invite_response: models::InviteResponse, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/invite/{notificationId}/response", local_var_configuration.base_path, notificationId=crate::apis::urlencode(notification_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/invite/{notificationId}/response", + local_var_configuration.base_path, + notificationId = crate::apis::urlencode(notification_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&invite_response); @@ -280,23 +385,42 @@ pub async fn respond_invite(configuration: &configuration::Configuration, notifi 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 }; + 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)) } } /// Updates a single Invite Message and then returns a list of all of them. Admin Credentials are required to update messages of other users! Updating a message automatically sets the cooldown timer to 60 minutes. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite -pub async fn update_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: models::InviteMessageType, slot: i32, update_invite_message_request: Option) -> Result, Error> { +pub async fn update_invite_message( + configuration: &configuration::Configuration, + user_id: &str, + message_type: models::InviteMessageType, + slot: i32, + update_invite_message_request: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/message/{userId}/{messageType}/{slot}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id), messageType=message_type.to_string(), slot=slot); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/message/{userId}/{messageType}/{slot}", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id), + messageType = message_type.to_string(), + slot = slot + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_invite_message_request); @@ -309,9 +433,13 @@ pub async fn update_invite_message(configuration: &configuration::Configuration, 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 }; + 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)) } } - diff --git a/src/apis/mod.rs b/src/apis/mod.rs index 9e080ff..7b80d97 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -16,7 +16,7 @@ pub enum Error { ResponseError(ResponseContent), } -impl fmt::Display for Error { +impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let (module, e) = match self { Error::Reqwest(e) => ("reqwest", e.to_string()), @@ -28,7 +28,7 @@ impl fmt::Display for Error { } } -impl error::Error for Error { +impl error::Error for Error { fn source(&self) -> Option<&(dyn error::Error + 'static)> { Some(match self { Error::Reqwest(e) => e, @@ -39,19 +39,19 @@ impl error::Error for Error { } } -impl From for Error { +impl From for Error { fn from(e: reqwest::Error) -> Self { Error::Reqwest(e) } } -impl From for Error { +impl From for Error { fn from(e: serde_json::Error) -> Self { Error::Serde(e) } } -impl From for Error { +impl From for Error { fn from(e: std::io::Error) -> Self { Error::Io(e) } @@ -78,8 +78,10 @@ pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String value, )); } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + } + serde_json::Value::String(s) => { + params.push((format!("{}[{}]", prefix, key), s.clone())) + } _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), } } diff --git a/src/apis/notifications_api.rs b/src/apis/notifications_api.rs index eacc744..be73fb3 100644 --- a/src/apis/notifications_api.rs +++ b/src/apis/notifications_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`accept_friend_request`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -54,18 +52,26 @@ pub enum MarkNotificationAsReadError { UnknownValue(serde_json::Value), } - /// Accept a friend request by notification `frq_` ID. Friend requests can be found using the NotificationsAPI `getNotifications` by filtering of type `friendRequest`. -pub async fn accept_friend_request(configuration: &configuration::Configuration, notification_id: &str) -> Result> { +pub async fn accept_friend_request( + configuration: &configuration::Configuration, + notification_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/notifications/{notificationId}/accept", local_var_configuration.base_path, notificationId=crate::apis::urlencode(notification_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/notifications/{notificationId}/accept", + local_var_configuration.base_path, + notificationId = crate::apis::urlencode(notification_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -77,23 +83,35 @@ pub async fn accept_friend_request(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Clear **all** notifications. -pub async fn clear_notifications(configuration: &configuration::Configuration, ) -> Result> { +pub async fn clear_notifications( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/notifications/clear", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/notifications/clear", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -105,23 +123,37 @@ pub async fn clear_notifications(configuration: &configuration::Configuration, ) 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 }; + 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)) } } /// Delete a notification. -pub async fn delete_notification(configuration: &configuration::Configuration, notification_id: &str) -> Result> { +pub async fn delete_notification( + configuration: &configuration::Configuration, + notification_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/notifications/{notificationId}/hide", local_var_configuration.base_path, notificationId=crate::apis::urlencode(notification_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/notifications/{notificationId}/hide", + local_var_configuration.base_path, + notificationId = crate::apis::urlencode(notification_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -133,41 +165,64 @@ pub async fn delete_notification(configuration: &configuration::Configuration, n 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 }; + 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)) } } /// Retrieve all of the current user's notifications. -pub async fn get_notifications(configuration: &configuration::Configuration, r#type: Option<&str>, sent: Option, hidden: Option, after: Option<&str>, n: Option, offset: Option) -> Result, Error> { +pub async fn get_notifications( + configuration: &configuration::Configuration, + r#type: Option<&str>, + sent: Option, + hidden: Option, + after: Option<&str>, + n: Option, + offset: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/notifications", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/notifications", + local_var_configuration.base_path + ); + 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_str) = r#type { - local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("type", &local_var_str.to_string())]); } if let Some(ref local_var_str) = sent { - local_var_req_builder = local_var_req_builder.query(&[("sent", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("sent", &local_var_str.to_string())]); } if let Some(ref local_var_str) = hidden { - local_var_req_builder = local_var_req_builder.query(&[("hidden", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("hidden", &local_var_str.to_string())]); } if let Some(ref local_var_str) = after { - local_var_req_builder = local_var_req_builder.query(&[("after", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("after", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } 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()); + 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()?; @@ -179,23 +234,37 @@ pub async fn get_notifications(configuration: &configuration::Configuration, r#t 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 }; + 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)) } } /// Mark a notification as seen. -pub async fn mark_notification_as_read(configuration: &configuration::Configuration, notification_id: &str) -> Result> { +pub async fn mark_notification_as_read( + configuration: &configuration::Configuration, + notification_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/notifications/{notificationId}/see", local_var_configuration.base_path, notificationId=crate::apis::urlencode(notification_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/notifications/{notificationId}/see", + local_var_configuration.base_path, + notificationId = crate::apis::urlencode(notification_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -207,9 +276,13 @@ pub async fn mark_notification_as_read(configuration: &configuration::Configurat 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 }; + 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)) } } - diff --git a/src/apis/permissions_api.rs b/src/apis/permissions_api.rs index 4a02727..19df323 100644 --- a/src/apis/permissions_api.rs +++ b/src/apis/permissions_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`get_assigned_permissions`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -29,18 +27,21 @@ pub enum GetPermissionError { UnknownValue(serde_json::Value), } - /// Returns a list of all permissions currently granted by the user. Permissions are assigned e.g. by subscribing to VRC+. -pub async fn get_assigned_permissions(configuration: &configuration::Configuration, ) -> Result, Error> { +pub async fn get_assigned_permissions( + configuration: &configuration::Configuration, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/auth/permissions", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + 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()?; @@ -52,23 +53,37 @@ pub async fn get_assigned_permissions(configuration: &configuration::Configurati 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 }; + 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)) } } /// Returns a single permission. This endpoint is pretty useless, as it returns the exact same information as `/auth/permissions`. -pub async fn get_permission(configuration: &configuration::Configuration, permission_id: &str) -> Result> { +pub async fn get_permission( + configuration: &configuration::Configuration, + permission_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/permissions/{permissionId}", local_var_configuration.base_path, permissionId=crate::apis::urlencode(permission_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/permissions/{permissionId}", + local_var_configuration.base_path, + permissionId = crate::apis::urlencode(permission_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()); + 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()?; @@ -80,9 +95,13 @@ pub async fn get_permission(configuration: &configuration::Configuration, permis 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 }; + 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)) } } - diff --git a/src/apis/playermoderation_api.rs b/src/apis/playermoderation_api.rs index adafede..925bf68 100644 --- a/src/apis/playermoderation_api.rs +++ b/src/apis/playermoderation_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`clear_all_player_moderations`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -63,18 +61,24 @@ pub enum UnmoderateUserError { UnknownValue(serde_json::Value), } - /// ⚠️ **This will delete every single player moderation you've ever made.** -pub async fn clear_all_player_moderations(configuration: &configuration::Configuration, ) -> Result> { +pub async fn clear_all_player_moderations( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/playermoderations", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/playermoderations", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -86,23 +90,37 @@ pub async fn clear_all_player_moderations(configuration: &configuration::Configu 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 }; + 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)) } } /// Deletes a specific player moderation based on it's `pmod_` ID. The website uses `unmoderateUser` instead. You can delete the same player moderation multiple times successfully. -pub async fn delete_player_moderation(configuration: &configuration::Configuration, player_moderation_id: &str) -> Result> { +pub async fn delete_player_moderation( + configuration: &configuration::Configuration, + player_moderation_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/playermoderations/{playerModerationId}", local_var_configuration.base_path, playerModerationId=crate::apis::urlencode(player_moderation_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/playermoderations/{playerModerationId}", + local_var_configuration.base_path, + playerModerationId = crate::apis::urlencode(player_moderation_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -114,23 +132,37 @@ pub async fn delete_player_moderation(configuration: &configuration::Configurati 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 }; + 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)) } } /// Returns a single Player Moderation. This returns the exact same amount of information as the more generalised `getPlayerModerations`. -pub async fn get_player_moderation(configuration: &configuration::Configuration, player_moderation_id: &str) -> Result> { +pub async fn get_player_moderation( + configuration: &configuration::Configuration, + player_moderation_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/playermoderations/{playerModerationId}", local_var_configuration.base_path, playerModerationId=crate::apis::urlencode(player_moderation_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/playermoderations/{playerModerationId}", + local_var_configuration.base_path, + playerModerationId = crate::apis::urlencode(player_moderation_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()); + 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()?; @@ -142,29 +174,45 @@ pub async fn get_player_moderation(configuration: &configuration::Configuration, 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 }; + 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)) } } /// Returns a list of all player moderations made by **you**. This endpoint does not have pagination, and will return *all* results. Use query parameters to limit your query if needed. -pub async fn get_player_moderations(configuration: &configuration::Configuration, r#type: Option<&str>, target_user_id: Option<&str>) -> Result, Error> { +pub async fn get_player_moderations( + configuration: &configuration::Configuration, + r#type: Option<&str>, + target_user_id: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/playermoderations", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/playermoderations", + local_var_configuration.base_path + ); + 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_str) = r#type { - local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("type", &local_var_str.to_string())]); } if let Some(ref local_var_str) = target_user_id { - local_var_req_builder = local_var_req_builder.query(&[("targetUserId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("targetUserId", &local_var_str.to_string())]); } 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()); + 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()?; @@ -176,23 +224,36 @@ pub async fn get_player_moderations(configuration: &configuration::Configuration 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 }; + 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)) } } /// 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 async fn moderate_user(configuration: &configuration::Configuration, moderate_user_request: models::ModerateUserRequest) -> Result> { +pub async fn moderate_user( + configuration: &configuration::Configuration, + moderate_user_request: models::ModerateUserRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/playermoderations", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/playermoderations", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&moderate_user_request); @@ -205,23 +266,36 @@ pub async fn moderate_user(configuration: &configuration::Configuration, moderat 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 }; + 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)) } } /// 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 async fn unmoderate_user(configuration: &configuration::Configuration, moderate_user_request: models::ModerateUserRequest) -> Result> { +pub async fn unmoderate_user( + configuration: &configuration::Configuration, + moderate_user_request: models::ModerateUserRequest, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/auth/user/unplayermoderate", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/auth/user/unplayermoderate", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&moderate_user_request); @@ -234,9 +308,13 @@ pub async fn unmoderate_user(configuration: &configuration::Configuration, moder 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 }; + 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)) } } - diff --git a/src/apis/system_api.rs b/src/apis/system_api.rs index cb965d1..c7020b3 100644 --- a/src/apis/system_api.rs +++ b/src/apis/system_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`get_config`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -64,18 +62,21 @@ pub enum GetSystemTimeError { UnknownValue(serde_json::Value), } - /// API config contains configuration that the clients needs to work properly. Currently the most important value here is `clientApiKey` which is used for all other API endpoints. -pub async fn get_config(configuration: &configuration::Configuration, ) -> Result> { +pub async fn get_config( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/config", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + 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()?; @@ -87,29 +88,42 @@ pub async fn get_config(configuration: &configuration::Configuration, ) -> Resul 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 }; + 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)) } } /// Fetches the CSS code to the frontend React website. -pub async fn get_css(configuration: &configuration::Configuration, variant: Option<&str>, branch: Option<&str>) -> Result> { +pub async fn get_css( + configuration: &configuration::Configuration, + variant: Option<&str>, + branch: Option<&str>, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/css/app.css", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = variant { - local_var_req_builder = local_var_req_builder.query(&[("variant", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("variant", &local_var_str.to_string())]); } if let Some(ref local_var_str) = branch { - local_var_req_builder = local_var_req_builder.query(&[("branch", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("branch", &local_var_str.to_string())]); } 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()); + 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()?; @@ -122,22 +136,30 @@ pub async fn get_css(configuration: &configuration::Configuration, variant: Opti 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } /// Returns the current number of online users. **NOTE:** The response type is not a JSON object, but a simple JSON integer. -pub async fn get_current_online_users(configuration: &configuration::Configuration, ) -> Result> { +pub async fn get_current_online_users( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/visits", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + 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()?; @@ -149,23 +171,32 @@ pub async fn get_current_online_users(configuration: &configuration::Configurati 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 }; + 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)) } } /// ~~Gets the overall health status, the server name, and the current build version tag of the API.~~ **DEPRECATED:** VRChat has suddenly restricted this endpoint for unknown reasons, and now always return 401 Unauthorized. -pub async fn get_health(configuration: &configuration::Configuration, ) -> Result> { +pub async fn get_health( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + 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()?; @@ -177,29 +208,42 @@ pub async fn get_health(configuration: &configuration::Configuration, ) -> Resul 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 }; + 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)) } } /// IPS (Info Push System) is a system for VRChat to push out dynamic information to the client. This is primarily used by the Quick-Menu info banners, but can also be used to e.g. alert you to update your game to the latest version. `include` is used to query what Information Pushes should be included in the response. If include is missing or empty, then no notices will normally be returned. This is an \"any of\" search. `require` is used to limit what Information Pushes should be included in the response. This is usually used in combination with `include`, and is an \"all of\" search. -pub async fn get_info_push(configuration: &configuration::Configuration, require: Option<&str>, include: Option<&str>) -> Result, Error> { +pub async fn get_info_push( + configuration: &configuration::Configuration, + require: Option<&str>, + include: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/infoPush", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = require { - local_var_req_builder = local_var_req_builder.query(&[("require", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("require", &local_var_str.to_string())]); } if let Some(ref local_var_str) = include { - local_var_req_builder = local_var_req_builder.query(&[("include", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("include", &local_var_str.to_string())]); } 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()); + 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()?; @@ -211,29 +255,42 @@ pub async fn get_info_push(configuration: &configuration::Configuration, require 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 }; + 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)) } } /// Fetches the JavaScript code to the frontend React website. -pub async fn get_java_script(configuration: &configuration::Configuration, variant: Option<&str>, branch: Option<&str>) -> Result> { +pub async fn get_java_script( + configuration: &configuration::Configuration, + variant: Option<&str>, + branch: Option<&str>, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/js/app.js", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = variant { - local_var_req_builder = local_var_req_builder.query(&[("variant", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("variant", &local_var_str.to_string())]); } if let Some(ref local_var_str) = branch { - local_var_req_builder = local_var_req_builder.query(&[("branch", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("branch", &local_var_str.to_string())]); } 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()); + 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()?; @@ -245,23 +302,32 @@ pub async fn get_java_script(configuration: &configuration::Configuration, varia 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 }; + 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)) } } /// Returns the current time of the API server. **NOTE:** The response type is not a JSON object, but a simple JSON string. -pub async fn get_system_time(configuration: &configuration::Configuration, ) -> Result> { +pub async fn get_system_time( + configuration: &configuration::Configuration, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/time", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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()); + 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()?; @@ -273,9 +339,13 @@ pub async fn get_system_time(configuration: &configuration::Configuration, ) -> 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 }; + 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)) } } - diff --git a/src/apis/users_api.rs b/src/apis/users_api.rs index 3c85d37..7b733b0 100644 --- a/src/apis/users_api.rs +++ b/src/apis/users_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`get_user`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -70,18 +68,26 @@ pub enum UpdateUserError { UnknownValue(serde_json::Value), } - /// Get public user information about a specific user using their ID. -pub async fn get_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn get_user( + 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}", 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()); + let local_var_uri_str = format!( + "{}/users/{userId}", + 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()); + 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()?; @@ -94,22 +100,35 @@ pub async fn get_user(configuration: &configuration::Configuration, user_id: &st 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } /// ~~Get public user information about a specific user using their name.~~ **DEPRECATED:** VRChat API no longer return usernames of other users. [See issue by Tupper for more information](https://github.com/pypy-vrc/VRCX/issues/429). This endpoint now require Admin Credentials. -pub async fn get_user_by_name(configuration: &configuration::Configuration, username: &str) -> Result> { +pub async fn get_user_by_name( + configuration: &configuration::Configuration, + username: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/users/{username}/name", local_var_configuration.base_path, username=crate::apis::urlencode(username)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/users/{username}/name", + local_var_configuration.base_path, + username = crate::apis::urlencode(username) + ); + 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()); + 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()?; @@ -121,23 +140,37 @@ pub async fn get_user_by_name(configuration: &configuration::Configuration, user 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 }; + 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)) } } /// Returns a list of Groups the user has requested to be invited into. -pub async fn get_user_group_requests(configuration: &configuration::Configuration, user_id: &str) -> Result, Error> { +pub async fn get_user_group_requests( + configuration: &configuration::Configuration, + user_id: &str, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/users/{userId}/groups/requested", 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()); + let local_var_uri_str = format!( + "{}/users/{userId}/groups/requested", + 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()); + 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()?; @@ -149,23 +182,37 @@ pub async fn get_user_group_requests(configuration: &configuration::Configuratio 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 }; + 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)) } } /// Get user's public groups -pub async fn get_user_groups(configuration: &configuration::Configuration, user_id: &str) -> Result, Error> { +pub async fn get_user_groups( + configuration: &configuration::Configuration, + user_id: &str, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/users/{userId}/groups", 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()); + let local_var_uri_str = format!( + "{}/users/{userId}/groups", + 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()); + 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()?; @@ -177,23 +224,37 @@ pub async fn get_user_groups(configuration: &configuration::Configuration, user_ 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 }; + 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)) } } /// Returns the current group that the user is currently representing -pub async fn get_user_represented_group(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async 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()); + 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()); + 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()?; @@ -205,35 +266,51 @@ pub async fn get_user_represented_group(configuration: &configuration::Configura 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 }; + 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 async fn search_users(configuration: &configuration::Configuration, search: Option<&str>, developer_type: Option<&str>, n: Option, offset: Option) -> Result, Error> { +pub async fn search_users( + configuration: &configuration::Configuration, + search: Option<&str>, + developer_type: Option<&str>, + n: Option, + offset: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = search { - local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("search", &local_var_str.to_string())]); } if let Some(ref local_var_str) = developer_type { - local_var_req_builder = local_var_req_builder.query(&[("developerType", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("developerType", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } 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()); + 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()?; @@ -245,23 +322,38 @@ pub async fn search_users(configuration: &configuration::Configuration, search: 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 }; + 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)) } } /// Update a users information such as the email and birthday. -pub async fn update_user(configuration: &configuration::Configuration, user_id: &str, update_user_request: Option) -> Result> { +pub async fn update_user( + configuration: &configuration::Configuration, + user_id: &str, + update_user_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/users/{userId}", local_var_configuration.base_path, userId=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/users/{userId}", + local_var_configuration.base_path, + userId = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_user_request); @@ -274,9 +366,13 @@ pub async fn update_user(configuration: &configuration::Configuration, user_id: 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 }; + 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)) } } - diff --git a/src/apis/worlds_api.rs b/src/apis/worlds_api.rs index 993304e..aae5cb0 100644 --- a/src/apis/worlds_api.rs +++ b/src/apis/worlds_api.rs @@ -6,12 +6,10 @@ * Generated by: https://openapi-generator.tech */ - +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - /// struct for typed errors of method [`create_world`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -125,18 +123,22 @@ pub enum UpdateWorldError { UnknownValue(serde_json::Value), } - /// Create a new world. This endpoint requires `assetUrl` to be a valid File object with `.vrcw` file extension, and `imageUrl` to be a valid File object with an image file extension. -pub async fn create_world(configuration: &configuration::Configuration, create_world_request: Option) -> Result> { +pub async fn create_world( + configuration: &configuration::Configuration, + create_world_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/worlds", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&create_world_request); @@ -149,23 +151,37 @@ pub async fn create_world(configuration: &configuration::Configuration, create_w 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 }; + 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)) } } /// Delete a world. Notice a world is never fully \"deleted\", only its ReleaseStatus is set to \"hidden\" and the linked Files are deleted. The WorldID is permanently reserved. -pub async fn delete_world(configuration: &configuration::Configuration, world_id: &str) -> Result<(), Error> { +pub async fn delete_world( + configuration: &configuration::Configuration, + world_id: &str, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/worlds/{worldId}", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/worlds/{worldId}", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -177,59 +193,90 @@ pub async fn delete_world(configuration: &configuration::Configuration, world_id if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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 currently Active worlds by query filters. -pub async fn get_active_worlds(configuration: &configuration::Configuration, featured: Option, sort: Option, n: Option, order: Option, offset: Option, search: Option<&str>, tag: Option<&str>, notag: Option<&str>, release_status: Option, max_unity_version: Option<&str>, min_unity_version: Option<&str>, platform: Option<&str>) -> Result, Error> { +pub async fn get_active_worlds( + configuration: &configuration::Configuration, + featured: Option, + sort: Option, + n: Option, + order: Option, + offset: Option, + search: Option<&str>, + tag: Option<&str>, + notag: Option<&str>, + release_status: Option, + max_unity_version: Option<&str>, + min_unity_version: Option<&str>, + platform: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/worlds/active", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = featured { - local_var_req_builder = local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); } if let Some(ref local_var_str) = sort { - local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = order { - local_var_req_builder = local_var_req_builder.query(&[("order", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("order", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = search { - local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("search", &local_var_str.to_string())]); } if let Some(ref local_var_str) = tag { local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = notag { - local_var_req_builder = local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = release_status { - local_var_req_builder = local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = min_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = platform { - local_var_req_builder = local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); } 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()); + 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()?; @@ -241,62 +288,95 @@ pub async fn get_active_worlds(configuration: &configuration::Configuration, fea 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 }; + 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 favorited worlds by query filters. -pub async fn get_favorited_worlds(configuration: &configuration::Configuration, featured: Option, sort: Option, n: Option, order: Option, offset: Option, search: Option<&str>, tag: Option<&str>, notag: Option<&str>, release_status: Option, max_unity_version: Option<&str>, min_unity_version: Option<&str>, platform: Option<&str>, user_id: Option<&str>) -> Result, Error> { +pub async fn get_favorited_worlds( + configuration: &configuration::Configuration, + featured: Option, + sort: Option, + n: Option, + order: Option, + offset: Option, + search: Option<&str>, + tag: Option<&str>, + notag: Option<&str>, + release_status: Option, + max_unity_version: Option<&str>, + min_unity_version: Option<&str>, + platform: Option<&str>, + user_id: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/worlds/favorites", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = featured { - local_var_req_builder = local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); } if let Some(ref local_var_str) = sort { - local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = order { - local_var_req_builder = local_var_req_builder.query(&[("order", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("order", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = search { - local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("search", &local_var_str.to_string())]); } if let Some(ref local_var_str) = tag { local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = notag { - local_var_req_builder = local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = release_status { - local_var_req_builder = local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = min_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = platform { - local_var_req_builder = local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); } if let Some(ref local_var_str) = user_id { - local_var_req_builder = local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); } 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()); + 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()?; @@ -308,62 +388,95 @@ pub async fn get_favorited_worlds(configuration: &configuration::Configuration, 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 }; + 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 recently visited worlds by query filters. -pub async fn get_recent_worlds(configuration: &configuration::Configuration, featured: Option, sort: Option, n: Option, order: Option, offset: Option, search: Option<&str>, tag: Option<&str>, notag: Option<&str>, release_status: Option, max_unity_version: Option<&str>, min_unity_version: Option<&str>, platform: Option<&str>, user_id: Option<&str>) -> Result, Error> { +pub async fn get_recent_worlds( + configuration: &configuration::Configuration, + featured: Option, + sort: Option, + n: Option, + order: Option, + offset: Option, + search: Option<&str>, + tag: Option<&str>, + notag: Option<&str>, + release_status: Option, + max_unity_version: Option<&str>, + min_unity_version: Option<&str>, + platform: Option<&str>, + user_id: Option<&str>, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/worlds/recent", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = featured { - local_var_req_builder = local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); } if let Some(ref local_var_str) = sort { - local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = order { - local_var_req_builder = local_var_req_builder.query(&[("order", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("order", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = search { - local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("search", &local_var_str.to_string())]); } if let Some(ref local_var_str) = tag { local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = notag { - local_var_req_builder = local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = release_status { - local_var_req_builder = local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = min_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = platform { - local_var_req_builder = local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); } if let Some(ref local_var_str) = user_id { - local_var_req_builder = local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); } 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()); + 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()?; @@ -375,23 +488,37 @@ pub async fn get_recent_worlds(configuration: &configuration::Configuration, fea 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 }; + 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)) } } /// Get information about a specific World. Works unauthenticated but when so will always return `0` for certain fields. -pub async fn get_world(configuration: &configuration::Configuration, world_id: &str) -> Result> { +pub async fn get_world( + configuration: &configuration::Configuration, + world_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/worlds/{worldId}", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/worlds/{worldId}", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_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()); + 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()?; @@ -404,22 +531,37 @@ pub async fn get_world(configuration: &configuration::Configuration, world_id: & 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 }; + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; Err(Error::ResponseError(local_var_error)) } } /// Returns a worlds instance. -pub async fn get_world_instance(configuration: &configuration::Configuration, world_id: &str, instance_id: &str) -> Result> { +pub async fn get_world_instance( + configuration: &configuration::Configuration, + world_id: &str, + instance_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/worlds/{worldId}/{instanceId}", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id), instanceId=crate::apis::urlencode(instance_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/worlds/{worldId}/{instanceId}", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id), + instanceId = crate::apis::urlencode(instance_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()); + 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()?; @@ -431,23 +573,37 @@ pub async fn get_world_instance(configuration: &configuration::Configuration, wo 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 }; + 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)) } } /// Return a worlds custom metadata. This is currently believed to be unused. Metadata can be set with `updateWorld` and can be any arbitrary object. -pub async fn get_world_metadata(configuration: &configuration::Configuration, world_id: &str) -> Result> { +pub async fn get_world_metadata( + configuration: &configuration::Configuration, + world_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/worlds/{worldId}/metadata", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/worlds/{worldId}/metadata", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_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()); + 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()?; @@ -459,23 +615,37 @@ pub async fn get_world_metadata(configuration: &configuration::Configuration, wo 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 }; + 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)) } } /// Returns a worlds publish status. -pub async fn get_world_publish_status(configuration: &configuration::Configuration, world_id: &str) -> Result> { +pub async fn get_world_publish_status( + configuration: &configuration::Configuration, + world_id: &str, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/worlds/{worldId}/publish", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/worlds/{worldId}/publish", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_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()); + 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()?; @@ -487,23 +657,37 @@ pub async fn get_world_publish_status(configuration: &configuration::Configurati 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 }; + 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)) } } /// Publish a world. You can only publish one world per week. -pub async fn publish_world(configuration: &configuration::Configuration, world_id: &str) -> Result<(), Error> { +pub async fn publish_world( + configuration: &configuration::Configuration, + world_id: &str, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/worlds/{worldId}/publish", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/worlds/{worldId}/publish", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + 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()?; @@ -515,68 +699,105 @@ pub async fn publish_world(configuration: &configuration::Configuration, world_i if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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 worlds by query filters. -pub async fn search_worlds(configuration: &configuration::Configuration, featured: Option, sort: Option, user: Option<&str>, user_id: Option<&str>, n: Option, order: Option, offset: Option, search: Option<&str>, tag: Option<&str>, notag: Option<&str>, release_status: Option, max_unity_version: Option<&str>, min_unity_version: Option<&str>, platform: Option<&str>, fuzzy: Option) -> Result, Error> { +pub async fn search_worlds( + configuration: &configuration::Configuration, + featured: Option, + sort: Option, + user: Option<&str>, + user_id: Option<&str>, + n: Option, + order: Option, + offset: Option, + search: Option<&str>, + tag: Option<&str>, + notag: Option<&str>, + release_status: Option, + max_unity_version: Option<&str>, + min_unity_version: Option<&str>, + platform: Option<&str>, + fuzzy: Option, +) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/worlds", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + 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_str) = featured { - local_var_req_builder = local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("featured", &local_var_str.to_string())]); } if let Some(ref local_var_str) = sort { - local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); } if let Some(ref local_var_str) = user { - local_var_req_builder = local_var_req_builder.query(&[("user", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("user", &local_var_str.to_string())]); } if let Some(ref local_var_str) = user_id { - local_var_req_builder = local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("userId", &local_var_str.to_string())]); } if let Some(ref local_var_str) = n { local_var_req_builder = local_var_req_builder.query(&[("n", &local_var_str.to_string())]); } if let Some(ref local_var_str) = order { - local_var_req_builder = local_var_req_builder.query(&[("order", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("order", &local_var_str.to_string())]); } if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); } if let Some(ref local_var_str) = search { - local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("search", &local_var_str.to_string())]); } if let Some(ref local_var_str) = tag { local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = notag { - local_var_req_builder = local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("notag", &local_var_str.to_string())]); } if let Some(ref local_var_str) = release_status { - local_var_req_builder = local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("releaseStatus", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("maxUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = min_unity_version { - local_var_req_builder = local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("minUnityVersion", &local_var_str.to_string())]); } if let Some(ref local_var_str) = platform { - local_var_req_builder = local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("platform", &local_var_str.to_string())]); } if let Some(ref local_var_str) = fuzzy { - local_var_req_builder = local_var_req_builder.query(&[("fuzzy", &local_var_str.to_string())]); + local_var_req_builder = + local_var_req_builder.query(&[("fuzzy", &local_var_str.to_string())]); } 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()); + 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()?; @@ -588,23 +809,37 @@ pub async fn search_worlds(configuration: &configuration::Configuration, feature 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 }; + 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)) } } /// Unpublish a world. -pub async fn unpublish_world(configuration: &configuration::Configuration, world_id: &str) -> Result<(), Error> { +pub async fn unpublish_world( + configuration: &configuration::Configuration, + world_id: &str, +) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/worlds/{worldId}/publish", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/worlds/{worldId}/publish", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, 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()); + 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()?; @@ -616,23 +851,38 @@ pub async fn unpublish_world(configuration: &configuration::Configuration, world if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } 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 }; + 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)) } } /// Update information about a specific World. -pub async fn update_world(configuration: &configuration::Configuration, world_id: &str, update_world_request: Option) -> Result> { +pub async fn update_world( + configuration: &configuration::Configuration, + world_id: &str, + update_world_request: Option, +) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/worlds/{worldId}", local_var_configuration.base_path, worldId=crate::apis::urlencode(world_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!( + "{}/worlds/{worldId}", + local_var_configuration.base_path, + worldId = crate::apis::urlencode(world_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, 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()); + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } local_var_req_builder = local_var_req_builder.json(&update_world_request); @@ -645,9 +895,13 @@ pub async fn update_world(configuration: &configuration::Configuration, world_id 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 }; + 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)) } } - diff --git a/src/lib.rs b/src/lib.rs index a1837b9..d91a0d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate reqwest; extern crate serde; extern crate serde_json; extern crate url; -extern crate reqwest; pub mod apis; pub mod models; diff --git a/src/models/account_deletion_log.rs b/src/models/account_deletion_log.rs index 5d61480..3dc9853 100644 --- a/src/models/account_deletion_log.rs +++ b/src/models/account_deletion_log.rs @@ -15,7 +15,12 @@ pub struct AccountDeletionLog { #[serde(rename = "message", skip_serializing_if = "Option::is_none")] pub message: Option, /// When the deletion is scheduled to happen, standard is 14 days after the request. - #[serde(rename = "deletionScheduled", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "deletionScheduled", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub deletion_scheduled: Option>, /// Date and time of the deletion request. #[serde(rename = "dateTime", skip_serializing_if = "Option::is_none")] @@ -31,4 +36,3 @@ impl AccountDeletionLog { } } } - diff --git a/src/models/add_favorite_request.rs b/src/models/add_favorite_request.rs index 4aaea88..76071ed 100644 --- a/src/models/add_favorite_request.rs +++ b/src/models/add_favorite_request.rs @@ -22,7 +22,11 @@ pub struct AddFavoriteRequest { } impl AddFavoriteRequest { - pub fn new(r#type: models::FavoriteType, favorite_id: String, tags: Vec) -> AddFavoriteRequest { + pub fn new( + r#type: models::FavoriteType, + favorite_id: String, + tags: Vec, + ) -> AddFavoriteRequest { AddFavoriteRequest { r#type, favorite_id, @@ -30,4 +34,3 @@ impl AddFavoriteRequest { } } } - diff --git a/src/models/add_group_gallery_image_request.rs b/src/models/add_group_gallery_image_request.rs index af105f2..0718b56 100644 --- a/src/models/add_group_gallery_image_request.rs +++ b/src/models/add_group_gallery_image_request.rs @@ -17,9 +17,6 @@ pub struct AddGroupGalleryImageRequest { impl AddGroupGalleryImageRequest { pub fn new(file_id: String) -> AddGroupGalleryImageRequest { - AddGroupGalleryImageRequest { - file_id, - } + AddGroupGalleryImageRequest { file_id } } } - diff --git a/src/models/api_config.rs b/src/models/api_config.rs index 6cfd2b5..c2ad247 100644 --- a/src/models/api_config.rs +++ b/src/models/api_config.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// ApiConfig : +/// ApiConfig : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiConfig { /// Unknown, probably voice optimization testing @@ -46,7 +46,10 @@ pub struct ApiConfig { #[serde(rename = "clientDisconnectTimeout")] pub client_disconnect_timeout: i32, /// Unknown - #[serde(rename = "clientNetDispatchThread", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "clientNetDispatchThread", + skip_serializing_if = "Option::is_none" + )] pub client_net_dispatch_thread: Option, /// Unknown #[serde(rename = "clientNetInThread", skip_serializing_if = "Option::is_none")] @@ -55,22 +58,37 @@ pub struct ApiConfig { #[serde(rename = "clientNetInThread2", skip_serializing_if = "Option::is_none")] pub client_net_in_thread2: Option, /// Unknown - #[serde(rename = "clientNetInThreadMobile", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "clientNetInThreadMobile", + skip_serializing_if = "Option::is_none" + )] pub client_net_in_thread_mobile: Option, /// Unknown - #[serde(rename = "clientNetInThreadMobile2", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "clientNetInThreadMobile2", + skip_serializing_if = "Option::is_none" + )] pub client_net_in_thread_mobile2: Option, /// Unknown #[serde(rename = "clientNetOutThread", skip_serializing_if = "Option::is_none")] pub client_net_out_thread: Option, /// Unknown - #[serde(rename = "clientNetOutThread2", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "clientNetOutThread2", + skip_serializing_if = "Option::is_none" + )] pub client_net_out_thread2: Option, /// Unknown - #[serde(rename = "clientNetOutThreadMobile", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "clientNetOutThreadMobile", + skip_serializing_if = "Option::is_none" + )] pub client_net_out_thread_mobile: Option, /// Unknown - #[serde(rename = "clientNetOutThreadMobile2", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "clientNetOutThreadMobile2", + skip_serializing_if = "Option::is_none" + )] pub client_net_out_thread_mobile2: Option, /// Unknown #[serde(rename = "clientQR", skip_serializing_if = "Option::is_none")] @@ -88,7 +106,10 @@ pub struct ApiConfig { #[serde(rename = "copyrightEmail")] pub copyright_email: String, /// Current version number of the Privacy Agreement - #[serde(rename = "currentPrivacyVersion", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "currentPrivacyVersion", + skip_serializing_if = "Option::is_none" + )] pub current_privacy_version: Option, /// Current version number of the Terms of Service #[serde(rename = "currentTOSVersion")] @@ -110,7 +131,10 @@ pub struct ApiConfig { #[serde(rename = "dis-countdown")] pub dis_countdown: String, /// Unknown - #[serde(rename = "disableAVProInProton", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "disableAVProInProton", + skip_serializing_if = "Option::is_none" + )] pub disable_av_pro_in_proton: Option, /// Toggles if copying avatars should be disabled #[serde(rename = "disableAvatarCopying")] @@ -263,7 +287,75 @@ pub struct ApiConfig { } impl ApiConfig { - pub fn new(voice_enable_degradation: bool, voice_enable_receiver_limiting: bool, address: String, announcements: Vec, app_name: String, available_language_codes: Vec, available_languages: Vec, build_version_tag: String, client_api_key: String, client_bps_ceiling: i32, client_disconnect_timeout: i32, client_reserved_player_bps: i32, client_sent_count_allowance: i32, contact_email: String, copyright_email: String, current_tos_version: i32, default_avatar: String, deployment_group: models::DeploymentGroup, dev_sdk_url: String, dev_sdk_version: String, dis_countdown: String, disable_avatar_copying: bool, disable_avatar_gating: bool, disable_community_labs: bool, disable_community_labs_promotion: bool, disable_email: bool, disable_event_stream: bool, disable_feedback_gating: bool, disable_frontend_builds: bool, disable_hello: bool, disable_oculus_subs: bool, disable_registration: bool, disable_steam_networking: bool, disable_two_factor_auth: bool, disable_udon: bool, disable_upgrade_account: bool, download_link_windows: String, download_urls: models::ApiConfigDownloadUrlList, dynamic_world_rows: Vec, events: models::ApiConfigEvents, home_world_id: String, homepage_redirect_target: String, hub_world_id: String, image_host_url_list: Vec, jobs_email: String, moderation_email: String, not_allowed_to_select_avatar_in_private_world_message: String, sdk_developer_faq_url: String, sdk_discord_url: String, sdk_not_allowed_to_publish_message: String, sdk_unity_version: String, server_name: String, string_host_url_list: Vec, support_email: String, time_out_world_id: String, tutorial_world_id: String, update_rate_ms_maximum: i32, update_rate_ms_minimum: i32, update_rate_ms_normal: i32, update_rate_ms_udon_manual: i32, upload_analysis_percent: i32, url_list: Vec, use_reliable_udp_for_voice: bool, vive_windows_url: String, white_listed_asset_urls: Vec, player_url_resolver_version: String, player_url_resolver_sha1: String) -> ApiConfig { + pub fn new( + voice_enable_degradation: bool, + voice_enable_receiver_limiting: bool, + address: String, + announcements: Vec, + app_name: String, + available_language_codes: Vec, + available_languages: Vec, + build_version_tag: String, + client_api_key: String, + client_bps_ceiling: i32, + client_disconnect_timeout: i32, + client_reserved_player_bps: i32, + client_sent_count_allowance: i32, + contact_email: String, + copyright_email: String, + current_tos_version: i32, + default_avatar: String, + deployment_group: models::DeploymentGroup, + dev_sdk_url: String, + dev_sdk_version: String, + dis_countdown: String, + disable_avatar_copying: bool, + disable_avatar_gating: bool, + disable_community_labs: bool, + disable_community_labs_promotion: bool, + disable_email: bool, + disable_event_stream: bool, + disable_feedback_gating: bool, + disable_frontend_builds: bool, + disable_hello: bool, + disable_oculus_subs: bool, + disable_registration: bool, + disable_steam_networking: bool, + disable_two_factor_auth: bool, + disable_udon: bool, + disable_upgrade_account: bool, + download_link_windows: String, + download_urls: models::ApiConfigDownloadUrlList, + dynamic_world_rows: Vec, + events: models::ApiConfigEvents, + home_world_id: String, + homepage_redirect_target: String, + hub_world_id: String, + image_host_url_list: Vec, + jobs_email: String, + moderation_email: String, + not_allowed_to_select_avatar_in_private_world_message: String, + sdk_developer_faq_url: String, + sdk_discord_url: String, + sdk_not_allowed_to_publish_message: String, + sdk_unity_version: String, + server_name: String, + string_host_url_list: Vec, + support_email: String, + time_out_world_id: String, + tutorial_world_id: String, + update_rate_ms_maximum: i32, + update_rate_ms_minimum: i32, + update_rate_ms_normal: i32, + update_rate_ms_udon_manual: i32, + upload_analysis_percent: i32, + url_list: Vec, + use_reliable_udp_for_voice: bool, + vive_windows_url: String, + white_listed_asset_urls: Vec, + player_url_resolver_version: String, + player_url_resolver_sha1: String, + ) -> ApiConfig { ApiConfig { voice_enable_degradation, voice_enable_receiver_limiting, @@ -352,4 +444,3 @@ impl ApiConfig { } } } - diff --git a/src/models/api_config_announcement.rs b/src/models/api_config_announcement.rs index 1151757..084aa04 100644 --- a/src/models/api_config_announcement.rs +++ b/src/models/api_config_announcement.rs @@ -23,10 +23,6 @@ pub struct ApiConfigAnnouncement { impl ApiConfigAnnouncement { /// Public Announcement pub fn new(name: String, text: String) -> ApiConfigAnnouncement { - ApiConfigAnnouncement { - name, - text, - } + ApiConfigAnnouncement { name, text } } } - diff --git a/src/models/api_config_download_url_list.rs b/src/models/api_config_download_url_list.rs index e0eb3e4..595e3ff 100644 --- a/src/models/api_config_download_url_list.rs +++ b/src/models/api_config_download_url_list.rs @@ -31,7 +31,13 @@ pub struct ApiConfigDownloadUrlList { impl ApiConfigDownloadUrlList { /// Download links for various development assets. - pub fn new(sdk2: String, sdk3_avatars: String, sdk3_worlds: String, vcc: String, bootstrap: String) -> ApiConfigDownloadUrlList { + pub fn new( + sdk2: String, + sdk3_avatars: String, + sdk3_worlds: String, + vcc: String, + bootstrap: String, + ) -> ApiConfigDownloadUrlList { ApiConfigDownloadUrlList { sdk2, sdk3_avatars, @@ -41,4 +47,3 @@ impl ApiConfigDownloadUrlList { } } } - diff --git a/src/models/api_config_events.rs b/src/models/api_config_events.rs index 3ac327e..439f6f6 100644 --- a/src/models/api_config_events.rs +++ b/src/models/api_config_events.rs @@ -44,7 +44,18 @@ pub struct ApiConfigEvents { } impl ApiConfigEvents { - pub fn new(distance_close: i32, distance_factor: i32, distance_far: i32, group_distance: i32, maximum_bunch_size: i32, not_visible_factor: i32, player_order_bucket_size: i32, player_order_factor: i32, slow_update_factor_threshold: i32, view_segment_length: i32) -> ApiConfigEvents { + pub fn new( + distance_close: i32, + distance_factor: i32, + distance_far: i32, + group_distance: i32, + maximum_bunch_size: i32, + not_visible_factor: i32, + player_order_bucket_size: i32, + player_order_factor: i32, + slow_update_factor_threshold: i32, + view_segment_length: i32, + ) -> ApiConfigEvents { ApiConfigEvents { distance_close, distance_factor, @@ -59,4 +70,3 @@ impl ApiConfigEvents { } } } - diff --git a/src/models/api_health.rs b/src/models/api_health.rs index cd89ca1..565f16e 100644 --- a/src/models/api_health.rs +++ b/src/models/api_health.rs @@ -28,4 +28,3 @@ impl ApiHealth { } } } - diff --git a/src/models/avatar.rs b/src/models/avatar.rs index 77f35e0..a6cb71f 100644 --- a/src/models/avatar.rs +++ b/src/models/avatar.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// Avatar : +/// Avatar : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Avatar { /// Not present from general serach `/avatars`, only on specific requests `/avatars/{avatarId}`. @@ -54,7 +54,24 @@ pub struct Avatar { } impl Avatar { - pub fn new(author_id: String, author_name: String, created_at: String, description: String, featured: bool, id: String, image_url: String, name: String, release_status: models::ReleaseStatus, tags: Vec, thumbnail_image_url: String, unity_package_url: String, unity_package_url_object: models::AvatarUnityPackageUrlObject, unity_packages: Vec, updated_at: String, version: i32) -> Avatar { + pub fn new( + author_id: String, + author_name: String, + created_at: String, + description: String, + featured: bool, + id: String, + image_url: String, + name: String, + release_status: models::ReleaseStatus, + tags: Vec, + thumbnail_image_url: String, + unity_package_url: String, + unity_package_url_object: models::AvatarUnityPackageUrlObject, + unity_packages: Vec, + updated_at: String, + version: i32, + ) -> Avatar { Avatar { asset_url: None, asset_url_object: None, @@ -77,4 +94,3 @@ impl Avatar { } } } - diff --git a/src/models/avatar_unity_package_url_object.rs b/src/models/avatar_unity_package_url_object.rs index 7c58797..83ec97d 100644 --- a/src/models/avatar_unity_package_url_object.rs +++ b/src/models/avatar_unity_package_url_object.rs @@ -24,4 +24,3 @@ impl AvatarUnityPackageUrlObject { } } } - diff --git a/src/models/badge.rs b/src/models/badge.rs index b04849b..0c30d0e 100644 --- a/src/models/badge.rs +++ b/src/models/badge.rs @@ -12,7 +12,12 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Badge { /// only present in CurrentUser badges - #[serde(rename = "assignedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "assignedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub assigned_at: Option>, #[serde(rename = "badgeDescription")] pub badge_description: String, @@ -24,17 +29,33 @@ pub struct Badge { #[serde(rename = "badgeName")] pub badge_name: String, /// only present in CurrentUser badges - #[serde(rename = "hidden", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "hidden", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub hidden: Option>, #[serde(rename = "showcased")] pub showcased: bool, /// only present in CurrentUser badges - #[serde(rename = "updatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "updatedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub updated_at: Option>, } impl Badge { - pub fn new(badge_description: String, badge_id: String, badge_image_url: String, badge_name: String, showcased: bool) -> Badge { + pub fn new( + badge_description: String, + badge_id: String, + badge_image_url: String, + badge_name: String, + showcased: bool, + ) -> Badge { Badge { assigned_at: None, badge_description, @@ -47,4 +68,3 @@ impl Badge { } } } - diff --git a/src/models/ban_group_member_request.rs b/src/models/ban_group_member_request.rs index 0cd9205..d2e8630 100644 --- a/src/models/ban_group_member_request.rs +++ b/src/models/ban_group_member_request.rs @@ -18,9 +18,6 @@ pub struct BanGroupMemberRequest { impl BanGroupMemberRequest { pub fn new(user_id: String) -> BanGroupMemberRequest { - BanGroupMemberRequest { - user_id, - } + BanGroupMemberRequest { user_id } } } - diff --git a/src/models/create_avatar_request.rs b/src/models/create_avatar_request.rs index 5e8c888..3b032ae 100644 --- a/src/models/create_avatar_request.rs +++ b/src/models/create_avatar_request.rs @@ -49,4 +49,3 @@ impl CreateAvatarRequest { } } } - diff --git a/src/models/create_file_request.rs b/src/models/create_file_request.rs index f9edc05..52e1861 100644 --- a/src/models/create_file_request.rs +++ b/src/models/create_file_request.rs @@ -31,4 +31,3 @@ impl CreateFileRequest { } } } - diff --git a/src/models/create_file_version_request.rs b/src/models/create_file_version_request.rs index 99ba461..40fe50f 100644 --- a/src/models/create_file_version_request.rs +++ b/src/models/create_file_version_request.rs @@ -31,4 +31,3 @@ impl CreateFileVersionRequest { } } } - diff --git a/src/models/create_group_announcement_request.rs b/src/models/create_group_announcement_request.rs index 22f941a..9d9bbfb 100644 --- a/src/models/create_group_announcement_request.rs +++ b/src/models/create_group_announcement_request.rs @@ -34,4 +34,3 @@ impl CreateGroupAnnouncementRequest { } } } - diff --git a/src/models/create_group_gallery_request.rs b/src/models/create_group_gallery_request.rs index cbe1249..edb1afd 100644 --- a/src/models/create_group_gallery_request.rs +++ b/src/models/create_group_gallery_request.rs @@ -20,13 +20,33 @@ pub struct CreateGroupGalleryRequest { /// Whether the gallery is members only. #[serde(rename = "membersOnly", skip_serializing_if = "Option::is_none")] pub members_only: Option, - #[serde(rename = "roleIdsToView", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToView", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_view: Option>>, - #[serde(rename = "roleIdsToSubmit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToSubmit", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_submit: Option>>, - #[serde(rename = "roleIdsToAutoApprove", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToAutoApprove", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_auto_approve: Option>>, - #[serde(rename = "roleIdsToManage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToManage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_manage: Option>>, } @@ -43,4 +63,3 @@ impl CreateGroupGalleryRequest { } } } - diff --git a/src/models/create_group_invite_request.rs b/src/models/create_group_invite_request.rs index 0c3487b..ba17230 100644 --- a/src/models/create_group_invite_request.rs +++ b/src/models/create_group_invite_request.rs @@ -14,7 +14,10 @@ pub struct CreateGroupInviteRequest { /// 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 = "userId")] pub user_id: String, - #[serde(rename = "confirmOverrideBlock", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "confirmOverrideBlock", + skip_serializing_if = "Option::is_none" + )] pub confirm_override_block: Option, } @@ -26,4 +29,3 @@ impl CreateGroupInviteRequest { } } } - diff --git a/src/models/create_group_post_request.rs b/src/models/create_group_post_request.rs index e35a3a9..f9a15f9 100644 --- a/src/models/create_group_post_request.rs +++ b/src/models/create_group_post_request.rs @@ -29,7 +29,12 @@ pub struct CreateGroupPostRequest { } impl CreateGroupPostRequest { - pub fn new(title: String, text: String, send_notification: bool, visibility: models::GroupPostVisibility) -> CreateGroupPostRequest { + pub fn new( + title: String, + text: String, + send_notification: bool, + visibility: models::GroupPostVisibility, + ) -> CreateGroupPostRequest { CreateGroupPostRequest { title, text, @@ -40,4 +45,3 @@ impl CreateGroupPostRequest { } } } - diff --git a/src/models/create_group_request.rs b/src/models/create_group_request.rs index 3348ecb..9dd2f4e 100644 --- a/src/models/create_group_request.rs +++ b/src/models/create_group_request.rs @@ -19,9 +19,19 @@ pub struct CreateGroupRequest { pub description: Option, #[serde(rename = "joinState", skip_serializing_if = "Option::is_none")] pub join_state: Option, - #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "iconId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub icon_id: Option>, - #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "bannerId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub banner_id: Option>, #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")] pub privacy: Option, @@ -30,7 +40,11 @@ pub struct CreateGroupRequest { } impl CreateGroupRequest { - pub fn new(name: String, short_code: String, role_template: models::GroupRoleTemplate) -> CreateGroupRequest { + pub fn new( + name: String, + short_code: String, + role_template: models::GroupRoleTemplate, + ) -> CreateGroupRequest { CreateGroupRequest { name, short_code, @@ -43,4 +57,3 @@ impl CreateGroupRequest { } } } - diff --git a/src/models/create_group_role_request.rs b/src/models/create_group_role_request.rs index 72a9f1d..4d4eeed 100644 --- a/src/models/create_group_role_request.rs +++ b/src/models/create_group_role_request.rs @@ -34,4 +34,3 @@ impl CreateGroupRoleRequest { } } } - diff --git a/src/models/create_instance_request.rs b/src/models/create_instance_request.rs index 5ded5ef..bc67c97 100644 --- a/src/models/create_instance_request.rs +++ b/src/models/create_instance_request.rs @@ -19,7 +19,12 @@ pub struct CreateInstanceRequest { #[serde(rename = "region")] pub region: models::InstanceRegion, /// 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")] + #[serde( + rename = "ownerId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub owner_id: Option>, /// Group roleIds that are allowed to join if the type is \"group\" and groupAccessType is \"member\" #[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")] @@ -42,7 +47,11 @@ pub struct CreateInstanceRequest { } impl CreateInstanceRequest { - pub fn new(world_id: String, r#type: models::InstanceType, region: models::InstanceRegion) -> CreateInstanceRequest { + pub fn new( + world_id: String, + r#type: models::InstanceType, + region: models::InstanceRegion, + ) -> CreateInstanceRequest { CreateInstanceRequest { world_id, r#type, @@ -58,4 +67,3 @@ impl CreateInstanceRequest { } } } - diff --git a/src/models/create_world_request.rs b/src/models/create_world_request.rs index 7f84409..557d60e 100644 --- a/src/models/create_world_request.rs +++ b/src/models/create_world_request.rs @@ -64,4 +64,3 @@ impl CreateWorldRequest { } } } - diff --git a/src/models/current_user.rs b/src/models/current_user.rs index c3b8668..2f362e6 100644 --- a/src/models/current_user.rs +++ b/src/models/current_user.rs @@ -13,11 +13,24 @@ use serde::{Deserialize, Serialize}; pub struct CurrentUser { #[serde(rename = "acceptedTOSVersion")] pub accepted_tos_version: i32, - #[serde(rename = "acceptedPrivacyVersion", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "acceptedPrivacyVersion", + skip_serializing_if = "Option::is_none" + )] pub accepted_privacy_version: Option, - #[serde(rename = "accountDeletionDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "accountDeletionDate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub account_deletion_date: Option>, - #[serde(rename = "accountDeletionLog", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "accountDeletionLog", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub account_deletion_log: Option>>, #[serde(rename = "activeFriends", skip_serializing_if = "Option::is_none")] pub active_friends: Option>, @@ -60,11 +73,24 @@ pub struct CurrentUser { pub friends: Vec, #[serde(rename = "hasBirthday")] pub has_birthday: bool, - #[serde(rename = "hideContentFilterSettings", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "hideContentFilterSettings", + skip_serializing_if = "Option::is_none" + )] pub hide_content_filter_settings: Option, - #[serde(rename = "userLanguage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "userLanguage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub user_language: Option>, - #[serde(rename = "userLanguageCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "userLanguageCode", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub user_language_code: Option>, #[serde(rename = "hasEmail")] pub has_email: bool, @@ -137,7 +163,12 @@ pub struct CurrentUser { pub tags: Vec, #[serde(rename = "twoFactorAuthEnabled")] pub two_factor_auth_enabled: bool, - #[serde(rename = "twoFactorAuthEnabledDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "twoFactorAuthEnabledDate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub two_factor_auth_enabled_date: Option>, #[serde(rename = "unsubscribe")] pub unsubscribe: bool, @@ -151,7 +182,52 @@ pub struct CurrentUser { } impl CurrentUser { - pub fn new(accepted_tos_version: i32, allow_avatar_copying: bool, bio: String, bio_links: Vec, current_avatar: String, current_avatar_asset_url: String, current_avatar_image_url: String, current_avatar_thumbnail_image_url: String, current_avatar_tags: Vec, date_joined: String, developer_type: models::DeveloperType, display_name: String, email_verified: bool, friend_group_names: Vec, friend_key: String, friends: Vec, has_birthday: bool, has_email: bool, has_logged_in_from_client: bool, has_pending_email: bool, home_location: String, id: String, is_friend: bool, last_login: String, last_mobile: Option, last_platform: String, obfuscated_email: String, obfuscated_pending_email: String, oculus_id: String, past_display_names: Vec, profile_pic_override: String, profile_pic_override_thumbnail: String, pronouns: String, state: models::UserState, status: models::UserStatus, status_description: String, status_first_time: bool, status_history: Vec, steam_details: serde_json::Value, steam_id: String, tags: Vec, two_factor_auth_enabled: bool, unsubscribe: bool, user_icon: String) -> CurrentUser { + pub fn new( + accepted_tos_version: i32, + allow_avatar_copying: bool, + bio: String, + bio_links: Vec, + current_avatar: String, + current_avatar_asset_url: String, + current_avatar_image_url: String, + current_avatar_thumbnail_image_url: String, + current_avatar_tags: Vec, + date_joined: String, + developer_type: models::DeveloperType, + display_name: String, + email_verified: bool, + friend_group_names: Vec, + friend_key: String, + friends: Vec, + has_birthday: bool, + has_email: bool, + has_logged_in_from_client: bool, + has_pending_email: bool, + home_location: String, + id: String, + is_friend: bool, + last_login: String, + last_mobile: Option, + last_platform: String, + obfuscated_email: String, + obfuscated_pending_email: String, + oculus_id: String, + past_display_names: Vec, + profile_pic_override: String, + profile_pic_override_thumbnail: String, + pronouns: String, + state: models::UserState, + status: models::UserStatus, + status_description: String, + status_first_time: bool, + status_history: Vec, + steam_details: serde_json::Value, + steam_id: String, + tags: Vec, + two_factor_auth_enabled: bool, + unsubscribe: bool, + user_icon: String, + ) -> CurrentUser { CurrentUser { accepted_tos_version, accepted_privacy_version: None, @@ -224,13 +300,13 @@ impl CurrentUser { #[derive(Serialize, Deserialize)] #[serde(untagged)] -pub enum EitherUserOrTwoFactor{ +pub enum EitherUserOrTwoFactor { CurrentUser(CurrentUser), RequiresTwoFactorAuth(RequiresTwoFactorAuth), } #[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)] -pub struct RequiresTwoFactorAuth{ +pub struct RequiresTwoFactorAuth { #[serde(rename = "requiresTwoFactorAuth")] - pub requires_two_factor_auth: Vec -} \ No newline at end of file + pub requires_two_factor_auth: Vec, +} diff --git a/src/models/current_user_presence.rs b/src/models/current_user_presence.rs index d177463..b45e42e 100644 --- a/src/models/current_user_presence.rs +++ b/src/models/current_user_presence.rs @@ -11,31 +11,76 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CurrentUserPresence { - #[serde(rename = "avatarThumbnail", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "avatarThumbnail", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub avatar_thumbnail: Option>, #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] pub display_name: Option, - #[serde(rename = "groups", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "groups", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub groups: 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 = "id", skip_serializing_if = "Option::is_none")] pub id: Option, - #[serde(rename = "instance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "instance", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub instance: Option>, /// either an InstanceType or an empty string - #[serde(rename = "instanceType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "instanceType", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub instance_type: Option>, - #[serde(rename = "isRejoining", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "isRejoining", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub is_rejoining: Option>, /// either a Platform or an empty string - #[serde(rename = "platform", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "platform", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub platform: Option>, - #[serde(rename = "profilePicOverride", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "profilePicOverride", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub profile_pic_override: Option>, /// either a UserStatus or empty string - #[serde(rename = "status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "status", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub status: Option>, - #[serde(rename = "travelingToInstance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "travelingToInstance", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub traveling_to_instance: Option>, /// WorldID be \"offline\" on User profiles if you are not friends with that user. #[serde(rename = "travelingToWorld", skip_serializing_if = "Option::is_none")] @@ -64,4 +109,3 @@ impl CurrentUserPresence { } } } - diff --git a/src/models/deployment_group.rs b/src/models/deployment_group.rs index 24d032a..1b60620 100644 --- a/src/models/deployment_group.rs +++ b/src/models/deployment_group.rs @@ -21,7 +21,6 @@ pub enum DeploymentGroup { Grape, #[serde(rename = "cherry")] Cherry, - } impl std::fmt::Display for DeploymentGroup { @@ -40,4 +39,3 @@ impl Default for DeploymentGroup { Self::Blue } } - diff --git a/src/models/developer_type.rs b/src/models/developer_type.rs index c0f9520..326ca0f 100644 --- a/src/models/developer_type.rs +++ b/src/models/developer_type.rs @@ -21,7 +21,6 @@ pub enum DeveloperType { Internal, #[serde(rename = "moderator")] Moderator, - } impl std::fmt::Display for DeveloperType { @@ -40,4 +39,3 @@ impl Default for DeveloperType { Self::None } } - diff --git a/src/models/dynamic_content_row.rs b/src/models/dynamic_content_row.rs index 7300c57..a38490c 100644 --- a/src/models/dynamic_content_row.rs +++ b/src/models/dynamic_content_row.rs @@ -33,7 +33,13 @@ pub struct DynamicContentRow { } impl DynamicContentRow { - pub fn new(name: String, platform: String, sort_heading: String, sort_order: String, sort_ownership: String) -> DynamicContentRow { + pub fn new( + name: String, + platform: String, + sort_heading: String, + sort_order: String, + sort_ownership: String, + ) -> DynamicContentRow { DynamicContentRow { index: None, name, @@ -46,4 +52,3 @@ impl DynamicContentRow { } } } - diff --git a/src/models/error.rs b/src/models/error.rs index 7612690..2393c77 100644 --- a/src/models/error.rs +++ b/src/models/error.rs @@ -17,9 +17,6 @@ pub struct Error { impl Error { pub fn new() -> Error { - Error { - error: None, - } + Error { error: None } } } - diff --git a/src/models/favorite.rs b/src/models/favorite.rs index 7f9584e..a28e2aa 100644 --- a/src/models/favorite.rs +++ b/src/models/favorite.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// Favorite : +/// Favorite : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Favorite { /// MUST be either AvatarID, UserID or WorldID. @@ -24,7 +24,12 @@ pub struct Favorite { } impl Favorite { - pub fn new(favorite_id: String, id: String, tags: Vec, r#type: models::FavoriteType) -> Favorite { + pub fn new( + favorite_id: String, + id: String, + tags: Vec, + r#type: models::FavoriteType, + ) -> Favorite { Favorite { favorite_id, id, @@ -33,4 +38,3 @@ impl Favorite { } } } - diff --git a/src/models/favorite_group.rs b/src/models/favorite_group.rs index 2afd531..728674f 100644 --- a/src/models/favorite_group.rs +++ b/src/models/favorite_group.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// FavoriteGroup : +/// FavoriteGroup : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FavoriteGroup { #[serde(rename = "displayName")] @@ -32,7 +32,16 @@ pub struct FavoriteGroup { } impl FavoriteGroup { - pub fn new(display_name: String, id: String, name: String, owner_display_name: String, owner_id: String, tags: Vec, r#type: models::FavoriteType, visibility: models::FavoriteGroupVisibility) -> FavoriteGroup { + pub fn new( + display_name: String, + id: String, + name: String, + owner_display_name: String, + owner_id: String, + tags: Vec, + r#type: models::FavoriteType, + visibility: models::FavoriteGroupVisibility, + ) -> FavoriteGroup { FavoriteGroup { display_name, id, @@ -45,4 +54,3 @@ impl FavoriteGroup { } } } - diff --git a/src/models/favorite_group_visibility.rs b/src/models/favorite_group_visibility.rs index 246c2fc..ccac213 100644 --- a/src/models/favorite_group_visibility.rs +++ b/src/models/favorite_group_visibility.rs @@ -17,7 +17,6 @@ pub enum FavoriteGroupVisibility { Friends, #[serde(rename = "public")] Public, - } impl std::fmt::Display for FavoriteGroupVisibility { @@ -35,4 +34,3 @@ impl Default for FavoriteGroupVisibility { Self::Private } } - diff --git a/src/models/favorite_type.rs b/src/models/favorite_type.rs index cd30edb..d0f5d63 100644 --- a/src/models/favorite_type.rs +++ b/src/models/favorite_type.rs @@ -17,7 +17,6 @@ pub enum FavoriteType { Friend, #[serde(rename = "avatar")] Avatar, - } impl std::fmt::Display for FavoriteType { @@ -35,4 +34,3 @@ impl Default for FavoriteType { Self::World } } - diff --git a/src/models/file.rs b/src/models/file.rs index 4f203f0..f34119f 100644 --- a/src/models/file.rs +++ b/src/models/file.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// File : +/// File : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct File { #[serde(rename = "extension")] @@ -30,7 +30,15 @@ pub struct File { } impl File { - pub fn new(extension: String, id: String, mime_type: models::MimeType, name: String, owner_id: String, tags: Vec, versions: Vec) -> File { + pub fn new( + extension: String, + id: String, + mime_type: models::MimeType, + name: String, + owner_id: String, + tags: Vec, + versions: Vec, + ) -> File { File { extension, id, @@ -42,4 +50,3 @@ impl File { } } } - diff --git a/src/models/file_data.rs b/src/models/file_data.rs index c15ee83..3a80655 100644 --- a/src/models/file_data.rs +++ b/src/models/file_data.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// FileData : +/// FileData : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FileData { #[serde(rename = "category")] @@ -29,7 +29,14 @@ pub struct FileData { } impl FileData { - pub fn new(category: Category, file_name: String, size_in_bytes: i32, status: models::FileStatus, upload_id: String, url: String) -> FileData { + pub fn new( + category: Category, + file_name: String, + size_in_bytes: i32, + status: models::FileStatus, + upload_id: String, + url: String, + ) -> FileData { FileData { category, file_name, @@ -56,4 +63,3 @@ impl Default for Category { Self::Multipart } } - diff --git a/src/models/file_status.rs b/src/models/file_status.rs index 9c296f3..d565753 100644 --- a/src/models/file_status.rs +++ b/src/models/file_status.rs @@ -19,7 +19,6 @@ pub enum FileStatus { None, #[serde(rename = "queued")] Queued, - } impl std::fmt::Display for FileStatus { @@ -38,4 +37,3 @@ impl Default for FileStatus { Self::Waiting } } - diff --git a/src/models/file_upload_url.rs b/src/models/file_upload_url.rs index 6d4dc43..5085bca 100644 --- a/src/models/file_upload_url.rs +++ b/src/models/file_upload_url.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// FileUploadUrl : +/// FileUploadUrl : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FileUploadUrl { #[serde(rename = "url")] @@ -18,9 +18,6 @@ pub struct FileUploadUrl { impl FileUploadUrl { pub fn new(url: String) -> FileUploadUrl { - FileUploadUrl { - url, - } + FileUploadUrl { url } } } - diff --git a/src/models/file_version.rs b/src/models/file_version.rs index befc3e0..ac175c1 100644 --- a/src/models/file_version.rs +++ b/src/models/file_version.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// FileVersion : +/// FileVersion : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FileVersion { #[serde(rename = "created_at")] @@ -43,4 +43,3 @@ impl FileVersion { } } } - diff --git a/src/models/file_version_upload_status.rs b/src/models/file_version_upload_status.rs index 41ed9d2..7448e50 100644 --- a/src/models/file_version_upload_status.rs +++ b/src/models/file_version_upload_status.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// FileVersionUploadStatus : +/// FileVersionUploadStatus : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FileVersionUploadStatus { #[serde(rename = "uploadId")] @@ -28,7 +28,14 @@ pub struct FileVersionUploadStatus { } impl FileVersionUploadStatus { - pub fn new(upload_id: String, file_name: String, next_part_number: f64, max_parts: f64, parts: Vec, etags: Vec) -> FileVersionUploadStatus { + pub fn new( + upload_id: String, + file_name: String, + next_part_number: f64, + max_parts: f64, + parts: Vec, + etags: Vec, + ) -> FileVersionUploadStatus { FileVersionUploadStatus { upload_id, file_name, @@ -39,4 +46,3 @@ impl FileVersionUploadStatus { } } } - diff --git a/src/models/finish_file_data_upload_request.rs b/src/models/finish_file_data_upload_request.rs index 5ec9d0e..2a753c2 100644 --- a/src/models/finish_file_data_upload_request.rs +++ b/src/models/finish_file_data_upload_request.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// FinishFileDataUploadRequest : +/// FinishFileDataUploadRequest : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FinishFileDataUploadRequest { /// Array of ETags uploaded. @@ -32,4 +32,3 @@ impl FinishFileDataUploadRequest { } } } - diff --git a/src/models/friend_status.rs b/src/models/friend_status.rs index 72c3720..0f8a6e4 100644 --- a/src/models/friend_status.rs +++ b/src/models/friend_status.rs @@ -28,4 +28,3 @@ impl FriendStatus { } } } - diff --git a/src/models/group.rs b/src/models/group.rs index 3b94caa..f5a1f77 100644 --- a/src/models/group.rs +++ b/src/models/group.rs @@ -21,28 +21,56 @@ pub struct Group { pub discriminator: Option, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] pub description: Option, - #[serde(rename = "iconUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "iconUrl", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub icon_url: Option>, - #[serde(rename = "bannerUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[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 = "rules", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "rules", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub rules: Option>, #[serde(rename = "links", skip_serializing_if = "Option::is_none")] pub links: Option>, #[serde(rename = "languages", skip_serializing_if = "Option::is_none")] pub languages: Option>, - #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "iconId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub icon_id: Option>, - #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "bannerId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub banner_id: Option>, #[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")] pub member_count: Option, - #[serde(rename = "memberCountSyncedAt", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "memberCountSyncedAt", + skip_serializing_if = "Option::is_none" + )] pub member_count_synced_at: Option, #[serde(rename = "isVerified", skip_serializing_if = "Option::is_none")] pub is_verified: Option, @@ -59,8 +87,13 @@ pub struct Group { pub created_at: Option, #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] pub updated_at: Option, - #[serde(rename = "lastPostCreatedAt", skip_serializing_if = "Option::is_none")] - pub last_post_created_at: Option, + #[serde( + rename = "lastPostCreatedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub last_post_created_at: Option>, #[serde(rename = "onlineMemberCount", skip_serializing_if = "Option::is_none")] pub online_member_count: Option, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] @@ -68,7 +101,12 @@ pub struct Group { #[serde(rename = "myMember", skip_serializing_if = "Option::is_none")] pub my_member: Option>, /// Only returned if ?includeRoles=true is specified. - #[serde(rename = "roles", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roles", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub roles: Option>>, } @@ -106,4 +144,3 @@ impl Group { } } } - diff --git a/src/models/group_access_type.rs b/src/models/group_access_type.rs index 084c70c..57d23c2 100644 --- a/src/models/group_access_type.rs +++ b/src/models/group_access_type.rs @@ -19,7 +19,6 @@ pub enum GroupAccessType { Plus, #[serde(rename = "members")] Members, - } impl std::fmt::Display for GroupAccessType { @@ -37,4 +36,3 @@ impl Default for GroupAccessType { Self::Public } } - diff --git a/src/models/group_announcement.rs b/src/models/group_announcement.rs index 89eddee..130b797 100644 --- a/src/models/group_announcement.rs +++ b/src/models/group_announcement.rs @@ -18,17 +18,42 @@ pub struct GroupAnnouncement { /// 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 = "authorId", skip_serializing_if = "Option::is_none")] pub author_id: Option, - #[serde(rename = "title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "title", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub title: Option>, - #[serde(rename = "text", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "text", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub text: Option>, #[serde(rename = "imageId", skip_serializing_if = "Option::is_none")] pub image_id: Option, - #[serde(rename = "imageUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "imageUrl", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub image_url: Option>, - #[serde(rename = "createdAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "createdAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub created_at: Option>, - #[serde(rename = "updatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "updatedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub updated_at: Option>, } @@ -47,4 +72,3 @@ impl GroupAnnouncement { } } } - diff --git a/src/models/group_audit_log_entry.rs b/src/models/group_audit_log_entry.rs index 861985f..fa1c3d6 100644 --- a/src/models/group_audit_log_entry.rs +++ b/src/models/group_audit_log_entry.rs @@ -51,4 +51,3 @@ impl GroupAuditLogEntry { } } } - diff --git a/src/models/group_gallery.rs b/src/models/group_gallery.rs index 3381c82..2515881 100644 --- a/src/models/group_gallery.rs +++ b/src/models/group_gallery.rs @@ -22,13 +22,33 @@ pub struct GroupGallery { /// Whether the gallery is members only. #[serde(rename = "membersOnly", skip_serializing_if = "Option::is_none")] pub members_only: Option, - #[serde(rename = "roleIdsToView", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToView", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_view: Option>>, - #[serde(rename = "roleIdsToSubmit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToSubmit", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_submit: Option>>, - #[serde(rename = "roleIdsToAutoApprove", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToAutoApprove", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_auto_approve: Option>>, - #[serde(rename = "roleIdsToManage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToManage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_manage: Option>>, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] pub created_at: Option, @@ -52,4 +72,3 @@ impl GroupGallery { } } } - diff --git a/src/models/group_gallery_image.rs b/src/models/group_gallery_image.rs index bde5170..c06ee0c 100644 --- a/src/models/group_gallery_image.rs +++ b/src/models/group_gallery_image.rs @@ -51,4 +51,3 @@ impl GroupGalleryImage { } } } - diff --git a/src/models/group_instance.rs b/src/models/group_instance.rs index a983594..27f62f6 100644 --- a/src/models/group_instance.rs +++ b/src/models/group_instance.rs @@ -23,7 +23,12 @@ pub struct GroupInstance { } impl GroupInstance { - pub fn new(instance_id: String, location: String, world: models::World, member_count: i32) -> GroupInstance { + pub fn new( + instance_id: String, + location: String, + world: models::World, + member_count: i32, + ) -> GroupInstance { GroupInstance { instance_id, location, @@ -32,4 +37,3 @@ impl GroupInstance { } } } - diff --git a/src/models/group_join_request_action.rs b/src/models/group_join_request_action.rs index fefdab2..755c9ae 100644 --- a/src/models/group_join_request_action.rs +++ b/src/models/group_join_request_action.rs @@ -15,7 +15,6 @@ pub enum GroupJoinRequestAction { Accept, #[serde(rename = "reject")] Reject, - } impl std::fmt::Display for GroupJoinRequestAction { @@ -32,4 +31,3 @@ impl Default for GroupJoinRequestAction { Self::Accept } } - diff --git a/src/models/group_join_state.rs b/src/models/group_join_state.rs index 435a6ea..55b7597 100644 --- a/src/models/group_join_state.rs +++ b/src/models/group_join_state.rs @@ -19,7 +19,6 @@ pub enum GroupJoinState { Request, #[serde(rename = "open")] Open, - } impl std::fmt::Display for GroupJoinState { @@ -38,4 +37,3 @@ impl Default for GroupJoinState { Self::Closed } } - diff --git a/src/models/group_limited_member.rs b/src/models/group_limited_member.rs index 828d933..c079e26 100644 --- a/src/models/group_limited_member.rs +++ b/src/models/group_limited_member.rs @@ -25,26 +25,57 @@ pub struct GroupLimitedMember { pub role_ids: Option>, #[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")] pub m_role_ids: Option>, - #[serde(rename = "joinedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[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, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, - #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "isSubscribedToAnnouncements", + skip_serializing_if = "Option::is_none" + )] pub is_subscribed_to_announcements: Option, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. - #[serde(rename = "createdAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "createdAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub created_at: Option>, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. - #[serde(rename = "bannedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "bannedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub banned_at: Option>, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. - #[serde(rename = "managerNotes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "managerNotes", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub manager_notes: Option>, - #[serde(rename = "lastPostReadAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "lastPostReadAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub last_post_read_at: Option>, - #[serde(rename = "hasJoinedFromPurchase", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "hasJoinedFromPurchase", + skip_serializing_if = "Option::is_none" + )] pub has_joined_from_purchase: Option, } @@ -69,4 +100,3 @@ impl GroupLimitedMember { } } } - diff --git a/src/models/group_member.rs b/src/models/group_member.rs index 6ef8489..9ce37b7 100644 --- a/src/models/group_member.rs +++ b/src/models/group_member.rs @@ -27,26 +27,57 @@ pub struct GroupMember { pub role_ids: Option>, #[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")] pub m_role_ids: Option>, - #[serde(rename = "joinedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[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, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, - #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "isSubscribedToAnnouncements", + skip_serializing_if = "Option::is_none" + )] pub is_subscribed_to_announcements: Option, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. - #[serde(rename = "createdAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "createdAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub created_at: Option>, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. - #[serde(rename = "bannedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "bannedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub banned_at: Option>, /// Only visible via the /groups/:groupId/members endpoint, **not** when fetching a specific user. - #[serde(rename = "managerNotes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "managerNotes", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub manager_notes: Option>, - #[serde(rename = "lastPostReadAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "lastPostReadAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub last_post_read_at: Option>, - #[serde(rename = "hasJoinedFromPurchase", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "hasJoinedFromPurchase", + skip_serializing_if = "Option::is_none" + )] pub has_joined_from_purchase: Option, } @@ -72,4 +103,3 @@ impl GroupMember { } } } - diff --git a/src/models/group_member_limited_user.rs b/src/models/group_member_limited_user.rs index 4606edd..56c08d7 100644 --- a/src/models/group_member_limited_user.rs +++ b/src/models/group_member_limited_user.rs @@ -17,13 +17,23 @@ pub struct GroupMemberLimitedUser { pub id: Option, #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] pub display_name: Option, - #[serde(rename = "thumbnailUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "thumbnailUrl", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub thumbnail_url: Option>, #[serde(rename = "iconUrl", skip_serializing_if = "Option::is_none")] pub icon_url: Option, #[serde(rename = "profilePicOverride", skip_serializing_if = "Option::is_none")] pub profile_pic_override: Option, - #[serde(rename = "currentAvatarThumbnailImageUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[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>, @@ -43,4 +53,3 @@ impl GroupMemberLimitedUser { } } } - diff --git a/src/models/group_member_status.rs b/src/models/group_member_status.rs index 6ccbf78..82a0afd 100644 --- a/src/models/group_member_status.rs +++ b/src/models/group_member_status.rs @@ -23,7 +23,6 @@ pub enum GroupMemberStatus { Banned, #[serde(rename = "userblocked")] Userblocked, - } impl std::fmt::Display for GroupMemberStatus { @@ -44,4 +43,3 @@ impl Default for GroupMemberStatus { Self::Inactive } } - diff --git a/src/models/group_my_member.rs b/src/models/group_my_member.rs index 33ae2af..5b550e6 100644 --- a/src/models/group_my_member.rs +++ b/src/models/group_my_member.rs @@ -20,8 +20,13 @@ pub struct GroupMyMember { pub user_id: Option, #[serde(rename = "roleIds", skip_serializing_if = "Option::is_none")] pub role_ids: Option>, - #[serde(rename = "acceptedByDisplayName", skip_serializing_if = "Option::is_none")] - pub accepted_by_display_name: Option, + #[serde( + rename = "acceptedByDisplayName", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub accepted_by_display_name: 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 = "acceptedById", skip_serializing_if = "Option::is_none")] pub accepted_by_id: Option, @@ -31,7 +36,10 @@ pub struct GroupMyMember { pub manager_notes: Option, #[serde(rename = "membershipStatus", skip_serializing_if = "Option::is_none")] pub membership_status: Option, - #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "isSubscribedToAnnouncements", + skip_serializing_if = "Option::is_none" + )] pub is_subscribed_to_announcements: Option, #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, @@ -39,14 +47,27 @@ pub struct GroupMyMember { pub is_representing: Option, #[serde(rename = "joinedAt", skip_serializing_if = "Option::is_none")] pub joined_at: Option, - #[serde(rename = "bannedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "bannedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub banned_at: Option>, #[serde(rename = "has2FA", skip_serializing_if = "Option::is_none")] pub has2_fa: Option, - #[serde(rename = "hasJoinedFromPurchase", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "hasJoinedFromPurchase", + skip_serializing_if = "Option::is_none" + )] pub has_joined_from_purchase: Option, - #[serde(rename = "lastPostReadAt", skip_serializing_if = "Option::is_none")] - pub last_post_read_at: Option, + #[serde( + rename = "lastPostReadAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub last_post_read_at: Option>, #[serde(rename = "mRoleIds", skip_serializing_if = "Option::is_none")] pub m_role_ids: Option>, #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] @@ -78,4 +99,3 @@ impl GroupMyMember { } } } - diff --git a/src/models/group_permission.rs b/src/models/group_permission.rs index 2c1f68c..b40008a 100644 --- a/src/models/group_permission.rs +++ b/src/models/group_permission.rs @@ -22,7 +22,10 @@ pub struct GroupPermission { #[serde(rename = "help", skip_serializing_if = "Option::is_none")] pub help: Option, /// Whether this permission is a \"management\" permission. - #[serde(rename = "isManagementPermission", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "isManagementPermission", + skip_serializing_if = "Option::is_none" + )] pub is_management_permission: Option, /// Whether the user is allowed to add this permission to a role. #[serde(rename = "allowedToAdd", skip_serializing_if = "Option::is_none")] @@ -41,4 +44,3 @@ impl GroupPermission { } } } - diff --git a/src/models/group_post.rs b/src/models/group_post.rs index 6b8c06f..5d94b42 100644 --- a/src/models/group_post.rs +++ b/src/models/group_post.rs @@ -31,7 +31,12 @@ pub struct GroupPost { pub text: Option, #[serde(rename = "imageId", skip_serializing_if = "Option::is_none")] pub image_id: Option, - #[serde(rename = "imageUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "imageUrl", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub image_url: Option>, #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] pub created_at: Option, @@ -57,4 +62,3 @@ impl GroupPost { } } } - diff --git a/src/models/group_post_visibility.rs b/src/models/group_post_visibility.rs index a41d4b7..f8238a8 100644 --- a/src/models/group_post_visibility.rs +++ b/src/models/group_post_visibility.rs @@ -15,7 +15,6 @@ pub enum GroupPostVisibility { Group, #[serde(rename = "public")] Public, - } impl std::fmt::Display for GroupPostVisibility { @@ -32,4 +31,3 @@ impl Default for GroupPostVisibility { Self::Group } } - diff --git a/src/models/group_privacy.rs b/src/models/group_privacy.rs index 7a4ccec..2ea289d 100644 --- a/src/models/group_privacy.rs +++ b/src/models/group_privacy.rs @@ -15,7 +15,6 @@ pub enum GroupPrivacy { Default, #[serde(rename = "private")] Private, - } impl std::fmt::Display for GroupPrivacy { @@ -32,4 +31,3 @@ impl Default for GroupPrivacy { Self::Default } } - diff --git a/src/models/group_role.rs b/src/models/group_role.rs index 7b92517..55c8cca 100644 --- a/src/models/group_role.rs +++ b/src/models/group_role.rs @@ -55,4 +55,3 @@ impl GroupRole { } } } - diff --git a/src/models/group_role_template.rs b/src/models/group_role_template.rs index 350764e..51279a0 100644 --- a/src/models/group_role_template.rs +++ b/src/models/group_role_template.rs @@ -19,7 +19,6 @@ pub enum GroupRoleTemplate { ManagedInvite, #[serde(rename = "managedRequest")] ManagedRequest, - } impl std::fmt::Display for GroupRoleTemplate { @@ -38,4 +37,3 @@ impl Default for GroupRoleTemplate { Self::Default } } - diff --git a/src/models/group_search_sort.rs b/src/models/group_search_sort.rs index 7804b91..fa8687f 100644 --- a/src/models/group_search_sort.rs +++ b/src/models/group_search_sort.rs @@ -15,7 +15,6 @@ pub enum GroupSearchSort { Asc, #[serde(rename = "joinedAt:desc")] Desc, - } impl std::fmt::Display for GroupSearchSort { @@ -32,4 +31,3 @@ impl Default for GroupSearchSort { Self::Asc } } - diff --git a/src/models/group_user_visibility.rs b/src/models/group_user_visibility.rs index 170b660..959ada3 100644 --- a/src/models/group_user_visibility.rs +++ b/src/models/group_user_visibility.rs @@ -17,7 +17,6 @@ pub enum GroupUserVisibility { Hidden, #[serde(rename = "friends")] Friends, - } impl std::fmt::Display for GroupUserVisibility { @@ -35,4 +34,3 @@ impl Default for GroupUserVisibility { Self::Visible } } - diff --git a/src/models/info_push.rs b/src/models/info_push.rs index 4820756..b83bbd4 100644 --- a/src/models/info_push.rs +++ b/src/models/info_push.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// InfoPush : +/// InfoPush : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct InfoPush { #[serde(rename = "id")] @@ -38,7 +38,17 @@ pub struct InfoPush { } impl InfoPush { - pub fn new(id: String, is_enabled: bool, release_status: models::ReleaseStatus, priority: i32, tags: Vec, data: models::InfoPushData, hash: String, created_at: String, updated_at: String) -> InfoPush { + pub fn new( + id: String, + is_enabled: bool, + release_status: models::ReleaseStatus, + priority: i32, + tags: Vec, + data: models::InfoPushData, + hash: String, + created_at: String, + updated_at: String, + ) -> InfoPush { InfoPush { id, is_enabled, @@ -54,4 +64,3 @@ impl InfoPush { } } } - diff --git a/src/models/info_push_data.rs b/src/models/info_push_data.rs index a1327b9..3add472 100644 --- a/src/models/info_push_data.rs +++ b/src/models/info_push_data.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// InfoPushData : +/// InfoPushData : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct InfoPushData { #[serde(rename = "contentList", skip_serializing_if = "Option::is_none")] @@ -44,4 +44,3 @@ impl InfoPushData { } } } - diff --git a/src/models/info_push_data_article.rs b/src/models/info_push_data_article.rs index 0970fe1..5c9e239 100644 --- a/src/models/info_push_data_article.rs +++ b/src/models/info_push_data_article.rs @@ -17,9 +17,6 @@ pub struct InfoPushDataArticle { impl InfoPushDataArticle { pub fn new() -> InfoPushDataArticle { - InfoPushDataArticle { - content: None, - } + InfoPushDataArticle { content: None } } } - diff --git a/src/models/info_push_data_article_content.rs b/src/models/info_push_data_article_content.rs index 1780437..c1da366 100644 --- a/src/models/info_push_data_article_content.rs +++ b/src/models/info_push_data_article_content.rs @@ -28,4 +28,3 @@ impl InfoPushDataArticleContent { } } } - diff --git a/src/models/info_push_data_clickable.rs b/src/models/info_push_data_clickable.rs index a736f90..28a1ca6 100644 --- a/src/models/info_push_data_clickable.rs +++ b/src/models/info_push_data_clickable.rs @@ -43,4 +43,3 @@ impl Default for Command { Self::OpenUrl } } - diff --git a/src/models/instance.rs b/src/models/instance.rs index 4e4e107..7aec088 100644 --- a/src/models/instance.rs +++ b/src/models/instance.rs @@ -36,7 +36,12 @@ pub struct Instance { #[serde(rename = "name")] pub name: 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")] + #[serde( + rename = "ownerId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub owner_id: Option>, #[serde(rename = "permanent")] pub permanent: bool, @@ -48,9 +53,14 @@ pub struct Instance { pub region: models::InstanceRegion, #[serde(rename = "secureName")] pub secure_name: String, - #[serde(rename = "shortName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "shortName", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub short_name: Option>, - /// The tags array on Instances usually contain the language tags of the people in the instance. + /// The tags array on Instances usually contain the language tags of the people in the instance. #[serde(rename = "tags")] pub tags: Vec, #[serde(rename = "type")] @@ -90,15 +100,50 @@ pub struct Instance { pub has_capacity_for_you: Option, #[serde(rename = "nonce", skip_serializing_if = "Option::is_none")] pub nonce: Option, - #[serde(rename = "closedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "closedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub closed_at: Option>, - #[serde(rename = "hardClose", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "hardClose", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub hard_close: 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: models::Region, platforms: models::InstancePlatforms, region: models::InstanceRegion, secure_name: String, tags: Vec, r#type: models::InstanceType, world_id: String, queue_enabled: bool, queue_size: i32, recommended_capacity: i32, strict: bool, user_count: i32, world: 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: models::Region, + platforms: models::InstancePlatforms, + region: models::InstanceRegion, + secure_name: String, + tags: Vec, + r#type: models::InstanceType, + world_id: String, + queue_enabled: bool, + queue_size: i32, + recommended_capacity: i32, + strict: bool, + user_count: i32, + world: models::World, + ) -> Instance { Instance { active, can_request_invite, @@ -139,4 +184,3 @@ impl Instance { } } } - diff --git a/src/models/instance_platforms.rs b/src/models/instance_platforms.rs index 4d65645..8198cc8 100644 --- a/src/models/instance_platforms.rs +++ b/src/models/instance_platforms.rs @@ -25,4 +25,3 @@ impl InstancePlatforms { } } } - diff --git a/src/models/instance_region.rs b/src/models/instance_region.rs index 8377128..4884c95 100644 --- a/src/models/instance_region.rs +++ b/src/models/instance_region.rs @@ -21,7 +21,6 @@ pub enum InstanceRegion { Eu, #[serde(rename = "jp")] Jp, - } impl std::fmt::Display for InstanceRegion { @@ -40,4 +39,3 @@ impl Default for InstanceRegion { Self::Us } } - diff --git a/src/models/instance_short_name_response.rs b/src/models/instance_short_name_response.rs index 78240ba..cd362cb 100644 --- a/src/models/instance_short_name_response.rs +++ b/src/models/instance_short_name_response.rs @@ -25,4 +25,3 @@ impl InstanceShortNameResponse { } } } - diff --git a/src/models/instance_type.rs b/src/models/instance_type.rs index 62e65e5..17c822f 100644 --- a/src/models/instance_type.rs +++ b/src/models/instance_type.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// InstanceType : +/// InstanceType : #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum InstanceType { #[serde(rename = "public")] @@ -22,7 +22,6 @@ pub enum InstanceType { Private, #[serde(rename = "group")] Group, - } impl std::fmt::Display for InstanceType { @@ -42,4 +41,3 @@ impl Default for InstanceType { Self::Public } } - diff --git a/src/models/invite_message.rs b/src/models/invite_message.rs index 3943e90..6b271d7 100644 --- a/src/models/invite_message.rs +++ b/src/models/invite_message.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// InviteMessage : +/// InviteMessage : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct InviteMessage { #[serde(rename = "canBeUpdated")] @@ -30,7 +30,15 @@ pub struct InviteMessage { } impl InviteMessage { - pub fn new(can_be_updated: bool, id: String, message: String, message_type: models::InviteMessageType, remaining_cooldown_minutes: i32, slot: i32, updated_at: String) -> InviteMessage { + pub fn new( + can_be_updated: bool, + id: String, + message: String, + message_type: models::InviteMessageType, + remaining_cooldown_minutes: i32, + slot: i32, + updated_at: String, + ) -> InviteMessage { InviteMessage { can_be_updated, id, @@ -42,4 +50,3 @@ impl InviteMessage { } } } - diff --git a/src/models/invite_message_type.rs b/src/models/invite_message_type.rs index 3495fb2..f34e2fb 100644 --- a/src/models/invite_message_type.rs +++ b/src/models/invite_message_type.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// InviteMessageType : +/// InviteMessageType : #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum InviteMessageType { #[serde(rename = "message")] @@ -20,7 +20,6 @@ pub enum InviteMessageType { Request, #[serde(rename = "requestResponse")] RequestResponse, - } impl std::fmt::Display for InviteMessageType { @@ -39,4 +38,3 @@ impl Default for InviteMessageType { Self::Message } } - diff --git a/src/models/invite_request.rs b/src/models/invite_request.rs index 99e045c..37a060c 100644 --- a/src/models/invite_request.rs +++ b/src/models/invite_request.rs @@ -26,4 +26,3 @@ impl InviteRequest { } } } - diff --git a/src/models/invite_response.rs b/src/models/invite_response.rs index ede5719..659c009 100644 --- a/src/models/invite_response.rs +++ b/src/models/invite_response.rs @@ -17,9 +17,6 @@ pub struct InviteResponse { impl InviteResponse { pub fn new(response_slot: i32) -> InviteResponse { - InviteResponse { - response_slot, - } + InviteResponse { response_slot } } } - diff --git a/src/models/license.rs b/src/models/license.rs index d4252b5..8ff200a 100644 --- a/src/models/license.rs +++ b/src/models/license.rs @@ -23,7 +23,12 @@ pub struct License { } impl License { - pub fn new(for_id: String, for_type: models::LicenseType, for_name: String, for_action: models::LicenseAction) -> License { + pub fn new( + for_id: String, + for_type: models::LicenseType, + for_name: String, + for_action: models::LicenseAction, + ) -> License { License { for_id, for_type, @@ -32,4 +37,3 @@ impl License { } } } - diff --git a/src/models/license_action.rs b/src/models/license_action.rs index 5f77da5..40c7119 100644 --- a/src/models/license_action.rs +++ b/src/models/license_action.rs @@ -15,7 +15,6 @@ pub enum LicenseAction { Wear, #[serde(rename = "have")] Have, - } impl std::fmt::Display for LicenseAction { @@ -32,4 +31,3 @@ impl Default for LicenseAction { Self::Wear } } - diff --git a/src/models/license_group.rs b/src/models/license_group.rs index 1759e7e..94bc999 100644 --- a/src/models/license_group.rs +++ b/src/models/license_group.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// LicenseGroup : +/// LicenseGroup : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct LicenseGroup { #[serde(rename = "id")] @@ -23,7 +23,12 @@ pub struct LicenseGroup { } impl LicenseGroup { - pub fn new(id: String, name: String, description: String, licenses: Vec) -> LicenseGroup { + pub fn new( + id: String, + name: String, + description: String, + licenses: Vec, + ) -> LicenseGroup { LicenseGroup { id, name, @@ -32,4 +37,3 @@ impl LicenseGroup { } } } - diff --git a/src/models/license_type.rs b/src/models/license_type.rs index 481a199..718cc2a 100644 --- a/src/models/license_type.rs +++ b/src/models/license_type.rs @@ -19,7 +19,6 @@ pub enum LicenseType { Permission, #[serde(rename = "product")] Product, - } impl std::fmt::Display for LicenseType { @@ -38,4 +37,3 @@ impl Default for LicenseType { Self::Avatar } } - diff --git a/src/models/limited_group.rs b/src/models/limited_group.rs index 59df18f..e2b6ed5 100644 --- a/src/models/limited_group.rs +++ b/src/models/limited_group.rs @@ -21,18 +21,43 @@ pub struct LimitedGroup { pub discriminator: Option, #[serde(rename = "description", skip_serializing_if = "Option::is_none")] pub description: Option, - #[serde(rename = "iconUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "iconUrl", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub icon_url: Option>, - #[serde(rename = "bannerUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "bannerUrl", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub banner_url: 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 = "rules", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "rules", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub rules: Option>, - #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "iconId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub icon_id: Option>, - #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "bannerId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub banner_id: Option>, #[serde(rename = "memberCount", skip_serializing_if = "Option::is_none")] pub member_count: Option, @@ -71,4 +96,3 @@ impl LimitedGroup { } } } - diff --git a/src/models/limited_unity_package.rs b/src/models/limited_unity_package.rs index d671080..8923bf7 100644 --- a/src/models/limited_unity_package.rs +++ b/src/models/limited_unity_package.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// LimitedUnityPackage : +/// LimitedUnityPackage : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitedUnityPackage { /// This can be `standalonewindows` or `android`, but can also pretty much be any random Unity verison such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. @@ -27,4 +27,3 @@ impl LimitedUnityPackage { } } } - diff --git a/src/models/limited_user.rs b/src/models/limited_user.rs index d444f30..24ccaa5 100644 --- a/src/models/limited_user.rs +++ b/src/models/limited_user.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// LimitedUser : +/// LimitedUser : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitedUser { #[serde(rename = "bio", skip_serializing_if = "Option::is_none")] @@ -17,10 +17,16 @@ pub struct LimitedUser { #[serde(rename = "bioLinks", skip_serializing_if = "Option::is_none")] pub bio_links: Option>, /// When profilePicOverride is not empty, use it instead. - #[serde(rename = "currentAvatarImageUrl", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "currentAvatarImageUrl", + skip_serializing_if = "Option::is_none" + )] pub current_avatar_image_url: Option, /// When profilePicOverride is not empty, use it instead. - #[serde(rename = "currentAvatarThumbnailImageUrl", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "currentAvatarThumbnailImageUrl", + 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>, @@ -61,7 +67,16 @@ pub struct LimitedUser { } impl LimitedUser { - 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) -> LimitedUser { + 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, + ) -> LimitedUser { LimitedUser { bio: None, bio_links: None, @@ -86,4 +101,3 @@ impl LimitedUser { } } } - diff --git a/src/models/limited_user_groups.rs b/src/models/limited_user_groups.rs index df37168..e1f9a90 100644 --- a/src/models/limited_user_groups.rs +++ b/src/models/limited_user_groups.rs @@ -21,17 +21,42 @@ pub struct LimitedUserGroups { 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")] + #[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")] + #[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")] + #[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")] + #[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, - #[serde(rename = "lastPostCreatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "lastPostCreatedAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub last_post_created_at: 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")] @@ -46,7 +71,12 @@ pub struct LimitedUserGroups { pub is_representing: Option, #[serde(rename = "mutualGroup", skip_serializing_if = "Option::is_none")] pub mutual_group: Option, - #[serde(rename = "lastPostReadAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "lastPostReadAt", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub last_post_read_at: Option>, } @@ -74,4 +104,3 @@ impl LimitedUserGroups { } } } - diff --git a/src/models/limited_world.rs b/src/models/limited_world.rs index de89bac..42ddf14 100644 --- a/src/models/limited_world.rs +++ b/src/models/limited_world.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// LimitedWorld : +/// LimitedWorld : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct LimitedWorld { /// 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. @@ -19,7 +19,10 @@ pub struct LimitedWorld { pub author_name: String, #[serde(rename = "capacity")] pub capacity: i32, - #[serde(rename = "recommendedCapacity", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "recommendedCapacity", + skip_serializing_if = "Option::is_none" + )] pub recommended_capacity: Option, #[serde(rename = "created_at")] pub created_at: String, @@ -44,7 +47,12 @@ pub struct LimitedWorld { pub organization: String, #[serde(rename = "popularity")] pub popularity: i32, - #[serde(rename = "previewYoutubeId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "previewYoutubeId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub preview_youtube_id: Option>, #[serde(rename = "publicationDate")] pub publication_date: String, @@ -63,7 +71,27 @@ pub struct LimitedWorld { } impl LimitedWorld { - pub fn new(author_id: String, author_name: String, capacity: i32, created_at: String, favorites: i32, heat: i32, id: String, image_url: String, labs_publication_date: String, name: String, occupants: i32, organization: String, popularity: i32, publication_date: String, release_status: models::ReleaseStatus, tags: Vec, thumbnail_image_url: String, unity_packages: Vec, updated_at: String) -> LimitedWorld { + pub fn new( + author_id: String, + author_name: String, + capacity: i32, + created_at: String, + favorites: i32, + heat: i32, + id: String, + image_url: String, + labs_publication_date: String, + name: String, + occupants: i32, + organization: String, + popularity: i32, + publication_date: String, + release_status: models::ReleaseStatus, + tags: Vec, + thumbnail_image_url: String, + unity_packages: Vec, + updated_at: String, + ) -> LimitedWorld { LimitedWorld { author_id, author_name, @@ -91,4 +119,3 @@ impl LimitedWorld { } } } - diff --git a/src/models/mime_type.rs b/src/models/mime_type.rs index 537cacf..5d40575 100644 --- a/src/models/mime_type.rs +++ b/src/models/mime_type.rs @@ -39,7 +39,6 @@ pub enum MimeType { ApplicationSlashXRsyncDelta, #[serde(rename = "application/octet-stream")] ApplicationSlashOctetStream, - } impl std::fmt::Display for MimeType { @@ -68,4 +67,3 @@ impl Default for MimeType { Self::ImageSlashJpeg } } - diff --git a/src/models/mod.rs b/src/models/mod.rs index 7a6c28e..1cb1d7f 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -45,7 +45,7 @@ pub use self::create_instance_request::CreateInstanceRequest; pub mod create_world_request; pub use self::create_world_request::CreateWorldRequest; pub mod current_user; -pub use self::current_user::{EitherUserOrTwoFactor, CurrentUser}; +pub use self::current_user::{CurrentUser, EitherUserOrTwoFactor}; pub mod current_user_presence; pub use self::current_user_presence::CurrentUserPresence; pub mod deployment_group; diff --git a/src/models/moderate_user_request.rs b/src/models/moderate_user_request.rs index 298a5fd..90afe6c 100644 --- a/src/models/moderate_user_request.rs +++ b/src/models/moderate_user_request.rs @@ -20,10 +20,6 @@ pub struct ModerateUserRequest { impl ModerateUserRequest { pub fn new(moderated: String, r#type: models::PlayerModerationType) -> ModerateUserRequest { - ModerateUserRequest { - moderated, - r#type, - } + ModerateUserRequest { moderated, r#type } } } - diff --git a/src/models/notification.rs b/src/models/notification.rs index 064d8b0..8246eee 100644 --- a/src/models/notification.rs +++ b/src/models/notification.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// Notification : +/// Notification : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Notification { #[serde(rename = "created_at")] @@ -38,7 +38,14 @@ pub struct Notification { } impl Notification { - pub fn new(created_at: String, details: String, id: String, message: String, sender_user_id: String, r#type: models::NotificationType) -> Notification { + pub fn new( + created_at: String, + details: String, + id: String, + message: String, + sender_user_id: String, + r#type: models::NotificationType, + ) -> Notification { Notification { created_at, details, @@ -52,4 +59,3 @@ impl Notification { } } } - diff --git a/src/models/notification_detail_invite.rs b/src/models/notification_detail_invite.rs index b4b6445..970ebb2 100644 --- a/src/models/notification_detail_invite.rs +++ b/src/models/notification_detail_invite.rs @@ -29,4 +29,3 @@ impl NotificationDetailInvite { } } } - diff --git a/src/models/notification_detail_invite_response.rs b/src/models/notification_detail_invite_response.rs index f231bcd..783aff9 100644 --- a/src/models/notification_detail_invite_response.rs +++ b/src/models/notification_detail_invite_response.rs @@ -18,11 +18,13 @@ pub struct NotificationDetailInviteResponse { } impl NotificationDetailInviteResponse { - pub fn new(in_response_to: String, response_message: String) -> NotificationDetailInviteResponse { + pub fn new( + in_response_to: String, + response_message: String, + ) -> NotificationDetailInviteResponse { NotificationDetailInviteResponse { in_response_to, response_message, } } } - diff --git a/src/models/notification_detail_request_invite.rs b/src/models/notification_detail_request_invite.rs index 0c36c63..9729470 100644 --- a/src/models/notification_detail_request_invite.rs +++ b/src/models/notification_detail_request_invite.rs @@ -27,4 +27,3 @@ impl NotificationDetailRequestInvite { } } } - diff --git a/src/models/notification_detail_request_invite_response.rs b/src/models/notification_detail_request_invite_response.rs index d8c90bb..36e99b6 100644 --- a/src/models/notification_detail_request_invite_response.rs +++ b/src/models/notification_detail_request_invite_response.rs @@ -26,4 +26,3 @@ impl NotificationDetailRequestInviteResponse { } } } - diff --git a/src/models/notification_detail_vote_to_kick.rs b/src/models/notification_detail_vote_to_kick.rs index 7352345..f417254 100644 --- a/src/models/notification_detail_vote_to_kick.rs +++ b/src/models/notification_detail_vote_to_kick.rs @@ -27,4 +27,3 @@ impl NotificationDetailVoteToKick { } } } - diff --git a/src/models/notification_type.rs b/src/models/notification_type.rs index e5decf8..af39a7e 100644 --- a/src/models/notification_type.rs +++ b/src/models/notification_type.rs @@ -25,7 +25,6 @@ pub enum NotificationType { RequestInviteResponse, #[serde(rename = "votetokick")] Votetokick, - } impl std::fmt::Display for NotificationType { @@ -47,4 +46,3 @@ impl Default for NotificationType { Self::FriendRequest } } - diff --git a/src/models/order_option.rs b/src/models/order_option.rs index e0edb6d..7ea5c5c 100644 --- a/src/models/order_option.rs +++ b/src/models/order_option.rs @@ -15,7 +15,6 @@ pub enum OrderOption { Ascending, #[serde(rename = "descending")] Descending, - } impl std::fmt::Display for OrderOption { @@ -32,4 +31,3 @@ impl Default for OrderOption { Self::Ascending } } - diff --git a/src/models/paginated_group_audit_log_entry_list.rs b/src/models/paginated_group_audit_log_entry_list.rs index c801d35..43bd343 100644 --- a/src/models/paginated_group_audit_log_entry_list.rs +++ b/src/models/paginated_group_audit_log_entry_list.rs @@ -30,4 +30,3 @@ impl PaginatedGroupAuditLogEntryList { } } } - diff --git a/src/models/past_display_name.rs b/src/models/past_display_name.rs index 62bdf29..f9e7340 100644 --- a/src/models/past_display_name.rs +++ b/src/models/past_display_name.rs @@ -25,4 +25,3 @@ impl PastDisplayName { } } } - diff --git a/src/models/permission.rs b/src/models/permission.rs index e37afd2..83e8855 100644 --- a/src/models/permission.rs +++ b/src/models/permission.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// Permission : +/// Permission : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Permission { #[serde(rename = "id")] @@ -26,7 +26,12 @@ pub struct Permission { } impl Permission { - pub fn new(id: String, owner_display_name: String, name: String, owner_id: String) -> Permission { + pub fn new( + id: String, + owner_display_name: String, + name: String, + owner_id: String, + ) -> Permission { Permission { id, owner_display_name, @@ -36,4 +41,3 @@ impl Permission { } } } - diff --git a/src/models/player_moderation.rs b/src/models/player_moderation.rs index 1b2082e..377cd26 100644 --- a/src/models/player_moderation.rs +++ b/src/models/player_moderation.rs @@ -30,7 +30,15 @@ pub struct PlayerModeration { } impl PlayerModeration { - pub fn new(created: String, id: String, source_display_name: String, source_user_id: String, target_display_name: String, target_user_id: String, r#type: models::PlayerModerationType) -> PlayerModeration { + pub fn new( + created: String, + id: String, + source_display_name: String, + source_user_id: String, + target_display_name: String, + target_user_id: String, + r#type: models::PlayerModerationType, + ) -> PlayerModeration { PlayerModeration { created, id, @@ -42,4 +50,3 @@ impl PlayerModeration { } } } - diff --git a/src/models/player_moderation_type.rs b/src/models/player_moderation_type.rs index d9cfcff..996d02e 100644 --- a/src/models/player_moderation_type.rs +++ b/src/models/player_moderation_type.rs @@ -23,7 +23,6 @@ pub enum PlayerModerationType { InteractOn, #[serde(rename = "interactOff")] InteractOff, - } impl std::fmt::Display for PlayerModerationType { @@ -44,4 +43,3 @@ impl Default for PlayerModerationType { Self::Mute } } - diff --git a/src/models/region.rs b/src/models/region.rs index 25c132f..f25ed76 100644 --- a/src/models/region.rs +++ b/src/models/region.rs @@ -25,7 +25,6 @@ pub enum Region { Jp, #[serde(rename = "unknown")] Unknown, - } impl std::fmt::Display for Region { @@ -46,4 +45,3 @@ impl Default for Region { Self::Us } } - diff --git a/src/models/release_status.rs b/src/models/release_status.rs index 661b25e..ab27aa6 100644 --- a/src/models/release_status.rs +++ b/src/models/release_status.rs @@ -19,7 +19,6 @@ pub enum ReleaseStatus { Hidden, #[serde(rename = "all")] All, - } impl std::fmt::Display for ReleaseStatus { @@ -38,4 +37,3 @@ impl Default for ReleaseStatus { Self::Public } } - diff --git a/src/models/represented_group.rs b/src/models/represented_group.rs index 01ccd45..0b345f8 100644 --- a/src/models/represented_group.rs +++ b/src/models/represented_group.rs @@ -19,13 +19,33 @@ pub struct RepresentedGroup { 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")] + #[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")] + #[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")] + #[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")] + #[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, @@ -62,4 +82,3 @@ impl RepresentedGroup { } } } - diff --git a/src/models/request_invite_request.rs b/src/models/request_invite_request.rs index c52de69..330a7f9 100644 --- a/src/models/request_invite_request.rs +++ b/src/models/request_invite_request.rs @@ -17,9 +17,6 @@ pub struct RequestInviteRequest { impl RequestInviteRequest { pub fn new() -> RequestInviteRequest { - RequestInviteRequest { - message_slot: None, - } + RequestInviteRequest { message_slot: None } } } - diff --git a/src/models/respond_group_join_request.rs b/src/models/respond_group_join_request.rs index bed29c9..094900c 100644 --- a/src/models/respond_group_join_request.rs +++ b/src/models/respond_group_join_request.rs @@ -26,4 +26,3 @@ impl RespondGroupJoinRequest { } } } - diff --git a/src/models/response.rs b/src/models/response.rs index 7d72400..7e8fdab 100644 --- a/src/models/response.rs +++ b/src/models/response.rs @@ -25,4 +25,3 @@ impl Response { } } } - diff --git a/src/models/sent_notification.rs b/src/models/sent_notification.rs index 07ba5ac..878bd3b 100644 --- a/src/models/sent_notification.rs +++ b/src/models/sent_notification.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// SentNotification : +/// SentNotification : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct SentNotification { #[serde(rename = "created_at")] @@ -34,7 +34,15 @@ pub struct SentNotification { } impl SentNotification { - pub fn new(created_at: String, details: serde_json::Value, id: String, message: String, receiver_user_id: String, sender_user_id: String, r#type: models::NotificationType) -> SentNotification { + pub fn new( + created_at: String, + details: serde_json::Value, + id: String, + message: String, + receiver_user_id: String, + sender_user_id: String, + r#type: models::NotificationType, + ) -> SentNotification { SentNotification { created_at, details, @@ -47,4 +55,3 @@ impl SentNotification { } } } - diff --git a/src/models/sort_option.rs b/src/models/sort_option.rs index 7d4f786..74d99e9 100644 --- a/src/models/sort_option.rs +++ b/src/models/sort_option.rs @@ -47,7 +47,6 @@ pub enum SortOption { Magic, #[serde(rename = "name")] Name, - } impl std::fmt::Display for SortOption { @@ -80,4 +79,3 @@ impl Default for SortOption { Self::Popularity } } - diff --git a/src/models/subscription.rs b/src/models/subscription.rs index aba7cc0..28684e2 100644 --- a/src/models/subscription.rs +++ b/src/models/subscription.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// Subscription : +/// Subscription : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Subscription { #[serde(rename = "id")] @@ -35,7 +35,14 @@ pub struct Subscription { } impl Subscription { - pub fn new(id: String, steam_item_id: String, amount: f64, description: String, period: models::SubscriptionPeriod, tier: f64) -> Subscription { + pub fn new( + id: String, + steam_item_id: String, + amount: f64, + description: String, + period: models::SubscriptionPeriod, + tier: f64, + ) -> Subscription { Subscription { id, steam_item_id, @@ -50,4 +57,3 @@ impl Subscription { } } } - diff --git a/src/models/subscription_period.rs b/src/models/subscription_period.rs index 386e44a..dd90a35 100644 --- a/src/models/subscription_period.rs +++ b/src/models/subscription_period.rs @@ -21,7 +21,6 @@ pub enum SubscriptionPeriod { Month, #[serde(rename = "year")] Year, - } impl std::fmt::Display for SubscriptionPeriod { @@ -41,4 +40,3 @@ impl Default for SubscriptionPeriod { Self::Hour } } - diff --git a/src/models/success.rs b/src/models/success.rs index 4e52df7..5abcf86 100644 --- a/src/models/success.rs +++ b/src/models/success.rs @@ -17,9 +17,6 @@ pub struct Success { impl Success { pub fn new() -> Success { - Success { - success: None, - } + Success { success: None } } } - diff --git a/src/models/transaction.rs b/src/models/transaction.rs index 8ea976e..6e98be1 100644 --- a/src/models/transaction.rs +++ b/src/models/transaction.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// Transaction : +/// Transaction : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Transaction { #[serde(rename = "id")] @@ -42,7 +42,15 @@ pub struct Transaction { } impl Transaction { - pub fn new(id: String, status: models::TransactionStatus, subscription: models::Subscription, sandbox: bool, created_at: String, updated_at: String, error: String) -> Transaction { + pub fn new( + id: String, + status: models::TransactionStatus, + subscription: models::Subscription, + sandbox: bool, + created_at: String, + updated_at: String, + error: String, + ) -> Transaction { Transaction { id, user_id: None, @@ -60,4 +68,3 @@ impl Transaction { } } } - diff --git a/src/models/transaction_agreement.rs b/src/models/transaction_agreement.rs index cfb4b46..c09cdd5 100644 --- a/src/models/transaction_agreement.rs +++ b/src/models/transaction_agreement.rs @@ -53,7 +53,26 @@ pub struct TransactionAgreement { impl TransactionAgreement { /// Represents a single Transaction, which is likely between VRChat and Steam. - pub fn new(agreement_id: String, item_id: f64, agreement: String, status: String, period: String, frequency: f64, billing_type: String, start_date: String, end_date: String, recurring_amt: f64, currency: String, time_created: String, next_payment: String, last_payment: String, last_amount: f64, last_amount_vat: f64, outstanding: f64, failed_attempts: f64) -> TransactionAgreement { + pub fn new( + agreement_id: String, + item_id: f64, + agreement: String, + status: String, + period: String, + frequency: f64, + billing_type: String, + start_date: String, + end_date: String, + recurring_amt: f64, + currency: String, + time_created: String, + next_payment: String, + last_payment: String, + last_amount: f64, + last_amount_vat: f64, + outstanding: f64, + failed_attempts: f64, + ) -> TransactionAgreement { TransactionAgreement { agreement_id, item_id, @@ -76,4 +95,3 @@ impl TransactionAgreement { } } } - diff --git a/src/models/transaction_status.rs b/src/models/transaction_status.rs index 18e6942..0dc71eb 100644 --- a/src/models/transaction_status.rs +++ b/src/models/transaction_status.rs @@ -19,7 +19,6 @@ pub enum TransactionStatus { Expired, #[serde(rename = "chargeback")] Chargeback, - } impl std::fmt::Display for TransactionStatus { @@ -38,4 +37,3 @@ impl Default for TransactionStatus { Self::Active } } - diff --git a/src/models/transaction_steam_info.rs b/src/models/transaction_steam_info.rs index 8ef17cd..988a430 100644 --- a/src/models/transaction_steam_info.rs +++ b/src/models/transaction_steam_info.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// TransactionSteamInfo : +/// TransactionSteamInfo : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TransactionSteamInfo { #[serde(rename = "walletInfo")] @@ -29,7 +29,13 @@ pub struct TransactionSteamInfo { } impl TransactionSteamInfo { - pub fn new(wallet_info: models::TransactionSteamWalletInfo, steam_id: String, order_id: String, steam_url: String, trans_id: String) -> TransactionSteamInfo { + pub fn new( + wallet_info: models::TransactionSteamWalletInfo, + steam_id: String, + order_id: String, + steam_url: String, + trans_id: String, + ) -> TransactionSteamInfo { TransactionSteamInfo { wallet_info: Box::new(wallet_info), steam_id, @@ -39,4 +45,3 @@ impl TransactionSteamInfo { } } } - diff --git a/src/models/transaction_steam_wallet_info.rs b/src/models/transaction_steam_wallet_info.rs index 5234d06..7025960 100644 --- a/src/models/transaction_steam_wallet_info.rs +++ b/src/models/transaction_steam_wallet_info.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// TransactionSteamWalletInfo : +/// TransactionSteamWalletInfo : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TransactionSteamWalletInfo { #[serde(rename = "state")] @@ -23,7 +23,12 @@ pub struct TransactionSteamWalletInfo { } impl TransactionSteamWalletInfo { - pub fn new(state: String, country: String, currency: String, status: String) -> TransactionSteamWalletInfo { + pub fn new( + state: String, + country: String, + currency: String, + status: String, + ) -> TransactionSteamWalletInfo { TransactionSteamWalletInfo { state, country, @@ -32,4 +37,3 @@ impl TransactionSteamWalletInfo { } } } - diff --git a/src/models/two_factor_auth_code.rs b/src/models/two_factor_auth_code.rs index 0c1aa3a..b44d0ac 100644 --- a/src/models/two_factor_auth_code.rs +++ b/src/models/two_factor_auth_code.rs @@ -17,9 +17,6 @@ pub struct TwoFactorAuthCode { impl TwoFactorAuthCode { pub fn new(code: String) -> TwoFactorAuthCode { - TwoFactorAuthCode { - code, - } + TwoFactorAuthCode { code } } } - diff --git a/src/models/two_factor_email_code.rs b/src/models/two_factor_email_code.rs index 6c35ef0..9c20b96 100644 --- a/src/models/two_factor_email_code.rs +++ b/src/models/two_factor_email_code.rs @@ -17,9 +17,6 @@ pub struct TwoFactorEmailCode { impl TwoFactorEmailCode { pub fn new(code: String) -> TwoFactorEmailCode { - TwoFactorEmailCode { - code, - } + TwoFactorEmailCode { code } } } - diff --git a/src/models/unity_package.rs b/src/models/unity_package.rs index 2d2f5d2..1dad163 100644 --- a/src/models/unity_package.rs +++ b/src/models/unity_package.rs @@ -9,12 +9,17 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// UnityPackage : +/// UnityPackage : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UnityPackage { #[serde(rename = "id")] pub id: String, - #[serde(rename = "assetUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "assetUrl", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub asset_url: Option>, #[serde(rename = "assetUrlObject", skip_serializing_if = "Option::is_none")] pub asset_url_object: Option, @@ -33,7 +38,12 @@ pub struct UnityPackage { pub unity_sort_number: Option, #[serde(rename = "unityVersion")] pub unity_version: String, - #[serde(rename = "impostorUrl", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "impostorUrl", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub impostor_url: Option>, #[serde(rename = "scanStatus", skip_serializing_if = "Option::is_none")] pub scan_status: Option, @@ -42,7 +52,12 @@ pub struct UnityPackage { } impl UnityPackage { - pub fn new(id: String, asset_version: i32, platform: String, unity_version: String) -> UnityPackage { + pub fn new( + id: String, + asset_version: i32, + platform: String, + unity_version: String, + ) -> UnityPackage { UnityPackage { id, asset_url: None, @@ -60,4 +75,3 @@ impl UnityPackage { } } } - diff --git a/src/models/update_avatar_request.rs b/src/models/update_avatar_request.rs index e0e6aac..4de3ba5 100644 --- a/src/models/update_avatar_request.rs +++ b/src/models/update_avatar_request.rs @@ -49,4 +49,3 @@ impl UpdateAvatarRequest { } } } - diff --git a/src/models/update_favorite_group_request.rs b/src/models/update_favorite_group_request.rs index 12ff3e0..c0cb54c 100644 --- a/src/models/update_favorite_group_request.rs +++ b/src/models/update_favorite_group_request.rs @@ -29,4 +29,3 @@ impl UpdateFavoriteGroupRequest { } } } - diff --git a/src/models/update_group_gallery_request.rs b/src/models/update_group_gallery_request.rs index 946b454..1f950c2 100644 --- a/src/models/update_group_gallery_request.rs +++ b/src/models/update_group_gallery_request.rs @@ -20,13 +20,33 @@ pub struct UpdateGroupGalleryRequest { /// Whether the gallery is members only. #[serde(rename = "membersOnly", skip_serializing_if = "Option::is_none")] pub members_only: Option, - #[serde(rename = "roleIdsToView", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToView", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_view: Option>>, - #[serde(rename = "roleIdsToSubmit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToSubmit", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_submit: Option>>, - #[serde(rename = "roleIdsToAutoApprove", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToAutoApprove", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_auto_approve: Option>>, - #[serde(rename = "roleIdsToManage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "roleIdsToManage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub role_ids_to_manage: Option>>, } @@ -43,4 +63,3 @@ impl UpdateGroupGalleryRequest { } } } - diff --git a/src/models/update_group_member_request.rs b/src/models/update_group_member_request.rs index ac65ede..1636970 100644 --- a/src/models/update_group_member_request.rs +++ b/src/models/update_group_member_request.rs @@ -13,7 +13,10 @@ use serde::{Deserialize, Serialize}; pub struct UpdateGroupMemberRequest { #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] pub visibility: Option, - #[serde(rename = "isSubscribedToAnnouncements", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "isSubscribedToAnnouncements", + skip_serializing_if = "Option::is_none" + )] pub is_subscribed_to_announcements: Option, #[serde(rename = "managerNotes", skip_serializing_if = "Option::is_none")] pub manager_notes: Option, @@ -28,4 +31,3 @@ impl UpdateGroupMemberRequest { } } } - diff --git a/src/models/update_group_request.rs b/src/models/update_group_request.rs index 7abe9a4..5faabe2 100644 --- a/src/models/update_group_request.rs +++ b/src/models/update_group_request.rs @@ -19,9 +19,19 @@ pub struct UpdateGroupRequest { pub description: Option, #[serde(rename = "joinState", skip_serializing_if = "Option::is_none")] pub join_state: Option, - #[serde(rename = "iconId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "iconId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub icon_id: Option>, - #[serde(rename = "bannerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "bannerId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub banner_id: Option>, /// 3 letter language code #[serde(rename = "languages", skip_serializing_if = "Option::is_none")] @@ -50,4 +60,3 @@ impl UpdateGroupRequest { } } } - diff --git a/src/models/update_group_role_request.rs b/src/models/update_group_role_request.rs index e6e0d3f..4d08eed 100644 --- a/src/models/update_group_role_request.rs +++ b/src/models/update_group_role_request.rs @@ -34,4 +34,3 @@ impl UpdateGroupRoleRequest { } } } - diff --git a/src/models/update_invite_message_request.rs b/src/models/update_invite_message_request.rs index 3fed8c6..6bc2d8a 100644 --- a/src/models/update_invite_message_request.rs +++ b/src/models/update_invite_message_request.rs @@ -17,9 +17,6 @@ pub struct UpdateInviteMessageRequest { impl UpdateInviteMessageRequest { pub fn new(message: String) -> UpdateInviteMessageRequest { - UpdateInviteMessageRequest { - message, - } + UpdateInviteMessageRequest { message } } } - diff --git a/src/models/update_user_request.rs b/src/models/update_user_request.rs index d0c3d8b..5f85e3c 100644 --- a/src/models/update_user_request.rs +++ b/src/models/update_user_request.rs @@ -53,4 +53,3 @@ impl UpdateUserRequest { } } } - diff --git a/src/models/update_world_request.rs b/src/models/update_world_request.rs index d20c350..5ed6683 100644 --- a/src/models/update_world_request.rs +++ b/src/models/update_world_request.rs @@ -60,4 +60,3 @@ impl UpdateWorldRequest { } } } - diff --git a/src/models/user.rs b/src/models/user.rs index d679ada..f37e465 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -36,7 +36,10 @@ pub struct User { pub display_name: String, #[serde(rename = "friendKey")] pub friend_key: String, - #[serde(rename = "friendRequestStatus", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "friendRequestStatus", + skip_serializing_if = "Option::is_none" + )] pub friend_request_status: 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 = "id")] @@ -77,9 +80,15 @@ pub struct User { pub status_description: String, #[serde(rename = "tags")] pub tags: Vec, - #[serde(rename = "travelingToInstance", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "travelingToInstance", + skip_serializing_if = "Option::is_none" + )] pub traveling_to_instance: Option, - #[serde(rename = "travelingToLocation", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "travelingToLocation", + skip_serializing_if = "Option::is_none" + )] pub traveling_to_location: Option, #[serde(rename = "travelingToWorld", skip_serializing_if = "Option::is_none")] pub traveling_to_world: Option, @@ -94,7 +103,32 @@ pub struct User { } impl User { - pub fn new(allow_avatar_copying: bool, bio: String, bio_links: Vec, current_avatar_image_url: String, current_avatar_thumbnail_image_url: String, current_avatar_tags: Vec, date_joined: String, developer_type: models::DeveloperType, display_name: String, friend_key: String, id: String, is_friend: bool, last_activity: String, last_login: String, last_platform: String, platform: String, profile_pic_override: String, profile_pic_override_thumbnail: String, pronouns: String, state: models::UserState, status: models::UserStatus, status_description: String, tags: Vec, user_icon: String) -> User { + pub fn new( + allow_avatar_copying: bool, + bio: String, + bio_links: Vec, + current_avatar_image_url: String, + current_avatar_thumbnail_image_url: String, + current_avatar_tags: Vec, + date_joined: String, + developer_type: models::DeveloperType, + display_name: String, + friend_key: String, + id: String, + is_friend: bool, + last_activity: String, + last_login: String, + last_platform: String, + platform: String, + profile_pic_override: String, + profile_pic_override_thumbnail: String, + pronouns: String, + state: models::UserState, + status: models::UserStatus, + status_description: String, + tags: Vec, + user_icon: String, + ) -> User { User { allow_avatar_copying, badges: None, @@ -133,4 +167,3 @@ impl User { } } } - diff --git a/src/models/user_exists.rs b/src/models/user_exists.rs index b1675a9..43fd471 100644 --- a/src/models/user_exists.rs +++ b/src/models/user_exists.rs @@ -15,14 +15,17 @@ pub struct UserExists { /// Status if a user exist with that username or userId. #[serde(rename = "userExists")] pub user_exists: bool, + /// Is the username valid? + #[serde(rename = "nameOk")] + pub name_ok: bool, } impl UserExists { /// Status object representing if a queried user by username or userId exists or not. This model is primarily used by the `/auth/exists` endpoint, which in turn is used during registration. Please see the documentation on that endpoint for more information on usage. - pub fn new(user_exists: bool) -> UserExists { + pub fn new(user_exists: bool, name_ok: bool) -> UserExists { UserExists { user_exists, + name_ok, } } } - diff --git a/src/models/user_state.rs b/src/models/user_state.rs index 334e774..a683c96 100644 --- a/src/models/user_state.rs +++ b/src/models/user_state.rs @@ -19,7 +19,6 @@ pub enum UserState { Active, #[serde(rename = "online")] Online, - } impl std::fmt::Display for UserState { @@ -37,4 +36,3 @@ impl Default for UserState { Self::Offline } } - diff --git a/src/models/user_status.rs b/src/models/user_status.rs index acdec06..966cdf8 100644 --- a/src/models/user_status.rs +++ b/src/models/user_status.rs @@ -23,7 +23,6 @@ pub enum UserStatus { Busy, #[serde(rename = "offline")] Offline, - } impl std::fmt::Display for UserStatus { @@ -43,4 +42,3 @@ impl Default for UserStatus { Self::Active } } - diff --git a/src/models/user_subscription.rs b/src/models/user_subscription.rs index 6c8fa42..65ca94b 100644 --- a/src/models/user_subscription.rs +++ b/src/models/user_subscription.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// UserSubscription : +/// UserSubscription : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UserSubscription { #[serde(rename = "id")] @@ -48,7 +48,22 @@ pub struct UserSubscription { } impl UserSubscription { - pub fn new(id: String, transaction_id: String, store: String, amount: f64, description: String, period: models::SubscriptionPeriod, tier: f64, active: bool, status: models::TransactionStatus, expires: String, created_at: String, updated_at: String, license_groups: Vec, is_gift: bool) -> UserSubscription { + pub fn new( + id: String, + transaction_id: String, + store: String, + amount: f64, + description: String, + period: models::SubscriptionPeriod, + tier: f64, + active: bool, + status: models::TransactionStatus, + expires: String, + created_at: String, + updated_at: String, + license_groups: Vec, + is_gift: bool, + ) -> UserSubscription { UserSubscription { id, transaction_id, @@ -69,4 +84,3 @@ impl UserSubscription { } } } - diff --git a/src/models/verify2_fa_email_code_result.rs b/src/models/verify2_fa_email_code_result.rs index da6e29e..1ac94ab 100644 --- a/src/models/verify2_fa_email_code_result.rs +++ b/src/models/verify2_fa_email_code_result.rs @@ -17,9 +17,6 @@ pub struct Verify2FaEmailCodeResult { impl Verify2FaEmailCodeResult { pub fn new(verified: bool) -> Verify2FaEmailCodeResult { - Verify2FaEmailCodeResult { - verified, - } + Verify2FaEmailCodeResult { verified } } } - diff --git a/src/models/verify2_fa_result.rs b/src/models/verify2_fa_result.rs index bc22e5c..511cbc1 100644 --- a/src/models/verify2_fa_result.rs +++ b/src/models/verify2_fa_result.rs @@ -17,9 +17,6 @@ pub struct Verify2FaResult { impl Verify2FaResult { pub fn new(verified: bool) -> Verify2FaResult { - Verify2FaResult { - verified, - } + Verify2FaResult { verified } } } - diff --git a/src/models/verify_auth_token_result.rs b/src/models/verify_auth_token_result.rs index 1e5f491..7e942b4 100644 --- a/src/models/verify_auth_token_result.rs +++ b/src/models/verify_auth_token_result.rs @@ -19,10 +19,6 @@ pub struct VerifyAuthTokenResult { impl VerifyAuthTokenResult { pub fn new(ok: bool, token: String) -> VerifyAuthTokenResult { - VerifyAuthTokenResult { - ok, - token, - } + VerifyAuthTokenResult { ok, token } } } - diff --git a/src/models/world.rs b/src/models/world.rs index 733e3b8..424e2ba 100644 --- a/src/models/world.rs +++ b/src/models/world.rs @@ -9,7 +9,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// World : +/// World : #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct World { /// 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. @@ -52,7 +52,12 @@ pub struct World { pub organization: String, #[serde(rename = "popularity")] pub popularity: i32, - #[serde(rename = "previewYoutubeId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + #[serde( + rename = "previewYoutubeId", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] pub preview_youtube_id: Option>, /// Will always be `0` when unauthenticated. #[serde(rename = "privateOccupants", skip_serializing_if = "Option::is_none")] @@ -82,7 +87,29 @@ 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, organization: String, popularity: i32, publication_date: String, release_status: 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: models::ReleaseStatus, + tags: Vec, + thumbnail_image_url: String, + updated_at: String, + version: i32, + visits: i32, + ) -> World { World { author_id, author_name, @@ -117,4 +144,3 @@ impl World { } } } - diff --git a/src/models/world_metadata.rs b/src/models/world_metadata.rs index c6acf86..88531a1 100644 --- a/src/models/world_metadata.rs +++ b/src/models/world_metadata.rs @@ -20,10 +20,6 @@ pub struct WorldMetadata { impl WorldMetadata { pub fn new(id: String, metadata: serde_json::Value) -> WorldMetadata { - WorldMetadata { - id, - metadata, - } + WorldMetadata { id, metadata } } } - diff --git a/src/models/world_publish_status.rs b/src/models/world_publish_status.rs index bf6a7d2..0947c1b 100644 --- a/src/models/world_publish_status.rs +++ b/src/models/world_publish_status.rs @@ -17,9 +17,6 @@ pub struct WorldPublishStatus { impl WorldPublishStatus { pub fn new(can_publish: bool) -> WorldPublishStatus { - WorldPublishStatus { - can_publish, - } + WorldPublishStatus { can_publish } } } -