mirror of
https://github.com/LukeHagar/plexphp.git
synced 2025-12-06 04:20:51 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.513.4
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -7,13 +7,15 @@ generation:
|
||||
useClassNamesForArrayFields: true
|
||||
fixes:
|
||||
nameResolutionDec2023: true
|
||||
nameResolutionFeb2025: false
|
||||
parameterOrderingFeb2024: true
|
||||
requestResponseComponentNamesFeb2024: true
|
||||
securityFeb2025: false
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: false
|
||||
oAuth2PasswordEnabled: false
|
||||
php:
|
||||
version: 0.13.0
|
||||
version: 0.14.0
|
||||
additionalDependencies:
|
||||
autoload: {}
|
||||
autoload-dev: {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.488.0
|
||||
speakeasyVersion: 1.513.4
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -9,19 +9,19 @@ sources:
|
||||
- main
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:0efb9039972533bf1190dfc1ffb377429a8e486b6299442e732f662c1ffbeca6
|
||||
sourceBlobDigest: sha256:038d73166cc9db17f514d511cfe4365ea032f4ebcb247fa86b7aa1bba0e1ab46
|
||||
sourceRevisionDigest: sha256:bf7001af017ce5072c503bfbaf60793f94549163b517489dc53e4f7b685659c0
|
||||
sourceBlobDigest: sha256:ed2b29043c84f32d2efa92a126083fd9a81644a7ce9c6ac86d9aeb3493cbd6f8
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1739232598
|
||||
- speakeasy-sdk-regen-1741392513
|
||||
targets:
|
||||
plexphp:
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:0efb9039972533bf1190dfc1ffb377429a8e486b6299442e732f662c1ffbeca6
|
||||
sourceBlobDigest: sha256:038d73166cc9db17f514d511cfe4365ea032f4ebcb247fa86b7aa1bba0e1ab46
|
||||
sourceRevisionDigest: sha256:bf7001af017ce5072c503bfbaf60793f94549163b517489dc53e4f7b685659c0
|
||||
sourceBlobDigest: sha256:ed2b29043c84f32d2efa92a126083fd9a81644a7ce9c6ac86d9aeb3493cbd6f8
|
||||
codeSamplesNamespace: code-samples-php-plexphp
|
||||
codeSamplesRevisionDigest: sha256:4ae9cce8da28704069c8a76f17d68fc0cd960200a362d8b4b8f7ac686242248a
|
||||
codeSamplesRevisionDigest: sha256:01eb8c50402af5d52e723a8b01100b282a41088adf944ba9887c06ded6a81c76
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
|
||||
41
README.md
41
README.md
@@ -307,6 +307,7 @@ declare(strict_types=1);
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
use LukeHagar\Plex_API\Models\Errors;
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setSecurity(
|
||||
@@ -341,13 +342,45 @@ try {
|
||||
### Server Variables
|
||||
|
||||
The default server `{protocol}://{ip}:{port}` contains variables and is set to `https://10.10.10.47:32400` by default. To override default values, the following builder methods are available when initializing the SDK client instance:
|
||||
* `setProtocol(Plex_API\ServerProtocol protocol)`
|
||||
* `setIp(string ip)`
|
||||
* `setPort(string port)`
|
||||
|
||||
| Variable | BuilderMethod | Supported Values | Default | Description |
|
||||
| ---------- | ----------------------------------------------- | -------------------------- | --------------- | ---------------------------------------------- |
|
||||
| `protocol` | `setProtocol(Plex_API\ServerProtocol protocol)` | - `"http"`<br/>- `"https"` | `"https"` | The protocol to use for the server connection |
|
||||
| `ip` | `setIp(string ip)` | string | `"10.10.10.47"` | The IP address or hostname of your Plex Server |
|
||||
| `port` | `setPort(string port)` | string | `"32400"` | The port of your Plex Server |
|
||||
|
||||
#### Example
|
||||
|
||||
```php
|
||||
declare(strict_types=1);
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use LukeHagar\Plex_API;
|
||||
|
||||
$sdk = Plex_API\PlexAPI::builder()
|
||||
->setProtocol('https')
|
||||
->setIp('247.38.141.142')
|
||||
->setPort('6717')
|
||||
->setSecurity(
|
||||
'<YOUR_API_KEY_HERE>'
|
||||
)
|
||||
->build();
|
||||
|
||||
|
||||
|
||||
$response = $sdk->server->getMediaProviders(
|
||||
xPlexToken: 'CV5xoxjTpFKUzBTShsaf'
|
||||
);
|
||||
|
||||
if ($response->object !== null) {
|
||||
// handle response
|
||||
}
|
||||
```
|
||||
|
||||
### Override Server URL Per-Client
|
||||
|
||||
The default server can also be overridden globally using the `setServerUrl(string $serverUrl)` builder method when initializing the SDK client instance. For example:
|
||||
The default server can be overridden globally using the `setServerUrl(string $serverUrl)` builder method when initializing the SDK client instance. For example:
|
||||
```php
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
10
RELEASES.md
10
RELEASES.md
@@ -793,3 +793,13 @@ Based on:
|
||||
- [php v0.13.0] .
|
||||
### Releases
|
||||
- [Composer v0.13.0] https://packagist.org/packages/lukehagar/plex-api#v0.13.0 - .
|
||||
|
||||
## 2025-03-08 00:08:18
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.513.4 (2.545.4) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [php v0.14.0] .
|
||||
### Releases
|
||||
- [Composer v0.14.0] https://packagist.org/packages/lukehagar/plex-api#v0.14.0 - .
|
||||
@@ -563,7 +563,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: added
|
||||
label: get-recently-added
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -686,7 +686,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: identity
|
||||
label: get-server-identity
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -768,7 +768,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: data
|
||||
label: get-media-meta-data
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -811,7 +811,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: image
|
||||
label: get-banner-image
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -875,7 +875,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: image
|
||||
label: get-thumb-image
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -937,7 +937,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: library
|
||||
label: get-recently-added-library
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -983,7 +983,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: libraries
|
||||
label: get-search-all-libraries
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1017,7 +1017,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: libraries
|
||||
label: get-all-libraries
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1044,7 +1044,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: list
|
||||
label: get-watch-list
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1102,7 +1102,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: details
|
||||
label: get-library-details
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1132,7 +1132,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: library
|
||||
label: get-actors-library
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1162,7 +1162,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: library
|
||||
label: get-all-media-library
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1193,7 +1193,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: library
|
||||
label: get-countries-library
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1223,7 +1223,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: library
|
||||
label: get-genres-library
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1253,7 +1253,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: metadata
|
||||
label: get-refresh-library-metadata
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1283,7 +1283,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: library
|
||||
label: get-search-library
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1313,7 +1313,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: items
|
||||
label: get-library-items
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1432,7 +1432,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: providers
|
||||
label: get-media-providers
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -1848,7 +1848,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: resources
|
||||
label: get-server-resources
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -2297,7 +2297,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: users
|
||||
label: get-users
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -2335,7 +2335,7 @@ actions:
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: php
|
||||
label: data
|
||||
label: post-users-sign-in-data
|
||||
source: |-
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"php": "^8.2",
|
||||
"galbar/jsonpath": "^3.0",
|
||||
"guzzlehttp/guzzle": "^7.0",
|
||||
"speakeasy/serializer": "^4.0.0",
|
||||
"speakeasy/serializer": "^4.0.3",
|
||||
"brick/date-time": "^0.7.0",
|
||||
"phpdocumentor/type-resolver": "^1.8",
|
||||
"brick/math": "^0.12.1"
|
||||
|
||||
@@ -22,7 +22,6 @@ Logged in user details
|
||||
| `scrobbleTypes` | *string* | :heavy_check_mark: | Unknown | |
|
||||
| `services` | array<[Operations\Services](../../Models/Operations/Services.md)> | :heavy_check_mark: | N/A | |
|
||||
| `subscription` | [Operations\Subscription](../../Models/Operations/Subscription.md) | :heavy_check_mark: | If the account’s Plex Pass subscription is active | |
|
||||
| `subscriptions` | array<[Operations\GetTokenDetailsSubscription](../../Models/Operations/GetTokenDetailsSubscription.md)> | :heavy_check_mark: | N/A | |
|
||||
| `thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101 |
|
||||
| `title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle |
|
||||
| `username` | *string* | :heavy_check_mark: | The account username | Username |
|
||||
@@ -45,6 +44,7 @@ Logged in user details
|
||||
| `restricted` | *?bool* | :heavy_minus_sign: | If the account is a Plex Home managed user | |
|
||||
| `roles` | array<*string*> | :heavy_minus_sign: | [Might be removed] List of account roles. Plexpass membership listed here | |
|
||||
| `subscriptionDescription` | *string* | :heavy_check_mark: | Description of the Plex Pass subscription | |
|
||||
| `subscriptions` | array<[Operations\GetTokenDetailsSubscription](../../Models/Operations/GetTokenDetailsSubscription.md)> | :heavy_minus_sign: | N/A | |
|
||||
| `twoFactorEnabled` | *?bool* | :heavy_minus_sign: | If two-factor authentication is enabled | |
|
||||
| `attributionPartner` | *string* | :heavy_check_mark: | N/A | <nil> |
|
||||
| `anonymous` | *?bool* | :heavy_minus_sign: | Unknown | |
|
||||
@@ -22,7 +22,6 @@ Returns the user account data with a valid auth token
|
||||
| `scrobbleTypes` | *string* | :heavy_check_mark: | Unknown | |
|
||||
| `services` | array<[Operations\PostUsersSignInDataServices](../../Models/Operations/PostUsersSignInDataServices.md)> | :heavy_check_mark: | N/A | |
|
||||
| `subscription` | [Operations\PostUsersSignInDataSubscription](../../Models/Operations/PostUsersSignInDataSubscription.md) | :heavy_check_mark: | If the account’s Plex Pass subscription is active | |
|
||||
| `subscriptions` | array<[Operations\PostUsersSignInDataAuthenticationSubscription](../../Models/Operations/PostUsersSignInDataAuthenticationSubscription.md)> | :heavy_check_mark: | N/A | |
|
||||
| `thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101 |
|
||||
| `title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle |
|
||||
| `username` | *string* | :heavy_check_mark: | The account username | Username |
|
||||
@@ -47,6 +46,7 @@ Returns the user account data with a valid auth token
|
||||
| `restricted` | *?bool* | :heavy_minus_sign: | If the account is a Plex Home managed user | |
|
||||
| `roles` | array<*string*> | :heavy_minus_sign: | [Might be removed] List of account roles. Plexpass membership listed here | |
|
||||
| `subscriptionDescription` | *string* | :heavy_check_mark: | Description of the Plex Pass subscription | |
|
||||
| `subscriptions` | array<[Operations\PostUsersSignInDataAuthenticationSubscription](../../Models/Operations/PostUsersSignInDataAuthenticationSubscription.md)> | :heavy_minus_sign: | N/A | |
|
||||
| `twoFactorEnabled` | *?bool* | :heavy_minus_sign: | If two-factor authentication is enabled | |
|
||||
| `attributionPartner` | *string* | :heavy_check_mark: | N/A | <nil> |
|
||||
| `anonymous` | *?bool* | :heavy_minus_sign: | Unknown | |
|
||||
@@ -136,15 +136,6 @@ class GetTokenDetailsUserPlexAccount
|
||||
#[\Speakeasy\Serializer\Annotation\Type('\LukeHagar\Plex_API\Models\Operations\Subscription')]
|
||||
public Subscription $subscription;
|
||||
|
||||
/**
|
||||
* $subscriptions
|
||||
*
|
||||
* @var array<GetTokenDetailsSubscription> $subscriptions
|
||||
*/
|
||||
#[\Speakeasy\Serializer\Annotation\SerializedName('subscriptions')]
|
||||
#[\Speakeasy\Serializer\Annotation\Type('array<\LukeHagar\Plex_API\Models\Operations\GetTokenDetailsSubscription>')]
|
||||
public array $subscriptions;
|
||||
|
||||
/**
|
||||
* URL of the account thumbnail
|
||||
*
|
||||
@@ -235,6 +226,16 @@ class GetTokenDetailsUserPlexAccount
|
||||
#[\Speakeasy\Serializer\Annotation\SerializedName('subscriptionDescription')]
|
||||
public ?string $subscriptionDescription;
|
||||
|
||||
/**
|
||||
* $subscriptions
|
||||
*
|
||||
* @var ?array<GetTokenDetailsSubscription> $subscriptions
|
||||
*/
|
||||
#[\Speakeasy\Serializer\Annotation\SerializedName('subscriptions')]
|
||||
#[\Speakeasy\Serializer\Annotation\Type('array<\LukeHagar\Plex_API\Models\Operations\GetTokenDetailsSubscription>|null')]
|
||||
#[\Speakeasy\Serializer\Annotation\SkipWhenNull]
|
||||
public ?array $subscriptions = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ?string $attributionPartner
|
||||
@@ -375,7 +376,6 @@ class GetTokenDetailsUserPlexAccount
|
||||
* @param string $scrobbleTypes
|
||||
* @param array<Services> $services
|
||||
* @param Subscription $subscription
|
||||
* @param array<GetTokenDetailsSubscription> $subscriptions
|
||||
* @param string $thumb
|
||||
* @param string $title
|
||||
* @param string $username
|
||||
@@ -398,12 +398,13 @@ class GetTokenDetailsUserPlexAccount
|
||||
* @param ?bool $restricted
|
||||
* @param ?array<string> $roles
|
||||
* @param ?string $subscriptionDescription
|
||||
* @param ?array<GetTokenDetailsSubscription> $subscriptions
|
||||
* @param ?bool $twoFactorEnabled
|
||||
* @param ?string $attributionPartner
|
||||
* @param ?bool $anonymous
|
||||
* @phpstan-pure
|
||||
*/
|
||||
public function __construct(string $authToken, string $country, string $email, string $friendlyName, array $entitlements, int $homeSize, int $id, int $joinedAt, MailingListStatus $mailingListStatus, int $maxHomeSize, UserProfile $profile, int $rememberExpiresAt, string $scrobbleTypes, array $services, Subscription $subscription, array $subscriptions, string $thumb, string $title, string $username, string $uuid, ?bool $adsConsent = null, ?int $adsConsentReminderAt = null, ?int $adsConsentSetAt = null, ?string $locale = null, ?string $pin = null, ?array $roles = null, ?string $subscriptionDescription = null, ?string $attributionPartner = null, ?bool $backupCodesCreated = false, ?bool $confirmed = false, ?bool $emailOnlyAuth = false, ?bool $experimentalFeatures = false, ?bool $guest = false, ?bool $hasPassword = true, ?bool $home = false, ?bool $homeAdmin = false, ?bool $mailingListActive = false, ?bool $protected = false, ?bool $restricted = false, ?bool $twoFactorEnabled = false, ?bool $anonymous = false)
|
||||
public function __construct(string $authToken, string $country, string $email, string $friendlyName, array $entitlements, int $homeSize, int $id, int $joinedAt, MailingListStatus $mailingListStatus, int $maxHomeSize, UserProfile $profile, int $rememberExpiresAt, string $scrobbleTypes, array $services, Subscription $subscription, string $thumb, string $title, string $username, string $uuid, ?bool $adsConsent = null, ?int $adsConsentReminderAt = null, ?int $adsConsentSetAt = null, ?string $locale = null, ?string $pin = null, ?array $roles = null, ?string $subscriptionDescription = null, ?array $subscriptions = null, ?string $attributionPartner = null, ?bool $backupCodesCreated = false, ?bool $confirmed = false, ?bool $emailOnlyAuth = false, ?bool $experimentalFeatures = false, ?bool $guest = false, ?bool $hasPassword = true, ?bool $home = false, ?bool $homeAdmin = false, ?bool $mailingListActive = false, ?bool $protected = false, ?bool $restricted = false, ?bool $twoFactorEnabled = false, ?bool $anonymous = false)
|
||||
{
|
||||
$this->authToken = $authToken;
|
||||
$this->country = $country;
|
||||
@@ -420,7 +421,6 @@ class GetTokenDetailsUserPlexAccount
|
||||
$this->scrobbleTypes = $scrobbleTypes;
|
||||
$this->services = $services;
|
||||
$this->subscription = $subscription;
|
||||
$this->subscriptions = $subscriptions;
|
||||
$this->thumb = $thumb;
|
||||
$this->title = $title;
|
||||
$this->username = $username;
|
||||
@@ -432,6 +432,7 @@ class GetTokenDetailsUserPlexAccount
|
||||
$this->pin = $pin;
|
||||
$this->roles = $roles;
|
||||
$this->subscriptionDescription = $subscriptionDescription;
|
||||
$this->subscriptions = $subscriptions;
|
||||
$this->attributionPartner = $attributionPartner;
|
||||
$this->backupCodesCreated = $backupCodesCreated;
|
||||
$this->confirmed = $confirmed;
|
||||
|
||||
@@ -136,15 +136,6 @@ class PostUsersSignInDataUserPlexAccount
|
||||
#[\Speakeasy\Serializer\Annotation\Type('\LukeHagar\Plex_API\Models\Operations\PostUsersSignInDataSubscription')]
|
||||
public PostUsersSignInDataSubscription $subscription;
|
||||
|
||||
/**
|
||||
* $subscriptions
|
||||
*
|
||||
* @var array<PostUsersSignInDataAuthenticationSubscription> $subscriptions
|
||||
*/
|
||||
#[\Speakeasy\Serializer\Annotation\SerializedName('subscriptions')]
|
||||
#[\Speakeasy\Serializer\Annotation\Type('array<\LukeHagar\Plex_API\Models\Operations\PostUsersSignInDataAuthenticationSubscription>')]
|
||||
public array $subscriptions;
|
||||
|
||||
/**
|
||||
* URL of the account thumbnail
|
||||
*
|
||||
@@ -253,6 +244,16 @@ class PostUsersSignInDataUserPlexAccount
|
||||
#[\Speakeasy\Serializer\Annotation\SerializedName('subscriptionDescription')]
|
||||
public ?string $subscriptionDescription;
|
||||
|
||||
/**
|
||||
* $subscriptions
|
||||
*
|
||||
* @var ?array<PostUsersSignInDataAuthenticationSubscription> $subscriptions
|
||||
*/
|
||||
#[\Speakeasy\Serializer\Annotation\SerializedName('subscriptions')]
|
||||
#[\Speakeasy\Serializer\Annotation\Type('array<\LukeHagar\Plex_API\Models\Operations\PostUsersSignInDataAuthenticationSubscription>|null')]
|
||||
#[\Speakeasy\Serializer\Annotation\SkipWhenNull]
|
||||
public ?array $subscriptions = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ?string $attributionPartner
|
||||
@@ -393,7 +394,6 @@ class PostUsersSignInDataUserPlexAccount
|
||||
* @param string $scrobbleTypes
|
||||
* @param array<PostUsersSignInDataServices> $services
|
||||
* @param PostUsersSignInDataSubscription $subscription
|
||||
* @param array<PostUsersSignInDataAuthenticationSubscription> $subscriptions
|
||||
* @param string $thumb
|
||||
* @param string $title
|
||||
* @param string $username
|
||||
@@ -418,12 +418,13 @@ class PostUsersSignInDataUserPlexAccount
|
||||
* @param ?bool $restricted
|
||||
* @param ?array<string> $roles
|
||||
* @param ?string $subscriptionDescription
|
||||
* @param ?array<PostUsersSignInDataAuthenticationSubscription> $subscriptions
|
||||
* @param ?bool $twoFactorEnabled
|
||||
* @param ?string $attributionPartner
|
||||
* @param ?bool $anonymous
|
||||
* @phpstan-pure
|
||||
*/
|
||||
public function __construct(string $authToken, string $country, string $email, string $friendlyName, array $entitlements, int $homeSize, int $id, int $joinedAt, PostUsersSignInDataMailingListStatus $mailingListStatus, int $maxHomeSize, PostUsersSignInDataUserProfile $profile, int $rememberExpiresAt, string $scrobbleTypes, array $services, PostUsersSignInDataSubscription $subscription, array $subscriptions, string $thumb, string $title, string $username, string $uuid, array $pastSubscriptions, array $trials, ?bool $adsConsent = null, ?int $adsConsentReminderAt = null, ?int $adsConsentSetAt = null, ?string $locale = null, ?string $pin = null, ?array $roles = null, ?string $subscriptionDescription = null, ?string $attributionPartner = null, ?bool $backupCodesCreated = false, ?bool $confirmed = false, ?bool $emailOnlyAuth = false, ?bool $experimentalFeatures = false, ?bool $guest = false, ?bool $hasPassword = true, ?bool $home = false, ?bool $homeAdmin = false, ?bool $mailingListActive = false, ?bool $protected = false, ?bool $restricted = false, ?bool $twoFactorEnabled = false, ?bool $anonymous = false)
|
||||
public function __construct(string $authToken, string $country, string $email, string $friendlyName, array $entitlements, int $homeSize, int $id, int $joinedAt, PostUsersSignInDataMailingListStatus $mailingListStatus, int $maxHomeSize, PostUsersSignInDataUserProfile $profile, int $rememberExpiresAt, string $scrobbleTypes, array $services, PostUsersSignInDataSubscription $subscription, string $thumb, string $title, string $username, string $uuid, array $pastSubscriptions, array $trials, ?bool $adsConsent = null, ?int $adsConsentReminderAt = null, ?int $adsConsentSetAt = null, ?string $locale = null, ?string $pin = null, ?array $roles = null, ?string $subscriptionDescription = null, ?array $subscriptions = null, ?string $attributionPartner = null, ?bool $backupCodesCreated = false, ?bool $confirmed = false, ?bool $emailOnlyAuth = false, ?bool $experimentalFeatures = false, ?bool $guest = false, ?bool $hasPassword = true, ?bool $home = false, ?bool $homeAdmin = false, ?bool $mailingListActive = false, ?bool $protected = false, ?bool $restricted = false, ?bool $twoFactorEnabled = false, ?bool $anonymous = false)
|
||||
{
|
||||
$this->authToken = $authToken;
|
||||
$this->country = $country;
|
||||
@@ -440,7 +441,6 @@ class PostUsersSignInDataUserPlexAccount
|
||||
$this->scrobbleTypes = $scrobbleTypes;
|
||||
$this->services = $services;
|
||||
$this->subscription = $subscription;
|
||||
$this->subscriptions = $subscriptions;
|
||||
$this->thumb = $thumb;
|
||||
$this->title = $title;
|
||||
$this->username = $username;
|
||||
@@ -454,6 +454,7 @@ class PostUsersSignInDataUserPlexAccount
|
||||
$this->pin = $pin;
|
||||
$this->roles = $roles;
|
||||
$this->subscriptionDescription = $subscriptionDescription;
|
||||
$this->subscriptions = $subscriptions;
|
||||
$this->attributionPartner = $attributionPartner;
|
||||
$this->backupCodesCreated = $backupCodesCreated;
|
||||
$this->confirmed = $confirmed;
|
||||
|
||||
@@ -33,11 +33,11 @@ class SDKConfiguration
|
||||
|
||||
public string $openapiDocVersion = '0.0.3';
|
||||
|
||||
public string $sdkVersion = '0.13.0';
|
||||
public string $sdkVersion = '0.14.0';
|
||||
|
||||
public string $genVersion = '2.506.0';
|
||||
public string $genVersion = '2.545.4';
|
||||
|
||||
public string $userAgent = 'speakeasy-sdk/php 0.13.0 2.506.0 0.0.3 lukehagar/plex-api';
|
||||
public string $userAgent = 'speakeasy-sdk/php 0.14.0 2.545.4 0.0.3 lukehagar/plex-api';
|
||||
|
||||
public ?RetryConfig $retryConfig = null;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class BigIntHandler implements SubscribingHandlerInterface
|
||||
}
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
public function deserialize(JsonDeserializationVisitor $visitor, string|int $data, array $type, Context $context): mixed
|
||||
public function deserialize(JsonDeserializationVisitor $visitor, mixed $data, array $type, Context $context): mixed
|
||||
{
|
||||
return \Brick\Math\BigInteger::of($data);
|
||||
}
|
||||
|
||||
@@ -82,5 +82,17 @@ class ParamsMetadata
|
||||
dateTimeFormat: $dateTimeFormat,
|
||||
serializeToString: $serializeToString
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
public function encodingArray(): array
|
||||
{
|
||||
return [
|
||||
'dateTimeFormat' => $this->dateTimeFormat,
|
||||
'serializeToString' => $this->serializeToString,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,9 +71,8 @@ class PathParameters
|
||||
case 'object':
|
||||
$vals = [];
|
||||
|
||||
$cls = get_class($value);
|
||||
if ($cls === 'Brick\\Math\\BigDecimal' || $cls === 'Brick\\Math\\BigInteger') {
|
||||
$pathParams[$metadata->name] = valToString($value, []);
|
||||
if ($value instanceof \Brick\Math\BigDecimal || $value instanceof \Brick\Math\BigInteger || $value instanceof \Brick\DateTime\LocalDate || $value instanceof \DateTime || $value instanceof \UnitEnum) {
|
||||
$pathParams[$metadata->name] = valToString($value, $metadata->encodingArray());
|
||||
break;
|
||||
}
|
||||
foreach ($value as $field => $fieldValue) { /** @phpstan-ignore-line */
|
||||
@@ -87,9 +86,9 @@ class PathParameters
|
||||
}
|
||||
|
||||
if ($metadata->explode) {
|
||||
$vals[] = sprintf('%s=%s', $fieldMetadata->name, valToString($fieldValue, ['dateTimeFormat' => $fieldMetadata->dateTimeFormat]));
|
||||
$vals[] = sprintf('%s=%s', $fieldMetadata->name, valToString($fieldValue, $fieldMetadata->encodingArray()));
|
||||
} else {
|
||||
$vals[] = sprintf('%s,%s', $fieldMetadata->name, valToString($fieldValue, ['dateTimeFormat' => $fieldMetadata->dateTimeFormat]));
|
||||
$vals[] = sprintf('%s,%s', $fieldMetadata->name, valToString($fieldValue, $fieldMetadata->encodingArray()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class QueryParameters
|
||||
$parts = array_merge($parts, $this->parseSerializationParams($metadata, $value));
|
||||
} else {
|
||||
match ($metadata->style) {
|
||||
'deepObject' => $parts = array_merge_recursive($parts, $this->parseDeepObjectParams($metadata, $value)),
|
||||
'deepObject' => $parts = array_merge_recursive($parts, $this->encodeDeepObjectParams($metadata, $value)),
|
||||
'form' => $parts = array_merge_recursive($parts, $this->parseDelimitedParams($metadata, $value, ',')),
|
||||
'pipeDelimited' => $parts = array_merge_recursive($parts, $this->parseDelimitedParams($metadata, $value, '|')),
|
||||
default => throw new \RuntimeException('Unsupported style '.$metadata->style),
|
||||
@@ -89,44 +89,54 @@ class QueryParameters
|
||||
* @param mixed $value
|
||||
* @return array<string, array<int, string>|string>
|
||||
*/
|
||||
private function parseDeepObjectParams(ParamsMetadata $metadata, mixed $value): array
|
||||
private function encodeDeepObjectParams(ParamsMetadata $metadata, mixed $value, ?string $prefix = null): array
|
||||
{
|
||||
$queryParams = [];
|
||||
|
||||
$dateTimeFormat = $metadata->dateTimeFormat;
|
||||
|
||||
switch (gettype($value)) {
|
||||
case 'object':
|
||||
if ($prefix) {
|
||||
$prefix = $prefix.'['.$metadata->name.']';
|
||||
} else {
|
||||
$prefix = $metadata->name;
|
||||
}
|
||||
if ($value instanceof \Brick\Math\BigDecimal || $value instanceof \Brick\Math\BigInteger || $value instanceof \Brick\DateTime\LocalDate || $value instanceof \DateTime || $value instanceof \UnitEnum) {
|
||||
$queryParams[$prefix] = valToString($value, $metadata->encodingArray());
|
||||
break;
|
||||
}
|
||||
foreach ($value as $field => $val) { /** @phpstan-ignore-line */
|
||||
if ($val === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fieldMetaData = $this->parseQueryParamsMetadata(new ReflectionProperty($value::class, $field));
|
||||
if ($fieldMetaData === null) {
|
||||
$fieldMetadata = $this->parseQueryParamsMetadata(new ReflectionProperty($value::class, $field));
|
||||
|
||||
|
||||
if ($fieldMetadata === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$dateTimeFormat = $fieldMetaData->dateTimeFormat;
|
||||
|
||||
$items = [];
|
||||
|
||||
if (is_array($val) && array_is_list($val)) {
|
||||
foreach ($val as $item) {
|
||||
$items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]);
|
||||
}
|
||||
if (is_array($val)) {
|
||||
$queryParams = array_merge($queryParams, $this->encodeDeepObjectParams($fieldMetadata, $val, $prefix));
|
||||
} elseif (is_object($val)) {
|
||||
$queryParams = array_merge($queryParams, $this->encodeDeepObjectParams($fieldMetadata, $val, $prefix));
|
||||
} else {
|
||||
$queryParams[$metadata->name.'['.$fieldMetaData->name.']'] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]);
|
||||
}
|
||||
|
||||
if (count($items) > 0) {
|
||||
$queryParams[$metadata->name.'['.$fieldMetaData->name.']'] = $items;
|
||||
$queryParams[$prefix.'['.$fieldMetadata->name.']'] = valToString($val, $fieldMetadata->encodingArray());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
if (! array_is_list($value)) {
|
||||
foreach ($value as $key => $val) {
|
||||
$qpKey = $metadata->name.'['.$key.']';
|
||||
if ($prefix) {
|
||||
$qpKey = $prefix.'['.$metadata->name.']'.'['.$key.']';
|
||||
}
|
||||
|
||||
if ($val === null) {
|
||||
continue;
|
||||
}
|
||||
@@ -138,13 +148,25 @@ class QueryParameters
|
||||
$items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]);
|
||||
}
|
||||
} else {
|
||||
$queryParams[$metadata->name.'['.$key.']'] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]);
|
||||
$queryParams[$qpKey] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]);
|
||||
}
|
||||
|
||||
if (count($items) > 0) {
|
||||
$queryParams[$metadata->name.'['.$key.']'] = $items;
|
||||
$queryParams[$qpKey] = $items;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$items = [];
|
||||
if ($prefix) {
|
||||
$qpKey = $prefix.'['.$metadata->name.']';
|
||||
} else {
|
||||
$qpKey = $metadata->name;
|
||||
}
|
||||
$count = 0;
|
||||
foreach ($value as $item) {
|
||||
$items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]);
|
||||
}
|
||||
$queryParams[$qpKey] = $items;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -167,9 +189,9 @@ class QueryParameters
|
||||
switch (gettype($value)) {
|
||||
case 'object':
|
||||
$items = [];
|
||||
$cls = get_class($value);
|
||||
if ($cls === 'Brick\\Math\\BigDecimal' || $cls === 'Brick\\Math\\BigInteger') {
|
||||
$queryParams[$metadata->name] = valToString($value, []);
|
||||
|
||||
if ($value instanceof \Brick\Math\BigDecimal || $value instanceof \Brick\Math\BigInteger || $value instanceof \Brick\DateTime\LocalDate || $value instanceof \DateTime || $value instanceof \UnitEnum) {
|
||||
$queryParams[$metadata->name] = valToString($value, $metadata->encodingArray());
|
||||
break;
|
||||
}
|
||||
foreach ($value as $field => $val) { /** @phpstan-ignore-line */
|
||||
@@ -177,17 +199,15 @@ class QueryParameters
|
||||
continue;
|
||||
}
|
||||
|
||||
$fieldMetaData = $this->parseQueryParamsMetadata(new ReflectionProperty($value::class, $field));
|
||||
if ($fieldMetaData === null) {
|
||||
$fieldMetadata = $this->parseQueryParamsMetadata(new ReflectionProperty($value::class, $field));
|
||||
if ($fieldMetadata === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$dateTimeFormat = $fieldMetaData->dateTimeFormat;
|
||||
|
||||
if ($metadata->explode) {
|
||||
$queryParams[$fieldMetaData->name] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]);
|
||||
$queryParams[$fieldMetadata->name] = valToString($val, $fieldMetadata->encodingArray());
|
||||
} else {
|
||||
$items[] = $fieldMetaData->name.$delimiter.valToString($val, ['dateTimeFormat' => $dateTimeFormat]);
|
||||
$items[] = $fieldMetadata->name.$delimiter.valToString($val, $fieldMetadata->encodingArray());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,8 @@ final class UnionHandler implements SubscribingHandlerInterface
|
||||
continue;
|
||||
} catch (\Brick\Math\Exception\NumberFormatException $e) {
|
||||
continue;
|
||||
} catch (\Brick\Math\Exception\RoundingNecessaryException $e) {
|
||||
continue;
|
||||
} catch (RuntimeException $e) {
|
||||
continue;
|
||||
}
|
||||
@@ -342,6 +344,10 @@ final class UnionHandler implements SubscribingHandlerInterface
|
||||
if ($type['params']) {
|
||||
uasort($type['params'], static function ($a, $b) {
|
||||
if (\class_exists($a['name']) && \class_exists($b['name'])) {
|
||||
/** always try BigInteger before trying BigDecimal */
|
||||
if ($a['name'] == '\Brick\Math\BigInteger' && $b['name'] == '\Brick\Math\BigDecimal') {
|
||||
return -1;
|
||||
}
|
||||
$aClass = new \ReflectionClass($a['name']);
|
||||
$bClass = new \ReflectionClass($b['name']);
|
||||
$aRequiredPropertyCount = 0;
|
||||
|
||||
@@ -111,7 +111,7 @@ class Utils
|
||||
$type = $parts[0];
|
||||
$subtype = $parts[1];
|
||||
|
||||
if ($pattern === '$type/*' || $pattern === '*/$subtype') {
|
||||
if ($pattern === "$type/*" || $pattern === "*/$subtype") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -435,7 +435,7 @@ function valToString(mixed $val, array $extras): string
|
||||
return '"'.$val->__toString().'"';
|
||||
}
|
||||
|
||||
return $val->__toString();
|
||||
return (string) (float) $val->__toString();
|
||||
default:
|
||||
if (is_a($val, \BackedEnum::class, true)) {
|
||||
$enumVal = $val->value;
|
||||
|
||||
Reference in New Issue
Block a user