Skip to content

Commit 42fa569

Browse files
committed
add source_code_url and donate_url to Resource and post_date to ResourceUpdate
1 parent 49946e6 commit 42fa569

File tree

5 files changed

+114
-6
lines changed

5 files changed

+114
-6
lines changed

docs/Model/Resource.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ Name | Type | Description | Notes
1919
**last_update** | **int** | last update as timestamp (in seconds) | [optional]
2020
**external_download_url** | **string** | | [optional] [default to '']
2121
**description** | **string** | | [optional]
22+
**source_code_url** | **string** | | [optional] [default to '']
23+
**donate_url** | **string** | | [optional] [default to '']
2224

2325
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/ResourceUpdate.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**resource_id** | **int** | | [optional]
99
**resource_version** | **string** | | [optional]
1010
**download_count** | **int** | | [optional]
11+
**post_date** | **int** | post date as timestamp (in seconds) | [optional]
1112
**title** | **string** | | [optional]
1213
**message** | **string** | | [optional]
1314

src/Model/Resource.php

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ class Resource implements ModelInterface, ArrayAccess, JsonSerializable
7272
'first_release' => 'int',
7373
'last_update' => 'int',
7474
'external_download_url' => 'string',
75-
'description' => 'string'
75+
'description' => 'string',
76+
'source_code_url' => 'string',
77+
'donate_url' => 'string'
7678
];
7779

