Skip to content

Commit 5eee349

Browse files
committed
Rerun generator (add id to report, change getReports to use string instead of array)
1 parent a875680 commit 5eee349

File tree

6 files changed

+79
-9
lines changed

6 files changed

+79
-9
lines changed

docs/Api/ThreadsApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ $apiInstance = new Aternos\ModrinthApi\Api\ThreadsApi(
221221
new GuzzleHttp\Client(),
222222
$config
223223
);
224-
$ids = ["AABBCCDD", "EEFFGGHH"]; // string[] | The IDs of the reports
224+
$ids = ["AABBCCDD", "EEFFGGHH"]; // string | The IDs of the reports
225225

226226
try {
227227
$result = $apiInstance->getReports($ids);
@@ -235,7 +235,7 @@ try {
235235

236236
| Name | Type | Description | Notes |
237237
| ------------- | ------------- | ------------- | ------------- |
238-
| **ids** | [**string[]**](../Model/string.md)| The IDs of the reports | |
238+
| **ids** | **string**| The IDs of the reports | |
239239

240240
### Return type
241241

docs/Model/Report.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**item_id** | **string** | The ID of the item (project, version, or user) being reported |
99
**item_type** | **string** | The type of the item being reported |
1010
**body** | **string** | The extended explanation of the report |
11+
**id** | **string** | The ID of the report | [optional]
1112
**reporter** | **string** | The ID of the user who reported the item |
1213
**created** | **string** | The time at which the report was created |
1314
**closed** | **bool** | Whether the report is resolved |

docs/Model/ReportAllOf.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7+
**id** | **string** | The ID of the report | [optional]
78
**reporter** | **string** | The ID of the user who reported the item |
89
**created** | **string** | The time at which the report was created |
910
**closed** | **bool** | Whether the report is resolved |

lib/Api/ThreadsApi.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ public function getReportRequest($id, string $contentType = self::contentTypes['
10111011
*
10121012
* Get multiple reports
10131013
*
1014-
* @param string[] $ids The IDs of the reports (required)
1014+
* @param string $ids The IDs of the reports (required)
10151015
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReports'] to see the possible values for this operation
10161016
*
10171017
* @throws \Aternos\ModrinthApi\ApiException on non-2xx response
@@ -1029,7 +1029,7 @@ public function getReports($ids, string $contentType = self::contentTypes['getRe
10291029
*
10301030
* Get multiple reports
10311031
*
1032-
* @param string[] $ids The IDs of the reports (required)
1032+
* @param string $ids The IDs of the reports (required)
10331033
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReports'] to see the possible values for this operation
10341034
*
10351035
* @throws \Aternos\ModrinthApi\ApiException on non-2xx response
@@ -1152,7 +1152,7 @@ public function getReportsWithHttpInfo($ids, string $contentType = self::content
11521152
*
11531153
* Get multiple reports
11541154
*
1155-
* @param string[] $ids The IDs of the reports (required)
1155+
* @param string $ids The IDs of the reports (required)
11561156
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReports'] to see the possible values for this operation
11571157
*
11581158
* @throws \InvalidArgumentException
@@ -1173,7 +1173,7 @@ function ($response) {
11731173
*
11741174
* Get multiple reports
11751175
*
1176-
* @param string[] $ids The IDs of the reports (required)
1176+
* @param string $ids The IDs of the reports (required)
11771177
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReports'] to see the possible values for this operation
11781178
*
11791179
* @throws \InvalidArgumentException
@@ -1223,7 +1223,7 @@ function ($exception) {
12231223
/**
12241224
* Create request for operation 'getReports'
12251225
*
1226-
* @param string[] $ids The IDs of the reports (required)
1226+
* @param string $ids The IDs of the reports (required)
12271227
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReports'] to see the possible values for this operation
12281228
*
12291229
* @throws \InvalidArgumentException
@@ -1251,7 +1251,7 @@ public function getReportsRequest($ids, string $contentType = self::contentTypes
12511251
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
12521252
$ids,
12531253
'ids', // param base name
1254-
'array', // openApiType
1254+
'string', // openApiType
12551255
'form', // style
12561256
true, // explode
12571257
true // required

lib/Model/Report.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class Report implements ModelInterface, ArrayAccess, \JsonSerializable
6262
'item_id' => 'string',
6363
'item_type' => 'string',
6464
'body' => 'string',
65+
'id' => 'string',
6566
'reporter' => 'string',
6667
'created' => 'string',
6768
'closed' => 'bool',
@@ -80,6 +81,7 @@ class Report implements ModelInterface, ArrayAccess, \JsonSerializable
8081
'item_id' => null,
8182
'item_type' => null,
8283
'body' => null,
84+
'id' => null,
8385
'reporter' => null,
8486
'created' => 'ISO-8601',
8587
'closed' => null,
@@ -96,6 +98,7 @@ class Report implements ModelInterface, ArrayAccess, \JsonSerializable
9698
'item_id' => false,
9799
'item_type' => false,
98100
'body' => false,
101+
'id' => false,
99102
'reporter' => false,
100103
'created' => false,
101104
'closed' => false,
@@ -192,6 +195,7 @@ public function isNullableSetToNull(string $property): bool
192195
'item_id' => 'item_id',
193196
'item_type' => 'item_type',
194197
'body' => 'body',
198+
'id' => 'id',
195199
'reporter' => 'reporter',
196200
'created' => 'created',
197201
'closed' => 'closed',
@@ -208,6 +212,7 @@ public function isNullableSetToNull(string $property): bool
208212
'item_id' => 'setItemId',
209213
'item_type' => 'setItemType',
210214
'body' => 'setBody',
215+
'id' => 'setId',
211216
'reporter' => 'setReporter',
212217
'created' => 'setCreated',
213218
'closed' => 'setClosed',
@@ -224,6 +229,7 @@ public function isNullableSetToNull(string $property): bool
224229
'item_id' => 'getItemId',
225230
'item_type' => 'getItemType',
226231
'body' => 'getBody',
232+
'id' => 'getId',
227233
'reporter' => 'getReporter',
228234
'created' => 'getCreated',
229235
'closed' => 'getClosed',
@@ -308,6 +314,7 @@ public function __construct(array $data = null)
308314
$this->setIfExists('item_id', $data ?? [], null);
309315
$this->setIfExists('item_type', $data ?? [], null);
310316
$this->setIfExists('body', $data ?? [], null);
317+
$this->setIfExists('id', $data ?? [], null);
311318
$this->setIfExists('reporter', $data ?? [], null);
312319
$this->setIfExists('created', $data ?? [], null);
313320
$this->setIfExists('closed', $data ?? [], null);
@@ -507,6 +514,33 @@ public function setBody($body)
507514
return $this;
508515
}
509516

517+
/**
518+
* Gets id
519+
*
520+
* @return string|null
521+
*/
522+
public function getId()
523+
{
524+
return $this->container['id'];
525+
}
526+
527+
/**
528+
* Sets id
529+
*
530+
* @param string|null $id The ID of the report
531+
*
532+
* @return self
533+
*/
534+
public function setId($id)
535+
{
536+
if (is_null($id)) {
537+
throw new \InvalidArgumentException('non-nullable id cannot be null');
538+
}
539+
$this->container['id'] = $id;
540+
541+
return $this;
542+
}
543+
510544
/**
511545
* Gets reporter
512546
*

lib/Model/ReportAllOf.php

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class ReportAllOf implements ModelInterface, ArrayAccess, \JsonSerializable
5858
* @var string[]
5959
*/
6060
protected static $openAPITypes = [
61+
'id' => 'string',
6162
'reporter' => 'string',
6263
'created' => 'string',
6364
'closed' => 'bool',
@@ -72,6 +73,7 @@ class ReportAllOf implements ModelInterface, ArrayAccess, \JsonSerializable
7273
* @psalm-var array<string, string|null>
7374
*/
7475
protected static $openAPIFormats = [
76+
'id' => null,
7577
'reporter' => null,
7678
'created' => 'ISO-8601',
7779
'closed' => null,
@@ -84,7 +86,8 @@ class ReportAllOf implements ModelInterface, ArrayAccess, \JsonSerializable
8486
* @var boolean[]
8587
*/
8688
protected static array $openAPINullables = [
87-
'reporter' => false,
89+
'id' => false,
90+
'reporter' => false,
8891
'created' => false,
8992
'closed' => false,
9093
'thread_id' => false
@@ -176,6 +179,7 @@ public function isNullableSetToNull(string $property): bool
176179
* @var string[]
177180
*/
178181
protected static $attributeMap = [
182+
'id' => 'id',
179183
'reporter' => 'reporter',
180184
'created' => 'created',
181185
'closed' => 'closed',
@@ -188,6 +192,7 @@ public function isNullableSetToNull(string $property): bool
188192
* @var string[]
189193
*/
190194
protected static $setters = [
195+
'id' => 'setId',
191196
'reporter' => 'setReporter',
192197
'created' => 'setCreated',
193198
'closed' => 'setClosed',
@@ -200,6 +205,7 @@ public function isNullableSetToNull(string $property): bool
200205
* @var string[]
201206
*/
202207
protected static $getters = [
208+
'id' => 'getId',
203209
'reporter' => 'getReporter',
204210
'created' => 'getCreated',
205211
'closed' => 'getClosed',
@@ -263,6 +269,7 @@ public function getModelName()
263269
*/
264270
public function __construct(array $data = null)
265271
{
272+
$this->setIfExists('id', $data ?? [], null);
266273
$this->setIfExists('reporter', $data ?? [], null);
267274
$this->setIfExists('created', $data ?? [], null);
268275
$this->setIfExists('closed', $data ?? [], null);
@@ -323,6 +330,33 @@ public function valid()
323330
}
324331

325332

333+
/**
334+
* Gets id
335+
*
336+
* @return string|null
337+
*/
338+
public function getId()
339+
{
340+
return $this->container['id'];
341+
}
342+
343+
/**
344+
* Sets id
345+
*
346+
* @param string|null $id The ID of the report
347+
*
348+
* @return self
349+
*/
350+
public function setId($id)
351+
{
352+
if (is_null($id)) {
353+
throw new \InvalidArgumentException('non-nullable id cannot be null');
354+
}
355+
$this->container['id'] = $id;
356+
357+
return $this;
358+
}
359+
326360
/**
327361
* Gets reporter
328362
*

0 commit comments

Comments
 (0)