ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1

This commit is contained in:
speakeasybot
2025-02-06 00:11:27 +00:00
parent a0fd258dae
commit 358a060449
788 changed files with 4077 additions and 1529 deletions

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 01a51eb2-5d90-4a24-b154-68e491d02c36
management:
docChecksum: a643a64d282d705e3e24f61ed6f068c6
docChecksum: 14b35829d4be91a88269761c3ed01426
docVersion: 0.0.3
speakeasyVersion: 1.459.2
generationVersion: 2.483.1
releaseVersion: 0.12.5
configChecksum: 2acdcb291a83a0328bb75df7f7a99505
speakeasyVersion: 1.484.1
generationVersion: 2.503.2
releaseVersion: 0.12.6
configChecksum: 0b21cc9558844e2166d52a79210c893d
repoURL: https://github.com/LukeHagar/plexphp.git
repoSubDirectory: .
installationURL: https://github.com/LukeHagar/plexphp
@@ -14,13 +14,13 @@ management:
features:
php:
constsAndDefaults: 0.2.0
core: 3.7.7
core: 3.7.13
deprecations: 2.81.1
enums: 2.81.1
errors: 0.3.0
flattening: 2.81.1
globalSecurity: 2.81.7
globalSecurityFlattening: 0.1.1
globalSecurityFlattening: 0.1.2
globalServerURLs: 2.82.1
methodArguments: 0.1.0
methodServerURLs: 2.82.1
@@ -93,6 +93,10 @@ generatedFiles:
- docs/Models/Errors/GetCompanionsDataErrors.md
- docs/Models/Errors/GetCompanionsDataPlexErrors.md
- docs/Models/Errors/GetCompanionsDataUnauthorized.md
- docs/Models/Errors/GetCountriesLibraryBadRequest.md
- docs/Models/Errors/GetCountriesLibraryErrors.md
- docs/Models/Errors/GetCountriesLibraryLibraryErrors.md
- docs/Models/Errors/GetCountriesLibraryUnauthorized.md
- docs/Models/Errors/GetDevicesBadRequest.md
- docs/Models/Errors/GetDevicesErrors.md
- docs/Models/Errors/GetDevicesServerErrors.md
@@ -101,6 +105,10 @@ generatedFiles:
- docs/Models/Errors/GetFileHashErrors.md
- docs/Models/Errors/GetFileHashLibraryErrors.md
- docs/Models/Errors/GetFileHashUnauthorized.md
- docs/Models/Errors/GetGenresLibraryBadRequest.md
- docs/Models/Errors/GetGenresLibraryErrors.md
- docs/Models/Errors/GetGenresLibraryLibraryErrors.md
- docs/Models/Errors/GetGenresLibraryUnauthorized.md
- docs/Models/Errors/GetGeoDataBadRequest.md
- docs/Models/Errors/GetGeoDataErrors.md
- docs/Models/Errors/GetGeoDataPlexErrors.md
@@ -400,11 +408,21 @@ generatedFiles:
- docs/Models/Operations/GetButlerTasksResponse.md
- docs/Models/Operations/GetButlerTasksResponseBody.md
- docs/Models/Operations/GetCompanionsDataResponse.md
- docs/Models/Operations/GetCountriesLibraryDirectory.md
- docs/Models/Operations/GetCountriesLibraryMediaContainer.md
- docs/Models/Operations/GetCountriesLibraryRequest.md
- docs/Models/Operations/GetCountriesLibraryResponse.md
- docs/Models/Operations/GetCountriesLibraryResponseBody.md
- docs/Models/Operations/GetDevicesMediaContainer.md
- docs/Models/Operations/GetDevicesResponse.md
- docs/Models/Operations/GetDevicesResponseBody.md
- docs/Models/Operations/GetFileHashRequest.md
- docs/Models/Operations/GetFileHashResponse.md
- docs/Models/Operations/GetGenresLibraryDirectory.md
- docs/Models/Operations/GetGenresLibraryMediaContainer.md
- docs/Models/Operations/GetGenresLibraryRequest.md
- docs/Models/Operations/GetGenresLibraryResponse.md
- docs/Models/Operations/GetGenresLibraryResponseBody.md
- docs/Models/Operations/GetGeoDataGeoData.md
- docs/Models/Operations/GetGeoDataResponse.md
- docs/Models/Operations/GetGlobalHubsMediaContainer.md
@@ -966,6 +984,12 @@ generatedFiles:
- src/Models/Errors/GetCompanionsDataPlexErrors.php
- src/Models/Errors/GetCompanionsDataUnauthorized.php
- src/Models/Errors/GetCompanionsDataUnauthorizedThrowable.php
- src/Models/Errors/GetCountriesLibraryBadRequest.php
- src/Models/Errors/GetCountriesLibraryBadRequestThrowable.php
- src/Models/Errors/GetCountriesLibraryErrors.php
- src/Models/Errors/GetCountriesLibraryLibraryErrors.php
- src/Models/Errors/GetCountriesLibraryUnauthorized.php
- src/Models/Errors/GetCountriesLibraryUnauthorizedThrowable.php
- src/Models/Errors/GetDevicesBadRequest.php
- src/Models/Errors/GetDevicesBadRequestThrowable.php
- src/Models/Errors/GetDevicesErrors.php
@@ -978,6 +1002,12 @@ generatedFiles:
- src/Models/Errors/GetFileHashLibraryErrors.php
- src/Models/Errors/GetFileHashUnauthorized.php
- src/Models/Errors/GetFileHashUnauthorizedThrowable.php
- src/Models/Errors/GetGenresLibraryBadRequest.php
- src/Models/Errors/GetGenresLibraryBadRequestThrowable.php
- src/Models/Errors/GetGenresLibraryErrors.php
- src/Models/Errors/GetGenresLibraryLibraryErrors.php
- src/Models/Errors/GetGenresLibraryUnauthorized.php
- src/Models/Errors/GetGenresLibraryUnauthorizedThrowable.php
- src/Models/Errors/GetGeoDataBadRequest.php
- src/Models/Errors/GetGeoDataBadRequestThrowable.php
- src/Models/Errors/GetGeoDataErrors.php
@@ -1392,11 +1422,21 @@ generatedFiles:
- src/Models/Operations/GetButlerTasksResponse.php
- src/Models/Operations/GetButlerTasksResponseBody.php
- src/Models/Operations/GetCompanionsDataResponse.php
- src/Models/Operations/GetCountriesLibraryDirectory.php
- src/Models/Operations/GetCountriesLibraryMediaContainer.php
- src/Models/Operations/GetCountriesLibraryRequest.php
- src/Models/Operations/GetCountriesLibraryResponse.php
- src/Models/Operations/GetCountriesLibraryResponseBody.php
- src/Models/Operations/GetDevicesMediaContainer.php
- src/Models/Operations/GetDevicesResponse.php
- src/Models/Operations/GetDevicesResponseBody.php
- src/Models/Operations/GetFileHashRequest.php
- src/Models/Operations/GetFileHashResponse.php
- src/Models/Operations/GetGenresLibraryDirectory.php
- src/Models/Operations/GetGenresLibraryMediaContainer.php
- src/Models/Operations/GetGenresLibraryRequest.php
- src/Models/Operations/GetGenresLibraryResponse.php
- src/Models/Operations/GetGenresLibraryResponseBody.php
- src/Models/Operations/GetGeoDataGeoData.php
- src/Models/Operations/GetGeoDataResponse.php
- src/Models/Operations/GetGlobalHubsMediaContainer.php
@@ -2856,5 +2896,29 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
generatedTests: {}
get-genres-library:
speakeasy-default-get-genres-library:
parameters:
path:
sectionKey: 9518
responses:
"200":
application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "art": "/:/resources/show-fanart.jpg", "content": "secondary", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "nocache": true, "thumb": "/:/resources/show.png", "title1": "TV Shows (Reality)", "title2": "By Genre", "viewGroup": "secondary", "Directory": [{"fastKey": "/library/sections/10/all?genre=89", "key": "89", "title": "Action", "type": "genre"}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
get-countries-library:
speakeasy-default-get-countries-library:
parameters:
path:
sectionKey: 9518
responses:
"200":
application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "art": "/:/resources/show-fanart.jpg", "content": "secondary", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "nocache": true, "thumb": "/:/resources/show.png", "title1": "TV Series", "title2": "By Country", "viewGroup": "secondary", "Directory": [{"fastKey": "/library/sections/2/all?country=15491", "key": "15491", "title": "Japan"}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
examplesVersion: 1.0.0
generatedTests: {}

View File

@@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
php:
version: 0.12.5
version: 0.12.6
additionalDependencies:
autoload: {}
autoload-dev: {}

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.459.2
speakeasyVersion: 1.484.1
sources:
my-source:
sourceNamespace: my-source
@@ -9,19 +9,19 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c
sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696
sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10
sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55
tags:
- latest
- speakeasy-sdk-regen-1738022986
- speakeasy-sdk-regen-1738800603
targets:
plexphp:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c
sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696
sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10
sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55
codeSamplesNamespace: code-samples-php-plexphp
codeSamplesRevisionDigest: sha256:927d211eb5bbb4f383aa1cb3d07f9d0c9316dc690ec5e6d83c1608e2315a8cdf
codeSamplesRevisionDigest: sha256:e5a939240be5566d8e8fc18b364210b4cc1c2f946f46075abc1aa7c9126eab07
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -80,9 +80,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -169,6 +171,8 @@ if ($response->object !== null) {
* [deleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
* [getAllLibraries](docs/sdks/library/README.md#getalllibraries) - Get All Libraries
* [getCountriesLibrary](docs/sdks/library/README.md#getcountrieslibrary) - Get Countries of library media
* [getGenresLibrary](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media
* [getLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details
* [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
* [getMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey
@@ -298,9 +302,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
try {
$response = $sdk->server->getMediaProviders(
@@ -343,11 +349,12 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()
->setServerURL('https://10.10.10.47:32400')
->setSecurity($security)->build();
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -371,9 +378,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -752,4 +752,14 @@ Based on:
### Generated
- [php v0.12.5] .
### Releases
- [Composer v0.12.5] https://packagist.org/packages/lukehagar/plex-api#v0.12.5 - .
- [Composer v0.12.5] https://packagist.org/packages/lukehagar/plex-api#v0.12.5 - .
## 2025-02-06 00:09:48
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.484.1 (2.503.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [php v0.12.6] .
### Releases
- [Composer v0.12.6] https://packagist.org/packages/lukehagar/plex-api#v0.12.6 - .

View File

@@ -6,9 +6,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

File diff suppressed because it is too large Load Diff

View File

@@ -18,9 +18,8 @@
},
"require-dev": {
"laravel/pint": "^1.18.1",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan": "^2.1.0",
"phpunit/phpunit": "^10",
"rector/rector": "^0.19",
"roave/security-advisories": "dev-latest"
},
"minimum-stability": "stable",

View File

@@ -0,0 +1,11 @@
# GetCountriesLibraryBadRequest
Bad Request - A parameter was not specified, or was specified incorrectly.
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `errors` | array<[Errors\GetCountriesLibraryErrors](../../Models/Errors/GetCountriesLibraryErrors.md)> | :heavy_minus_sign: | N/A |
| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -0,0 +1,10 @@
# GetCountriesLibraryErrors
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `code` | *?int* | :heavy_minus_sign: | N/A | 1000 |
| `message` | *?string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
| `status` | *?int* | :heavy_minus_sign: | N/A | 400 |

View File

@@ -0,0 +1,10 @@
# GetCountriesLibraryLibraryErrors
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `code` | *?int* | :heavy_minus_sign: | N/A | 1001 |
| `message` | *?string* | :heavy_minus_sign: | N/A | User could not be authenticated |
| `status` | *?int* | :heavy_minus_sign: | N/A | 401 |

View File

@@ -0,0 +1,11 @@
# GetCountriesLibraryUnauthorized
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `errors` | array<[Errors\GetCountriesLibraryLibraryErrors](../../Models/Errors/GetCountriesLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A |
| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -0,0 +1,11 @@
# GetGenresLibraryBadRequest
Bad Request - A parameter was not specified, or was specified incorrectly.
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `errors` | array<[Errors\GetGenresLibraryErrors](../../Models/Errors/GetGenresLibraryErrors.md)> | :heavy_minus_sign: | N/A |
| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -0,0 +1,10 @@
# GetGenresLibraryErrors
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `code` | *?int* | :heavy_minus_sign: | N/A | 1000 |
| `message` | *?string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
| `status` | *?int* | :heavy_minus_sign: | N/A | 400 |

View File

@@ -0,0 +1,10 @@
# GetGenresLibraryLibraryErrors
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `code` | *?int* | :heavy_minus_sign: | N/A | 1001 |
| `message` | *?string* | :heavy_minus_sign: | N/A | User could not be authenticated |
| `status` | *?int* | :heavy_minus_sign: | N/A | 401 |

View File

@@ -0,0 +1,11 @@
# GetGenresLibraryUnauthorized
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `errors` | array<[Errors\GetGenresLibraryLibraryErrors](../../Models/Errors/GetGenresLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A |
| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -0,0 +1,10 @@
# GetCountriesLibraryDirectory
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- |
| `fastKey` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?country=15491 |
| `key` | *string* | :heavy_check_mark: | N/A | 15491 |
| `title` | *string* | :heavy_check_mark: | N/A | Japan |

View File

@@ -0,0 +1,22 @@
# GetCountriesLibraryMediaContainer
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `size` | *float* | :heavy_check_mark: | N/A | 50 |
| `identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.library |
| `allowSync` | *bool* | :heavy_check_mark: | N/A | false |
| `art` | *string* | :heavy_check_mark: | N/A | /:/resources/show-fanart.jpg |
| `content` | *string* | :heavy_check_mark: | N/A | secondary |
| `mediaTagPrefix` | *string* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ |
| `mediaTagVersion` | *int* | :heavy_check_mark: | N/A | 1734362201 |
| `nocache` | *bool* | :heavy_check_mark: | N/A | true |
| `thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/show.png |
| `title1` | *string* | :heavy_check_mark: | N/A | TV Series |
| `title2` | *string* | :heavy_check_mark: | N/A | By Country |
| `viewGroup` | *string* | :heavy_check_mark: | N/A | secondary |
| `offset` | *?int* | :heavy_minus_sign: | N/A | |
| `totalSize` | *?int* | :heavy_minus_sign: | N/A | |
| `directory` | array<[Operations\GetCountriesLibraryDirectory](../../Models/Operations/GetCountriesLibraryDirectory.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -0,0 +1,8 @@
# GetCountriesLibraryRequest
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |

View File

@@ -0,0 +1,11 @@
# GetCountriesLibraryResponse
## 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 |
| `object` | [?Operations\GetCountriesLibraryResponseBody](../../Models/Operations/GetCountriesLibraryResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. |

View File

@@ -0,0 +1,10 @@
# GetCountriesLibraryResponseBody
Successful response containing media container data.
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `mediaContainer` | [?Operations\GetCountriesLibraryMediaContainer](../../Models/Operations/GetCountriesLibraryMediaContainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,11 @@
# GetGenresLibraryDirectory
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
| `fastKey` | *string* | :heavy_check_mark: | N/A | /library/sections/10/all?genre=89 |
| `key` | *string* | :heavy_check_mark: | N/A | 89 |
| `title` | *string* | :heavy_check_mark: | N/A | Action |
| `type` | *string* | :heavy_check_mark: | N/A | genre |

View File

@@ -0,0 +1,22 @@
# GetGenresLibraryMediaContainer
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `size` | *float* | :heavy_check_mark: | N/A | 50 |
| `identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.library |
| `allowSync` | *bool* | :heavy_check_mark: | N/A | false |
| `art` | *string* | :heavy_check_mark: | N/A | /:/resources/show-fanart.jpg |
| `content` | *string* | :heavy_check_mark: | N/A | secondary |
| `mediaTagPrefix` | *string* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ |
| `mediaTagVersion` | *int* | :heavy_check_mark: | N/A | 1734362201 |
| `nocache` | *bool* | :heavy_check_mark: | N/A | true |
| `thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/show.png |
| `title1` | *string* | :heavy_check_mark: | N/A | TV Shows (Reality) |
| `title2` | *string* | :heavy_check_mark: | N/A | By Genre |
| `viewGroup` | *string* | :heavy_check_mark: | N/A | secondary |
| `offset` | *?int* | :heavy_minus_sign: | N/A | |
| `totalSize` | *?int* | :heavy_minus_sign: | N/A | |
| `directory` | array<[Operations\GetGenresLibraryDirectory](../../Models/Operations/GetGenresLibraryDirectory.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -0,0 +1,8 @@
# GetGenresLibraryRequest
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |

View File

@@ -0,0 +1,11 @@
# GetGenresLibraryResponse
## 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 |
| `object` | [?Operations\GetGenresLibraryResponseBody](../../Models/Operations/GetGenresLibraryResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. |

View File

@@ -0,0 +1,10 @@
# GetGenresLibraryResponseBody
Successful response containing media container data.
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `mediaContainer` | [?Operations\GetGenresLibraryMediaContainer](../../Models/Operations/GetGenresLibraryMediaContainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -9,6 +9,6 @@
| `offset` | *?int* | :heavy_minus_sign: | N/A | |
| `totalSize` | *?int* | :heavy_minus_sign: | N/A | |
| `identifier` | *?string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library |
| `allowSync` | *?bool* | :heavy_minus_sign: | N/A | |
| `allowSync` | *?bool* | :heavy_minus_sign: | N/A | false |
| `meta` | [?Operations\Meta](../../Models/Operations/Meta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |
| `metadata` | array<[Operations\GetRecentlyAddedMetadata](../../Models/Operations/GetRecentlyAddedMetadata.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -30,9 +30,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -76,9 +78,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -28,9 +28,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -74,9 +76,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -122,9 +126,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -27,9 +27,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -72,9 +74,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -118,9 +122,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -165,9 +171,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -207,9 +215,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -27,17 +27,16 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetRecentlyAddedRequest(
contentDirectoryID: 470161,
type: Operations\Type::TvShow,
sectionID: 2,
includeMeta: Operations\IncludeMeta::Enable,
xPlexContainerStart: 0,
xPlexContainerSize: 50,
);
$response = $sdk->hubs->getRecentlyAdded(
@@ -79,9 +78,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -130,9 +131,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -10,6 +10,8 @@ API Calls interacting with Plex Media Server Libraries
* [deleteLibrary](#deletelibrary) - Delete Library Section
* [getAllLibraries](#getalllibraries) - Get All Libraries
* [getCountriesLibrary](#getcountrieslibrary) - Get Countries of library media
* [getGenresLibrary](#getgenreslibrary) - Get Genres of library media
* [getLibraryDetails](#getlibrarydetails) - Get Library Details
* [getLibraryItems](#getlibraryitems) - Get Library Items
* [getMetaDataByRatingKey](#getmetadatabyratingkey) - Get Metadata by RatingKey
@@ -35,9 +37,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -87,9 +91,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -114,6 +120,104 @@ if ($response->object !== null) {
| Errors\GetAllLibrariesUnauthorized | 401 | application/json |
| Errors\SDKException | 4XX, 5XX | \*/\* |
## getCountriesLibrary
Retrieves a list of all the countries that are found for the media in this library.
### Example Usage
```php
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->library->getCountriesLibrary(
sectionKey: 9518
);
if ($response->object !== null) {
// handle response
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
### Response
**[?Operations\GetCountriesLibraryResponse](../../Models/Operations/GetCountriesLibraryResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| Errors\GetCountriesLibraryBadRequest | 400 | application/json |
| Errors\GetCountriesLibraryUnauthorized | 401 | application/json |
| Errors\SDKException | 4XX, 5XX | \*/\* |
## getGenresLibrary
Retrieves a list of all the genres that are found for the media in this library.
### Example Usage
```php
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->library->getGenresLibrary(
sectionKey: 9518
);
if ($response->object !== null) {
// handle response
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
### Response
**[?Operations\GetGenresLibraryResponse](../../Models/Operations/GetGenresLibraryResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
| Errors\GetGenresLibraryBadRequest | 400 | application/json |
| Errors\GetGenresLibraryUnauthorized | 401 | application/json |
| Errors\SDKException | 4XX, 5XX | \*/\* |
## getLibraryDetails
## Library Details Endpoint
@@ -167,9 +271,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -238,18 +344,16 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetLibraryItemsRequest(
tag: Operations\Tag::Edition,
sectionKey: 9518,
includeGuids: Operations\IncludeGuids::Enable,
type: Operations\GetLibraryItemsQueryParamType::TvShow,
includeMeta: Operations\GetLibraryItemsQueryParamIncludeMeta::Enable,
xPlexContainerStart: 0,
xPlexContainerSize: 50,
);
$response = $sdk->library->getLibraryItems(
@@ -293,9 +397,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -341,9 +447,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetRecentlyAddedLibraryRequest(
type: Operations\QueryParamType::TvShow,
@@ -363,9 +471,6 @@ $request = new Operations\GetRecentlyAddedLibraryRequest(
17,
],
sectionID: 2,
includeMeta: Operations\QueryParamIncludeMeta::Enable,
xPlexContainerStart: 0,
xPlexContainerSize: 50,
);
$response = $sdk->library->getRecentlyAddedLibrary(
@@ -410,9 +515,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -461,9 +568,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetSearchAllLibrariesRequest(
query: '<value>',
@@ -471,8 +580,6 @@ $request = new Operations\GetSearchAllLibrariesRequest(
searchTypes: [
Operations\SearchTypes::People,
],
includeCollections: Operations\QueryParamIncludeCollections::Enable,
includeExternalMedia: Operations\QueryParamIncludeExternalMedia::Enable,
);
$response = $sdk->library->getSearchAllLibraries(
@@ -534,9 +641,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -583,9 +692,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -633,14 +744,16 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->library->getMetadataChildren(
ratingKey: 1539.15,
ratingKey: 1539.14,
includeElements: '<value>'
);
@@ -683,9 +796,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -725,9 +840,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -26,9 +26,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -68,9 +70,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -140,13 +144,15 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$request = 'level=4&message=Test%20message%201&source=postman
level=3&message=Test%20message%202&source=postman
level=1&message=Test%20message%203&source=postman';
$request = 'level=4&message=Test%20message%201&source=postman\n' .
'level=3&message=Test%20message%202&source=postman\n' .
'level=1&message=Test%20message%203&source=postman';
$response = $sdk->log->logMultiLine(
request: $request

View File

@@ -28,9 +28,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetBannerImageRequest(
ratingKey: 9518,
@@ -82,9 +84,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetThumbImageRequest(
ratingKey: 9518,
@@ -135,9 +139,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -181,9 +187,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -228,9 +236,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -36,14 +36,16 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->playlists->addPlaylistContents(
playlistID: 8502.00,
playlistID: 8502.01,
uri: 'server://12345/com.plexapp.plugins.library/library/metadata/1',
playQueueID: 123
@@ -88,9 +90,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -138,9 +142,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\CreatePlaylistRequest(
title: '<value>',
@@ -190,9 +196,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -238,9 +246,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -289,9 +299,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -339,9 +351,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -389,14 +403,16 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->playlists->updatePlaylist(
playlistID: 3915.00,
playlistID: 3915,
title: '<value>',
summary: '<value>'
@@ -442,9 +458,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -30,9 +30,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -84,9 +86,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -174,9 +178,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -318,9 +324,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -25,9 +25,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -83,15 +85,17 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->search->performSearch(
query: 'dylan',
sectionId: 9372.69,
sectionId: 9372.7,
limit: 5
);
@@ -138,15 +142,17 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->search->performVoiceSearch(
query: 'dead+poop',
sectionId: 4094.80,
sectionId: 4094.8,
limit: 5
);

View File

@@ -31,9 +31,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -114,9 +116,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -154,9 +158,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -194,9 +200,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -236,9 +244,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetResizedPhotoRequest(
width: 110,
@@ -290,9 +300,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -330,9 +342,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -370,9 +384,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -27,9 +27,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$filter = new Operations\QueryParamFilter();
@@ -80,9 +82,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -120,9 +124,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -160,9 +166,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -25,9 +25,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -71,9 +73,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -117,9 +121,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -28,9 +28,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -78,9 +80,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
@@ -124,9 +128,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();

View File

@@ -25,9 +25,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetTimelineRequest(
ratingKey: 23409,
@@ -83,9 +85,11 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\StartUniversalTranscodeRequest(
hasMDE: 1,

View File

@@ -24,15 +24,15 @@ require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$security = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()->setSecurity($security)->build();
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$request = new Operations\GetWatchListRequest(
filter: Operations\Filter::Available,
xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
xPlexContainerStart: 0,
xPlexContainerSize: 50,
);
$response = $sdk->watchlist->getWatchList(

View File

@@ -73,20 +73,16 @@ class Activities
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\CancelServerActivitiesResponse(
@@ -94,7 +90,7 @@ class Activities
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -106,7 +102,7 @@ class Activities
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -118,7 +114,9 @@ class Activities
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -150,20 +148,16 @@ class Activities
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -180,7 +174,7 @@ class Activities
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -192,7 +186,7 @@ class Activities
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -204,7 +198,9 @@ class Activities
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);

View File

@@ -86,20 +86,16 @@ class Authentication
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\GetSourceConnectionInformationResponse(
@@ -107,7 +103,7 @@ class Authentication
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -119,7 +115,7 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -131,7 +127,9 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -168,20 +166,16 @@ class Authentication
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -198,7 +192,7 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -210,7 +204,7 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -222,7 +216,9 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -264,20 +260,16 @@ class Authentication
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\GetTransientTokenResponse(
@@ -285,7 +277,7 @@ class Authentication
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -297,7 +289,7 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -309,7 +301,9 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -355,20 +349,16 @@ class Authentication
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 201) {
if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -385,7 +375,7 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -397,7 +387,7 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -409,7 +399,9 @@ class Authentication
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);

View File

@@ -69,20 +69,16 @@ class Butler
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -99,7 +95,7 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -111,7 +107,7 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -123,7 +119,9 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -160,20 +158,16 @@ class Butler
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\StartAllTasksResponse(
@@ -181,7 +175,7 @@ class Butler
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -193,7 +187,7 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -205,7 +199,9 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -246,20 +242,16 @@ class Butler
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if (in_array($statusCode, [200, 202])) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200', '202'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\StartTaskResponse(
@@ -267,7 +259,7 @@ class Butler
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -279,7 +271,7 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -291,7 +283,9 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -324,20 +318,16 @@ class Butler
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\StopAllTasksResponse(
@@ -345,7 +335,7 @@ class Butler
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -357,7 +347,7 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -369,7 +359,9 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -406,20 +398,16 @@ class Butler
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\StopTaskResponse(
@@ -427,7 +415,7 @@ class Butler
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -439,7 +427,7 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -451,7 +439,9 @@ class Butler
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);

View File

@@ -74,20 +74,16 @@ class Hubs
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -104,7 +100,9 @@ class Hubs
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -145,20 +143,16 @@ class Hubs
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -175,7 +169,7 @@ class Hubs
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -187,7 +181,7 @@ class Hubs
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -199,7 +193,9 @@ class Hubs
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -243,20 +239,16 @@ class Hubs
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -273,7 +265,7 @@ class Hubs
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -285,7 +277,7 @@ class Hubs
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -297,7 +289,9 @@ class Hubs
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);

View File

@@ -73,20 +73,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\DeleteLibraryResponse(
@@ -94,7 +90,7 @@ class Library
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -106,7 +102,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -118,7 +114,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -156,20 +154,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -186,7 +180,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -198,7 +192,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -210,7 +204,187 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
}
/**
* Get Countries of library media
*
* Retrieves a list of all the countries that are found for the media in this library.
*
*
* @param int $sectionKey
* @return Operations\GetCountriesLibraryResponse
* @throws \LukeHagar\Plex_API\Models\Errors\SDKException
*/
public function getCountriesLibrary(int $sectionKey, ?Options $options = null): Operations\GetCountriesLibraryResponse
{
$request = new Operations\GetCountriesLibraryRequest(
sectionKey: $sectionKey,
);
$baseUrl = Utils\Utils::templateUrl($this->sdkConfiguration->getServerUrl(), $this->sdkConfiguration->getServerDefaults());
$url = Utils\Utils::generateUrl($baseUrl, '/library/sections/{sectionKey}/country', Operations\GetCountriesLibraryRequest::class, $request);
$urlOverride = null;
$httpOptions = ['http_errors' => false];
$httpOptions['headers']['Accept'] = 'application/json';
$httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent;
$httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url);
$hookContext = new HookContext('get-countries-library', null, $this->sdkConfiguration->securitySource);
$httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest);
$httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions);
$httpRequest = Utils\Utils::removeHeaders($httpRequest);
try {
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
$httpResponse = $res;
}
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
$serializer = Utils\JSON::createSerializer();
$responseData = (string) $httpResponse->getBody();
$obj = $serializer->deserialize($responseData, '\LukeHagar\Plex_API\Models\Operations\GetCountriesLibraryResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
$response = new Operations\GetCountriesLibraryResponse(
statusCode: $statusCode,
contentType: $contentType,
rawResponse: $httpResponse,
object: $obj);
return $response;
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
$serializer = Utils\JSON::createSerializer();
$responseData = (string) $httpResponse->getBody();
$obj = $serializer->deserialize($responseData, '\LukeHagar\Plex_API\Models\Errors\GetCountriesLibraryBadRequest', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
$obj->rawResponse = $httpResponse;
throw $obj->toException();
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
$serializer = Utils\JSON::createSerializer();
$responseData = (string) $httpResponse->getBody();
$obj = $serializer->deserialize($responseData, '\LukeHagar\Plex_API\Models\Errors\GetCountriesLibraryUnauthorized', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
$obj->rawResponse = $httpResponse;
throw $obj->toException();
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
}
/**
* Get Genres of library media
*
* Retrieves a list of all the genres that are found for the media in this library.
*
*
* @param int $sectionKey
* @return Operations\GetGenresLibraryResponse
* @throws \LukeHagar\Plex_API\Models\Errors\SDKException
*/
public function getGenresLibrary(int $sectionKey, ?Options $options = null): Operations\GetGenresLibraryResponse
{
$request = new Operations\GetGenresLibraryRequest(
sectionKey: $sectionKey,
);
$baseUrl = Utils\Utils::templateUrl($this->sdkConfiguration->getServerUrl(), $this->sdkConfiguration->getServerDefaults());
$url = Utils\Utils::generateUrl($baseUrl, '/library/sections/{sectionKey}/genre', Operations\GetGenresLibraryRequest::class, $request);
$urlOverride = null;
$httpOptions = ['http_errors' => false];
$httpOptions['headers']['Accept'] = 'application/json';
$httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent;
$httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url);
$hookContext = new HookContext('get-genres-library', null, $this->sdkConfiguration->securitySource);
$httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest);
$httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions);
$httpRequest = Utils\Utils::removeHeaders($httpRequest);
try {
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
$httpResponse = $res;
}
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
$serializer = Utils\JSON::createSerializer();
$responseData = (string) $httpResponse->getBody();
$obj = $serializer->deserialize($responseData, '\LukeHagar\Plex_API\Models\Operations\GetGenresLibraryResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
$response = new Operations\GetGenresLibraryResponse(
statusCode: $statusCode,
contentType: $contentType,
rawResponse: $httpResponse,
object: $obj);
return $response;
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
$serializer = Utils\JSON::createSerializer();
$responseData = (string) $httpResponse->getBody();
$obj = $serializer->deserialize($responseData, '\LukeHagar\Plex_API\Models\Errors\GetGenresLibraryBadRequest', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
$obj->rawResponse = $httpResponse;
throw $obj->toException();
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
$serializer = Utils\JSON::createSerializer();
$responseData = (string) $httpResponse->getBody();
$obj = $serializer->deserialize($responseData, '\LukeHagar\Plex_API\Models\Errors\GetGenresLibraryUnauthorized', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
$obj->rawResponse = $httpResponse;
throw $obj->toException();
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -290,20 +464,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -320,7 +490,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -332,7 +502,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -344,7 +514,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -401,20 +573,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -431,7 +599,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -443,7 +611,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -455,7 +623,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -492,20 +662,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -522,7 +688,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -534,7 +700,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -546,7 +712,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -583,20 +751,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -613,7 +777,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -625,7 +789,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -637,7 +801,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -679,20 +845,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\GetRefreshLibraryMetadataResponse(
@@ -700,7 +862,7 @@ class Library
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -712,7 +874,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -724,7 +886,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -765,20 +929,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -795,7 +955,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -807,7 +967,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -819,7 +979,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -878,20 +1040,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -908,7 +1066,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -920,7 +1078,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -932,7 +1090,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -973,20 +1133,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\GetFileHashResponse(
@@ -994,7 +1150,7 @@ class Library
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1006,7 +1162,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1018,7 +1174,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -1060,20 +1218,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1090,7 +1244,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1102,7 +1256,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1114,7 +1268,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -1147,20 +1303,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1177,7 +1329,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1189,7 +1341,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1201,7 +1353,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -1243,20 +1397,16 @@ class Library
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1273,7 +1423,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1285,7 +1435,7 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -1297,7 +1447,9 @@ class Library
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);

View File

@@ -70,20 +70,16 @@ class Log
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\EnablePaperTrailResponse(
@@ -91,7 +87,7 @@ class Log
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -103,7 +99,7 @@ class Log
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -115,7 +111,9 @@ class Log
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 403 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['403', '4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -159,20 +157,16 @@ class Log
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\LogLineResponse(
@@ -180,7 +174,7 @@ class Log
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -192,7 +186,7 @@ class Log
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -204,7 +198,9 @@ class Log
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -263,20 +259,16 @@ class Log
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\LogMultiLineResponse(
@@ -284,7 +276,7 @@ class Log
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -296,7 +288,7 @@ class Log
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -308,7 +300,9 @@ class Log
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);

View File

@@ -77,20 +77,16 @@ class Media
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'image/jpeg')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -105,7 +101,7 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -117,7 +113,7 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -129,7 +125,9 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -169,20 +167,16 @@ class Media
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
if (Utils\Utils::matchContentType($contentType, 'image/jpeg')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -197,7 +191,7 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -209,7 +203,7 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -221,7 +215,9 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -260,20 +256,16 @@ class Media
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\MarkPlayedResponse(
@@ -281,7 +273,7 @@ class Media
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -293,7 +285,7 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -305,7 +297,9 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -344,20 +338,16 @@ class Media
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\MarkUnplayedResponse(
@@ -365,7 +355,7 @@ class Media
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -377,7 +367,7 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -389,7 +379,9 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
@@ -433,20 +425,16 @@ class Media
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';
$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '4XX', '5XX'])) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
$httpResponse = $res;
}
if ($statusCode == 200) {
if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
return new Operations\UpdatePlayProgressResponse(
@@ -454,7 +442,7 @@ class Media
contentType: $contentType,
rawResponse: $httpResponse
);
} elseif ($statusCode == 400) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -466,7 +454,7 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode == 401) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) {
if (Utils\Utils::matchContentType($contentType, 'application/json')) {
$httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);
@@ -478,7 +466,9 @@ class Media
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
} else {
throw new \LukeHagar\Plex_API\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);

View File

@@ -20,6 +20,7 @@ class Security
/**
* @param ?string $accessToken
* @phpstan-pure
*/
public function __construct(?string $accessToken = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** AddPlaylistContentsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class AddPlaylistContentsBadRequest
@@ -35,6 +34,7 @@ class AddPlaylistContentsBadRequest
/**
* @param ?array<AddPlaylistContentsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class AddPlaylistContentsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class AddPlaylistContentsPlaylistsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** AddPlaylistContentsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class AddPlaylistContentsUnauthorized
@@ -35,6 +34,7 @@ class AddPlaylistContentsUnauthorized
/**
* @param ?array<AddPlaylistContentsPlaylistsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** ApplyUpdatesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class ApplyUpdatesBadRequest
@@ -35,6 +34,7 @@ class ApplyUpdatesBadRequest
/**
* @param ?array<ApplyUpdatesErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class ApplyUpdatesErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** ApplyUpdatesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class ApplyUpdatesUnauthorized
@@ -35,6 +34,7 @@ class ApplyUpdatesUnauthorized
/**
* @param ?array<ApplyUpdatesUpdaterErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class ApplyUpdatesUpdaterErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class CancelServerActivitiesActivitiesErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** CancelServerActivitiesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class CancelServerActivitiesBadRequest
@@ -35,6 +34,7 @@ class CancelServerActivitiesBadRequest
/**
* @param ?array<CancelServerActivitiesErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class CancelServerActivitiesErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** CancelServerActivitiesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class CancelServerActivitiesUnauthorized
@@ -35,6 +34,7 @@ class CancelServerActivitiesUnauthorized
/**
* @param ?array<CancelServerActivitiesActivitiesErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** CheckForUpdatesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class CheckForUpdatesBadRequest
@@ -35,6 +34,7 @@ class CheckForUpdatesBadRequest
/**
* @param ?array<CheckForUpdatesErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class CheckForUpdatesErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** CheckForUpdatesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class CheckForUpdatesUnauthorized
@@ -35,6 +34,7 @@ class CheckForUpdatesUnauthorized
/**
* @param ?array<CheckForUpdatesUpdaterErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class CheckForUpdatesUpdaterErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** ClearPlaylistContentsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class ClearPlaylistContentsBadRequest
@@ -35,6 +34,7 @@ class ClearPlaylistContentsBadRequest
/**
* @param ?array<ClearPlaylistContentsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class ClearPlaylistContentsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class ClearPlaylistContentsPlaylistsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** ClearPlaylistContentsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class ClearPlaylistContentsUnauthorized
@@ -35,6 +34,7 @@ class ClearPlaylistContentsUnauthorized
/**
* @param ?array<ClearPlaylistContentsPlaylistsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** CreatePlaylistBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class CreatePlaylistBadRequest
@@ -35,6 +34,7 @@ class CreatePlaylistBadRequest
/**
* @param ?array<CreatePlaylistErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class CreatePlaylistErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class CreatePlaylistPlaylistsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** CreatePlaylistUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class CreatePlaylistUnauthorized
@@ -35,6 +34,7 @@ class CreatePlaylistUnauthorized
/**
* @param ?array<CreatePlaylistPlaylistsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** DeleteLibraryBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class DeleteLibraryBadRequest
@@ -35,6 +34,7 @@ class DeleteLibraryBadRequest
/**
* @param ?array<DeleteLibraryErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class DeleteLibraryErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class DeleteLibraryLibraryErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** DeleteLibraryUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class DeleteLibraryUnauthorized
@@ -35,6 +34,7 @@ class DeleteLibraryUnauthorized
/**
* @param ?array<DeleteLibraryLibraryErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** DeletePlaylistBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class DeletePlaylistBadRequest
@@ -35,6 +34,7 @@ class DeletePlaylistBadRequest
/**
* @param ?array<DeletePlaylistErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class DeletePlaylistErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class DeletePlaylistPlaylistsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** DeletePlaylistUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class DeletePlaylistUnauthorized
@@ -35,6 +34,7 @@ class DeletePlaylistUnauthorized
/**
* @param ?array<DeletePlaylistPlaylistsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** EnablePaperTrailBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class EnablePaperTrailBadRequest
@@ -35,6 +34,7 @@ class EnablePaperTrailBadRequest
/**
* @param ?array<EnablePaperTrailErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class EnablePaperTrailErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class EnablePaperTrailLogErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** EnablePaperTrailUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class EnablePaperTrailUnauthorized
@@ -35,6 +34,7 @@ class EnablePaperTrailUnauthorized
/**
* @param ?array<EnablePaperTrailLogErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class Errors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** GetAllLibrariesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class GetAllLibrariesBadRequest
@@ -35,6 +34,7 @@ class GetAllLibrariesBadRequest
/**
* @param ?array<GetAllLibrariesErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class GetAllLibrariesErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class GetAllLibrariesLibraryErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** GetAllLibrariesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class GetAllLibrariesUnauthorized
@@ -35,6 +34,7 @@ class GetAllLibrariesUnauthorized
/**
* @param ?array<GetAllLibrariesLibraryErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** GetAvailableClientsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class GetAvailableClientsBadRequest
@@ -35,6 +34,7 @@ class GetAvailableClientsBadRequest
/**
* @param ?array<GetAvailableClientsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class GetAvailableClientsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class GetAvailableClientsServerErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** GetAvailableClientsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class GetAvailableClientsUnauthorized
@@ -35,6 +34,7 @@ class GetAvailableClientsUnauthorized
/**
* @param ?array<GetAvailableClientsServerErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** GetBandwidthStatisticsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. */
class GetBandwidthStatisticsBadRequest
@@ -35,6 +34,7 @@ class GetBandwidthStatisticsBadRequest
/**
* @param ?array<GetBandwidthStatisticsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

View File

@@ -39,6 +39,7 @@ class GetBandwidthStatisticsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -39,6 +39,7 @@ class GetBandwidthStatisticsStatisticsErrors
* @param ?int $code
* @param ?string $message
* @param ?int $status
* @phpstan-pure
*/
public function __construct(?int $code = null, ?string $message = null, ?int $status = null)
{

View File

@@ -8,7 +8,6 @@ declare(strict_types=1);
namespace LukeHagar\Plex_API\Models\Errors;
use LukeHagar\Plex_API\Utils;
/** GetBandwidthStatisticsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */
class GetBandwidthStatisticsUnauthorized
@@ -35,6 +34,7 @@ class GetBandwidthStatisticsUnauthorized
/**
* @param ?array<GetBandwidthStatisticsStatisticsErrors> $errors
* @param ?\Psr\Http\Message\ResponseInterface $rawResponse
* @phpstan-pure
*/
public function __construct(?array $errors = null, ?\Psr\Http\Message\ResponseInterface $rawResponse = null)
{

Some files were not shown because too many files have changed in this diff Show More