mirror of
https://github.com/LukeHagar/plexphp.git
synced 2025-12-06 12:37:47 +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
|
lockVersion: 2.0.0
|
||||||
id: 01a51eb2-5d90-4a24-b154-68e491d02c36
|
id: 01a51eb2-5d90-4a24-b154-68e491d02c36
|
||||||
management:
|
management:
|
||||||
docChecksum: 5e039359563b41bbe118fc6701ba22dc
|
docChecksum: e7673f3f46e5b0bf495c378378aa7ad6
|
||||||
docVersion: 0.0.3
|
docVersion: 0.0.3
|
||||||
speakeasyVersion: 1.402.14
|
speakeasyVersion: 1.404.5
|
||||||
generationVersion: 2.422.22
|
generationVersion: 2.426.2
|
||||||
releaseVersion: 0.10.0
|
releaseVersion: 0.10.1
|
||||||
configChecksum: 2922b9b3b78b0220103ba0c17b1ed6fa
|
configChecksum: 91b2dd16663efb6b9ea6649cf44a1618
|
||||||
repoURL: https://github.com/LukeHagar/plexphp.git
|
repoURL: https://github.com/LukeHagar/plexphp.git
|
||||||
repoSubDirectory: .
|
repoSubDirectory: .
|
||||||
installationURL: https://github.com/LukeHagar/plexphp
|
installationURL: https://github.com/LukeHagar/plexphp
|
||||||
published: true
|
published: true
|
||||||
features:
|
features:
|
||||||
php:
|
php:
|
||||||
core: 3.4.5
|
core: 3.4.8
|
||||||
deprecations: 2.81.1
|
deprecations: 2.81.1
|
||||||
enums: 2.81.1
|
enums: 2.81.1
|
||||||
errors: 0.1.2
|
errors: 0.1.3
|
||||||
flattening: 2.81.1
|
flattening: 2.81.1
|
||||||
globalSecurity: 2.81.7
|
globalSecurity: 2.81.7
|
||||||
globalSecurityFlattening: 0.1.1
|
globalSecurityFlattening: 0.1.1
|
||||||
@@ -2100,7 +2100,12 @@ examples:
|
|||||||
parameters:
|
parameters:
|
||||||
path:
|
path:
|
||||||
pinID: 408895
|
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:
|
responses:
|
||||||
"404":
|
"404":
|
||||||
application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]}
|
application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]}
|
||||||
@@ -2528,7 +2533,7 @@ examples:
|
|||||||
speakeasy-default-get-token-details:
|
speakeasy-default-get-token-details:
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"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":
|
"400":
|
||||||
application/json: {"errors": []}
|
application/json: {"errors": []}
|
||||||
"401":
|
"401":
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ generation:
|
|||||||
auth:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: false
|
oAuth2ClientCredentialsEnabled: false
|
||||||
php:
|
php:
|
||||||
version: 0.10.0
|
version: 0.10.1
|
||||||
clientServerStatusCodesAsErrors: true
|
clientServerStatusCodesAsErrors: true
|
||||||
flattenGlobalSecurity: true
|
flattenGlobalSecurity: true
|
||||||
imports:
|
imports:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.402.14
|
speakeasyVersion: 1.404.5
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
my-source:
|
||||||
sourceNamespace: my-source
|
sourceNamespace: my-source
|
||||||
@@ -9,8 +9,8 @@ sources:
|
|||||||
- main
|
- main
|
||||||
plexapi:
|
plexapi:
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e
|
sourceRevisionDigest: sha256:276a31ab98595ebaf2b1fac4b4f5c3c1c7b55e0431f9074c89b8fbcb55b52d3f
|
||||||
sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e
|
sourceBlobDigest: sha256:2bc9e816db669d609d8a5988ebb629578dc5cbbaff191d260b5c63b7ba1bd59b
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- main
|
- main
|
||||||
@@ -18,10 +18,10 @@ targets:
|
|||||||
plexphp:
|
plexphp:
|
||||||
source: plexapi
|
source: plexapi
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e
|
sourceRevisionDigest: sha256:276a31ab98595ebaf2b1fac4b4f5c3c1c7b55e0431f9074c89b8fbcb55b52d3f
|
||||||
sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e
|
sourceBlobDigest: sha256:2bc9e816db669d609d8a5988ebb629578dc5cbbaff191d260b5c63b7ba1bd59b
|
||||||
codeSamplesNamespace: code-samples-php-plexphp
|
codeSamplesNamespace: code-samples-php-plexphp
|
||||||
codeSamplesRevisionDigest: sha256:79772c55deda5b6a51423f1e52bde30280ceb6babc20a243a4905190cee8f142
|
codeSamplesRevisionDigest: sha256:f8eef34098947cc9ec73bca8291a4c763d6d133347f98550a6aadde00bef8231
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
|
|||||||
173
README.md
173
README.md
@@ -11,6 +11,31 @@
|
|||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
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] -->
|
<!-- End Summary [summary] -->
|
||||||
|
|
||||||
<!-- Start Table of Contents [toc] -->
|
<!-- 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)
|
* [SDK Example Usage](#sdk-example-usage)
|
||||||
* [Available Resources and Operations](#available-resources-and-operations)
|
* [Available Resources and Operations](#available-resources-and-operations)
|
||||||
* [Global Parameters](#global-parameters)
|
* [Global Parameters](#global-parameters)
|
||||||
|
* [Error Handling](#error-handling)
|
||||||
* [Server Selection](#server-selection)
|
* [Server Selection](#server-selection)
|
||||||
<!-- End Table of Contents [toc] -->
|
<!-- End Table of Contents [toc] -->
|
||||||
|
|
||||||
@@ -45,11 +71,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -59,14 +82,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getServerCapabilities();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getServerCapabilities(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
<!-- End SDK Example Usage [usage] -->
|
<!-- End SDK Example Usage [usage] -->
|
||||||
@@ -77,19 +100,19 @@ try {
|
|||||||
<details open>
|
<details open>
|
||||||
<summary>Available methods</summary>
|
<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
|
* [getServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
|
||||||
* [cancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) - Cancel 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
|
* [getTransientToken](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token
|
||||||
* [getSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
* [getSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
||||||
* [getTokenDetails](docs/sdks/authentication/README.md#gettokendetails) - Get Token Details
|
* [getTokenDetails](docs/sdks/authentication/README.md#gettokendetails) - Get Token Details
|
||||||
* [postUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) - Get User Sign In Data
|
* [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
|
* [getButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks
|
||||||
* [startAllTasks](docs/sdks/butler/README.md#startalltasks) - Start all 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
|
* [startTask](docs/sdks/butler/README.md#starttask) - Start a single Butler task
|
||||||
* [stopTask](docs/sdks/butler/README.md#stoptask) - Stop 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
|
* [getGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs
|
||||||
* [getRecentlyAdded](docs/sdks/hubs/README.md#getrecentlyadded) - Get Recently Added
|
* [getRecentlyAdded](docs/sdks/hubs/README.md#getrecentlyadded) - Get Recently Added
|
||||||
* [getLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs
|
* [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
|
* [getFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value
|
||||||
* [getRecentlyAddedLibrary](docs/sdks/library/README.md#getrecentlyaddedlibrary) - Get Recently Added
|
* [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
|
* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
|
||||||
* [getOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
|
* [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.
|
* [logLine](docs/sdks/log/README.md#logline) - Logging a single line message.
|
||||||
* [logMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
* [logMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
||||||
* [enablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
|
* [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
|
* [markPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played
|
||||||
* [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
|
* [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
|
* [getBannerImage](docs/sdks/media/README.md#getbannerimage) - Get Banner Image
|
||||||
* [getThumbImage](docs/sdks/media/README.md#getthumbimage) - Get Thumb 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
|
* [createPlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
|
||||||
* [getPlaylists](docs/sdks/playlists/README.md#getplaylists) - Get All Playlists
|
* [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
|
* [addPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist
|
||||||
* [uploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload 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
|
* [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
|
* [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
|
* [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
|
* [performSearch](docs/sdks/search/README.md#performsearch) - Perform a search
|
||||||
* [performVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search
|
* [performVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search
|
||||||
* [getSearchResults](docs/sdks/search/README.md#getsearchresults) - Get Search Results
|
* [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
|
* [getServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Get Server Capabilities
|
||||||
* [getServerPreferences](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences
|
* [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
|
* [getMediaProviders](docs/sdks/server/README.md#getmediaproviders) - Get Media Providers
|
||||||
* [getServerList](docs/sdks/server/README.md#getserverlist) - Get Server List
|
* [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
|
* [getSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions
|
||||||
* [getSessionHistory](docs/sdks/sessions/README.md#getsessionhistory) - Get Session History
|
* [getSessionHistory](docs/sdks/sessions/README.md#getsessionhistory) - Get Session History
|
||||||
* [getTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions
|
* [getTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions
|
||||||
* [stopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session
|
* [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
|
* [getStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics
|
||||||
* [getResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics
|
* [getResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics
|
||||||
* [getBandwidthStatistics](docs/sdks/statistics/README.md#getbandwidthstatistics) - Get Bandwidth 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
|
* [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
|
||||||
* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
||||||
* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply 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
|
* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
|
||||||
* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
|
* [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
|
* [getWatchList](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist
|
||||||
|
|
||||||
@@ -246,19 +269,80 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetPinRequest();
|
||||||
$request = new Operations\GetPinRequest();
|
|
||||||
$response = $sdk->plex->getPin($request);
|
|
||||||
|
|
||||||
if ($response->authPinContainer !== null) {
|
$response = $sdk->plex->getPin(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->authPinContainer !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
<!-- End Global Parameters [global-parameters] -->
|
<!-- 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] -->
|
<!-- Start Server Selection [server] -->
|
||||||
## Server Selection
|
## Server Selection
|
||||||
|
|
||||||
@@ -295,11 +379,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -309,14 +390,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->plex->getCompanionsData("https://plex.tv/api/v2/");
|
|
||||||
|
|
||||||
if ($response->responseBodies !== null) {
|
|
||||||
// handle response
|
$response = $sdk->plex->getCompanionsData(
|
||||||
}
|
"https://plex.tv/api/v2"
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->responseBodies !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
<!-- End Server Selection [server] -->
|
<!-- End Server Selection [server] -->
|
||||||
|
|||||||
12
RELEASES.md
12
RELEASES.md
@@ -632,4 +632,14 @@ Based on:
|
|||||||
### Generated
|
### Generated
|
||||||
- [php v0.10.0] .
|
- [php v0.10.0] .
|
||||||
### Releases
|
### 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';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -19,14 +16,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getServerCapabilities();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getServerCapabilities(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
<!-- End SDK Example Usage [usage] -->
|
<!-- 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"
|
"phpdocumentor/type-resolver": "^1.8"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"laravel/pint": "^1.15",
|
"laravel/pint": "^1.18.1",
|
||||||
"phpstan/phpstan": "^1.9",
|
"phpstan/phpstan": "^1.9",
|
||||||
"phpunit/phpunit": "^10",
|
"phpunit/phpunit": "^10",
|
||||||
"rector/rector": "^0.18.13",
|
"rector/rector": "^0.18.13",
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||||
| `protocol` | [Operations\Protocol](../../Models/Operations/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) |
|
| `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 |
|
| `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 |
|
| `port` | *int* | :heavy_check_mark: | The port used for the connection | |
|
||||||
| `uri` | *string* | :heavy_check_mark: | The full URI of the connection |
|
| `uri` | *string* | :heavy_check_mark: | The full URI of the connection | |
|
||||||
| `local` | *bool* | :heavy_check_mark: | If the connection is local address |
|
| `local` | *bool* | :heavy_check_mark: | If the connection is local address | |
|
||||||
| `relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct |
|
| `relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct | |
|
||||||
| `iPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 |
|
| `iPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 | |
|
||||||
@@ -3,6 +3,11 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `pinID` | *int* | :heavy_check_mark: | The PinID to retrieve an access token for |
|
| `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 |
|
| `id` | *int* | :heavy_check_mark: | The Plex account ID | 13692262 |
|
||||||
| `joinedAt` | *int* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
| `joinedAt` | *int* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
| `mailingListActive` | *bool* | :heavy_check_mark: | If you are subscribed to the Plex newsletter | |
|
| `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 |
|
| `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 | |
|
| `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 | |
|
| `protected` | *bool* | :heavy_check_mark: | If the account has a Plex Home PIN enabled | |
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# MailingListStatus
|
# MailingListStatus
|
||||||
|
|
||||||
Your current mailing list status
|
Your current mailing list status (active or unsubscribed)
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# PostUsersSignInDataMailingListStatus
|
# PostUsersSignInDataMailingListStatus
|
||||||
|
|
||||||
Your current mailing list status
|
Your current mailing list status (active or unsubscribed)
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## 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 |
|
| `id` | *int* | :heavy_check_mark: | The Plex account ID | 13692262 |
|
||||||
| `joinedAt` | *int* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
| `joinedAt` | *int* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
| `mailingListActive` | *bool* | :heavy_check_mark: | If you are subscribed to the Plex newsletter | |
|
| `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 |
|
| `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 | |
|
| `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 | |
|
| `protected` | *bool* | :heavy_check_mark: | If the account has a Plex Home PIN enabled | |
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Activities
|
# Activities
|
||||||
|
(*activities*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -28,11 +29,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -42,14 +40,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->activities->getServerActivities();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->activities->getServerActivities(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -78,11 +76,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -92,15 +87,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->activities->cancelServerActivities('25b71ed5-0f9d-461c-baa7-d404e9e10d3e');
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->activities->cancelServerActivities(
|
||||||
// handle response
|
activityUUID: '25b71ed5-0f9d-461c-baa7-d404e9e10d3e'
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Authentication
|
# Authentication
|
||||||
|
(*authentication*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -25,12 +26,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -40,15 +38,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->authentication->getTransientToken(Operations\GetTransientTokenQueryParamType::Delegation, Operations\Scope::All);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->authentication->getTransientToken(
|
||||||
// handle response
|
type: Operations\GetTransientTokenQueryParamType::Delegation,
|
||||||
}
|
scope: Operations\Scope::All
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -86,11 +85,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -100,15 +96,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->authentication->getSourceConnectionInformation('server://client-identifier');
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->authentication->getSourceConnectionInformation(
|
||||||
// handle response
|
source: 'server://client-identifier'
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -143,11 +138,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -157,14 +149,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->authentication->getTokenDetails();
|
|
||||||
|
|
||||||
if ($response->userPlexAccount !== null) {
|
|
||||||
// handle response
|
$response = $sdk->authentication->getTokenDetails(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->userPlexAccount !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -209,21 +201,20 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\PostUsersSignInDataRequest(
|
||||||
$request = new Operations\PostUsersSignInDataRequest(
|
requestBody: new Operations\PostUsersSignInDataRequestBody(
|
||||||
requestBody: new Operations\PostUsersSignInDataRequestBody(
|
login: 'username@email.com',
|
||||||
login: 'username@email.com',
|
password: 'password123',
|
||||||
password: 'password123',
|
verificationCode: '123456',
|
||||||
verificationCode: '123456',
|
),
|
||||||
),
|
);
|
||||||
);
|
|
||||||
$response = $sdk->authentication->postUsersSignInData($request);
|
|
||||||
|
|
||||||
if ($response->userPlexAccount !== null) {
|
$response = $sdk->authentication->postUsersSignInData(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->userPlexAccount !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Butler
|
# Butler
|
||||||
|
(*butler*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -25,11 +26,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -39,14 +37,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->butler->getButlerTasks();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->butler->getButlerTasks(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -80,11 +78,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -94,14 +89,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->butler->startAllTasks();
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
|
||||||
// handle response
|
$response = $sdk->butler->startAllTasks(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -131,11 +126,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -145,14 +137,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->butler->stopAllTasks();
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
|
||||||
// handle response
|
$response = $sdk->butler->stopAllTasks(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -186,12 +178,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -201,15 +190,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->butler->startTask(Operations\TaskName::CleanOldBundles);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->butler->startTask(
|
||||||
// handle response
|
taskName: Operations\TaskName::CleanOldBundles
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -245,12 +233,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -260,15 +245,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->butler->stopTask(Operations\PathParamTaskName::BackupDatabase);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->butler->stopTask(
|
||||||
// handle response
|
taskName: Operations\PathParamTaskName::BackupDatabase
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Hubs
|
# Hubs
|
||||||
|
(*hubs*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -23,12 +24,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -38,15 +36,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->hubs->getGlobalHubs(1262.49, Operations\OnlyTransient::One);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->hubs->getGlobalHubs(
|
||||||
// handle response
|
count: 1262.49,
|
||||||
}
|
onlyTransient: Operations\OnlyTransient::One
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -83,12 +82,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -98,22 +94,21 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetRecentlyAddedRequest(
|
||||||
$request = new Operations\GetRecentlyAddedRequest(
|
contentDirectoryID: 470161,
|
||||||
contentDirectoryID: 470161,
|
type: Operations\Type::TvShow,
|
||||||
type: Operations\Type::TvShow,
|
sectionID: 2,
|
||||||
sectionID: 2,
|
includeMeta: Operations\IncludeMeta::Enable,
|
||||||
includeMeta: Operations\IncludeMeta::Enable,
|
xPlexContainerStart: 0,
|
||||||
xPlexContainerStart: 0,
|
xPlexContainerSize: 50,
|
||||||
xPlexContainerSize: 50,
|
);
|
||||||
);
|
|
||||||
$response = $sdk->hubs->getRecentlyAdded($request);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->hubs->getRecentlyAdded(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -147,12 +142,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -162,15 +154,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->hubs->getLibraryHubs(6728.76, 639.24, Operations\QueryParamOnlyTransient::One);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->hubs->getLibraryHubs(
|
||||||
// handle response
|
sectionId: 6728.76,
|
||||||
}
|
count: 639.24,
|
||||||
} catch (Throwable $e) {
|
onlyTransient: Operations\QueryParamOnlyTransient::One
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Library
|
# Library
|
||||||
|
(*library*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -32,11 +33,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -46,15 +44,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->library->getFileHash('file://C:\Image.png&type=13', 4462.17);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->library->getFileHash(
|
||||||
// handle response
|
url: 'file://C:\Image.png&type=13',
|
||||||
}
|
type: 4462.17
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -91,12 +90,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -106,36 +102,35 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetRecentlyAddedLibraryRequest(
|
||||||
$request = new Operations\GetRecentlyAddedLibraryRequest(
|
type: Operations\QueryParamType::TvShow,
|
||||||
type: Operations\QueryParamType::TvShow,
|
contentDirectoryID: 2,
|
||||||
contentDirectoryID: 2,
|
pinnedContentDirectoryID: [
|
||||||
pinnedContentDirectoryID: [
|
3,
|
||||||
3,
|
5,
|
||||||
5,
|
7,
|
||||||
7,
|
13,
|
||||||
13,
|
12,
|
||||||
12,
|
1,
|
||||||
1,
|
6,
|
||||||
6,
|
14,
|
||||||
14,
|
2,
|
||||||
2,
|
10,
|
||||||
10,
|
16,
|
||||||
16,
|
17,
|
||||||
17,
|
],
|
||||||
],
|
sectionID: 2,
|
||||||
sectionID: 2,
|
includeMeta: Operations\QueryParamIncludeMeta::Enable,
|
||||||
includeMeta: Operations\QueryParamIncludeMeta::Enable,
|
xPlexContainerStart: 0,
|
||||||
xPlexContainerStart: 0,
|
xPlexContainerSize: 50,
|
||||||
xPlexContainerSize: 50,
|
);
|
||||||
);
|
|
||||||
$response = $sdk->library->getRecentlyAddedLibrary($request);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->library->getRecentlyAddedLibrary(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -176,11 +171,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -190,14 +182,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->library->getAllLibraries();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->library->getAllLibraries(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -265,12 +257,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -280,15 +269,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->library->getLibraryDetails(9518, Operations\IncludeDetails::Zero);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->library->getLibraryDetails(
|
||||||
// handle response
|
sectionKey: 9518,
|
||||||
}
|
includeDetails: Operations\IncludeDetails::Zero
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -324,11 +314,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -338,15 +325,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->library->deleteLibrary(9518);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->library->deleteLibrary(
|
||||||
// handle response
|
sectionKey: 9518
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -401,12 +387,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -416,23 +399,22 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetLibraryItemsRequest(
|
||||||
$request = new Operations\GetLibraryItemsRequest(
|
sectionKey: 9518,
|
||||||
sectionKey: 9518,
|
tag: Operations\Tag::Edition,
|
||||||
tag: Operations\Tag::Edition,
|
includeGuids: Operations\IncludeGuids::Enable,
|
||||||
includeGuids: Operations\IncludeGuids::Enable,
|
type: Operations\GetLibraryItemsQueryParamType::TvShow,
|
||||||
type: Operations\GetLibraryItemsQueryParamType::TvShow,
|
includeMeta: Operations\GetLibraryItemsQueryParamIncludeMeta::Enable,
|
||||||
includeMeta: Operations\GetLibraryItemsQueryParamIncludeMeta::Enable,
|
xPlexContainerStart: 0,
|
||||||
xPlexContainerStart: 0,
|
xPlexContainerSize: 50,
|
||||||
xPlexContainerSize: 50,
|
);
|
||||||
);
|
|
||||||
$response = $sdk->library->getLibraryItems($request);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->library->getLibraryItems(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -468,12 +450,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -483,15 +462,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->library->getRefreshLibraryMetadata(9518, Operations\Force::One);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->library->getRefreshLibraryMetadata(
|
||||||
// handle response
|
sectionKey: 9518,
|
||||||
}
|
force: Operations\Force::One
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -545,12 +525,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -560,15 +537,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->library->getSearchLibrary(9518, Operations\GetSearchLibraryQueryParamType::TvShow);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->library->getSearchLibrary(
|
||||||
// handle response
|
sectionKey: 9518,
|
||||||
}
|
type: Operations\GetSearchLibraryQueryParamType::TvShow
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -605,11 +583,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -619,15 +594,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->library->getMetaDataByRatingKey(9518);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->library->getMetaDataByRatingKey(
|
||||||
// handle response
|
ratingKey: 9518
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -663,11 +637,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -677,15 +648,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->library->getMetadataChildren(1539.15, '<value>');
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->library->getMetadataChildren(
|
||||||
// handle response
|
ratingKey: 1539.15,
|
||||||
}
|
includeElements: '<value>'
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -722,12 +694,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -737,15 +706,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->library->getTopWatchedContent(Operations\GetTopWatchedContentQueryParamType::TvShow, 1);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->library->getTopWatchedContent(
|
||||||
// handle response
|
type: Operations\GetTopWatchedContentQueryParamType::TvShow,
|
||||||
}
|
includeGuids: 1
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -782,11 +752,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -796,14 +763,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->library->getOnDeck();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->library->getOnDeck(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Log
|
# Log
|
||||||
|
(*log*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -24,12 +25,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -39,15 +37,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->log->logLine(Operations\Level::Three, 'Test log message', 'Postman');
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->log->logLine(
|
||||||
// handle response
|
level: Operations\Level::Three,
|
||||||
}
|
message: 'Test log message',
|
||||||
} catch (Throwable $e) {
|
source: 'Postman'
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -105,11 +105,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -119,17 +116,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = 'level=4&message=Test%20message%201&source=postman
|
||||||
$request = 'level=4&message=Test%20message%201&source=postman
|
level=3&message=Test%20message%202&source=postman
|
||||||
level=3&message=Test%20message%202&source=postman
|
level=1&message=Test%20message%203&source=postman';
|
||||||
level=1&message=Test%20message%203&source=postman';
|
|
||||||
$response = $sdk->log->logMultiLine($request);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->log->logMultiLine(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -165,11 +161,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -179,14 +172,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->log->enablePaperTrail();
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
|
||||||
// handle response
|
$response = $sdk->log->enablePaperTrail(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Media
|
# Media
|
||||||
|
(*media*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -25,11 +26,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -39,15 +37,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->media->markPlayed(59398);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->media->markPlayed(
|
||||||
// handle response
|
key: 59398
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -82,11 +79,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -96,15 +90,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->media->markUnplayed(59398);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->media->markUnplayed(
|
||||||
// handle response
|
key: 59398
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -140,11 +133,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -154,15 +144,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->media->updatePlayProgress('<key>', 90000, 'played');
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->media->updatePlayProgress(
|
||||||
// handle response
|
key: '<key>',
|
||||||
}
|
time: 90000,
|
||||||
} catch (Throwable $e) {
|
state: 'played'
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -199,12 +191,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -214,22 +203,21 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetBannerImageRequest(
|
||||||
$request = new Operations\GetBannerImageRequest(
|
ratingKey: 9518,
|
||||||
ratingKey: 9518,
|
width: 396,
|
||||||
width: 396,
|
height: 396,
|
||||||
height: 396,
|
minSize: 1,
|
||||||
minSize: 1,
|
upscale: 1,
|
||||||
upscale: 1,
|
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
);
|
||||||
);
|
|
||||||
$response = $sdk->media->getBannerImage($request);
|
|
||||||
|
|
||||||
if ($response->bytes !== null) {
|
$response = $sdk->media->getBannerImage(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->bytes !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -264,12 +252,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -279,22 +264,21 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetThumbImageRequest(
|
||||||
$request = new Operations\GetThumbImageRequest(
|
ratingKey: 9518,
|
||||||
ratingKey: 9518,
|
width: 396,
|
||||||
width: 396,
|
height: 396,
|
||||||
height: 396,
|
minSize: 1,
|
||||||
minSize: 1,
|
upscale: 1,
|
||||||
upscale: 1,
|
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
);
|
||||||
);
|
|
||||||
$response = $sdk->media->getThumbImage($request);
|
|
||||||
|
|
||||||
if ($response->bytes !== null) {
|
$response = $sdk->media->getThumbImage(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->bytes !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Playlists
|
# Playlists
|
||||||
|
(*playlists*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -35,12 +36,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -50,20 +48,19 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\CreatePlaylistRequest(
|
||||||
$request = new Operations\CreatePlaylistRequest(
|
title: '<value>',
|
||||||
title: '<value>',
|
type: Operations\CreatePlaylistQueryParamType::Photo,
|
||||||
type: Operations\CreatePlaylistQueryParamType::Photo,
|
smart: Operations\Smart::One,
|
||||||
smart: Operations\Smart::One,
|
uri: 'https://hoarse-testing.info/',
|
||||||
uri: 'https://hoarse-testing.info/',
|
);
|
||||||
);
|
|
||||||
$response = $sdk->playlists->createPlaylist($request);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->playlists->createPlaylist(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -98,12 +95,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -113,15 +107,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->playlists->getPlaylists(Operations\PlaylistType::Audio, Operations\QueryParamSmart::Zero);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->playlists->getPlaylists(
|
||||||
// handle response
|
playlistType: Operations\PlaylistType::Audio,
|
||||||
}
|
smart: Operations\QueryParamSmart::Zero
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -159,11 +154,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -173,15 +165,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->playlists->getPlaylist(4109.48);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->playlists->getPlaylist(
|
||||||
// handle response
|
playlistID: 4109.48
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -217,11 +208,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -231,15 +219,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->playlists->deletePlaylist(216.22);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->playlists->deletePlaylist(
|
||||||
// handle response
|
playlistID: 216.22
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -275,11 +262,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -289,15 +273,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->playlists->updatePlaylist(3915.00, '<value>', '<value>');
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->playlists->updatePlaylist(
|
||||||
// handle response
|
playlistID: 3915.00,
|
||||||
}
|
title: '<value>',
|
||||||
} catch (Throwable $e) {
|
summary: '<value>'
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -338,12 +324,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -353,15 +336,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->playlists->getPlaylistContents(5004.46, Operations\GetPlaylistContentsQueryParamType::TvShow);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->playlists->getPlaylistContents(
|
||||||
// handle response
|
playlistID: 5004.46,
|
||||||
}
|
type: Operations\GetPlaylistContentsQueryParamType::TvShow
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -398,11 +382,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -412,15 +393,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->playlists->clearPlaylistContents(1893.18);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->playlists->clearPlaylistContents(
|
||||||
// handle response
|
playlistID: 1893.18
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -457,11 +437,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -471,15 +448,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->playlists->addPlaylistContents(8502.00, 'server://12345/com.plexapp.plugins.library/library/metadata/1', 123);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->playlists->addPlaylistContents(
|
||||||
// handle response
|
playlistID: 8502.00,
|
||||||
}
|
uri: 'server://12345/com.plexapp.plugins.library/library/metadata/1',
|
||||||
} catch (Throwable $e) {
|
playQueueID: 123
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -517,12 +496,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -532,15 +508,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->playlists->uploadPlaylist('/home/barkley/playlist.m3u', Operations\QueryParamForce::Zero, 1);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->playlists->uploadPlaylist(
|
||||||
// handle response
|
path: '/home/barkley/playlist.m3u',
|
||||||
}
|
force: Operations\QueryParamForce::Zero,
|
||||||
} catch (Throwable $e) {
|
sectionID: 1
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Plex
|
# Plex
|
||||||
|
(*plex*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -27,11 +28,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -41,14 +39,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->plex->getCompanionsData();
|
|
||||||
|
|
||||||
if ($response->responseBodies !== null) {
|
|
||||||
// handle response
|
$response = $sdk->plex->getCompanionsData(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->responseBodies !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -83,11 +81,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -97,14 +92,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->plex->getUserFriends();
|
|
||||||
|
|
||||||
if ($response->friends !== null) {
|
|
||||||
// handle response
|
$response = $sdk->plex->getUserFriends(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->friends !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -148,14 +143,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->plex->getGeoData();
|
|
||||||
|
|
||||||
if ($response->geoData !== null) {
|
|
||||||
// handle response
|
$response = $sdk->plex->getGeoData(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->geoData !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -190,11 +185,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -204,14 +196,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->plex->getHomeData();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->plex->getHomeData(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -240,12 +232,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -255,15 +244,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->plex->getServerResources(Operations\IncludeHttps::Enable, Operations\IncludeRelay::Enable, Operations\IncludeIPv6::Enable);
|
|
||||||
|
|
||||||
if ($response->plexDevices !== null) {
|
$response = $sdk->plex->getServerResources(
|
||||||
// handle response
|
includeHttps: Operations\IncludeHttps::Enable,
|
||||||
}
|
includeRelay: Operations\IncludeRelay::Enable,
|
||||||
} catch (Throwable $e) {
|
includeIPv6: Operations\IncludeIPv6::Enable
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->plexDevices !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -311,15 +302,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetPinRequest();
|
||||||
$request = new Operations\GetPinRequest();
|
|
||||||
$response = $sdk->plex->getPin($request);
|
|
||||||
|
|
||||||
if ($response->authPinContainer !== null) {
|
$response = $sdk->plex->getPin(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->authPinContainer !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -354,6 +344,7 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -363,24 +354,25 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetTokenByPinIdRequest(
|
||||||
|
pinID: 408895,
|
||||||
|
);
|
||||||
|
|
||||||
$response = $sdk->plex->getTokenByPinId(408895);
|
$response = $sdk->plex->getTokenByPinId(
|
||||||
|
request: $request
|
||||||
|
);
|
||||||
|
|
||||||
if ($response->authPinContainer !== null) {
|
if ($response->authPinContainer !== null) {
|
||||||
// handle response
|
// handle response
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||||
| `pinID` | *int* | :heavy_check_mark: | The PinID to retrieve an access token for |
|
| `$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. |
|
| `$serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
|
|||||||
@@ -2,4 +2,27 @@
|
|||||||
|
|
||||||
## Overview
|
## 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
|
||||||
|
(*search*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -35,11 +36,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -49,15 +47,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->search->performSearch('dylan', 9372.69, 5);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->search->performSearch(
|
||||||
// handle response
|
query: 'dylan',
|
||||||
}
|
sectionId: 9372.69,
|
||||||
} catch (Throwable $e) {
|
limit: 5
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -98,11 +98,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -112,15 +109,17 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->search->performVoiceSearch('dead+poop', 4094.80, 5);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->search->performVoiceSearch(
|
||||||
// handle response
|
query: 'dead+poop',
|
||||||
}
|
sectionId: 4094.80,
|
||||||
} catch (Throwable $e) {
|
limit: 5
|
||||||
// handle exception
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -157,11 +156,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -171,15 +167,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->search->getSearchResults('110');
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->search->getSearchResults(
|
||||||
// handle response
|
query: '110'
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Server
|
# Server
|
||||||
|
(*server*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -29,11 +30,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -43,14 +41,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getServerCapabilities();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getServerCapabilities(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -79,11 +77,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -93,14 +88,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getServerPreferences();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getServerPreferences(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -129,11 +124,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -143,14 +135,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getAvailableClients();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getAvailableClients(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -179,11 +171,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -193,14 +182,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getDevices();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getDevices(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -238,14 +227,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getServerIdentity();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getServerIdentity(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -273,11 +262,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -287,14 +273,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getMyPlexAccount();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getMyPlexAccount(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -324,12 +310,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -339,23 +322,22 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetResizedPhotoRequest(
|
||||||
$request = new Operations\GetResizedPhotoRequest(
|
width: 110,
|
||||||
width: 110,
|
height: 165,
|
||||||
height: 165,
|
opacity: 643869,
|
||||||
opacity: 643869,
|
blur: 0,
|
||||||
blur: 0,
|
minSize: Operations\MinSize::One,
|
||||||
minSize: Operations\MinSize::One,
|
upscale: Operations\Upscale::One,
|
||||||
upscale: Operations\Upscale::One,
|
url: '/library/metadata/49564/thumb/1654258204',
|
||||||
url: '/library/metadata/49564/thumb/1654258204',
|
);
|
||||||
);
|
|
||||||
$response = $sdk->server->getResizedPhoto($request);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->server->getResizedPhoto(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -390,11 +372,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -404,15 +383,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->server->getMediaProviders('CV5xoxjTpFKUzBTShsaf');
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->server->getMediaProviders(
|
||||||
// handle response
|
xPlexToken: 'CV5xoxjTpFKUzBTShsaf'
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -447,11 +425,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -461,14 +436,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->server->getServerList();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->server->getServerList(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Sessions
|
# Sessions
|
||||||
|
(*sessions*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -24,11 +25,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -38,14 +36,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->sessions->getSessions();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->sessions->getSessions(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -74,12 +72,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -89,15 +84,18 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$filter = new Operations\QueryParamFilter();
|
||||||
$filter = new Operations\QueryParamFilter();
|
|
||||||
$response = $sdk->sessions->getSessionHistory('<value>', 1, $filter, 12);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->sessions->getSessionHistory(
|
||||||
// handle response
|
sort: '<value>',
|
||||||
}
|
accountId: 1,
|
||||||
} catch (Throwable $e) {
|
filter: $filter,
|
||||||
// handle exception
|
librarySectionID: 12
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -135,11 +133,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -149,14 +144,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->sessions->getTranscodeSessions();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->sessions->getTranscodeSessions(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -185,11 +180,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -199,15 +191,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->sessions->stopTranscodeSession('zz7llzqlx8w9vnrsbnwhbmep');
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->sessions->stopTranscodeSession(
|
||||||
// handle response
|
sessionKey: 'zz7llzqlx8w9vnrsbnwhbmep'
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Statistics
|
# Statistics
|
||||||
|
(*statistics*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -23,11 +24,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -37,15 +35,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->statistics->getStatistics(4);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->statistics->getStatistics(
|
||||||
// handle response
|
timespan: 4
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -80,11 +77,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -94,15 +88,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->statistics->getResourcesStatistics(4);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->statistics->getResourcesStatistics(
|
||||||
// handle response
|
timespan: 4
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -137,11 +130,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -151,15 +141,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->statistics->getBandwidthStatistics(4);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->statistics->getBandwidthStatistics(
|
||||||
// handle response
|
timespan: 4
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Updater
|
# Updater
|
||||||
|
(*updater*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -24,11 +25,8 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -38,14 +36,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $sdk->updater->getUpdateStatus();
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
|
||||||
// handle response
|
$response = $sdk->updater->getUpdateStatus(
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
);
|
||||||
// handle exception
|
|
||||||
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -74,12 +72,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -89,15 +84,14 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->updater->checkForUpdates(Operations\Download::One);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->updater->checkForUpdates(
|
||||||
// handle response
|
download: Operations\Download::One
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -133,12 +127,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -148,15 +139,16 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$response = $sdk->updater->applyUpdates(Operations\Tonight::One, Operations\Skip::One);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->updater->applyUpdates(
|
||||||
// handle response
|
tonight: Operations\Tonight::One,
|
||||||
}
|
skip: Operations\Skip::One
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
);
|
||||||
|
|
||||||
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Video
|
# Video
|
||||||
|
(*video*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -22,12 +23,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -37,26 +35,25 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetTimelineRequest(
|
||||||
$request = new Operations\GetTimelineRequest(
|
ratingKey: 23409,
|
||||||
ratingKey: 23409,
|
key: '/library/metadata/23409',
|
||||||
key: '/library/metadata/23409',
|
state: Operations\State::Playing,
|
||||||
state: Operations\State::Playing,
|
hasMDE: 1,
|
||||||
hasMDE: 1,
|
time: 2000,
|
||||||
time: 2000,
|
duration: 10000,
|
||||||
duration: 10000,
|
context: 'home:hub.continueWatching',
|
||||||
context: 'home:hub.continueWatching',
|
playQueueItemID: 1,
|
||||||
playQueueItemID: 1,
|
playBackTime: 2000,
|
||||||
playBackTime: 2000,
|
row: 1,
|
||||||
row: 1,
|
);
|
||||||
);
|
|
||||||
$response = $sdk->video->getTimeline($request);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->video->getTimeline(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -91,12 +88,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -106,32 +100,31 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\StartUniversalTranscodeRequest(
|
||||||
$request = new Operations\StartUniversalTranscodeRequest(
|
hasMDE: 1,
|
||||||
hasMDE: 1,
|
path: '/library/metadata/23409',
|
||||||
path: '/library/metadata/23409',
|
mediaIndex: 0,
|
||||||
mediaIndex: 0,
|
partIndex: 0,
|
||||||
partIndex: 0,
|
protocol: 'hls',
|
||||||
protocol: 'hls',
|
fastSeek: 0,
|
||||||
fastSeek: 0,
|
directPlay: 0,
|
||||||
directPlay: 0,
|
directStream: 0,
|
||||||
directStream: 0,
|
subtitleSize: 100,
|
||||||
subtitleSize: 100,
|
subtites: 'burn',
|
||||||
subtites: 'burn',
|
audioBoost: 100,
|
||||||
audioBoost: 100,
|
location: 'lan',
|
||||||
location: 'lan',
|
mediaBufferSize: 102400,
|
||||||
mediaBufferSize: 102400,
|
session: 'zvcage8b7rkioqcm8f4uns4c',
|
||||||
session: 'zvcage8b7rkioqcm8f4uns4c',
|
addDebugOverlay: 0,
|
||||||
addDebugOverlay: 0,
|
autoAdjustQuality: 0,
|
||||||
autoAdjustQuality: 0,
|
);
|
||||||
);
|
|
||||||
$response = $sdk->video->startUniversalTranscode($request);
|
|
||||||
|
|
||||||
if ($response->statusCode === 200) {
|
$response = $sdk->video->startUniversalTranscode(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->statusCode === 200) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Watchlist
|
# Watchlist
|
||||||
|
(*watchlist*)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -21,12 +22,9 @@ declare(strict_types=1);
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
use LukeHagar\Plex_API;
|
use LukeHagar\Plex_API;
|
||||||
use LukeHagar\Plex_API\Models\Components;
|
|
||||||
use LukeHagar\Plex_API\Models\Operations;
|
use LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
$security = new Components\Security(
|
$security = '<YOUR_API_KEY_HERE>';
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
);
|
|
||||||
|
|
||||||
$sdk = Plex_API\PlexAPI::builder()
|
$sdk = Plex_API\PlexAPI::builder()
|
||||||
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
->setClientID('gcgzw5rz2xovp84b4vha3a40')
|
||||||
@@ -36,20 +34,19 @@ $sdk = Plex_API\PlexAPI::builder()
|
|||||||
->setDeviceName('Linux')
|
->setDeviceName('Linux')
|
||||||
->setSecurity($security)->build();
|
->setSecurity($security)->build();
|
||||||
|
|
||||||
try {
|
$request = new Operations\GetWatchListRequest(
|
||||||
$request = new Operations\GetWatchListRequest(
|
filter: Operations\Filter::Available,
|
||||||
filter: Operations\Filter::Available,
|
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
||||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
|
xPlexContainerStart: 0,
|
||||||
xPlexContainerStart: 0,
|
xPlexContainerSize: 50,
|
||||||
xPlexContainerSize: 50,
|
);
|
||||||
);
|
|
||||||
$response = $sdk->watchlist->getWatchList($request);
|
|
||||||
|
|
||||||
if ($response->object !== null) {
|
$response = $sdk->watchlist->getWatchList(
|
||||||
// handle response
|
request: $request
|
||||||
}
|
);
|
||||||
} catch (Throwable $e) {
|
|
||||||
// handle exception
|
if ($response->object !== null) {
|
||||||
|
// handle response
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ class Authentication
|
|||||||
{
|
{
|
||||||
public const GET_TOKEN_DETAILS_SERVERS = [
|
public const GET_TOKEN_DETAILS_SERVERS = [
|
||||||
|
|
||||||
'https://plex.tv/api/v2/',
|
'https://plex.tv/api/v2',
|
||||||
];
|
];
|
||||||
public const POST_USERS_SIGN_IN_DATA_SERVERS = [
|
public const POST_USERS_SIGN_IN_DATA_SERVERS = [
|
||||||
|
|
||||||
'https://plex.tv/api/v2/',
|
'https://plex.tv/api/v2',
|
||||||
];
|
];
|
||||||
private SDKConfiguration $sdkConfiguration;
|
private SDKConfiguration $sdkConfiguration;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,10 +20,60 @@ class GetTokenByPinIdRequest
|
|||||||
public int $pinID;
|
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->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;
|
public bool $mailingListActive;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Your current mailing list status
|
* Your current mailing list status (active or unsubscribed)
|
||||||
*
|
*
|
||||||
* @var MailingListStatus $mailingListStatus
|
* @var MailingListStatus $mailingListStatus
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
|||||||
namespace LukeHagar\Plex_API\Models\Operations;
|
namespace LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
|
|
||||||
/** Your current mailing list status */
|
/** Your current mailing list status (active or unsubscribed) */
|
||||||
enum MailingListStatus: string
|
enum MailingListStatus: string
|
||||||
{
|
{
|
||||||
case Active = 'active';
|
case Active = 'active';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
|||||||
namespace LukeHagar\Plex_API\Models\Operations;
|
namespace LukeHagar\Plex_API\Models\Operations;
|
||||||
|
|
||||||
|
|
||||||
/** Your current mailing list status */
|
/** Your current mailing list status (active or unsubscribed) */
|
||||||
enum PostUsersSignInDataMailingListStatus: string
|
enum PostUsersSignInDataMailingListStatus: string
|
||||||
{
|
{
|
||||||
case Active = 'active';
|
case Active = 'active';
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ class PostUsersSignInDataUserPlexAccount
|
|||||||
public bool $mailingListActive;
|
public bool $mailingListActive;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Your current mailing list status
|
* Your current mailing list status (active or unsubscribed)
|
||||||
*
|
*
|
||||||
* @var PostUsersSignInDataMailingListStatus $mailingListStatus
|
* @var PostUsersSignInDataMailingListStatus $mailingListStatus
|
||||||
*/
|
*/
|
||||||
|
|||||||
20
src/Plex.php
20
src/Plex.php
@@ -15,27 +15,27 @@ class Plex
|
|||||||
{
|
{
|
||||||
public const GET_COMPANIONS_DATA_SERVERS = [
|
public const GET_COMPANIONS_DATA_SERVERS = [
|
||||||
|
|
||||||
'https://plex.tv/api/v2/',
|
'https://plex.tv/api/v2',
|
||||||
];
|
];
|
||||||
public const GET_USER_FRIENDS_SERVERS = [
|
public const GET_USER_FRIENDS_SERVERS = [
|
||||||
|
|
||||||
'https://plex.tv/api/v2/',
|
'https://plex.tv/api/v2',
|
||||||
];
|
];
|
||||||
public const GET_GEO_DATA_SERVERS = [
|
public const GET_GEO_DATA_SERVERS = [
|
||||||
|
|
||||||
'https://plex.tv/api/v2/',
|
'https://plex.tv/api/v2',
|
||||||
];
|
];
|
||||||
public const GET_SERVER_RESOURCES_SERVERS = [
|
public const GET_SERVER_RESOURCES_SERVERS = [
|
||||||
|
|
||||||
'https://plex.tv/api/v2/',
|
'https://plex.tv/api/v2',
|
||||||
];
|
];
|
||||||
public const GET_PIN_SERVERS = [
|
public const GET_PIN_SERVERS = [
|
||||||
|
|
||||||
'https://plex.tv/api/v2/',
|
'https://plex.tv/api/v2',
|
||||||
];
|
];
|
||||||
public const GET_TOKEN_BY_PIN_ID_SERVERS = [
|
public const GET_TOKEN_BY_PIN_ID_SERVERS = [
|
||||||
|
|
||||||
'https://plex.tv/api/v2/',
|
'https://plex.tv/api/v2',
|
||||||
];
|
];
|
||||||
private SDKConfiguration $sdkConfiguration;
|
private SDKConfiguration $sdkConfiguration;
|
||||||
/**
|
/**
|
||||||
@@ -449,18 +449,15 @@ class Plex
|
|||||||
*
|
*
|
||||||
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
|
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
|
||||||
*
|
*
|
||||||
* @param int $pinID
|
* @param Operations\GetTokenByPinIdRequest $request
|
||||||
* @param string $serverURL
|
* @param string $serverURL
|
||||||
* @return Operations\GetTokenByPinIdResponse
|
* @return Operations\GetTokenByPinIdResponse
|
||||||
* @throws \LukeHagar\Plex_API\Models\Errors\SDKException
|
* @throws \LukeHagar\Plex_API\Models\Errors\SDKException
|
||||||
*/
|
*/
|
||||||
public function getTokenByPinId(
|
public function getTokenByPinId(
|
||||||
int $pinID,
|
?Operations\GetTokenByPinIdRequest $request,
|
||||||
?string $serverURL = null,
|
?string $serverURL = null,
|
||||||
): Operations\GetTokenByPinIdResponse {
|
): Operations\GetTokenByPinIdResponse {
|
||||||
$request = new Operations\GetTokenByPinIdRequest(
|
|
||||||
pinID: $pinID,
|
|
||||||
);
|
|
||||||
$baseUrl = Utils\Utils::templateUrl(Plex::GET_TOKEN_BY_PIN_ID_SERVERS[0], [
|
$baseUrl = Utils\Utils::templateUrl(Plex::GET_TOKEN_BY_PIN_ID_SERVERS[0], [
|
||||||
]);
|
]);
|
||||||
if (! empty($serverURL)) {
|
if (! empty($serverURL)) {
|
||||||
@@ -468,6 +465,7 @@ class Plex
|
|||||||
}
|
}
|
||||||
$url = Utils\Utils::generateUrl($baseUrl, '/pins/{pinID}', Operations\GetTokenByPinIdRequest::class, $request, $this->sdkConfiguration->globals);
|
$url = Utils\Utils::generateUrl($baseUrl, '/pins/{pinID}', Operations\GetTokenByPinIdRequest::class, $request, $this->sdkConfiguration->globals);
|
||||||
$options = ['http_errors' => false];
|
$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']['Accept'] = 'application/json';
|
||||||
$options['headers']['user-agent'] = $this->sdkConfiguration->userAgent;
|
$options['headers']['user-agent'] = $this->sdkConfiguration->userAgent;
|
||||||
$httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url);
|
$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
|
class PlexAPI
|
||||||
{
|
{
|
||||||
public const SERVERS = [
|
public const SERVERS = [
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ class SDKConfiguration
|
|||||||
|
|
||||||
public string $openapiDocVersion = '0.0.3';
|
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>>> */
|
/** @var array<string, array<string, array<string, mixed>>> */
|
||||||
public ?array $globals = [
|
public ?array $globals = [
|
||||||
'parameters' => [],
|
'parameters' => [],
|
||||||
|
|||||||
Reference in New Issue
Block a user