ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.513.4

This commit is contained in:
speakeasybot
2025-03-08 00:10:00 +00:00
parent e95c490be0
commit a229d5202b
18 changed files with 195 additions and 111 deletions

File diff suppressed because one or more lines are too long

View File

@@ -7,13 +7,15 @@ generation:
useClassNamesForArrayFields: true useClassNamesForArrayFields: true
fixes: fixes:
nameResolutionDec2023: true nameResolutionDec2023: true
nameResolutionFeb2025: false
parameterOrderingFeb2024: true parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true requestResponseComponentNamesFeb2024: true
securityFeb2025: false
auth: auth:
oAuth2ClientCredentialsEnabled: false oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false oAuth2PasswordEnabled: false
php: php:
version: 0.13.0 version: 0.14.0
additionalDependencies: additionalDependencies:
autoload: {} autoload: {}
autoload-dev: {} autoload-dev: {}

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.488.0 speakeasyVersion: 1.513.4
sources: sources:
my-source: my-source:
sourceNamespace: my-source sourceNamespace: my-source
@@ -9,19 +9,19 @@ sources:
- main - main
plexapi: plexapi:
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:0efb9039972533bf1190dfc1ffb377429a8e486b6299442e732f662c1ffbeca6 sourceRevisionDigest: sha256:bf7001af017ce5072c503bfbaf60793f94549163b517489dc53e4f7b685659c0
sourceBlobDigest: sha256:038d73166cc9db17f514d511cfe4365ea032f4ebcb247fa86b7aa1bba0e1ab46 sourceBlobDigest: sha256:ed2b29043c84f32d2efa92a126083fd9a81644a7ce9c6ac86d9aeb3493cbd6f8
tags: tags:
- latest - latest
- speakeasy-sdk-regen-1739232598 - speakeasy-sdk-regen-1741392513
targets: targets:
plexphp: plexphp:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:0efb9039972533bf1190dfc1ffb377429a8e486b6299442e732f662c1ffbeca6 sourceRevisionDigest: sha256:bf7001af017ce5072c503bfbaf60793f94549163b517489dc53e4f7b685659c0
sourceBlobDigest: sha256:038d73166cc9db17f514d511cfe4365ea032f4ebcb247fa86b7aa1bba0e1ab46 sourceBlobDigest: sha256:ed2b29043c84f32d2efa92a126083fd9a81644a7ce9c6ac86d9aeb3493cbd6f8
codeSamplesNamespace: code-samples-php-plexphp codeSamplesNamespace: code-samples-php-plexphp
codeSamplesRevisionDigest: sha256:4ae9cce8da28704069c8a76f17d68fc0cd960200a362d8b4b8f7ac686242248a codeSamplesRevisionDigest: sha256:01eb8c50402af5d52e723a8b01100b282a41088adf944ba9887c06ded6a81c76
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest speakeasyVersion: latest

View File

