Skip to content

Commit f6bf8ba

Browse files
committed
Update curseforge api
1 parent 0d887b1 commit f6bf8ba

File tree

94 files changed

+1142
-316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1142
-316
lines changed

curseforge-client/.openapi-generator/FILES

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ src/apis/mod.rs
99
src/apis/mods_api.rs
1010
src/client.rs
1111
src/lib.rs
12+
src/models/affiliation_service_type.rs
1213
src/models/api_response_of_list_of_minecraft_game_version.rs
1314
src/models/api_response_of_list_of_minecraft_mod_loader_index.rs
1415
src/models/api_response_of_minecraft_game_version.rs
@@ -70,10 +71,17 @@ src/models/mod_description_response.rs
7071
src/models/mod_links.rs
7172
src/models/mod_loader_install_method.rs
7273
src/models/mod_loader_type.rs
74+
src/models/mod_search_sort_field.rs
7375
src/models/mod_status.rs
7476
src/models/model_mod.rs
75-
src/models/mods_search_sort_field.rs
7677
src/models/pagination.rs
78+
src/models/platform_type.rs
79+
src/models/premium_type.rs
80+
src/models/rating_details.rs
81+
src/models/rating_score.rs
7782
src/models/search_mods_response.rs
83+
src/models/server_affiliation.rs
84+
src/models/social_link.rs
85+
src/models/social_link_type.rs
7886
src/models/sort_order.rs
7987
src/models/sortable_game_version.rs

curseforge-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ serde_derive = "^1.0"
1515
serde_json = "^1.0"
1616
serde_repr = "^0.1"
1717
thiserror = "2.0"
18-
url = "^2.5"
18+
url = { version = "^2.5", features = ["serde"] }
1919
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] }
2020

2121
[features]

curseforge-client/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ HTTP API for CurseForge
77

88
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client.
99

10-
- API version: 1.0.240719
11-
- Package version: 1.0.240719
10+
- API version: 1.0.250410
11+
- Package version: 1.0.250410
1212
- Generator version: 7.13.0
1313
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
1414

@@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
5454

5555
## Documentation For Models
5656

57+
- [AffiliationServiceType](docs/AffiliationServiceType.md)
5758
- [ApiResponseOfListOfMinecraftGameVersion](docs/ApiResponseOfListOfMinecraftGameVersion.md)
5859
- [ApiResponseOfListOfMinecraftModLoaderIndex](docs/ApiResponseOfListOfMinecraftModLoaderIndex.md)
5960
- [ApiResponseOfMinecraftGameVersion](docs/ApiResponseOfMinecraftGameVersion.md)
@@ -115,10 +116,17 @@ Class | Method | HTTP request | Description
115116
- [ModLinks](docs/ModLinks.md)
116117
- [ModLoaderInstallMethod](docs/ModLoaderInstallMethod.md)
117118
- [ModLoaderType](docs/ModLoaderType.md)
119+
- [ModSearchSortField](docs/ModSearchSortField.md)
118120
- [ModStatus](docs/ModStatus.md)
119-
- [ModsSearchSortField](docs/ModsSearchSortField.md)
120121
- [Pagination](docs/Pagination.md)
122+
- [PlatformType](docs/PlatformType.md)
123+
- [PremiumType](docs/PremiumType.md)
124+
- [RatingDetails](docs/RatingDetails.md)
125+
- [RatingScore](docs/RatingScore.md)
121126
- [SearchModsResponse](docs/SearchModsResponse.md)
127+
- [ServerAffiliation](docs/ServerAffiliation.md)
128+
- [SocialLink](docs/SocialLink.md)
129+
- [SocialLinkType](docs/SocialLinkType.md)
122130
- [SortOrder](docs/SortOrder.md)
123131
- [SortableGameVersion](docs/SortableGameVersion.md)
124132

