From 673ba1e538d0b539dc5c85231b100652e3ce3630 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 23 Feb 2024 14:46:43 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.193.0 --- .speakeasy/gen.lock | 73 ++++++---- README.md | 20 +-- RELEASES.md | 10 +- USAGE.md | 2 +- composer.json | 25 +++- docs/Models/Operations/Account.md | 15 ++ .../GetServerPreferencesMediaContainer.md | 8 +- docs/Models/Operations/GetStatisticsDevice.md | 12 ++ docs/Models/Operations/GetStatisticsErrors.md | 10 ++ .../Operations/GetStatisticsMediaContainer.md | 11 ++ .../Models/Operations/GetStatisticsRequest.md | 8 ++ .../Operations/GetStatisticsResponse.md | 12 ++ .../Operations/GetStatisticsResponseBody.md | 10 ++ .../GetStatisticsStatisticsResponseBody.md | 10 ++ docs/Models/Operations/Setting.md | 17 +++ docs/Models/Operations/StatisticsMedia.md | 14 ++ docs/sdks/activities/README.md | 6 +- docs/sdks/butler/README.md | 10 +- docs/sdks/hubs/README.md | 4 +- docs/sdks/library/README.md | 22 +-- docs/sdks/log/README.md | 6 +- docs/sdks/media/README.md | 8 +- docs/sdks/playlists/README.md | 22 +-- docs/sdks/plex/README.md | 8 +- docs/sdks/search/README.md | 6 +- docs/sdks/security/README.md | 4 +- docs/sdks/server/README.md | 16 +-- docs/sdks/sessions/README.md | 8 +- docs/sdks/statistics/README.md | 57 ++++++++ docs/sdks/updater/README.md | 6 +- docs/sdks/video/README.md | 130 +++++++++--------- gen.yaml | 3 +- phpstan.neon | 7 + rector.php | 29 ++++ src/Models/Operations/Account.php | 65 +++++++++ .../GetServerPreferencesMediaContainer.php | 4 +- src/Models/Operations/GetStatisticsDevice.php | 47 +++++++ src/Models/Operations/GetStatisticsErrors.php | 35 +++++ .../GetStatisticsMediaContainer.php | 56 ++++++++ .../Operations/GetStatisticsRequest.php | 29 ++++ .../Operations/GetStatisticsResponse.php | 62 +++++++++ .../Operations/GetStatisticsResponseBody.php | 29 ++++ .../GetStatisticsStatisticsResponseBody.php | 34 +++++ src/Models/Operations/Setting.php | 77 +++++++++++ src/Models/Operations/StatisticsMedia.php | 59 ++++++++ src/PlexAPI.php | 33 +++-- src/SDKConfiguration.php | 6 +- src/Statistics.php | 75 ++++++++++ src/Video.php | 86 ++++++------ 49 files changed, 1077 insertions(+), 229 deletions(-) create mode 100644 docs/Models/Operations/Account.md create mode 100644 docs/Models/Operations/GetStatisticsDevice.md create mode 100644 docs/Models/Operations/GetStatisticsErrors.md create mode 100644 docs/Models/Operations/GetStatisticsMediaContainer.md create mode 100644 docs/Models/Operations/GetStatisticsRequest.md create mode 100644 docs/Models/Operations/GetStatisticsResponse.md create mode 100644 docs/Models/Operations/GetStatisticsResponseBody.md create mode 100644 docs/Models/Operations/GetStatisticsStatisticsResponseBody.md create mode 100644 docs/Models/Operations/Setting.md create mode 100644 docs/Models/Operations/StatisticsMedia.md create mode 100644 docs/sdks/statistics/README.md create mode 100644 rector.php create mode 100644 src/Models/Operations/Account.php create mode 100644 src/Models/Operations/GetStatisticsDevice.php create mode 100644 src/Models/Operations/GetStatisticsErrors.php create mode 100644 src/Models/Operations/GetStatisticsMediaContainer.php create mode 100644 src/Models/Operations/GetStatisticsRequest.php create mode 100644 src/Models/Operations/GetStatisticsResponse.php create mode 100644 src/Models/Operations/GetStatisticsResponseBody.php create mode 100644 src/Models/Operations/GetStatisticsStatisticsResponseBody.php create mode 100644 src/Models/Operations/Setting.php create mode 100644 src/Models/Operations/StatisticsMedia.php create mode 100644 src/Statistics.php diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 76290f1..e118c61 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,18 +1,18 @@ lockVersion: 2.0.0 id: 01a51eb2-5d90-4a24-b154-68e491d02c36 management: - docChecksum: 099fc5bbb987ae7e391f7f07b4212860 + docChecksum: 278d186496d83d5830ba4870f8cad39d docVersion: 0.0.3 speakeasyVersion: internal - generationVersion: 2.249.1 - releaseVersion: 0.3.0 - configChecksum: 73678e6800bc86c17da7081b9d5a1b97 + generationVersion: 2.269.0 + releaseVersion: 0.3.1 + configChecksum: 114512b0b3bdc6ff6cb307b1ac592df2 repoURL: https://github.com/LukeHagar/plexphp.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexphp features: php: - core: 3.3.0 + core: 3.3.2 flattening: 2.81.1 globalSecurity: 2.81.3 globalServerURLs: 2.82.1 @@ -22,6 +22,7 @@ generatedFiles: - src/SDKConfiguration.php - src/Server.php - src/Media.php + - src/Video.php - src/Activities.php - src/Butler.php - src/Hubs.php @@ -31,14 +32,15 @@ generatedFiles: - src/Plex.php - src/Playlists.php - src/Security.php + - src/Statistics.php - src/Sessions.php - src/Updater.php - - src/Video.php - src/PlexAPI.php - src/ServerProtocol.php - src/PlexAPIBuilder.php - composer.json - phpstan.neon + - rector.php - src/Utils/EnumHandler.php - src/Utils/FormMetadata.php - src/Utils/Headers.php @@ -63,6 +65,7 @@ generatedFiles: - src/Models/Operations/GetServerCapabilitiesResponse.php - src/Models/Operations/GetServerPreferencesErrors.php - src/Models/Operations/GetServerPreferencesServerResponseBody.php + - src/Models/Operations/Setting.php - src/Models/Operations/GetServerPreferencesMediaContainer.php - src/Models/Operations/GetServerPreferencesResponseBody.php - src/Models/Operations/GetServerPreferencesResponse.php @@ -112,6 +115,15 @@ generatedFiles: - src/Models/Operations/UpdatePlayProgressErrors.php - src/Models/Operations/UpdatePlayProgressResponseBody.php - src/Models/Operations/UpdatePlayProgressResponse.php + - src/Models/Operations/State.php + - src/Models/Operations/GetTimelineRequest.php + - src/Models/Operations/GetTimelineErrors.php + - src/Models/Operations/GetTimelineResponseBody.php + - src/Models/Operations/GetTimelineResponse.php + - src/Models/Operations/StartUniversalTranscodeRequest.php + - src/Models/Operations/StartUniversalTranscodeErrors.php + - src/Models/Operations/StartUniversalTranscodeResponseBody.php + - src/Models/Operations/StartUniversalTranscodeResponse.php - src/Models/Operations/GetServerActivitiesErrors.php - src/Models/Operations/GetServerActivitiesActivitiesResponseBody.php - src/Models/Operations/Context.php @@ -388,6 +400,15 @@ generatedFiles: - src/Models/Operations/GetSourceConnectionInformationErrors.php - src/Models/Operations/GetSourceConnectionInformationResponseBody.php - src/Models/Operations/GetSourceConnectionInformationResponse.php + - src/Models/Operations/GetStatisticsRequest.php + - src/Models/Operations/GetStatisticsErrors.php + - src/Models/Operations/GetStatisticsStatisticsResponseBody.php + - src/Models/Operations/GetStatisticsDevice.php + - src/Models/Operations/Account.php + - src/Models/Operations/StatisticsMedia.php + - src/Models/Operations/GetStatisticsMediaContainer.php + - src/Models/Operations/GetStatisticsResponseBody.php + - src/Models/Operations/GetStatisticsResponse.php - src/Models/Operations/GetSessionsErrors.php - src/Models/Operations/GetSessionsSessionsResponseBody.php - src/Models/Operations/GetSessionsStream.php @@ -433,15 +454,6 @@ generatedFiles: - src/Models/Operations/ApplyUpdatesErrors.php - src/Models/Operations/ApplyUpdatesResponseBody.php - src/Models/Operations/ApplyUpdatesResponse.php - - src/Models/Operations/StartUniversalTranscodeRequest.php - - src/Models/Operations/StartUniversalTranscodeErrors.php - - src/Models/Operations/StartUniversalTranscodeResponseBody.php - - src/Models/Operations/StartUniversalTranscodeResponse.php - - src/Models/Operations/State.php - - src/Models/Operations/GetTimelineRequest.php - - src/Models/Operations/GetTimelineErrors.php - - src/Models/Operations/GetTimelineResponseBody.php - - src/Models/Operations/GetTimelineResponse.php - src/Models/Components/Security.php - docs/Models/Operations/Errors.md - docs/Models/Operations/GetServerCapabilitiesServerResponseBody.md @@ -451,6 +463,7 @@ generatedFiles: - docs/Models/Operations/GetServerCapabilitiesResponse.md - docs/Models/Operations/GetServerPreferencesErrors.md - docs/Models/Operations/GetServerPreferencesServerResponseBody.md + - docs/Models/Operations/Setting.md - docs/Models/Operations/GetServerPreferencesMediaContainer.md - docs/Models/Operations/GetServerPreferencesResponseBody.md - docs/Models/Operations/GetServerPreferencesResponse.md @@ -500,6 +513,15 @@ generatedFiles: - docs/Models/Operations/UpdatePlayProgressErrors.md - docs/Models/Operations/UpdatePlayProgressResponseBody.md - docs/Models/Operations/UpdatePlayProgressResponse.md + - docs/Models/Operations/State.md + - docs/Models/Operations/GetTimelineRequest.md + - docs/Models/Operations/GetTimelineErrors.md + - docs/Models/Operations/GetTimelineResponseBody.md + - docs/Models/Operations/GetTimelineResponse.md + - docs/Models/Operations/StartUniversalTranscodeRequest.md + - docs/Models/Operations/StartUniversalTranscodeErrors.md + - docs/Models/Operations/StartUniversalTranscodeResponseBody.md + - docs/Models/Operations/StartUniversalTranscodeResponse.md - docs/Models/Operations/GetServerActivitiesErrors.md - docs/Models/Operations/GetServerActivitiesActivitiesResponseBody.md - docs/Models/Operations/Context.md @@ -776,6 +798,15 @@ generatedFiles: - docs/Models/Operations/GetSourceConnectionInformationErrors.md - docs/Models/Operations/GetSourceConnectionInformationResponseBody.md - docs/Models/Operations/GetSourceConnectionInformationResponse.md + - docs/Models/Operations/GetStatisticsRequest.md + - docs/Models/Operations/GetStatisticsErrors.md + - docs/Models/Operations/GetStatisticsStatisticsResponseBody.md + - docs/Models/Operations/GetStatisticsDevice.md + - docs/Models/Operations/Account.md + - docs/Models/Operations/StatisticsMedia.md + - docs/Models/Operations/GetStatisticsMediaContainer.md + - docs/Models/Operations/GetStatisticsResponseBody.md + - docs/Models/Operations/GetStatisticsResponse.md - docs/Models/Operations/GetSessionsErrors.md - docs/Models/Operations/GetSessionsSessionsResponseBody.md - docs/Models/Operations/GetSessionsStream.md @@ -821,19 +852,11 @@ generatedFiles: - docs/Models/Operations/ApplyUpdatesErrors.md - docs/Models/Operations/ApplyUpdatesResponseBody.md - docs/Models/Operations/ApplyUpdatesResponse.md - - docs/Models/Operations/StartUniversalTranscodeRequest.md - - docs/Models/Operations/StartUniversalTranscodeErrors.md - - docs/Models/Operations/StartUniversalTranscodeResponseBody.md - - docs/Models/Operations/StartUniversalTranscodeResponse.md - - docs/Models/Operations/State.md - - docs/Models/Operations/GetTimelineRequest.md - - docs/Models/Operations/GetTimelineErrors.md - - docs/Models/Operations/GetTimelineResponseBody.md - - docs/Models/Operations/GetTimelineResponse.md - docs/Models/Components/Security.md - docs/sdks/plexapi/README.md - docs/sdks/server/README.md - docs/sdks/media/README.md + - docs/sdks/video/README.md - docs/sdks/activities/README.md - docs/sdks/butler/README.md - docs/sdks/hubs/README.md @@ -843,8 +866,8 @@ generatedFiles: - docs/sdks/plex/README.md - docs/sdks/playlists/README.md - docs/sdks/security/README.md + - docs/sdks/statistics/README.md - docs/sdks/sessions/README.md - docs/sdks/updater/README.md - - docs/sdks/video/README.md - USAGE.md - .gitattributes diff --git a/README.md b/README.md index af4c1d3..71bab21 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } @@ -89,6 +89,11 @@ try { * [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed * [updatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress +### [Video](docs/sdks/video/README.md) + +* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item +* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode + ### [Activities](docs/sdks/activities/README.md) * [getServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities @@ -155,6 +160,10 @@ try { * [getTransientToken](docs/sdks/security/README.md#gettransienttoken) - Get a Transient Token. * [getSourceConnectionInformation](docs/sdks/security/README.md#getsourceconnectioninformation) - Get Source Connection Information +### [Statistics](docs/sdks/statistics/README.md) + +* [getStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics + ### [Sessions](docs/sdks/sessions/README.md) * [getSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions @@ -167,11 +176,6 @@ try { * [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates * [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates * [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates - -### [Video](docs/sdks/video/README.md) - -* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode -* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item @@ -222,12 +226,12 @@ $sdk = Plex_API\PlexAPI::builder() ->build(); try { - $response = $sdk->plex->getPin('https://plex.tv/api/v2', 'string', false); + $response = $sdk->plex->getPin('https://plex.tv/api/v2', '', false); if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } diff --git a/RELEASES.md b/RELEASES.md index 5b527de..45d2209 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -86,4 +86,12 @@ Based on: - OpenAPI Doc 0.0.3 - Speakeasy CLI 1.166.1 (2.249.1) https://github.com/speakeasy-api/speakeasy ### Generated -- [php v0.3.0] . \ No newline at end of file +- [php v0.3.0] . + +## 2024-02-23 14:46:24 +### Changes +Based on: +- OpenAPI Doc 0.0.3 +- Speakeasy CLI 1.193.0 (2.269.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v0.3.1] . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index ed5fad4..491297f 100644 --- a/USAGE.md +++ b/USAGE.md @@ -21,7 +21,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } diff --git a/composer.json b/composer.json index 53a3612..b78df38 100644 --- a/composer.json +++ b/composer.json @@ -8,12 +8,33 @@ }, "license": "MIT", "require": { - "php": ">=8.1.0", + "php": "^8.1", "guzzlehttp/guzzle": "^7.0", "jms/serializer": "^3.22" }, "require-dev": { "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^10" + "phpunit/phpunit": "^10", + "rector/rector": "^0.18.13", + "roave/security-advisories": "dev-latest" + }, + "minimum-stability": "stable", + "prefer-stable": true, + "config": { + "optimize-autoloader": true, + "classmap-authoritative": true, + "sort-packages": true + }, + "scripts": { + "test": [ + "./vendor/bin/phpunit --testdox" + ], + "stan": [ + "./vendor/bin/phpstan analyse --memory-limit=2g" + ] + }, + "script-descriptions": { + "test": "Run PhpUnit test scripts.", + "stan": "Run PhpStan static analysis." } } diff --git a/docs/Models/Operations/Account.md b/docs/Models/Operations/Account.md new file mode 100644 index 0000000..b9cfaf7 --- /dev/null +++ b/docs/Models/Operations/Account.md @@ -0,0 +1,15 @@ +# Account + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *?int* | :heavy_minus_sign: | N/A | 238960586 | +| `key` | *?string* | :heavy_minus_sign: | N/A | /accounts/238960586 | +| `name` | *?string* | :heavy_minus_sign: | N/A | Diane | +| `defaultAudioLanguage` | *?string* | :heavy_minus_sign: | N/A | en | +| `autoSelectAudio` | *?bool* | :heavy_minus_sign: | N/A | true | +| `defaultSubtitleLanguage` | *?string* | :heavy_minus_sign: | N/A | en | +| `subtitleMode` | *?int* | :heavy_minus_sign: | N/A | 1 | +| `thumb` | *?string* | :heavy_minus_sign: | N/A | https://plex.tv/users/50d83634246da1de/avatar?c=1707110967 | \ No newline at end of file diff --git a/docs/Models/Operations/GetServerPreferencesMediaContainer.md b/docs/Models/Operations/GetServerPreferencesMediaContainer.md index 84c451b..b4c34df 100644 --- a/docs/Models/Operations/GetServerPreferencesMediaContainer.md +++ b/docs/Models/Operations/GetServerPreferencesMediaContainer.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `size` | *?int* | :heavy_minus_sign: | N/A | 161 | -| `setting` | array<*mixed*> | :heavy_minus_sign: | N/A | [{"advanced":false,"default":"","group":"general","hidden":false,"id":"FriendlyName","label":"Friendly name","summary":"This name will be used to identify this media server to other computers on your network. If you leave it blank, your computer's name will be used instead.","type":"text","value":"Hera"},{"advanced":false,"default":3600,"enumValues":"900:every 15 minutes\|1800:every 30 minutes\|3600:hourly\|7200:every 2 hours\|21600:every 6 hours\|43200:every 12 hours\|86400:daily","group":"library","hidden":false,"id":"ScheduledLibraryUpdateInterval","label":"Library scan interval","summary":"","type":"int","value":3600}] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *?int* | :heavy_minus_sign: | N/A | 161 | +| `setting` | array<[\LukeHagar\Plex_API\Models\Operations\Setting](../../Models/Operations/Setting.md)> | :heavy_minus_sign: | N/A | [{"advanced":false,"default":false,"enumValues":"1:admin only\|2:everyone","group":"","hidden":true,"id":"EnableDatabaseTrace","label":"","summary":"","type":"bool","value":false}] | \ No newline at end of file diff --git a/docs/Models/Operations/GetStatisticsDevice.md b/docs/Models/Operations/GetStatisticsDevice.md new file mode 100644 index 0000000..078a131 --- /dev/null +++ b/docs/Models/Operations/GetStatisticsDevice.md @@ -0,0 +1,12 @@ +# GetStatisticsDevice + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `id` | *?int* | :heavy_minus_sign: | N/A | 208 | +| `name` | *?string* | :heavy_minus_sign: | N/A | Roku Express | +| `platform` | *?string* | :heavy_minus_sign: | N/A | Roku | +| `clientIdentifier` | *?string* | :heavy_minus_sign: | N/A | 793095d235660625108ef785cc7646e9 | +| `createdAt` | *?int* | :heavy_minus_sign: | N/A | 1706470556 | \ No newline at end of file diff --git a/docs/Models/Operations/GetStatisticsErrors.md b/docs/Models/Operations/GetStatisticsErrors.md new file mode 100644 index 0000000..dc88e30 --- /dev/null +++ b/docs/Models/Operations/GetStatisticsErrors.md @@ -0,0 +1,10 @@ +# GetStatisticsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *?float* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *?string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *?float* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/Models/Operations/GetStatisticsMediaContainer.md b/docs/Models/Operations/GetStatisticsMediaContainer.md new file mode 100644 index 0000000..9c01b24 --- /dev/null +++ b/docs/Models/Operations/GetStatisticsMediaContainer.md @@ -0,0 +1,11 @@ +# GetStatisticsMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `size` | *?int* | :heavy_minus_sign: | N/A | 5497 | +| `device` | array<[\LukeHagar\Plex_API\Models\Operations\GetStatisticsDevice](../../Models/Operations/GetStatisticsDevice.md)> | :heavy_minus_sign: | N/A | [{"clientIdentifier":"793095d235660625108ef785cc7646e9","createdAt":1706470556,"id":208,"name":"Roku Express","platform":"Roku"}] | +| `account` | array<[\LukeHagar\Plex_API\Models\Operations\Account](../../Models/Operations/Account.md)> | :heavy_minus_sign: | N/A | [{"autoSelectAudio":true,"defaultAudioLanguage":"en","defaultSubtitleLanguage":"en","id":238960586,"key":"/accounts/238960586","name":"Diane","subtitleMode":1,"thumb":"https://plex.tv/users/50d83634246da1de/avatar?c=1707110967"}] | +| `statisticsMedia` | array<[\LukeHagar\Plex_API\Models\Operations\StatisticsMedia](../../Models/Operations/StatisticsMedia.md)> | :heavy_minus_sign: | N/A | [{"accountID":1,"at":1707141600,"count":1,"deviceID":13,"duration":1555,"metadataType":4,"timespan":4}] | \ No newline at end of file diff --git a/docs/Models/Operations/GetStatisticsRequest.md b/docs/Models/Operations/GetStatisticsRequest.md new file mode 100644 index 0000000..546dd95 --- /dev/null +++ b/docs/Models/Operations/GetStatisticsRequest.md @@ -0,0 +1,8 @@ +# GetStatisticsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *?int* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| \ No newline at end of file diff --git a/docs/Models/Operations/GetStatisticsResponse.md b/docs/Models/Operations/GetStatisticsResponse.md new file mode 100644 index 0000000..5259e88 --- /dev/null +++ b/docs/Models/Operations/GetStatisticsResponse.md @@ -0,0 +1,12 @@ +# GetStatisticsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `twoHundredApplicationJsonObject` | [?\LukeHagar\Plex_API\Models\Operations\GetStatisticsResponseBody](../../Models/Operations/GetStatisticsResponseBody.md) | :heavy_minus_sign: | Media Statistics | +| `fourHundredAndOneApplicationJsonObject` | [?\LukeHagar\Plex_API\Models\Operations\GetStatisticsStatisticsResponseBody](../../Models/Operations/GetStatisticsStatisticsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | \ No newline at end of file diff --git a/docs/Models/Operations/GetStatisticsResponseBody.md b/docs/Models/Operations/GetStatisticsResponseBody.md new file mode 100644 index 0000000..a51b842 --- /dev/null +++ b/docs/Models/Operations/GetStatisticsResponseBody.md @@ -0,0 +1,10 @@ +# GetStatisticsResponseBody + +Media Statistics + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `mediaContainer` | [?\LukeHagar\Plex_API\Models\Operations\GetStatisticsMediaContainer](../../Models/Operations/GetStatisticsMediaContainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetStatisticsStatisticsResponseBody.md b/docs/Models/Operations/GetStatisticsStatisticsResponseBody.md new file mode 100644 index 0000000..d0a96bf --- /dev/null +++ b/docs/Models/Operations/GetStatisticsStatisticsResponseBody.md @@ -0,0 +1,10 @@ +# GetStatisticsStatisticsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `errors` | array<[\LukeHagar\Plex_API\Models\Operations\GetStatisticsErrors](../../Models/Operations/GetStatisticsErrors.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/Setting.md b/docs/Models/Operations/Setting.md new file mode 100644 index 0000000..ce02e6a --- /dev/null +++ b/docs/Models/Operations/Setting.md @@ -0,0 +1,17 @@ +# Setting + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `id` | *?string* | :heavy_minus_sign: | N/A | EnableDatabaseTrace | +| `label` | *?string* | :heavy_minus_sign: | N/A | | +| `summary` | *?string* | :heavy_minus_sign: | N/A | | +| `type` | *?string* | :heavy_minus_sign: | N/A | bool | +| `default` | *?bool* | :heavy_minus_sign: | N/A | false | +| `value` | *?bool* | :heavy_minus_sign: | N/A | false | +| `hidden` | *?bool* | :heavy_minus_sign: | N/A | true | +| `advanced` | *?bool* | :heavy_minus_sign: | N/A | false | +| `group` | *?string* | :heavy_minus_sign: | N/A | | +| `enumValues` | *?string* | :heavy_minus_sign: | N/A | 1:admin only\|2:everyone | \ No newline at end of file diff --git a/docs/Models/Operations/StatisticsMedia.md b/docs/Models/Operations/StatisticsMedia.md new file mode 100644 index 0000000..541bb21 --- /dev/null +++ b/docs/Models/Operations/StatisticsMedia.md @@ -0,0 +1,14 @@ +# StatisticsMedia + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `accountID` | *?int* | :heavy_minus_sign: | N/A | 1 | +| `deviceID` | *?int* | :heavy_minus_sign: | N/A | 13 | +| `timespan` | *?int* | :heavy_minus_sign: | N/A | 4 | +| `at` | *?int* | :heavy_minus_sign: | N/A | 1707141600 | +| `metadataType` | *?int* | :heavy_minus_sign: | N/A | 4 | +| `count` | *?int* | :heavy_minus_sign: | N/A | 1 | +| `duration` | *?int* | :heavy_minus_sign: | N/A | 1555 | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index 7a0f688..6d29365 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -43,7 +43,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -78,12 +78,12 @@ $sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); try { - $response = $sdk->activities->cancelServerActivities('string'); + $response = $sdk->activities->cancelServerActivities(''); if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index 3e605e7..e097058 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -40,7 +40,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -82,7 +82,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -120,7 +120,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -165,7 +165,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -212,7 +212,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index d3e85ca..600449a 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -40,7 +40,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -88,7 +88,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index f2a2914..ec1b299 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -49,7 +49,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -94,7 +94,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -137,7 +137,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -216,7 +216,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -263,7 +263,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -329,7 +329,7 @@ try { if ($response->object !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -377,7 +377,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -441,7 +441,7 @@ try { if ($response->object !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -489,7 +489,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -536,7 +536,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -580,7 +580,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index a0e0f5d..f78b083 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -42,7 +42,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -112,7 +112,7 @@ level=1&message=Test%20message%203&source=postman'; if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -156,7 +156,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index bc1147a..6a4ab6a 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -41,7 +41,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -87,7 +87,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -129,12 +129,12 @@ $sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); try { - $response = $sdk->media->updatePlayProgress('string', 6900.91, 'string'); + $response = $sdk->media->updatePlayProgress('', 6900.91, ''); if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index 992e14e..a67c225 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -47,7 +47,7 @@ $sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); try { $request = new Operations\CreatePlaylistRequest(); - $request->title = 'string'; + $request->title = ''; $request->type = Operations\QueryParamType::Photo; $request->smart = Operations\Smart::One; $request->uri = 'https://inborn-brochure.biz'; @@ -58,7 +58,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -104,7 +104,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -153,7 +153,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -200,7 +200,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -242,12 +242,12 @@ $sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); try { - $response = $sdk->playlists->updatePlaylist(3915, 'string', 'string'); + $response = $sdk->playlists->updatePlaylist(3915, '', ''); if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -299,7 +299,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -347,7 +347,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -395,7 +395,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -444,7 +444,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index 53a3348..d37d930 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -35,12 +35,12 @@ $sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); try { - $response = $sdk->plex->getPin('string', false); + $response = $sdk->plex->getPin('', false); if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -83,12 +83,12 @@ $sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); try { - $response = $sdk->plex->getToken('string', 'string'); + $response = $sdk->plex->getToken('', ''); if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 492b9c9..4599b19 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -53,7 +53,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -105,7 +105,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -153,7 +153,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/security/README.md b/docs/sdks/security/README.md index ed4e64a..5966488 100644 --- a/docs/sdks/security/README.md +++ b/docs/sdks/security/README.md @@ -41,7 +41,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -90,7 +90,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 739af96..2a56b52 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -43,7 +43,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -80,7 +80,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -117,7 +117,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -154,7 +154,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -191,7 +191,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -228,7 +228,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -276,7 +276,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -319,7 +319,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index 1b1a1e5..e720d4b 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -39,7 +39,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -76,7 +76,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -113,7 +113,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -153,7 +153,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md new file mode 100644 index 0000000..35587da --- /dev/null +++ b/docs/sdks/statistics/README.md @@ -0,0 +1,57 @@ +# Statistics + + +## Overview + +API Calls that perform operations with Plex Media Server Statistics + + +### Available Operations + +* [getStatistics](#getstatistics) - Get Media Statistics + +## getStatistics + +This will return the media statistics for the server + +### Example Usage + +```php +accessToken = ''; + +$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); + +try { + + + $response = $sdk->statistics->getStatistics(411769); + + if ($response->twoHundredApplicationJsonObject !== null) { + // handle response + } +} catch (Throwable $e) { + // handle exception +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *int* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| + + +### Response + +**[?\LukeHagar\Plex_API\Models\Operations\GetStatisticsResponse](../../Models/Operations/GetStatisticsResponse.md)** + diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index cc444ec..650ca78 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -39,7 +39,7 @@ try { if ($response->twoHundredApplicationJsonObject !== null) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -79,7 +79,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -126,7 +126,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 758097a..ca2f7f3 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -8,70 +8,8 @@ API Calls that perform operations with Plex Media Server Videos ### Available Operations -* [startUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode * [getTimeline](#gettimeline) - Get the timeline for a media item - -## startUniversalTranscode - -Begin a Universal Transcode Session - -### Example Usage - -```php -accessToken = ''; - -$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); - -try { - $request = new Operations\StartUniversalTranscodeRequest(); - $request->hasMDE = 8924.99; - $request->path = '/etc/mail'; - $request->mediaIndex = 9962.95; - $request->partIndex = 1232.82; - $request->protocol = 'string'; - $request->fastSeek = 1630.75; - $request->directPlay = 4531.53; - $request->directStream = 4877.48; - $request->subtitleSize = 3383.01; - $request->subtites = 'string'; - $request->audioBoost = 7970.18; - $request->location = 'string'; - $request->mediaBufferSize = 2664.33; - $request->session = 'string'; - $request->addDebugOverlay = 4930.91; - $request->autoAdjustQuality = 2087.17;; - - $response = $sdk->video->startUniversalTranscode($request); - - if ($response->statusCode === 200) { - // handle response - } -} catch (Exception $e) { - // handle exception -} -``` - -### Parameters - -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `$request` | [\LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeRequest](../../Models/Operations/StartUniversalTranscodeRequest.md) | :heavy_check_mark: | The request object to use for the request. | - - -### Response - -**[?\LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponse](../../Models/Operations/StartUniversalTranscodeResponse.md)** - +* [startUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode ## getTimeline @@ -102,7 +40,7 @@ try { $request->hasMDE = 7574.33; $request->time = 3327.51; $request->duration = 7585.39; - $request->context = 'string'; + $request->context = ''; $request->playQueueItemID = 1406.21; $request->playBackTime = 2699.34; $request->row = 3536.42;; @@ -112,7 +50,7 @@ try { if ($response->statusCode === 200) { // handle response } -} catch (Exception $e) { +} catch (Throwable $e) { // handle exception } ``` @@ -128,3 +66,65 @@ try { **[?\LukeHagar\Plex_API\Models\Operations\GetTimelineResponse](../../Models/Operations/GetTimelineResponse.md)** + +## startUniversalTranscode + +Begin a Universal Transcode Session + +### Example Usage + +```php +accessToken = ''; + +$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build(); + +try { + $request = new Operations\StartUniversalTranscodeRequest(); + $request->hasMDE = 8924.99; + $request->path = '/etc/mail'; + $request->mediaIndex = 9962.95; + $request->partIndex = 1232.82; + $request->protocol = ''; + $request->fastSeek = 1630.75; + $request->directPlay = 4531.53; + $request->directStream = 4877.48; + $request->subtitleSize = 3383.01; + $request->subtites = ''; + $request->audioBoost = 7970.18; + $request->location = ''; + $request->mediaBufferSize = 2664.33; + $request->session = ''; + $request->addDebugOverlay = 4930.91; + $request->autoAdjustQuality = 2087.17;; + + $response = $sdk->video->startUniversalTranscode($request); + + if ($response->statusCode === 200) { + // handle response + } +} catch (Throwable $e) { + // handle exception +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `$request` | [\LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeRequest](../../Models/Operations/StartUniversalTranscodeRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[?\LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponse](../../Models/Operations/StartUniversalTranscodeResponse.md)** + diff --git a/gen.yaml b/gen.yaml index f245585..2242cca 100644 --- a/gen.yaml +++ b/gen.yaml @@ -8,8 +8,9 @@ generation: fixes: nameResolutionDec2023: false parameterOrderingFeb2024: false + requestResponseComponentNamesFeb2024: false php: - version: 0.3.0 + version: 0.3.1 imports: option: openapi paths: diff --git a/phpstan.neon b/phpstan.neon index 244f87c..b8d0ee6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,12 @@ parameters: + + paths: + - src/ + reportUnmatchedIgnoredErrors: false + + checkGenericClassInNonGenericObjectType: false + ignoreErrors: - '#.*?class ReflectionProperty constructor expects object\|string.*?#' - '#^Strict comparison using === between .*? will always evaluate to false\.$#' \ No newline at end of file diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..606164e --- /dev/null +++ b/rector.php @@ -0,0 +1,29 @@ +paths([ + __DIR__ . '/src', + ]); + + $rectorConfig->rules([ + InlineConstructorDefaultToPropertyRector::class, + ]); + + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_82, + SetList::CODE_QUALITY, + SetList::DEAD_CODE, + SetList::EARLY_RETURN, + SetList::TYPE_DECLARATION, + SetList::PRIVATIZATION, + ]); +}; diff --git a/src/Models/Operations/Account.php b/src/Models/Operations/Account.php new file mode 100644 index 0000000..cc5fc61 --- /dev/null +++ b/src/Models/Operations/Account.php @@ -0,0 +1,65 @@ +id = null; + $this->key = null; + $this->name = null; + $this->defaultAudioLanguage = null; + $this->autoSelectAudio = null; + $this->defaultSubtitleLanguage = null; + $this->subtitleMode = null; + $this->thumb = null; + } +} diff --git a/src/Models/Operations/GetServerPreferencesMediaContainer.php b/src/Models/Operations/GetServerPreferencesMediaContainer.php index 5c93950..1e159a9 100644 --- a/src/Models/Operations/GetServerPreferencesMediaContainer.php +++ b/src/Models/Operations/GetServerPreferencesMediaContainer.php @@ -19,10 +19,10 @@ class GetServerPreferencesMediaContainer /** * $setting * - * @var ?array $setting + * @var ?array<\LukeHagar\Plex_API\Models\Operations\Setting> $setting */ #[\JMS\Serializer\Annotation\SerializedName('Setting')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\JMS\Serializer\Annotation\Type('array')] #[\JMS\Serializer\Annotation\SkipWhenEmpty] public ?array $setting = null; diff --git a/src/Models/Operations/GetStatisticsDevice.php b/src/Models/Operations/GetStatisticsDevice.php new file mode 100644 index 0000000..fa127ba --- /dev/null +++ b/src/Models/Operations/GetStatisticsDevice.php @@ -0,0 +1,47 @@ +id = null; + $this->name = null; + $this->platform = null; + $this->clientIdentifier = null; + $this->createdAt = null; + } +} diff --git a/src/Models/Operations/GetStatisticsErrors.php b/src/Models/Operations/GetStatisticsErrors.php new file mode 100644 index 0000000..dfa4aef --- /dev/null +++ b/src/Models/Operations/GetStatisticsErrors.php @@ -0,0 +1,35 @@ +code = null; + $this->message = null; + $this->status = null; + } +} diff --git a/src/Models/Operations/GetStatisticsMediaContainer.php b/src/Models/Operations/GetStatisticsMediaContainer.php new file mode 100644 index 0000000..1f4a707 --- /dev/null +++ b/src/Models/Operations/GetStatisticsMediaContainer.php @@ -0,0 +1,56 @@ + $device + */ + #[\JMS\Serializer\Annotation\SerializedName('Device')] + #[\JMS\Serializer\Annotation\Type('array')] + #[\JMS\Serializer\Annotation\SkipWhenEmpty] + public ?array $device = null; + + /** + * $account + * + * @var ?array<\LukeHagar\Plex_API\Models\Operations\Account> $account + */ + #[\JMS\Serializer\Annotation\SerializedName('Account')] + #[\JMS\Serializer\Annotation\Type('array')] + #[\JMS\Serializer\Annotation\SkipWhenEmpty] + public ?array $account = null; + + /** + * $statisticsMedia + * + * @var ?array<\LukeHagar\Plex_API\Models\Operations\StatisticsMedia> $statisticsMedia + */ + #[\JMS\Serializer\Annotation\SerializedName('StatisticsMedia')] + #[\JMS\Serializer\Annotation\Type('array')] + #[\JMS\Serializer\Annotation\SkipWhenEmpty] + public ?array $statisticsMedia = null; + + public function __construct() + { + $this->size = null; + $this->device = null; + $this->account = null; + $this->statisticsMedia = null; + } +} diff --git a/src/Models/Operations/GetStatisticsRequest.php b/src/Models/Operations/GetStatisticsRequest.php new file mode 100644 index 0000000..47d0f2a --- /dev/null +++ b/src/Models/Operations/GetStatisticsRequest.php @@ -0,0 +1,29 @@ +timespan = null; + } +} diff --git a/src/Models/Operations/GetStatisticsResponse.php b/src/Models/Operations/GetStatisticsResponse.php new file mode 100644 index 0000000..80fa2c1 --- /dev/null +++ b/src/Models/Operations/GetStatisticsResponse.php @@ -0,0 +1,62 @@ +contentType = ""; + $this->statusCode = 0; + $this->rawResponse = null; + $this->twoHundredApplicationJsonObject = null; + $this->fourHundredAndOneApplicationJsonObject = null; + } +} diff --git a/src/Models/Operations/GetStatisticsResponseBody.php b/src/Models/Operations/GetStatisticsResponseBody.php new file mode 100644 index 0000000..57ebdd1 --- /dev/null +++ b/src/Models/Operations/GetStatisticsResponseBody.php @@ -0,0 +1,29 @@ +mediaContainer = null; + } +} diff --git a/src/Models/Operations/GetStatisticsStatisticsResponseBody.php b/src/Models/Operations/GetStatisticsStatisticsResponseBody.php new file mode 100644 index 0000000..17bb92e --- /dev/null +++ b/src/Models/Operations/GetStatisticsStatisticsResponseBody.php @@ -0,0 +1,34 @@ + $errors + */ + #[\JMS\Serializer\Annotation\SerializedName('errors')] + #[\JMS\Serializer\Annotation\Type('array')] + #[\JMS\Serializer\Annotation\SkipWhenEmpty] + public ?array $errors = null; + + public function __construct() + { + $this->errors = null; + } +} diff --git a/src/Models/Operations/Setting.php b/src/Models/Operations/Setting.php new file mode 100644 index 0000000..5d19fff --- /dev/null +++ b/src/Models/Operations/Setting.php @@ -0,0 +1,77 @@ +id = null; + $this->label = null; + $this->summary = null; + $this->type = null; + $this->default = null; + $this->value = null; + $this->hidden = null; + $this->advanced = null; + $this->group = null; + $this->enumValues = null; + } +} diff --git a/src/Models/Operations/StatisticsMedia.php b/src/Models/Operations/StatisticsMedia.php new file mode 100644 index 0000000..94cfc39 --- /dev/null +++ b/src/Models/Operations/StatisticsMedia.php @@ -0,0 +1,59 @@ +accountID = null; + $this->deviceID = null; + $this->timespan = null; + $this->at = null; + $this->metadataType = null; + $this->count = null; + $this->duration = null; + } +} diff --git a/src/PlexAPI.php b/src/PlexAPI.php index 42f1f2e..97a506c 100644 --- a/src/PlexAPI.php +++ b/src/PlexAPI.php @@ -41,6 +41,15 @@ class PlexAPI */ public Media $media; + /** + * API Calls that perform operations with Plex Media Server Videos + * + * + * + * @var Video $$video + */ + public Video $video; + /** * Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. * @@ -131,6 +140,15 @@ class PlexAPI */ public Security $security; + /** + * API Calls that perform operations with Plex Media Server Statistics + * + * + * + * @var Statistics $$statistics + */ + public Statistics $statistics; + /** * API Calls that perform search operations with Plex Media Server Sessions * @@ -149,15 +167,6 @@ class PlexAPI * @var Updater $$updater */ public Updater $updater; - - /** - * API Calls that perform operations with Plex Media Server Videos - * - * - * - * @var Video $$video - */ - public Video $video; private SDKConfiguration $sdkConfiguration; @@ -182,6 +191,8 @@ class PlexAPI $this->media = new Media($this->sdkConfiguration); + $this->video = new Video($this->sdkConfiguration); + $this->activities = new Activities($this->sdkConfiguration); $this->butler = new Butler($this->sdkConfiguration); @@ -200,10 +211,10 @@ class PlexAPI $this->security = new Security($this->sdkConfiguration); + $this->statistics = new Statistics($this->sdkConfiguration); + $this->sessions = new Sessions($this->sdkConfiguration); $this->updater = new Updater($this->sdkConfiguration); - - $this->video = new Video($this->sdkConfiguration); } } \ No newline at end of file diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 01cd71e..a73220e 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -25,9 +25,9 @@ class SDKConfiguration ]; public string $language = 'php'; public string $openapiDocVersion = '0.0.3'; - public string $sdkVersion = '0.3.0'; - public string $genVersion = '2.249.1'; - public string $userAgent = 'speakeasy-sdk/php 0.3.0 2.249.1 0.0.3 lukehagar/plex-api'; + public string $sdkVersion = '0.3.1'; + public string $genVersion = '2.269.0'; + public string $userAgent = 'speakeasy-sdk/php 0.3.1 2.269.0 0.0.3 lukehagar/plex-api'; public function getServerUrl(): string diff --git a/src/Statistics.php b/src/Statistics.php new file mode 100644 index 0000000..fca2fd9 --- /dev/null +++ b/src/Statistics.php @@ -0,0 +1,75 @@ +sdkConfiguration = $sdkConfig; + } + + /** + * Get Media Statistics + * + * This will return the media statistics for the server + * + * @param ?int $timespan + * @return \LukeHagar\Plex_API\Models\Operations\GetStatisticsResponse + */ + public function getStatistics( + ?int $timespan = null, + ): \LukeHagar\Plex_API\Models\Operations\GetStatisticsResponse + { + $request = new \LukeHagar\Plex_API\Models\Operations\GetStatisticsRequest(); + $request->timespan = $timespan; + + $baseUrl = Utils\Utils::templateUrl($this->sdkConfiguration->getServerUrl(), $this->sdkConfiguration->getServerDefaults()); + $url = Utils\Utils::generateUrl($baseUrl, '/statistics/media'); + + $options = ['http_errors' => false]; + $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\LukeHagar\Plex_API\Models\Operations\GetStatisticsRequest::class, $request, null)); + $options['headers']['Accept'] = 'application/json'; + $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + + $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + + $response = new \LukeHagar\Plex_API\Models\Operations\GetStatisticsResponse(); + $response->statusCode = $statusCode; + $response->contentType = $contentType; + $response->rawResponse = $httpResponse; + + if ($httpResponse->getStatusCode() === 200) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $serializer = Utils\JSON::createSerializer(); + $response->twoHundredApplicationJsonObject = $serializer->deserialize((string)$httpResponse->getBody(), 'LukeHagar\Plex_API\Models\Operations\GetStatisticsResponseBody', 'json'); + } + } + else if ($httpResponse->getStatusCode() === 400) { + } + else if ($httpResponse->getStatusCode() === 401) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $serializer = Utils\JSON::createSerializer(); + $response->fourHundredAndOneApplicationJsonObject = $serializer->deserialize((string)$httpResponse->getBody(), 'LukeHagar\Plex_API\Models\Operations\GetStatisticsStatisticsResponseBody', 'json'); + } + } + + return $response; + } +} \ No newline at end of file diff --git a/src/Video.php b/src/Video.php index 9a1dbb3..338c47a 100644 --- a/src/Video.php +++ b/src/Video.php @@ -21,49 +21,6 @@ class Video $this->sdkConfiguration = $sdkConfig; } - /** - * Start Universal Transcode - * - * Begin a Universal Transcode Session - * - * @param \LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeRequest $request - * @return \LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponse - */ - public function startUniversalTranscode( - ?\LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeRequest $request, - ): \LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponse - { - $baseUrl = Utils\Utils::templateUrl($this->sdkConfiguration->getServerUrl(), $this->sdkConfiguration->getServerDefaults()); - $url = Utils\Utils::generateUrl($baseUrl, '/video/:/transcode/universal/start.mpd'); - - $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeRequest::class, $request, null)); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); - - $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; - - $statusCode = $httpResponse->getStatusCode(); - - $response = new \LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - - if ($httpResponse->getStatusCode() === 200 or $httpResponse->getStatusCode() === 400) { - } - else if ($httpResponse->getStatusCode() === 401) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->object = $serializer->deserialize((string)$httpResponse->getBody(), 'LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponseBody', 'json'); - } - } - - return $response; - } - /** * Get the timeline for a media item * @@ -106,4 +63,47 @@ class Video return $response; } + + /** + * Start Universal Transcode + * + * Begin a Universal Transcode Session + * + * @param \LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeRequest $request + * @return \LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponse + */ + public function startUniversalTranscode( + ?\LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeRequest $request, + ): \LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponse + { + $baseUrl = Utils\Utils::templateUrl($this->sdkConfiguration->getServerUrl(), $this->sdkConfiguration->getServerDefaults()); + $url = Utils\Utils::generateUrl($baseUrl, '/video/:/transcode/universal/start.mpd'); + + $options = ['http_errors' => false]; + $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeRequest::class, $request, null)); + $options['headers']['Accept'] = 'application/json'; + $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + + $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + + $response = new \LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponse(); + $response->statusCode = $statusCode; + $response->contentType = $contentType; + $response->rawResponse = $httpResponse; + + if ($httpResponse->getStatusCode() === 200 or $httpResponse->getStatusCode() === 400) { + } + else if ($httpResponse->getStatusCode() === 401) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $serializer = Utils\JSON::createSerializer(); + $response->object = $serializer->deserialize((string)$httpResponse->getBody(), 'LukeHagar\Plex_API\Models\Operations\StartUniversalTranscodeResponseBody', 'json'); + } + } + + return $response; + } } \ No newline at end of file