@@ -307,6 +307,7 @@ declare(strict_types=1);
require 'vendor/autoload.php'; require 'vendor/autoload.php';
use LukeHagar\Plex_API; use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Errors;
$sdk = Plex_API\PlexAPI::builder() $sdk = Plex_API\PlexAPI::builder()
->setSecurity( ->setSecurity(
@@ -341,13 +342,45 @@ try {
### Server Variables ### 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: 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)` | Variable | BuilderMethod | Supported Values | Default | Description |
* `setPort(string port)` | ---------- | ----------------------------------------------- | -------------------------- | --------------- | ---------------------------------------------- |
| `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 ### 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 ```php
declare(strict_types=1); declare(strict_types=1);

View File

@@ -792,4 +792,14 @@ Based on:
### Generated ### Generated
- [php v0.13.0] . - [php v0.13.0] .
### Releases ### Releases
- [Composer v0.13.0] https://packagist.org/packages/lukehagar/plex-api#v0.13.0 - . - [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 - .

View File

@@ -563,7 +563,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: added label: get-recently-added
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -686,7 +686,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: identity label: get-server-identity
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -768,7 +768,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: data label: get-media-meta-data
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -811,7 +811,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: image label: get-banner-image
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -875,7 +875,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: image label: get-thumb-image
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -937,7 +937,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: library label: get-recently-added-library
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -983,7 +983,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: libraries label: get-search-all-libraries
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1017,7 +1017,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: libraries label: get-all-libraries
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1044,7 +1044,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: list label: get-watch-list
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1102,7 +1102,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: details label: get-library-details
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1132,7 +1132,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: library label: get-actors-library
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1162,7 +1162,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: library label: get-all-media-library
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1193,7 +1193,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: library label: get-countries-library
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1223,7 +1223,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: library label: get-genres-library
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1253,7 +1253,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: metadata label: get-refresh-library-metadata
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1283,7 +1283,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: library label: get-search-library
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1313,7 +1313,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: items label: get-library-items
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1432,7 +1432,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: providers label: get-media-providers
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -1848,7 +1848,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: resources label: get-server-resources
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -2297,7 +2297,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: users label: get-users
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);
@@ -2335,7 +2335,7 @@ actions:
update: update:
x-codeSamples: x-codeSamples:
- lang: php - lang: php
label: data label: post-users-sign-in-data
source: |- source: |-
declare(strict_types=1); declare(strict_types=1);

View File

@@ -11,7 +11,7 @@
"php": "^8.2", "php": "^8.2",
"galbar/jsonpath": "^3.0", "galbar/jsonpath": "^3.0",
"guzzlehttp/guzzle": "^7.0", "guzzlehttp/guzzle": "^7.0",
"speakeasy/serializer": "^4.0.0", "speakeasy/serializer": "^4.0.3",
"brick/date-time": "^0.7.0", "brick/date-time": "^0.7.0",
"phpdocumentor/type-resolver": "^1.8", "phpdocumentor/type-resolver": "^1.8",
"brick/math": "^0.12.1" "brick/math": "^0.12.1"

View File

@@ -22,7 +22,6 @@ Logged in user details
| `scrobbleTypes` | *string* | :heavy_check_mark: | Unknown | | | `scrobbleTypes` | *string* | :heavy_check_mark: | Unknown | |
| `services` | array<[Operations\Services](../../Models/Operations/Services.md)> | :heavy_check_mark: | N/A | | | `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 accounts Plex Pass subscription is active | | | `subscription` | [Operations\Subscription](../../Models/Operations/Subscription.md) | :heavy_check_mark: | If the accounts 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 | | `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 | | `title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle |
| `username` | *string* | :heavy_check_mark: | The account username | Username | | `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 | | | `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 | | | `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 | | | `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 | | | `twoFactorEnabled` | *?bool* | :heavy_minus_sign: | If two-factor authentication is enabled | |
| `attributionPartner` | *string* | :heavy_check_mark: | N/A | <nil> | | `attributionPartner` | *string* | :heavy_check_mark: | N/A | <nil> |
| `anonymous` | *?bool* | :heavy_minus_sign: | Unknown | | | `anonymous` | *?bool* | :heavy_minus_sign: | Unknown | |

View File

@@ -22,7 +22,6 @@ Returns the user account data with a valid auth token
| `scrobbleTypes` | *string* | :heavy_check_mark: | Unknown | | | `scrobbleTypes` | *string* | :heavy_check_mark: | Unknown | |
| `services` | array<[Operations\PostUsersSignInDataServices](../../Models/Operations/PostUsersSignInDataServices.md)> | :heavy_check_mark: | N/A | | | `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 accounts Plex Pass subscription is active | | | `subscription` | [Operations\PostUsersSignInDataSubscription](../../Models/Operations/PostUsersSignInDataSubscription.md) | :heavy_check_mark: | If the accounts 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 | | `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 | | `title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle |
| `username` | *string* | :heavy_check_mark: | The account username | Username | | `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 | | | `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 | | | `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 | | | `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 | | | `twoFactorEnabled` | *?bool* | :heavy_minus_sign: | If two-factor authentication is enabled | |
| `attributionPartner` | *string* | :heavy_check_mark: | N/A | <nil> | | `attributionPartner` | *string* | :heavy_check_mark: | N/A | <nil> |
| `anonymous` | *?bool* | :heavy_minus_sign: | Unknown | | | `anonymous` | *?bool* | :heavy_minus_sign: | Unknown | |

View File

@@ -136,15 +136,6 @@ class GetTokenDetailsUserPlexAccount
#[\Speakeasy\Serializer\Annotation\Type('\LukeHagar\Plex_API\Models\Operations\Subscription')] #[\Speakeasy\Serializer\Annotation\Type('\LukeHagar\Plex_API\Models\Operations\Subscription')]
public Subscription $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 * URL of the account thumbnail
* *
@@ -235,6 +226,16 @@ class GetTokenDetailsUserPlexAccount
#[\Speakeasy\Serializer\Annotation\SerializedName('subscriptionDescription')] #[\Speakeasy\Serializer\Annotation\SerializedName('subscriptionDescription')]
public ?string $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 * @var ?string $attributionPartner
@@ -375,7 +376,6 @@ class GetTokenDetailsUserPlexAccount
* @param string $scrobbleTypes * @param string $scrobbleTypes
* @param array<Services> $services * @param array<Services> $services
* @param Subscription $subscription * @param Subscription $subscription
* @param array<GetTokenDetailsSubscription> $subscriptions
* @param string $thumb * @param string $thumb
* @param string $title * @param string $title
* @param string $username * @param string $username
@@ -398,12 +398,13 @@ class GetTokenDetailsUserPlexAccount
* @param ?bool $restricted * @param ?bool $restricted
* @param ?array<string> $roles * @param ?array<string> $roles
* @param ?string $subscriptionDescription * @param ?string $subscriptionDescription
* @param ?array<GetTokenDetailsSubscription> $subscriptions
* @param ?bool $twoFactorEnabled * @param ?bool $twoFactorEnabled
* @param ?string $attributionPartner * @param ?string $attributionPartner
* @param ?bool $anonymous * @param ?bool $anonymous
* @phpstan-pure * @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->authToken = $authToken;
$this->country = $country; $this->country = $country;
@@ -420,7 +421,6 @@ class GetTokenDetailsUserPlexAccount
$this->scrobbleTypes = $scrobbleTypes; $this->scrobbleTypes = $scrobbleTypes;
$this->services = $services; $this->services = $services;
$this->subscription = $subscription; $this->subscription = $subscription;
$this->subscriptions = $subscriptions;
$this->thumb = $thumb; $this->thumb = $thumb;
$this->title = $title; $this->title = $title;
$this->username = $username; $this->username = $username;
@@ -432,6 +432,7 @@ class GetTokenDetailsUserPlexAccount
$this->pin = $pin; $this->pin = $pin;
$this->roles = $roles; $this->roles = $roles;
$this->subscriptionDescription = $subscriptionDescription; $this->subscriptionDescription = $subscriptionDescription;
$this->subscriptions = $subscriptions;
$this->attributionPartner = $attributionPartner; $this->attributionPartner = $attributionPartner;
$this->backupCodesCreated = $backupCodesCreated; $this->backupCodesCreated = $backupCodesCreated;
$this->confirmed = $confirmed; $this->confirmed = $confirmed;

View File

@@ -136,15 +136,6 @@ class PostUsersSignInDataUserPlexAccount
#[\Speakeasy\Serializer\Annotation\Type('\LukeHagar\Plex_API\Models\Operations\PostUsersSignInDataSubscription')] #[\Speakeasy\Serializer\Annotation\Type('\LukeHagar\Plex_API\Models\Operations\PostUsersSignInDataSubscription')]
public PostUsersSignInDataSubscription $subscription; 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 * URL of the account thumbnail
* *
@@ -253,6 +244,16 @@ class PostUsersSignInDataUserPlexAccount
#[\Speakeasy\Serializer\Annotation\SerializedName('subscriptionDescription')] #[\Speakeasy\Serializer\Annotation\SerializedName('subscriptionDescription')]
public ?string $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 * @var ?string $attributionPartner
@@ -393,7 +394,6 @@ class PostUsersSignInDataUserPlexAccount
* @param string $scrobbleTypes * @param string $scrobbleTypes
* @param array<PostUsersSignInDataServices> $services * @param array<PostUsersSignInDataServices> $services
* @param PostUsersSignInDataSubscription $subscription * @param PostUsersSignInDataSubscription $subscription
* @param array<PostUsersSignInDataAuthenticationSubscription> $subscriptions
* @param string $thumb * @param string $thumb
* @param string $title * @param string $title
* @param string $username * @param string $username
@@ -418,12 +418,13 @@ class PostUsersSignInDataUserPlexAccount
* @param ?bool $restricted * @param ?bool $restricted
* @param ?array<string> $roles * @param ?array<string> $roles
* @param ?string $subscriptionDescription * @param ?string $subscriptionDescription
* @param ?array<PostUsersSignInDataAuthenticationSubscription> $subscriptions
* @param ?bool $twoFactorEnabled * @param ?bool $twoFactorEnabled
* @param ?string $attributionPartner * @param ?string $attributionPartner
* @param ?bool $anonymous * @param ?bool $anonymous
* @phpstan-pure * @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->authToken = $authToken;
$this->country = $country; $this->country = $country;
@@ -440,7 +441,6 @@ class PostUsersSignInDataUserPlexAccount
$this->scrobbleTypes = $scrobbleTypes; $this->scrobbleTypes = $scrobbleTypes;
$this->services = $services; $this->services = $services;
$this->subscription = $subscription; $this->subscription = $subscription;
$this->subscriptions = $subscriptions;
$this->thumb = $thumb; $this->thumb = $thumb;
$this->title = $title; $this->title = $title;
$this->username = $username; $this->username = $username;
@@ -454,6 +454,7 @@ class PostUsersSignInDataUserPlexAccount
$this->pin = $pin; $this->pin = $pin;
$this->roles = $roles; $this->roles = $roles;
$this->subscriptionDescription = $subscriptionDescription; $this->subscriptionDescription = $subscriptionDescription;
$this->subscriptions = $subscriptions;
$this->attributionPartner = $attributionPartner; $this->attributionPartner = $attributionPartner;
$this->backupCodesCreated = $backupCodesCreated; $this->backupCodesCreated = $backupCodesCreated;
$this->confirmed = $confirmed; $this->confirmed = $confirmed;

View File

@@ -33,11 +33,11 @@ class SDKConfiguration
public string $openapiDocVersion = '0.0.3'; 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; public ?RetryConfig $retryConfig = null;

View File

@@ -58,7 +58,7 @@ class BigIntHandler implements SubscribingHandlerInterface
} }
/** @phpstan-ignore-next-line */ /** @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); return \Brick\Math\BigInteger::of($data);
} }

View File

@@ -82,5 +82,17 @@ class ParamsMetadata
dateTimeFormat: $dateTimeFormat, dateTimeFormat: $dateTimeFormat,
serializeToString: $serializeToString serializeToString: $serializeToString
); );
}
/**
* @return array<string,mixed>
*/
public function encodingArray(): array
{
return [
'dateTimeFormat' => $this->dateTimeFormat,
'serializeToString' => $this->serializeToString,
];
} }
} }

