Skip to content

Commit

Permalink
Merge pull request #11 from aternosorg/spec-update
Browse files Browse the repository at this point in the history
Update to latest openapi spec
  • Loading branch information
pavog committed Dec 19, 2023
2 parents d4b466a + 1f06763 commit 993f00d
Show file tree
Hide file tree
Showing 117 changed files with 1,812 additions and 10,124 deletions.
3 changes: 1 addition & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
63 changes: 0 additions & 63 deletions docs/Api/MiscApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()`
Expand Down Expand Up @@ -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
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: TokenAuth
$config = Aternos\ModrinthApi\Configuration::getDefaultConfiguration()->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)
8 changes: 2 additions & 6 deletions docs/Api/ProjectsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -1030,8 +1028,6 @@ try {
| **index** | **string**| The sorting method used for sorting search results | [optional] [default to &#39;relevance&#39;] |
| **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

Expand Down
4 changes: 2 additions & 2 deletions docs/Api/TagsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -213,7 +213,7 @@ try {

### Return type

[**\Aternos\ModrinthApi\Model\LicenseText200Response**](../Model/LicenseText200Response.md)
[**\Aternos\ModrinthApi\Model\License**](../Model/License.md)

### Authorization

Expand Down
61 changes: 0 additions & 61 deletions docs/Api/UsersApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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&#39;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&#39;s notifications |
| [**getUserProjects()**](UsersApi.md#getUserProjects) | **GET** /user/{id|username}/projects | Get user&#39;s projects |
| [**getUsers()**](UsersApi.md#getUsers) | **GET** /users | Get multiple users |
| [**modifyUser()**](UsersApi.md#modifyUser) | **PATCH** /user/{id|username} | Modify a user |
Expand Down Expand Up @@ -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
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: TokenAuth
$config = Aternos\ModrinthApi\Configuration::getDefaultConfiguration()->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
Expand Down
10 changes: 5 additions & 5 deletions docs/Api/VersionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 0 additions & 10 deletions docs/Model/EditableProjectAllOf.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# # ForgeUpdatesPromos
# # ForgeUpdateCheckerPromos

## Properties

Expand Down
2 changes: 1 addition & 1 deletion docs/Model/ForgeUpdates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 0 additions & 10 deletions docs/Model/GetLatestVersionsFromHashesBodyAllOf.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# # LicenseText200Response
# # License

## Properties

Expand Down
10 changes: 0 additions & 10 deletions docs/Model/LicenseList200ResponseInner.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/Model/ModifiableProjectAllOf.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs/Model/NonSearchProjectAllOf.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Model/NotificationAction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
22 changes: 0 additions & 22 deletions docs/Model/ProjectAllOf.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/Model/ProjectResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -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&#39;s dependencies, in the format of &#x60;{project_id}-{dep_type}&#x60; | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
20 changes: 0 additions & 20 deletions docs/Model/ProjectResultAllOf.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/Model/ReportAllOf.md

This file was deleted.

Loading

0 comments on commit 993f00d

Please sign in to comment.