Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Amo/Sdk/Models/RPA/BotListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class BotListResponse extends AbstractModel
{
protected int $count;
protected ?string $pageToken = null;

public array $_embedded = [
'items' => BotListCollection::class
Expand All @@ -20,6 +21,14 @@ public function getCount(): int
return $this->count;
}

/**
* @return string|null
*/
public function getPageToken(): ?string
{
return $this->pageToken;
}

/**
* @return BotListCollection|Bot[]
*/
Expand Down
14 changes: 12 additions & 2 deletions src/Amo/Sdk/Service/BotsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,19 @@ public function requestSearch(string $requestId, array $options = []): MessageSe
return MessageSearchResponse::fromStream($response->getBody());
}

public function get(): BotListResponse {
public function get(?string $pageToken = null, ?int $limit = null): BotListResponse {
$queryParams = [];

if ($pageToken) {
$queryParams['page_token'] = $pageToken;
}

if ($limit) {
$queryParams['limit'] = $limit;
}

$response = $this->apiClient->get(
$this->getUrl(),
$this->getUrl(null, $queryParams),
);
return BotListResponse::fromStream($response->getBody());
}
Expand Down