Skip to content

Commit 56a0fe5

Browse files
matthi4sk0ka
authored andcommitted
set alias for image list params, added sort param
1 parent 3c85b6f commit 56a0fe5

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/Common/Api/AbstractParams.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function sortDir(): array
8585
return [
8686
'type' => self::STRING_TYPE,
8787
'location' => self::QUERY,
88+
'sentAs' => 'sort_dir',
8889
'description' => 'Sorts by one or more sets of attribute and sort direction combinations.',
8990
'enum' => ['asc', 'desc'],
9091
];
@@ -95,6 +96,7 @@ public function sortKey(): array
9596
return [
9697
'type' => self::STRING_TYPE,
9798
'location' => self::QUERY,
99+
'sentAs' => 'sort_key',
98100
'description' => 'Sorts by one or more sets of attribute and sort direction combinations.',
99101
];
100102
}

src/Images/v2/Api.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function getImages(): array
4444
'marker' => $this->params->marker(),
4545
'sortKey' => $this->params->sortKey(),
4646
'sortDir' => $this->params->sortDir(),
47+
'sort' => $this->params->sort(),
4748
'name' => $this->params->queryName(),
4849
'visibility' => $this->params->queryVisibility(),
4950
'memberStatus' => $this->params->queryMemberStatus(),

src/Images/v2/Params.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public function queryMemberStatus(): array
113113
return [
114114
'location' => self::QUERY,
115115
'type' => self::STRING_TYPE,
116+
'sentAs' => 'member_status',
116117
'description' => 'Shows only images with this member status.',
117118
'enum' => ['accepted', 'pending', 'rejected', 'all'],
118119
];
@@ -142,6 +143,7 @@ public function querySizeMin(): array
142143
return [
143144
'location' => self::QUERY,
144145
'type' => self::INT_TYPE,
146+
'sentAs' => 'size_min',
145147
'description' => 'Shows only images with this minimum image size.',
146148
];
147149
}
@@ -151,6 +153,7 @@ public function querySizeMax(): array
151153
return [
152154
'location' => self::QUERY,
153155
'type' => self::INT_TYPE,
156+
'sentAs' => 'size_max',
154157
'description' => 'Shows only images with this maximum image size.',
155158
];
156159
}
@@ -164,6 +167,16 @@ public function queryTag(): array
164167
];
165168
}
166169

170+
public function sort(): array
171+
{
172+
return [
173+
'location' => self::QUERY,
174+
'type' => self::STRING_TYPE,
175+
'description' => 'Sorts the response by one or more attribute and sort direction combinations. You can ' .
176+
'also set multiple sort keys and directions. Default direction is desc.'
177+
];
178+
}
179+
167180
public function contentType(): array
168181
{
169182
return [

0 commit comments

Comments
 (0)