Small rewrite to allow fetching owned game of users

This commit is contained in:
2025-07-13 13:30:25 +02:00
parent ad0e81fdc3
commit 0e89bca126
6 changed files with 48 additions and 28 deletions

View File

@@ -304,12 +304,15 @@ Name | Type | Description | Required | Notes
## owned_games_get
> Vec<String> owned_games_get()
> Vec<String> owned_games_get(user_id)
### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**user_id** | Option<[**UserId**](UserId.md)> | | |
### Return type
@@ -321,7 +324,7 @@ This endpoint does not need any parameter.
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -505,7 +505,9 @@ pub async fn own_post(configuration: &configuration::Configuration, game_id: Opt
}
}
pub async fn owned_games_get(configuration: &configuration::Configuration, ) -> Result<Vec<String>, Error<OwnedGamesGetError>> {
pub async fn owned_games_get(configuration: &configuration::Configuration, user_id: Option<models::UserId>) -> Result<Vec<String>, Error<OwnedGamesGetError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_user_id = user_id;
let uri_str = format!("{}/owned_games", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
@@ -516,6 +518,7 @@ pub async fn owned_games_get(configuration: &configuration::Configuration, ) ->
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_user_id);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;