diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 573536a..c317da9 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -5,38 +5,45 @@ src/models/account.rs src/models/application.rs src/models/application_type.rs src/models/authorize_request.rs +src/models/client.rs +src/models/client_info.rs +src/models/client_type.rs src/models/code_challenge_method.rs +src/models/code_response.rs +src/models/create_user.rs src/models/crypto_view_model.rs src/models/game.rs src/models/game_server.rs src/models/game_server_cluster.rs +src/models/game_server_query.rs +src/models/game_server_status.rs src/models/grant_type.rs src/models/group.rs -src/models/group_game.rs +src/models/group_application.rs src/models/group_member.rs src/models/group_rank.rs src/models/hash_view_model.rs src/models/introspect_request.rs +src/models/introspect_response.rs src/models/ip_address.rs src/models/leaderboard_item.rs src/models/leaderboard_order.rs src/models/login_provider.rs -src/models/login_request.rs -src/models/login_response.rs src/models/mod.rs src/models/package.rs +src/models/package_release.rs +src/models/product.rs +src/models/product_price.rs +src/models/product_type.rs src/models/profile.rs src/models/profile_game.rs src/models/profile_group.rs -src/models/refresh_request.rs -src/models/register_request.rs src/models/response_type.rs src/models/revoke_request.rs -src/models/search_request.rs +src/models/search.rs src/models/search_type.rs src/models/server_metrics.rs -src/models/server_status.rs -src/models/subscription.rs +src/models/storage_file.rs src/models/token_hint_type.rs src/models/token_request.rs src/models/token_response.rs diff --git a/Cargo.toml b/Cargo.toml index c5361da..904ed8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tribufu" -version = "1.1.0" +version = "1.3.0" description = "REST API to access Tribufu services." repository = "https://github.com/tribufu/tribufu-rust" authors = ["Tribufu "] @@ -19,7 +19,6 @@ exclude = [ ".vscode/", "examples/", "scripts/", - "scripts/", ] [workspace] @@ -33,7 +32,7 @@ crate-type = ["rlib"] path = "src/lib.rs" [dependencies] -tribufu-constants = { version = "0.0.5", path = "./src/constants" } +tribufu-constants = { version = "1.3.0", path = "./src/constants" } async-trait = "^0.1" reqwest = { version = "^0.12", features = ["json", "multipart"] } serde = { version = "^1.0", features = ["derive"] } diff --git a/scripts/windows/publish.ps1 b/scripts/windows/publish.ps1 index 2a52c10..2422226 100644 --- a/scripts/windows/publish.ps1 +++ b/scripts/windows/publish.ps1 @@ -1,9 +1,11 @@ #!/usr/bin/env pwsh $crates = @( - "tribufu-types", "tribufu-constants", - "tribufu-api", + "tribufu-error", + "tribufu-json", + "tribufu-log", + "tribufu-platform", "tribufu" ) diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs index c1b63de..3e5160c 100644 --- a/src/apis/configuration.rs +++ b/src/apis/configuration.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -40,7 +40,7 @@ impl Default for Configuration { fn default() -> Self { Configuration { base_path: "http://localhost".to_owned(), - user_agent: Some("OpenAPI-Generator/1.1.0/rust".to_owned()), + user_agent: Some("OpenAPI-Generator/1.3.0/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, oauth_access_token: None, diff --git a/src/apis/tribufu_generated_api.rs b/src/apis/tribufu_generated_api.rs index 2322174..8f9c1c8 100644 --- a/src/apis/tribufu_generated_api.rs +++ b/src/apis/tribufu_generated_api.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -23,7 +23,7 @@ pub trait TribufuGeneratedApi: Send + Sync { /// POST /v1/oauth2/authorize /// /// 🔒 Required permissions: tribufu.identity.oauth2.authorize - async fn authorize<'authorize_request>(&self, authorize_request: Option) -> Result<(), Error>; + async fn authorize<'authorize_request>(&self, authorize_request: Option) -> Result>; /// PUT /v1/users/{id}/email /// @@ -35,25 +35,45 @@ pub trait TribufuGeneratedApi: Send + Sync { /// This endpoint is not available with an api key, only with a bearer token.

🔒 Required permissions: tribufu.identity.user.password.update async fn change_password<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; + /// PUT /v1/games/servers/{id}/claim + /// + /// This endpoint is not available with an api key, only with a bearer token.

🔒 Required permissions: tribufu.game.server.claim + async fn claim_game_server<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; + /// PUT /v1/servers/{id}/claim /// - /// This endpoint is not available with an api key, only with a bearer token.

🔒 Required permissions: tribufu.community.game.server.claim - async fn claim_game_server<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; + /// This endpoint is not available with an api key, only with a bearer token.

