Skip to content

Commit

Permalink
set alias for image list params, added sort param
Browse files Browse the repository at this point in the history
  • Loading branch information
matthi4s authored and k0ka committed Dec 15, 2023
1 parent 3c85b6f commit 56a0fe5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Common/Api/AbstractParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function sortDir(): array
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'sort_dir',
'description' => 'Sorts by one or more sets of attribute and sort direction combinations.',
'enum' => ['asc', 'desc'],
];
Expand All @@ -95,6 +96,7 @@ public function sortKey(): array
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'sort_key',
'description' => 'Sorts by one or more sets of attribute and sort direction combinations.',
];
}
Expand Down
1 change: 1 addition & 0 deletions src/Images/v2/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function getImages(): array
'marker' => $this->params->marker(),
'sortKey' => $this->params->sortKey(),
'sortDir' => $this->params->sortDir(),
'sort' => $this->params->sort(),
'name' => $this->params->queryName(),
'visibility' => $this->params->queryVisibility(),
'memberStatus' => $this->params->queryMemberStatus(),
Expand Down
13 changes: 13 additions & 0 deletions src/Images/v2/Params.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public function queryMemberStatus(): array
return [
'location' => self::QUERY,
'type' => self::STRING_TYPE,
'sentAs' => 'member_status',
'description' => 'Shows only images with this member status.',
'enum' => ['accepted', 'pending', 'rejected', 'all'],
];
Expand Down Expand Up @@ -142,6 +143,7 @@ public function querySizeMin(): array
return [
'location' => self::QUERY,
'type' => self::INT_TYPE,
'sentAs' => 'size_min',
'description' => 'Shows only images with this minimum image size.',
];
}
Expand All @@ -151,6 +153,7 @@ public function querySizeMax(): array
return [
'location' => self::QUERY,
'type' => self::INT_TYPE,
'sentAs' => 'size_max',
'description' => 'Shows only images with this maximum image size.',
];
}
Expand All @@ -164,6 +167,16 @@ public function queryTag(): array
];
}

public function sort(): array
{
return [
'location' => self::QUERY,
'type' => self::STRING_TYPE,
'description' => 'Sorts the response by one or more attribute and sort direction combinations. You can ' .
'also set multiple sort keys and directions. Default direction is desc.'
];
}

public function contentType(): array
{
return [
Expand Down

0 comments on commit 56a0fe5

Please sign in to comment.