Skip to content

Commit 4c69b2d

Browse files
committed
Added support for AssetUpdateStartRequest (private API).
1 parent 4c44533 commit 4c69b2d

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 9.4.0 - 2025-09-10
4+
5+
Added support for AssetUpdateStartRequest (private API).
6+
37
## 9.3.0 - 2025-08-18
48

59
When the Assets sessions expires in AssetsClient::downloadFileToPath(), re-authenticate instead of
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
3+
namespace DerSpiegel\WoodWingAssetsClient\PrivateApi\System;
4+
5+
use DerSpiegel\WoodWingAssetsClient\AssetsClient;
6+
use DerSpiegel\WoodWingAssetsClient\Request;
7+
8+
9+
class AssetUpdateStartRequest extends Request
10+
{
11+
public function __construct(
12+
AssetsClient $assetsClient,
13+
readonly string $filterQuery,
14+
readonly bool $extractMetadata = false,
15+
readonly bool $reEmbedMetadata = false,
16+
readonly bool $extractTextContent = false,
17+
readonly bool $deleteRemovedAssetsFromIndex = false,
18+
readonly bool $regenerateThumbnailsAndPreviews = false,
19+
readonly bool $rebuildAutoCreatedRelations = false,
20+
readonly bool $pruneBlacklist = false,
21+
readonly ?bool $runExclusive = null,
22+
readonly ?int $pauseMillis = null,
23+
readonly ?int $numThreads = null,
24+
)
25+
{
26+
parent::__construct($assetsClient);
27+
}
28+
29+
30+
public function __invoke(): array
31+
{
32+
return $this->assetsClient->privateApiRequest(
33+
'POST',
34+
'system/asset/update/start',
35+
$this->toArray()
36+
);
37+
}
38+
39+
40+
protected function toArray(): array
41+
{
42+
$params = [
43+
'filterQuery' => $this->filterQuery,
44+
];
45+
46+
$actionProperties = [
47+
'extractMetadata',
48+
'reEmbedMetadata',
49+
'extractTextContent',
50+
'deleteRemovedAssetsFromIndex',
51+
'regenerateThumbnailsAndPreviews',
52+
'rebuildAutoCreatedRelations',
53+
'pruneBlacklist',
54+
];
55+
56+
foreach ($actionProperties as $propertyName) {
57+
if ($this->$propertyName === true) {
58+
$params[$propertyName] = true;
59+
}
60+
}
61+
62+
$nullableProperties = [
63+
'runExclusive',
64+
'pauseMillis',
65+
'numThreads',
66+
];
67+
68+
foreach ($nullableProperties as $propertyName) {
69+
if ($this->$propertyName !== null) {
70+
$params[$propertyName] = $this->$propertyName;
71+
}
72+
}
73+
74+
return $params;
75+
}
76+
}

0 commit comments

Comments
 (0)