| @@ 531-549 (lines=19) @@ | ||
| 528 | * @throws InvalidParameterException |
|
| 529 | * @throws NotFoundException |
|
| 530 | */ |
|
| 531 | public function startSnoop($channelId, $spy, $whisper, $app, $appArgs, $snoopId) |
|
| 532 | { |
|
| 533 | $uri = "/channels/$channelId/snoop"; |
|
| 534 | try { |
|
| 535 | $response = $this->client->getEndpoint()->post($uri, array( |
|
| 536 | 'spy' => $spy, |
|
| 537 | 'whisper' => $whisper, |
|
| 538 | 'app' => $app, |
|
| 539 | 'appArgs' => $appArgs, |
|
| 540 | 'snoopId' => $snoopId, |
|
| 541 | )); |
|
| 542 | } catch (Pest_BadRequest $e) { // Missing parameters |
|
| 543 | throw new InvalidParameterException($e); |
|
| 544 | } catch (Pest_NotFound $e) { // Channel not found |
|
| 545 | throw new NotFoundException($e); |
|
| 546 | } |
|
| 547 | ||
| 548 | return new Channel($this->client, $response); |
|
| 549 | } |
|
| 550 | ||
| 551 | /** |
|
| 552 | * Start snooping. Snoop (spy/whisper) on a specific channel. |
|
| @@ 564-581 (lines=18) @@ | ||
| 561 | * @throws InvalidParameterException |
|
| 562 | * @throws NotFoundException |
|
| 563 | */ |
|
| 564 | public function startSnoopWithId($channelId, $spy, $whisper, $app, $appArgs, $snoopId) |
|
| 565 | { |
|
| 566 | $uri = "/channels/$channelId/snoop/$snoopId"; |
|
| 567 | try { |
|
| 568 | $response = $this->client->getEndpoint()->post($uri, array( |
|
| 569 | 'spy' => $spy, |
|
| 570 | 'whisper' => $whisper, |
|
| 571 | 'app' => $app, |
|
| 572 | 'appArgs' => $appArgs, |
|
| 573 | )); |
|
| 574 | } catch (Pest_BadRequest $e) { // Missing parameters |
|
| 575 | throw new InvalidParameterException($e); |
|
| 576 | } catch (Pest_NotFound $e) { // Channel not found |
|
| 577 | throw new NotFoundException($e); |
|
| 578 | } |
|
| 579 | ||
| 580 | return new Channel($this->client, $response); |
|
| 581 | } |
|
| 582 | ||
| 583 | /** |
|
| 584 | * @return string |
|