diff --git a/config.yaml b/config.yaml index 81ff9ec..7b7900c 100644 --- a/config.yaml +++ b/config.yaml @@ -2,5 +2,4 @@ invokerPackage: Aternos\ModrinthApi artifactVersion: 1.0.0 generatorName: php outputDir: . -# This points to a downgraded Open API 3.0.0 spec for now. The official spec can be found at https://docs.modrinth.com/redocusaurus/plugin-redoc-0.yaml -inputSpec: https://raw.githubusercontent.com/JulianVennen/modrinth-docs/php-modrinth-api/static/openapi.yaml +inputSpec: https://docs.modrinth.com/redocusaurus/plugin-redoc-0.yaml \ No newline at end of file diff --git a/docs/Api/MiscApi.md b/docs/Api/MiscApi.md index cf19c60..a697945 100644 --- a/docs/Api/MiscApi.md +++ b/docs/Api/MiscApi.md @@ -6,7 +6,6 @@ All URIs are relative to https://api.modrinth.com/v2, except if the operation de | ------------- | ------------- | ------------- | | [**forgeUpdates()**](MiscApi.md#forgeUpdates) | **GET** /updates/{id|slug}/forge_updates.json | Forge Updates JSON file | | [**statistics()**](MiscApi.md#statistics) | **GET** /statistics | Various statistics about this Modrinth instance | -| [**submitReport()**](MiscApi.md#submitReport) | **POST** /report | Report a project, user, or version | ## `forgeUpdates()` @@ -123,65 +122,3 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - -## `submitReport()` - -```php -submitReport($creatable_report): \Aternos\ModrinthApi\Model\Report -``` - -Report a project, user, or version - -Bring a project, user, or version to the attention of the moderators by reporting it. - -### Example - -```php -setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Aternos\ModrinthApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); - - -$apiInstance = new Aternos\ModrinthApi\Api\MiscApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$creatable_report = new \Aternos\ModrinthApi\Model\CreatableReport(); // \Aternos\ModrinthApi\Model\CreatableReport | The report to be sent - -try { - $result = $apiInstance->submitReport($creatable_report); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling MiscApi->submitReport: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **creatable_report** | [**\Aternos\ModrinthApi\Model\CreatableReport**](../Model/CreatableReport.md)| The report to be sent | [optional] | - -### Return type - -[**\Aternos\ModrinthApi\Model\Report**](../Model/Report.md) - -### Authorization - -[TokenAuth](../../README.md#TokenAuth) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) diff --git a/docs/Api/ProjectsApi.md b/docs/Api/ProjectsApi.md index 757eba7..1cfa368 100644 --- a/docs/Api/ProjectsApi.md +++ b/docs/Api/ProjectsApi.md @@ -987,7 +987,7 @@ void (empty response body) ## `searchProjects()` ```php -searchProjects($query, $facets, $index, $offset, $limit, $filters, $version): \Aternos\ModrinthApi\Model\SearchResults +searchProjects($query, $facets, $index, $offset, $limit): \Aternos\ModrinthApi\Model\SearchResults ``` Search projects @@ -1010,11 +1010,9 @@ $facets = [["categories:forge"],["versions:1.17.1"],["project_type:mod"],["licen $index = downloads; // string | The sorting method used for sorting search results $offset = 20; // int | The offset into the search. Skips this number of results $limit = 20; // int | The number of results returned by the search -$filters = categories="fabric" AND (categories="technology" OR categories="utility"); // string | A list of filters relating to the properties of a project. Facets are generally recommended over filters. -$version = version="1.16.3" OR version="1.16.2" OR version="1.16.1"; // string | A list of filters relating to the versions of a project. Use of facets for filtering by version is recommended try { - $result = $apiInstance->searchProjects($query, $facets, $index, $offset, $limit, $filters, $version); + $result = $apiInstance->searchProjects($query, $facets, $index, $offset, $limit); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProjectsApi->searchProjects: ', $e->getMessage(), PHP_EOL; @@ -1030,8 +1028,6 @@ try { | **index** | **string**| The sorting method used for sorting search results | [optional] [default to 'relevance'] | | **offset** | **int**| The offset into the search. Skips this number of results | [optional] [default to 0] | | **limit** | **int**| The number of results returned by the search | [optional] [default to 10] | -| **filters** | **string**| A list of filters relating to the properties of a project. Facets are generally recommended over filters. | [optional] | -| **version** | **string**| A list of filters relating to the versions of a project. Use of facets for filtering by version is recommended | [optional] | ### Return type diff --git a/docs/Api/TagsApi.md b/docs/Api/TagsApi.md index cab76aa..907d8a5 100644 --- a/docs/Api/TagsApi.md +++ b/docs/Api/TagsApi.md @@ -177,7 +177,7 @@ No authorization required ## `licenseText()` ```php -licenseText($id): \Aternos\ModrinthApi\Model\LicenseText200Response +licenseText($id): \Aternos\ModrinthApi\Model\License ``` Get the text and title of a license @@ -213,7 +213,7 @@ try { ### Return type -[**\Aternos\ModrinthApi\Model\LicenseText200Response**](../Model/LicenseText200Response.md) +[**\Aternos\ModrinthApi\Model\License**](../Model/License.md) ### Authorization diff --git a/docs/Api/UsersApi.md b/docs/Api/UsersApi.md index a4c125e..0d2cee1 100644 --- a/docs/Api/UsersApi.md +++ b/docs/Api/UsersApi.md @@ -9,7 +9,6 @@ All URIs are relative to https://api.modrinth.com/v2, except if the operation de | [**getPayoutHistory()**](UsersApi.md#getPayoutHistory) | **GET** /user/{id|username}/payouts | Get user's payout history | | [**getUser()**](UsersApi.md#getUser) | **GET** /user/{id|username} | Get a user | | [**getUserFromAuth()**](UsersApi.md#getUserFromAuth) | **GET** /user | Get user from authorization header | -| [**getUserNotifications()**](UsersApi.md#getUserNotifications) | **GET** /user/{id|username}/notifications | Get user's notifications | | [**getUserProjects()**](UsersApi.md#getUserProjects) | **GET** /user/{id|username}/projects | Get user's projects | | [**getUsers()**](UsersApi.md#getUsers) | **GET** /users | Get multiple users | | [**modifyUser()**](UsersApi.md#modifyUser) | **PATCH** /user/{id|username} | Modify a user | @@ -310,66 +309,6 @@ This endpoint does not need any parameter. [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getUserNotifications()` - -```php -getUserNotifications($id_username): \Aternos\ModrinthApi\Model\Notification[] -``` - -Get user's notifications - -### Example - -```php -setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Aternos\ModrinthApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); - - -$apiInstance = new Aternos\ModrinthApi\Api\UsersApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$id_username = ["EEFFGGHH","my_user"]; // string | The ID or username of the user - -try { - $result = $apiInstance->getUserNotifications($id_username); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling UsersApi->getUserNotifications: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **id_username** | **string**| The ID or username of the user | | - -### Return type - -[**\Aternos\ModrinthApi\Model\Notification[]**](../Model/Notification.md) - -### Authorization - -[TokenAuth](../../README.md#TokenAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - ## `getUserProjects()` ```php diff --git a/docs/Api/VersionsApi.md b/docs/Api/VersionsApi.md index a57f5a0..18a36c4 100644 --- a/docs/Api/VersionsApi.md +++ b/docs/Api/VersionsApi.md @@ -221,8 +221,8 @@ $apiInstance = new Aternos\ModrinthApi\Api\VersionsApi( new GuzzleHttp\Client() ); $id_slug = ["AABBCCDD","my_project"]; // string | The ID or slug of the project -$loaders = ["fabric"]; // string[] | The types of loaders to filter for -$game_versions = ["1.18.1"]; // string[] | The game versions to filter for +$loaders = ["fabric"]; // string | The types of loaders to filter for +$game_versions = ["1.18.1"]; // string | The game versions to filter for $featured = True; // bool | Allows to filter for featured or non-featured versions only try { @@ -238,8 +238,8 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **id_slug** | **string**| The ID or slug of the project | | -| **loaders** | [**string[]**](../Model/string.md)| The types of loaders to filter for | [optional] | -| **game_versions** | [**string[]**](../Model/string.md)| The game versions to filter for | [optional] | +| **loaders** | **string**| The types of loaders to filter for | [optional] | +| **game_versions** | **string**| The game versions to filter for | [optional] | | **featured** | **bool**| Allows to filter for featured or non-featured versions only | [optional] | ### Return type @@ -392,7 +392,7 @@ $apiInstance = new Aternos\ModrinthApi\Api\VersionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$ids = ["AABBCCDD","EEFFGGHH"]; // string | The IDs of the versions +$ids = ["AABBCCDD", "EEFFGGHH"]; // string | The IDs of the versions try { $result = $apiInstance->getVersions($ids); diff --git a/docs/Model/EditableProjectAllOf.md b/docs/Model/EditableProjectAllOf.md deleted file mode 100644 index 2fbc539..0000000 --- a/docs/Model/EditableProjectAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# # EditableProjectAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**moderation_message** | **string** | The title of the moderators' message for the project | [optional] -**moderation_message_body** | **string** | The body of the moderators' message for the project | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForgeUpdatesPromos.md b/docs/Model/ForgeUpdateCheckerPromos.md similarity index 95% rename from docs/Model/ForgeUpdatesPromos.md rename to docs/Model/ForgeUpdateCheckerPromos.md index 30aadc0..dfd0230 100644 --- a/docs/Model/ForgeUpdatesPromos.md +++ b/docs/Model/ForgeUpdateCheckerPromos.md @@ -1,4 +1,4 @@ -# # ForgeUpdatesPromos +# # ForgeUpdateCheckerPromos ## Properties diff --git a/docs/Model/ForgeUpdates.md b/docs/Model/ForgeUpdates.md index 81352d7..a4424a3 100644 --- a/docs/Model/ForgeUpdates.md +++ b/docs/Model/ForgeUpdates.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **homepage** | **string** | A link to the mod page | [optional] -**promos** | [**\Aternos\ModrinthApi\Model\ForgeUpdatesPromos**](ForgeUpdatesPromos.md) | | [optional] +**promos** | [**\Aternos\ModrinthApi\Model\ForgeUpdateCheckerPromos**](ForgeUpdateCheckerPromos.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetLatestVersionsFromHashesBodyAllOf.md b/docs/Model/GetLatestVersionsFromHashesBodyAllOf.md deleted file mode 100644 index d5de849..0000000 --- a/docs/Model/GetLatestVersionsFromHashesBodyAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# # GetLatestVersionsFromHashesBodyAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**loaders** | **string[]** | | -**game_versions** | **string[]** | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LicenseText200Response.md b/docs/Model/License.md similarity index 92% rename from docs/Model/LicenseText200Response.md rename to docs/Model/License.md index b69730e..ed2fdbe 100644 --- a/docs/Model/LicenseText200Response.md +++ b/docs/Model/License.md @@ -1,4 +1,4 @@ -# # LicenseText200Response +# # License ## Properties diff --git a/docs/Model/LicenseList200ResponseInner.md b/docs/Model/LicenseList200ResponseInner.md deleted file mode 100644 index aec113e..0000000 --- a/docs/Model/LicenseList200ResponseInner.md +++ /dev/null @@ -1,10 +0,0 @@ -# # LicenseList200ResponseInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**short** | **string** | The short identifier of the license | -**name** | **string** | The full name of the license | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModifiableProjectAllOf.md b/docs/Model/ModifiableProjectAllOf.md deleted file mode 100644 index 8577efc..0000000 --- a/docs/Model/ModifiableProjectAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# # ModifiableProjectAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**license_id** | **string** | The SPDX license ID of a project | [optional] -**license_url** | **string** | The URL to this license | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NonSearchProjectAllOf.md b/docs/Model/NonSearchProjectAllOf.md deleted file mode 100644 index 2471fc5..0000000 --- a/docs/Model/NonSearchProjectAllOf.md +++ /dev/null @@ -1,17 +0,0 @@ -# # NonSearchProjectAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**body** | **string** | A long form description of the project | [optional] -**status** | **string** | The status of the project | [optional] -**requested_status** | **string** | The requested status when submitting for review or scheduling the project for release | [optional] -**additional_categories** | **string[]** | A list of categories which are searchable but non-primary | [optional] -**issues_url** | **string** | An optional link to where to submit bugs or issues with the project | [optional] -**source_url** | **string** | An optional link to the source code of the project | [optional] -**wiki_url** | **string** | An optional link to the project's wiki page or other relevant information | [optional] -**discord_url** | **string** | An optional invite link to the project's discord | [optional] -**donation_urls** | [**\Aternos\ModrinthApi\Model\ProjectDonationURL[]**](ProjectDonationURL.md) | A list of donation links for the project | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NotificationAction.md b/docs/Model/NotificationAction.md index 6d35c58..e5e80c2 100644 --- a/docs/Model/NotificationAction.md +++ b/docs/Model/NotificationAction.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | The friendly name for this action | [optional] -**action_route** | **array** | The HTTP code and path to request in order to perform this action. | [optional] +**action_route** | **string[]** | The HTTP code and path to request in order to perform this action. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProjectAllOf.md b/docs/Model/ProjectAllOf.md deleted file mode 100644 index bafd00e..0000000 --- a/docs/Model/ProjectAllOf.md +++ /dev/null @@ -1,22 +0,0 @@ -# # ProjectAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The ID of the project, encoded as a base62 string | -**team** | **string** | The ID of the team that has ownership of this project | -**body_url** | **string** | The link to the long description of the project. Always null, only kept for legacy compatibility. | [optional] -**moderator_message** | [**\Aternos\ModrinthApi\Model\ModeratorMessage**](ModeratorMessage.md) | | [optional] -**published** | **string** | The date the project was published | -**updated** | **string** | The date the project was last updated | -**approved** | **string** | The date the project's status was set to an approved status | [optional] -**queued** | **string** | The date the project's status was submitted to moderators for review | [optional] -**followers** | **int** | The total number of users following the project | -**license** | [**\Aternos\ModrinthApi\Model\ProjectLicense**](ProjectLicense.md) | | [optional] -**versions** | **string[]** | A list of the version IDs of the project (will never be empty unless `draft` status) | [optional] -**game_versions** | **string[]** | A list of all of the game versions supported by the project | [optional] -**loaders** | **string[]** | A list of all of the loaders supported by the project | [optional] -**gallery** | [**\Aternos\ModrinthApi\Model\GalleryImage[]**](GalleryImage.md) | A list of images that have been uploaded to the project's gallery | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProjectResult.md b/docs/Model/ProjectResult.md index 250287e..fc7817e 100644 --- a/docs/Model/ProjectResult.md +++ b/docs/Model/ProjectResult.md @@ -27,6 +27,5 @@ Name | Type | Description | Notes **license** | **string** | The SPDX license ID of a project | **gallery** | **string[]** | All gallery images attached to the project | [optional] **featured_gallery** | **string** | The featured gallery image of the project | [optional] -**dependencies** | **string[]** | A list of this project's dependencies, in the format of `{project_id}-{dep_type}` | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProjectResultAllOf.md b/docs/Model/ProjectResultAllOf.md deleted file mode 100644 index 9e7bc3f..0000000 --- a/docs/Model/ProjectResultAllOf.md +++ /dev/null @@ -1,20 +0,0 @@ -# # ProjectResultAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**project_id** | **string** | The ID of the project | -**author** | **string** | The username of the project's author | -**display_categories** | **string[]** | A list of the categories that the project has which are not secondary | [optional] -**versions** | **string[]** | A list of the minecraft versions supported by the project | -**follows** | **int** | The total number of users following the project | -**date_created** | **string** | The date the project was added to search | -**date_modified** | **string** | The date the project was last modified | -**latest_version** | **string** | The latest version of minecraft that this project supports | [optional] -**license** | **string** | The SPDX license ID of a project | -**gallery** | **string[]** | All gallery images attached to the project | [optional] -**featured_gallery** | **string** | The featured gallery image of the project | [optional] -**dependencies** | **string[]** | A list of this project's dependencies, in the format of `{project_id}-{dep_type}` | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReportAllOf.md b/docs/Model/ReportAllOf.md deleted file mode 100644 index 9a1ac00..0000000 --- a/docs/Model/ReportAllOf.md +++ /dev/null @@ -1,13 +0,0 @@ -# # ReportAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The ID of the report | [optional] -**reporter** | **string** | The ID of the user who reported the item | -**created** | **string** | The time at which the report was created | -**closed** | **bool** | Whether the report is resolved | -**thread_id** | **string** | The ID of the moderation thread associated with this report | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ServerRenderedProjectAllOf.md b/docs/Model/ServerRenderedProjectAllOf.md deleted file mode 100644 index 916161c..0000000 --- a/docs/Model/ServerRenderedProjectAllOf.md +++ /dev/null @@ -1,14 +0,0 @@ -# # ServerRenderedProjectAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**project_type** | **string** | The project type of the project | -**downloads** | **int** | The total number of downloads of the project | -**icon_url** | **string** | The URL of the project's icon | [optional] -**color** | **int** | The RGB color of the project, automatically generated from the project icon | [optional] -**thread_id** | **string** | The ID of the moderation thread associated with this project | [optional] -**monetization_status** | **string** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserAllOf.md b/docs/Model/UserAllOf.md deleted file mode 100644 index 7ebc17a..0000000 --- a/docs/Model/UserAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# # UserAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The user's ID | -**avatar_url** | **string** | The user's avatar url | -**created** | **string** | The time at which the user was created | -**role** | **string** | The user's role | -**badges** | **int** | Any badges applicable to this user. These are currently unused and undisplayed, and as such are subject to change In order from first to seventh bit, the current bits are: - (unused) - EARLY_MODPACK_ADOPTER - EARLY_RESPACK_ADOPTER - EARLY_PLUGIN_ADOPTER - ALPHA_TESTER - CONTRIBUTOR - TRANSLATOR | [optional] -**auth_providers** | **string[]** | A list of authentication providers you have signed up for (only displayed if requesting your own account) | [optional] -**email_verified** | **bool** | Whether your email is verified (only displayed if requesting your own account) | [optional] -**has_password** | **bool** | Whether you have a password associated with your account (only displayed if requesting your own account) | [optional] -**has_totp** | **bool** | Whether you have TOTP two-factor authentication connected to your account (only displayed if requesting your own account) | [optional] -**github_id** | **int** | Deprecated - this is no longer public for security reasons and is always null | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VersionAllOf.md b/docs/Model/VersionAllOf.md deleted file mode 100644 index 7b2044d..0000000 --- a/docs/Model/VersionAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# # VersionAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The ID of the version, encoded as a base62 string | -**project_id** | **string** | The ID of the project this version is for | -**author_id** | **string** | The ID of the author who published this version | -**date_published** | **string** | | -**downloads** | **int** | The number of times this version has been downloaded | -**changelog_url** | **string** | A link to the changelog for this version. Always null, only kept for legacy compatibility. | [optional] -**files** | [**\Aternos\ModrinthApi\Model\VersionFile[]**](VersionFile.md) | A list of files available for download for this version | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/MiscApi.php b/lib/Api/MiscApi.php index 13cae19..80d9bd7 100644 --- a/lib/Api/MiscApi.php +++ b/lib/Api/MiscApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -78,9 +78,6 @@ class MiscApi 'statistics' => [ 'application/json', ], - 'submitReport' => [ - 'application/json', - ], ]; /** @@ -144,7 +141,7 @@ public function getConfig() * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forgeUpdates'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\ForgeUpdates|\Aternos\ModrinthApi\Model\InvalidInputError */ @@ -169,7 +166,7 @@ public function forgeUpdates($id_slug, ?int $hostIndex = null, array $variables * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forgeUpdates'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\ForgeUpdates|\Aternos\ModrinthApi\Model\InvalidInputError, HTTP status code, HTTP response headers (array of strings) */ @@ -219,7 +216,19 @@ public function forgeUpdatesWithHttpInfo($id_slug, ?int $hostIndex = null, array } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\ForgeUpdates' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -234,7 +243,19 @@ public function forgeUpdatesWithHttpInfo($id_slug, ?int $hostIndex = null, array } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -251,7 +272,19 @@ public function forgeUpdatesWithHttpInfo($id_slug, ?int $hostIndex = null, array } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -506,7 +539,7 @@ protected function getHostSettingsForforgeUpdates(): array * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['statistics'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Statistics */ @@ -523,7 +556,7 @@ public function statistics(string $contentType = self::contentTypes['statistics' * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['statistics'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Statistics, HTTP status code, HTTP response headers (array of strings) */ @@ -573,7 +606,19 @@ public function statisticsWithHttpInfo(string $contentType = self::contentTypes[ } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Statistics' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -590,7 +635,19 @@ public function statisticsWithHttpInfo(string $contentType = self::contentTypes[ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -762,333 +819,6 @@ public function statisticsRequest(string $contentType = self::contentTypes['stat ); } - /** - * Operation submitReport - * - * Report a project, user, or version - * - * @param \Aternos\ModrinthApi\Model\CreatableReport $creatable_report The report to be sent (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReport'] to see the possible values for this operation - * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Aternos\ModrinthApi\Model\Report|\Aternos\ModrinthApi\Model\InvalidInputError|\Aternos\ModrinthApi\Model\AuthError - */ - public function submitReport($creatable_report = null, string $contentType = self::contentTypes['submitReport'][0]) - { - list($response) = $this->submitReportWithHttpInfo($creatable_report, $contentType); - return $response; - } - - /** - * Operation submitReportWithHttpInfo - * - * Report a project, user, or version - * - * @param \Aternos\ModrinthApi\Model\CreatableReport $creatable_report The report to be sent (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReport'] to see the possible values for this operation - * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Aternos\ModrinthApi\Model\Report|\Aternos\ModrinthApi\Model\InvalidInputError|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) - */ - public function submitReportWithHttpInfo($creatable_report = null, string $contentType = self::contentTypes['submitReport'][0]) - { - $request = $this->submitReportRequest($creatable_report, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\Aternos\ModrinthApi\Model\Report' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Aternos\ModrinthApi\Model\Report' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Aternos\ModrinthApi\Model\Report', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Aternos\ModrinthApi\Model\InvalidInputError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Aternos\ModrinthApi\Model\InvalidInputError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\Aternos\ModrinthApi\Model\AuthError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Aternos\ModrinthApi\Model\AuthError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\Aternos\ModrinthApi\Model\Report'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Aternos\ModrinthApi\Model\Report', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Aternos\ModrinthApi\Model\InvalidInputError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Aternos\ModrinthApi\Model\AuthError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation submitReportAsync - * - * Report a project, user, or version - * - * @param \Aternos\ModrinthApi\Model\CreatableReport $creatable_report The report to be sent (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReport'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function submitReportAsync($creatable_report = null, string $contentType = self::contentTypes['submitReport'][0]) - { - return $this->submitReportAsyncWithHttpInfo($creatable_report, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation submitReportAsyncWithHttpInfo - * - * Report a project, user, or version - * - * @param \Aternos\ModrinthApi\Model\CreatableReport $creatable_report The report to be sent (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReport'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function submitReportAsyncWithHttpInfo($creatable_report = null, string $contentType = self::contentTypes['submitReport'][0]) - { - $returnType = '\Aternos\ModrinthApi\Model\Report'; - $request = $this->submitReportRequest($creatable_report, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'submitReport' - * - * @param \Aternos\ModrinthApi\Model\CreatableReport $creatable_report The report to be sent (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReport'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function submitReportRequest($creatable_report = null, string $contentType = self::contentTypes['submitReport'][0]) - { - - - - $resourcePath = '/report'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (isset($creatable_report)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($creatable_report)); - } else { - $httpBody = $creatable_report; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'POST', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - /** * Create http client option * diff --git a/lib/Api/NotificationsApi.php b/lib/Api/NotificationsApi.php index b9e30eb..6057962 100644 --- a/lib/Api/NotificationsApi.php +++ b/lib/Api/NotificationsApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -149,7 +149,7 @@ public function getConfig() * @param string $id The ID of the notification (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNotification'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -166,7 +166,7 @@ public function deleteNotification($id, string $contentType = self::contentTypes * @param string $id The ID of the notification (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNotification'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -391,7 +391,7 @@ public function deleteNotificationRequest($id, string $contentType = self::conte * @param string $ids The IDs of the notifications (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNotifications'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -408,7 +408,7 @@ public function deleteNotifications($ids, string $contentType = self::contentTyp * @param string $ids The IDs of the notifications (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNotifications'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -634,7 +634,7 @@ public function deleteNotificationsRequest($ids, string $contentType = self::con * @param string $id The ID of the notification (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotification'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Notification|\Aternos\ModrinthApi\Model\AuthError */ @@ -652,7 +652,7 @@ public function getNotification($id, string $contentType = self::contentTypes['g * @param string $id The ID of the notification (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotification'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Notification|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -702,7 +702,19 @@ public function getNotificationWithHttpInfo($id, string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Notification' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -717,7 +729,19 @@ public function getNotificationWithHttpInfo($id, string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -734,7 +758,19 @@ public function getNotificationWithHttpInfo($id, string $contentType = self::con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -945,7 +981,7 @@ public function getNotificationRequest($id, string $contentType = self::contentT * @param string $ids The IDs of the notifications (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotifications'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Notification[]|\Aternos\ModrinthApi\Model\AuthError */ @@ -963,7 +999,7 @@ public function getNotifications($ids, string $contentType = self::contentTypes[ * @param string $ids The IDs of the notifications (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotifications'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Notification[]|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -1013,7 +1049,19 @@ public function getNotificationsWithHttpInfo($ids, string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Notification[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1028,7 +1076,19 @@ public function getNotificationsWithHttpInfo($ids, string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1045,7 +1105,19 @@ public function getNotificationsWithHttpInfo($ids, string $contentType = self::c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1257,7 +1329,7 @@ public function getNotificationsRequest($ids, string $contentType = self::conten * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Notification[]|\Aternos\ModrinthApi\Model\AuthError */ @@ -1275,7 +1347,7 @@ public function getUserNotifications($id_username, string $contentType = self::c * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Notification[]|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -1325,7 +1397,19 @@ public function getUserNotificationsWithHttpInfo($id_username, string $contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Notification[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1340,7 +1424,19 @@ public function getUserNotificationsWithHttpInfo($id_username, string $contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1357,7 +1453,19 @@ public function getUserNotificationsWithHttpInfo($id_username, string $contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1568,7 +1676,7 @@ public function getUserNotificationsRequest($id_username, string $contentType = * @param string $id The ID of the notification (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readNotification'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -1585,7 +1693,7 @@ public function readNotification($id, string $contentType = self::contentTypes[' * @param string $id The ID of the notification (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readNotification'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -1810,7 +1918,7 @@ public function readNotificationRequest($id, string $contentType = self::content * @param string $ids The IDs of the notifications (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readNotifications'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -1827,7 +1935,7 @@ public function readNotifications($ids, string $contentType = self::contentTypes * @param string $ids The IDs of the notifications (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readNotifications'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ diff --git a/lib/Api/ProjectsApi.php b/lib/Api/ProjectsApi.php index 736d2ec..c16ac22 100644 --- a/lib/Api/ProjectsApi.php +++ b/lib/Api/ProjectsApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -202,7 +202,7 @@ public function getConfig() * @param \SplFileObject $body body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addGalleryImage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -225,7 +225,7 @@ public function addGalleryImage($id_slug, $ext, $featured, $title = null, $descr * @param \SplFileObject $body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addGalleryImage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -548,7 +548,7 @@ public function addGalleryImageRequest($id_slug, $ext, $featured, $title = null, * @param \SplFileObject $body body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeProjectIcon'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -567,7 +567,7 @@ public function changeProjectIcon($id_slug, $ext, $body = null, string $contentT * @param \SplFileObject $body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeProjectIcon'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -822,7 +822,7 @@ public function changeProjectIconRequest($id_slug, $ext, $body = null, string $c * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkProjectValidity'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\ProjectIdentifier */ @@ -840,7 +840,7 @@ public function checkProjectValidity($id_slug, string $contentType = self::conte * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkProjectValidity'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\ProjectIdentifier, HTTP status code, HTTP response headers (array of strings) */ @@ -890,7 +890,19 @@ public function checkProjectValidityWithHttpInfo($id_slug, string $contentType = } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\ProjectIdentifier' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -907,7 +919,19 @@ public function checkProjectValidityWithHttpInfo($id_slug, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1106,7 +1130,7 @@ public function checkProjectValidityRequest($id_slug, string $contentType = self * @param \SplFileObject $icon Project icon file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Project|\Aternos\ModrinthApi\Model\InvalidInputError|\Aternos\ModrinthApi\Model\AuthError */ @@ -1125,7 +1149,7 @@ public function createProject($data, $icon = null, string $contentType = self::c * @param \SplFileObject $icon Project icon file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Project|\Aternos\ModrinthApi\Model\InvalidInputError|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -1175,7 +1199,19 @@ public function createProjectWithHttpInfo($data, $icon = null, string $contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Project' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1190,7 +1226,19 @@ public function createProjectWithHttpInfo($data, $icon = null, string $contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1205,7 +1253,19 @@ public function createProjectWithHttpInfo($data, $icon = null, string $contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1222,7 +1282,19 @@ public function createProjectWithHttpInfo($data, $icon = null, string $contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1454,7 +1526,7 @@ public function createProjectRequest($data, $icon = null, string $contentType = * @param string $url URL link of the image to delete (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGalleryImage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -1472,7 +1544,7 @@ public function deleteGalleryImage($id_slug, $url, string $contentType = self::c * @param string $url URL link of the image to delete (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGalleryImage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -1724,7 +1796,7 @@ public function deleteGalleryImageRequest($id_slug, $url, string $contentType = * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -1741,7 +1813,7 @@ public function deleteProject($id_slug, string $contentType = self::contentTypes * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -1974,7 +2046,7 @@ public function deleteProjectRequest($id_slug, string $contentType = self::conte * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProjectIcon'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -1991,7 +2063,7 @@ public function deleteProjectIcon($id_slug, string $contentType = self::contentT * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProjectIcon'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -2224,7 +2296,7 @@ public function deleteProjectIconRequest($id_slug, string $contentType = self::c * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['followProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -2241,7 +2313,7 @@ public function followProject($id_slug, string $contentType = self::contentTypes * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['followProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -2474,7 +2546,7 @@ public function followProjectRequest($id_slug, string $contentType = self::conte * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDependencies'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\ProjectDependencyList */ @@ -2492,7 +2564,7 @@ public function getDependencies($id_slug, string $contentType = self::contentTyp * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDependencies'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\ProjectDependencyList, HTTP status code, HTTP response headers (array of strings) */ @@ -2542,7 +2614,19 @@ public function getDependenciesWithHttpInfo($id_slug, string $contentType = self } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\ProjectDependencyList' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2559,7 +2643,19 @@ public function getDependenciesWithHttpInfo($id_slug, string $contentType = self } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2757,7 +2853,7 @@ public function getDependenciesRequest($id_slug, string $contentType = self::con * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Project */ @@ -2775,7 +2871,7 @@ public function getProject($id_slug, string $contentType = self::contentTypes['g * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Project, HTTP status code, HTTP response headers (array of strings) */ @@ -2825,7 +2921,19 @@ public function getProjectWithHttpInfo($id_slug, string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Project' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2842,7 +2950,19 @@ public function getProjectWithHttpInfo($id_slug, string $contentType = self::con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -3040,7 +3160,7 @@ public function getProjectRequest($id_slug, string $contentType = self::contentT * @param string $ids The IDs of the projects (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Project[] */ @@ -3058,7 +3178,7 @@ public function getProjects($ids, string $contentType = self::contentTypes['getP * @param string $ids The IDs of the projects (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Project[], HTTP status code, HTTP response headers (array of strings) */ @@ -3108,7 +3228,19 @@ public function getProjectsWithHttpInfo($ids, string $contentType = self::conten } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Project[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -3125,7 +3257,19 @@ public function getProjectsWithHttpInfo($ids, string $contentType = self::conten } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -3329,7 +3473,7 @@ public function getProjectsRequest($ids, string $contentType = self::contentType * @param int $ordering New ordering of the image (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyGalleryImage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -3351,7 +3495,7 @@ public function modifyGalleryImage($id_slug, $url, $featured = null, $title = nu * @param int $ordering New ordering of the image (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyGalleryImage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -3648,7 +3792,7 @@ public function modifyGalleryImageRequest($id_slug, $url, $featured = null, $tit * @param \Aternos\ModrinthApi\Model\EditableProject $editable_project Modified project fields (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -3666,7 +3810,7 @@ public function modifyProject($id_slug, $editable_project = null, string $conten * @param \Aternos\ModrinthApi\Model\EditableProject $editable_project Modified project fields (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -3903,7 +4047,7 @@ public function modifyProjectRequest($id_slug, $editable_project = null, string * @param \Aternos\ModrinthApi\Model\PatchProjectsBody $patch_projects_body Fields to edit on all projects specified (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['patchProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -3921,7 +4065,7 @@ public function patchProjects($ids, $patch_projects_body = null, string $content * @param \Aternos\ModrinthApi\Model\PatchProjectsBody $patch_projects_body Fields to edit on all projects specified (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['patchProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -4166,7 +4310,7 @@ public function patchProjectsRequest($ids, $patch_projects_body = null, string $ * @param int $count The number of random projects to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['randomProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Project[]|\Aternos\ModrinthApi\Model\InvalidInputError */ @@ -4184,7 +4328,7 @@ public function randomProjects($count, string $contentType = self::contentTypes[ * @param int $count The number of random projects to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['randomProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Project[]|\Aternos\ModrinthApi\Model\InvalidInputError, HTTP status code, HTTP response headers (array of strings) */ @@ -4234,7 +4378,19 @@ public function randomProjectsWithHttpInfo($count, string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Project[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -4249,7 +4405,19 @@ public function randomProjectsWithHttpInfo($count, string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -4266,7 +4434,19 @@ public function randomProjectsWithHttpInfo($count, string $contentType = self::c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -4480,7 +4660,7 @@ public function randomProjectsRequest($count, string $contentType = self::conten * @param \Aternos\ModrinthApi\Model\Schedule $schedule Information about date and requested status (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -4498,7 +4678,7 @@ public function scheduleProject($id_slug, $schedule = null, string $contentType * @param \Aternos\ModrinthApi\Model\Schedule $schedule Information about date and requested status (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -4744,17 +4924,15 @@ public function scheduleProjectRequest($id_slug, $schedule = null, string $conte * @param string $index The sorting method used for sorting search results (optional, default to 'relevance') * @param int $offset The offset into the search. Skips this number of results (optional, default to 0) * @param int $limit The number of results returned by the search (optional, default to 10) - * @param string $filters A list of filters relating to the properties of a project. Facets are generally recommended over filters. (optional) (deprecated) - * @param string $version A list of filters relating to the versions of a project. Use of facets for filtering by version is recommended (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\SearchResults|\Aternos\ModrinthApi\Model\InvalidInputError */ - public function searchProjects($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, $filters = null, $version = null, string $contentType = self::contentTypes['searchProjects'][0]) + public function searchProjects($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, string $contentType = self::contentTypes['searchProjects'][0]) { - list($response) = $this->searchProjectsWithHttpInfo($query, $facets, $index, $offset, $limit, $filters, $version, $contentType); + list($response) = $this->searchProjectsWithHttpInfo($query, $facets, $index, $offset, $limit, $contentType); return $response; } @@ -4768,17 +4946,15 @@ public function searchProjects($query = null, $facets = null, $index = 'relevanc * @param string $index The sorting method used for sorting search results (optional, default to 'relevance') * @param int $offset The offset into the search. Skips this number of results (optional, default to 0) * @param int $limit The number of results returned by the search (optional, default to 10) - * @param string $filters A list of filters relating to the properties of a project. Facets are generally recommended over filters. (optional) (deprecated) - * @param string $version A list of filters relating to the versions of a project. Use of facets for filtering by version is recommended (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\SearchResults|\Aternos\ModrinthApi\Model\InvalidInputError, HTTP status code, HTTP response headers (array of strings) */ - public function searchProjectsWithHttpInfo($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, $filters = null, $version = null, string $contentType = self::contentTypes['searchProjects'][0]) + public function searchProjectsWithHttpInfo($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, string $contentType = self::contentTypes['searchProjects'][0]) { - $request = $this->searchProjectsRequest($query, $facets, $index, $offset, $limit, $filters, $version, $contentType); + $request = $this->searchProjectsRequest($query, $facets, $index, $offset, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -4822,7 +4998,19 @@ public function searchProjectsWithHttpInfo($query = null, $facets = null, $index } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\SearchResults' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -4837,7 +5025,19 @@ public function searchProjectsWithHttpInfo($query = null, $facets = null, $index } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -4854,7 +5054,19 @@ public function searchProjectsWithHttpInfo($query = null, $facets = null, $index } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -4897,16 +5109,14 @@ public function searchProjectsWithHttpInfo($query = null, $facets = null, $index * @param string $index The sorting method used for sorting search results (optional, default to 'relevance') * @param int $offset The offset into the search. Skips this number of results (optional, default to 0) * @param int $limit The number of results returned by the search (optional, default to 10) - * @param string $filters A list of filters relating to the properties of a project. Facets are generally recommended over filters. (optional) (deprecated) - * @param string $version A list of filters relating to the versions of a project. Use of facets for filtering by version is recommended (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchProjects'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchProjectsAsync($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, $filters = null, $version = null, string $contentType = self::contentTypes['searchProjects'][0]) + public function searchProjectsAsync($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, string $contentType = self::contentTypes['searchProjects'][0]) { - return $this->searchProjectsAsyncWithHttpInfo($query, $facets, $index, $offset, $limit, $filters, $version, $contentType) + return $this->searchProjectsAsyncWithHttpInfo($query, $facets, $index, $offset, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -4924,17 +5134,15 @@ function ($response) { * @param string $index The sorting method used for sorting search results (optional, default to 'relevance') * @param int $offset The offset into the search. Skips this number of results (optional, default to 0) * @param int $limit The number of results returned by the search (optional, default to 10) - * @param string $filters A list of filters relating to the properties of a project. Facets are generally recommended over filters. (optional) (deprecated) - * @param string $version A list of filters relating to the versions of a project. Use of facets for filtering by version is recommended (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchProjects'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchProjectsAsyncWithHttpInfo($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, $filters = null, $version = null, string $contentType = self::contentTypes['searchProjects'][0]) + public function searchProjectsAsyncWithHttpInfo($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, string $contentType = self::contentTypes['searchProjects'][0]) { $returnType = '\Aternos\ModrinthApi\Model\SearchResults'; - $request = $this->searchProjectsRequest($query, $facets, $index, $offset, $limit, $filters, $version, $contentType); + $request = $this->searchProjectsRequest($query, $facets, $index, $offset, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4980,14 +5188,12 @@ function ($exception) { * @param string $index The sorting method used for sorting search results (optional, default to 'relevance') * @param int $offset The offset into the search. Skips this number of results (optional, default to 0) * @param int $limit The number of results returned by the search (optional, default to 10) - * @param string $filters A list of filters relating to the properties of a project. Facets are generally recommended over filters. (optional) (deprecated) - * @param string $version A list of filters relating to the versions of a project. Use of facets for filtering by version is recommended (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchProjects'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchProjectsRequest($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, $filters = null, $version = null, string $contentType = self::contentTypes['searchProjects'][0]) + public function searchProjectsRequest($query = null, $facets = null, $index = 'relevance', $offset = 0, $limit = 10, string $contentType = self::contentTypes['searchProjects'][0]) { @@ -5002,8 +5208,6 @@ public function searchProjectsRequest($query = null, $facets = null, $index = 'r } - - $resourcePath = '/search'; $formParams = []; $queryParams = []; @@ -5056,24 +5260,6 @@ public function searchProjectsRequest($query = null, $facets = null, $index = 'r true, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filters, - 'filters', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $version, - 'version', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); @@ -5139,7 +5325,7 @@ public function searchProjectsRequest($query = null, $facets = null, $index = 'r * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unfollowProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -5156,7 +5342,7 @@ public function unfollowProject($id_slug, string $contentType = self::contentTyp * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unfollowProject'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ diff --git a/lib/Api/TagsApi.php b/lib/Api/TagsApi.php index 3877a59..d070170 100644 --- a/lib/Api/TagsApi.php +++ b/lib/Api/TagsApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -154,7 +154,7 @@ public function getConfig() * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['categoryList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\CategoryTag[] */ @@ -171,7 +171,7 @@ public function categoryList(string $contentType = self::contentTypes['categoryL * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['categoryList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\CategoryTag[], HTTP status code, HTTP response headers (array of strings) */ @@ -221,7 +221,19 @@ public function categoryListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\CategoryTag[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -238,7 +250,19 @@ public function categoryListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -417,7 +441,7 @@ public function categoryListRequest(string $contentType = self::contentTypes['ca * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['donationPlatformList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\DonationPlatformTag[] */ @@ -434,7 +458,7 @@ public function donationPlatformList(string $contentType = self::contentTypes['d * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['donationPlatformList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\DonationPlatformTag[], HTTP status code, HTTP response headers (array of strings) */ @@ -484,7 +508,19 @@ public function donationPlatformListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\DonationPlatformTag[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -501,7 +537,19 @@ public function donationPlatformListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -680,7 +728,7 @@ public function donationPlatformListRequest(string $contentType = self::contentT * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['licenseList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\LicenseTag[] * @deprecated @@ -698,7 +746,7 @@ public function licenseList(string $contentType = self::contentTypes['licenseLis * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['licenseList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\LicenseTag[], HTTP status code, HTTP response headers (array of strings) * @deprecated @@ -749,7 +797,19 @@ public function licenseListWithHttpInfo(string $contentType = self::contentTypes } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\LicenseTag[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -766,7 +826,19 @@ public function licenseListWithHttpInfo(string $contentType = self::contentTypes } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -949,9 +1021,9 @@ public function licenseListRequest(string $contentType = self::contentTypes['lic * @param string $id The license ID to get the text of (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['licenseText'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Aternos\ModrinthApi\Model\LicenseText200Response|\Aternos\ModrinthApi\Model\InvalidInputError + * @return \Aternos\ModrinthApi\Model\License|\Aternos\ModrinthApi\Model\InvalidInputError */ public function licenseText($id, string $contentType = self::contentTypes['licenseText'][0]) { @@ -967,9 +1039,9 @@ public function licenseText($id, string $contentType = self::contentTypes['licen * @param string $id The license ID to get the text of (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['licenseText'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Aternos\ModrinthApi\Model\LicenseText200Response|\Aternos\ModrinthApi\Model\InvalidInputError, HTTP status code, HTTP response headers (array of strings) + * @return array of \Aternos\ModrinthApi\Model\License|\Aternos\ModrinthApi\Model\InvalidInputError, HTTP status code, HTTP response headers (array of strings) */ public function licenseTextWithHttpInfo($id, string $contentType = self::contentTypes['licenseText'][0]) { @@ -1012,17 +1084,29 @@ public function licenseTextWithHttpInfo($id, string $contentType = self::content switch($statusCode) { case 200: - if ('\Aternos\ModrinthApi\Model\LicenseText200Response' === '\SplFileObject') { + if ('\Aternos\ModrinthApi\Model\License' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\ModrinthApi\Model\LicenseText200Response' !== 'string') { - $content = json_decode($content); + if ('\Aternos\ModrinthApi\Model\License' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } return [ - ObjectSerializer::deserialize($content, '\Aternos\ModrinthApi\Model\LicenseText200Response', []), + ObjectSerializer::deserialize($content, '\Aternos\ModrinthApi\Model\License', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1032,7 +1116,19 @@ public function licenseTextWithHttpInfo($id, string $contentType = self::content } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1043,13 +1139,25 @@ public function licenseTextWithHttpInfo($id, string $contentType = self::content ]; } - $returnType = '\Aternos\ModrinthApi\Model\LicenseText200Response'; + $returnType = '\Aternos\ModrinthApi\Model\License'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1064,7 +1172,7 @@ public function licenseTextWithHttpInfo($id, string $contentType = self::content case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\ModrinthApi\Model\LicenseText200Response', + '\Aternos\ModrinthApi\Model\License', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1116,7 +1224,7 @@ function ($response) { */ public function licenseTextAsyncWithHttpInfo($id, string $contentType = self::contentTypes['licenseText'][0]) { - $returnType = '\Aternos\ModrinthApi\Model\LicenseText200Response'; + $returnType = '\Aternos\ModrinthApi\Model\License'; $request = $this->licenseTextRequest($id, $contentType); return $this->client @@ -1254,7 +1362,7 @@ public function licenseTextRequest($id, string $contentType = self::contentTypes * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loaderList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\LoaderTag[] */ @@ -1271,7 +1379,7 @@ public function loaderList(string $contentType = self::contentTypes['loaderList' * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loaderList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\LoaderTag[], HTTP status code, HTTP response headers (array of strings) */ @@ -1321,7 +1429,19 @@ public function loaderListWithHttpInfo(string $contentType = self::contentTypes[ } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\LoaderTag[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1338,7 +1458,19 @@ public function loaderListWithHttpInfo(string $contentType = self::contentTypes[ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1517,7 +1649,7 @@ public function loaderListRequest(string $contentType = self::contentTypes['load * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['projectTypeList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string[] */ @@ -1534,7 +1666,7 @@ public function projectTypeList(string $contentType = self::contentTypes['projec * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['projectTypeList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string[], HTTP status code, HTTP response headers (array of strings) */ @@ -1584,7 +1716,19 @@ public function projectTypeListWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ('string[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1601,7 +1745,19 @@ public function projectTypeListWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1780,7 +1936,7 @@ public function projectTypeListRequest(string $contentType = self::contentTypes[ * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportTypeList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string[] */ @@ -1797,7 +1953,7 @@ public function reportTypeList(string $contentType = self::contentTypes['reportT * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportTypeList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string[], HTTP status code, HTTP response headers (array of strings) */ @@ -1847,7 +2003,19 @@ public function reportTypeListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('string[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1864,7 +2032,19 @@ public function reportTypeListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2043,7 +2223,7 @@ public function reportTypeListRequest(string $contentType = self::contentTypes[' * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sideTypeList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string[] */ @@ -2060,7 +2240,7 @@ public function sideTypeList(string $contentType = self::contentTypes['sideTypeL * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sideTypeList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string[], HTTP status code, HTTP response headers (array of strings) */ @@ -2110,7 +2290,19 @@ public function sideTypeListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ('string[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2127,7 +2319,19 @@ public function sideTypeListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2306,7 +2510,7 @@ public function sideTypeListRequest(string $contentType = self::contentTypes['si * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['versionList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\GameVersionTag[] */ @@ -2323,7 +2527,7 @@ public function versionList(string $contentType = self::contentTypes['versionLis * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['versionList'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\GameVersionTag[], HTTP status code, HTTP response headers (array of strings) */ @@ -2373,7 +2577,19 @@ public function versionListWithHttpInfo(string $contentType = self::contentTypes } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\GameVersionTag[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2390,7 +2606,19 @@ public function versionListWithHttpInfo(string $contentType = self::contentTypes } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/lib/Api/TeamsApi.php b/lib/Api/TeamsApi.php index 70bb8ed..ae90a81 100644 --- a/lib/Api/TeamsApi.php +++ b/lib/Api/TeamsApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -153,7 +153,7 @@ public function getConfig() * @param \Aternos\ModrinthApi\Model\UserIdentifier $user_identifier User to be added (must be the ID, usernames cannot be used here) (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addTeamMember'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -171,7 +171,7 @@ public function addTeamMember($id, $user_identifier = null, string $contentType * @param \Aternos\ModrinthApi\Model\UserIdentifier $user_identifier User to be added (must be the ID, usernames cannot be used here) (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addTeamMember'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -408,7 +408,7 @@ public function addTeamMemberRequest($id, $user_identifier = null, string $conte * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTeamMember'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -426,7 +426,7 @@ public function deleteTeamMember($id, $id_username, string $contentType = self:: * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTeamMember'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -669,7 +669,7 @@ public function deleteTeamMemberRequest($id, $id_username, string $contentType = * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectTeamMembers'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\TeamMember[] */ @@ -687,7 +687,7 @@ public function getProjectTeamMembers($id_slug, string $contentType = self::cont * @param string $id_slug The ID or slug of the project (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectTeamMembers'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\TeamMember[], HTTP status code, HTTP response headers (array of strings) */ @@ -737,7 +737,19 @@ public function getProjectTeamMembersWithHttpInfo($id_slug, string $contentType } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\TeamMember[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -754,7 +766,19 @@ public function getProjectTeamMembersWithHttpInfo($id_slug, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -952,7 +976,7 @@ public function getProjectTeamMembersRequest($id_slug, string $contentType = sel * @param string $id The ID of the team (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTeamMembers'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\TeamMember[] */ @@ -970,7 +994,7 @@ public function getTeamMembers($id, string $contentType = self::contentTypes['ge * @param string $id The ID of the team (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTeamMembers'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\TeamMember[], HTTP status code, HTTP response headers (array of strings) */ @@ -1020,7 +1044,19 @@ public function getTeamMembersWithHttpInfo($id, string $contentType = self::cont } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\TeamMember[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1037,7 +1073,19 @@ public function getTeamMembersWithHttpInfo($id, string $contentType = self::cont } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1240,7 +1288,7 @@ public function getTeamMembersRequest($id, string $contentType = self::contentTy * @param string $ids The IDs of the teams (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTeams'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\TeamMember[][] */ @@ -1258,7 +1306,7 @@ public function getTeams($ids, string $contentType = self::contentTypes['getTeam * @param string $ids The IDs of the teams (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTeams'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\TeamMember[][], HTTP status code, HTTP response headers (array of strings) */ @@ -1308,7 +1356,19 @@ public function getTeamsWithHttpInfo($ids, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\TeamMember[][]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1325,7 +1385,19 @@ public function getTeamsWithHttpInfo($ids, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1524,7 +1596,7 @@ public function getTeamsRequest($ids, string $contentType = self::contentTypes[' * @param string $id The ID of the team (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['joinTeam'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -1541,7 +1613,7 @@ public function joinTeam($id, string $contentType = self::contentTypes['joinTeam * @param string $id The ID of the team (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['joinTeam'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -1768,7 +1840,7 @@ public function joinTeamRequest($id, string $contentType = self::contentTypes['j * @param \Aternos\ModrinthApi\Model\ModifyTeamMemberBody $modify_team_member_body Contents to be modified (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyTeamMember'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -1787,7 +1859,7 @@ public function modifyTeamMember($id, $id_username, $modify_team_member_body = n * @param \Aternos\ModrinthApi\Model\ModifyTeamMemberBody $modify_team_member_body Contents to be modified (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyTeamMember'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -2042,7 +2114,7 @@ public function modifyTeamMemberRequest($id, $id_username, $modify_team_member_b * @param \Aternos\ModrinthApi\Model\UserIdentifier $user_identifier New owner's ID (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferTeamOwnership'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -2060,7 +2132,7 @@ public function transferTeamOwnership($id, $user_identifier = null, string $cont * @param \Aternos\ModrinthApi\Model\UserIdentifier $user_identifier New owner's ID (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferTeamOwnership'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ diff --git a/lib/Api/ThreadsApi.php b/lib/Api/ThreadsApi.php index 96ec9e6..f455562 100644 --- a/lib/Api/ThreadsApi.php +++ b/lib/Api/ThreadsApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -155,7 +155,7 @@ public function getConfig() * @param string $id The ID of the message (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteThreadMessage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -172,7 +172,7 @@ public function deleteThreadMessage($id, string $contentType = self::contentType * @param string $id The ID of the message (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteThreadMessage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -397,7 +397,7 @@ public function deleteThreadMessageRequest($id, string $contentType = self::cont * @param int $count count (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpenReports'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Report[]|\Aternos\ModrinthApi\Model\AuthError */ @@ -415,7 +415,7 @@ public function getOpenReports($count = null, string $contentType = self::conten * @param int $count (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpenReports'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Report[]|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -465,7 +465,19 @@ public function getOpenReportsWithHttpInfo($count = null, string $contentType = } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Report[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -480,7 +492,19 @@ public function getOpenReportsWithHttpInfo($count = null, string $contentType = } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -497,7 +521,19 @@ public function getOpenReportsWithHttpInfo($count = null, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -703,7 +739,7 @@ public function getOpenReportsRequest($count = null, string $contentType = self: * @param string $id The ID of the report (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReport'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Report|\Aternos\ModrinthApi\Model\AuthError */ @@ -721,7 +757,7 @@ public function getReport($id, string $contentType = self::contentTypes['getRepo * @param string $id The ID of the report (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReport'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Report|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -771,7 +807,19 @@ public function getReportWithHttpInfo($id, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Report' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -786,7 +834,19 @@ public function getReportWithHttpInfo($id, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -803,7 +863,19 @@ public function getReportWithHttpInfo($id, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1014,7 +1086,7 @@ public function getReportRequest($id, string $contentType = self::contentTypes[' * @param string $ids The IDs of the reports (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReports'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Report[]|\Aternos\ModrinthApi\Model\AuthError */ @@ -1032,7 +1104,7 @@ public function getReports($ids, string $contentType = self::contentTypes['getRe * @param string $ids The IDs of the reports (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReports'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Report[]|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -1082,7 +1154,19 @@ public function getReportsWithHttpInfo($ids, string $contentType = self::content } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Report[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1097,7 +1181,19 @@ public function getReportsWithHttpInfo($ids, string $contentType = self::content } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1114,7 +1210,19 @@ public function getReportsWithHttpInfo($ids, string $contentType = self::content } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1326,7 +1434,7 @@ public function getReportsRequest($ids, string $contentType = self::contentTypes * @param string $id The ID of the thread (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getThread'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Thread */ @@ -1344,7 +1452,7 @@ public function getThread($id, string $contentType = self::contentTypes['getThre * @param string $id The ID of the thread (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getThread'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Thread, HTTP status code, HTTP response headers (array of strings) */ @@ -1394,7 +1502,19 @@ public function getThreadWithHttpInfo($id, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Thread' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1411,7 +1531,19 @@ public function getThreadWithHttpInfo($id, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1614,7 +1746,7 @@ public function getThreadRequest($id, string $contentType = self::contentTypes[' * @param string $ids The IDs of the threads (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getThreads'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Thread[] */ @@ -1632,7 +1764,7 @@ public function getThreads($ids, string $contentType = self::contentTypes['getTh * @param string $ids The IDs of the threads (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getThreads'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Thread[], HTTP status code, HTTP response headers (array of strings) */ @@ -1682,7 +1814,19 @@ public function getThreadsWithHttpInfo($ids, string $contentType = self::content } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Thread[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1699,7 +1843,19 @@ public function getThreadsWithHttpInfo($ids, string $contentType = self::content } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1904,7 +2060,7 @@ public function getThreadsRequest($ids, string $contentType = self::contentTypes * @param \Aternos\ModrinthApi\Model\ModifyReportRequest $modify_report_request What to modify about the report (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyReport'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -1922,7 +2078,7 @@ public function modifyReport($id, $modify_report_request = null, string $content * @param \Aternos\ModrinthApi\Model\ModifyReportRequest $modify_report_request What to modify about the report (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyReport'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -2167,7 +2323,7 @@ public function modifyReportRequest($id, $modify_report_request = null, string $ * @param \Aternos\ModrinthApi\Model\ThreadMessageBody $thread_message_body The message to be sent. Note that you only need the fields applicable for the `text` type. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendThreadMessage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Thread|\Aternos\ModrinthApi\Model\InvalidInputError */ @@ -2186,7 +2342,7 @@ public function sendThreadMessage($id, $thread_message_body = null, string $cont * @param \Aternos\ModrinthApi\Model\ThreadMessageBody $thread_message_body The message to be sent. Note that you only need the fields applicable for the `text` type. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendThreadMessage'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Thread|\Aternos\ModrinthApi\Model\InvalidInputError, HTTP status code, HTTP response headers (array of strings) */ @@ -2236,7 +2392,19 @@ public function sendThreadMessageWithHttpInfo($id, $thread_message_body = null, } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Thread' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2251,7 +2419,19 @@ public function sendThreadMessageWithHttpInfo($id, $thread_message_body = null, } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2268,7 +2448,19 @@ public function sendThreadMessageWithHttpInfo($id, $thread_message_body = null, } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2490,7 +2682,7 @@ public function sendThreadMessageRequest($id, $thread_message_body = null, strin * @param \Aternos\ModrinthApi\Model\CreatableReport $creatable_report The report to be sent (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReport'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Report|\Aternos\ModrinthApi\Model\InvalidInputError|\Aternos\ModrinthApi\Model\AuthError */ @@ -2508,7 +2700,7 @@ public function submitReport($creatable_report = null, string $contentType = sel * @param \Aternos\ModrinthApi\Model\CreatableReport $creatable_report The report to be sent (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReport'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Report|\Aternos\ModrinthApi\Model\InvalidInputError|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -2558,7 +2750,19 @@ public function submitReportWithHttpInfo($creatable_report = null, string $conte } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Report' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2573,7 +2777,19 @@ public function submitReportWithHttpInfo($creatable_report = null, string $conte } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2588,7 +2804,19 @@ public function submitReportWithHttpInfo($creatable_report = null, string $conte } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2605,7 +2833,19 @@ public function submitReportWithHttpInfo($creatable_report = null, string $conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/lib/Api/UsersApi.php b/lib/Api/UsersApi.php index 5f4362c..43ec989 100644 --- a/lib/Api/UsersApi.php +++ b/lib/Api/UsersApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -94,9 +94,6 @@ class UsersApi 'getUserFromAuth' => [ 'application/json', ], - 'getNotifications' => [ - 'application/json', - ], 'getUserProjects' => [ 'application/json', ], @@ -166,7 +163,7 @@ public function getConfig() * @param \SplFileObject $body body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeUserIcon'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -184,7 +181,7 @@ public function changeUserIcon($id_username, $body = null, string $contentType = * @param \SplFileObject $body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeUserIcon'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -420,7 +417,7 @@ public function changeUserIconRequest($id_username, $body = null, string $conten * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFollowedProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Project[]|\Aternos\ModrinthApi\Model\AuthError */ @@ -438,7 +435,7 @@ public function getFollowedProjects($id_username, string $contentType = self::co * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFollowedProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Project[]|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -488,7 +485,19 @@ public function getFollowedProjectsWithHttpInfo($id_username, string $contentTyp } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Project[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -503,7 +512,19 @@ public function getFollowedProjectsWithHttpInfo($id_username, string $contentTyp } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -520,7 +541,19 @@ public function getFollowedProjectsWithHttpInfo($id_username, string $contentTyp } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -731,7 +764,7 @@ public function getFollowedProjectsRequest($id_username, string $contentType = s * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayoutHistory'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\UserPayoutHistory|\Aternos\ModrinthApi\Model\AuthError */ @@ -749,7 +782,7 @@ public function getPayoutHistory($id_username, string $contentType = self::conte * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayoutHistory'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\UserPayoutHistory|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -799,7 +832,19 @@ public function getPayoutHistoryWithHttpInfo($id_username, string $contentType = } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\UserPayoutHistory' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -814,7 +859,19 @@ public function getPayoutHistoryWithHttpInfo($id_username, string $contentType = } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -831,7 +888,19 @@ public function getPayoutHistoryWithHttpInfo($id_username, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1042,7 +1111,7 @@ public function getPayoutHistoryRequest($id_username, string $contentType = self * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUser'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\User */ @@ -1060,7 +1129,7 @@ public function getUser($id_username, string $contentType = self::contentTypes[' * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUser'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\User, HTTP status code, HTTP response headers (array of strings) */ @@ -1110,7 +1179,19 @@ public function getUserWithHttpInfo($id_username, string $contentType = self::co } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\User' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1127,7 +1208,19 @@ public function getUserWithHttpInfo($id_username, string $contentType = self::co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1324,7 +1417,7 @@ public function getUserRequest($id_username, string $contentType = self::content * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserFromAuth'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\User|\Aternos\ModrinthApi\Model\AuthError */ @@ -1341,7 +1434,7 @@ public function getUserFromAuth(string $contentType = self::contentTypes['getUse * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserFromAuth'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\User|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -1391,7 +1484,19 @@ public function getUserFromAuthWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\User' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1406,7 +1511,19 @@ public function getUserFromAuthWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1423,7 +1540,19 @@ public function getUserFromAuthWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1550,322 +1679,6 @@ public function getUserFromAuthRequest(string $contentType = self::contentTypes[ - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - if ($apiKey !== null) { - $headers['Authorization'] = $apiKey; - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getNotifications - * - * Get user's notifications - * - * @param string $id_username The ID or username of the user (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotifications'] to see the possible values for this operation - * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Aternos\ModrinthApi\Model\Notification[]|\Aternos\ModrinthApi\Model\AuthError - * @deprecated Moved to {@link \Aternos\ModrinthApi\Api\NotificationsApi::getUserNotifications} - */ - public function getNotifications($id_username, string $contentType = self::contentTypes['getNotifications'][0]) - { - list($response) = $this->getNotificationsWithHttpInfo($id_username, $contentType); - return $response; - } - - /** - * Operation getNotificationsWithHttpInfo - * - * Get user's notifications - * - * @param string $id_username The ID or username of the user (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotifications'] to see the possible values for this operation - * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Aternos\ModrinthApi\Model\Notification[]|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) - * @deprecated Moved to {@link \Aternos\ModrinthApi\Api\NotificationsApi::getUserNotifications} - */ - public function getNotificationsWithHttpInfo($id_username, string $contentType = self::contentTypes['getNotifications'][0]) - { - $request = $this->getNotificationsRequest($id_username, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\Aternos\ModrinthApi\Model\Notification[]' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Aternos\ModrinthApi\Model\Notification[]' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Aternos\ModrinthApi\Model\Notification[]', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\Aternos\ModrinthApi\Model\AuthError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Aternos\ModrinthApi\Model\AuthError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\Aternos\ModrinthApi\Model\Notification[]'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Aternos\ModrinthApi\Model\Notification[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Aternos\ModrinthApi\Model\AuthError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getNotificationsAsync - * - * Get user's notifications - * - * @param string $id_username The ID or username of the user (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotifications'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated Moved to {@link \Aternos\ModrinthApi\Api\NotificationsApi::getUserNotifications} - */ - public function getNotificationsAsync($id_username, string $contentType = self::contentTypes['getNotifications'][0]) - { - return $this->getNotificationsAsyncWithHttpInfo($id_username, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getNotificationsAsyncWithHttpInfo - * - * Get user's notifications - * - * @param string $id_username The ID or username of the user (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotifications'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated Moved to {@link \Aternos\ModrinthApi\Api\NotificationsApi::getUserNotifications} - */ - public function getNotificationsAsyncWithHttpInfo($id_username, string $contentType = self::contentTypes['getNotifications'][0]) - { - $returnType = '\Aternos\ModrinthApi\Model\Notification[]'; - $request = $this->getNotificationsRequest($id_username, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getNotifications' - * - * @param string $id_username The ID or username of the user (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNotifications'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - * @deprecated Moved to {@link \Aternos\ModrinthApi\Api\NotificationsApi::getUserNotifications} - */ - public function getNotificationsRequest($id_username, string $contentType = self::contentTypes['getNotifications'][0]) - { - - // verify the required parameter 'id_username' is set - if ($id_username === null || (is_array($id_username) && count($id_username) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id_username when calling getNotifications' - ); - } - - - $resourcePath = '/user/{id|username}/notifications'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($id_username !== null) { - $resourcePath = str_replace( - '{' . 'id|username' . '}', - ObjectSerializer::toPathValue($id_username), - $resourcePath - ); - } - - $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -1932,7 +1745,7 @@ public function getNotificationsRequest($id_username, string $contentType = self * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Project[] */ @@ -1950,7 +1763,7 @@ public function getUserProjects($id_username, string $contentType = self::conten * @param string $id_username The ID or username of the user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserProjects'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Project[], HTTP status code, HTTP response headers (array of strings) */ @@ -2000,7 +1813,19 @@ public function getUserProjectsWithHttpInfo($id_username, string $contentType = } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Project[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2017,7 +1842,19 @@ public function getUserProjectsWithHttpInfo($id_username, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2215,7 +2052,7 @@ public function getUserProjectsRequest($id_username, string $contentType = self: * @param string $ids The IDs of the users (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsers'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\User[] */ @@ -2233,7 +2070,7 @@ public function getUsers($ids, string $contentType = self::contentTypes['getUser * @param string $ids The IDs of the users (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsers'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\User[], HTTP status code, HTTP response headers (array of strings) */ @@ -2283,7 +2120,19 @@ public function getUsersWithHttpInfo($ids, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\User[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2300,7 +2149,19 @@ public function getUsersWithHttpInfo($ids, string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2500,7 +2361,7 @@ public function getUsersRequest($ids, string $contentType = self::contentTypes[' * @param \Aternos\ModrinthApi\Model\EditableUser $editable_user Modified user fields (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyUser'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -2518,7 +2379,7 @@ public function modifyUser($id_username, $editable_user = null, string $contentT * @param \Aternos\ModrinthApi\Model\EditableUser $editable_user Modified user fields (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyUser'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -2755,7 +2616,7 @@ public function modifyUserRequest($id_username, $editable_user = null, string $c * @param int $amount Amount to withdraw (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['withdrawPayout'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -2773,7 +2634,7 @@ public function withdrawPayout($id_username, $amount, string $contentType = self * @param int $amount Amount to withdraw (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['withdrawPayout'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ diff --git a/lib/Api/VersionFilesApi.php b/lib/Api/VersionFilesApi.php index d6d9c13..a8e2277 100644 --- a/lib/Api/VersionFilesApi.php +++ b/lib/Api/VersionFilesApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -145,7 +145,7 @@ public function getConfig() * @param string $version_id Version ID to delete the version from, if multiple files of the same hash exist (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFileFromHash'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -164,7 +164,7 @@ public function deleteFileFromHash($hash, $algorithm, $version_id = null, string * @param string $version_id Version ID to delete the version from, if multiple files of the same hash exist (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFileFromHash'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -423,7 +423,7 @@ public function deleteFileFromHashRequest($hash, $algorithm, $version_id = null, * @param \Aternos\ModrinthApi\Model\GetLatestVersionFromHashBody $get_latest_version_from_hash_body Parameters of the updated version requested (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersionFromHash'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Version */ @@ -443,7 +443,7 @@ public function getLatestVersionFromHash($hash, $algorithm, $get_latest_version_ * @param \Aternos\ModrinthApi\Model\GetLatestVersionFromHashBody $get_latest_version_from_hash_body Parameters of the updated version requested (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersionFromHash'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Version, HTTP status code, HTTP response headers (array of strings) */ @@ -493,7 +493,19 @@ public function getLatestVersionFromHashWithHttpInfo($hash, $algorithm, $get_lat } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Version' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -510,7 +522,19 @@ public function getLatestVersionFromHashWithHttpInfo($hash, $algorithm, $get_lat } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -738,7 +762,7 @@ public function getLatestVersionFromHashRequest($hash, $algorithm, $get_latest_v * @param \Aternos\ModrinthApi\Model\GetLatestVersionsFromHashesBody $get_latest_versions_from_hashes_body Parameters of the updated version requested (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersionsFromHashes'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array */ @@ -756,7 +780,7 @@ public function getLatestVersionsFromHashes($get_latest_versions_from_hashes_bod * @param \Aternos\ModrinthApi\Model\GetLatestVersionsFromHashesBody $get_latest_versions_from_hashes_body Parameters of the updated version requested (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersionsFromHashes'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of array, HTTP status code, HTTP response headers (array of strings) */ @@ -806,7 +830,19 @@ public function getLatestVersionsFromHashesWithHttpInfo($get_latest_versions_fro } else { $content = (string) $response->getBody(); if ('array' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -823,7 +859,19 @@ public function getLatestVersionsFromHashesWithHttpInfo($get_latest_versions_fro } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1016,7 +1064,7 @@ public function getLatestVersionsFromHashesRequest($get_latest_versions_from_has * @param bool $multiple Whether to return multiple results when looking for this hash (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['versionFromHash'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Version */ @@ -1036,7 +1084,7 @@ public function versionFromHash($hash, $algorithm, $multiple = false, string $co * @param bool $multiple Whether to return multiple results when looking for this hash (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['versionFromHash'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Version, HTTP status code, HTTP response headers (array of strings) */ @@ -1086,7 +1134,19 @@ public function versionFromHashWithHttpInfo($hash, $algorithm, $multiple = false } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Version' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1103,7 +1163,19 @@ public function versionFromHashWithHttpInfo($hash, $algorithm, $multiple = false } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1333,7 +1405,7 @@ public function versionFromHashRequest($hash, $algorithm, $multiple = false, str * @param \Aternos\ModrinthApi\Model\HashList $hash_list Hashes and algorithm of the versions requested (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['versionsFromHashes'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array */ @@ -1351,7 +1423,7 @@ public function versionsFromHashes($hash_list = null, string $contentType = self * @param \Aternos\ModrinthApi\Model\HashList $hash_list Hashes and algorithm of the versions requested (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['versionsFromHashes'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of array, HTTP status code, HTTP response headers (array of strings) */ @@ -1401,7 +1473,19 @@ public function versionsFromHashesWithHttpInfo($hash_list = null, string $conten } else { $content = (string) $response->getBody(); if ('array' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1418,7 +1502,19 @@ public function versionsFromHashesWithHttpInfo($hash_list = null, string $conten } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/lib/Api/VersionsApi.php b/lib/Api/VersionsApi.php index ecd3272..39e010e 100644 --- a/lib/Api/VersionsApi.php +++ b/lib/Api/VersionsApi.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -156,7 +156,7 @@ public function getConfig() * @param object $data data (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addFilesToVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -174,7 +174,7 @@ public function addFilesToVersion($id, $data = null, string $contentType = self: * @param object $data (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addFilesToVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -407,7 +407,7 @@ public function addFilesToVersionRequest($id, $data = null, string $contentType * @param \Aternos\ModrinthApi\Model\CreatableVersion $data data (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Version|\Aternos\ModrinthApi\Model\InvalidInputError|\Aternos\ModrinthApi\Model\AuthError */ @@ -425,7 +425,7 @@ public function createVersion($data, string $contentType = self::contentTypes['c * @param \Aternos\ModrinthApi\Model\CreatableVersion $data (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Version|\Aternos\ModrinthApi\Model\InvalidInputError|\Aternos\ModrinthApi\Model\AuthError, HTTP status code, HTTP response headers (array of strings) */ @@ -475,7 +475,19 @@ public function createVersionWithHttpInfo($data, string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Version' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -490,7 +502,19 @@ public function createVersionWithHttpInfo($data, string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\InvalidInputError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -505,7 +529,19 @@ public function createVersionWithHttpInfo($data, string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\AuthError' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -522,7 +558,19 @@ public function createVersionWithHttpInfo($data, string $contentType = self::con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -737,7 +785,7 @@ public function createVersionRequest($data, string $contentType = self::contentT * @param string $id The ID of the version (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -754,7 +802,7 @@ public function deleteVersion($id, string $contentType = self::contentTypes['del * @param string $id The ID of the version (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -977,12 +1025,12 @@ public function deleteVersionRequest($id, string $contentType = self::contentTyp * List project's versions * * @param string $id_slug The ID or slug of the project (required) - * @param string[] $loaders The types of loaders to filter for (optional) - * @param string[] $game_versions The game versions to filter for (optional) + * @param string $loaders The types of loaders to filter for (optional) + * @param string $game_versions The game versions to filter for (optional) * @param bool $featured Allows to filter for featured or non-featured versions only (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectVersions'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Version[] */ @@ -998,12 +1046,12 @@ public function getProjectVersions($id_slug, $loaders = null, $game_versions = n * List project's versions * * @param string $id_slug The ID or slug of the project (required) - * @param string[] $loaders The types of loaders to filter for (optional) - * @param string[] $game_versions The game versions to filter for (optional) + * @param string $loaders The types of loaders to filter for (optional) + * @param string $game_versions The game versions to filter for (optional) * @param bool $featured Allows to filter for featured or non-featured versions only (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectVersions'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Version[], HTTP status code, HTTP response headers (array of strings) */ @@ -1053,7 +1101,19 @@ public function getProjectVersionsWithHttpInfo($id_slug, $loaders = null, $game_ } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Version[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1070,7 +1130,19 @@ public function getProjectVersionsWithHttpInfo($id_slug, $loaders = null, $game_ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1101,8 +1173,8 @@ public function getProjectVersionsWithHttpInfo($id_slug, $loaders = null, $game_ * List project's versions * * @param string $id_slug The ID or slug of the project (required) - * @param string[] $loaders The types of loaders to filter for (optional) - * @param string[] $game_versions The game versions to filter for (optional) + * @param string $loaders The types of loaders to filter for (optional) + * @param string $game_versions The game versions to filter for (optional) * @param bool $featured Allows to filter for featured or non-featured versions only (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectVersions'] to see the possible values for this operation * @@ -1125,8 +1197,8 @@ function ($response) { * List project's versions * * @param string $id_slug The ID or slug of the project (required) - * @param string[] $loaders The types of loaders to filter for (optional) - * @param string[] $game_versions The game versions to filter for (optional) + * @param string $loaders The types of loaders to filter for (optional) + * @param string $game_versions The game versions to filter for (optional) * @param bool $featured Allows to filter for featured or non-featured versions only (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectVersions'] to see the possible values for this operation * @@ -1178,8 +1250,8 @@ function ($exception) { * Create request for operation 'getProjectVersions' * * @param string $id_slug The ID or slug of the project (required) - * @param string[] $loaders The types of loaders to filter for (optional) - * @param string[] $game_versions The game versions to filter for (optional) + * @param string $loaders The types of loaders to filter for (optional) + * @param string $game_versions The game versions to filter for (optional) * @param bool $featured Allows to filter for featured or non-featured versions only (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectVersions'] to see the possible values for this operation * @@ -1211,7 +1283,7 @@ public function getProjectVersionsRequest($id_slug, $loaders = null, $game_versi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $loaders, 'loaders', // param base name - 'array', // openApiType + 'string', // openApiType 'form', // style true, // explode false // required @@ -1220,7 +1292,7 @@ public function getProjectVersionsRequest($id_slug, $loaders = null, $game_versi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $game_versions, 'game_versions', // param base name - 'array', // openApiType + 'string', // openApiType 'form', // style true, // explode false // required @@ -1307,7 +1379,7 @@ public function getProjectVersionsRequest($id_slug, $loaders = null, $game_versi * @param string $id The ID of the version (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Version */ @@ -1325,7 +1397,7 @@ public function getVersion($id, string $contentType = self::contentTypes['getVer * @param string $id The ID of the version (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Version, HTTP status code, HTTP response headers (array of strings) */ @@ -1375,7 +1447,19 @@ public function getVersionWithHttpInfo($id, string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Version' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1392,7 +1476,19 @@ public function getVersionWithHttpInfo($id, string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1591,7 +1687,7 @@ public function getVersionRequest($id, string $contentType = self::contentTypes[ * @param string $id_number The version ID or version number (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionFromIdOrNumber'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Version */ @@ -1610,7 +1706,7 @@ public function getVersionFromIdOrNumber($id_slug, $id_number, string $contentTy * @param string $id_number The version ID or version number (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionFromIdOrNumber'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Version, HTTP status code, HTTP response headers (array of strings) */ @@ -1660,7 +1756,19 @@ public function getVersionFromIdOrNumberWithHttpInfo($id_slug, $id_number, strin } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Version' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1677,7 +1785,19 @@ public function getVersionFromIdOrNumberWithHttpInfo($id_slug, $id_number, strin } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1893,7 +2013,7 @@ public function getVersionFromIdOrNumberRequest($id_slug, $id_number, string $co * @param string $ids The IDs of the versions (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersions'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\ModrinthApi\Model\Version[] */ @@ -1911,7 +2031,7 @@ public function getVersions($ids, string $contentType = self::contentTypes['getV * @param string $ids The IDs of the versions (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersions'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\ModrinthApi\Model\Version[], HTTP status code, HTTP response headers (array of strings) */ @@ -1961,7 +2081,19 @@ public function getVersionsWithHttpInfo($ids, string $contentType = self::conten } else { $content = (string) $response->getBody(); if ('\Aternos\ModrinthApi\Model\Version[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1978,7 +2110,19 @@ public function getVersionsWithHttpInfo($ids, string $contentType = self::conten } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -2178,7 +2322,7 @@ public function getVersionsRequest($ids, string $contentType = self::contentType * @param \Aternos\ModrinthApi\Model\EditableVersion $editable_version Modified version fields (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -2196,7 +2340,7 @@ public function modifyVersion($id, $editable_version = null, string $contentType * @param \Aternos\ModrinthApi\Model\EditableVersion $editable_version Modified version fields (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -2433,7 +2577,7 @@ public function modifyVersionRequest($id, $editable_version = null, string $cont * @param \Aternos\ModrinthApi\Model\Schedule $schedule Information about date and requested status (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -2451,7 +2595,7 @@ public function scheduleVersion($id, $schedule = null, string $contentType = sel * @param \Aternos\ModrinthApi\Model\Schedule $schedule Information about date and requested status (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleVersion'] to see the possible values for this operation * - * @throws \Aternos\ModrinthApi\ApiException on non-2xx response + * @throws \Aternos\ModrinthApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ diff --git a/lib/ApiException.php b/lib/ApiException.php index 844c6b0..e848037 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Client/ModrinthAPIClient.php b/lib/Client/ModrinthAPIClient.php index f8d9a3e..91d1b7a 100644 --- a/lib/Client/ModrinthAPIClient.php +++ b/lib/Client/ModrinthAPIClient.php @@ -168,7 +168,6 @@ public function searchProjects(?ProjectSearchOptions $options = null): Paginated $options->getIndex()->value, $options->getOffset(), $options->getLimit(), - $options->getFilters(), ); return new PaginatedProjectSearchList($this, $options, $projects); diff --git a/lib/Client/Options/ProjectSearchOptions.php b/lib/Client/Options/ProjectSearchOptions.php index d28ba7b..f4c23f4 100644 --- a/lib/Client/Options/ProjectSearchOptions.php +++ b/lib/Client/Options/ProjectSearchOptions.php @@ -19,7 +19,6 @@ class ProjectSearchOptions * @param string|null $query The query to search for. * @param FacetANDGroup|FacetORGroup|null $facets The recommended way of filtering search results. * @param SearchIndex $index The sorting method used for sorting search results. - * @param string|null $filters A list of filters relating to the properties of a project. Use filters when there isn't an available facet for your needs. * @param int $offset The offset into the search. Skips this number of results. * @param int $limit The number of results returned by the search. */ @@ -27,7 +26,6 @@ public function __construct( protected ?string $query = null, FacetANDGroup|FacetORGroup|null $facets = null, protected SearchIndex $index = SearchIndex::RELEVANCE, - protected ?string $filters = null, protected int $offset = 0, protected int $limit = 50, ) @@ -92,24 +90,6 @@ public function setIndex(SearchIndex $index): static return $this; } - /** - * @return string|null - */ - public function getFilters(): ?string - { - return $this->filters; - } - - /** - * @param string|null $filters - * @return $this - */ - public function setFilters(?string $filters): static - { - $this->filters = $filters; - return $this; - } - /** * @return int */ diff --git a/lib/Configuration.php b/lib/Configuration.php index 84b2999..2612eb2 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -433,7 +433,7 @@ public static function toDebugReport() $report = 'PHP SDK (Aternos\ModrinthApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: v2.7.0/ec80c2b' . PHP_EOL; + $report .= ' The version of the OpenAPI document: v2.7.0/15cf3fc' . PHP_EOL; $report .= ' SDK Package Version: 1.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index ea9b2b5..2adc715 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -14,10 +14,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/AuthError.php b/lib/Model/AuthError.php index ea6363b..c9c980b 100644 --- a/lib/Model/AuthError.php +++ b/lib/Model/AuthError.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/BaseProject.php b/lib/Model/BaseProject.php index e839717..3495fbb 100644 --- a/lib/Model/BaseProject.php +++ b/lib/Model/BaseProject.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/BaseVersion.php b/lib/Model/BaseVersion.php index 43e952f..4e5fcad 100644 --- a/lib/Model/BaseVersion.php +++ b/lib/Model/BaseVersion.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/CategoryTag.php b/lib/Model/CategoryTag.php index da2dc97..f739a53 100644 --- a/lib/Model/CategoryTag.php +++ b/lib/Model/CategoryTag.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/CreatableProject.php b/lib/Model/CreatableProject.php index a715e63..58dc821 100644 --- a/lib/Model/CreatableProject.php +++ b/lib/Model/CreatableProject.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/CreatableProjectGalleryItem.php b/lib/Model/CreatableProjectGalleryItem.php index f28944b..bf6993b 100644 --- a/lib/Model/CreatableProjectGalleryItem.php +++ b/lib/Model/CreatableProjectGalleryItem.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/CreatableReport.php b/lib/Model/CreatableReport.php index 5a808de..ec81b5a 100644 --- a/lib/Model/CreatableReport.php +++ b/lib/Model/CreatableReport.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/CreatableVersion.php b/lib/Model/CreatableVersion.php index 47be770..117450c 100644 --- a/lib/Model/CreatableVersion.php +++ b/lib/Model/CreatableVersion.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/DonationPlatformTag.php b/lib/Model/DonationPlatformTag.php index ca6c629..3fbff36 100644 --- a/lib/Model/DonationPlatformTag.php +++ b/lib/Model/DonationPlatformTag.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/EditableFileType.php b/lib/Model/EditableFileType.php index 62c5dc9..f8f58f3 100644 --- a/lib/Model/EditableFileType.php +++ b/lib/Model/EditableFileType.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/EditableProject.php b/lib/Model/EditableProject.php index 15806e1..1eb9d49 100644 --- a/lib/Model/EditableProject.php +++ b/lib/Model/EditableProject.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/EditableProjectAllOf.php b/lib/Model/EditableProjectAllOf.php deleted file mode 100644 index a3538ae..0000000 --- a/lib/Model/EditableProjectAllOf.php +++ /dev/null @@ -1,458 +0,0 @@ - - */ -class EditableProjectAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'EditableProject_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'moderation_message' => 'string', - 'moderation_message_body' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'moderation_message' => null, - 'moderation_message_body' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'moderation_message' => true, - 'moderation_message_body' => true - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'moderation_message' => 'moderation_message', - 'moderation_message_body' => 'moderation_message_body' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'moderation_message' => 'setModerationMessage', - 'moderation_message_body' => 'setModerationMessageBody' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'moderation_message' => 'getModerationMessage', - 'moderation_message_body' => 'getModerationMessageBody' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('moderation_message', $data ?? [], null); - $this->setIfExists('moderation_message_body', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets moderation_message - * - * @return string|null - */ - public function getModerationMessage() - { - return $this->container['moderation_message']; - } - - /** - * Sets moderation_message - * - * @param string|null $moderation_message The title of the moderators' message for the project - * - * @return self - */ - public function setModerationMessage($moderation_message) - { - if (is_null($moderation_message)) { - array_push($this->openAPINullablesSetToNull, 'moderation_message'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('moderation_message', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['moderation_message'] = $moderation_message; - - return $this; - } - - /** - * Gets moderation_message_body - * - * @return string|null - */ - public function getModerationMessageBody() - { - return $this->container['moderation_message_body']; - } - - /** - * Sets moderation_message_body - * - * @param string|null $moderation_message_body The body of the moderators' message for the project - * - * @return self - */ - public function setModerationMessageBody($moderation_message_body) - { - if (is_null($moderation_message_body)) { - array_push($this->openAPINullablesSetToNull, 'moderation_message_body'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('moderation_message_body', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['moderation_message_body'] = $moderation_message_body; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/EditableUser.php b/lib/Model/EditableUser.php index 48437a2..9148335 100644 --- a/lib/Model/EditableUser.php +++ b/lib/Model/EditableUser.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/EditableVersion.php b/lib/Model/EditableVersion.php index 5823871..18c7563 100644 --- a/lib/Model/EditableVersion.php +++ b/lib/Model/EditableVersion.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ForgeUpdatesPromos.php b/lib/Model/ForgeUpdateCheckerPromos.php similarity index 97% rename from lib/Model/ForgeUpdatesPromos.php rename to lib/Model/ForgeUpdateCheckerPromos.php index 59f38d9..33cd38b 100644 --- a/lib/Model/ForgeUpdatesPromos.php +++ b/lib/Model/ForgeUpdateCheckerPromos.php @@ -1,6 +1,6 @@ */ -class ForgeUpdatesPromos implements ModelInterface, ArrayAccess, \JsonSerializable +class ForgeUpdateCheckerPromos implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -51,7 +51,7 @@ class ForgeUpdatesPromos implements ModelInterface, ArrayAccess, \JsonSerializab * * @var string */ - protected static $openAPIModelName = 'ForgeUpdatesPromos'; + protected static $openAPIModelName = 'ForgeUpdateCheckerPromos'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/ForgeUpdates.php b/lib/Model/ForgeUpdates.php index 0e1cb67..a895717 100644 --- a/lib/Model/ForgeUpdates.php +++ b/lib/Model/ForgeUpdates.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -60,7 +60,7 @@ class ForgeUpdates implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'homepage' => 'string', - 'promos' => '\Aternos\ModrinthApi\Model\ForgeUpdatesPromos' + 'promos' => '\Aternos\ModrinthApi\Model\ForgeUpdateCheckerPromos' ]; /** @@ -328,7 +328,7 @@ public function setHomepage($homepage) /** * Gets promos * - * @return \Aternos\ModrinthApi\Model\ForgeUpdatesPromos|null + * @return \Aternos\ModrinthApi\Model\ForgeUpdateCheckerPromos|null */ public function getPromos() { @@ -338,7 +338,7 @@ public function getPromos() /** * Sets promos * - * @param \Aternos\ModrinthApi\Model\ForgeUpdatesPromos|null $promos promos + * @param \Aternos\ModrinthApi\Model\ForgeUpdateCheckerPromos|null $promos promos * * @return self */ diff --git a/lib/Model/GalleryImage.php b/lib/Model/GalleryImage.php index d5fcf93..614299e 100644 --- a/lib/Model/GalleryImage.php +++ b/lib/Model/GalleryImage.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/GameVersionTag.php b/lib/Model/GameVersionTag.php index c44eff0..1514f33 100644 --- a/lib/Model/GameVersionTag.php +++ b/lib/Model/GameVersionTag.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/GetLatestVersionFromHashBody.php b/lib/Model/GetLatestVersionFromHashBody.php index 0da8c24..0844880 100644 --- a/lib/Model/GetLatestVersionFromHashBody.php +++ b/lib/Model/GetLatestVersionFromHashBody.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/GetLatestVersionsFromHashesBody.php b/lib/Model/GetLatestVersionsFromHashesBody.php index 4718dfc..39fa20e 100644 --- a/lib/Model/GetLatestVersionsFromHashesBody.php +++ b/lib/Model/GetLatestVersionsFromHashesBody.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/GetLatestVersionsFromHashesBodyAllOf.php b/lib/Model/GetLatestVersionsFromHashesBodyAllOf.php deleted file mode 100644 index 5a6aa2e..0000000 --- a/lib/Model/GetLatestVersionsFromHashesBodyAllOf.php +++ /dev/null @@ -1,450 +0,0 @@ - - */ -class GetLatestVersionsFromHashesBodyAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetLatestVersionsFromHashesBody_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'loaders' => 'string[]', - 'game_versions' => 'string[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'loaders' => null, - 'game_versions' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'loaders' => false, - 'game_versions' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'loaders' => 'loaders', - 'game_versions' => 'game_versions' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'loaders' => 'setLoaders', - 'game_versions' => 'setGameVersions' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'loaders' => 'getLoaders', - 'game_versions' => 'getGameVersions' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('loaders', $data ?? [], null); - $this->setIfExists('game_versions', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['loaders'] === null) { - $invalidProperties[] = "'loaders' can't be null"; - } - if ($this->container['game_versions'] === null) { - $invalidProperties[] = "'game_versions' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets loaders - * - * @return string[] - */ - public function getLoaders() - { - return $this->container['loaders']; - } - - /** - * Sets loaders - * - * @param string[] $loaders loaders - * - * @return self - */ - public function setLoaders($loaders) - { - if (is_null($loaders)) { - throw new \InvalidArgumentException('non-nullable loaders cannot be null'); - } - $this->container['loaders'] = $loaders; - - return $this; - } - - /** - * Gets game_versions - * - * @return string[] - */ - public function getGameVersions() - { - return $this->container['game_versions']; - } - - /** - * Sets game_versions - * - * @param string[] $game_versions game_versions - * - * @return self - */ - public function setGameVersions($game_versions) - { - if (is_null($game_versions)) { - throw new \InvalidArgumentException('non-nullable game_versions cannot be null'); - } - $this->container['game_versions'] = $game_versions; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/HashList.php b/lib/Model/HashList.php index 0c1bfd4..4cb36b1 100644 --- a/lib/Model/HashList.php +++ b/lib/Model/HashList.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/InvalidInputError.php b/lib/Model/InvalidInputError.php index 9e2f622..422e102 100644 --- a/lib/Model/InvalidInputError.php +++ b/lib/Model/InvalidInputError.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/LicenseText200Response.php b/lib/Model/License.php similarity index 97% rename from lib/Model/LicenseText200Response.php rename to lib/Model/License.php index a4000ca..a6f83af 100644 --- a/lib/Model/LicenseText200Response.php +++ b/lib/Model/License.php @@ -1,6 +1,6 @@ */ -class LicenseText200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class License implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -51,7 +51,7 @@ class LicenseText200Response implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'LicenseText200Response'; + protected static $openAPIModelName = 'License'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/LicenseList200ResponseInner.php b/lib/Model/LicenseList200ResponseInner.php deleted file mode 100644 index cb78fb3..0000000 --- a/lib/Model/LicenseList200ResponseInner.php +++ /dev/null @@ -1,450 +0,0 @@ - - */ -class LicenseList200ResponseInner implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'licenseList_200_response_inner'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'short' => 'string', - 'name' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'short' => null, - 'name' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'short' => false, - 'name' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'short' => 'short', - 'name' => 'name' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'short' => 'setShort', - 'name' => 'setName' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'short' => 'getShort', - 'name' => 'getName' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('short', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['short'] === null) { - $invalidProperties[] = "'short' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets short - * - * @return string - */ - public function getShort() - { - return $this->container['short']; - } - - /** - * Sets short - * - * @param string $short The short identifier of the license - * - * @return self - */ - public function setShort($short) - { - if (is_null($short)) { - throw new \InvalidArgumentException('non-nullable short cannot be null'); - } - $this->container['short'] = $short; - - return $this; - } - - /** - * Gets name - * - * @return string - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string $name The full name of the license - * - * @return self - */ - public function setName($name) - { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); - } - $this->container['name'] = $name; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/LicenseTag.php b/lib/Model/LicenseTag.php index b229b7a..b198d80 100644 --- a/lib/Model/LicenseTag.php +++ b/lib/Model/LicenseTag.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/LoaderTag.php b/lib/Model/LoaderTag.php index 44c4988..166ed06 100644 --- a/lib/Model/LoaderTag.php +++ b/lib/Model/LoaderTag.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index f8f33ab..fe8bacb 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ModeratorMessage.php b/lib/Model/ModeratorMessage.php index 4b6ed8e..51a44cc 100644 --- a/lib/Model/ModeratorMessage.php +++ b/lib/Model/ModeratorMessage.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ModifiableProject.php b/lib/Model/ModifiableProject.php index e69f2e4..33120a3 100644 --- a/lib/Model/ModifiableProject.php +++ b/lib/Model/ModifiableProject.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ModifiableProjectAllOf.php b/lib/Model/ModifiableProjectAllOf.php deleted file mode 100644 index 40fc303..0000000 --- a/lib/Model/ModifiableProjectAllOf.php +++ /dev/null @@ -1,451 +0,0 @@ - - */ -class ModifiableProjectAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ModifiableProject_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'license_id' => 'string', - 'license_url' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'license_id' => null, - 'license_url' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'license_id' => false, - 'license_url' => true - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'license_id' => 'license_id', - 'license_url' => 'license_url' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'license_id' => 'setLicenseId', - 'license_url' => 'setLicenseUrl' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'license_id' => 'getLicenseId', - 'license_url' => 'getLicenseUrl' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('license_id', $data ?? [], null); - $this->setIfExists('license_url', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets license_id - * - * @return string|null - */ - public function getLicenseId() - { - return $this->container['license_id']; - } - - /** - * Sets license_id - * - * @param string|null $license_id The SPDX license ID of a project - * - * @return self - */ - public function setLicenseId($license_id) - { - if (is_null($license_id)) { - throw new \InvalidArgumentException('non-nullable license_id cannot be null'); - } - $this->container['license_id'] = $license_id; - - return $this; - } - - /** - * Gets license_url - * - * @return string|null - */ - public function getLicenseUrl() - { - return $this->container['license_url']; - } - - /** - * Sets license_url - * - * @param string|null $license_url The URL to this license - * - * @return self - */ - public function setLicenseUrl($license_url) - { - if (is_null($license_url)) { - array_push($this->openAPINullablesSetToNull, 'license_url'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('license_url', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['license_url'] = $license_url; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/ModifyReportRequest.php b/lib/Model/ModifyReportRequest.php index 542d722..5b6d0fb 100644 --- a/lib/Model/ModifyReportRequest.php +++ b/lib/Model/ModifyReportRequest.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ModifyTeamMemberBody.php b/lib/Model/ModifyTeamMemberBody.php index 50a6294..ca83ec7 100644 --- a/lib/Model/ModifyTeamMemberBody.php +++ b/lib/Model/ModifyTeamMemberBody.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/NonSearchProject.php b/lib/Model/NonSearchProject.php index c615684..e1885eb 100644 --- a/lib/Model/NonSearchProject.php +++ b/lib/Model/NonSearchProject.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/NonSearchProjectAllOf.php b/lib/Model/NonSearchProjectAllOf.php deleted file mode 100644 index efc2d0c..0000000 --- a/lib/Model/NonSearchProjectAllOf.php +++ /dev/null @@ -1,807 +0,0 @@ - - */ -class NonSearchProjectAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'NonSearchProject_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'body' => 'string', - 'status' => 'string', - 'requested_status' => 'string', - 'additional_categories' => 'string[]', - 'issues_url' => 'string', - 'source_url' => 'string', - 'wiki_url' => 'string', - 'discord_url' => 'string', - 'donation_urls' => '\Aternos\ModrinthApi\Model\ProjectDonationURL[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'body' => null, - 'status' => null, - 'requested_status' => null, - 'additional_categories' => null, - 'issues_url' => null, - 'source_url' => null, - 'wiki_url' => null, - 'discord_url' => null, - 'donation_urls' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'body' => false, - 'status' => false, - 'requested_status' => true, - 'additional_categories' => false, - 'issues_url' => true, - 'source_url' => true, - 'wiki_url' => true, - 'discord_url' => true, - 'donation_urls' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'body' => 'body', - 'status' => 'status', - 'requested_status' => 'requested_status', - 'additional_categories' => 'additional_categories', - 'issues_url' => 'issues_url', - 'source_url' => 'source_url', - 'wiki_url' => 'wiki_url', - 'discord_url' => 'discord_url', - 'donation_urls' => 'donation_urls' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'body' => 'setBody', - 'status' => 'setStatus', - 'requested_status' => 'setRequestedStatus', - 'additional_categories' => 'setAdditionalCategories', - 'issues_url' => 'setIssuesUrl', - 'source_url' => 'setSourceUrl', - 'wiki_url' => 'setWikiUrl', - 'discord_url' => 'setDiscordUrl', - 'donation_urls' => 'setDonationUrls' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'body' => 'getBody', - 'status' => 'getStatus', - 'requested_status' => 'getRequestedStatus', - 'additional_categories' => 'getAdditionalCategories', - 'issues_url' => 'getIssuesUrl', - 'source_url' => 'getSourceUrl', - 'wiki_url' => 'getWikiUrl', - 'discord_url' => 'getDiscordUrl', - 'donation_urls' => 'getDonationUrls' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const STATUS_APPROVED = 'approved'; - public const STATUS_ARCHIVED = 'archived'; - public const STATUS_REJECTED = 'rejected'; - public const STATUS_DRAFT = 'draft'; - public const STATUS_UNLISTED = 'unlisted'; - public const STATUS_PROCESSING = 'processing'; - public const STATUS_WITHHELD = 'withheld'; - public const STATUS_SCHEDULED = 'scheduled'; - public const STATUS__PRIVATE = 'private'; - public const STATUS_UNKNOWN = 'unknown'; - public const REQUESTED_STATUS_APPROVED = 'approved'; - public const REQUESTED_STATUS_ARCHIVED = 'archived'; - public const REQUESTED_STATUS_UNLISTED = 'unlisted'; - public const REQUESTED_STATUS__PRIVATE = 'private'; - public const REQUESTED_STATUS_DRAFT = 'draft'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_APPROVED, - self::STATUS_ARCHIVED, - self::STATUS_REJECTED, - self::STATUS_DRAFT, - self::STATUS_UNLISTED, - self::STATUS_PROCESSING, - self::STATUS_WITHHELD, - self::STATUS_SCHEDULED, - self::STATUS__PRIVATE, - self::STATUS_UNKNOWN, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getRequestedStatusAllowableValues() - { - return [ - self::REQUESTED_STATUS_APPROVED, - self::REQUESTED_STATUS_ARCHIVED, - self::REQUESTED_STATUS_UNLISTED, - self::REQUESTED_STATUS__PRIVATE, - self::REQUESTED_STATUS_DRAFT, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('body', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('requested_status', $data ?? [], null); - $this->setIfExists('additional_categories', $data ?? [], null); - $this->setIfExists('issues_url', $data ?? [], null); - $this->setIfExists('source_url', $data ?? [], null); - $this->setIfExists('wiki_url', $data ?? [], null); - $this->setIfExists('discord_url', $data ?? [], null); - $this->setIfExists('donation_urls', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getRequestedStatusAllowableValues(); - if (!is_null($this->container['requested_status']) && !in_array($this->container['requested_status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'requested_status', must be one of '%s'", - $this->container['requested_status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets body - * - * @return string|null - */ - public function getBody() - { - return $this->container['body']; - } - - /** - * Sets body - * - * @param string|null $body A long form description of the project - * - * @return self - */ - public function setBody($body) - { - if (is_null($body)) { - throw new \InvalidArgumentException('non-nullable body cannot be null'); - } - $this->container['body'] = $body; - - return $this; - } - - /** - * Gets status - * - * @return string|null - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string|null $status The status of the project - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets requested_status - * - * @return string|null - */ - public function getRequestedStatus() - { - return $this->container['requested_status']; - } - - /** - * Sets requested_status - * - * @param string|null $requested_status The requested status when submitting for review or scheduling the project for release - * - * @return self - */ - public function setRequestedStatus($requested_status) - { - if (is_null($requested_status)) { - array_push($this->openAPINullablesSetToNull, 'requested_status'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('requested_status', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $allowedValues = $this->getRequestedStatusAllowableValues(); - if (!is_null($requested_status) && !in_array($requested_status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'requested_status', must be one of '%s'", - $requested_status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['requested_status'] = $requested_status; - - return $this; - } - - /** - * Gets additional_categories - * - * @return string[]|null - */ - public function getAdditionalCategories() - { - return $this->container['additional_categories']; - } - - /** - * Sets additional_categories - * - * @param string[]|null $additional_categories A list of categories which are searchable but non-primary - * - * @return self - */ - public function setAdditionalCategories($additional_categories) - { - if (is_null($additional_categories)) { - throw new \InvalidArgumentException('non-nullable additional_categories cannot be null'); - } - $this->container['additional_categories'] = $additional_categories; - - return $this; - } - - /** - * Gets issues_url - * - * @return string|null - */ - public function getIssuesUrl() - { - return $this->container['issues_url']; - } - - /** - * Sets issues_url - * - * @param string|null $issues_url An optional link to where to submit bugs or issues with the project - * - * @return self - */ - public function setIssuesUrl($issues_url) - { - if (is_null($issues_url)) { - array_push($this->openAPINullablesSetToNull, 'issues_url'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('issues_url', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['issues_url'] = $issues_url; - - return $this; - } - - /** - * Gets source_url - * - * @return string|null - */ - public function getSourceUrl() - { - return $this->container['source_url']; - } - - /** - * Sets source_url - * - * @param string|null $source_url An optional link to the source code of the project - * - * @return self - */ - public function setSourceUrl($source_url) - { - if (is_null($source_url)) { - array_push($this->openAPINullablesSetToNull, 'source_url'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('source_url', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['source_url'] = $source_url; - - return $this; - } - - /** - * Gets wiki_url - * - * @return string|null - */ - public function getWikiUrl() - { - return $this->container['wiki_url']; - } - - /** - * Sets wiki_url - * - * @param string|null $wiki_url An optional link to the project's wiki page or other relevant information - * - * @return self - */ - public function setWikiUrl($wiki_url) - { - if (is_null($wiki_url)) { - array_push($this->openAPINullablesSetToNull, 'wiki_url'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('wiki_url', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['wiki_url'] = $wiki_url; - - return $this; - } - - /** - * Gets discord_url - * - * @return string|null - */ - public function getDiscordUrl() - { - return $this->container['discord_url']; - } - - /** - * Sets discord_url - * - * @param string|null $discord_url An optional invite link to the project's discord - * - * @return self - */ - public function setDiscordUrl($discord_url) - { - if (is_null($discord_url)) { - array_push($this->openAPINullablesSetToNull, 'discord_url'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('discord_url', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['discord_url'] = $discord_url; - - return $this; - } - - /** - * Gets donation_urls - * - * @return \Aternos\ModrinthApi\Model\ProjectDonationURL[]|null - */ - public function getDonationUrls() - { - return $this->container['donation_urls']; - } - - /** - * Sets donation_urls - * - * @param \Aternos\ModrinthApi\Model\ProjectDonationURL[]|null $donation_urls A list of donation links for the project - * - * @return self - */ - public function setDonationUrls($donation_urls) - { - if (is_null($donation_urls)) { - throw new \InvalidArgumentException('non-nullable donation_urls cannot be null'); - } - $this->container['donation_urls'] = $donation_urls; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/Notification.php b/lib/Model/Notification.php index 720d126..34c05d8 100644 --- a/lib/Model/Notification.php +++ b/lib/Model/Notification.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/NotificationAction.php b/lib/Model/NotificationAction.php index ee0b70c..15f8a8a 100644 --- a/lib/Model/NotificationAction.php +++ b/lib/Model/NotificationAction.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -60,7 +60,7 @@ class NotificationAction implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'title' => 'string', - 'action_route' => 'array' + 'action_route' => 'string[]' ]; /** @@ -328,7 +328,7 @@ public function setTitle($title) /** * Gets action_route * - * @return array|null + * @return string[]|null */ public function getActionRoute() { @@ -338,7 +338,7 @@ public function getActionRoute() /** * Sets action_route * - * @param array|null $action_route The HTTP code and path to request in order to perform this action. + * @param string[]|null $action_route The HTTP code and path to request in order to perform this action. * * @return self */ diff --git a/lib/Model/PatchProjectsBody.php b/lib/Model/PatchProjectsBody.php index 1adbb5e..c380cf5 100644 --- a/lib/Model/PatchProjectsBody.php +++ b/lib/Model/PatchProjectsBody.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/Project.php b/lib/Model/Project.php index ff340aa..36239e0 100644 --- a/lib/Model/Project.php +++ b/lib/Model/Project.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ProjectAllOf.php b/lib/Model/ProjectAllOf.php deleted file mode 100644 index 4b0d5e2..0000000 --- a/lib/Model/ProjectAllOf.php +++ /dev/null @@ -1,899 +0,0 @@ - - */ -class ProjectAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Project_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id' => 'string', - 'team' => 'string', - 'body_url' => 'string', - 'moderator_message' => '\Aternos\ModrinthApi\Model\ModeratorMessage', - 'published' => 'string', - 'updated' => 'string', - 'approved' => 'string', - 'queued' => 'string', - 'followers' => 'int', - 'license' => '\Aternos\ModrinthApi\Model\ProjectLicense', - 'versions' => 'string[]', - 'game_versions' => 'string[]', - 'loaders' => 'string[]', - 'gallery' => '\Aternos\ModrinthApi\Model\GalleryImage[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id' => null, - 'team' => null, - 'body_url' => null, - 'moderator_message' => null, - 'published' => 'ISO-8601', - 'updated' => 'ISO-8601', - 'approved' => 'ISO-8601', - 'queued' => 'ISO-8601', - 'followers' => null, - 'license' => null, - 'versions' => null, - 'game_versions' => null, - 'loaders' => null, - 'gallery' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'id' => false, - 'team' => false, - 'body_url' => true, - 'moderator_message' => true, - 'published' => false, - 'updated' => false, - 'approved' => true, - 'queued' => true, - 'followers' => false, - 'license' => false, - 'versions' => false, - 'game_versions' => false, - 'loaders' => false, - 'gallery' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'team' => 'team', - 'body_url' => 'body_url', - 'moderator_message' => 'moderator_message', - 'published' => 'published', - 'updated' => 'updated', - 'approved' => 'approved', - 'queued' => 'queued', - 'followers' => 'followers', - 'license' => 'license', - 'versions' => 'versions', - 'game_versions' => 'game_versions', - 'loaders' => 'loaders', - 'gallery' => 'gallery' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'team' => 'setTeam', - 'body_url' => 'setBodyUrl', - 'moderator_message' => 'setModeratorMessage', - 'published' => 'setPublished', - 'updated' => 'setUpdated', - 'approved' => 'setApproved', - 'queued' => 'setQueued', - 'followers' => 'setFollowers', - 'license' => 'setLicense', - 'versions' => 'setVersions', - 'game_versions' => 'setGameVersions', - 'loaders' => 'setLoaders', - 'gallery' => 'setGallery' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'team' => 'getTeam', - 'body_url' => 'getBodyUrl', - 'moderator_message' => 'getModeratorMessage', - 'published' => 'getPublished', - 'updated' => 'getUpdated', - 'approved' => 'getApproved', - 'queued' => 'getQueued', - 'followers' => 'getFollowers', - 'license' => 'getLicense', - 'versions' => 'getVersions', - 'game_versions' => 'getGameVersions', - 'loaders' => 'getLoaders', - 'gallery' => 'getGallery' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('team', $data ?? [], null); - $this->setIfExists('body_url', $data ?? [], null); - $this->setIfExists('moderator_message', $data ?? [], null); - $this->setIfExists('published', $data ?? [], null); - $this->setIfExists('updated', $data ?? [], null); - $this->setIfExists('approved', $data ?? [], null); - $this->setIfExists('queued', $data ?? [], null); - $this->setIfExists('followers', $data ?? [], null); - $this->setIfExists('license', $data ?? [], null); - $this->setIfExists('versions', $data ?? [], null); - $this->setIfExists('game_versions', $data ?? [], null); - $this->setIfExists('loaders', $data ?? [], null); - $this->setIfExists('gallery', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['team'] === null) { - $invalidProperties[] = "'team' can't be null"; - } - if ($this->container['published'] === null) { - $invalidProperties[] = "'published' can't be null"; - } - if ($this->container['updated'] === null) { - $invalidProperties[] = "'updated' can't be null"; - } - if ($this->container['followers'] === null) { - $invalidProperties[] = "'followers' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id The ID of the project, encoded as a base62 string - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets team - * - * @return string - */ - public function getTeam() - { - return $this->container['team']; - } - - /** - * Sets team - * - * @param string $team The ID of the team that has ownership of this project - * - * @return self - */ - public function setTeam($team) - { - if (is_null($team)) { - throw new \InvalidArgumentException('non-nullable team cannot be null'); - } - $this->container['team'] = $team; - - return $this; - } - - /** - * Gets body_url - * - * @return string|null - * @deprecated - */ - public function getBodyUrl() - { - return $this->container['body_url']; - } - - /** - * Sets body_url - * - * @param string|null $body_url The link to the long description of the project. Always null, only kept for legacy compatibility. - * - * @return self - * @deprecated - */ - public function setBodyUrl($body_url) - { - if (is_null($body_url)) { - array_push($this->openAPINullablesSetToNull, 'body_url'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('body_url', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['body_url'] = $body_url; - - return $this; - } - - /** - * Gets moderator_message - * - * @return \Aternos\ModrinthApi\Model\ModeratorMessage|null - * @deprecated - */ - public function getModeratorMessage() - { - return $this->container['moderator_message']; - } - - /** - * Sets moderator_message - * - * @param \Aternos\ModrinthApi\Model\ModeratorMessage|null $moderator_message moderator_message - * - * @return self - * @deprecated - */ - public function setModeratorMessage($moderator_message) - { - if (is_null($moderator_message)) { - array_push($this->openAPINullablesSetToNull, 'moderator_message'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('moderator_message', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['moderator_message'] = $moderator_message; - - return $this; - } - - /** - * Gets published - * - * @return string - */ - public function getPublished() - { - return $this->container['published']; - } - - /** - * Sets published - * - * @param string $published The date the project was published - * - * @return self - */ - public function setPublished($published) - { - if (is_null($published)) { - throw new \InvalidArgumentException('non-nullable published cannot be null'); - } - $this->container['published'] = $published; - - return $this; - } - - /** - * Gets updated - * - * @return string - */ - public function getUpdated() - { - return $this->container['updated']; - } - - /** - * Sets updated - * - * @param string $updated The date the project was last updated - * - * @return self - */ - public function setUpdated($updated) - { - if (is_null($updated)) { - throw new \InvalidArgumentException('non-nullable updated cannot be null'); - } - $this->container['updated'] = $updated; - - return $this; - } - - /** - * Gets approved - * - * @return string|null - */ - public function getApproved() - { - return $this->container['approved']; - } - - /** - * Sets approved - * - * @param string|null $approved The date the project's status was set to an approved status - * - * @return self - */ - public function setApproved($approved) - { - if (is_null($approved)) { - array_push($this->openAPINullablesSetToNull, 'approved'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('approved', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['approved'] = $approved; - - return $this; - } - - /** - * Gets queued - * - * @return string|null - */ - public function getQueued() - { - return $this->container['queued']; - } - - /** - * Sets queued - * - * @param string|null $queued The date the project's status was submitted to moderators for review - * - * @return self - */ - public function setQueued($queued) - { - if (is_null($queued)) { - array_push($this->openAPINullablesSetToNull, 'queued'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('queued', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['queued'] = $queued; - - return $this; - } - - /** - * Gets followers - * - * @return int - */ - public function getFollowers() - { - return $this->container['followers']; - } - - /** - * Sets followers - * - * @param int $followers The total number of users following the project - * - * @return self - */ - public function setFollowers($followers) - { - if (is_null($followers)) { - throw new \InvalidArgumentException('non-nullable followers cannot be null'); - } - $this->container['followers'] = $followers; - - return $this; - } - - /** - * Gets license - * - * @return \Aternos\ModrinthApi\Model\ProjectLicense|null - */ - public function getLicense() - { - return $this->container['license']; - } - - /** - * Sets license - * - * @param \Aternos\ModrinthApi\Model\ProjectLicense|null $license license - * - * @return self - */ - public function setLicense($license) - { - if (is_null($license)) { - throw new \InvalidArgumentException('non-nullable license cannot be null'); - } - $this->container['license'] = $license; - - return $this; - } - - /** - * Gets versions - * - * @return string[]|null - */ - public function getVersions() - { - return $this->container['versions']; - } - - /** - * Sets versions - * - * @param string[]|null $versions A list of the version IDs of the project (will never be empty unless `draft` status) - * - * @return self - */ - public function setVersions($versions) - { - if (is_null($versions)) { - throw new \InvalidArgumentException('non-nullable versions cannot be null'); - } - $this->container['versions'] = $versions; - - return $this; - } - - /** - * Gets game_versions - * - * @return string[]|null - */ - public function getGameVersions() - { - return $this->container['game_versions']; - } - - /** - * Sets game_versions - * - * @param string[]|null $game_versions A list of all of the game versions supported by the project - * - * @return self - */ - public function setGameVersions($game_versions) - { - if (is_null($game_versions)) { - throw new \InvalidArgumentException('non-nullable game_versions cannot be null'); - } - $this->container['game_versions'] = $game_versions; - - return $this; - } - - /** - * Gets loaders - * - * @return string[]|null - */ - public function getLoaders() - { - return $this->container['loaders']; - } - - /** - * Sets loaders - * - * @param string[]|null $loaders A list of all of the loaders supported by the project - * - * @return self - */ - public function setLoaders($loaders) - { - if (is_null($loaders)) { - throw new \InvalidArgumentException('non-nullable loaders cannot be null'); - } - $this->container['loaders'] = $loaders; - - return $this; - } - - /** - * Gets gallery - * - * @return \Aternos\ModrinthApi\Model\GalleryImage[]|null - */ - public function getGallery() - { - return $this->container['gallery']; - } - - /** - * Sets gallery - * - * @param \Aternos\ModrinthApi\Model\GalleryImage[]|null $gallery A list of images that have been uploaded to the project's gallery - * - * @return self - */ - public function setGallery($gallery) - { - if (is_null($gallery)) { - throw new \InvalidArgumentException('non-nullable gallery cannot be null'); - } - $this->container['gallery'] = $gallery; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/ProjectDependencyList.php b/lib/Model/ProjectDependencyList.php index 186fa4a..e7c65f9 100644 --- a/lib/Model/ProjectDependencyList.php +++ b/lib/Model/ProjectDependencyList.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ProjectDonationURL.php b/lib/Model/ProjectDonationURL.php index 5525f8c..f051724 100644 --- a/lib/Model/ProjectDonationURL.php +++ b/lib/Model/ProjectDonationURL.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ProjectIdentifier.php b/lib/Model/ProjectIdentifier.php index 4bfd8ae..806c1c6 100644 --- a/lib/Model/ProjectIdentifier.php +++ b/lib/Model/ProjectIdentifier.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ProjectLicense.php b/lib/Model/ProjectLicense.php index 2e8d58a..4c2c1a3 100644 --- a/lib/Model/ProjectLicense.php +++ b/lib/Model/ProjectLicense.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ProjectResult.php b/lib/Model/ProjectResult.php index fe17f32..5660313 100644 --- a/lib/Model/ProjectResult.php +++ b/lib/Model/ProjectResult.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** @@ -80,8 +80,7 @@ class ProjectResult implements ModelInterface, ArrayAccess, \JsonSerializable 'latest_version' => 'string', 'license' => 'string', 'gallery' => 'string[]', - 'featured_gallery' => 'string', - 'dependencies' => 'string[]' + 'featured_gallery' => 'string' ]; /** @@ -114,8 +113,7 @@ class ProjectResult implements ModelInterface, ArrayAccess, \JsonSerializable 'latest_version' => null, 'license' => null, 'gallery' => null, - 'featured_gallery' => null, - 'dependencies' => null + 'featured_gallery' => null ]; /** @@ -146,8 +144,7 @@ class ProjectResult implements ModelInterface, ArrayAccess, \JsonSerializable 'latest_version' => false, 'license' => false, 'gallery' => false, - 'featured_gallery' => true, - 'dependencies' => false + 'featured_gallery' => true ]; /** @@ -258,8 +255,7 @@ public function isNullableSetToNull(string $property): bool 'latest_version' => 'latest_version', 'license' => 'license', 'gallery' => 'gallery', - 'featured_gallery' => 'featured_gallery', - 'dependencies' => 'dependencies' + 'featured_gallery' => 'featured_gallery' ]; /** @@ -290,8 +286,7 @@ public function isNullableSetToNull(string $property): bool 'latest_version' => 'setLatestVersion', 'license' => 'setLicense', 'gallery' => 'setGallery', - 'featured_gallery' => 'setFeaturedGallery', - 'dependencies' => 'setDependencies' + 'featured_gallery' => 'setFeaturedGallery' ]; /** @@ -322,8 +317,7 @@ public function isNullableSetToNull(string $property): bool 'latest_version' => 'getLatestVersion', 'license' => 'getLicense', 'gallery' => 'getGallery', - 'featured_gallery' => 'getFeaturedGallery', - 'dependencies' => 'getDependencies' + 'featured_gallery' => 'getFeaturedGallery' ]; /** @@ -476,7 +470,6 @@ public function __construct(array $data = null) $this->setIfExists('license', $data ?? [], null); $this->setIfExists('gallery', $data ?? [], null); $this->setIfExists('featured_gallery', $data ?? [], null); - $this->setIfExists('dependencies', $data ?? [], null); } /** @@ -1280,33 +1273,6 @@ public function setFeaturedGallery($featured_gallery) return $this; } - - /** - * Gets dependencies - * - * @return string[]|null - */ - public function getDependencies() - { - return $this->container['dependencies']; - } - - /** - * Sets dependencies - * - * @param string[]|null $dependencies A list of this project's dependencies, in the format of `{project_id}-{dep_type}` - * - * @return self - */ - public function setDependencies($dependencies) - { - if (is_null($dependencies)) { - throw new \InvalidArgumentException('non-nullable dependencies cannot be null'); - } - $this->container['dependencies'] = $dependencies; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ProjectResultAllOf.php b/lib/Model/ProjectResultAllOf.php deleted file mode 100644 index 2c80254..0000000 --- a/lib/Model/ProjectResultAllOf.php +++ /dev/null @@ -1,812 +0,0 @@ - - */ -class ProjectResultAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ProjectResult_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'project_id' => 'string', - 'author' => 'string', - 'display_categories' => 'string[]', - 'versions' => 'string[]', - 'follows' => 'int', - 'date_created' => 'string', - 'date_modified' => 'string', - 'latest_version' => 'string', - 'license' => 'string', - 'gallery' => 'string[]', - 'featured_gallery' => 'string', - 'dependencies' => 'string[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'project_id' => null, - 'author' => null, - 'display_categories' => null, - 'versions' => null, - 'follows' => null, - 'date_created' => 'ISO-8601', - 'date_modified' => 'ISO-8601', - 'latest_version' => null, - 'license' => null, - 'gallery' => null, - 'featured_gallery' => null, - 'dependencies' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'project_id' => false, - 'author' => false, - 'display_categories' => false, - 'versions' => false, - 'follows' => false, - 'date_created' => false, - 'date_modified' => false, - 'latest_version' => false, - 'license' => false, - 'gallery' => false, - 'featured_gallery' => true, - 'dependencies' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'project_id' => 'project_id', - 'author' => 'author', - 'display_categories' => 'display_categories', - 'versions' => 'versions', - 'follows' => 'follows', - 'date_created' => 'date_created', - 'date_modified' => 'date_modified', - 'latest_version' => 'latest_version', - 'license' => 'license', - 'gallery' => 'gallery', - 'featured_gallery' => 'featured_gallery', - 'dependencies' => 'dependencies' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'project_id' => 'setProjectId', - 'author' => 'setAuthor', - 'display_categories' => 'setDisplayCategories', - 'versions' => 'setVersions', - 'follows' => 'setFollows', - 'date_created' => 'setDateCreated', - 'date_modified' => 'setDateModified', - 'latest_version' => 'setLatestVersion', - 'license' => 'setLicense', - 'gallery' => 'setGallery', - 'featured_gallery' => 'setFeaturedGallery', - 'dependencies' => 'setDependencies' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'project_id' => 'getProjectId', - 'author' => 'getAuthor', - 'display_categories' => 'getDisplayCategories', - 'versions' => 'getVersions', - 'follows' => 'getFollows', - 'date_created' => 'getDateCreated', - 'date_modified' => 'getDateModified', - 'latest_version' => 'getLatestVersion', - 'license' => 'getLicense', - 'gallery' => 'getGallery', - 'featured_gallery' => 'getFeaturedGallery', - 'dependencies' => 'getDependencies' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('project_id', $data ?? [], null); - $this->setIfExists('author', $data ?? [], null); - $this->setIfExists('display_categories', $data ?? [], null); - $this->setIfExists('versions', $data ?? [], null); - $this->setIfExists('follows', $data ?? [], null); - $this->setIfExists('date_created', $data ?? [], null); - $this->setIfExists('date_modified', $data ?? [], null); - $this->setIfExists('latest_version', $data ?? [], null); - $this->setIfExists('license', $data ?? [], null); - $this->setIfExists('gallery', $data ?? [], null); - $this->setIfExists('featured_gallery', $data ?? [], null); - $this->setIfExists('dependencies', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['project_id'] === null) { - $invalidProperties[] = "'project_id' can't be null"; - } - if ($this->container['author'] === null) { - $invalidProperties[] = "'author' can't be null"; - } - if ($this->container['versions'] === null) { - $invalidProperties[] = "'versions' can't be null"; - } - if ($this->container['follows'] === null) { - $invalidProperties[] = "'follows' can't be null"; - } - if ($this->container['date_created'] === null) { - $invalidProperties[] = "'date_created' can't be null"; - } - if ($this->container['date_modified'] === null) { - $invalidProperties[] = "'date_modified' can't be null"; - } - if ($this->container['license'] === null) { - $invalidProperties[] = "'license' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets project_id - * - * @return string - */ - public function getProjectId() - { - return $this->container['project_id']; - } - - /** - * Sets project_id - * - * @param string $project_id The ID of the project - * - * @return self - */ - public function setProjectId($project_id) - { - if (is_null($project_id)) { - throw new \InvalidArgumentException('non-nullable project_id cannot be null'); - } - $this->container['project_id'] = $project_id; - - return $this; - } - - /** - * Gets author - * - * @return string - */ - public function getAuthor() - { - return $this->container['author']; - } - - /** - * Sets author - * - * @param string $author The username of the project's author - * - * @return self - */ - public function setAuthor($author) - { - if (is_null($author)) { - throw new \InvalidArgumentException('non-nullable author cannot be null'); - } - $this->container['author'] = $author; - - return $this; - } - - /** - * Gets display_categories - * - * @return string[]|null - */ - public function getDisplayCategories() - { - return $this->container['display_categories']; - } - - /** - * Sets display_categories - * - * @param string[]|null $display_categories A list of the categories that the project has which are not secondary - * - * @return self - */ - public function setDisplayCategories($display_categories) - { - if (is_null($display_categories)) { - throw new \InvalidArgumentException('non-nullable display_categories cannot be null'); - } - $this->container['display_categories'] = $display_categories; - - return $this; - } - - /** - * Gets versions - * - * @return string[] - */ - public function getVersions() - { - return $this->container['versions']; - } - - /** - * Sets versions - * - * @param string[] $versions A list of the minecraft versions supported by the project - * - * @return self - */ - public function setVersions($versions) - { - if (is_null($versions)) { - throw new \InvalidArgumentException('non-nullable versions cannot be null'); - } - $this->container['versions'] = $versions; - - return $this; - } - - /** - * Gets follows - * - * @return int - */ - public function getFollows() - { - return $this->container['follows']; - } - - /** - * Sets follows - * - * @param int $follows The total number of users following the project - * - * @return self - */ - public function setFollows($follows) - { - if (is_null($follows)) { - throw new \InvalidArgumentException('non-nullable follows cannot be null'); - } - $this->container['follows'] = $follows; - - return $this; - } - - /** - * Gets date_created - * - * @return string - */ - public function getDateCreated() - { - return $this->container['date_created']; - } - - /** - * Sets date_created - * - * @param string $date_created The date the project was added to search - * - * @return self - */ - public function setDateCreated($date_created) - { - if (is_null($date_created)) { - throw new \InvalidArgumentException('non-nullable date_created cannot be null'); - } - $this->container['date_created'] = $date_created; - - return $this; - } - - /** - * Gets date_modified - * - * @return string - */ - public function getDateModified() - { - return $this->container['date_modified']; - } - - /** - * Sets date_modified - * - * @param string $date_modified The date the project was last modified - * - * @return self - */ - public function setDateModified($date_modified) - { - if (is_null($date_modified)) { - throw new \InvalidArgumentException('non-nullable date_modified cannot be null'); - } - $this->container['date_modified'] = $date_modified; - - return $this; - } - - /** - * Gets latest_version - * - * @return string|null - */ - public function getLatestVersion() - { - return $this->container['latest_version']; - } - - /** - * Sets latest_version - * - * @param string|null $latest_version The latest version of minecraft that this project supports - * - * @return self - */ - public function setLatestVersion($latest_version) - { - if (is_null($latest_version)) { - throw new \InvalidArgumentException('non-nullable latest_version cannot be null'); - } - $this->container['latest_version'] = $latest_version; - - return $this; - } - - /** - * Gets license - * - * @return string - */ - public function getLicense() - { - return $this->container['license']; - } - - /** - * Sets license - * - * @param string $license The SPDX license ID of a project - * - * @return self - */ - public function setLicense($license) - { - if (is_null($license)) { - throw new \InvalidArgumentException('non-nullable license cannot be null'); - } - $this->container['license'] = $license; - - return $this; - } - - /** - * Gets gallery - * - * @return string[]|null - */ - public function getGallery() - { - return $this->container['gallery']; - } - - /** - * Sets gallery - * - * @param string[]|null $gallery All gallery images attached to the project - * - * @return self - */ - public function setGallery($gallery) - { - if (is_null($gallery)) { - throw new \InvalidArgumentException('non-nullable gallery cannot be null'); - } - $this->container['gallery'] = $gallery; - - return $this; - } - - /** - * Gets featured_gallery - * - * @return string|null - */ - public function getFeaturedGallery() - { - return $this->container['featured_gallery']; - } - - /** - * Sets featured_gallery - * - * @param string|null $featured_gallery The featured gallery image of the project - * - * @return self - */ - public function setFeaturedGallery($featured_gallery) - { - if (is_null($featured_gallery)) { - array_push($this->openAPINullablesSetToNull, 'featured_gallery'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('featured_gallery', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['featured_gallery'] = $featured_gallery; - - return $this; - } - - /** - * Gets dependencies - * - * @return string[]|null - */ - public function getDependencies() - { - return $this->container['dependencies']; - } - - /** - * Sets dependencies - * - * @param string[]|null $dependencies A list of this project's dependencies, in the format of `{project_id}-{dep_type}` - * - * @return self - */ - public function setDependencies($dependencies) - { - if (is_null($dependencies)) { - throw new \InvalidArgumentException('non-nullable dependencies cannot be null'); - } - $this->container['dependencies'] = $dependencies; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/Report.php b/lib/Model/Report.php index 2814957..c7728cf 100644 --- a/lib/Model/Report.php +++ b/lib/Model/Report.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ReportAllOf.php b/lib/Model/ReportAllOf.php deleted file mode 100644 index 3b2ea01..0000000 --- a/lib/Model/ReportAllOf.php +++ /dev/null @@ -1,558 +0,0 @@ - - */ -class ReportAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Report_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id' => 'string', - 'reporter' => 'string', - 'created' => 'string', - 'closed' => 'bool', - 'thread_id' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id' => null, - 'reporter' => null, - 'created' => 'ISO-8601', - 'closed' => null, - 'thread_id' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'id' => false, - 'reporter' => false, - 'created' => false, - 'closed' => false, - 'thread_id' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'reporter' => 'reporter', - 'created' => 'created', - 'closed' => 'closed', - 'thread_id' => 'thread_id' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'reporter' => 'setReporter', - 'created' => 'setCreated', - 'closed' => 'setClosed', - 'thread_id' => 'setThreadId' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'reporter' => 'getReporter', - 'created' => 'getCreated', - 'closed' => 'getClosed', - 'thread_id' => 'getThreadId' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('reporter', $data ?? [], null); - $this->setIfExists('created', $data ?? [], null); - $this->setIfExists('closed', $data ?? [], null); - $this->setIfExists('thread_id', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['reporter'] === null) { - $invalidProperties[] = "'reporter' can't be null"; - } - if ($this->container['created'] === null) { - $invalidProperties[] = "'created' can't be null"; - } - if ($this->container['closed'] === null) { - $invalidProperties[] = "'closed' can't be null"; - } - if ($this->container['thread_id'] === null) { - $invalidProperties[] = "'thread_id' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return string|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string|null $id The ID of the report - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets reporter - * - * @return string - */ - public function getReporter() - { - return $this->container['reporter']; - } - - /** - * Sets reporter - * - * @param string $reporter The ID of the user who reported the item - * - * @return self - */ - public function setReporter($reporter) - { - if (is_null($reporter)) { - throw new \InvalidArgumentException('non-nullable reporter cannot be null'); - } - $this->container['reporter'] = $reporter; - - return $this; - } - - /** - * Gets created - * - * @return string - */ - public function getCreated() - { - return $this->container['created']; - } - - /** - * Sets created - * - * @param string $created The time at which the report was created - * - * @return self - */ - public function setCreated($created) - { - if (is_null($created)) { - throw new \InvalidArgumentException('non-nullable created cannot be null'); - } - $this->container['created'] = $created; - - return $this; - } - - /** - * Gets closed - * - * @return bool - */ - public function getClosed() - { - return $this->container['closed']; - } - - /** - * Sets closed - * - * @param bool $closed Whether the report is resolved - * - * @return self - */ - public function setClosed($closed) - { - if (is_null($closed)) { - throw new \InvalidArgumentException('non-nullable closed cannot be null'); - } - $this->container['closed'] = $closed; - - return $this; - } - - /** - * Gets thread_id - * - * @return string - */ - public function getThreadId() - { - return $this->container['thread_id']; - } - - /** - * Sets thread_id - * - * @param string $thread_id The ID of the moderation thread associated with this report - * - * @return self - */ - public function setThreadId($thread_id) - { - if (is_null($thread_id)) { - throw new \InvalidArgumentException('non-nullable thread_id cannot be null'); - } - $this->container['thread_id'] = $thread_id; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/Schedule.php b/lib/Model/Schedule.php index efc7119..9a6bede 100644 --- a/lib/Model/Schedule.php +++ b/lib/Model/Schedule.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/SearchResults.php b/lib/Model/SearchResults.php index d61a054..7139db6 100644 --- a/lib/Model/SearchResults.php +++ b/lib/Model/SearchResults.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ServerRenderedProject.php b/lib/Model/ServerRenderedProject.php index 0327c0f..157f6f6 100644 --- a/lib/Model/ServerRenderedProject.php +++ b/lib/Model/ServerRenderedProject.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ServerRenderedProjectAllOf.php b/lib/Model/ServerRenderedProjectAllOf.php deleted file mode 100644 index 45a769c..0000000 --- a/lib/Model/ServerRenderedProjectAllOf.php +++ /dev/null @@ -1,674 +0,0 @@ - - */ -class ServerRenderedProjectAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ServerRenderedProject_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'project_type' => 'string', - 'downloads' => 'int', - 'icon_url' => 'string', - 'color' => 'int', - 'thread_id' => 'string', - 'monetization_status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'project_type' => null, - 'downloads' => null, - 'icon_url' => null, - 'color' => null, - 'thread_id' => null, - 'monetization_status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'project_type' => false, - 'downloads' => false, - 'icon_url' => true, - 'color' => true, - 'thread_id' => false, - 'monetization_status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'project_type' => 'project_type', - 'downloads' => 'downloads', - 'icon_url' => 'icon_url', - 'color' => 'color', - 'thread_id' => 'thread_id', - 'monetization_status' => 'monetization_status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'project_type' => 'setProjectType', - 'downloads' => 'setDownloads', - 'icon_url' => 'setIconUrl', - 'color' => 'setColor', - 'thread_id' => 'setThreadId', - 'monetization_status' => 'setMonetizationStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'project_type' => 'getProjectType', - 'downloads' => 'getDownloads', - 'icon_url' => 'getIconUrl', - 'color' => 'getColor', - 'thread_id' => 'getThreadId', - 'monetization_status' => 'getMonetizationStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const PROJECT_TYPE_MOD = 'mod'; - public const PROJECT_TYPE_MODPACK = 'modpack'; - public const PROJECT_TYPE_RESOURCEPACK = 'resourcepack'; - public const PROJECT_TYPE_SHADER = 'shader'; - public const MONETIZATION_STATUS_MONETIZED = 'monetized'; - public const MONETIZATION_STATUS_DEMONETIZED = 'demonetized'; - public const MONETIZATION_STATUS_FORCE_DEMONETIZED = 'force-demonetized'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getProjectTypeAllowableValues() - { - return [ - self::PROJECT_TYPE_MOD, - self::PROJECT_TYPE_MODPACK, - self::PROJECT_TYPE_RESOURCEPACK, - self::PROJECT_TYPE_SHADER, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getMonetizationStatusAllowableValues() - { - return [ - self::MONETIZATION_STATUS_MONETIZED, - self::MONETIZATION_STATUS_DEMONETIZED, - self::MONETIZATION_STATUS_FORCE_DEMONETIZED, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('project_type', $data ?? [], null); - $this->setIfExists('downloads', $data ?? [], null); - $this->setIfExists('icon_url', $data ?? [], null); - $this->setIfExists('color', $data ?? [], null); - $this->setIfExists('thread_id', $data ?? [], null); - $this->setIfExists('monetization_status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['project_type'] === null) { - $invalidProperties[] = "'project_type' can't be null"; - } - $allowedValues = $this->getProjectTypeAllowableValues(); - if (!is_null($this->container['project_type']) && !in_array($this->container['project_type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'project_type', must be one of '%s'", - $this->container['project_type'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['downloads'] === null) { - $invalidProperties[] = "'downloads' can't be null"; - } - $allowedValues = $this->getMonetizationStatusAllowableValues(); - if (!is_null($this->container['monetization_status']) && !in_array($this->container['monetization_status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'monetization_status', must be one of '%s'", - $this->container['monetization_status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets project_type - * - * @return string - */ - public function getProjectType() - { - return $this->container['project_type']; - } - - /** - * Sets project_type - * - * @param string $project_type The project type of the project - * - * @return self - */ - public function setProjectType($project_type) - { - if (is_null($project_type)) { - throw new \InvalidArgumentException('non-nullable project_type cannot be null'); - } - $allowedValues = $this->getProjectTypeAllowableValues(); - if (!in_array($project_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'project_type', must be one of '%s'", - $project_type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['project_type'] = $project_type; - - return $this; - } - - /** - * Gets downloads - * - * @return int - */ - public function getDownloads() - { - return $this->container['downloads']; - } - - /** - * Sets downloads - * - * @param int $downloads The total number of downloads of the project - * - * @return self - */ - public function setDownloads($downloads) - { - if (is_null($downloads)) { - throw new \InvalidArgumentException('non-nullable downloads cannot be null'); - } - $this->container['downloads'] = $downloads; - - return $this; - } - - /** - * Gets icon_url - * - * @return string|null - */ - public function getIconUrl() - { - return $this->container['icon_url']; - } - - /** - * Sets icon_url - * - * @param string|null $icon_url The URL of the project's icon - * - * @return self - */ - public function setIconUrl($icon_url) - { - if (is_null($icon_url)) { - array_push($this->openAPINullablesSetToNull, 'icon_url'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('icon_url', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['icon_url'] = $icon_url; - - return $this; - } - - /** - * Gets color - * - * @return int|null - */ - public function getColor() - { - return $this->container['color']; - } - - /** - * Sets color - * - * @param int|null $color The RGB color of the project, automatically generated from the project icon - * - * @return self - */ - public function setColor($color) - { - if (is_null($color)) { - array_push($this->openAPINullablesSetToNull, 'color'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('color', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['color'] = $color; - - return $this; - } - - /** - * Gets thread_id - * - * @return string|null - */ - public function getThreadId() - { - return $this->container['thread_id']; - } - - /** - * Sets thread_id - * - * @param string|null $thread_id The ID of the moderation thread associated with this project - * - * @return self - */ - public function setThreadId($thread_id) - { - if (is_null($thread_id)) { - throw new \InvalidArgumentException('non-nullable thread_id cannot be null'); - } - $this->container['thread_id'] = $thread_id; - - return $this; - } - - /** - * Gets monetization_status - * - * @return string|null - */ - public function getMonetizationStatus() - { - return $this->container['monetization_status']; - } - - /** - * Sets monetization_status - * - * @param string|null $monetization_status monetization_status - * - * @return self - */ - public function setMonetizationStatus($monetization_status) - { - if (is_null($monetization_status)) { - throw new \InvalidArgumentException('non-nullable monetization_status cannot be null'); - } - $allowedValues = $this->getMonetizationStatusAllowableValues(); - if (!in_array($monetization_status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'monetization_status', must be one of '%s'", - $monetization_status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['monetization_status'] = $monetization_status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/Statistics.php b/lib/Model/Statistics.php index 297f032..33e6381 100644 --- a/lib/Model/Statistics.php +++ b/lib/Model/Statistics.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/TeamMember.php b/lib/Model/TeamMember.php index 9ed2ff7..3879be9 100644 --- a/lib/Model/TeamMember.php +++ b/lib/Model/TeamMember.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/Thread.php b/lib/Model/Thread.php index 6c33cdf..a61837f 100644 --- a/lib/Model/Thread.php +++ b/lib/Model/Thread.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ThreadMessage.php b/lib/Model/ThreadMessage.php index 4666841..cfb30ee 100644 --- a/lib/Model/ThreadMessage.php +++ b/lib/Model/ThreadMessage.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/ThreadMessageBody.php b/lib/Model/ThreadMessageBody.php index 386c877..650a019 100644 --- a/lib/Model/ThreadMessageBody.php +++ b/lib/Model/ThreadMessageBody.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/User.php b/lib/Model/User.php index 6d9ee9c..f0be2d9 100644 --- a/lib/Model/User.php +++ b/lib/Model/User.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/UserAllOf.php b/lib/Model/UserAllOf.php deleted file mode 100644 index 5168f16..0000000 --- a/lib/Model/UserAllOf.php +++ /dev/null @@ -1,801 +0,0 @@ - - */ -class UserAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'User_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id' => 'string', - 'avatar_url' => 'string', - 'created' => 'string', - 'role' => 'string', - 'badges' => 'int', - 'auth_providers' => 'string[]', - 'email_verified' => 'bool', - 'has_password' => 'bool', - 'has_totp' => 'bool', - 'github_id' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id' => null, - 'avatar_url' => null, - 'created' => 'ISO-8601', - 'role' => null, - 'badges' => 'bitfield', - 'auth_providers' => null, - 'email_verified' => null, - 'has_password' => null, - 'has_totp' => null, - 'github_id' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'id' => false, - 'avatar_url' => false, - 'created' => false, - 'role' => false, - 'badges' => false, - 'auth_providers' => true, - 'email_verified' => true, - 'has_password' => true, - 'has_totp' => true, - 'github_id' => true - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'avatar_url' => 'avatar_url', - 'created' => 'created', - 'role' => 'role', - 'badges' => 'badges', - 'auth_providers' => 'auth_providers', - 'email_verified' => 'email_verified', - 'has_password' => 'has_password', - 'has_totp' => 'has_totp', - 'github_id' => 'github_id' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'avatar_url' => 'setAvatarUrl', - 'created' => 'setCreated', - 'role' => 'setRole', - 'badges' => 'setBadges', - 'auth_providers' => 'setAuthProviders', - 'email_verified' => 'setEmailVerified', - 'has_password' => 'setHasPassword', - 'has_totp' => 'setHasTotp', - 'github_id' => 'setGithubId' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'avatar_url' => 'getAvatarUrl', - 'created' => 'getCreated', - 'role' => 'getRole', - 'badges' => 'getBadges', - 'auth_providers' => 'getAuthProviders', - 'email_verified' => 'getEmailVerified', - 'has_password' => 'getHasPassword', - 'has_totp' => 'getHasTotp', - 'github_id' => 'getGithubId' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const ROLE_ADMIN = 'admin'; - public const ROLE_MODERATOR = 'moderator'; - public const ROLE_DEVELOPER = 'developer'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getRoleAllowableValues() - { - return [ - self::ROLE_ADMIN, - self::ROLE_MODERATOR, - self::ROLE_DEVELOPER, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('avatar_url', $data ?? [], null); - $this->setIfExists('created', $data ?? [], null); - $this->setIfExists('role', $data ?? [], null); - $this->setIfExists('badges', $data ?? [], null); - $this->setIfExists('auth_providers', $data ?? [], null); - $this->setIfExists('email_verified', $data ?? [], null); - $this->setIfExists('has_password', $data ?? [], null); - $this->setIfExists('has_totp', $data ?? [], null); - $this->setIfExists('github_id', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['avatar_url'] === null) { - $invalidProperties[] = "'avatar_url' can't be null"; - } - if ($this->container['created'] === null) { - $invalidProperties[] = "'created' can't be null"; - } - if ($this->container['role'] === null) { - $invalidProperties[] = "'role' can't be null"; - } - $allowedValues = $this->getRoleAllowableValues(); - if (!is_null($this->container['role']) && !in_array($this->container['role'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'role', must be one of '%s'", - $this->container['role'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id The user's ID - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets avatar_url - * - * @return string - */ - public function getAvatarUrl() - { - return $this->container['avatar_url']; - } - - /** - * Sets avatar_url - * - * @param string $avatar_url The user's avatar url - * - * @return self - */ - public function setAvatarUrl($avatar_url) - { - if (is_null($avatar_url)) { - throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); - } - $this->container['avatar_url'] = $avatar_url; - - return $this; - } - - /** - * Gets created - * - * @return string - */ - public function getCreated() - { - return $this->container['created']; - } - - /** - * Sets created - * - * @param string $created The time at which the user was created - * - * @return self - */ - public function setCreated($created) - { - if (is_null($created)) { - throw new \InvalidArgumentException('non-nullable created cannot be null'); - } - $this->container['created'] = $created; - - return $this; - } - - /** - * Gets role - * - * @return string - */ - public function getRole() - { - return $this->container['role']; - } - - /** - * Sets role - * - * @param string $role The user's role - * - * @return self - */ - public function setRole($role) - { - if (is_null($role)) { - throw new \InvalidArgumentException('non-nullable role cannot be null'); - } - $allowedValues = $this->getRoleAllowableValues(); - if (!in_array($role, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'role', must be one of '%s'", - $role, - implode("', '", $allowedValues) - ) - ); - } - $this->container['role'] = $role; - - return $this; - } - - /** - * Gets badges - * - * @return int|null - */ - public function getBadges() - { - return $this->container['badges']; - } - - /** - * Sets badges - * - * @param int|null $badges Any badges applicable to this user. These are currently unused and undisplayed, and as such are subject to change In order from first to seventh bit, the current bits are: - (unused) - EARLY_MODPACK_ADOPTER - EARLY_RESPACK_ADOPTER - EARLY_PLUGIN_ADOPTER - ALPHA_TESTER - CONTRIBUTOR - TRANSLATOR - * - * @return self - */ - public function setBadges($badges) - { - if (is_null($badges)) { - throw new \InvalidArgumentException('non-nullable badges cannot be null'); - } - $this->container['badges'] = $badges; - - return $this; - } - - /** - * Gets auth_providers - * - * @return string[]|null - */ - public function getAuthProviders() - { - return $this->container['auth_providers']; - } - - /** - * Sets auth_providers - * - * @param string[]|null $auth_providers A list of authentication providers you have signed up for (only displayed if requesting your own account) - * - * @return self - */ - public function setAuthProviders($auth_providers) - { - if (is_null($auth_providers)) { - array_push($this->openAPINullablesSetToNull, 'auth_providers'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('auth_providers', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['auth_providers'] = $auth_providers; - - return $this; - } - - /** - * Gets email_verified - * - * @return bool|null - */ - public function getEmailVerified() - { - return $this->container['email_verified']; - } - - /** - * Sets email_verified - * - * @param bool|null $email_verified Whether your email is verified (only displayed if requesting your own account) - * - * @return self - */ - public function setEmailVerified($email_verified) - { - if (is_null($email_verified)) { - array_push($this->openAPINullablesSetToNull, 'email_verified'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('email_verified', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['email_verified'] = $email_verified; - - return $this; - } - - /** - * Gets has_password - * - * @return bool|null - */ - public function getHasPassword() - { - return $this->container['has_password']; - } - - /** - * Sets has_password - * - * @param bool|null $has_password Whether you have a password associated with your account (only displayed if requesting your own account) - * - * @return self - */ - public function setHasPassword($has_password) - { - if (is_null($has_password)) { - array_push($this->openAPINullablesSetToNull, 'has_password'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('has_password', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['has_password'] = $has_password; - - return $this; - } - - /** - * Gets has_totp - * - * @return bool|null - */ - public function getHasTotp() - { - return $this->container['has_totp']; - } - - /** - * Sets has_totp - * - * @param bool|null $has_totp Whether you have TOTP two-factor authentication connected to your account (only displayed if requesting your own account) - * - * @return self - */ - public function setHasTotp($has_totp) - { - if (is_null($has_totp)) { - array_push($this->openAPINullablesSetToNull, 'has_totp'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('has_totp', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['has_totp'] = $has_totp; - - return $this; - } - - /** - * Gets github_id - * - * @return int|null - * @deprecated - */ - public function getGithubId() - { - return $this->container['github_id']; - } - - /** - * Sets github_id - * - * @param int|null $github_id Deprecated - this is no longer public for security reasons and is always null - * - * @return self - * @deprecated - */ - public function setGithubId($github_id) - { - if (is_null($github_id)) { - array_push($this->openAPINullablesSetToNull, 'github_id'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('github_id', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['github_id'] = $github_id; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/UserIdentifier.php b/lib/Model/UserIdentifier.php index 76cd6fb..a94f3d9 100644 --- a/lib/Model/UserIdentifier.php +++ b/lib/Model/UserIdentifier.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/UserPayoutData.php b/lib/Model/UserPayoutData.php index f62ad77..74225c8 100644 --- a/lib/Model/UserPayoutData.php +++ b/lib/Model/UserPayoutData.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/UserPayoutHistory.php b/lib/Model/UserPayoutHistory.php index 3954a88..d42ee80 100644 --- a/lib/Model/UserPayoutHistory.php +++ b/lib/Model/UserPayoutHistory.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/UserPayoutHistoryEntry.php b/lib/Model/UserPayoutHistoryEntry.php index dd7c54b..aeb5ee1 100644 --- a/lib/Model/UserPayoutHistoryEntry.php +++ b/lib/Model/UserPayoutHistoryEntry.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/Version.php b/lib/Model/Version.php index 56246ab..e2efe0e 100644 --- a/lib/Model/Version.php +++ b/lib/Model/Version.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/VersionAllOf.php b/lib/Model/VersionAllOf.php deleted file mode 100644 index ccb1886..0000000 --- a/lib/Model/VersionAllOf.php +++ /dev/null @@ -1,641 +0,0 @@ - - */ -class VersionAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Version_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id' => 'string', - 'project_id' => 'string', - 'author_id' => 'string', - 'date_published' => 'string', - 'downloads' => 'int', - 'changelog_url' => 'string', - 'files' => '\Aternos\ModrinthApi\Model\VersionFile[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id' => null, - 'project_id' => null, - 'author_id' => null, - 'date_published' => 'ISO-8601', - 'downloads' => null, - 'changelog_url' => null, - 'files' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'id' => false, - 'project_id' => false, - 'author_id' => false, - 'date_published' => false, - 'downloads' => false, - 'changelog_url' => true, - 'files' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'project_id' => 'project_id', - 'author_id' => 'author_id', - 'date_published' => 'date_published', - 'downloads' => 'downloads', - 'changelog_url' => 'changelog_url', - 'files' => 'files' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'project_id' => 'setProjectId', - 'author_id' => 'setAuthorId', - 'date_published' => 'setDatePublished', - 'downloads' => 'setDownloads', - 'changelog_url' => 'setChangelogUrl', - 'files' => 'setFiles' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'project_id' => 'getProjectId', - 'author_id' => 'getAuthorId', - 'date_published' => 'getDatePublished', - 'downloads' => 'getDownloads', - 'changelog_url' => 'getChangelogUrl', - 'files' => 'getFiles' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('project_id', $data ?? [], null); - $this->setIfExists('author_id', $data ?? [], null); - $this->setIfExists('date_published', $data ?? [], null); - $this->setIfExists('downloads', $data ?? [], null); - $this->setIfExists('changelog_url', $data ?? [], null); - $this->setIfExists('files', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['project_id'] === null) { - $invalidProperties[] = "'project_id' can't be null"; - } - if ($this->container['author_id'] === null) { - $invalidProperties[] = "'author_id' can't be null"; - } - if ($this->container['date_published'] === null) { - $invalidProperties[] = "'date_published' can't be null"; - } - if ($this->container['downloads'] === null) { - $invalidProperties[] = "'downloads' can't be null"; - } - if ($this->container['files'] === null) { - $invalidProperties[] = "'files' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id The ID of the version, encoded as a base62 string - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets project_id - * - * @return string - */ - public function getProjectId() - { - return $this->container['project_id']; - } - - /** - * Sets project_id - * - * @param string $project_id The ID of the project this version is for - * - * @return self - */ - public function setProjectId($project_id) - { - if (is_null($project_id)) { - throw new \InvalidArgumentException('non-nullable project_id cannot be null'); - } - $this->container['project_id'] = $project_id; - - return $this; - } - - /** - * Gets author_id - * - * @return string - */ - public function getAuthorId() - { - return $this->container['author_id']; - } - - /** - * Sets author_id - * - * @param string $author_id The ID of the author who published this version - * - * @return self - */ - public function setAuthorId($author_id) - { - if (is_null($author_id)) { - throw new \InvalidArgumentException('non-nullable author_id cannot be null'); - } - $this->container['author_id'] = $author_id; - - return $this; - } - - /** - * Gets date_published - * - * @return string - */ - public function getDatePublished() - { - return $this->container['date_published']; - } - - /** - * Sets date_published - * - * @param string $date_published date_published - * - * @return self - */ - public function setDatePublished($date_published) - { - if (is_null($date_published)) { - throw new \InvalidArgumentException('non-nullable date_published cannot be null'); - } - $this->container['date_published'] = $date_published; - - return $this; - } - - /** - * Gets downloads - * - * @return int - */ - public function getDownloads() - { - return $this->container['downloads']; - } - - /** - * Sets downloads - * - * @param int $downloads The number of times this version has been downloaded - * - * @return self - */ - public function setDownloads($downloads) - { - if (is_null($downloads)) { - throw new \InvalidArgumentException('non-nullable downloads cannot be null'); - } - $this->container['downloads'] = $downloads; - - return $this; - } - - /** - * Gets changelog_url - * - * @return string|null - * @deprecated - */ - public function getChangelogUrl() - { - return $this->container['changelog_url']; - } - - /** - * Sets changelog_url - * - * @param string|null $changelog_url A link to the changelog for this version. Always null, only kept for legacy compatibility. - * - * @return self - * @deprecated - */ - public function setChangelogUrl($changelog_url) - { - if (is_null($changelog_url)) { - array_push($this->openAPINullablesSetToNull, 'changelog_url'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('changelog_url', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['changelog_url'] = $changelog_url; - - return $this; - } - - /** - * Gets files - * - * @return \Aternos\ModrinthApi\Model\VersionFile[] - */ - public function getFiles() - { - return $this->container['files']; - } - - /** - * Sets files - * - * @param \Aternos\ModrinthApi\Model\VersionFile[] $files A list of files available for download for this version - * - * @return self - */ - public function setFiles($files) - { - if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); - } - $this->container['files'] = $files; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/VersionDependency.php b/lib/Model/VersionDependency.php index fa04bc7..5b99ee0 100644 --- a/lib/Model/VersionDependency.php +++ b/lib/Model/VersionDependency.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/VersionFile.php b/lib/Model/VersionFile.php index 8600ea9..8d1cc25 100644 --- a/lib/Model/VersionFile.php +++ b/lib/Model/VersionFile.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/Model/VersionFileHashes.php b/lib/Model/VersionFileHashes.php index d54c658..68bb9c0 100644 --- a/lib/Model/VersionFileHashes.php +++ b/lib/Model/VersionFileHashes.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 1506a7c..d79c110 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -15,10 +15,10 @@ * * ## Authentication This API uses personal access tokens tied to a user account for authentication. The token is in the `Authorization` header of the request. Example: ``` Authorization: mrp_RNtLRSPmGj2pd1v1ubi52nX7TJJM9sznrmwhAuj511oe4t1jAqAQ3D6Wc8Ic ``` You do not need a token for most requests. Generally speaking, only the following types of requests require a token: - those which create data (such as version creation) - those which modify data (such as editing a project) - those which access private data (such as draft projects, notifications, emails, and payout data) Applications interacting with the authenticated API should have the user generate a personal access token from [their user settings](https://modrinth.com/settings/account). Each request requiring authentication has a certain scope. For example, to view the email of the user being requested, the token must have the `USER_READ_EMAIL` scope. You can find the list of available scopes [on GitHub](https://github.com/modrinth/labrinth/blob/master/src/models/pats.rs#L15). Making a request with an invalid scope will return a 401 error. Please note that certain scopes and requests cannot be completed with a personal access token. For example, deleting a user account can only be done through Modrinth's frontend. For backwards compatibility purposes, some types of GitHub tokens also work for authenticating a user with Modrinth's API, granting all scopes. **We urge any application still using GitHub tokens to start using personal access tokens for security and reliability purposes.** GitHub tokens will cease to function to authenticate with Modrinth's API as soon as version 3 of the API is made generally available. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with the [W3C spec](https://www.w3.org/TR/cors/). This allows for cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. ## Identifiers The majority of items you can interact with in the API have a unique eight-digit base62 ID. Projects, versions, users, threads, teams, and reports all use this same way of identifying themselves. Version files use the sha1 or sha512 file hashes as identifiers. Each project and user has a friendlier way of identifying them; slugs and usernames, respectively. While unique IDs are constant, slugs and usernames can change at any moment. If you want to store something in the long term, it is recommended to use the unique ID. ## Ratelimits The API has a ratelimit defined per IP. Limits and remaining amounts are given in the response headers. - `X-Ratelimit-Limit`: the maximum number of requests that can be made in a minute - `X-Ratelimit-Remaining`: the number of requests remaining in the current ratelimit window - `X-Ratelimit-Reset`: the time in seconds until the ratelimit window resets Ratelimits are the same no matter whether you use a token or not. The ratelimit is currently 300 requests per minute. If you have a use case requiring a higher limit, please [contact us](mailto:admin@modrinth.com). ## User Agents To access the Modrinth API, you **must** use provide a uniquely-identifying `User-Agent` header. Providing a user agent that only identifies your HTTP client library (such as \"okhttp/4.9.3\") increases the likelihood that we will block your traffic. It is recommended, but not required, to include contact information in your user agent. This allows us to contact you if we would like a change in your application's behavior without having to block your traffic. - Bad: `User-Agent: okhttp/4.9.3` - Good: `User-Agent: project_name` - Better: `User-Agent: github_username/project_name/1.56.0` - Best: `User-Agent: github_username/project_name/1.56.0 (launcher.com)` or `User-Agent: github_username/project_name/1.56.0 (contact@launcher.com)` ## Versioning Modrinth follows a simple pattern for its API versioning. In the event of a breaking API change, the API version in the URL path is bumped, and migration steps will be published [on the migrations page](/docs/migrations/information). When an API is no longer the current one, it will immediately be considered deprecated. No more support will be provided for API versions older than the current one. It will be kept for some time, but this amount of time is not certain. We will exercise various tactics to get people to update their implementation of our API. One example is by adding something like `STOP USING THIS API` to various data returned by the API. Once an API version is completely deprecated, it will permanently return a 410 error. Please ensure your application handles these 410 errors. * - * The version of the OpenAPI document: v2.7.0/ec80c2b + * The version of the OpenAPI document: v2.7.0/15cf3fc * Contact: support@modrinth.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.1.0 */ /** diff --git a/tests/Integration/Model/EditableProjectAllOfTest.php b/tests/Integration/Model/EditableProjectAllOfTest.php deleted file mode 100644 index 8c0aeb4..0000000 --- a/tests/Integration/Model/EditableProjectAllOfTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "moderation_message" - */ - public function testPropertyModerationMessage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "moderation_message_body" - */ - public function testPropertyModerationMessageBody() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/GetLatestVersionsFromHashesBodyAllOfTest.php b/tests/Integration/Model/GetLatestVersionsFromHashesBodyAllOfTest.php deleted file mode 100644 index 6a94d33..0000000 --- a/tests/Integration/Model/GetLatestVersionsFromHashesBodyAllOfTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "loaders" - */ - public function testPropertyLoaders() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "game_versions" - */ - public function testPropertyGameVersions() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/LicenseList200ResponseInnerTest.php b/tests/Integration/Model/LicenseList200ResponseInnerTest.php deleted file mode 100644 index 9685c6c..0000000 --- a/tests/Integration/Model/LicenseList200ResponseInnerTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "short" - */ - public function testPropertyShort() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "name" - */ - public function testPropertyName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/LicenseText200ResponseTest.php b/tests/Integration/Model/LicenseText200ResponseTest.php deleted file mode 100644 index 88b519a..0000000 --- a/tests/Integration/Model/LicenseText200ResponseTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "body" - */ - public function testPropertyBody() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/ModifiableProjectAllOfTest.php b/tests/Integration/Model/ModifiableProjectAllOfTest.php deleted file mode 100644 index 2d5ba38..0000000 --- a/tests/Integration/Model/ModifiableProjectAllOfTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "license_id" - */ - public function testPropertyLicenseId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "license_url" - */ - public function testPropertyLicenseUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/NonSearchProjectAllOfTest.php b/tests/Integration/Model/NonSearchProjectAllOfTest.php deleted file mode 100644 index 614bbc0..0000000 --- a/tests/Integration/Model/NonSearchProjectAllOfTest.php +++ /dev/null @@ -1,163 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "body" - */ - public function testPropertyBody() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "status" - */ - public function testPropertyStatus() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requested_status" - */ - public function testPropertyRequestedStatus() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "additional_categories" - */ - public function testPropertyAdditionalCategories() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "issues_url" - */ - public function testPropertyIssuesUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "source_url" - */ - public function testPropertySourceUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "wiki_url" - */ - public function testPropertyWikiUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "discord_url" - */ - public function testPropertyDiscordUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "donation_urls" - */ - public function testPropertyDonationUrls() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/ProjectAllOfTest.php b/tests/Integration/Model/ProjectAllOfTest.php deleted file mode 100644 index b71ed11..0000000 --- a/tests/Integration/Model/ProjectAllOfTest.php +++ /dev/null @@ -1,208 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "id" - */ - public function testPropertyId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "team" - */ - public function testPropertyTeam() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "body_url" - */ - public function testPropertyBodyUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "moderator_message" - */ - public function testPropertyModeratorMessage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "published" - */ - public function testPropertyPublished() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updated" - */ - public function testPropertyUpdated() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "approved" - */ - public function testPropertyApproved() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queued" - */ - public function testPropertyQueued() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "followers" - */ - public function testPropertyFollowers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "license" - */ - public function testPropertyLicense() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "versions" - */ - public function testPropertyVersions() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "game_versions" - */ - public function testPropertyGameVersions() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "loaders" - */ - public function testPropertyLoaders() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "gallery" - */ - public function testPropertyGallery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/ProjectResultAllOfTest.php b/tests/Integration/Model/ProjectResultAllOfTest.php deleted file mode 100644 index 97d653d..0000000 --- a/tests/Integration/Model/ProjectResultAllOfTest.php +++ /dev/null @@ -1,190 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "project_id" - */ - public function testPropertyProjectId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "author" - */ - public function testPropertyAuthor() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "display_categories" - */ - public function testPropertyDisplayCategories() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "versions" - */ - public function testPropertyVersions() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "follows" - */ - public function testPropertyFollows() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "date_created" - */ - public function testPropertyDateCreated() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "date_modified" - */ - public function testPropertyDateModified() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "latest_version" - */ - public function testPropertyLatestVersion() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "license" - */ - public function testPropertyLicense() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "gallery" - */ - public function testPropertyGallery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "featured_gallery" - */ - public function testPropertyFeaturedGallery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "dependencies" - */ - public function testPropertyDependencies() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/ReportAllOfTest.php b/tests/Integration/Model/ReportAllOfTest.php deleted file mode 100644 index ff88fa0..0000000 --- a/tests/Integration/Model/ReportAllOfTest.php +++ /dev/null @@ -1,118 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "reporter" - */ - public function testPropertyReporter() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "created" - */ - public function testPropertyCreated() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "closed" - */ - public function testPropertyClosed() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "thread_id" - */ - public function testPropertyThreadId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/ServerRenderedProjectAllOfTest.php b/tests/Integration/Model/ServerRenderedProjectAllOfTest.php deleted file mode 100644 index 69376aa..0000000 --- a/tests/Integration/Model/ServerRenderedProjectAllOfTest.php +++ /dev/null @@ -1,136 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "project_type" - */ - public function testPropertyProjectType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "downloads" - */ - public function testPropertyDownloads() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "icon_url" - */ - public function testPropertyIconUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "color" - */ - public function testPropertyColor() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "thread_id" - */ - public function testPropertyThreadId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "monetization_status" - */ - public function testPropertyMonetizationStatus() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/UserAllOfTest.php b/tests/Integration/Model/UserAllOfTest.php deleted file mode 100644 index 82392b0..0000000 --- a/tests/Integration/Model/UserAllOfTest.php +++ /dev/null @@ -1,172 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "id" - */ - public function testPropertyId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "avatar_url" - */ - public function testPropertyAvatarUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "created" - */ - public function testPropertyCreated() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "role" - */ - public function testPropertyRole() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "badges" - */ - public function testPropertyBadges() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "auth_providers" - */ - public function testPropertyAuthProviders() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "email_verified" - */ - public function testPropertyEmailVerified() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "has_password" - */ - public function testPropertyHasPassword() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "has_totp" - */ - public function testPropertyHasTotp() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "github_id" - */ - public function testPropertyGithubId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/tests/Integration/Model/VersionAllOfTest.php b/tests/Integration/Model/VersionAllOfTest.php deleted file mode 100644 index bb280ac..0000000 --- a/tests/Integration/Model/VersionAllOfTest.php +++ /dev/null @@ -1,145 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "id" - */ - public function testPropertyId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "project_id" - */ - public function testPropertyProjectId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "author_id" - */ - public function testPropertyAuthorId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "date_published" - */ - public function testPropertyDatePublished() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "downloads" - */ - public function testPropertyDownloads() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "changelog_url" - */ - public function testPropertyChangelogUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "files" - */ - public function testPropertyFiles() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -}