mirror of
https://github.com/LukeHagar/plexphp.git
synced 2025-12-06 04:20:51 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.129.1
This commit is contained in:
29
USAGE.md
Normal file
29
USAGE.md
Normal file
@@ -0,0 +1,29 @@
|
||||
<!-- Start SDK Example Usage [usage] -->
|
||||
```php
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security();
|
||||
$security->accessToken = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setSecurity($security)
|
||||
->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getServerCapabilities();
|
||||
|
||||
if ($response->twoHundredApplicationJsonObject !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// handle exception
|
||||
}
|
||||
|
||||
```
|
||||
<!-- End SDK Example Usage [usage] -->
|
||||
Reference in New Issue
Block a user