File tree 4 files changed +32
-1
lines changed
Model/API/Stream/ManageCollections
4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,16 @@ $streamApi = new StreamAPI(
34
34
$streamApi->getCollection(
35
35
libraryId: 1,
36
36
collectionId: '97f20caa-649b-4302-9f6e-1d286e0da144',
37
+ query: [
38
+ 'includeThumbnails' => true,
39
+ ],
37
40
);
38
41
```
39
42
43
+ !!! note
44
+
45
+ - If the query parameter `includeThumbnails` is set to `true`, the response item(s) will include a non-empty array key `previewImageUrls` containing the URLs for the corresponding image thumbnails.
46
+
40
47
#### [ Update Collection] ( https://docs.bunny.net/reference/collection_updatecollection )
41
48
42
49
``` php
@@ -68,10 +75,15 @@ $streamApi->listCollections(
68
75
'perPage' => 100,
69
76
'search' => 'bunny',
70
77
'orderBy' => 'date',
78
+ 'includeThumbnails' => true,
71
79
],
72
80
);
73
81
```
74
82
83
+ !!! note
84
+
85
+ - If the query parameter `includeThumbnails` is set to `true`, the response item(s) will include a non-empty array key `previewImageUrls` containing the URLs for the corresponding image thumbnails.
86
+
75
87
#### [ Create Collection] ( https://docs.bunny.net/reference/collection_createcollection )
76
88
77
89
``` php
Original file line number Diff line number Diff line change 6
6
7
7
use ToshY \BunnyNet \Enum \Header ;
8
8
use ToshY \BunnyNet \Enum \Method ;
9
+ use ToshY \BunnyNet \Enum \Type ;
10
+ use ToshY \BunnyNet \Model \AbstractParameter ;
9
11
use ToshY \BunnyNet \Model \EndpointInterface ;
12
+ use ToshY \BunnyNet \Model \EndpointQueryInterface ;
10
13
11
- class GetCollection implements EndpointInterface
14
+ class GetCollection implements EndpointInterface, EndpointQueryInterface
12
15
{
13
16
public function getMethod (): Method
14
17
{
@@ -26,4 +29,11 @@ public function getHeaders(): array
26
29
Header::ACCEPT_JSON ,
27
30
];
28
31
}
32
+
33
+ public function getQuery (): array
34
+ {
35
+ return [
36
+ new AbstractParameter (name: 'includeThumbnails ' , type: Type::BOOLEAN_TYPE ),
37
+ ];
38
+ }
29
39
}
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ public function getQuery(): array
37
37
new AbstractParameter (name: 'itemsPerPage ' , type: Type::INT_TYPE ),
38
38
new AbstractParameter (name: 'search ' , type: Type::STRING_TYPE ),
39
39
new AbstractParameter (name: 'orderBy ' , type: Type::STRING_TYPE ),
40
+ new AbstractParameter (name: 'includeThumbnails ' , type: Type::BOOLEAN_TYPE ),
40
41
];
41
42
}
42
43
}
Original file line number Diff line number Diff line change @@ -49,19 +49,27 @@ public function __construct(
49
49
* @throws ClientExceptionInterface
50
50
* @throws Exception\BunnyClientResponseException
51
51
* @throws Exception\JSONException
52
+ * @throws Exception\InvalidTypeForKeyValueException
53
+ * @throws Exception\InvalidTypeForListValueException
54
+ * @throws Exception\ParameterIsRequiredException
52
55
* @param string $collectionId
56
+ * @param array<string,mixed> $query
53
57
* @return BunnyClientResponseInterface
54
58
* @param int $libraryId
55
59
*/
56
60
public function getCollection (
57
61
int $ libraryId ,
58
62
string $ collectionId ,
63
+ array $ query = [],
59
64
): BunnyClientResponseInterface {
60
65
$ endpoint = new GetCollection ();
61
66
67
+ ParameterValidator::validate ($ query , $ endpoint ->getQuery ());
68
+
62
69
return $ this ->client ->request (
63
70
endpoint: $ endpoint ,
64
71
parameters: [$ libraryId , $ collectionId ],
72
+ query: $ query ,
65
73
);
66
74
}
67
75
You can’t perform that action at this time.
0 commit comments