curseforge-client/src/apis/categories_api.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* HTTP API for CurseForge
55
*
6-
* The version of the OpenAPI document: 1.0.240719
6+
* The version of the OpenAPI document: 1.0.250410
77
*
88
* Generated by: https://openapi-generator.tech
99
*/
@@ -20,10 +20,10 @@ use crate::{
2020
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
2121
pub struct GetCategoriesParams<> {
2222
/// A game unique id
23-
pub game_id: u64,
23+
pub game_id: u32,
2424
/// A class unique id
25-
pub class_id: Option<u64>,
26-
/// A flag used to only return classes
25+
pub class_id: Option<u32>,
26+
/// A flag used with gameId to return only classes
2727
pub classes_only: Option<bool>,
2828
}
2929

curseforge-client/src/apis/files_api.rs

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* HTTP API for CurseForge
55
*
6-
* The version of the OpenAPI document: 1.0.240719
6+
* The version of the OpenAPI document: 1.0.250410
77
*
88
* Generated by: https://openapi-generator.tech
99
*/
@@ -55,19 +55,25 @@ pub struct GetModFileDownloadUrlParams<> {
5555
/// struct for passing parameters to the method [`FilesApi::get_mod_files`]
5656
#[derive(Clone, Debug)]
5757
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
58-
pub struct GetModFilesParams<'l2,> {
58+
pub struct GetModFilesParams<'l4,'l8,> {
5959
/// The mod id the files belong to
6060
pub mod_id: u64,
61-
/// Filter by game version string
62-
pub game_version: Option<&'l2 str>,
63-
/// ModLoaderType enumeration Filter only files associated to a given modloader (Forge, Fabric ...).
64-
pub mod_loader_type: Option<ModLoaderType>,
65-
/// Filter only files that are tagged with versions of the given gameVersionTypeId
66-
pub game_version_type_id: Option<u64>,
6761
/// A zero based index of the first item to include in the response, the limit is: (index + pageSize <= 10,000).
6862
pub index: Option<u32>,
6963
/// The number of items to include in the response, the default/maximum value is 50.
7064
pub page_size: Option<u32>,
65+
/// Filter by game version string
66+
pub game_version: Option<&'l4 str>,
67+
/// ModLoaderType enumeration Filter only files associated to a given modloader (Forge, Fabric ...).
68+
pub mod_loader_type: Option<ModLoaderType>,
69+
/// Filter only files that are tagged with versions of the given gameVersionTypeId
70+
pub game_version_type_id: Option<u32>,
71+
/// Filter only files older than the given file ID
72+
pub older_than_project_file_id: Option<u32>,
73+
/// Filter only files that are of the given release types
74+
pub release_types: Option<&'l8 Vec<models::FileReleaseType>>,
75+
/// Filter only files supporting the given platform type
76+
pub platform_type: Option<PlatformType>,
7177
}
7278

7379

@@ -322,7 +328,7 @@ impl FilesApi<'_> {
322328
}
323329
}
324330
/// Get all files of the specified mod.
325-
pub async fn get_mod_files(&self, params: &GetModFilesParams<'_,>) -> Result<models::GetModFilesResponse> {
331+
pub async fn get_mod_files(&self, params: &GetModFilesParams<'_,'_,>) -> Result<models::GetModFilesResponse> {
326332
#[allow(unused_mut)]
327333
let mut req_builder = self.0.request(
328334
reqwest::Method::GET,
@@ -350,6 +356,12 @@ impl FilesApi<'_> {
350356
}
351357
}
352358

359+
if let Some(ref param_value) = params.index {
360+
req_builder = req_builder.query(&[("index", &param_value)]);
361+
}
362+
if let Some(ref param_value) = params.page_size {
363+
req_builder = req_builder.query(&[("pageSize", &param_value)]);
364+
}
353365
if let Some(ref param_value) = params.game_version {
354366
req_builder = req_builder.query(&[("gameVersion", &param_value)]);
355367
}
@@ -359,11 +371,17 @@ impl FilesApi<'_> {
359371
if let Some(ref param_value) = params.game_version_type_id {
360372
req_builder = req_builder.query(&[("gameVersionTypeId", &param_value)]);
361373
}
362-
if let Some(ref param_value) = params.index {
363-
req_builder = req_builder.query(&[("index", &param_value)]);
374+
if let Some(ref param_value) = params.older_than_project_file_id {
375+
req_builder = req_builder.query(&[("olderThanProjectFileId", &param_value)]);
364376
}
365-
if let Some(ref param_value) = params.page_size {
366-
req_builder = req_builder.query(&[("pageSize", &param_value)]);
377+
if let Some(param_value) = params.release_types {
378+
req_builder = match "multi" {
379+
"multi" => req_builder.query(&param_value.iter().map(|p| ("releaseTypes", p)).collect::<Vec<_>>()),
380+
_ => req_builder.query(&[("releaseTypes", &param_value.iter().map(|p| p.to_string()).collect::<Vec<_>>().join(","))]),
381+
};
382+
}
383+
if let Some(ref param_value) = params.platform_type {
384+
req_builder = req_builder.query(&[("platformType", &param_value)]);
367385
}
368386

369387
let resp = req_builder.send().await?;

curseforge-client/src/apis/fingerprints_api.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* HTTP API for CurseForge
55
*
6-
* The version of the OpenAPI document: 1.0.240719
6+
* The version of the OpenAPI document: 1.0.250410
77
*
88
* Generated by: https://openapi-generator.tech
99
*/
@@ -27,14 +27,15 @@ pub struct GetFingerprintFuzzyMatchesParams<'l1,> {
2727
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
2828
pub struct GetFingerprintFuzzyMatchesByGameParams<'l2,> {
2929
/// The game id the find matches in
30-
pub game_id: u64,
30+
pub game_id: u32,
3131
pub get_fuzzy_matches_request_body: &'l2 GetFuzzyMatchesRequestBody,
3232
}
3333

3434
/// struct for passing parameters to the method [`FingerprintsApi::get_fingerprint_matches`]
3535
#[derive(Clone, Debug)]
3636
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
3737
pub struct GetFingerprintMatchesParams<'l1,> {
38+
/// The request body containing an array of fingerprints
3839
pub get_fingerprint_matches_request_body: &'l1 GetFingerprintMatchesRequestBody,
3940
}
4041

@@ -43,7 +44,7 @@ pub struct GetFingerprintMatchesParams<'l1,> {
4344
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
4445
pub struct GetFingerprintMatchesByGameParams<'l2,> {
4546
/// The game id the find matches in
46-
pub game_id: u64,
47+
pub game_id: u32,
4748
pub get_fingerprint_matches_request_body: &'l2 GetFingerprintMatchesRequestBody,
4849
}
4950

