mirror of
https://github.com/LukeHagar/plexphp.git
synced 2025-12-06 04:20:51 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
lockVersion: 2.0.0
|
||||
id: 01a51eb2-5d90-4a24-b154-68e491d02c36
|
||||
management:
|
||||
docChecksum: 5e039359563b41bbe118fc6701ba22dc
|
||||
docChecksum: e7673f3f46e5b0bf495c378378aa7ad6
|
||||
docVersion: 0.0.3
|
||||
speakeasyVersion: 1.402.14
|
||||
generationVersion: 2.422.22
|
||||
releaseVersion: 0.10.0
|
||||
configChecksum: 2922b9b3b78b0220103ba0c17b1ed6fa
|
||||
speakeasyVersion: 1.404.5
|
||||
generationVersion: 2.426.2
|
||||
releaseVersion: 0.10.1
|
||||
configChecksum: 91b2dd16663efb6b9ea6649cf44a1618
|
||||
repoURL: https://github.com/LukeHagar/plexphp.git
|
||||
repoSubDirectory: .
|
||||
installationURL: https://github.com/LukeHagar/plexphp
|
||||
published: true
|
||||
features:
|
||||
php:
|
||||
core: 3.4.5
|
||||
core: 3.4.8
|
||||
deprecations: 2.81.1
|
||||
enums: 2.81.1
|
||||
errors: 0.1.2
|
||||
errors: 0.1.3
|
||||
flattening: 2.81.1
|
||||
globalSecurity: 2.81.7
|
||||
globalSecurityFlattening: 0.1.1
|
||||
@@ -2100,7 +2100,12 @@ examples:
|
||||
parameters:
|
||||
path:
|
||||
pinID: 408895
|
||||
query: {}
|
||||
query:
|
||||
X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40"
|
||||
X-Plex-Product: "Plex Web"
|
||||
X-Plex-Device: "Linux"
|
||||
X-Plex-Version: "4.133.0"
|
||||
X-Plex-Platform: "Chrome"
|
||||
responses:
|
||||
"404":
|
||||
application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]}
|
||||
@@ -2528,7 +2533,7 @@ examples:
|
||||
speakeasy-default-get-token-details:
|
||||
responses:
|
||||
"200":
|
||||
application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null}
|
||||
application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "active", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null}
|
||||
"400":
|
||||
application/json: {"errors": []}
|
||||
"401":
|
||||
|
||||
@@ -12,7 +12,7 @@ generation:
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: false
|
||||
php:
|
||||
version: 0.10.0
|
||||
version: 0.10.1
|
||||
clientServerStatusCodesAsErrors: true
|
||||
flattenGlobalSecurity: true
|
||||
imports:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.402.14
|
||||
speakeasyVersion: 1.404.5
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -9,8 +9,8 @@ sources:
|
||||
- main
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e
|
||||
sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e
|
||||
sourceRevisionDigest: sha256:276a31ab98595ebaf2b1fac4b4f5c3c1c7b55e0431f9074c89b8fbcb55b52d3f
|
||||
sourceBlobDigest: sha256:2bc9e816db669d609d8a5988ebb629578dc5cbbaff191d260b5c63b7ba1bd59b
|
||||
tags:
|
||||
- latest
|
||||
- main
|
||||
@@ -18,10 +18,10 @@ targets:
|
||||
plexphp:
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e
|
||||
sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e
|
||||
sourceRevisionDigest: sha256:276a31ab98595ebaf2b1fac4b4f5c3c1c7b55e0431f9074c89b8fbcb55b52d3f
|
||||
sourceBlobDigest: sha256:2bc9e816db669d609d8a5988ebb629578dc5cbbaff191d260b5c63b7ba1bd59b
|
||||
codeSamplesNamespace: code-samples-php-plexphp
|
||||
codeSamplesRevisionDigest: sha256:79772c55deda5b6a51423f1e52bde30280ceb6babc20a243a4905190cee8f142
|
||||
codeSamplesRevisionDigest: sha256:f8eef34098947cc9ec73bca8291a4c763d6d133347f98550a6aadde00bef8231
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
|
||||
173
README.md
173
README.md
@@ -11,6 +11,31 @@
|
||||
## Summary
|
||||
|
||||
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
|
||||
# Plex Media Server OpenAPI Specification
|
||||
|
||||
An Open Source OpenAPI Specification for Plex Media Server
|
||||
|
||||
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||
|
||||
## Documentation
|
||||
|
||||
[API Documentation](https://plexapi.dev)
|
||||
|
||||
## SDKs
|
||||
|
||||
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.
|
||||
|
||||
| Language | Repository | Releases | Other |
|
||||
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
|
||||
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
<!-- End Summary [summary] -->
|
||||
|
||||
<!-- Start Table of Contents [toc] -->
|
||||
@@ -20,6 +45,7 @@ Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
* [SDK Example Usage](#sdk-example-usage)
|
||||
* [Available Resources and Operations](#available-resources-and-operations)
|
||||
* [Global Parameters](#global-parameters)
|
||||
* [Error Handling](#error-handling)
|
||||
* [Server Selection](#server-selection)
|
||||
<!-- End Table of Contents [toc] -->
|
||||
|
||||
@@ -45,11 +71,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -59,14 +82,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getServerCapabilities();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getServerCapabilities(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
<!-- End SDK Example Usage [usage] -->
|
||||
@@ -77,19 +100,19 @@ try {
|
||||
<details open>
|
||||
<summary>Available methods</summary>
|
||||
|
||||
### [Activities](docs/sdks/activities/README.md)
|
||||
### [activities](docs/sdks/activities/README.md)
|
||||
|
||||
* [getServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
|
||||
* [cancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) - Cancel Server Activities
|
||||
|
||||
### [Authentication](docs/sdks/authentication/README.md)
|
||||
### [authentication](docs/sdks/authentication/README.md)
|
||||
|
||||
* [getTransientToken](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token
|
||||
* [getSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
||||
* [getTokenDetails](docs/sdks/authentication/README.md#gettokendetails) - Get Token Details
|
||||
* [postUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) - Get User Sign In Data
|
||||
|
||||
### [Butler](docs/sdks/butler/README.md)
|
||||
### [butler](docs/sdks/butler/README.md)
|
||||
|
||||
* [getButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks
|
||||
* [startAllTasks](docs/sdks/butler/README.md#startalltasks) - Start all Butler tasks
|
||||
@@ -97,13 +120,13 @@ try {
|
||||
* [startTask](docs/sdks/butler/README.md#starttask) - Start a single Butler task
|
||||
* [stopTask](docs/sdks/butler/README.md#stoptask) - Stop a single Butler task
|
||||
|
||||
### [Hubs](docs/sdks/hubs/README.md)
|
||||
### [hubs](docs/sdks/hubs/README.md)
|
||||
|
||||
* [getGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs
|
||||
* [getRecentlyAdded](docs/sdks/hubs/README.md#getrecentlyadded) - Get Recently Added
|
||||
* [getLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs
|
||||
|
||||
### [Library](docs/sdks/library/README.md)
|
||||
### [library](docs/sdks/library/README.md)
|
||||
|
||||
* [getFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value
|
||||
* [getRecentlyAddedLibrary](docs/sdks/library/README.md#getrecentlyaddedlibrary) - Get Recently Added
|
||||
@@ -118,13 +141,13 @@ try {
|
||||
* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
|
||||
* [getOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
|
||||
|
||||
### [Log](docs/sdks/log/README.md)
|
||||
### [log](docs/sdks/log/README.md)
|
||||
|
||||
* [logLine](docs/sdks/log/README.md#logline) - Logging a single line message.
|
||||
* [logMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
||||
* [enablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
|
||||
|
||||
### [Media](docs/sdks/media/README.md)
|
||||
### [media](docs/sdks/media/README.md)
|
||||
|
||||
* [markPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played
|
||||
* [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
|
||||
@@ -132,7 +155,7 @@ try {
|
||||
* [getBannerImage](docs/sdks/media/README.md#getbannerimage) - Get Banner Image
|
||||
* [getThumbImage](docs/sdks/media/README.md#getthumbimage) - Get Thumb Image
|
||||
|
||||
### [Playlists](docs/sdks/playlists/README.md)
|
||||
### [playlists](docs/sdks/playlists/README.md)
|
||||
|
||||
* [createPlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
|
||||
* [getPlaylists](docs/sdks/playlists/README.md#getplaylists) - Get All Playlists
|
||||
@@ -144,7 +167,7 @@ try {
|
||||
* [addPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist
|
||||
* [uploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist
|
||||
|
||||
### [Plex](docs/sdks/plex/README.md)
|
||||
### [plex](docs/sdks/plex/README.md)
|
||||
|
||||
* [getCompanionsData](docs/sdks/plex/README.md#getcompanionsdata) - Get Companions Data
|
||||
* [getUserFriends](docs/sdks/plex/README.md#getuserfriends) - Get list of friends of the user logged in
|
||||
@@ -155,13 +178,13 @@ try {
|
||||
* [getTokenByPinId](docs/sdks/plex/README.md#gettokenbypinid) - Get Access Token by PinId
|
||||
|
||||
|
||||
### [Search](docs/sdks/search/README.md)
|
||||
### [search](docs/sdks/search/README.md)
|
||||
|
||||
* [performSearch](docs/sdks/search/README.md#performsearch) - Perform a search
|
||||
* [performVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search
|
||||
* [getSearchResults](docs/sdks/search/README.md#getsearchresults) - Get Search Results
|
||||
|
||||
### [Server](docs/sdks/server/README.md)
|
||||
### [server](docs/sdks/server/README.md)
|
||||
|
||||
* [getServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Get Server Capabilities
|
||||
* [getServerPreferences](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences
|
||||
@@ -173,31 +196,31 @@ try {
|
||||
* [getMediaProviders](docs/sdks/server/README.md#getmediaproviders) - Get Media Providers
|
||||
* [getServerList](docs/sdks/server/README.md#getserverlist) - Get Server List
|
||||
|
||||
### [Sessions](docs/sdks/sessions/README.md)
|
||||
### [sessions](docs/sdks/sessions/README.md)
|
||||
|
||||
* [getSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions
|
||||
* [getSessionHistory](docs/sdks/sessions/README.md#getsessionhistory) - Get Session History
|
||||
* [getTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions
|
||||
* [stopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session
|
||||
|
||||
### [Statistics](docs/sdks/statistics/README.md)
|
||||
### [statistics](docs/sdks/statistics/README.md)
|
||||
|
||||
* [getStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics
|
||||
* [getResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics
|
||||
* [getBandwidthStatistics](docs/sdks/statistics/README.md#getbandwidthstatistics) - Get Bandwidth Statistics
|
||||
|
||||
### [Updater](docs/sdks/updater/README.md)
|
||||
### [updater](docs/sdks/updater/README.md)
|
||||
|
||||
* [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
|
||||
* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
||||
* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates
|
||||
|
||||
### [Video](docs/sdks/video/README.md)
|
||||
### [video](docs/sdks/video/README.md)
|
||||
|
||||
* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
|
||||
* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
|
||||
|
||||
### [Watchlist](docs/sdks/watchlist/README.md)
|
||||
### [watchlist](docs/sdks/watchlist/README.md)
|
||||
|
||||
* [getWatchList](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist
|
||||
|
||||
@@ -246,19 +269,80 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetPinRequest();
|
||||
$response = $sdk->plex->getPin($request);
|
||||
$request = new Operations\GetPinRequest();
|
||||
|
||||
if ($response->authPinContainer !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->plex->getPin(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->authPinContainer !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
<!-- End Global Parameters [global-parameters] -->
|
||||
|
||||
<!-- Start Error Handling [errors] -->
|
||||
## Error Handling
|
||||
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
|
||||
|
||||
By default an API error will raise a `Errors\SDKException` exception, which has the following properties:
|
||||
|
||||
| Property | Type | Description |
|
||||
|----------------|-----------------------------------------|-----------------------|
|
||||
| `$message` | *string* | The error message |
|
||||
| `$statusCode` | *int* | The HTTP status code |
|
||||
| `$rawResponse` | *?\Psr\Http\Message\ResponseInterface* | The raw HTTP response |
|
||||
| `$body` | *string* | The response content |
|
||||
|
||||
When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `getServerCapabilities` method throws the following exceptions:
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
|
||||
| Errors\GetServerCapabilitiesBadRequest | 400 | application/json |
|
||||
| Errors\GetServerCapabilitiesUnauthorized | 401 | application/json |
|
||||
| LukeHagar\Plex_API\Models\Errors.SDKException | 4xx-5xx | */* |
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
declare(strict_types=1);
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
->setClientName('Plex Web')
|
||||
->setClientVersion('4.133.0')
|
||||
->setClientPlatform('Chrome')
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getServerCapabilities(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Errors\GetServerCapabilitiesBadRequestThrowable $e) {
|
||||
// handle $e->$container data
|
||||
throw $e;
|
||||
} catch (Errors\GetServerCapabilitiesUnauthorizedThrowable $e) {
|
||||
// handle $e->$container data
|
||||
throw $e;
|
||||
} catch (Errors\SDKException $e) {
|
||||
// handle default exception
|
||||
throw $e;
|
||||
}
|
||||
```
|
||||
<!-- End Error Handling [errors] -->
|
||||
|
||||
<!-- Start Server Selection [server] -->
|
||||
## Server Selection
|
||||
|
||||
@@ -295,11 +379,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -309,14 +390,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->plex->getCompanionsData("https://plex.tv/api/v2/");
|
||||
|
||||
if ($response->responseBodies !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->plex->getCompanionsData(
|
||||
"https://plex.tv/api/v2"
|
||||
);
|
||||
|
||||
if ($response->responseBodies !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
<!-- End Server Selection [server] -->
|
||||
|
||||
12
RELEASES.md
12
RELEASES.md
@@ -632,4 +632,14 @@ Based on:
|
||||
### Generated
|
||||
- [php v0.10.0] .
|
||||
### Releases
|
||||
- [Composer v0.10.0] https://packagist.org/packages/lukehagar/plex-api#v0.10.0 - .
|
||||
- [Composer v0.10.0] https://packagist.org/packages/lukehagar/plex-api#v0.10.0 - .
|
||||
|
||||
## 2024-09-28 00:09:29
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [php v0.10.1] .
|
||||
### Releases
|
||||
- [Composer v0.10.1] https://packagist.org/packages/lukehagar/plex-api#v0.10.1 - .
|
||||
19
USAGE.md
19
USAGE.md
@@ -5,11 +5,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -19,14 +16,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getServerCapabilities();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getServerCapabilities(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
<!-- End SDK Example Usage [usage] -->
|
||||
1639
codeSamples.yaml
1639
codeSamples.yaml
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
"phpdocumentor/type-resolver": "^1.8"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/pint": "^1.15",
|
||||
"laravel/pint": "^1.18.1",
|
||||
"phpstan/phpstan": "^1.9",
|
||||
"phpunit/phpunit": "^10",
|
||||
"rector/rector": "^0.18.13",
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||
| `protocol` | [Operations\Protocol](../../Models/Operations/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) |
|
||||
| `address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection |
|
||||
| `port` | *int* | :heavy_check_mark: | The port used for the connection |
|
||||
| `uri` | *string* | :heavy_check_mark: | The full URI of the connection |
|
||||
| `local` | *bool* | :heavy_check_mark: | If the connection is local address |
|
||||
| `relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct |
|
||||
| `iPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||
| `protocol` | [Operations\Protocol](../../Models/Operations/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | http |
|
||||
| `address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection | |
|
||||
| `port` | *int* | :heavy_check_mark: | The port used for the connection | |
|
||||
| `uri` | *string* | :heavy_check_mark: | The full URI of the connection | |
|
||||
| `local` | *bool* | :heavy_check_mark: | If the connection is local address | |
|
||||
| `relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct | |
|
||||
| `iPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 | |
|
||||
@@ -3,6 +3,11 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
||||
| `pinID` | *int* | :heavy_check_mark: | The PinID to retrieve an access token for |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `pinID` | *int* | :heavy_check_mark: | The PinID to retrieve an access token for | |
|
||||
| `clientID` | *?string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | gcgzw5rz2xovp84b4vha3a40 |
|
||||
| `clientName` | *?string* | :heavy_minus_sign: | N/A | Plex Web |
|
||||
| `deviceName` | *?string* | :heavy_minus_sign: | N/A | Linux |
|
||||
| `clientVersion` | *?string* | :heavy_minus_sign: | N/A | 4.133.0 |
|
||||
| `clientPlatform` | *?string* | :heavy_minus_sign: | N/A | Chrome |
|
||||
@@ -24,7 +24,7 @@ Logged in user details
|
||||
| `id` | *int* | :heavy_check_mark: | The Plex account ID | 13692262 |
|
||||
| `joinedAt` | *int* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||
| `mailingListActive` | *bool* | :heavy_check_mark: | If you are subscribed to the Plex newsletter | |
|
||||
| `mailingListStatus` | [Operations\MailingListStatus](../../Models/Operations/MailingListStatus.md) | :heavy_check_mark: | Your current mailing list status | |
|
||||
| `mailingListStatus` | [Operations\MailingListStatus](../../Models/Operations/MailingListStatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active |
|
||||
| `maxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 |
|
||||
| `profile` | [Operations\UserProfile](../../Models/Operations/UserProfile.md) | :heavy_check_mark: | N/A | |
|
||||
| `protected` | *bool* | :heavy_check_mark: | If the account has a Plex Home PIN enabled | |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# MailingListStatus
|
||||
|
||||
Your current mailing list status
|
||||
Your current mailing list status (active or unsubscribed)
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# PostUsersSignInDataMailingListStatus
|
||||
|
||||
Your current mailing list status
|
||||
Your current mailing list status (active or unsubscribed)
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
@@ -24,7 +24,7 @@ Returns the user account data with a valid auth token
|
||||
| `id` | *int* | :heavy_check_mark: | The Plex account ID | 13692262 |
|
||||
| `joinedAt` | *int* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||
| `mailingListActive` | *bool* | :heavy_check_mark: | If you are subscribed to the Plex newsletter | |
|
||||
| `mailingListStatus` | [Operations\PostUsersSignInDataMailingListStatus](../../Models/Operations/PostUsersSignInDataMailingListStatus.md) | :heavy_check_mark: | Your current mailing list status | |
|
||||
| `mailingListStatus` | [Operations\PostUsersSignInDataMailingListStatus](../../Models/Operations/PostUsersSignInDataMailingListStatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active |
|
||||
| `maxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 |
|
||||
| `profile` | [Operations\PostUsersSignInDataUserProfile](../../Models/Operations/PostUsersSignInDataUserProfile.md) | :heavy_check_mark: | N/A | |
|
||||
| `protected` | *bool* | :heavy_check_mark: | If the account has a Plex Home PIN enabled | |
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Activities
|
||||
(*activities*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -28,11 +29,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -42,14 +40,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->activities->getServerActivities();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->activities->getServerActivities(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -78,11 +76,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -92,15 +87,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->activities->cancelServerActivities('25b71ed5-0f9d-461c-baa7-d404e9e10d3e');
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->activities->cancelServerActivities(
|
||||
activityUUID: '25b71ed5-0f9d-461c-baa7-d404e9e10d3e'
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Authentication
|
||||
(*authentication*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -25,12 +26,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -40,15 +38,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->authentication->getTransientToken(Operations\GetTransientTokenQueryParamType::Delegation, Operations\Scope::All);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->authentication->getTransientToken(
|
||||
type: Operations\GetTransientTokenQueryParamType::Delegation,
|
||||
scope: Operations\Scope::All
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -86,11 +85,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -100,15 +96,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->authentication->getSourceConnectionInformation('server://client-identifier');
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->authentication->getSourceConnectionInformation(
|
||||
source: 'server://client-identifier'
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -143,11 +138,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -157,14 +149,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->authentication->getTokenDetails();
|
||||
|
||||
if ($response->userPlexAccount !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->authentication->getTokenDetails(
|
||||
|
||||
);
|
||||
|
||||
if ($response->userPlexAccount !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -209,21 +201,20 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\PostUsersSignInDataRequest(
|
||||
requestBody: new Operations\PostUsersSignInDataRequestBody(
|
||||
login: 'username@email.com',
|
||||
password: 'password123',
|
||||
verificationCode: '123456',
|
||||
),
|
||||
);
|
||||
$response = $sdk->authentication->postUsersSignInData($request);
|
||||
$request = new Operations\PostUsersSignInDataRequest(
|
||||
requestBody: new Operations\PostUsersSignInDataRequestBody(
|
||||
login: 'username@email.com',
|
||||
password: 'password123',
|
||||
verificationCode: '123456',
|
||||
),
|
||||
);
|
||||
|
||||
if ($response->userPlexAccount !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->authentication->postUsersSignInData(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->userPlexAccount !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Butler
|
||||
(*butler*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -25,11 +26,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -39,14 +37,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->butler->getButlerTasks();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->butler->getButlerTasks(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -80,11 +78,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -94,14 +89,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->butler->startAllTasks();
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->butler->startAllTasks(
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -131,11 +126,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -145,14 +137,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->butler->stopAllTasks();
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->butler->stopAllTasks(
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -186,12 +178,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -201,15 +190,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->butler->startTask(Operations\TaskName::CleanOldBundles);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->butler->startTask(
|
||||
taskName: Operations\TaskName::CleanOldBundles
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -245,12 +233,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -260,15 +245,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->butler->stopTask(Operations\PathParamTaskName::BackupDatabase);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->butler->stopTask(
|
||||
taskName: Operations\PathParamTaskName::BackupDatabase
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Hubs
|
||||
(*hubs*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -23,12 +24,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -38,15 +36,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->hubs->getGlobalHubs(1262.49, Operations\OnlyTransient::One);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->hubs->getGlobalHubs(
|
||||
count: 1262.49,
|
||||
onlyTransient: Operations\OnlyTransient::One
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -83,12 +82,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -98,22 +94,21 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetRecentlyAddedRequest(
|
||||
contentDirectoryID: 470161,
|
||||
type: Operations\Type::TvShow,
|
||||
sectionID: 2,
|
||||
includeMeta: Operations\IncludeMeta::Enable,
|
||||
xPlexContainerStart: 0,
|
||||
xPlexContainerSize: 50,
|
||||
);
|
||||
$response = $sdk->hubs->getRecentlyAdded($request);
|
||||
$request = new Operations\GetRecentlyAddedRequest(
|
||||
contentDirectoryID: 470161,
|
||||
type: Operations\Type::TvShow,
|
||||
sectionID: 2,
|
||||
includeMeta: Operations\IncludeMeta::Enable,
|
||||
xPlexContainerStart: 0,
|
||||
xPlexContainerSize: 50,
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->hubs->getRecentlyAdded(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -147,12 +142,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -162,15 +154,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->hubs->getLibraryHubs(6728.76, 639.24, Operations\QueryParamOnlyTransient::One);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->hubs->getLibraryHubs(
|
||||
sectionId: 6728.76,
|
||||
count: 639.24,
|
||||
onlyTransient: Operations\QueryParamOnlyTransient::One
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Library
|
||||
(*library*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -32,11 +33,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -46,15 +44,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->library->getFileHash('file://C:\Image.png&type=13', 4462.17);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getFileHash(
|
||||
url: 'file://C:\Image.png&type=13',
|
||||
type: 4462.17
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -91,12 +90,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -106,36 +102,35 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetRecentlyAddedLibraryRequest(
|
||||
type: Operations\QueryParamType::TvShow,
|
||||
contentDirectoryID: 2,
|
||||
pinnedContentDirectoryID: [
|
||||
3,
|
||||
5,
|
||||
7,
|
||||
13,
|
||||
12,
|
||||
1,
|
||||
6,
|
||||
14,
|
||||
2,
|
||||
10,
|
||||
16,
|
||||
17,
|
||||
],
|
||||
sectionID: 2,
|
||||
includeMeta: Operations\QueryParamIncludeMeta::Enable,
|
||||
xPlexContainerStart: 0,
|
||||
xPlexContainerSize: 50,
|
||||
);
|
||||
$response = $sdk->library->getRecentlyAddedLibrary($request);
|
||||
$request = new Operations\GetRecentlyAddedLibraryRequest(
|
||||
type: Operations\QueryParamType::TvShow,
|
||||
contentDirectoryID: 2,
|
||||
pinnedContentDirectoryID: [
|
||||
3,
|
||||
5,
|
||||
7,
|
||||
13,
|
||||
12,
|
||||
1,
|
||||
6,
|
||||
14,
|
||||
2,
|
||||
10,
|
||||
16,
|
||||
17,
|
||||
],
|
||||
sectionID: 2,
|
||||
includeMeta: Operations\QueryParamIncludeMeta::Enable,
|
||||
xPlexContainerStart: 0,
|
||||
xPlexContainerSize: 50,
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getRecentlyAddedLibrary(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -176,11 +171,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -190,14 +182,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->library->getAllLibraries();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->library->getAllLibraries(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -265,12 +257,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -280,15 +269,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->library->getLibraryDetails(9518, Operations\IncludeDetails::Zero);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getLibraryDetails(
|
||||
sectionKey: 9518,
|
||||
includeDetails: Operations\IncludeDetails::Zero
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -324,11 +314,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -338,15 +325,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->library->deleteLibrary(9518);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->deleteLibrary(
|
||||
sectionKey: 9518
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -401,12 +387,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -416,23 +399,22 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetLibraryItemsRequest(
|
||||
sectionKey: 9518,
|
||||
tag: Operations\Tag::Edition,
|
||||
includeGuids: Operations\IncludeGuids::Enable,
|
||||
type: Operations\GetLibraryItemsQueryParamType::TvShow,
|
||||
includeMeta: Operations\GetLibraryItemsQueryParamIncludeMeta::Enable,
|
||||
xPlexContainerStart: 0,
|
||||
xPlexContainerSize: 50,
|
||||
);
|
||||
$response = $sdk->library->getLibraryItems($request);
|
||||
$request = new Operations\GetLibraryItemsRequest(
|
||||
sectionKey: 9518,
|
||||
tag: Operations\Tag::Edition,
|
||||
includeGuids: Operations\IncludeGuids::Enable,
|
||||
type: Operations\GetLibraryItemsQueryParamType::TvShow,
|
||||
includeMeta: Operations\GetLibraryItemsQueryParamIncludeMeta::Enable,
|
||||
xPlexContainerStart: 0,
|
||||
xPlexContainerSize: 50,
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getLibraryItems(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -468,12 +450,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -483,15 +462,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->library->getRefreshLibraryMetadata(9518, Operations\Force::One);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getRefreshLibraryMetadata(
|
||||
sectionKey: 9518,
|
||||
force: Operations\Force::One
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -545,12 +525,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -560,15 +537,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->library->getSearchLibrary(9518, Operations\GetSearchLibraryQueryParamType::TvShow);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getSearchLibrary(
|
||||
sectionKey: 9518,
|
||||
type: Operations\GetSearchLibraryQueryParamType::TvShow
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -605,11 +583,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -619,15 +594,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->library->getMetaDataByRatingKey(9518);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getMetaDataByRatingKey(
|
||||
ratingKey: 9518
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -663,11 +637,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -677,15 +648,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->library->getMetadataChildren(1539.15, '<value>');
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getMetadataChildren(
|
||||
ratingKey: 1539.15,
|
||||
includeElements: '<value>'
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -722,12 +694,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -737,15 +706,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->library->getTopWatchedContent(Operations\GetTopWatchedContentQueryParamType::TvShow, 1);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->library->getTopWatchedContent(
|
||||
type: Operations\GetTopWatchedContentQueryParamType::TvShow,
|
||||
includeGuids: 1
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -782,11 +752,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -796,14 +763,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->library->getOnDeck();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->library->getOnDeck(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Log
|
||||
(*log*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -24,12 +25,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -39,15 +37,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->log->logLine(Operations\Level::Three, 'Test log message', 'Postman');
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->log->logLine(
|
||||
level: Operations\Level::Three,
|
||||
message: 'Test log message',
|
||||
source: 'Postman'
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -105,11 +105,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -119,17 +116,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = 'level=4&message=Test%20message%201&source=postman
|
||||
level=3&message=Test%20message%202&source=postman
|
||||
level=1&message=Test%20message%203&source=postman';
|
||||
$response = $sdk->log->logMultiLine($request);
|
||||
$request = 'level=4&message=Test%20message%201&source=postman
|
||||
level=3&message=Test%20message%202&source=postman
|
||||
level=1&message=Test%20message%203&source=postman';
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->log->logMultiLine(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -165,11 +161,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -179,14 +172,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->log->enablePaperTrail();
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->log->enablePaperTrail(
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Media
|
||||
(*media*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -25,11 +26,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -39,15 +37,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->media->markPlayed(59398);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->media->markPlayed(
|
||||
key: 59398
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -82,11 +79,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -96,15 +90,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->media->markUnplayed(59398);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->media->markUnplayed(
|
||||
key: 59398
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -140,11 +133,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -154,15 +144,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->media->updatePlayProgress('<key>', 90000, 'played');
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->media->updatePlayProgress(
|
||||
key: '<key>',
|
||||
time: 90000,
|
||||
state: 'played'
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -199,12 +191,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -214,22 +203,21 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetBannerImageRequest(
|
||||
ratingKey: 9518,
|
||||
width: 396,
|
||||
height: 396,
|
||||
minSize: 1,
|
||||
upscale: 1,
|
||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||
);
|
||||
$response = $sdk->media->getBannerImage($request);
|
||||
$request = new Operations\GetBannerImageRequest(
|
||||
ratingKey: 9518,
|
||||
width: 396,
|
||||
height: 396,
|
||||
minSize: 1,
|
||||
upscale: 1,
|
||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||
);
|
||||
|
||||
if ($response->bytes !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->media->getBannerImage(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->bytes !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -264,12 +252,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -279,22 +264,21 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetThumbImageRequest(
|
||||
ratingKey: 9518,
|
||||
width: 396,
|
||||
height: 396,
|
||||
minSize: 1,
|
||||
upscale: 1,
|
||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||
);
|
||||
$response = $sdk->media->getThumbImage($request);
|
||||
$request = new Operations\GetThumbImageRequest(
|
||||
ratingKey: 9518,
|
||||
width: 396,
|
||||
height: 396,
|
||||
minSize: 1,
|
||||
upscale: 1,
|
||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||
);
|
||||
|
||||
if ($response->bytes !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->media->getThumbImage(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->bytes !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Playlists
|
||||
(*playlists*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -35,12 +36,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -50,20 +48,19 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\CreatePlaylistRequest(
|
||||
title: '<value>',
|
||||
type: Operations\CreatePlaylistQueryParamType::Photo,
|
||||
smart: Operations\Smart::One,
|
||||
uri: 'https://hoarse-testing.info/',
|
||||
);
|
||||
$response = $sdk->playlists->createPlaylist($request);
|
||||
$request = new Operations\CreatePlaylistRequest(
|
||||
title: '<value>',
|
||||
type: Operations\CreatePlaylistQueryParamType::Photo,
|
||||
smart: Operations\Smart::One,
|
||||
uri: 'https://hoarse-testing.info/',
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->createPlaylist(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -98,12 +95,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -113,15 +107,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->playlists->getPlaylists(Operations\PlaylistType::Audio, Operations\QueryParamSmart::Zero);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->getPlaylists(
|
||||
playlistType: Operations\PlaylistType::Audio,
|
||||
smart: Operations\QueryParamSmart::Zero
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -159,11 +154,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -173,15 +165,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->playlists->getPlaylist(4109.48);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->getPlaylist(
|
||||
playlistID: 4109.48
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -217,11 +208,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -231,15 +219,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->playlists->deletePlaylist(216.22);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->deletePlaylist(
|
||||
playlistID: 216.22
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -275,11 +262,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -289,15 +273,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->playlists->updatePlaylist(3915.00, '<value>', '<value>');
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->updatePlaylist(
|
||||
playlistID: 3915.00,
|
||||
title: '<value>',
|
||||
summary: '<value>'
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -338,12 +324,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -353,15 +336,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->playlists->getPlaylistContents(5004.46, Operations\GetPlaylistContentsQueryParamType::TvShow);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->getPlaylistContents(
|
||||
playlistID: 5004.46,
|
||||
type: Operations\GetPlaylistContentsQueryParamType::TvShow
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -398,11 +382,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -412,15 +393,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->playlists->clearPlaylistContents(1893.18);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->clearPlaylistContents(
|
||||
playlistID: 1893.18
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -457,11 +437,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -471,15 +448,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->playlists->addPlaylistContents(8502.00, 'server://12345/com.plexapp.plugins.library/library/metadata/1', 123);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->addPlaylistContents(
|
||||
playlistID: 8502.00,
|
||||
uri: 'server://12345/com.plexapp.plugins.library/library/metadata/1',
|
||||
playQueueID: 123
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -517,12 +496,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -532,15 +508,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->playlists->uploadPlaylist('/home/barkley/playlist.m3u', Operations\QueryParamForce::Zero, 1);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->playlists->uploadPlaylist(
|
||||
path: '/home/barkley/playlist.m3u',
|
||||
force: Operations\QueryParamForce::Zero,
|
||||
sectionID: 1
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Plex
|
||||
(*plex*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -27,11 +28,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -41,14 +39,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->plex->getCompanionsData();
|
||||
|
||||
if ($response->responseBodies !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->plex->getCompanionsData(
|
||||
|
||||
);
|
||||
|
||||
if ($response->responseBodies !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -83,11 +81,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -97,14 +92,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->plex->getUserFriends();
|
||||
|
||||
if ($response->friends !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->plex->getUserFriends(
|
||||
|
||||
);
|
||||
|
||||
if ($response->friends !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -148,14 +143,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->plex->getGeoData();
|
||||
|
||||
if ($response->geoData !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->plex->getGeoData(
|
||||
|
||||
);
|
||||
|
||||
if ($response->geoData !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -190,11 +185,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -204,14 +196,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->plex->getHomeData();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->plex->getHomeData(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -240,12 +232,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -255,15 +244,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->plex->getServerResources(Operations\IncludeHttps::Enable, Operations\IncludeRelay::Enable, Operations\IncludeIPv6::Enable);
|
||||
|
||||
if ($response->plexDevices !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->plex->getServerResources(
|
||||
includeHttps: Operations\IncludeHttps::Enable,
|
||||
includeRelay: Operations\IncludeRelay::Enable,
|
||||
includeIPv6: Operations\IncludeIPv6::Enable
|
||||
|
||||
);
|
||||
|
||||
if ($response->plexDevices !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -311,15 +302,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetPinRequest();
|
||||
$response = $sdk->plex->getPin($request);
|
||||
$request = new Operations\GetPinRequest();
|
||||
|
||||
if ($response->authPinContainer !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->plex->getPin(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->authPinContainer !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -354,6 +344,7 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -363,24 +354,25 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetTokenByPinIdRequest(
|
||||
pinID: 408895,
|
||||
);
|
||||
|
||||
$response = $sdk->plex->getTokenByPinId(408895);
|
||||
$response = $sdk->plex->getTokenByPinId(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->authPinContainer !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
if ($response->authPinContainer !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
||||
| `pinID` | *int* | :heavy_check_mark: | The PinID to retrieve an access token for |
|
||||
| `$serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
|
||||
| Parameter | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| `$request` | [Operations\GetTokenByPinIdRequest](../../Models/Operations/GetTokenByPinIdRequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `$serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
@@ -2,4 +2,27 @@
|
||||
|
||||
## Overview
|
||||
|
||||
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
# Plex Media Server OpenAPI Specification
|
||||
|
||||
An Open Source OpenAPI Specification for Plex Media Server
|
||||
|
||||
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||
|
||||
## Documentation
|
||||
|
||||
[API Documentation](https://plexapi.dev)
|
||||
|
||||
## SDKs
|
||||
|
||||
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.
|
||||
|
||||
| Language | Repository | Releases | Other |
|
||||
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
|
||||
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Search
|
||||
(*search*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -35,11 +36,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -49,15 +47,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->search->performSearch('dylan', 9372.69, 5);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->search->performSearch(
|
||||
query: 'dylan',
|
||||
sectionId: 9372.69,
|
||||
limit: 5
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -98,11 +98,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -112,15 +109,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->search->performVoiceSearch('dead+poop', 4094.80, 5);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->search->performVoiceSearch(
|
||||
query: 'dead+poop',
|
||||
sectionId: 4094.80,
|
||||
limit: 5
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -157,11 +156,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -171,15 +167,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->search->getSearchResults('110');
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->search->getSearchResults(
|
||||
query: '110'
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Server
|
||||
(*server*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -29,11 +30,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -43,14 +41,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getServerCapabilities();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getServerCapabilities(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -79,11 +77,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -93,14 +88,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getServerPreferences();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getServerPreferences(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -129,11 +124,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -143,14 +135,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getAvailableClients();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getAvailableClients(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -179,11 +171,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -193,14 +182,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getDevices();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getDevices(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -238,14 +227,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getServerIdentity();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getServerIdentity(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -273,11 +262,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -287,14 +273,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getMyPlexAccount();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getMyPlexAccount(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -324,12 +310,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -339,23 +322,22 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetResizedPhotoRequest(
|
||||
width: 110,
|
||||
height: 165,
|
||||
opacity: 643869,
|
||||
blur: 0,
|
||||
minSize: Operations\MinSize::One,
|
||||
upscale: Operations\Upscale::One,
|
||||
url: '/library/metadata/49564/thumb/1654258204',
|
||||
);
|
||||
$response = $sdk->server->getResizedPhoto($request);
|
||||
$request = new Operations\GetResizedPhotoRequest(
|
||||
width: 110,
|
||||
height: 165,
|
||||
opacity: 643869,
|
||||
blur: 0,
|
||||
minSize: Operations\MinSize::One,
|
||||
upscale: Operations\Upscale::One,
|
||||
url: '/library/metadata/49564/thumb/1654258204',
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->server->getResizedPhoto(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -390,11 +372,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -404,15 +383,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->server->getMediaProviders('CV5xoxjTpFKUzBTShsaf');
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->server->getMediaProviders(
|
||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf'
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -447,11 +425,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -461,14 +436,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->server->getServerList();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->server->getServerList(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Sessions
|
||||
(*sessions*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -24,11 +25,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -38,14 +36,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->sessions->getSessions();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->sessions->getSessions(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -74,12 +72,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -89,15 +84,18 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$filter = new Operations\QueryParamFilter();
|
||||
$response = $sdk->sessions->getSessionHistory('<value>', 1, $filter, 12);
|
||||
$filter = new Operations\QueryParamFilter();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->sessions->getSessionHistory(
|
||||
sort: '<value>',
|
||||
accountId: 1,
|
||||
filter: $filter,
|
||||
librarySectionID: 12
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -135,11 +133,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -149,14 +144,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->sessions->getTranscodeSessions();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->sessions->getTranscodeSessions(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -185,11 +180,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -199,15 +191,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->sessions->stopTranscodeSession('zz7llzqlx8w9vnrsbnwhbmep');
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->sessions->stopTranscodeSession(
|
||||
sessionKey: 'zz7llzqlx8w9vnrsbnwhbmep'
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Statistics
|
||||
(*statistics*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -23,11 +24,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -37,15 +35,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->statistics->getStatistics(4);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->statistics->getStatistics(
|
||||
timespan: 4
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -80,11 +77,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -94,15 +88,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->statistics->getResourcesStatistics(4);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->statistics->getResourcesStatistics(
|
||||
timespan: 4
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -137,11 +130,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -151,15 +141,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->statistics->getBandwidthStatistics(4);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->statistics->getBandwidthStatistics(
|
||||
timespan: 4
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Updater
|
||||
(*updater*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -24,11 +25,8 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -38,14 +36,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$response = $sdk->updater->getUpdateStatus();
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
|
||||
$response = $sdk->updater->getUpdateStatus(
|
||||
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -74,12 +72,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -89,15 +84,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->updater->checkForUpdates(Operations\Download::One);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->updater->checkForUpdates(
|
||||
download: Operations\Download::One
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -133,12 +127,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -148,15 +139,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
|
||||
$response = $sdk->updater->applyUpdates(Operations\Tonight::One, Operations\Skip::One);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->updater->applyUpdates(
|
||||
tonight: Operations\Tonight::One,
|
||||
skip: Operations\Skip::One
|
||||
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Video
|
||||
(*video*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -22,12 +23,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -37,26 +35,25 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetTimelineRequest(
|
||||
ratingKey: 23409,
|
||||
key: '/library/metadata/23409',
|
||||
state: Operations\State::Playing,
|
||||
hasMDE: 1,
|
||||
time: 2000,
|
||||
duration: 10000,
|
||||
context: 'home:hub.continueWatching',
|
||||
playQueueItemID: 1,
|
||||
playBackTime: 2000,
|
||||
row: 1,
|
||||
);
|
||||
$response = $sdk->video->getTimeline($request);
|
||||
$request = new Operations\GetTimelineRequest(
|
||||
ratingKey: 23409,
|
||||
key: '/library/metadata/23409',
|
||||
state: Operations\State::Playing,
|
||||
hasMDE: 1,
|
||||
time: 2000,
|
||||
duration: 10000,
|
||||
context: 'home:hub.continueWatching',
|
||||
playQueueItemID: 1,
|
||||
playBackTime: 2000,
|
||||
row: 1,
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->video->getTimeline(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
@@ -91,12 +88,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -106,32 +100,31 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\StartUniversalTranscodeRequest(
|
||||
hasMDE: 1,
|
||||
path: '/library/metadata/23409',
|
||||
mediaIndex: 0,
|
||||
partIndex: 0,
|
||||
protocol: 'hls',
|
||||
fastSeek: 0,
|
||||
directPlay: 0,
|
||||
directStream: 0,
|
||||
subtitleSize: 100,
|
||||
subtites: 'burn',
|
||||
audioBoost: 100,
|
||||
location: 'lan',
|
||||
mediaBufferSize: 102400,
|
||||
session: 'zvcage8b7rkioqcm8f4uns4c',
|
||||
addDebugOverlay: 0,
|
||||
autoAdjustQuality: 0,
|
||||
);
|
||||
$response = $sdk->video->startUniversalTranscode($request);
|
||||
$request = new Operations\StartUniversalTranscodeRequest(
|
||||
hasMDE: 1,
|
||||
path: '/library/metadata/23409',
|
||||
mediaIndex: 0,
|
||||
partIndex: 0,
|
||||
protocol: 'hls',
|
||||
fastSeek: 0,
|
||||
directPlay: 0,
|
||||
directStream: 0,
|
||||
subtitleSize: 100,
|
||||
subtites: 'burn',
|
||||
audioBoost: 100,
|
||||
location: 'lan',
|
||||
mediaBufferSize: 102400,
|
||||
session: 'zvcage8b7rkioqcm8f4uns4c',
|
||||
addDebugOverlay: 0,
|
||||
autoAdjustQuality: 0,
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->video->startUniversalTranscode(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->statusCode === 200) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Watchlist
|
||||
(*watchlist*)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -21,12 +22,9 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Components;
|
||||
use LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
$security = new Components\Security(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
);
|
||||
$security = '<YOUR_API_KEY_HERE>';
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||
@@ -36,20 +34,19 @@ $sdk = Plex_API\PlexAPI::builder()
|
||||
->setDeviceName('Linux')
|
||||
->setSecurity($security)->build();
|
||||
|
||||
try {
|
||||
$request = new Operations\GetWatchListRequest(
|
||||
filter: Operations\Filter::Available,
|
||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||
xPlexContainerStart: 0,
|
||||
xPlexContainerSize: 50,
|
||||
);
|
||||
$response = $sdk->watchlist->getWatchList($request);
|
||||
$request = new Operations\GetWatchListRequest(
|
||||
filter: Operations\Filter::Available,
|
||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||
xPlexContainerStart: 0,
|
||||
xPlexContainerSize: 50,
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// handle exception
|
||||
$response = $sdk->watchlist->getWatchList(
|
||||
request: $request
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ class Authentication
|
||||
{
|
||||
public const GET_TOKEN_DETAILS_SERVERS = [
|
||||
|
||||
'https://plex.tv/api/v2/',
|
||||
'https://plex.tv/api/v2',
|
||||
];
|
||||
public const POST_USERS_SIGN_IN_DATA_SERVERS = [
|
||||
|
||||
'https://plex.tv/api/v2/',
|
||||
'https://plex.tv/api/v2',
|
||||
];
|
||||
private SDKConfiguration $sdkConfiguration;
|
||||
/**
|
||||
|
||||
@@ -20,10 +20,60 @@ class GetTokenByPinIdRequest
|
||||
public int $pinID;
|
||||
|
||||
/**
|
||||
* @param int $pinID
|
||||
* The unique identifier for the client application
|
||||
*
|
||||
* This is used to track the client application and its usage
|
||||
* (UUID, serial number, or other number unique per device)
|
||||
*
|
||||
*
|
||||
* @var ?string $clientID
|
||||
*/
|
||||
public function __construct(int $pinID)
|
||||
#[SpeakeasyMetadata('queryParam:style=form,explode=true,name=X-Plex-Client-Identifier')]
|
||||
public ?string $clientID = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ?string $clientName
|
||||
*/
|
||||
#[SpeakeasyMetadata('queryParam:style=form,explode=true,name=X-Plex-Product')]
|
||||
public ?string $clientName = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ?string $deviceName
|
||||
*/
|
||||
#[SpeakeasyMetadata('queryParam:style=form,explode=true,name=X-Plex-Device')]
|
||||
public ?string $deviceName = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ?string $clientVersion
|
||||
*/
|
||||
#[SpeakeasyMetadata('queryParam:style=form,explode=true,name=X-Plex-Version')]
|
||||
public ?string $clientVersion = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ?string $clientPlatform
|
||||
*/
|
||||
#[SpeakeasyMetadata('queryParam:style=form,explode=true,name=X-Plex-Platform')]
|
||||
public ?string $clientPlatform = null;
|
||||
|
||||
/**
|
||||
* @param int $pinID
|
||||
* @param ?string $clientID
|
||||
* @param ?string $clientName
|
||||
* @param ?string $deviceName
|
||||
* @param ?string $clientVersion
|
||||
* @param ?string $clientPlatform
|
||||
*/
|
||||
public function __construct(int $pinID, ?string $clientID = null, ?string $clientName = null, ?string $deviceName = null, ?string $clientVersion = null, ?string $clientPlatform = null)
|
||||
{
|
||||
$this->pinID = $pinID;
|
||||
$this->clientID = $clientID;
|
||||
$this->clientName = $clientName;
|
||||
$this->deviceName = $deviceName;
|
||||
$this->clientVersion = $clientVersion;
|
||||
$this->clientPlatform = $clientPlatform;
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ class GetTokenDetailsUserPlexAccount
|
||||
public bool $mailingListActive;
|
||||
|
||||
/**
|
||||
* Your current mailing list status
|
||||
* Your current mailing list status (active or unsubscribed)
|
||||
*
|
||||
* @var MailingListStatus $mailingListStatus
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
||||
namespace LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
|
||||
/** Your current mailing list status */
|
||||
/** Your current mailing list status (active or unsubscribed) */
|
||||
enum MailingListStatus: string
|
||||
{
|
||||
case Active = 'active';
|
||||
|
||||
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
||||
namespace LukeHagar\Plex_API\Models\Operations;
|
||||
|
||||
|
||||
/** Your current mailing list status */
|
||||
/** Your current mailing list status (active or unsubscribed) */
|
||||
enum PostUsersSignInDataMailingListStatus: string
|
||||
{
|
||||
case Active = 'active';
|
||||
|
||||
@@ -190,7 +190,7 @@ class PostUsersSignInDataUserPlexAccount
|
||||
public bool $mailingListActive;
|
||||
|
||||
/**
|
||||
* Your current mailing list status
|
||||
* Your current mailing list status (active or unsubscribed)
|
||||
*
|
||||
* @var PostUsersSignInDataMailingListStatus $mailingListStatus
|
||||
*/
|
||||
|
||||
20
src/Plex.php
20
src/Plex.php
@@ -15,27 +15,27 @@ class Plex
|
||||
{
|
||||
public const GET_COMPANIONS_DATA_SERVERS = [
|
||||
|
||||
'https://plex.tv/api/v2/',
|
||||
'https://plex.tv/api/v2',
|
||||
];
|
||||
public const GET_USER_FRIENDS_SERVERS = [
|
||||
|
||||
'https://plex.tv/api/v2/',
|
||||
'https://plex.tv/api/v2',
|
||||
];
|
||||
public const GET_GEO_DATA_SERVERS = [
|
||||
|
||||
'https://plex.tv/api/v2/',
|
||||
'https://plex.tv/api/v2',
|
||||
];
|
||||
public const GET_SERVER_RESOURCES_SERVERS = [
|
||||
|
||||
'https://plex.tv/api/v2/',
|
||||
'https://plex.tv/api/v2',
|
||||
];
|
||||
public const GET_PIN_SERVERS = [
|
||||
|
||||
'https://plex.tv/api/v2/',
|
||||
'https://plex.tv/api/v2',
|
||||
];
|
||||
public const GET_TOKEN_BY_PIN_ID_SERVERS = [
|
||||
|
||||
'https://plex.tv/api/v2/',
|
||||
'https://plex.tv/api/v2',
|
||||
];
|
||||
private SDKConfiguration $sdkConfiguration;
|
||||
/**
|
||||
@@ -449,18 +449,15 @@ class Plex
|
||||
*
|
||||
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
|
||||
*
|
||||
* @param int $pinID
|
||||
* @param Operations\GetTokenByPinIdRequest $request
|
||||
* @param string $serverURL
|
||||
* @return Operations\GetTokenByPinIdResponse
|
||||
* @throws \LukeHagar\Plex_API\Models\Errors\SDKException
|
||||
*/
|
||||
public function getTokenByPinId(
|
||||
int $pinID,
|
||||
?Operations\GetTokenByPinIdRequest $request,
|
||||
?string $serverURL = null,
|
||||
): Operations\GetTokenByPinIdResponse {
|
||||
$request = new Operations\GetTokenByPinIdRequest(
|
||||
pinID: $pinID,
|
||||
);
|
||||
$baseUrl = Utils\Utils::templateUrl(Plex::GET_TOKEN_BY_PIN_ID_SERVERS[0], [
|
||||
]);
|
||||
if (! empty($serverURL)) {
|
||||
@@ -468,6 +465,7 @@ class Plex
|
||||
}
|
||||
$url = Utils\Utils::generateUrl($baseUrl, '/pins/{pinID}', Operations\GetTokenByPinIdRequest::class, $request, $this->sdkConfiguration->globals);
|
||||
$options = ['http_errors' => false];
|
||||
$options = array_merge_recursive($options, Utils\Utils::getQueryParams(Operations\GetTokenByPinIdRequest::class, $request, $this->sdkConfiguration->globals));
|
||||
$options['headers']['Accept'] = 'application/json';
|
||||
$options['headers']['user-agent'] = $this->sdkConfiguration->userAgent;
|
||||
$httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url);
|
||||
|
||||
@@ -10,7 +10,35 @@ namespace LukeHagar\Plex_API;
|
||||
|
||||
|
||||
|
||||
/** PlexAPI - Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server */
|
||||
/**
|
||||
* PlexAPI - Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
*
|
||||
* # Plex Media Server OpenAPI Specification
|
||||
*
|
||||
* An Open Source OpenAPI Specification for Plex Media Server
|
||||
*
|
||||
* Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||
*
|
||||
* ## Documentation
|
||||
*
|
||||
* [API Documentation](https://plexapi.dev)
|
||||
*
|
||||
* ## SDKs
|
||||
*
|
||||
* The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.
|
||||
*
|
||||
* | Language | Repository | Releases | Other |
|
||||
* | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||
* | Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||
* | JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||
* | Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||
* | Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
|
||||
* | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||
* | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||
* | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||
* | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
*
|
||||
*/
|
||||
class PlexAPI
|
||||
{
|
||||
public const SERVERS = [
|
||||
|
||||
@@ -36,11 +36,11 @@ class SDKConfiguration
|
||||
|
||||
public string $openapiDocVersion = '0.0.3';
|
||||
|
||||
public string $sdkVersion = '0.10.0';
|
||||
public string $sdkVersion = '0.10.1';
|
||||
|
||||
public string $genVersion = '2.422.22';
|
||||
public string $genVersion = '2.426.2';
|
||||
|
||||
public string $userAgent = 'speakeasy-sdk/php 0.10.0 2.422.22 0.0.3 lukehagar/plex-api';
|
||||
public string $userAgent = 'speakeasy-sdk/php 0.10.1 2.426.2 0.0.3 lukehagar/plex-api';
|
||||
/** @var array<string, array<string, array<string, mixed>>> */
|
||||
public ?array $globals = [
|
||||
'parameters' => [],
|
||||
|
||||
Reference in New Issue
Block a user