7880
/**
@@ -95,7 +97,9 @@ class Resource implements ModelInterface, ArrayAccess, JsonSerializable
9597
'first_release' => null,
9698
'last_update' => null,
9799
'external_download_url' => 'uri',
98-
'description' => null
100+
'description' => null,
101+
'source_code_url' => 'uri',
102+
'donate_url' => 'uri'
99103
];
100104

101105
/**
@@ -118,7 +122,9 @@ class Resource implements ModelInterface, ArrayAccess, JsonSerializable
118122
'first_release' => false,
119123
'last_update' => false,
120124
'external_download_url' => false,
121-
'description' => false
125+
'description' => false,
126+
'source_code_url' => false,
127+
'donate_url' => false
122128
];
123129

124130
/**
@@ -221,7 +227,9 @@ public function isNullableSetToNull(string $property): bool
221227
'first_release' => 'first_release',
222228
'last_update' => 'last_update',
223229
'external_download_url' => 'external_download_url',
224-
'description' => 'description'
230+
'description' => 'description',
231+
'source_code_url' => 'source_code_url',
232+
'donate_url' => 'donate_url'
225233
];
226234

227235
/**
@@ -244,7 +252,9 @@ public function isNullableSetToNull(string $property): bool
244252
'first_release' => 'setFirstRelease',
245253
'last_update' => 'setLastUpdate',
246254
'external_download_url' => 'setExternalDownloadUrl',
247-
'description' => 'setDescription'
255+
'description' => 'setDescription',
256+
'source_code_url' => 'setSourceCodeUrl',
257+
'donate_url' => 'setDonateUrl'
248258
];
249259

250260
/**
@@ -267,7 +277,9 @@ public function isNullableSetToNull(string $property): bool
267277
'first_release' => 'getFirstRelease',
268278
'last_update' => 'getLastUpdate',
269279
'external_download_url' => 'getExternalDownloadUrl',
270-
'description' => 'getDescription'
280+
'description' => 'getDescription',
281+
'source_code_url' => 'getSourceCodeUrl',
282+
'donate_url' => 'getDonateUrl'
271283
];
272284

273285
/**
@@ -341,6 +353,8 @@ public function __construct(?array $data = null)
341353
$this->setIfExists('last_update', $data ?? [], null);
342354
$this->setIfExists('external_download_url', $data ?? [], '');
343355
$this->setIfExists('description', $data ?? [], null);
356+
$this->setIfExists('source_code_url', $data ?? [], '');
357+
$this->setIfExists('donate_url', $data ?? [], '');
344358
}
345359

346360
/**
@@ -803,6 +817,60 @@ public function setDescription(?string $description): static
803817

804818
return $this;
805819
}
820+
821+
/**
822+
* Gets source_code_url
823+
*
824+
* @return string|null
825+
*/
826+
public function getSourceCodeUrl(): ?string
827+
{
828+
return $this->container['source_code_url'];
829+
}
830+
831+
/**
832+
* Sets source_code_url
833+
*
834+
* @param string|null $source_code_url source_code_url
835+
*
836+
* @return $this
837+
*/
838+
public function setSourceCodeUrl(?string $source_code_url): static
839+
{
840+
if (is_null($source_code_url)) {
841+
throw new InvalidArgumentException('non-nullable source_code_url cannot be null');
842+
}
843+
$this->container['source_code_url'] = $source_code_url;
844+
845+
return $this;
846+
}
847+
848+
/**
849+
* Gets donate_url
850+
*
851+
* @return string|null
852+
*/
853+
public function getDonateUrl(): ?string
854+
{
855+
return $this->container['donate_url'];
856+
}
857+
858+
/**
859+
* Sets donate_url
860+
*
861+
* @param string|null $donate_url donate_url
862+
*
863+
* @return $this
864+
*/
865+
public function setDonateUrl(?string $donate_url): static
866+
{
867+
if (is_null($donate_url)) {
868+
throw new InvalidArgumentException('non-nullable donate_url cannot be null');
869+
}
870+
$this->container['donate_url'] = $donate_url;
871+
872+
return $this;
873+
}
806874
/**
807875
* Returns true if offset exists. False otherwise.
808876
*

src/Model/ResourceUpdate.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class ResourceUpdate implements ModelInterface, ArrayAccess, JsonSerializable
6262
'resource_id' => 'int',
6363
'resource_version' => 'string',
6464
'download_count' => 'int',
65+
'post_date' => 'int',
6566
'title' => 'string',
6667
'message' => 'string'
6768
];
@@ -76,6 +77,7 @@ class ResourceUpdate implements ModelInterface, ArrayAccess, JsonSerializable
7677
'resource_id' => null,
7778
'resource_version' => null,
7879
'download_count' => null,
80+
'post_date' => null,
7981
'title' => null,
8082
'message' => null
8183
];
@@ -90,6 +92,7 @@ class ResourceUpdate implements ModelInterface, ArrayAccess, JsonSerializable
9092
'resource_id' => false,
9193
'resource_version' => false,
9294
'download_count' => false,
95+
'post_date' => false,
9396
'title' => false,
9497
'message' => false
9598
];
@@ -184,6 +187,7 @@ public function isNullableSetToNull(string $property): bool
184187
'resource_id' => 'resource_id',
185188
'resource_version' => 'resource_version',
186189
'download_count' => 'download_count',
190+
'post_date' => 'post_date',
187191
'title' => 'title',
188192
'message' => 'message'
189193
];
@@ -198,6 +202,7 @@ public function isNullableSetToNull(string $property): bool
198202
'resource_id' => 'setResourceId',
199203
'resource_version' => 'setResourceVersion',
200204
'download_count' => 'setDownloadCount',
205+
'post_date' => 'setPostDate',
201206
'title' => 'setTitle',
202207
'message' => 'setMessage'
203208
];
@@ -212,6 +217,7 @@ public function isNullableSetToNull(string $property): bool
212217
'resource_id' => 'getResourceId',
213218
'resource_version' => 'getResourceVersion',
214219
'download_count' => 'getDownloadCount',
220+
'post_date' => 'getPostDate',
215221
'title' => 'getTitle',
216222
'message' => 'getMessage'
217223
];
@@ -276,6 +282,7 @@ public function __construct(?array $data = null)
276282
$this->setIfExists('resource_id', $data ?? [], null);
277283
$this->setIfExists('resource_version', $data ?? [], null);
278284
$this->setIfExists('download_count', $data ?? [], null);
285+
$this->setIfExists('post_date', $data ?? [], null);
279286
$this->setIfExists('title', $data ?? [], null);
280287
$this->setIfExists('message', $data ?? [], null);
281288
}
@@ -430,6 +437,33 @@ public function setDownloadCount(?int $download_count): static
430437
return $this;
431438
}
432439

440+
/**
441+
* Gets post_date
442+
*
443+
* @return int|null
444+
*/
445+
public function getPostDate(): ?int
446+
{
447+
return $this->container['post_date'];
448+
}
449+
450+
/**
451+
* Sets post_date
452+
*
453+
* @param int|null $post_date post date as timestamp (in seconds)
454+
*
455+
* @return $this
456+
*/
457+
public function setPostDate(?int $post_date): static
458+
{
459+
if (is_null($post_date)) {
460+
throw new InvalidArgumentException('non-nullable post_date cannot be null');
461+
}
462+
$this->container['post_date'] = $post_date;
463+
464+
return $this;
465+
}
466+
433467
/**
434468
* Gets title
435469
*

tests/TestCase.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ protected function assertValidProject(Project $project): void
7878
$this->assertNotNull($project->getData()->getDescription());
7979
$this->assertNotNull($project->getData()->getFirstRelease());
8080
$this->assertNotNull($project->getData()->getLastUpdate());
81+
$this->assertNotNull($project->getData()->getSourceCodeUrl());
82+
$this->assertNotNull($project->getData()->getDonateUrl());
8183
}
8284

8385
protected function assertValidVersion(Version $version): void
@@ -89,6 +91,7 @@ protected function assertValidVersion(Version $version): void
8991
$this->assertNotNull($version->getData()->getDownloadCount());
9092
$this->assertNotNull($version->getData()->getTitle());
9193
$this->assertNotNull($version->getData()->getMessage());
94+
$this->assertNotNull($version->getData()->getPostDate());
9295
}
9396

9497
protected function assertValidPaginatedList(PaginatedList $list): void

0 commit comments

Comments
 (0)