🔒 Required permissions: tribufu.game.server.claim + async fn claim_game_server_v1<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; /// POST /v1/utils/base64 /// /// 🔒 Required permissions: tribufu.utils.convert.base64 async fn convert_base64<'crypto_view_model>(&self, crypto_view_model: Option) -> Result>; - /// POST /v1/servers + /// POST /v1/oauth2/clients /// - /// 🔒 Required permissions: tribufu.community.game.server.create + /// 🔒 Required permissions: tribufu.identity.oauth2.client.create + async fn create_client<'body>(&self, body: Option) -> Result<(), Error>; + + /// POST /v1/games/servers + /// + /// 🔒 Required permissions: tribufu.game.server.create async fn create_game_server<'body>(&self, body: Option) -> Result<(), Error>; + /// POST /v1/games/servers/clusters + /// + /// 🔒 Required permissions: tribufu.game.server.cluster.create + async fn create_game_server_cluster<'body>(&self, body: Option) -> Result<(), Error>; + /// POST /v1/clusters /// - /// 🔒 Required permissions: tribufu.community.game.server.cluster.create - async fn create_game_server_cluster<'body>(&self, body: Option) -> Result<(), Error>; + /// 🔒 Required permissions: tribufu.game.server.cluster.create + async fn create_game_server_cluster_v1<'body>(&self, body: Option) -> Result<(), Error>; + + /// POST /v1/servers + /// + /// 🔒 Required permissions: tribufu.game.server.create + async fn create_game_server_v1<'body>(&self, body: Option) -> Result<(), Error>; /// POST /v1/groups /// @@ -65,21 +85,46 @@ pub trait TribufuGeneratedApi: Send + Sync { /// async fn create_token<'token_request>(&self, token_request: Option) -> Result>; - /// DELETE /v1/servers/{id} + /// POST /v1/users /// - /// 🔒 Required permissions: tribufu.community.game.server.delete + /// This endpoint is only available with client credentials. + async fn create_user<'create_user>(&self, create_user: Option) -> Result<(), Error>; + + /// DELETE /v1/oauth2/clients/{id} + /// + /// 🔒 Required permissions: tribufu.identity.oauth2.client.delete + async fn delete_client<'id>(&self, id: &'id str) -> Result<(), Error>; + + /// DELETE /v1/games/servers/{id} + /// + /// 🔒 Required permissions: tribufu.game.server.delete async fn delete_game_server<'id>(&self, id: &'id str) -> Result<(), Error>; + /// DELETE /v1/games/servers/clusters/{id} + /// + /// 🔒 Required permissions: tribufu.game.server.cluster.delete + async fn delete_game_server_cluster<'id>(&self, id: &'id str) -> Result<(), Error>; + /// DELETE /v1/clusters/{id} /// - /// 🔒 Required permissions: tribufu.community.game.server.cluster.delete - async fn delete_game_server_cluster<'id>(&self, id: &'id str) -> Result<(), Error>; + /// 🔒 Required permissions: tribufu.game.server.cluster.delete + async fn delete_game_server_cluster_v1<'id>(&self, id: &'id str) -> Result<(), Error>; + + /// DELETE /v1/servers/{id} + /// + /// 🔒 Required permissions: tribufu.game.server.delete + async fn delete_game_server_v1<'id>(&self, id: &'id str) -> Result<(), Error>; /// DELETE /v1/groups/{id} /// /// 🔒 Required permissions: tribufu.community.group.delete async fn delete_group<'id>(&self, id: &'id str) -> Result<(), Error>; + /// DELETE /v1/packages/{id} + /// + /// 🔒 Required permissions: tribufu.community.package.delete + async fn delete_package<'id>(&self, id: &'id str) -> Result<(), Error>; + /// GET /v1/utils/flake /// /// 🔒 Required permissions: tribufu.utils.generate.flake @@ -100,80 +145,135 @@ pub trait TribufuGeneratedApi: Send + Sync { /// 🔒 Required permissions: tribufu.utils.generate.uuid async fn generate_uuid<'version, 'amount>(&self, version: Option, amount: Option) -> Result, Error>; + /// GET /v1/oauth2/clients/{id} + /// + /// 🔒 Required permissions: tribufu.identity.oauth2.client.get + async fn get_client_by_id<'id>(&self, id: &'id str) -> Result>; + /// GET /v1/oauth2/clientinfo /// /// - async fn get_client_info<>(&self, ) -> Result<(), Error>; + async fn get_client_info<>(&self, ) -> Result>; + + /// GET /v1/oauth2/clients + /// + /// 🔒 Required permissions: tribufu.identity.oauth2.client.list + async fn get_clients<'organization_id, 'page, 'limit>(&self, organization_id: Option<&'organization_id str>, page: Option, limit: Option) -> Result, Error>; /// GET /v1/geoip /// - /// 🔒 Required permissions: tribufu.geoip.current + /// async fn get_current_ip_address<>(&self, ) -> Result, Error>; /// GET /v1/games/{id} /// - /// 🔒 Required permissions: tribufu.community.game.get + /// 🔒 Required permissions: tribufu.game.get async fn get_game_by_id<'id>(&self, id: &'id str) -> Result>; - /// GET /v1/games/{id}/clusters + /// GET /v1/games/servers/address/{address}:{port} /// - /// 🔒 Required permissions: tribufu.community.game.server.cluster.list - async fn get_game_clusters_by_game_id<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; - - /// GET /v1/games/{id}/items - /// - /// 🔒 Required permissions: tribufu.community.game.item.list - async fn get_game_items<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; + /// 🔒 Required permissions: tribufu.game.server.get.address + async fn get_game_server_by_address_and_query_port<'address, 'port>(&self, address: &'address str, port: i32) -> Result>; /// GET /v1/servers/address/{address}:{port} /// - /// 🔒 Required permissions: tribufu.community.game.server.get.address - async fn get_game_server_by_address_and_query_port<'address, 'port>(&self, address: &'address str, port: i32) -> Result>; + /// 🔒 Required permissions: tribufu.game.server.get.address + async fn get_game_server_by_address_and_query_port_v1<'address, 'port>(&self, address: &'address str, port: i32) -> Result>; + + /// GET /v1/games/servers/{id} + /// + /// 🔒 Required permissions: tribufu.game.server.get + async fn get_game_server_by_id<'id>(&self, id: &'id str) -> Result>; /// GET /v1/servers/{id} /// - /// 🔒 Required permissions: tribufu.community.game.server.get - async fn get_game_server_by_id<'id>(&self, id: &'id str) -> Result>; + /// 🔒 Required permissions: tribufu.game.server.get + async fn get_game_server_by_id_v1<'id>(&self, id: &'id str) -> Result>; + + /// GET /v1/games/servers/clusters/{id} + /// + /// 🔒 Required permissions: tribufu.game.server.cluster.get + async fn get_game_server_cluster_by_id<'id>(&self, id: &'id str) -> Result>; /// GET /v1/clusters/{id} /// - /// 🔒 Required permissions: tribufu.community.game.server.cluster.get - async fn get_game_server_cluster_by_id<'id>(&self, id: &'id str) -> Result>; + /// 🔒 Required permissions: tribufu.game.server.cluster.get + async fn get_game_server_cluster_by_id_v1<'id>(&self, id: &'id str) -> Result>; + + /// GET /v1/games/servers/clusters/{id}/servers + /// + /// 🔒 Required permissions: tribufu.game.server.cluster.server.list + async fn get_game_server_cluster_servers<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; + + /// GET /v1/clusters/{id}/servers + /// + /// 🔒 Required permissions: tribufu.game.server.cluster.server.list + async fn get_game_server_cluster_servers_v1<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; + + /// GET /v1/games/servers/clusters + /// + /// 🔒 Required permissions: tribufu.game.server.cluster.list + async fn get_game_server_clusters<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; /// GET /v1/clusters /// - /// 🔒 Required permissions: tribufu.community.game.server.cluster.list - async fn get_game_server_clusters<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; + /// 🔒 Required permissions: tribufu.game.server.cluster.list + async fn get_game_server_clusters_v1<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; - /// GET /v1/servers + /// GET /v1/games/servers/{id}/queries /// - /// 🔒 Required permissions: tribufu.community.game.server.list - async fn get_game_servers<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; + /// 🔒 Required permissions: tribufu.game.server.queries + async fn get_game_server_queries<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; + + /// GET /v1/servers/{id}/queries + /// + /// 🔒 Required permissions: tribufu.game.server.queries + async fn get_game_server_queries_v1<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; + + /// GET /v1/games/servers + /// + /// 🔒 Required permissions: tribufu.game.server.list + async fn get_game_servers<'address, 'query_port, 'country, 'game_id, 'page, 'limit>(&self, address: Option<&'address str>, query_port: Option, country: Option<&'country str>, game_id: Option<&'game_id str>, page: Option, limit: Option) -> Result, Error>; + + /// GET /v1/games/servers/country/{country} + /// + /// 🔒 Required permissions: tribufu.game.server.list.country + async fn get_game_servers_by_country<'country, 'page, 'limit>(&self, country: &'country str, page: Option, limit: Option) -> Result, Error>; /// GET /v1/servers/country/{country} /// - /// 🔒 Required permissions: tribufu.community.game.server.list.country - async fn get_game_servers_by_country<'country, 'page, 'limit>(&self, country: &'country str, page: Option, limit: Option) -> Result, Error>; + /// 🔒 Required permissions: tribufu.game.server.list.country + async fn get_game_servers_by_country_v1<'country, 'page, 'limit>(&self, country: &'country str, page: Option, limit: Option) -> Result, Error>; - /// GET /v1/games/{id}/servers + /// GET /v1/games/servers/countries /// - /// 🔒 Required permissions: tribufu.community.game.server.list - async fn get_game_servers_by_game_id<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; + /// 🔒 Required permissions: tribufu.game.server.country.list + async fn get_game_servers_countries<>(&self, ) -> Result, Error>; /// GET /v1/servers/countries /// - /// 🔒 Required permissions: tribufu.community.game.server.country.list - async fn get_game_servers_countries<>(&self, ) -> Result, Error>; + /// 🔒 Required permissions: tribufu.game.server.country.list + async fn get_game_servers_countries_v1<>(&self, ) -> Result, Error>; + + /// GET /v1/games/servers/metrics + /// + /// 🔒 Required permissions: tribufu.game.server.metric.get + async fn get_game_servers_metrics<>(&self, ) -> Result>; /// GET /v1/servers/metrics /// - /// 🔒 Required permissions: tribufu.community.game.server.metric.get - async fn get_game_servers_metrics<>(&self, ) -> Result>; + /// 🔒 Required permissions: tribufu.game.server.metric.get + async fn get_game_servers_metrics_v1<>(&self, ) -> Result>; + + /// GET /v1/servers + /// + /// 🔒 Required permissions: tribufu.game.server.list + async fn get_game_servers_v1<'address, 'query_port, 'country, 'game_id, 'page, 'limit>(&self, address: Option<&'address str>, query_port: Option, country: Option<&'country str>, game_id: Option<&'game_id str>, page: Option, limit: Option) -> Result, Error>; /// GET /v1/games /// - /// 🔒 Required permissions: tribufu.community.game.list - async fn get_games<>(&self, ) -> Result, Error>; + /// 🔒 Required permissions: tribufu.game.list + async fn get_games<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; /// GET /v1/groups/{id} /// @@ -193,7 +293,7 @@ pub trait TribufuGeneratedApi: Send + Sync { /// GET /v1/groups/{id}/games /// /// 🔒 Required permissions: tribufu.community.group.game.list - async fn get_group_games<'id>(&self, id: &'id str) -> Result, Error>; + async fn get_group_games<'id>(&self, id: &'id str) -> Result, Error>; /// GET /v1/groups/{id}/members /// @@ -207,24 +307,19 @@ pub trait TribufuGeneratedApi: Send + Sync { /// GET /v1/geoip/addresses/{address} /// - /// 🔒 Required permissions: tribufu.geoip.address.get + /// async fn get_ip_address<'address>(&self, address: &'address str) -> Result>; /// GET /v1/geoip/addresses /// /// 🔒 Required permissions: tribufu.geoip.address.list - async fn get_ip_addresses<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; + async fn get_ip_addresses<'organization_id, 'page, 'limit>(&self, organization_id: Option<&'organization_id str>, page: Option, limit: Option) -> Result, Error>; /// GET /v1/leaderboard /// /// 🔒 Required permissions: tribufu.community.leaderboard.get async fn get_leaderboard<'order>(&self, order: Option) -> Result, Error>; - /// GET /v1/me - /// - /// - async fn get_me<>(&self, ) -> Result>; - /// GET /v1/packages/{id} /// /// 🔒 Required permissions: tribufu.community.package.get @@ -235,75 +330,120 @@ pub trait TribufuGeneratedApi: Send + Sync { /// 🔒 Required permissions: tribufu.community.package.list async fn get_packages<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; + /// GET /v1/products/{id} + /// + /// 🔒 Required permissions: tribufu.store.product.get + async fn get_product_by_id<'id>(&self, id: &'id str) -> Result>; + + /// GET /v1/products + /// + /// 🔒 Required permissions: tribufu.store.product.list + async fn get_products<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; + /// GET /v1/oauth2/jwks /// - /// 🔒 Required permissions: tribufu.identity.oauth2.client.keys + /// async fn get_public_keys<>(&self, ) -> Result<(), Error>; - /// GET /v1/subscriptions/{id} - /// - /// 🔒 Required permissions: tribufu.store.subscription.get - async fn get_subscription_by_id<'id>(&self, id: &'id str) -> Result>; - - /// GET /v1/subscriptions - /// - /// 🔒 Required permissions: tribufu.store.subscription.list - async fn get_subscriptions<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; - /// GET /v1/users/{id}/accounts /// /// 🔒 Required permissions: tribufu.identity.user.account.list async fn get_user_accounts<'id>(&self, id: &'id str) -> Result, Error>; - /// GET /v1/users/{id} - /// - /// 🔒 Required permissions: tribufu.community.profile.get - async fn get_user_by_id<'id>(&self, id: &'id str) -> Result>; - - /// GET /v1/users/name/{name} - /// - /// 🔒 Required permissions: tribufu.community.profile.get.name - async fn get_user_by_name<'name>(&self, name: &'name str) -> Result>; - - /// GET /v1/users/uuid/{uuid} - /// - /// 🔒 Required permissions: tribufu.community.profile.get.uuid - async fn get_user_by_uuid<'uuid>(&self, uuid: &str) -> Result>; - - /// GET /v1/users/{id}/friends + /// GET /v1/profiles/{id}/friends /// /// 🔒 Required permissions: tribufu.community.profile.friend.list async fn get_user_friends<'id>(&self, id: &'id str) -> Result, Error>; - /// GET /v1/users/{id}/games + /// GET /v1/users/{id}/friends + /// + /// 🔒 Required permissions: tribufu.community.profile.friend.list + async fn get_user_friends_v1<'id>(&self, id: &'id str) -> Result, Error>; + + /// GET /v1/profiles/{id}/games /// /// 🔒 Required permissions: tribufu.community.profile.game.list async fn get_user_games<'id>(&self, id: &'id str) -> Result, Error>; - /// GET /v1/users/{id}/groups + /// GET /v1/users/{id}/games + /// + /// 🔒 Required permissions: tribufu.community.profile.game.list + async fn get_user_games_v1<'id>(&self, id: &'id str) -> Result, Error>; + + /// GET /v1/profiles/{id}/groups /// /// 🔒 Required permissions: tribufu.community.profile.group.list async fn get_user_groups<'id>(&self, id: &'id str) -> Result, Error>; + /// GET /v1/users/{id}/groups + /// + /// 🔒 Required permissions: tribufu.community.profile.group.list + async fn get_user_groups_v1<'id>(&self, id: &'id str) -> Result, Error>; + /// GET /v1/oauth2/userinfo /// /// 🔒 Required permissions: tribufu.identity.oauth2.user.info async fn get_user_info<>(&self, ) -> Result>; - /// GET /v1/users/{id}/punishments + /// GET /v1/profiles/{id} /// - /// 🔒 Required permissions: tribufu.community.profile.punishment.list - async fn get_user_punishments<'id>(&self, id: &'id str) -> Result, Error>; + /// 🔒 Required permissions: tribufu.community.profile.get + async fn get_user_profile_by_id<'id>(&self, id: &'id str) -> Result>; - /// GET /v1/users/{id}/servers + /// GET /v1/users/{id} /// - /// 🔒 Required permissions: tribufu.community.profile.game.server.list - async fn get_user_servers<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; + /// 🔒 Required permissions: tribufu.community.profile.get + async fn get_user_profile_by_id_v1<'id>(&self, id: &'id str) -> Result>; + + /// GET /v1/profiles/name/{name} + /// + /// 🔒 Required permissions: tribufu.community.profile.get.name + async fn get_user_profile_by_name<'name>(&self, name: &'name str) -> Result>; + + /// GET /v1/users/name/{name} + /// + /// 🔒 Required permissions: tribufu.community.profile.get.name + async fn get_user_profile_by_name_v1<'name>(&self, name: &'name str) -> Result>; + + /// GET /v1/profiles/uuid/{uuid} + /// + /// 🔒 Required permissions: tribufu.community.profile.get.uuid + async fn get_user_profile_by_uuid<'uuid>(&self, uuid: &str) -> Result>; + + /// GET /v1/users/uuid/{uuid} + /// + /// 🔒 Required permissions: tribufu.community.profile.get.uuid + async fn get_user_profile_by_uuid_v1<'uuid>(&self, uuid: &str) -> Result>; + + /// GET /v1/profiles + /// + /// 🔒 Required permissions: tribufu.community.profile.list + async fn get_user_profiles<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; /// GET /v1/users /// /// 🔒 Required permissions: tribufu.community.profile.list - async fn get_users<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; + async fn get_user_profiles_v1<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error>; + + /// GET /v1/profiles/{id}/sanctions + /// + /// 🔒 Required permissions: tribufu.community.profile.sanction.list + async fn get_user_sanctions<'id>(&self, id: &'id str) -> Result, Error>; + + /// GET /v1/users/{id}/sanctions + /// + /// 🔒 Required permissions: tribufu.community.profile.sanction.list + async fn get_user_sanctions_v1<'id>(&self, id: &'id str) -> Result, Error>; + + /// GET /v1/profiles/{id}/servers + /// + /// 🔒 Required permissions: tribufu.community.profile.game.server.list + async fn get_user_servers<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; + + /// GET /v1/users/{id}/servers + /// + /// 🔒 Required permissions: tribufu.community.profile.game.server.list + async fn get_user_servers_v1<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error>; /// POST /v1/utils/argon2 /// @@ -327,58 +467,63 @@ pub trait TribufuGeneratedApi: Send + Sync { /// POST /v1/oauth2/introspect /// - /// 🔒 Required permissions: tribufu.identity.oauth2.token.introspect - async fn introspect_token<'introspect_request>(&self, introspect_request: Option) -> Result<(), Error>; - - /// POST /v1/login - /// - /// 🔒 Required permissions: tribufu.identity.token.create - async fn login<'login_request>(&self, login_request: Option) -> Result>; - - /// POST /v1/logout - /// - /// 🔒 Required permissions: tribufu.identity.token.revoke - async fn logout<>(&self, ) -> Result<(), Error>; - - /// POST /v1/refresh - /// - /// 🔒 Required permissions: tribufu.identity.token.refresh - async fn refresh<'refresh_request>(&self, refresh_request: Option) -> Result>; - - /// POST /v1/register - /// - /// 🔒 Required permissions: tribufu.identity.user.create - async fn register<'register_request>(&self, register_request: Option) -> Result>; + /// + async fn introspect_token<'introspect_request>(&self, introspect_request: Option) -> Result>; /// POST /v1/oauth2/revoke /// - /// 🔒 Required permissions: tribufu.identity.oauth2.token.revoke + /// async fn revoke_token<'revoke_request>(&self, revoke_request: Option) -> Result<(), Error>; /// POST /v1/search /// /// 🔒 Required permissions: tribufu.community.search - async fn search<'search_request>(&self, search_request: Option) -> Result, Error>; + async fn search<'search>(&self, search: Option) -> Result, Error>; - /// PUT /v1/servers/{id} + /// PUT /v1/oauth2/clients/{id} /// - /// 🔒 Required permissions: tribufu.community.game.server.update + /// 🔒 Required permissions: tribufu.identity.oauth2.client.update + async fn update_client<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; + + /// PUT /v1/games/servers/{id} + /// + /// 🔒 Required permissions: tribufu.game.server.update async fn update_game_server<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; + /// PUT /v1/games/servers/clusters/{id} + /// + /// 🔒 Required permissions: tribufu.game.server.cluster.update + async fn update_game_server_cluster<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; + /// PUT /v1/clusters/{id} /// - /// 🔒 Required permissions: tribufu.community.game.server.cluster.update - async fn update_game_server_cluster<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; + /// 🔒 Required permissions: tribufu.game.server.cluster.update + async fn update_game_server_cluster_v1<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; + + /// PUT /v1/servers/{id} + /// + /// 🔒 Required permissions: tribufu.game.server.update + async fn update_game_server_v1<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; /// PUT /v1/groups/{id} /// /// 🔒 Required permissions: tribufu.community.group.update async fn update_group<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error>; - /// PUT /v1/users/{id}/profile + /// PUT /v1/packages/{id} + /// + /// 🔒 Required permissions: tribufu.community.package.update + async fn update_package<'id, 'package>(&self, id: &'id str, package: Option) -> Result<(), Error>; + + /// PUT /v1/profiles/{id}/profile /// /// 🔒 Required permissions: tribufu.community.profile.update async fn update_user_profile<'id, 'update_profile>(&self, id: &'id str, update_profile: Option) -> Result>; + + /// PUT /v1/users/{id}/profile + /// + /// 🔒 Required permissions: tribufu.community.profile.update + async fn update_user_profile_v1<'id, 'update_profile>(&self, id: &'id str, update_profile: Option) -> Result>; } pub struct TribufuGeneratedApiClient { @@ -396,7 +541,7 @@ impl TribufuGeneratedApiClient { #[async_trait] impl TribufuGeneratedApi for TribufuGeneratedApiClient { /// 🔒 Required permissions: tribufu.identity.oauth2.authorize - async fn authorize<'authorize_request>(&self, authorize_request: Option) -> Result<(), Error> { + async fn authorize<'authorize_request>(&self, authorize_request: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; @@ -421,10 +566,20 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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() { - Ok(()) + 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::CodeResponse`"))), + 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::CodeResponse`")))), + } } 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 }; @@ -506,12 +661,49 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// This endpoint is not available with an api key, only with a bearer token.