View File

@@ -71,9 +71,8 @@ class PathParameters
case 'object': case 'object':
$vals = []; $vals = [];
$cls = get_class($value); if ($value instanceof \Brick\Math\BigDecimal || $value instanceof \Brick\Math\BigInteger || $value instanceof \Brick\DateTime\LocalDate || $value instanceof \DateTime || $value instanceof \UnitEnum) {
if ($cls === 'Brick\\Math\\BigDecimal' || $cls === 'Brick\\Math\\BigInteger') { $pathParams[$metadata->name] = valToString($value, $metadata->encodingArray());
$pathParams[$metadata->name] = valToString($value, []);
break; break;
} }
foreach ($value as $field => $fieldValue) { /** @phpstan-ignore-line */ foreach ($value as $field => $fieldValue) { /** @phpstan-ignore-line */
@@ -87,9 +86,9 @@ class PathParameters
} }
if ($metadata->explode) { 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 { } else {
$vals[] = sprintf('%s,%s', $fieldMetadata->name, valToString($fieldValue, ['dateTimeFormat' => $fieldMetadata->dateTimeFormat])); $vals[] = sprintf('%s,%s', $fieldMetadata->name, valToString($fieldValue, $fieldMetadata->encodingArray()));
} }
} }

View File

@@ -50,7 +50,7 @@ class QueryParameters
$parts = array_merge($parts, $this->parseSerializationParams($metadata, $value)); $parts = array_merge($parts, $this->parseSerializationParams($metadata, $value));
} else { } else {
match ($metadata->style) { 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, ',')), 'form' => $parts = array_merge_recursive($parts, $this->parseDelimitedParams($metadata, $value, ',')),
'pipeDelimited' => $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), default => throw new \RuntimeException('Unsupported style '.$metadata->style),
@@ -89,44 +89,54 @@ class QueryParameters
* @param mixed $value * @param mixed $value
* @return array<string, array<int, string>|string> * @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 = []; $queryParams = [];
$dateTimeFormat = $metadata->dateTimeFormat; $dateTimeFormat = $metadata->dateTimeFormat;
switch (gettype($value)) { switch (gettype($value)) {
case 'object': 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 */ foreach ($value as $field => $val) { /** @phpstan-ignore-line */
if ($val === null) { if ($val === null) {
continue; continue;
} }
$fieldMetaData = $this->parseQueryParamsMetadata(new ReflectionProperty($value::class, $field)); $fieldMetadata = $this->parseQueryParamsMetadata(new ReflectionProperty($value::class, $field));
if ($fieldMetaData === null) {
if ($fieldMetadata === null) {
continue; continue;
} }
$dateTimeFormat = $fieldMetaData->dateTimeFormat;
$items = []; $items = [];
if (is_array($val) && array_is_list($val)) { if (is_array($val)) {
foreach ($val as $item) { $queryParams = array_merge($queryParams, $this->encodeDeepObjectParams($fieldMetadata, $val, $prefix));
$items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]); } elseif (is_object($val)) {
} $queryParams = array_merge($queryParams, $this->encodeDeepObjectParams($fieldMetadata, $val, $prefix));
} else { } else {
$queryParams[$metadata->name.'['.$fieldMetaData->name.']'] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]); $queryParams[$prefix.'['.$fieldMetadata->name.']'] = valToString($val, $fieldMetadata->encodingArray());
}
if (count($items) > 0) {
$queryParams[$metadata->name.'['.$fieldMetaData->name.']'] = $items;
} }
} }
break; break;
case 'array': case 'array':
if (! array_is_list($value)) { if (! array_is_list($value)) {
foreach ($value as $key => $val) { foreach ($value as $key => $val) {
$qpKey = $metadata->name.'['.$key.']';
if ($prefix) {
$qpKey = $prefix.'['.$metadata->name.']'.'['.$key.']';
}
if ($val === null) { if ($val === null) {
continue; continue;
} }
@@ -138,13 +148,25 @@ class QueryParameters
$items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]); $items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]);
} }
} else { } else {
$queryParams[$metadata->name.'['.$key.']'] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]); $queryParams[$qpKey] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]);
} }
if (count($items) > 0) { 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; break;
} }
@@ -167,9 +189,9 @@ class QueryParameters
switch (gettype($value)) { switch (gettype($value)) {
case 'object': case 'object':
$items = []; $items = [];
$cls = get_class($value);
if ($cls === 'Brick\\Math\\BigDecimal' || $cls === 'Brick\\Math\\BigInteger') { 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, []); $queryParams[$metadata->name] = valToString($value, $metadata->encodingArray());
break; break;
} }
foreach ($value as $field => $val) { /** @phpstan-ignore-line */ foreach ($value as $field => $val) { /** @phpstan-ignore-line */
@@ -177,17 +199,15 @@ class QueryParameters
continue; continue;
} }
$fieldMetaData = $this->parseQueryParamsMetadata(new ReflectionProperty($value::class, $field)); $fieldMetadata = $this->parseQueryParamsMetadata(new ReflectionProperty($value::class, $field));
if ($fieldMetaData === null) { if ($fieldMetadata === null) {
continue; continue;
} }
$dateTimeFormat = $fieldMetaData->dateTimeFormat;
if ($metadata->explode) { if ($metadata->explode) {
$queryParams[$fieldMetaData->name] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]); $queryParams[$fieldMetadata->name] = valToString($val, $fieldMetadata->encodingArray());
} else { } else {
$items[] = $fieldMetaData->name.$delimiter.valToString($val, ['dateTimeFormat' => $dateTimeFormat]); $items[] = $fieldMetadata->name.$delimiter.valToString($val, $fieldMetadata->encodingArray());
} }
} }

