/* * Gamenight * * Api specification for a Gamenight server * * The version of the OpenAPI document: 1.0 * Contact: dennis@brentj.es * Generated by: https://openapi-generator.tech */ use async_trait::async_trait; use reqwest; use std::sync::Arc; use serde::{Deserialize, Serialize, de::Error as _}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; use crate::apis::ContentType; #[async_trait] pub trait DefaultApi: Send + Sync { /// GET /authorized_location_user_ids /// /// async fn authorized_location_user_ids_get<'location_id>(&self, location_id: Option) -> Result, Error>; /// POST /disown /// /// async fn disown_post<'game_id>(&self, game_id: Option) -> Result<(), Error>; /// DELETE /game /// /// async fn game_delete<'game_id>(&self, game_id: Option) -> Result<(), Error>; /// GET /game /// /// async fn game_get<'game_id>(&self, game_id: Option) -> Result>; /// POST /game /// /// async fn game_post<'add_game_request_body>(&self, add_game_request_body: Option) -> Result>; /// GET /games /// /// async fn games_get<>(&self, ) -> Result, Error>; /// GET /gamenight /// /// async fn get_gamenight<'get_gamenight_request_body>(&self, get_gamenight_request_body: Option) -> Result>; /// GET /gamenights /// /// Retrieve the list of gamenights on this gamenight server. Requires authorization. async fn get_gamenights<>(&self, ) -> Result, Error>; /// GET /token /// /// Submit your credentials to get a JWT-token to use with the rest of the api. async fn get_token<'login>(&self, login: Option) -> Result>; /// POST /join /// /// async fn join_post<'gamenight_id>(&self, gamenight_id: Option) -> Result<(), Error>; /// POST /leave /// /// async fn leave_post<'gamenight_id>(&self, gamenight_id: Option) -> Result<(), Error>; /// POST /location_authorize /// /// async fn location_authorize_post<'authorize_location_request_body>(&self, authorize_location_request_body: Option) -> Result<(), Error>; /// GET /location /// /// async fn location_get<'location_id>(&self, location_id: Option) -> Result>; /// POST /location /// /// async fn location_post<'add_location_request_body>(&self, add_location_request_body: Option) -> Result>; /// GET /locations /// /// async fn locations_get<>(&self, ) -> Result, Error>; /// POST /own /// /// async fn own_post<'own_game_request_body>(&self, own_game_request_body: Option) -> Result<(), Error>; /// GET /owned_games /// /// async fn owned_games_get<'user_id>(&self, user_id: Option) -> Result, Error>; /// GET /participants /// /// Retrieve the participants of a single gamenight by id. async fn participants_get<'gamenight_id>(&self, gamenight_id: Option) -> Result>; /// POST /gamenight /// /// Add a gamenight by providing a name and a date, only available when providing an JWT token. async fn post_gamenight<'add_gamenight_request_body>(&self, add_gamenight_request_body: Option) -> Result<(), Error>; /// POST /user /// /// Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match. async fn post_register<'registration>(&self, registration: Option) -> Result<(), Error>; /// POST /token /// /// Refresh your JWT-token without logging in again. async fn post_token<>(&self, ) -> Result>; /// POST /rename_game /// /// async fn rename_game_post<'rename_game_request_body>(&self, rename_game_request_body: Option) -> Result<(), Error>; /// GET /user /// /// Get a user from primary id async fn user_get<'user_id>(&self, user_id: Option) -> Result>; /// GET /users /// /// async fn users_get<>(&self, ) -> Result, Error>; } pub struct DefaultApiClient { configuration: Arc } impl DefaultApiClient { pub fn new(configuration: Arc) -> Self { Self { configuration } } } #[async_trait] impl DefaultApi for DefaultApiClient { async fn authorized_location_user_ids_get<'location_id>(&self, location_id: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/authorized_location_user_ids", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&location_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UserId>`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::UserId>`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn disown_post<'game_id>(&self, game_id: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/disown", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&game_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } async fn game_delete<'game_id>(&self, game_id: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/game", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&game_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } async fn game_get<'game_id>(&self, game_id: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/game", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&game_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Game`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::Game`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn game_post<'add_game_request_body>(&self, add_game_request_body: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/game", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&add_game_request_body); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GameId`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GameId`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn games_get<>(&self, ) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/games", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Game>`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::Game>`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn get_gamenight<'get_gamenight_request_body>(&self, get_gamenight_request_body: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/gamenight", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&get_gamenight_request_body); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Gamenight`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::Gamenight`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Retrieve the list of gamenights on this gamenight server. Requires authorization. async fn get_gamenights<>(&self, ) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/gamenights", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Gamenight>`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::Gamenight>`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Submit your credentials to get a JWT-token to use with the rest of the api. async fn get_token<'login>(&self, login: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/token", 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.json(&login); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Token`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::Token`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn join_post<'gamenight_id>(&self, gamenight_id: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/join", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&gamenight_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } async fn leave_post<'gamenight_id>(&self, gamenight_id: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/leave", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&gamenight_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } async fn location_authorize_post<'authorize_location_request_body>(&self, authorize_location_request_body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/location_authorize", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&authorize_location_request_body); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } async fn location_get<'location_id>(&self, location_id: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/location", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&location_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Location`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::Location`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn location_post<'add_location_request_body>(&self, add_location_request_body: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/location", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&add_location_request_body); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LocationId`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::LocationId`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn locations_get<>(&self, ) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/locations", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Location>`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::Location>`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn own_post<'own_game_request_body>(&self, own_game_request_body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/own", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&own_game_request_body); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } async fn owned_games_get<'user_id>(&self, user_id: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/owned_games", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&user_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::OwnedGame>`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::OwnedGame>`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Retrieve the participants of a single gamenight by id. async fn participants_get<'gamenight_id>(&self, gamenight_id: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/participants", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&gamenight_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Participants`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::Participants`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Add a gamenight by providing a name and a date, only available when providing an JWT token. async fn post_gamenight<'add_gamenight_request_body>(&self, add_gamenight_request_body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/gamenight", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&add_gamenight_request_body); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } /// Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match. async fn post_register<'registration>(&self, registration: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/user", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(®istration); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } /// Refresh your JWT-token without logging in again. async fn post_token<>(&self, ) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/token", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Token`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::Token`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn rename_game_post<'rename_game_request_body>(&self, rename_game_request_body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/rename_game", 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&rename_game_request_body); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; 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 }; Err(Error::ResponseError(local_var_error)) } } /// Get a user from primary id async fn user_get<'user_id>(&self, user_id: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/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()); 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&user_id); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::User`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::User`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } async fn users_get<>(&self, ) -> Result, Error> { let local_var_configuration = &self.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()); 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()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content_type = local_var_resp .headers() .get("content-type") .and_then(|v| v.to_str().ok()) .unwrap_or("application/octet-stream"); let local_var_content_type = super::ContentType::from(local_var_content_type); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } } /// struct for typed errors of method [`DefaultApi::authorized_location_user_ids_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum AuthorizedLocationUserIdsGetError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::disown_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum DisownPostError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::game_delete`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GameDeleteError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::game_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GameGetError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::game_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GamePostError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::games_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GamesGetError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::get_gamenight`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetGamenightError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::get_gamenights`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetGamenightsError { Status400(models::Failure), Status401(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::get_token`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetTokenError { Status401(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::join_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum JoinPostError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::leave_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum LeavePostError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::location_authorize_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum LocationAuthorizePostError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::location_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum LocationGetError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::location_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum LocationPostError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::locations_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum LocationsGetError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::own_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum OwnPostError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::owned_games_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum OwnedGamesGetError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::participants_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum ParticipantsGetError { Status400(models::Failure), Status401(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::post_gamenight`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum PostGamenightError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::post_register`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum PostRegisterError { Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::post_token`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum PostTokenError { Status401(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::rename_game_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum RenameGamePostError { Status401(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::user_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum UserGetError { Status401(models::Failure), Status404(models::Failure), Status422(models::Failure), UnknownValue(serde_json::Value), } /// struct for typed errors of method [`DefaultApi::users_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum UsersGetError { Status400(models::Failure), Status401(models::Failure), UnknownValue(serde_json::Value), }