curseforge-client/src/apis/games_api.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* HTTP API for CurseForge
55
*
6-
* The version of the OpenAPI document: 1.0.240719
6+
* The version of the OpenAPI document: 1.0.250410
77
*
88
* Generated by: https://openapi-generator.tech
99
*/
@@ -20,7 +20,7 @@ use crate::{
2020
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
2121
pub struct GetGameParams<> {
2222
/// A game unique id
23-
pub game_id: u64,
23+
pub game_id: u32,
2424
}
2525

2626
/// struct for passing parameters to the method [`GamesApi::get_games`]
@@ -38,23 +38,23 @@ pub struct GetGamesParams<> {
3838
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
3939
pub struct GetVersionTypesParams<> {
4040
/// A game unique id
41-
pub game_id: u64,
41+
pub game_id: u32,
4242
}
4343

4444
/// struct for passing parameters to the method [`GamesApi::get_versions`]
4545
#[derive(Clone, Debug)]
4646
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
4747
pub struct GetVersionsParams<> {
4848
/// A game unique id
49-
pub game_id: u64,
49+
pub game_id: u32,
5050
}
5151

5252
/// struct for passing parameters to the method [`GamesApi::get_versions_v2`]
5353
#[derive(Clone, Debug)]
5454
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
5555
pub struct GetVersionsV2Params<> {
5656
/// A game unique id
57-
pub game_id: u64,
57+
pub game_id: u32,
5858
}
5959

6060

curseforge-client/src/apis/minecraft_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* HTTP API for CurseForge
55
*
6-
* The version of the OpenAPI document: 1.0.240719
6+
* The version of the OpenAPI document: 1.0.250410
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

curseforge-client/src/apis/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* HTTP API for CurseForge
55
*
6-
* The version of the OpenAPI document: 1.0.240719
6+
* The version of the OpenAPI document: 1.0.250410
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

0 commit comments

Comments
 (0)