diff --git a/src/Amo/Sdk/Models/RPA/BotListResponse.php b/src/Amo/Sdk/Models/RPA/BotListResponse.php index 49d8a4e..434b1a3 100644 --- a/src/Amo/Sdk/Models/RPA/BotListResponse.php +++ b/src/Amo/Sdk/Models/RPA/BotListResponse.php @@ -7,6 +7,7 @@ class BotListResponse extends AbstractModel { protected int $count; + protected ?string $pageToken = null; public array $_embedded = [ 'items' => BotListCollection::class @@ -20,6 +21,14 @@ public function getCount(): int return $this->count; } + /** + * @return string|null + */ + public function getPageToken(): ?string + { + return $this->pageToken; + } + /** * @return BotListCollection|Bot[] */ diff --git a/src/Amo/Sdk/Service/BotsService.php b/src/Amo/Sdk/Service/BotsService.php index 2220560..f97f988 100644 --- a/src/Amo/Sdk/Service/BotsService.php +++ b/src/Amo/Sdk/Service/BotsService.php @@ -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()); }