View File

@@ -173,6 +173,8 @@ final class UnionHandler implements SubscribingHandlerInterface
continue; continue;
} catch (\Brick\Math\Exception\NumberFormatException $e) { } catch (\Brick\Math\Exception\NumberFormatException $e) {
continue; continue;
} catch (\Brick\Math\Exception\RoundingNecessaryException $e) {
continue;
} catch (RuntimeException $e) { } catch (RuntimeException $e) {
continue; continue;
} }
@@ -342,6 +344,10 @@ final class UnionHandler implements SubscribingHandlerInterface
if ($type['params']) { if ($type['params']) {
uasort($type['params'], static function ($a, $b) { uasort($type['params'], static function ($a, $b) {
if (\class_exists($a['name']) && \class_exists($b['name'])) { 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']); $aClass = new \ReflectionClass($a['name']);
$bClass = new \ReflectionClass($b['name']); $bClass = new \ReflectionClass($b['name']);
$aRequiredPropertyCount = 0; $aRequiredPropertyCount = 0;

View File

@@ -111,7 +111,7 @@ class Utils
$type = $parts[0]; $type = $parts[0];
$subtype = $parts[1]; $subtype = $parts[1];
if ($pattern === '$type/*' || $pattern === '*/$subtype') { if ($pattern === "$type/*" || $pattern === "*/$subtype") {
return true; return true;
} }
} }
@@ -435,7 +435,7 @@ function valToString(mixed $val, array $extras): string
return '"'.$val->__toString().'"'; return '"'.$val->__toString().'"';
} }
return $val->__toString(); return (string) (float) $val->__toString();
default: default:
if (is_a($val, \BackedEnum::class, true)) { if (is_a($val, \BackedEnum::class, true)) {
$enumVal = $val->value; $enumVal = $val->value;
@@ -468,4 +468,4 @@ function populateGlobal(mixed $value, string $type, string $field, array $global
} }
return $value; return $value;
} }