🔒 Required permissions: tribufu.community.game.server.claim + /// This endpoint is not available with an api key, only with a bearer token.

🔒 Required permissions: tribufu.game.server.claim async fn claim_game_server<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/games/servers/{id}/claim", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&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)) + } + } + + /// This endpoint is not available with an api key, only with a bearer token.

🔒 Required permissions: tribufu.game.server.claim + async fn claim_game_server_v1<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/servers/{id}/claim", local_var_configuration.base_path, id=crate::apis::urlencode(id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); @@ -537,7 +729,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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_entity: Option = serde_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)) } @@ -590,13 +782,50 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.create + /// 🔒 Required permissions: tribufu.identity.oauth2.client.create + async fn create_client<'body>(&self, body: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/oauth2/clients", 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.create async fn create_game_server<'body>(&self, body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/v1/games/servers", 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 { @@ -627,12 +856,49 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.cluster.create + /// 🔒 Required permissions: tribufu.game.server.cluster.create async fn create_game_server_cluster<'body>(&self, body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/games/servers/clusters", 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.cluster.create + async fn create_game_server_cluster_v1<'body>(&self, body: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/clusters", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); @@ -658,7 +924,44 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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_entity: Option = serde_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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.create + async fn create_game_server_v1<'body>(&self, body: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers", 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&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)) } @@ -747,13 +1050,86 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.delete + /// This endpoint is only available with client credentials. + async fn create_user<'create_user>(&self, create_user: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users", 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&create_user); + + 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)) + } + } + + /// 🔒 Required permissions: tribufu.identity.oauth2.client.delete + async fn delete_client<'id>(&self, id: &'id str) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/oauth2/clients/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.delete async fn delete_game_server<'id>(&self, id: &'id str) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/games/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -783,12 +1159,48 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.cluster.delete + /// 🔒 Required permissions: tribufu.game.server.cluster.delete async fn delete_game_server_cluster<'id>(&self, id: &'id str) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/games/servers/clusters/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.cluster.delete + async fn delete_game_server_cluster_v1<'id>(&self, id: &'id str) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/clusters/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); @@ -813,7 +1225,43 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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_entity: Option = serde_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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.delete + async fn delete_game_server_v1<'id>(&self, id: &'id str) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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)) } @@ -855,6 +1303,42 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } + /// 🔒 Required permissions: tribufu.community.package.delete + async fn delete_package<'id>(&self, id: &'id str) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/packages/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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)) + } + } + /// 🔒 Required permissions: tribufu.utils.generate.flake async fn generate_flake_id<'amount>(&self, amount: Option) -> Result, Error> { let local_var_configuration = &self.configuration; @@ -1057,7 +1541,53 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - async fn get_client_info<>(&self, ) -> Result<(), Error> { + /// 🔒 Required permissions: tribufu.identity.oauth2.client.get + async fn get_client_by_id<'id>(&self, id: &'id str) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/oauth2/clients/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Client`"))), + 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::Client`")))), + } + } 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_client_info<>(&self, ) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; @@ -1081,10 +1611,20 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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() { - Ok(()) + 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::ClientInfo`"))), + 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::ClientInfo`")))), + } } 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 }; @@ -1092,7 +1632,61 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.geoip.current + /// 🔒 Required permissions: tribufu.identity.oauth2.client.list + async fn get_clients<'organization_id, 'page, 'limit>(&self, organization_id: Option<&'organization_id str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/oauth2/clients", 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) = organization_id { + local_var_req_builder = local_var_req_builder.query(&[("organization_id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Client>`"))), + 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::Client>`")))), + } + } 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_current_ip_address<>(&self, ) -> Result, Error> { let local_var_configuration = &self.configuration; @@ -1138,7 +1732,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.get + /// 🔒 Required permissions: tribufu.game.get async fn get_game_by_id<'id>(&self, id: &'id str) -> Result> { let local_var_configuration = &self.configuration; @@ -1184,117 +1778,13 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.cluster.list - async fn get_game_clusters_by_game_id<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/games/{id}/clusters", local_var_configuration.base_path, id=crate::apis::urlencode(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) = page { - local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - - 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::GameServerCluster>`"))), - 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::GameServerCluster>`")))), - } - } 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)) - } - } - - /// 🔒 Required permissions: tribufu.community.game.item.list - async fn get_game_items<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/games/{id}/items", local_var_configuration.base_path, id=crate::apis::urlencode(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) = page { - local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - - 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<serde_json::Value>`"))), - 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<serde_json::Value>`")))), - } - } 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)) - } - } - - /// 🔒 Required permissions: tribufu.community.game.server.get.address + /// 🔒 Required permissions: tribufu.game.server.get.address async fn get_game_server_by_address_and_query_port<'address, 'port>(&self, address: &'address str, port: i32) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers/address/{address}:{port}", local_var_configuration.base_path, address=crate::apis::urlencode(address), port=port); + let local_var_uri_str = format!("{}/v1/games/servers/address/{address}:{port}", local_var_configuration.base_path, address=crate::apis::urlencode(address), port=port); 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 { @@ -1334,13 +1824,59 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.get + /// 🔒 Required permissions: tribufu.game.server.get.address + async fn get_game_server_by_address_and_query_port_v1<'address, 'port>(&self, address: &'address str, port: i32) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers/address/{address}:{port}", local_var_configuration.base_path, address=crate::apis::urlencode(address), port=port); + 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::GameServer`"))), + 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::GameServer`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.get async fn get_game_server_by_id<'id>(&self, id: &'id str) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/games/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -1380,13 +1916,59 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.cluster.get + /// 🔒 Required permissions: tribufu.game.server.get + async fn get_game_server_by_id_v1<'id>(&self, id: &'id str) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::GameServer`"))), + 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::GameServer`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.cluster.get async fn get_game_server_cluster_by_id<'id>(&self, id: &'id str) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/clusters/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/games/servers/clusters/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -1426,13 +2008,163 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.cluster.list + /// 🔒 Required permissions: tribufu.game.server.cluster.get + async fn get_game_server_cluster_by_id_v1<'id>(&self, id: &'id str) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/clusters/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::GameServerCluster`"))), + 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::GameServerCluster`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.cluster.server.list + async fn get_game_server_cluster_servers<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/games/servers/clusters/{id}/servers", local_var_configuration.base_path, id=crate::apis::urlencode(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) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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<serde_json::Value>`"))), + 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<serde_json::Value>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.cluster.server.list + async fn get_game_server_cluster_servers_v1<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/clusters/{id}/servers", local_var_configuration.base_path, id=crate::apis::urlencode(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) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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<serde_json::Value>`"))), + 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<serde_json::Value>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.cluster.list async fn get_game_server_clusters<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/clusters", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/v1/games/servers/clusters", 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) = page { @@ -1478,13 +2210,13 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.list - async fn get_game_servers<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { + /// 🔒 Required permissions: tribufu.game.server.cluster.list + async fn get_game_server_clusters_v1<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/v1/clusters", 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) = page { @@ -1517,6 +2249,174 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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::GameServerCluster>`"))), + 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::GameServerCluster>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.queries + async fn get_game_server_queries<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/games/servers/{id}/queries", local_var_configuration.base_path, id=crate::apis::urlencode(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) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::GameServerQuery>`"))), + 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::GameServerQuery>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.queries + async fn get_game_server_queries_v1<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers/{id}/queries", local_var_configuration.base_path, id=crate::apis::urlencode(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) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::GameServerQuery>`"))), + 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::GameServerQuery>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.list + async fn get_game_servers<'address, 'query_port, 'country, 'game_id, 'page, 'limit>(&self, address: Option<&'address str>, query_port: Option, country: Option<&'country str>, game_id: Option<&'game_id str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/games/servers", 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) = address { + local_var_req_builder = local_var_req_builder.query(&[("address", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = query_port { + local_var_req_builder = local_var_req_builder.query(&[("query_port", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = country { + local_var_req_builder = local_var_req_builder.query(&[("country", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = game_id { + local_var_req_builder = local_var_req_builder.query(&[("game_id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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), @@ -1530,13 +2430,13 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.list.country + /// 🔒 Required permissions: tribufu.game.server.list.country async fn get_game_servers_by_country<'country, 'page, 'limit>(&self, country: &'country str, page: Option, limit: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers/country/{country}", local_var_configuration.base_path, country=crate::apis::urlencode(country)); + let local_var_uri_str = format!("{}/v1/games/servers/country/{country}", local_var_configuration.base_path, country=crate::apis::urlencode(country)); 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) = page { @@ -1582,13 +2482,13 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.list - async fn get_game_servers_by_game_id<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error> { + /// 🔒 Required permissions: tribufu.game.server.list.country + async fn get_game_servers_by_country_v1<'country, 'page, 'limit>(&self, country: &'country str, page: Option, limit: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/games/{id}/servers", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/servers/country/{country}", local_var_configuration.base_path, country=crate::apis::urlencode(country)); 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) = page { @@ -1628,19 +2528,19 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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::GameServer>`")))), } } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_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)) } } - /// 🔒 Required permissions: tribufu.community.game.server.country.list + /// 🔒 Required permissions: tribufu.game.server.country.list async fn get_game_servers_countries<>(&self, ) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers/countries", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/v1/games/servers/countries", 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 { @@ -1680,13 +2580,59 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.metric.get + /// 🔒 Required permissions: tribufu.game.server.country.list + async fn get_game_servers_countries_v1<>(&self, ) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers/countries", 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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 `std::collections::HashMap<String, i32>`"))), + 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 `std::collections::HashMap<String, i32>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.metric.get async fn get_game_servers_metrics<>(&self, ) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers/metrics", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/v1/games/servers/metrics", 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 { @@ -1726,8 +2672,118 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.list - async fn get_games<>(&self, ) -> Result, Error> { + /// 🔒 Required permissions: tribufu.game.server.metric.get + async fn get_game_servers_metrics_v1<>(&self, ) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers/metrics", 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::ServerMetrics`"))), + 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::ServerMetrics`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.list + async fn get_game_servers_v1<'address, 'query_port, 'country, 'game_id, 'page, 'limit>(&self, address: Option<&'address str>, query_port: Option, country: Option<&'country str>, game_id: Option<&'game_id str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers", 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) = address { + local_var_req_builder = local_var_req_builder.query(&[("address", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = query_port { + local_var_req_builder = local_var_req_builder.query(&[("query_port", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = country { + local_var_req_builder = local_var_req_builder.query(&[("country", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = game_id { + local_var_req_builder = local_var_req_builder.query(&[("game_id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::GameServer>`"))), + 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::GameServer>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.game.list + async fn get_games<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; @@ -1735,6 +2791,12 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { let local_var_uri_str = format!("{}/v1/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_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); } @@ -1911,7 +2973,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } /// 🔒 Required permissions: tribufu.community.group.game.list - async fn get_group_games<'id>(&self, id: &'id str) -> Result, Error> { + async fn get_group_games<'id>(&self, id: &'id str) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; @@ -1946,8 +3008,8 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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::GroupGame>`"))), - 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::GroupGame>`")))), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GroupApplication>`"))), + 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::GroupApplication>`")))), } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -2054,7 +3116,6 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.geoip.address.get async fn get_ip_address<'address>(&self, address: &'address str) -> Result> { let local_var_configuration = &self.configuration; @@ -2101,7 +3162,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } /// 🔒 Required permissions: tribufu.geoip.address.list - async fn get_ip_addresses<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { + async fn get_ip_addresses<'organization_id, 'page, 'limit>(&self, organization_id: Option<&'organization_id str>, page: Option, limit: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; @@ -2109,6 +3170,9 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { let local_var_uri_str = format!("{}/v1/geoip/addresses", 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) = organization_id { + local_var_req_builder = local_var_req_builder.query(&[("organization_id", &local_var_str.to_string())]); + } if let Some(ref local_var_str) = page { local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); } @@ -2201,51 +3265,6 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - async fn get_me<>(&self, ) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/me", 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_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - - 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::UserInfo`"))), - 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::UserInfo`")))), - } - } 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)) - } - } - /// 🔒 Required permissions: tribufu.community.package.get async fn get_package_by_id<'id>(&self, id: &'id str) -> Result> { let local_var_configuration = &self.configuration; @@ -2344,49 +3363,13 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.identity.oauth2.client.keys - async fn get_public_keys<>(&self, ) -> Result<(), Error> { + /// 🔒 Required permissions: tribufu.store.product.get + async fn get_product_by_id<'id>(&self, id: &'id str) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/oauth2/jwks", 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_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - - 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)) - } - } - - /// 🔒 Required permissions: tribufu.store.subscription.get - async fn get_subscription_by_id<'id>(&self, id: &'id str) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/subscriptions/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/products/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -2416,23 +3399,23 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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::Subscription`"))), - 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::Subscription`")))), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Product`"))), + 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::Product`")))), } } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_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)) } } - /// 🔒 Required permissions: tribufu.store.subscription.list - async fn get_subscriptions<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { + /// 🔒 Required permissions: tribufu.store.product.list + async fn get_products<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/subscriptions", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/v1/products", 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) = page { @@ -2468,11 +3451,46 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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::Subscription>`"))), - 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::Subscription>`")))), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`"))), + 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::Product>`")))), } } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_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_public_keys<>(&self, ) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/oauth2/jwks", 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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)) } @@ -2524,151 +3542,13 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.profile.get - async fn get_user_by_id<'id>(&self, id: &'id str) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/users/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - - 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::Profile`"))), - 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::Profile`")))), - } - } 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)) - } - } - - /// 🔒 Required permissions: tribufu.community.profile.get.name - async fn get_user_by_name<'name>(&self, name: &'name str) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/users/name/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(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()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - - 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::Profile`"))), - 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::Profile`")))), - } - } 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)) - } - } - - /// 🔒 Required permissions: tribufu.community.profile.get.uuid - async fn get_user_by_uuid<'uuid>(&self, uuid: &str) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/users/uuid/{uuid}", local_var_configuration.base_path, uuid=crate::apis::urlencode(uuid)); - 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_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - - 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::Profile`"))), - 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::Profile`")))), - } - } 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)) - } - } - /// 🔒 Required permissions: tribufu.community.profile.friend.list async fn get_user_friends<'id>(&self, id: &'id str) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/users/{id}/friends", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/profiles/{id}/friends", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -2708,13 +3588,59 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } + /// 🔒 Required permissions: tribufu.community.profile.friend.list + async fn get_user_friends_v1<'id>(&self, id: &'id str) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/{id}/friends", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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<serde_json::Value>`"))), + 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<serde_json::Value>`")))), + } + } 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)) + } + } + /// 🔒 Required permissions: tribufu.community.profile.game.list async fn get_user_games<'id>(&self, id: &'id str) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/users/{id}/games", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/profiles/{id}/games", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -2754,12 +3680,104 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } + /// 🔒 Required permissions: tribufu.community.profile.game.list + async fn get_user_games_v1<'id>(&self, id: &'id str) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/{id}/games", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::ProfileGame>`"))), + 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::ProfileGame>`")))), + } + } 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)) + } + } + /// 🔒 Required permissions: tribufu.community.profile.group.list async fn get_user_groups<'id>(&self, id: &'id str) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/profiles/{id}/groups", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::ProfileGroup>`"))), + 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::ProfileGroup>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.group.list + async fn get_user_groups_v1<'id>(&self, id: &'id str) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/users/{id}/groups", local_var_configuration.base_path, id=crate::apis::urlencode(id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); @@ -2794,7 +3812,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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::ProfileGroup>`")))), } } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_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)) } @@ -2846,13 +3864,393 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.profile.punishment.list - async fn get_user_punishments<'id>(&self, id: &'id str) -> Result, Error> { + /// 🔒 Required permissions: tribufu.community.profile.get + async fn get_user_profile_by_id<'id>(&self, id: &'id str) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/users/{id}/punishments", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/profiles/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Profile`"))), + 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::Profile`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.get + async fn get_user_profile_by_id_v1<'id>(&self, id: &'id str) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Profile`"))), + 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::Profile`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.get.name + async fn get_user_profile_by_name<'name>(&self, name: &'name str) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/profiles/name/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Profile`"))), + 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::Profile`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.get.name + async fn get_user_profile_by_name_v1<'name>(&self, name: &'name str) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/name/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Profile`"))), + 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::Profile`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.get.uuid + async fn get_user_profile_by_uuid<'uuid>(&self, uuid: &str) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/profiles/uuid/{uuid}", local_var_configuration.base_path, uuid=crate::apis::urlencode(uuid)); + 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Profile`"))), + 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::Profile`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.get.uuid + async fn get_user_profile_by_uuid_v1<'uuid>(&self, uuid: &str) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/uuid/{uuid}", local_var_configuration.base_path, uuid=crate::apis::urlencode(uuid)); + 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_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Profile`"))), + 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::Profile`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.list + async fn get_user_profiles<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/profiles", 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) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Profile>`"))), + 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::Profile>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.list + async fn get_user_profiles_v1<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/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_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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::Profile>`"))), + 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::Profile>`")))), + } + } 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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.sanction.list + async fn get_user_sanctions<'id>(&self, id: &'id str) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/profiles/{id}/sanctions", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -2886,7 +4284,53 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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<serde_json::Value>`")))), } } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_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)) + } + } + + /// 🔒 Required permissions: tribufu.community.profile.sanction.list + async fn get_user_sanctions_v1<'id>(&self, id: &'id str) -> Result, Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/{id}/sanctions", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + + 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<serde_json::Value>`"))), + 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<serde_json::Value>`")))), + } + } 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)) } @@ -2898,7 +4342,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/users/{id}/servers", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/profiles/{id}/servers", local_var_configuration.base_path, id=crate::apis::urlencode(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) = page { @@ -2944,13 +4388,13 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.profile.list - async fn get_users<'page, 'limit>(&self, page: Option, limit: Option) -> Result, Error> { + /// 🔒 Required permissions: tribufu.community.profile.game.server.list + async fn get_user_servers_v1<'id, 'page, 'limit>(&self, id: &'id str, page: Option, limit: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/users", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/v1/users/{id}/servers", local_var_configuration.base_path, id=crate::apis::urlencode(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) = page { @@ -2986,11 +4430,11 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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::Profile>`"))), - 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::Profile>`")))), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GameServer>`"))), + 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::GameServer>`")))), } } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_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)) } @@ -3184,8 +4628,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.identity.oauth2.token.introspect - async fn introspect_token<'introspect_request>(&self, introspect_request: Option) -> Result<(), Error> { + async fn introspect_token<'introspect_request>(&self, introspect_request: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; @@ -3210,10 +4653,20 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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() { - Ok(()) + 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::IntrospectResponse`"))), + 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::IntrospectResponse`")))), + } } 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 }; @@ -3221,184 +4674,6 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.identity.token.create - async fn login<'login_request>(&self, login_request: Option) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/login", 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_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - local_var_req_builder = local_var_req_builder.json(&login_request); - - 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::LoginResponse`"))), - 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::LoginResponse`")))), - } - } 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)) - } - } - - /// 🔒 Required permissions: tribufu.identity.token.revoke - async fn logout<>(&self, ) -> Result<(), Error> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/logout", 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_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - - 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)) - } - } - - /// 🔒 Required permissions: tribufu.identity.token.refresh - async fn refresh<'refresh_request>(&self, refresh_request: Option) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/refresh", 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_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - local_var_req_builder = local_var_req_builder.json(&refresh_request); - - 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::LoginResponse`"))), - 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::LoginResponse`")))), - } - } 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)) - } - } - - /// 🔒 Required permissions: tribufu.identity.user.create - async fn register<'register_request>(&self, register_request: Option) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/v1/register", 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_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - local_var_req_builder = local_var_req_builder.json(®ister_request); - - 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::LoginResponse`"))), - 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::LoginResponse`")))), - } - } 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)) - } - } - - /// 🔒 Required permissions: tribufu.identity.oauth2.token.revoke async fn revoke_token<'revoke_request>(&self, revoke_request: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; @@ -3436,7 +4711,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } /// 🔒 Required permissions: tribufu.community.search - async fn search<'search_request>(&self, search_request: Option) -> Result, Error> { + async fn search<'search>(&self, search: Option) -> Result, Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; @@ -3455,7 +4730,7 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { }; local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; - local_var_req_builder = local_var_req_builder.json(&search_request); + local_var_req_builder = local_var_req_builder.json(&search); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -3482,13 +4757,50 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.update + /// 🔒 Required permissions: tribufu.identity.oauth2.client.update + async fn update_client<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/oauth2/clients/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.update async fn update_game_server<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/games/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -3519,12 +4831,49 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } - /// 🔒 Required permissions: tribufu.community.game.server.cluster.update + /// 🔒 Required permissions: tribufu.game.server.cluster.update async fn update_game_server_cluster<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/games/servers/clusters/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.cluster.update + async fn update_game_server_cluster_v1<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + let local_var_uri_str = format!("{}/v1/clusters/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); @@ -3550,7 +4899,44 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { 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_entity: Option = serde_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)) + } + } + + /// 🔒 Required permissions: tribufu.game.server.update + async fn update_game_server_v1<'id, 'body>(&self, id: &'id str, body: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/servers/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&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)) } @@ -3593,13 +4979,50 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } + /// 🔒 Required permissions: tribufu.community.package.update + async fn update_package<'id, 'package>(&self, id: &'id str, package: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/packages/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&package); + + 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)) + } + } + /// 🔒 Required permissions: tribufu.community.profile.update async fn update_user_profile<'id, 'update_profile>(&self, id: &'id str, update_profile: Option) -> Result> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/v1/users/{id}/profile", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let local_var_uri_str = format!("{}/v1/profiles/{id}/profile", local_var_configuration.base_path, id=crate::apis::urlencode(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 { @@ -3640,6 +5063,53 @@ impl TribufuGeneratedApi for TribufuGeneratedApiClient { } } + /// 🔒 Required permissions: tribufu.community.profile.update + async fn update_user_profile_v1<'id, 'update_profile>(&self, id: &'id str, update_profile: Option) -> Result> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/{id}/profile", local_var_configuration.base_path, id=crate::apis::urlencode(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()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&update_profile); + + 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::Profile`"))), + 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::Profile`")))), + } + } 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 [`authorize`] @@ -3670,6 +5140,13 @@ pub enum ClaimGameServerError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`claim_game_server_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ClaimGameServerV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`convert_base64`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3677,6 +5154,13 @@ pub enum ConvertBase64Error { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`create_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateClientError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`create_game_server`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3691,6 +5175,20 @@ pub enum CreateGameServerClusterError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`create_game_server_cluster_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateGameServerClusterV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_game_server_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateGameServerV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`create_group`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3705,6 +5203,20 @@ pub enum CreateTokenError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`create_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateUserError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteClientError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`delete_game_server`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3719,6 +5231,20 @@ pub enum DeleteGameServerClusterError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`delete_game_server_cluster_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGameServerClusterV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_game_server_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGameServerV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`delete_group`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3726,6 +5252,13 @@ pub enum DeleteGroupError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`delete_package`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeletePackageError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`generate_flake_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3754,6 +5287,13 @@ pub enum GenerateUuidError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_client_by_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetClientByIdError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_client_info`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3761,6 +5301,13 @@ pub enum GetClientInfoError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_clients`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetClientsError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_current_ip_address`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3775,20 +5322,6 @@ pub enum GetGameByIdError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`get_game_clusters_by_game_id`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetGameClustersByGameIdError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_game_items`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetGameItemsError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`get_game_server_by_address_and_query_port`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3796,6 +5329,13 @@ pub enum GetGameServerByAddressAndQueryPortError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_game_server_by_address_and_query_port_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServerByAddressAndQueryPortV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_game_server_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3803,6 +5343,13 @@ pub enum GetGameServerByIdError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_game_server_by_id_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServerByIdV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_game_server_cluster_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3810,6 +5357,27 @@ pub enum GetGameServerClusterByIdError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_game_server_cluster_by_id_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServerClusterByIdV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_game_server_cluster_servers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServerClusterServersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_game_server_cluster_servers_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServerClusterServersV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_game_server_clusters`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3817,6 +5385,27 @@ pub enum GetGameServerClustersError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_game_server_clusters_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServerClustersV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_game_server_queries`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServerQueriesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_game_server_queries_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServerQueriesV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_game_servers`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3831,10 +5420,10 @@ pub enum GetGameServersByCountryError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`get_game_servers_by_game_id`] +/// struct for typed errors of method [`get_game_servers_by_country_v1`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum GetGameServersByGameIdError { +pub enum GetGameServersByCountryV1Error { UnknownValue(serde_json::Value), } @@ -3845,6 +5434,13 @@ pub enum GetGameServersCountriesError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_game_servers_countries_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServersCountriesV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_game_servers_metrics`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3852,6 +5448,20 @@ pub enum GetGameServersMetricsError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_game_servers_metrics_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServersMetricsV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_game_servers_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGameServersV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_games`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3922,13 +5532,6 @@ pub enum GetLeaderboardError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`get_me`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetMeError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`get_package_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3943,6 +5546,20 @@ pub enum GetPackagesError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_product_by_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetProductByIdError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_products`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetProductsError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_public_keys`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3950,20 +5567,6 @@ pub enum GetPublicKeysError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`get_subscription_by_id`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetSubscriptionByIdError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_subscriptions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetSubscriptionsError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`get_user_accounts`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3971,27 +5574,6 @@ pub enum GetUserAccountsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`get_user_by_id`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetUserByIdError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_user_by_name`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetUserByNameError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_user_by_uuid`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetUserByUuidError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`get_user_friends`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -3999,6 +5581,13 @@ pub enum GetUserFriendsError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_user_friends_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserFriendsV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_user_games`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -4006,6 +5595,13 @@ pub enum GetUserGamesError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_user_games_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserGamesV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_user_groups`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -4013,6 +5609,13 @@ pub enum GetUserGroupsError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_user_groups_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserGroupsV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_user_info`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -4020,10 +5623,73 @@ pub enum GetUserInfoError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`get_user_punishments`] +/// struct for typed errors of method [`get_user_profile_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum GetUserPunishmentsError { +pub enum GetUserProfileByIdError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_profile_by_id_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserProfileByIdV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_profile_by_name`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserProfileByNameError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_profile_by_name_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserProfileByNameV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_profile_by_uuid`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserProfileByUuidError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_profile_by_uuid_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserProfileByUuidV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_profiles`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserProfilesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_profiles_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserProfilesV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_sanctions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserSanctionsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_sanctions_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserSanctionsV1Error { UnknownValue(serde_json::Value), } @@ -4034,10 +5700,10 @@ pub enum GetUserServersError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`get_users`] +/// struct for typed errors of method [`get_user_servers_v1`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum GetUsersError { +pub enum GetUserServersV1Error { UnknownValue(serde_json::Value), } @@ -4076,34 +5742,6 @@ pub enum IntrospectTokenError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`login`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LoginError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`logout`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LogoutError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`refresh`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RefreshError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`register`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RegisterError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`revoke_token`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -4118,6 +5756,13 @@ pub enum SearchError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`update_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`update_game_server`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -4132,6 +5777,20 @@ pub enum UpdateGameServerClusterError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`update_game_server_cluster_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateGameServerClusterV1Error { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_game_server_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateGameServerV1Error { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`update_group`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -4139,6 +5798,13 @@ pub enum UpdateGroupError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`update_package`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdatePackageError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`update_user_profile`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -4146,3 +5812,10 @@ pub enum UpdateUserProfileError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`update_user_profile_v1`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateUserProfileV1Error { + UnknownValue(serde_json::Value), +} + diff --git a/src/constants/Cargo.toml b/src/constants/Cargo.toml index 2cc5dfa..6bb3621 100644 --- a/src/constants/Cargo.toml +++ b/src/constants/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "tribufu-constants" -version = "0.0.5" +version = "1.3.0" description = "Tribufu Constants" repository = "https://github.com/tribufu/tribufu-rust" authors = ["Tribufu "] +license = "MIT" edition = "2021" -publish = false +publish = true [lib] name = "tribufu_constants" diff --git a/src/error/Cargo.toml b/src/error/Cargo.toml index 5723bd9..c62d2d2 100644 --- a/src/error/Cargo.toml +++ b/src/error/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "tribufu-error" -version = "0.0.5" +version = "1.3.0" description = "Tribufu Error" repository = "https://github.com/tribufu/tribufu-rust" authors = ["Tribufu "] +license = "MIT" edition = "2021" -publish = false +publish = true [lib] name = "tribufu_error" diff --git a/src/json/Cargo.toml b/src/json/Cargo.toml index dda77d4..9829ba0 100644 --- a/src/json/Cargo.toml +++ b/src/json/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "tribufu-json" -version = "0.0.5" +version = "1.3.0" description = "Tribufu Json" repository = "https://github.com/tribufu/tribufu-rust" authors = ["Tribufu "] +license = "MIT" edition = "2021" -publish = false +publish = true [lib] name = "tribufu_json" @@ -13,6 +14,6 @@ crate-type = ["rlib"] path = "lib.rs" [dependencies] -tribufu-error = { version = "0.0.5", path = "../error" } +tribufu-error = { version = "1.3.0", path = "../error" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/log/Cargo.toml b/src/log/Cargo.toml index 165babf..35afda0 100644 --- a/src/log/Cargo.toml +++ b/src/log/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "tribufu-log" -version = "0.0.5" +version = "1.3.0" description = "Tribufu Log" repository = "https://github.com/tribufu/tribufu-rust" authors = ["Tribufu "] +license = "MIT" edition = "2021" -publish = false +publish = true [lib] name = "tribufu_log" @@ -13,7 +14,7 @@ crate-type = ["rlib"] path = "lib.rs" [dependencies] -tribufu-error = { version = "0.0.5", path = "../error" } +tribufu-error = { version = "1.3.0", path = "../error" } chrono = "0.4.23" env_logger = "0.10.1" log = "0.4" diff --git a/src/models/account.rs b/src/models/account.rs index 6d76e4b..8ed0220 100644 --- a/src/models/account.rs +++ b/src/models/account.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -13,12 +13,12 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Account { - #[serde(rename = "id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub id: Option>, + #[serde(rename = "id", deserialize_with = "Option::deserialize")] + pub id: Option, #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub name: Option>, - #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] - pub provider: Option, + #[serde(rename = "provider")] + pub provider: models::LoginProvider, #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")] pub user_id: Option, #[serde(rename = "authorized", skip_serializing_if = "Option::is_none")] @@ -32,11 +32,11 @@ pub struct Account { } impl Account { - pub fn new() -> Account { + pub fn new(id: Option, provider: models::LoginProvider) -> Account { Account { - id: None, + id, name: None, - provider: None, + provider, user_id: None, authorized: None, fields: None, diff --git a/src/models/application.rs b/src/models/application.rs index e395e0e..24fe58f 100644 --- a/src/models/application.rs +++ b/src/models/application.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -15,8 +15,8 @@ use serde::{Deserialize, Serialize}; pub struct Application { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, - #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub name: Option>, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub description: Option>, #[serde(rename = "type", skip_serializing_if = "Option::is_none")] @@ -31,24 +31,8 @@ pub struct Application { pub capsule_image_url: Option>, #[serde(rename = "library_image_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub library_image_url: Option>, - #[serde(rename = "parent_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub parent_id: Option>, #[serde(rename = "slug", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub slug: Option>, - #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] - pub visibility: Option, - #[serde(rename = "password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub password: Option>, - #[serde(rename = "primary", skip_serializing_if = "Option::is_none")] - pub primary: Option, - #[serde(rename = "user_count", skip_serializing_if = "Option::is_none")] - pub user_count: Option, - #[serde(rename = "achievement_count", skip_serializing_if = "Option::is_none")] - pub achievement_count: Option, - #[serde(rename = "badge_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub badge_count: Option>, - #[serde(rename = "download_count", skip_serializing_if = "Option::is_none")] - pub download_count: Option, #[serde(rename = "created", skip_serializing_if = "Option::is_none")] pub created: Option, #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -56,10 +40,10 @@ pub struct Application { } impl Application { - pub fn new() -> Application { + pub fn new(name: Option) -> Application { Application { id: None, - name: None, + name, description: None, r#type: None, organization_id: None, @@ -67,15 +51,7 @@ impl Application { banner_url: None, capsule_image_url: None, library_image_url: None, - parent_id: None, slug: None, - visibility: None, - password: None, - primary: None, - user_count: None, - achievement_count: None, - badge_count: None, - download_count: None, created: None, updated: None, } diff --git a/src/models/application_type.rs b/src/models/application_type.rs index 7f0d437..8ebebfc 100644 --- a/src/models/application_type.rs +++ b/src/models/application_type.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/authorize_request.rs b/src/models/authorize_request.rs index 59ec297..f2d34ff 100644 --- a/src/models/authorize_request.rs +++ b/src/models/authorize_request.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -15,14 +15,14 @@ use serde::{Deserialize, Serialize}; pub struct AuthorizeRequest { #[serde(rename = "response_type", skip_serializing_if = "Option::is_none")] pub response_type: Option, - #[serde(rename = "client_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub client_id: Option>, + #[serde(rename = "client_id")] + pub client_id: String, #[serde(rename = "code_challenge", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub code_challenge: Option>, #[serde(rename = "code_challenge_method", skip_serializing_if = "Option::is_none")] pub code_challenge_method: Option, - #[serde(rename = "redirect_uri", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub redirect_uri: Option>, + #[serde(rename = "redirect_uri", deserialize_with = "Option::deserialize")] + pub redirect_uri: Option, #[serde(rename = "scope", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub scope: Option>, #[serde(rename = "state", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -30,13 +30,13 @@ pub struct AuthorizeRequest { } impl AuthorizeRequest { - pub fn new() -> AuthorizeRequest { + pub fn new(client_id: String, redirect_uri: Option) -> AuthorizeRequest { AuthorizeRequest { response_type: None, - client_id: None, + client_id, code_challenge: None, code_challenge_method: None, - redirect_uri: None, + redirect_uri, scope: None, state: None, } diff --git a/src/models/client.rs b/src/models/client.rs new file mode 100644 index 0000000..3eaa25d --- /dev/null +++ b/src/models/client.rs @@ -0,0 +1,63 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Client { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "organization_id", skip_serializing_if = "Option::is_none")] + pub organization_id: Option, + #[serde(rename = "trusted", skip_serializing_if = "Option::is_none")] + pub trusted: Option, + #[serde(rename = "website_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub website_url: Option>, + #[serde(rename = "photo_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub photo_url: Option>, + #[serde(rename = "background_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub background_url: Option>, + #[serde(rename = "redirects", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub redirects: Option>, + #[serde(rename = "scopes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub scopes: Option>, + #[serde(rename = "permissions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub permissions: Option>>, + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub updated: Option>, +} + +impl Client { + pub fn new(name: Option) -> Client { + Client { + id: None, + name, + r#type: None, + organization_id: None, + trusted: None, + website_url: None, + photo_url: None, + background_url: None, + redirects: None, + scopes: None, + permissions: None, + created: None, + updated: None, + } + } +} + diff --git a/src/models/client_info.rs b/src/models/client_info.rs new file mode 100644 index 0000000..38d4de7 --- /dev/null +++ b/src/models/client_info.rs @@ -0,0 +1,39 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientInfo { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "photo_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub photo_url: Option>, + #[serde(rename = "permissions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub permissions: Option>>, +} + +impl ClientInfo { + pub fn new(name: Option) -> ClientInfo { + ClientInfo { + id: None, + name, + r#type: None, + photo_url: None, + permissions: None, + } + } +} + diff --git a/src/models/client_type.rs b/src/models/client_type.rs new file mode 100644 index 0000000..706e98e --- /dev/null +++ b/src/models/client_type.rs @@ -0,0 +1,41 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ClientType { + #[serde(rename = "web")] + Web, + #[serde(rename = "desktop")] + Desktop, + #[serde(rename = "mobile")] + Mobile, + +} + +impl std::fmt::Display for ClientType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Web => write!(f, "web"), + Self::Desktop => write!(f, "desktop"), + Self::Mobile => write!(f, "mobile"), + } + } +} + +impl Default for ClientType { + fn default() -> ClientType { + Self::Web + } +} + diff --git a/src/models/code_challenge_method.rs b/src/models/code_challenge_method.rs index 6279001..c5cf5d3 100644 --- a/src/models/code_challenge_method.rs +++ b/src/models/code_challenge_method.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/code_response.rs b/src/models/code_response.rs new file mode 100644 index 0000000..329dc13 --- /dev/null +++ b/src/models/code_response.rs @@ -0,0 +1,30 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CodeResponse { + #[serde(rename = "code", deserialize_with = "Option::deserialize")] + pub code: Option, + #[serde(rename = "state", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub state: Option>, +} + +impl CodeResponse { + pub fn new(code: Option) -> CodeResponse { + CodeResponse { + code, + state: None, + } + } +} + diff --git a/src/models/create_user.rs b/src/models/create_user.rs new file mode 100644 index 0000000..aaee70d --- /dev/null +++ b/src/models/create_user.rs @@ -0,0 +1,51 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateUser { + #[serde(rename = "uuid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub uuid: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "display_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub display_name: Option>, + #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub email: Option>, + #[serde(rename = "password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub password: Option>, + #[serde(rename = "language", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub language: Option>, + #[serde(rename = "timezone", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub timezone: Option>, + #[serde(rename = "currency", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub currency: Option>, + #[serde(rename = "ip_address", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub ip_address: Option>, +} + +impl CreateUser { + pub fn new(name: String) -> CreateUser { + CreateUser { + uuid: None, + name, + display_name: None, + email: None, + password: None, + language: None, + timezone: None, + currency: None, + ip_address: None, + } + } +} + diff --git a/src/models/crypto_view_model.rs b/src/models/crypto_view_model.rs index b3bf759..c6225e1 100644 --- a/src/models/crypto_view_model.rs +++ b/src/models/crypto_view_model.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/game.rs b/src/models/game.rs index 5a0a010..d1f6854 100644 --- a/src/models/game.rs +++ b/src/models/game.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -13,32 +13,10 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Game { - #[serde(rename = "game_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub game_port: Option>, - #[serde(rename = "query_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub query_port: Option>, - #[serde(rename = "rcon_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub rcon_port: Option>, - #[serde(rename = "server_count", skip_serializing_if = "Option::is_none")] - pub server_count: Option, - #[serde(rename = "steam_app_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub steam_app_id: Option>, - #[serde(rename = "steam_server_app_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub steam_server_app_id: Option>, - #[serde(rename = "enable_servers", skip_serializing_if = "Option::is_none")] - pub enable_servers: Option, - #[serde(rename = "rust_gamedig_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub rust_gamedig_id: Option>, - #[serde(rename = "node_gamedig_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub node_gamedig_id: Option>, - #[serde(rename = "server_connect_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub server_connect_url: Option>, - #[serde(rename = "server_tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub server_tags: Option>, #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, - #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub name: Option>, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub description: Option>, #[serde(rename = "type", skip_serializing_if = "Option::is_none")] @@ -53,46 +31,33 @@ pub struct Game { pub capsule_image_url: Option>, #[serde(rename = "library_image_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub library_image_url: Option>, - #[serde(rename = "parent_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub parent_id: Option>, #[serde(rename = "slug", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub slug: Option>, - #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] - pub visibility: Option, - #[serde(rename = "password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub password: Option>, - #[serde(rename = "primary", skip_serializing_if = "Option::is_none")] - pub primary: Option, - #[serde(rename = "user_count", skip_serializing_if = "Option::is_none")] - pub user_count: Option, - #[serde(rename = "achievement_count", skip_serializing_if = "Option::is_none")] - pub achievement_count: Option, - #[serde(rename = "badge_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub badge_count: Option>, - #[serde(rename = "download_count", skip_serializing_if = "Option::is_none")] - pub download_count: Option, #[serde(rename = "created", skip_serializing_if = "Option::is_none")] pub created: Option, #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub updated: Option>, + #[serde(rename = "enable_servers", skip_serializing_if = "Option::is_none")] + pub enable_servers: Option, + #[serde(rename = "game_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub game_port: Option>, + #[serde(rename = "query_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub query_port: Option>, + #[serde(rename = "rcon_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub rcon_port: Option>, + #[serde(rename = "gamedig_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub gamedig_id: Option>, + #[serde(rename = "steam_app_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub steam_app_id: Option>, + #[serde(rename = "steam_server_app_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub steam_server_app_id: Option>, } impl Game { - pub fn new() -> Game { + pub fn new(name: Option) -> Game { Game { - game_port: None, - query_port: None, - rcon_port: None, - server_count: None, - steam_app_id: None, - steam_server_app_id: None, - enable_servers: None, - rust_gamedig_id: None, - node_gamedig_id: None, - server_connect_url: None, - server_tags: None, id: None, - name: None, + name, description: None, r#type: None, organization_id: None, @@ -100,17 +65,16 @@ impl Game { banner_url: None, capsule_image_url: None, library_image_url: None, - parent_id: None, slug: None, - visibility: None, - password: None, - primary: None, - user_count: None, - achievement_count: None, - badge_count: None, - download_count: None, created: None, updated: None, + enable_servers: None, + game_port: None, + query_port: None, + rcon_port: None, + gamedig_id: None, + steam_app_id: None, + steam_server_app_id: None, } } } diff --git a/src/models/game_server.rs b/src/models/game_server.rs index 7d1026f..361d373 100644 --- a/src/models/game_server.rs +++ b/src/models/game_server.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -15,50 +15,34 @@ use serde::{Deserialize, Serialize}; pub struct GameServer { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, - #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub name: Option>, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub description: Option>, - #[serde(rename = "address", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub address: Option>, + #[serde(rename = "owner_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub owner_id: Option>, + #[serde(rename = "address", deserialize_with = "Option::deserialize")] + pub address: Option, + #[serde(rename = "query_port")] + pub query_port: i32, #[serde(rename = "game_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub game_port: Option>, - #[serde(rename = "query_port", skip_serializing_if = "Option::is_none")] - pub query_port: Option, + #[serde(rename = "map", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub map: Option>, + #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub version: Option>, #[serde(rename = "game_id", skip_serializing_if = "Option::is_none")] pub game_id: Option, #[serde(rename = "game_icon_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub game_icon_url: Option>, - #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub version: Option>, - #[serde(rename = "featured", skip_serializing_if = "Option::is_none")] - pub featured: Option, #[serde(rename = "cluster_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub cluster_id: Option>, #[serde(rename = "website_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub website_url: Option>, #[serde(rename = "banner_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub banner_url: Option>, - #[serde(rename = "owner_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub owner_id: Option>, #[serde(rename = "uptime", skip_serializing_if = "Option::is_none")] pub uptime: Option, - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - #[serde(rename = "ping", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub ping: Option>, - #[serde(rename = "map", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub map: Option>, - #[serde(rename = "used_slots", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub used_slots: Option>, - #[serde(rename = "max_slots", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub max_slots: Option>, - #[serde(rename = "motd", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub motd: Option>, - #[serde(rename = "players", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub players: Option>, - #[serde(rename = "last_online", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub last_online: Option>, #[serde(rename = "country", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub country: Option>, #[serde(rename = "steam", skip_serializing_if = "Option::is_none")] @@ -67,10 +51,6 @@ pub struct GameServer { pub discord_server_id: Option>, #[serde(rename = "youtube_video_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub youtube_video_url: Option>, - #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub tags: Option>, - #[serde(rename = "comment_count", skip_serializing_if = "Option::is_none")] - pub comment_count: Option, #[serde(rename = "created", skip_serializing_if = "Option::is_none")] pub created: Option, #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -78,37 +58,27 @@ pub struct GameServer { } impl GameServer { - pub fn new() -> GameServer { + pub fn new(name: Option, address: Option, query_port: i32) -> GameServer { GameServer { id: None, - name: None, + name, description: None, - address: None, + owner_id: None, + address, + query_port, game_port: None, - query_port: None, + map: None, + version: None, game_id: None, game_icon_url: None, - version: None, - featured: None, cluster_id: None, website_url: None, banner_url: None, - owner_id: None, uptime: None, - status: None, - ping: None, - map: None, - used_slots: None, - max_slots: None, - motd: None, - players: None, - last_online: None, country: None, steam: None, discord_server_id: None, youtube_video_url: None, - tags: None, - comment_count: None, created: None, updated: None, } diff --git a/src/models/game_server_cluster.rs b/src/models/game_server_cluster.rs index 7ab5c67..609bf8e 100644 --- a/src/models/game_server_cluster.rs +++ b/src/models/game_server_cluster.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -15,8 +15,8 @@ use serde::{Deserialize, Serialize}; pub struct GameServerCluster { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, - #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub name: Option>, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub description: Option>, #[serde(rename = "game_id", skip_serializing_if = "Option::is_none")] @@ -44,10 +44,10 @@ pub struct GameServerCluster { } impl GameServerCluster { - pub fn new() -> GameServerCluster { + pub fn new(name: Option) -> GameServerCluster { GameServerCluster { id: None, - name: None, + name, description: None, game_id: None, website_url: None, diff --git a/src/models/game_server_query.rs b/src/models/game_server_query.rs new file mode 100644 index 0000000..523af11 --- /dev/null +++ b/src/models/game_server_query.rs @@ -0,0 +1,48 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GameServerQuery { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "server_id", skip_serializing_if = "Option::is_none")] + pub server_id: Option, + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "ping", skip_serializing_if = "Option::is_none")] + pub ping: Option, + #[serde(rename = "current_players", skip_serializing_if = "Option::is_none")] + pub current_players: Option, + #[serde(rename = "max_players", skip_serializing_if = "Option::is_none")] + pub max_players: Option, + #[serde(rename = "motd", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub motd: Option>, + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, +} + +impl GameServerQuery { + pub fn new() -> GameServerQuery { + GameServerQuery { + id: None, + server_id: None, + status: None, + ping: None, + current_players: None, + max_players: None, + motd: None, + created: None, + } + } +} + diff --git a/src/models/server_status.rs b/src/models/game_server_status.rs similarity index 75% rename from src/models/server_status.rs rename to src/models/game_server_status.rs index dcf32c3..72ab6e4 100644 --- a/src/models/server_status.rs +++ b/src/models/game_server_status.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServerStatus { +pub enum GameServerStatus { #[serde(rename = "unknown")] Unknown, #[serde(rename = "offline")] @@ -23,7 +23,7 @@ pub enum ServerStatus { } -impl std::fmt::Display for ServerStatus { +impl std::fmt::Display for GameServerStatus { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::Unknown => write!(f, "unknown"), @@ -33,8 +33,8 @@ impl std::fmt::Display for ServerStatus { } } -impl Default for ServerStatus { - fn default() -> ServerStatus { +impl Default for GameServerStatus { + fn default() -> GameServerStatus { Self::Unknown } } diff --git a/src/models/grant_type.rs b/src/models/grant_type.rs index 25efa8b..268b807 100644 --- a/src/models/grant_type.rs +++ b/src/models/grant_type.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/group.rs b/src/models/group.rs index 76b96b2..d0c6658 100644 --- a/src/models/group.rs +++ b/src/models/group.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -17,8 +17,8 @@ pub struct Group { pub id: Option, #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] pub uuid: Option, - #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub name: Option>, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, #[serde(rename = "tag", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub tag: Option>, #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -48,11 +48,11 @@ pub struct Group { } impl Group { - pub fn new() -> Group { + pub fn new(name: Option) -> Group { Group { id: None, uuid: None, - name: None, + name, tag: None, description: None, r#type: None, diff --git a/src/models/group_game.rs b/src/models/group_application.rs similarity index 79% rename from src/models/group_game.rs rename to src/models/group_application.rs index 30a2504..755d67e 100644 --- a/src/models/group_game.rs +++ b/src/models/group_application.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -12,9 +12,9 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupGame { - #[serde(rename = "group_id", skip_serializing_if = "Option::is_none")] - pub group_id: Option, +pub struct GroupApplication { + #[serde(rename = "group_id")] + pub group_id: String, #[serde(rename = "group", skip_serializing_if = "Option::is_none")] pub group: Option>, #[serde(rename = "application_id", skip_serializing_if = "Option::is_none")] @@ -29,10 +29,10 @@ pub struct GroupGame { pub last_used: Option>, } -impl GroupGame { - pub fn new() -> GroupGame { - GroupGame { - group_id: None, +impl GroupApplication { + pub fn new(group_id: String) -> GroupApplication { + GroupApplication { + group_id, group: None, application_id: None, application: None, diff --git a/src/models/group_member.rs b/src/models/group_member.rs index 54349cb..8817f07 100644 --- a/src/models/group_member.rs +++ b/src/models/group_member.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/group_rank.rs b/src/models/group_rank.rs index 8781fdf..f24e031 100644 --- a/src/models/group_rank.rs +++ b/src/models/group_rank.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/hash_view_model.rs b/src/models/hash_view_model.rs index 0fb0ed1..c68de1d 100644 --- a/src/models/hash_view_model.rs +++ b/src/models/hash_view_model.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -13,14 +13,14 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct HashViewModel { - #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub value: Option>, + #[serde(rename = "value", deserialize_with = "Option::deserialize")] + pub value: Option, } impl HashViewModel { - pub fn new() -> HashViewModel { + pub fn new(value: Option) -> HashViewModel { HashViewModel { - value: None, + value, } } } diff --git a/src/models/introspect_request.rs b/src/models/introspect_request.rs index 8b55f4e..fe0cd00 100644 --- a/src/models/introspect_request.rs +++ b/src/models/introspect_request.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -13,17 +13,17 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct IntrospectRequest { - #[serde(rename = "token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub token: Option>, - #[serde(rename = "token_type_hint", skip_serializing_if = "Option::is_none")] - pub token_type_hint: Option, + #[serde(rename = "token", deserialize_with = "Option::deserialize")] + pub token: Option, + #[serde(rename = "token_type_hint")] + pub token_type_hint: models::TokenHintType, } impl IntrospectRequest { - pub fn new() -> IntrospectRequest { + pub fn new(token: Option, token_type_hint: models::TokenHintType) -> IntrospectRequest { IntrospectRequest { - token: None, - token_type_hint: None, + token, + token_type_hint, } } } diff --git a/src/models/introspect_response.rs b/src/models/introspect_response.rs new file mode 100644 index 0000000..6aa4650 --- /dev/null +++ b/src/models/introspect_response.rs @@ -0,0 +1,60 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IntrospectResponse { + #[serde(rename = "jti", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub jti: Option>, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "token_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub token_type: Option>, + #[serde(rename = "client_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub client_id: Option>, + #[serde(rename = "sub", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sub: Option>, + #[serde(rename = "username", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub username: Option>, + #[serde(rename = "scope", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub scope: Option>, + #[serde(rename = "iss", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub iss: Option>, + #[serde(rename = "aud", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub aud: Option>, + #[serde(rename = "iat", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub iat: Option>, + #[serde(rename = "exp", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub exp: Option>, + #[serde(rename = "nbf", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub nbf: Option>, +} + +impl IntrospectResponse { + pub fn new() -> IntrospectResponse { + IntrospectResponse { + jti: None, + active: None, + token_type: None, + client_id: None, + sub: None, + username: None, + scope: None, + iss: None, + aud: None, + iat: None, + exp: None, + nbf: None, + } + } +} + diff --git a/src/models/ip_address.rs b/src/models/ip_address.rs index 01db6ba..8f5b28e 100644 --- a/src/models/ip_address.rs +++ b/src/models/ip_address.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -21,6 +21,8 @@ pub struct IpAddress { pub network: Option>, #[serde(rename = "reserved", skip_serializing_if = "Option::is_none")] pub reserved: Option, + #[serde(rename = "banned", skip_serializing_if = "Option::is_none")] + pub banned: Option, #[serde(rename = "asn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub asn: Option>, #[serde(rename = "isp", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -29,8 +31,8 @@ pub struct IpAddress { pub continent: Option>, #[serde(rename = "country", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub country: Option>, - #[serde(rename = "region", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub region: Option>, + #[serde(rename = "province", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub province: Option>, #[serde(rename = "city", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub city: Option>, #[serde(rename = "postal_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -58,11 +60,12 @@ impl IpAddress { version: None, network: None, reserved: None, + banned: None, asn: None, isp: None, continent: None, country: None, - region: None, + province: None, city: None, postal_code: None, calling_code: None, diff --git a/src/models/leaderboard_item.rs b/src/models/leaderboard_item.rs index 3bbfa7e..645487d 100644 --- a/src/models/leaderboard_item.rs +++ b/src/models/leaderboard_item.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/leaderboard_order.rs b/src/models/leaderboard_order.rs index a705d2a..951684d 100644 --- a/src/models/leaderboard_order.rs +++ b/src/models/leaderboard_order.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/login_provider.rs b/src/models/login_provider.rs index c358bda..9c965fa 100644 --- a/src/models/login_provider.rs +++ b/src/models/login_provider.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/login_request.rs b/src/models/login_request.rs deleted file mode 100644 index 8665e6a..0000000 --- a/src/models/login_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Tribufu API - * - * REST API to access Tribufu services. - * - * The version of the OpenAPI document: 1.1.0 - * Contact: contact@tribufu.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LoginRequest { - #[serde(rename = "login", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub login: Option>, - #[serde(rename = "password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub password: Option>, -} - -impl LoginRequest { - pub fn new() -> LoginRequest { - LoginRequest { - login: None, - password: None, - } - } -} - diff --git a/src/models/login_response.rs b/src/models/login_response.rs deleted file mode 100644 index f816e09..0000000 --- a/src/models/login_response.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Tribufu API - * - * REST API to access Tribufu services. - * - * The version of the OpenAPI document: 1.1.0 - * Contact: contact@tribufu.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LoginResponse { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option>, - #[serde(rename = "access_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub access_token: Option>, - #[serde(rename = "refresh_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub refresh_token: Option>, - #[serde(rename = "expires_in", skip_serializing_if = "Option::is_none")] - pub expires_in: Option, -} - -impl LoginResponse { - pub fn new() -> LoginResponse { - LoginResponse { - user: None, - access_token: None, - refresh_token: None, - expires_in: None, - } - } -} - diff --git a/src/models/mod.rs b/src/models/mod.rs index f1e76a9..b1d4faf 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -6,8 +6,18 @@ pub mod application_type; pub use self::application_type::ApplicationType; pub mod authorize_request; pub use self::authorize_request::AuthorizeRequest; +pub mod client; +pub use self::client::Client; +pub mod client_info; +pub use self::client_info::ClientInfo; +pub mod client_type; +pub use self::client_type::ClientType; pub mod code_challenge_method; pub use self::code_challenge_method::CodeChallengeMethod; +pub mod code_response; +pub use self::code_response::CodeResponse; +pub mod create_user; +pub use self::create_user::CreateUser; pub mod crypto_view_model; pub use self::crypto_view_model::CryptoViewModel; pub mod game; @@ -16,12 +26,16 @@ pub mod game_server; pub use self::game_server::GameServer; pub mod game_server_cluster; pub use self::game_server_cluster::GameServerCluster; +pub mod game_server_query; +pub use self::game_server_query::GameServerQuery; +pub mod game_server_status; +pub use self::game_server_status::GameServerStatus; pub mod grant_type; pub use self::grant_type::GrantType; pub mod group; pub use self::group::Group; -pub mod group_game; -pub use self::group_game::GroupGame; +pub mod group_application; +pub use self::group_application::GroupApplication; pub mod group_member; pub use self::group_member::GroupMember; pub mod group_rank; @@ -30,6 +44,8 @@ pub mod hash_view_model; pub use self::hash_view_model::HashViewModel; pub mod introspect_request; pub use self::introspect_request::IntrospectRequest; +pub mod introspect_response; +pub use self::introspect_response::IntrospectResponse; pub mod ip_address; pub use self::ip_address::IpAddress; pub mod leaderboard_item; @@ -38,36 +54,34 @@ pub mod leaderboard_order; pub use self::leaderboard_order::LeaderboardOrder; pub mod login_provider; pub use self::login_provider::LoginProvider; -pub mod login_request; -pub use self::login_request::LoginRequest; -pub mod login_response; -pub use self::login_response::LoginResponse; pub mod package; pub use self::package::Package; +pub mod package_release; +pub use self::package_release::PackageRelease; +pub mod product; +pub use self::product::Product; +pub mod product_price; +pub use self::product_price::ProductPrice; +pub mod product_type; +pub use self::product_type::ProductType; pub mod profile; pub use self::profile::Profile; pub mod profile_game; pub use self::profile_game::ProfileGame; pub mod profile_group; pub use self::profile_group::ProfileGroup; -pub mod refresh_request; -pub use self::refresh_request::RefreshRequest; -pub mod register_request; -pub use self::register_request::RegisterRequest; pub mod response_type; pub use self::response_type::ResponseType; pub mod revoke_request; pub use self::revoke_request::RevokeRequest; -pub mod search_request; -pub use self::search_request::SearchRequest; +pub mod search; +pub use self::search::Search; pub mod search_type; pub use self::search_type::SearchType; pub mod server_metrics; pub use self::server_metrics::ServerMetrics; -pub mod server_status; -pub use self::server_status::ServerStatus; -pub mod subscription; -pub use self::subscription::Subscription; +pub mod storage_file; +pub use self::storage_file::StorageFile; pub mod token_hint_type; pub use self::token_hint_type::TokenHintType; pub mod token_request; diff --git a/src/models/package.rs b/src/models/package.rs index 0d8e0b1..ccc916a 100644 --- a/src/models/package.rs +++ b/src/models/package.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -15,24 +15,24 @@ use serde::{Deserialize, Serialize}; pub struct Package { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, - #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub name: Option>, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub description: Option>, - #[serde(rename = "image_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub image_url: Option>, #[serde(rename = "author_id", skip_serializing_if = "Option::is_none")] pub author_id: Option, - #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub version: Option>, - #[serde(rename = "file_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub file_url: Option>, - #[serde(rename = "raw_size", skip_serializing_if = "Option::is_none")] - pub raw_size: Option, + #[serde(rename = "image_url", deserialize_with = "Option::deserialize")] + pub image_url: Option, + #[serde(rename = "application_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub application_id: Option>, + #[serde(rename = "category_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category_id: Option>, #[serde(rename = "download_count", skip_serializing_if = "Option::is_none")] pub download_count: Option, #[serde(rename = "last_download", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub last_download: Option>, + #[serde(rename = "releases", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub releases: Option>>, #[serde(rename = "created", skip_serializing_if = "Option::is_none")] pub created: Option, #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -40,18 +40,18 @@ pub struct Package { } impl Package { - pub fn new() -> Package { + pub fn new(name: Option, image_url: Option) -> Package { Package { id: None, - name: None, + name, description: None, - image_url: None, author_id: None, - version: None, - file_url: None, - raw_size: None, + image_url, + application_id: None, + category_id: None, download_count: None, last_download: None, + releases: None, created: None, updated: None, } diff --git a/src/models/package_release.rs b/src/models/package_release.rs new file mode 100644 index 0000000..6df4da8 --- /dev/null +++ b/src/models/package_release.rs @@ -0,0 +1,45 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PackageRelease { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "version", deserialize_with = "Option::deserialize")] + pub version: Option, + #[serde(rename = "package_id", skip_serializing_if = "Option::is_none")] + pub package_id: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "files", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub files: Option>>, + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub updated: Option>, +} + +impl PackageRelease { + pub fn new(version: Option) -> PackageRelease { + PackageRelease { + id: None, + version, + package_id: None, + notes: None, + files: None, + created: None, + updated: None, + } + } +} + diff --git a/src/models/subscription.rs b/src/models/product.rs similarity index 63% rename from src/models/subscription.rs rename to src/models/product.rs index c5d876f..884b025 100644 --- a/src/models/subscription.rs +++ b/src/models/product.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -12,30 +12,39 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Subscription { +pub struct Product { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, - #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub name: Option>, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub description: Option>, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "slug", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub slug: Option>, #[serde(rename = "image_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub image_url: Option>, + #[serde(rename = "is_physical", skip_serializing_if = "Option::is_none")] + pub is_physical: Option, #[serde(rename = "prices", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub prices: Option>>, + pub prices: Option>>, #[serde(rename = "created", skip_serializing_if = "Option::is_none")] pub created: Option, #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub updated: Option>, } -impl Subscription { - pub fn new() -> Subscription { - Subscription { +impl Product { + pub fn new(name: Option) -> Product { + Product { id: None, - name: None, + name, description: None, + r#type: None, + slug: None, image_url: None, + is_physical: None, prices: None, created: None, updated: None, diff --git a/src/models/product_price.rs b/src/models/product_price.rs new file mode 100644 index 0000000..69d1254 --- /dev/null +++ b/src/models/product_price.rs @@ -0,0 +1,33 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProductPrice { + #[serde(rename = "currency", deserialize_with = "Option::deserialize")] + pub currency: Option, + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(rename = "renewal", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub renewal: Option>, +} + +impl ProductPrice { + pub fn new(currency: Option) -> ProductPrice { + ProductPrice { + currency, + amount: None, + renewal: None, + } + } +} + diff --git a/src/models/product_type.rs b/src/models/product_type.rs new file mode 100644 index 0000000..1a41f51 --- /dev/null +++ b/src/models/product_type.rs @@ -0,0 +1,38 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ProductType { + #[serde(rename = "product")] + Product, + #[serde(rename = "subscription")] + Subscription, + +} + +impl std::fmt::Display for ProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Product => write!(f, "product"), + Self::Subscription => write!(f, "subscription"), + } + } +} + +impl Default for ProductType { + fn default() -> ProductType { + Self::Product + } +} + diff --git a/src/models/profile.rs b/src/models/profile.rs index d44904a..d7cdc13 100644 --- a/src/models/profile.rs +++ b/src/models/profile.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/profile_game.rs b/src/models/profile_game.rs index 14861c8..3d6d978 100644 --- a/src/models/profile_game.rs +++ b/src/models/profile_game.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/profile_group.rs b/src/models/profile_group.rs index 7b55912..82c4042 100644 --- a/src/models/profile_group.rs +++ b/src/models/profile_group.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/refresh_request.rs b/src/models/refresh_request.rs deleted file mode 100644 index dda194c..0000000 --- a/src/models/refresh_request.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Tribufu API - * - * REST API to access Tribufu services. - * - * The version of the OpenAPI document: 1.1.0 - * Contact: contact@tribufu.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RefreshRequest { - #[serde(rename = "refresh_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub refresh_token: Option>, -} - -impl RefreshRequest { - pub fn new() -> RefreshRequest { - RefreshRequest { - refresh_token: None, - } - } -} - diff --git a/src/models/register_request.rs b/src/models/register_request.rs deleted file mode 100644 index 7b5fda8..0000000 --- a/src/models/register_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Tribufu API - * - * REST API to access Tribufu services. - * - * The version of the OpenAPI document: 1.1.0 - * Contact: contact@tribufu.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegisterRequest { - #[serde(rename = "uuid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub uuid: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub email: Option>, - #[serde(rename = "password")] - pub password: String, -} - -impl RegisterRequest { - pub fn new(name: String, password: String) -> RegisterRequest { - RegisterRequest { - uuid: None, - name, - email: None, - password, - } - } -} - diff --git a/src/models/response_type.rs b/src/models/response_type.rs index 217d266..ea9a73c 100644 --- a/src/models/response_type.rs +++ b/src/models/response_type.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/revoke_request.rs b/src/models/revoke_request.rs index 4e27b96..84fdb0e 100644 --- a/src/models/revoke_request.rs +++ b/src/models/revoke_request.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -13,17 +13,17 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RevokeRequest { - #[serde(rename = "token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub token: Option>, - #[serde(rename = "token_type_hint", skip_serializing_if = "Option::is_none")] - pub token_type_hint: Option, + #[serde(rename = "token", deserialize_with = "Option::deserialize")] + pub token: Option, + #[serde(rename = "token_type_hint")] + pub token_type_hint: models::TokenHintType, } impl RevokeRequest { - pub fn new() -> RevokeRequest { + pub fn new(token: Option, token_type_hint: models::TokenHintType) -> RevokeRequest { RevokeRequest { - token: None, - token_type_hint: None, + token, + token_type_hint, } } } diff --git a/src/models/search_request.rs b/src/models/search.rs similarity index 54% rename from src/models/search_request.rs rename to src/models/search.rs index c80a894..880ad86 100644 --- a/src/models/search_request.rs +++ b/src/models/search.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -12,22 +12,22 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SearchRequest { - #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub r#type: Option, - #[serde(rename = "query", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub query: Option>, +pub struct Search { + #[serde(rename = "type")] + pub r#type: models::SearchType, + #[serde(rename = "query", deserialize_with = "Option::deserialize")] + pub query: Option, #[serde(rename = "page", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub page: Option>, #[serde(rename = "game_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub game_id: Option>, } -impl SearchRequest { - pub fn new() -> SearchRequest { - SearchRequest { - r#type: None, - query: None, +impl Search { + pub fn new(r#type: models::SearchType, query: Option) -> Search { + Search { + r#type, + query, page: None, game_id: None, } diff --git a/src/models/search_type.rs b/src/models/search_type.rs index 2d936a5..d5793a0 100644 --- a/src/models/search_type.rs +++ b/src/models/search_type.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -18,10 +18,10 @@ pub enum SearchType { User, #[serde(rename = "group")] Group, - #[serde(rename = "server")] - Server, - #[serde(rename = "cluster")] - Cluster, + #[serde(rename = "game_server")] + GameServer, + #[serde(rename = "game_server_cluster")] + GameServerCluster, } @@ -30,8 +30,8 @@ impl std::fmt::Display for SearchType { match self { Self::User => write!(f, "user"), Self::Group => write!(f, "group"), - Self::Server => write!(f, "server"), - Self::Cluster => write!(f, "cluster"), + Self::GameServer => write!(f, "game_server"), + Self::GameServerCluster => write!(f, "game_server_cluster"), } } } diff --git a/src/models/server_metrics.rs b/src/models/server_metrics.rs index 77a70ba..3e7c5fd 100644 --- a/src/models/server_metrics.rs +++ b/src/models/server_metrics.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/storage_file.rs b/src/models/storage_file.rs new file mode 100644 index 0000000..2cde85e --- /dev/null +++ b/src/models/storage_file.rs @@ -0,0 +1,51 @@ +/* + * Tribufu API + * + * API to access Tribufu services. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: contact@tribufu.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct StorageFile { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, + #[serde(rename = "content_type", deserialize_with = "Option::deserialize")] + pub content_type: Option, + #[serde(rename = "url", deserialize_with = "Option::deserialize")] + pub url: Option, + #[serde(rename = "size", skip_serializing_if = "Option::is_none")] + pub size: Option, + #[serde(rename = "hash", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub hash: Option>, + #[serde(rename = "etag", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub etag: Option>, + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub updated: Option>, +} + +impl StorageFile { + pub fn new(name: Option, content_type: Option, url: Option) -> StorageFile { + StorageFile { + id: None, + name, + content_type, + url, + size: None, + hash: None, + etag: None, + created: None, + updated: None, + } + } +} + diff --git a/src/models/token_hint_type.rs b/src/models/token_hint_type.rs index c1875a1..672b623 100644 --- a/src/models/token_hint_type.rs +++ b/src/models/token_hint_type.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/token_request.rs b/src/models/token_request.rs index 7f05d62..20625d1 100644 --- a/src/models/token_request.rs +++ b/src/models/token_request.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -23,8 +23,6 @@ pub struct TokenRequest { pub password: Option>, #[serde(rename = "refresh_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub refresh_token: Option>, - #[serde(rename = "client_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub client_id: Option>, #[serde(rename = "redirect_uri", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub redirect_uri: Option>, #[serde(rename = "code_verifier", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -39,7 +37,6 @@ impl TokenRequest { username: None, password: None, refresh_token: None, - client_id: None, redirect_uri: None, code_verifier: None, } diff --git a/src/models/token_response.rs b/src/models/token_response.rs index 0a0bebb..1bc1a52 100644 --- a/src/models/token_response.rs +++ b/src/models/token_response.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -13,10 +13,10 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TokenResponse { - #[serde(rename = "token_type", skip_serializing_if = "Option::is_none")] - pub token_type: Option, - #[serde(rename = "access_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub access_token: Option>, + #[serde(rename = "token_type")] + pub token_type: models::TokenType, + #[serde(rename = "access_token", deserialize_with = "Option::deserialize")] + pub access_token: Option, #[serde(rename = "refresh_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub refresh_token: Option>, #[serde(rename = "scope", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -28,10 +28,10 @@ pub struct TokenResponse { } impl TokenResponse { - pub fn new() -> TokenResponse { + pub fn new(token_type: models::TokenType, access_token: Option) -> TokenResponse { TokenResponse { - token_type: None, - access_token: None, + token_type, + access_token, refresh_token: None, scope: None, state: None, diff --git a/src/models/token_type.rs b/src/models/token_type.rs index fda55ca..9952b32 100644 --- a/src/models/token_type.rs +++ b/src/models/token_type.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/update_profile.rs b/src/models/update_profile.rs index 6b025dc..0e18e8f 100644 --- a/src/models/update_profile.rs +++ b/src/models/update_profile.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -13,16 +13,16 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateProfile { - #[serde(rename = "display_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub display_name: Option>, + #[serde(rename = "display_name", deserialize_with = "Option::deserialize")] + pub display_name: Option, #[serde(rename = "biography", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub biography: Option>, } impl UpdateProfile { - pub fn new() -> UpdateProfile { + pub fn new(display_name: Option) -> UpdateProfile { UpdateProfile { - display_name: None, + display_name, biography: None, } } diff --git a/src/models/user_info.rs b/src/models/user_info.rs index e81dadb..7d2a3c6 100644 --- a/src/models/user_info.rs +++ b/src/models/user_info.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ @@ -17,32 +17,16 @@ pub struct UserInfo { pub id: Option, #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] pub uuid: Option, - #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub name: Option>, + #[serde(rename = "name", deserialize_with = "Option::deserialize")] + pub name: Option, #[serde(rename = "display_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub display_name: Option>, #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub email: Option>, + #[serde(rename = "email_verified", skip_serializing_if = "Option::is_none")] + pub email_verified: Option, #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, - #[serde(rename = "flags", skip_serializing_if = "Option::is_none")] - pub flags: Option, - #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option, - #[serde(rename = "verified", skip_serializing_if = "Option::is_none")] - pub verified: Option, - #[serde(rename = "level", skip_serializing_if = "Option::is_none")] - pub level: Option, - #[serde(rename = "experience", skip_serializing_if = "Option::is_none")] - pub experience: Option, - #[serde(rename = "public_birthday", skip_serializing_if = "Option::is_none")] - pub public_birthday: Option, - #[serde(rename = "birthday", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub birthday: Option>, - #[serde(rename = "points", skip_serializing_if = "Option::is_none")] - pub points: Option, - #[serde(rename = "location", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub location: Option>, #[serde(rename = "language", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub language: Option>, #[serde(rename = "timezone", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -51,14 +35,8 @@ pub struct UserInfo { pub currency: Option>, #[serde(rename = "photo_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub photo_url: Option>, - #[serde(rename = "banner_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub banner_url: Option>, - #[serde(rename = "last_online", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub last_online: Option>, - #[serde(rename = "biography", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub biography: Option>, - #[serde(rename = "view_count", skip_serializing_if = "Option::is_none")] - pub view_count: Option, + #[serde(rename = "permissions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub permissions: Option>>, #[serde(rename = "created", skip_serializing_if = "Option::is_none")] pub created: Option, #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -66,31 +44,20 @@ pub struct UserInfo { } impl UserInfo { - pub fn new() -> UserInfo { + pub fn new(name: Option) -> UserInfo { UserInfo { id: None, uuid: None, - name: None, + name, display_name: None, email: None, + email_verified: None, r#type: None, - flags: None, - permissions: None, - verified: None, - level: None, - experience: None, - public_birthday: None, - birthday: None, - points: None, - location: None, language: None, timezone: None, currency: None, photo_url: None, - banner_url: None, - last_online: None, - biography: None, - view_count: None, + permissions: None, created: None, updated: None, } diff --git a/src/models/user_type.rs b/src/models/user_type.rs index e6962b5..90bf1ae 100644 --- a/src/models/user_type.rs +++ b/src/models/user_type.rs @@ -1,9 +1,9 @@ /* * Tribufu API * - * REST API to access Tribufu services. + * API to access Tribufu services. * - * The version of the OpenAPI document: 1.1.0 + * The version of the OpenAPI document: 1.3.0 * Contact: contact@tribufu.com * Generated by: https://openapi-generator.tech */ diff --git a/src/platform/Cargo.toml b/src/platform/Cargo.toml index 88935d7..db1e7d4 100644 --- a/src/platform/Cargo.toml +++ b/src/platform/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "tribufu-platform" -version = "0.0.5" +version = "1.3.0" description = "Tribufu Platform" repository = "https://github.com/tribufu/tribufu-rust" authors = ["Tribufu "] +license = "MIT" edition = "2021" -publish = false +publish = true [lib] name = "tribufu_platform" @@ -13,7 +14,7 @@ crate-type = ["rlib"] path = "lib.rs" [dependencies] -tribufu-error = { version = "0.0.5", path = "../error" } +tribufu-error = { version = "1.3.0", path = "../error" } dunce = "1.0.4" [target.'cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))'.dependencies]