Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Split up fetch examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Feb 24, 2021
1 parent e07c691 commit 8900514
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php declare(strict_types=1);

use Ticketpark\Wsc\Request\LiveStream\FetchAllRequest;
use Ticketpark\Wsc\Request\LiveStream\FetchRequest;
use Ticketpark\Wsc\Response\ErrorResponse;

require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../credentials.php';
Expand All @@ -13,18 +13,8 @@
$response = (new FetchAllRequest($apiKey, $accessKey, false))
->execute();

$liveStreams = $response->getLiveStreams();


// Fetch details of first result
// https://api.docs.cloud.wowza.com/v1.5/tag/live_streams#operation/showLiveStream

$response = (new FetchRequest($apiKey, $accessKey, false))
->setId('lsxpkmhj')
->execute();


print_r($response->getLiveStream());



if ($response instanceof ErrorResponse) {
print 'Error: ' . $response->getMeta()->getMessage();
} else {
print_r($response->getLiveStreams());
}
22 changes: 22 additions & 0 deletions example/LiveStream/2-fetch-single.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php declare(strict_types=1);

use Ticketpark\Wsc\Request\LiveStream\FetchRequest;
use Ticketpark\Wsc\Response\ErrorResponse;

require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../credentials.php';


// Fetch details of a single livestream
// https://api.docs.cloud.wowza.com/v1.5/tag/live_streams#operation/showLiveStream

$response = (new FetchRequest($apiKey, $accessKey, false))
->setId('xxx')
->execute();


if ($response instanceof ErrorResponse) {
print 'Error: ' . $response->getMeta()->getMessage();
} else {
print_r($response->getLiveStream());
}

0 comments on commit 8900514

Please sign in to comment.