diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 1f650b9e..a05be325 100755
--- a/.speakeasy/gen.lock
+++ b/.speakeasy/gen.lock
@@ -1,19 +1,19 @@
lockVersion: 2.0.0
id: 1732900d-e173-47c1-a90d-d45182eb35d9
management:
- docChecksum: 5e039359563b41bbe118fc6701ba22dc
+ docChecksum: e7673f3f46e5b0bf495c378378aa7ad6
docVersion: 0.0.3
- speakeasyVersion: 1.402.14
- generationVersion: 2.422.22
- releaseVersion: 0.5.0
- configChecksum: 1e077922ecb4295a2f75526fffe0b239
+ speakeasyVersion: 1.404.5
+ generationVersion: 2.426.2
+ releaseVersion: 0.6.0
+ configChecksum: 3170f0dc35d813b7d5122d31a2dfaf65
repoURL: https://github.com/LukeHagar/plexjava.git
published: true
features:
java:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.1
- core: 3.30.2
+ core: 3.30.3
deprecations: 2.81.1
downloadStreams: 0.1.1
enums: 2.81.2
@@ -28,6 +28,7 @@ features:
nameOverrides: 2.81.3
nullables: 0.1.0
sdkHooks: 0.1.0
+ tests: 0.1.0
generatedFiles:
- .gitattributes
- CONTRIBUTING.md
@@ -1713,6 +1714,22 @@ generatedFiles:
- src/main/java/dev/plexapi/sdk/utils/TypedObject.java
- src/main/java/dev/plexapi/sdk/utils/Types.java
- src/main/java/dev/plexapi/sdk/utils/Utils.java
+ - src/test/java/dev/plexapi/sdk/ActivitiesTests.java
+ - src/test/java/dev/plexapi/sdk/AuthenticationTests.java
+ - src/test/java/dev/plexapi/sdk/ButlerTests.java
+ - src/test/java/dev/plexapi/sdk/HubsTests.java
+ - src/test/java/dev/plexapi/sdk/LibraryTests.java
+ - src/test/java/dev/plexapi/sdk/LogTests.java
+ - src/test/java/dev/plexapi/sdk/MediaTests.java
+ - src/test/java/dev/plexapi/sdk/PlaylistsTests.java
+ - src/test/java/dev/plexapi/sdk/PlexTests.java
+ - src/test/java/dev/plexapi/sdk/SearchTests.java
+ - src/test/java/dev/plexapi/sdk/ServerTests.java
+ - src/test/java/dev/plexapi/sdk/SessionsTests.java
+ - src/test/java/dev/plexapi/sdk/StatisticsTests.java
+ - src/test/java/dev/plexapi/sdk/UpdaterTests.java
+ - src/test/java/dev/plexapi/sdk/VideoTests.java
+ - src/test/java/dev/plexapi/sdk/WatchlistTests.java
examples:
getServerCapabilities:
speakeasy-default-get-server-capabilities:
@@ -2045,7 +2062,12 @@ examples:
parameters:
path:
pinID: 408895
- query: {}
+ query:
+ X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40"
+ X-Plex-Product: "Plex Web"
+ X-Plex-Device: "Linux"
+ X-Plex-Version: "4.133.0"
+ X-Plex-Platform: "Chrome"
responses:
"200":
application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null}
@@ -2687,7 +2709,7 @@ examples:
speakeasy-default-get-token-details:
responses:
"200":
- application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null}
+ application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "active", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null}
"400":
application/json: {"errors": []}
"401":
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index e2d5082d..e22ca377 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
java:
- version: 0.5.0
+ version: 0.6.0
additionalDependencies: []
additionalPlugins: []
artifactID: plexapi
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 7cd94c58..a8cbaff6 100644
--- a/.speakeasy/workflow.lock
+++ b/.speakeasy/workflow.lock
@@ -1,4 +1,4 @@
-speakeasyVersion: 1.402.14
+speakeasyVersion: 1.404.5
sources:
my-source:
sourceNamespace: my-source
@@ -8,8 +8,8 @@ sources:
- latest
plexapi:
sourceNamespace: plexapi
- sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e
- sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e
+ sourceRevisionDigest: sha256:276a31ab98595ebaf2b1fac4b4f5c3c1c7b55e0431f9074c89b8fbcb55b52d3f
+ sourceBlobDigest: sha256:2bc9e816db669d609d8a5988ebb629578dc5cbbaff191d260b5c63b7ba1bd59b
tags:
- latest
- main
@@ -17,10 +17,10 @@ targets:
plexjava:
source: plexapi
sourceNamespace: plexapi
- sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e
- sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e
+ sourceRevisionDigest: sha256:276a31ab98595ebaf2b1fac4b4f5c3c1c7b55e0431f9074c89b8fbcb55b52d3f
+ sourceBlobDigest: sha256:2bc9e816db669d609d8a5988ebb629578dc5cbbaff191d260b5c63b7ba1bd59b
codeSamplesNamespace: code-samples-java-plexjava
- codeSamplesRevisionDigest: sha256:2b2011bee7f3ca4e29ec8c4fad1295a7c10ae37f6f6da7034d7aa919591f58ca
+ codeSamplesRevisionDigest: sha256:4286e602eb7c7bb7994a5820d46e703830d79724b86399aac3a75e9f2994c975
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
diff --git a/README.md b/README.md
index 77f6281d..497d2873 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,31 @@
## Summary
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
+
+# Plex Media Server OpenAPI Specification
+
+An Open Source OpenAPI Specification for Plex Media Server
+
+Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
+
+## Documentation
+
+[API Documentation](https://plexapi.dev)
+
+## SDKs
+
+The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.
+
+| Language | Repository | Releases | Other |
+| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
+| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
+| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
+| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
+| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
+| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
+| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
+| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
+| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
@@ -37,7 +62,7 @@ The samples below show how a published SDK artifact is used:
Gradle:
```groovy
-implementation 'dev.plexapi:plexapi:0.5.0'
+implementation 'dev.plexapi:plexapi:0.6.0'
```
Maven:
@@ -45,7 +70,7 @@ Maven:
dev.plexapi
plexapi
- 0.5.0
+ 0.6.0
```
@@ -458,7 +483,7 @@ public class Application {
.build();
GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
- .serverURL("https://plex.tv/api/v2/")
+ .serverURL("https://plex.tv/api/v2")
.call();
if (res.responseBodies().isPresent()) {
diff --git a/RELEASES.md b/RELEASES.md
index 092a3368..3cd50901 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -98,4 +98,14 @@ Based on:
### Generated
- [java v0.5.0] .
### Releases
-- [Maven Central v0.5.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.5.0 - .
\ No newline at end of file
+- [Maven Central v0.5.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.5.0 - .
+
+## 2024-09-28 00:25:08
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [java v0.6.0] .
+### Releases
+- [Maven Central v0.6.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.6.0 - .
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index d80b74ee..12651408 100644
--- a/build.gradle
+++ b/build.gradle
@@ -63,7 +63,7 @@ tasks.withType(Javadoc) {
}
group = "dev.plexapi"
-version = "0.5.0"
+version = "0.6.0"
sourcesJar {
archiveBaseName = "plexapi"
@@ -101,7 +101,7 @@ publishing {
maven(MavenPublication) {
groupId = 'dev.plexapi'
artifactId = 'plexapi'
- version = '0.5.0'
+ version = '0.6.0'
from components.java
@@ -152,6 +152,9 @@ dependencies {
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation 'org.apache.httpcomponents:httpmime:4.5.14'
implementation 'commons-io:commons-io:2.15.1'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
+ testImplementation 'org.mockito:mockito-core:5.12.0'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.2'
}
diff --git a/codeSamples.yaml b/codeSamples.yaml
index 6b5bcfc0..5b1b2bb0 100644
--- a/codeSamples.yaml
+++ b/codeSamples.yaml
@@ -1790,6 +1790,7 @@ actions:
import dev.plexapi.plexapi.PlexAPI;
import dev.plexapi.plexapi.models.errors.GetTokenByPinIdBadRequest;
import dev.plexapi.plexapi.models.errors.GetTokenByPinIdResponseBody;
+ import dev.plexapi.plexapi.models.operations.GetTokenByPinIdRequest;
import dev.plexapi.plexapi.models.operations.GetTokenByPinIdResponse;
import java.lang.Exception;
@@ -1805,8 +1806,12 @@ actions:
.deviceName("Linux")
.build();
- GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
+ GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder()
.pinID(408895L)
+ .build();
+
+ GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
+ .request(req)
.call();
if (res.authPinContainer().isPresent()) {
diff --git a/docs/models/operations/Connections.md b/docs/models/operations/Connections.md
index 58ec0219..b61c1f64 100644
--- a/docs/models/operations/Connections.md
+++ b/docs/models/operations/Connections.md
@@ -3,12 +3,12 @@
## Fields
-| Field | Type | Required | Description |
-| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
-| `protocol` | [Protocol](../../models/operations/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) |
-| `address` | *String* | :heavy_check_mark: | The (ip) address or domain name used for the connection |
-| `port` | *int* | :heavy_check_mark: | The port used for the connection |
-| `uri` | *String* | :heavy_check_mark: | The full URI of the connection |
-| `local` | *boolean* | :heavy_check_mark: | If the connection is local address |
-| `relay` | *boolean* | :heavy_check_mark: | If the connection is relayed through plex.direct |
-| `iPv6` | *boolean* | :heavy_check_mark: | If the connection is using IPv6 |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
+| `protocol` | [Protocol](../../models/operations/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | http |
+| `address` | *String* | :heavy_check_mark: | The (ip) address or domain name used for the connection | |
+| `port` | *int* | :heavy_check_mark: | The port used for the connection | |
+| `uri` | *String* | :heavy_check_mark: | The full URI of the connection | |
+| `local` | *boolean* | :heavy_check_mark: | If the connection is local address | |
+| `relay` | *boolean* | :heavy_check_mark: | If the connection is relayed through plex.direct | |
+| `iPv6` | *boolean* | :heavy_check_mark: | If the connection is using IPv6 | |
\ No newline at end of file
diff --git a/docs/models/operations/GetTokenByPinIdRequest.md b/docs/models/operations/GetTokenByPinIdRequest.md
index 54c97fd5..e9e22ea6 100644
--- a/docs/models/operations/GetTokenByPinIdRequest.md
+++ b/docs/models/operations/GetTokenByPinIdRequest.md
@@ -3,6 +3,11 @@
## Fields
-| Field | Type | Required | Description |
-| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
-| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | |
+| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 |
+| `clientName` | *Optional* | :heavy_minus_sign: | N/A | Plex Web |
+| `deviceName` | *Optional* | :heavy_minus_sign: | N/A | Linux |
+| `clientVersion` | *Optional* | :heavy_minus_sign: | N/A | 4.133.0 |
+| `clientPlatform` | *Optional* | :heavy_minus_sign: | N/A | Chrome |
\ No newline at end of file
diff --git a/docs/models/operations/GetTokenDetailsUserPlexAccount.md b/docs/models/operations/GetTokenDetailsUserPlexAccount.md
index 7d71ba6e..6a9ee402 100644
--- a/docs/models/operations/GetTokenDetailsUserPlexAccount.md
+++ b/docs/models/operations/GetTokenDetailsUserPlexAccount.md
@@ -29,7 +29,7 @@ Logged in user details
| `joinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `locale` | *Optional* | :heavy_check_mark: | The account locale | |
| `mailingListActive` | *Optional* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | |
-| `mailingListStatus` | [MailingListStatus](../../models/operations/MailingListStatus.md) | :heavy_check_mark: | Your current mailing list status | |
+| `mailingListStatus` | [MailingListStatus](../../models/operations/MailingListStatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active |
| `maxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 |
| ~~`pin`~~ | *Optional* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.
[Might be removed] The hashed Plex Home PIN | |
| `profile` | [UserProfile](../../models/operations/UserProfile.md) | :heavy_check_mark: | N/A | |
diff --git a/docs/models/operations/MailingListStatus.md b/docs/models/operations/MailingListStatus.md
index 272f38f6..3f0bbb3b 100644
--- a/docs/models/operations/MailingListStatus.md
+++ b/docs/models/operations/MailingListStatus.md
@@ -1,6 +1,6 @@
# MailingListStatus
-Your current mailing list status
+Your current mailing list status (active or unsubscribed)
## Values
diff --git a/docs/models/operations/PostUsersSignInDataMailingListStatus.md b/docs/models/operations/PostUsersSignInDataMailingListStatus.md
index a01308ed..04b21d0d 100644
--- a/docs/models/operations/PostUsersSignInDataMailingListStatus.md
+++ b/docs/models/operations/PostUsersSignInDataMailingListStatus.md
@@ -1,6 +1,6 @@
# PostUsersSignInDataMailingListStatus
-Your current mailing list status
+Your current mailing list status (active or unsubscribed)
## Values
diff --git a/docs/models/operations/PostUsersSignInDataUserPlexAccount.md b/docs/models/operations/PostUsersSignInDataUserPlexAccount.md
index 722da9f3..decd690b 100644
--- a/docs/models/operations/PostUsersSignInDataUserPlexAccount.md
+++ b/docs/models/operations/PostUsersSignInDataUserPlexAccount.md
@@ -29,7 +29,7 @@ Returns the user account data with a valid auth token
| `joinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `locale` | *Optional* | :heavy_check_mark: | The account locale | |
| `mailingListActive` | *Optional* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | |
-| `mailingListStatus` | [PostUsersSignInDataMailingListStatus](../../models/operations/PostUsersSignInDataMailingListStatus.md) | :heavy_check_mark: | Your current mailing list status | |
+| `mailingListStatus` | [PostUsersSignInDataMailingListStatus](../../models/operations/PostUsersSignInDataMailingListStatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active |
| `maxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 |
| ~~`pin`~~ | *Optional* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.
[Might be removed] The hashed Plex Home PIN | |
| `profile` | [PostUsersSignInDataUserProfile](../../models/operations/PostUsersSignInDataUserProfile.md) | :heavy_check_mark: | N/A | |
diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md
index 994b0a05..465d30fc 100644
--- a/docs/sdks/plex/README.md
+++ b/docs/sdks/plex/README.md
@@ -375,6 +375,7 @@ package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetTokenByPinIdBadRequest;
import dev.plexapi.sdk.models.errors.GetTokenByPinIdResponseBody;
+import dev.plexapi.sdk.models.operations.GetTokenByPinIdRequest;
import dev.plexapi.sdk.models.operations.GetTokenByPinIdResponse;
import java.lang.Exception;
@@ -390,8 +391,12 @@ public class Application {
.deviceName("Linux")
.build();
- GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
+ GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder()
.pinID(408895L)
+ .build();
+
+ GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
+ .request(req)
.call();
if (res.authPinContainer().isPresent()) {
@@ -403,10 +408,10 @@ public class Application {
### Parameters
-| Parameter | Type | Required | Description |
-| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
-| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for |
-| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
+| Parameter | Type | Required | Description |
+| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
+| `request` | [GetTokenByPinIdRequest](../../models/operations/GetTokenByPinIdRequest.md) | :heavy_check_mark: | The request object to use for the request. |
+| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md
index 2fd26ab8..0821a84c 100644
--- a/docs/sdks/plexapi/README.md
+++ b/docs/sdks/plexapi/README.md
@@ -2,4 +2,27 @@
## Overview
-Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
\ No newline at end of file
+# Plex Media Server OpenAPI Specification
+
+An Open Source OpenAPI Specification for Plex Media Server
+
+Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
+
+## Documentation
+
+[API Documentation](https://plexapi.dev)
+
+## SDKs
+
+The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.
+
+| Language | Repository | Releases | Other |
+| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
+| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
+| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
+| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
+| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
+| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
+| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
+| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
+| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
diff --git a/src/main/java/dev/plexapi/sdk/Authentication.java b/src/main/java/dev/plexapi/sdk/Authentication.java
index 5a500e7e..6114fde2 100644
--- a/src/main/java/dev/plexapi/sdk/Authentication.java
+++ b/src/main/java/dev/plexapi/sdk/Authentication.java
@@ -62,14 +62,14 @@ public class Authentication implements
* GET_TOKEN_DETAILS_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_TOKEN_DETAILS_SERVERS = {
- "https://plex.tv/api/v2/",
+ "https://plex.tv/api/v2",
};
/**
* POST_USERS_SIGN_IN_DATA_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] POST_USERS_SIGN_IN_DATA_SERVERS = {
- "https://plex.tv/api/v2/",
+ "https://plex.tv/api/v2",
};
private final SDKConfiguration sdkConfiguration;
diff --git a/src/main/java/dev/plexapi/sdk/Plex.java b/src/main/java/dev/plexapi/sdk/Plex.java
index 0ed09434..d673de05 100644
--- a/src/main/java/dev/plexapi/sdk/Plex.java
+++ b/src/main/java/dev/plexapi/sdk/Plex.java
@@ -79,42 +79,42 @@ public class Plex implements
* GET_COMPANIONS_DATA_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_COMPANIONS_DATA_SERVERS = {
- "https://plex.tv/api/v2/",
+ "https://plex.tv/api/v2",
};
/**
* GET_USER_FRIENDS_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_USER_FRIENDS_SERVERS = {
- "https://plex.tv/api/v2/",
+ "https://plex.tv/api/v2",
};
/**
* GET_GEO_DATA_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_GEO_DATA_SERVERS = {
- "https://plex.tv/api/v2/",
+ "https://plex.tv/api/v2",
};
/**
* GET_SERVER_RESOURCES_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_SERVER_RESOURCES_SERVERS = {
- "https://plex.tv/api/v2/",
+ "https://plex.tv/api/v2",
};
/**
* GET_PIN_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_PIN_SERVERS = {
- "https://plex.tv/api/v2/",
+ "https://plex.tv/api/v2",
};
/**
* GET_TOKEN_BY_PIN_ID_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_TOKEN_BY_PIN_ID_SERVERS = {
- "https://plex.tv/api/v2/",
+ "https://plex.tv/api/v2",
};
private final SDKConfiguration sdkConfiguration;
@@ -1096,32 +1096,26 @@ public GetTokenByPinIdRequestBuilder getTokenByPinId() {
/**
* Get Access Token by PinId
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
- * @param pinID The PinID to retrieve an access token for
+ * @param request The request object containing all of the parameters for the API call.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetTokenByPinIdResponse getTokenByPinId(
- long pinID) throws Exception {
- return getTokenByPinId(pinID, Optional.empty());
+ GetTokenByPinIdRequest request) throws Exception {
+ return getTokenByPinId(request, Optional.empty());
}
/**
* Get Access Token by PinId
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
- * @param pinID The PinID to retrieve an access token for
+ * @param request The request object containing all of the parameters for the API call.
* @param serverURL Overrides the server URL.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetTokenByPinIdResponse getTokenByPinId(
- long pinID,
+ GetTokenByPinIdRequest request,
Optional serverURL) throws Exception {
- GetTokenByPinIdRequest request =
- GetTokenByPinIdRequest
- .builder()
- .pinID(pinID)
- .build();
-
String _baseUrl = Utils.templateUrl(GET_TOKEN_BY_PIN_ID_SERVERS[0], new HashMap());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
@@ -1137,6 +1131,11 @@ public GetTokenByPinIdResponse getTokenByPinId(
.addHeader("user-agent",
SDKConfiguration.USER_AGENT);
+ _req.addQueryParams(Utils.getQueryParams(
+ GetTokenByPinIdRequest.class,
+ request,
+ this.sdkConfiguration.globals));
+
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
diff --git a/src/main/java/dev/plexapi/sdk/PlexAPI.java b/src/main/java/dev/plexapi/sdk/PlexAPI.java
index 99cc2daf..2d6106ba 100644
--- a/src/main/java/dev/plexapi/sdk/PlexAPI.java
+++ b/src/main/java/dev/plexapi/sdk/PlexAPI.java
@@ -16,6 +16,31 @@
/**
* Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
+ * # Plex Media Server OpenAPI Specification
+ *
+ * An Open Source OpenAPI Specification for Plex Media Server
+ *
+ * Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
+ *
+ * ## Documentation
+ *
+ * [API Documentation](https://plexapi.dev)
+ *
+ * ## SDKs
+ *
+ * The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.
+ *
+ * | Language | Repository | Releases | Other |
+ * | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
+ * | Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
+ * | JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
+ * | Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
+ * | Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
+ * | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
+ * | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
+ * | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
+ * | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
+ *
*/
public class PlexAPI {
diff --git a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java
index 6eb66e1e..5fbf8fe3 100644
--- a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java
+++ b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java
@@ -36,8 +36,8 @@ public Optional securitySource() {
} };
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "0.0.3";
- public static final String SDK_VERSION = "0.5.0";
- public static final String GEN_VERSION = "2.422.22";
+ public static final String SDK_VERSION = "0.6.0";
+ public static final String GEN_VERSION = "2.426.2";
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
public static final String USER_AGENT =
String.format("speakeasy-sdk/%s %s %s %s %s",
diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java
index 17c8a081..a1fb9983 100644
--- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java
+++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java
@@ -13,6 +13,7 @@
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
+import java.util.Optional;
public class GetTokenByPinIdRequest {
@@ -23,11 +24,52 @@ public class GetTokenByPinIdRequest {
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=pinID")
private long pinID;
+ /**
+ * The unique identifier for the client application
+ * This is used to track the client application and its usage
+ * (UUID, serial number, or other number unique per device)
+ *
+ */
+ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")
+ private Optional clientID;
+
+ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product")
+ private Optional clientName;
+
+ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device")
+ private Optional deviceName;
+
+ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version")
+ private Optional clientVersion;
+
+ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform")
+ private Optional clientPlatform;
+
@JsonCreator
public GetTokenByPinIdRequest(
- long pinID) {
+ long pinID,
+ Optional clientID,
+ Optional clientName,
+ Optional deviceName,
+ Optional clientVersion,
+ Optional clientPlatform) {
Utils.checkNotNull(pinID, "pinID");
+ Utils.checkNotNull(clientID, "clientID");
+ Utils.checkNotNull(clientName, "clientName");
+ Utils.checkNotNull(deviceName, "deviceName");
+ Utils.checkNotNull(clientVersion, "clientVersion");
+ Utils.checkNotNull(clientPlatform, "clientPlatform");
this.pinID = pinID;
+ this.clientID = clientID;
+ this.clientName = clientName;
+ this.deviceName = deviceName;
+ this.clientVersion = clientVersion;
+ this.clientPlatform = clientPlatform;
+ }
+
+ public GetTokenByPinIdRequest(
+ long pinID) {
+ this(pinID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
}
/**
@@ -38,6 +80,37 @@ public long pinID() {
return pinID;
}
+ /**
+ * The unique identifier for the client application
+ * This is used to track the client application and its usage
+ * (UUID, serial number, or other number unique per device)
+ *
+ */
+ @JsonIgnore
+ public Optional clientID() {
+ return clientID;
+ }
+
+ @JsonIgnore
+ public Optional clientName() {
+ return clientName;
+ }
+
+ @JsonIgnore
+ public Optional deviceName() {
+ return deviceName;
+ }
+
+ @JsonIgnore
+ public Optional clientVersion() {
+ return clientVersion;
+ }
+
+ @JsonIgnore
+ public Optional clientPlatform() {
+ return clientPlatform;
+ }
+
public final static Builder builder() {
return new Builder();
}
@@ -50,6 +123,78 @@ public GetTokenByPinIdRequest withPinID(long pinID) {
this.pinID = pinID;
return this;
}
+
+ /**
+ * The unique identifier for the client application
+ * This is used to track the client application and its usage
+ * (UUID, serial number, or other number unique per device)
+ *
+ */
+ public GetTokenByPinIdRequest withClientID(String clientID) {
+ Utils.checkNotNull(clientID, "clientID");
+ this.clientID = Optional.ofNullable(clientID);
+ return this;
+ }
+
+ /**
+ * The unique identifier for the client application
+ * This is used to track the client application and its usage
+ * (UUID, serial number, or other number unique per device)
+ *
+ */
+ public GetTokenByPinIdRequest withClientID(Optional clientID) {
+ Utils.checkNotNull(clientID, "clientID");
+ this.clientID = clientID;
+ return this;
+ }
+
+ public GetTokenByPinIdRequest withClientName(String clientName) {
+ Utils.checkNotNull(clientName, "clientName");
+ this.clientName = Optional.ofNullable(clientName);
+ return this;
+ }
+
+ public GetTokenByPinIdRequest withClientName(Optional clientName) {
+ Utils.checkNotNull(clientName, "clientName");
+ this.clientName = clientName;
+ return this;
+ }
+
+ public GetTokenByPinIdRequest withDeviceName(String deviceName) {
+ Utils.checkNotNull(deviceName, "deviceName");
+ this.deviceName = Optional.ofNullable(deviceName);
+ return this;
+ }
+
+ public GetTokenByPinIdRequest withDeviceName(Optional deviceName) {
+ Utils.checkNotNull(deviceName, "deviceName");
+ this.deviceName = deviceName;
+ return this;
+ }
+
+ public GetTokenByPinIdRequest withClientVersion(String clientVersion) {
+ Utils.checkNotNull(clientVersion, "clientVersion");
+ this.clientVersion = Optional.ofNullable(clientVersion);
+ return this;
+ }
+
+ public GetTokenByPinIdRequest withClientVersion(Optional clientVersion) {
+ Utils.checkNotNull(clientVersion, "clientVersion");
+ this.clientVersion = clientVersion;
+ return this;
+ }
+
+ public GetTokenByPinIdRequest withClientPlatform(String clientPlatform) {
+ Utils.checkNotNull(clientPlatform, "clientPlatform");
+ this.clientPlatform = Optional.ofNullable(clientPlatform);
+ return this;
+ }
+
+ public GetTokenByPinIdRequest withClientPlatform(Optional clientPlatform) {
+ Utils.checkNotNull(clientPlatform, "clientPlatform");
+ this.clientPlatform = clientPlatform;
+ return this;
+ }
@Override
public boolean equals(java.lang.Object o) {
@@ -61,24 +206,49 @@ public boolean equals(java.lang.Object o) {
}
GetTokenByPinIdRequest other = (GetTokenByPinIdRequest) o;
return
- Objects.deepEquals(this.pinID, other.pinID);
+ Objects.deepEquals(this.pinID, other.pinID) &&
+ Objects.deepEquals(this.clientID, other.clientID) &&
+ Objects.deepEquals(this.clientName, other.clientName) &&
+ Objects.deepEquals(this.deviceName, other.deviceName) &&
+ Objects.deepEquals(this.clientVersion, other.clientVersion) &&
+ Objects.deepEquals(this.clientPlatform, other.clientPlatform);
}
@Override
public int hashCode() {
return Objects.hash(
- pinID);
+ pinID,
+ clientID,
+ clientName,
+ deviceName,
+ clientVersion,
+ clientPlatform);
}
@Override
public String toString() {
return Utils.toString(GetTokenByPinIdRequest.class,
- "pinID", pinID);
+ "pinID", pinID,
+ "clientID", clientID,
+ "clientName", clientName,
+ "deviceName", deviceName,
+ "clientVersion", clientVersion,
+ "clientPlatform", clientPlatform);
}
public final static class Builder {
- private Long pinID;
+ private Long pinID;
+
+ private Optional clientID = Optional.empty();
+
+ private Optional clientName = Optional.empty();
+
+ private Optional deviceName = Optional.empty();
+
+ private Optional clientVersion = Optional.empty();
+
+ private Optional clientPlatform = Optional.empty();
private Builder() {
// force use of static builder() method
@@ -92,10 +262,87 @@ public Builder pinID(long pinID) {
this.pinID = pinID;
return this;
}
+
+ /**
+ * The unique identifier for the client application
+ * This is used to track the client application and its usage
+ * (UUID, serial number, or other number unique per device)
+ *
+ */
+ public Builder clientID(String clientID) {
+ Utils.checkNotNull(clientID, "clientID");
+ this.clientID = Optional.ofNullable(clientID);
+ return this;
+ }
+
+ /**
+ * The unique identifier for the client application
+ * This is used to track the client application and its usage
+ * (UUID, serial number, or other number unique per device)
+ *
+ */
+ public Builder clientID(Optional clientID) {
+ Utils.checkNotNull(clientID, "clientID");
+ this.clientID = clientID;
+ return this;
+ }
+
+ public Builder clientName(String clientName) {
+ Utils.checkNotNull(clientName, "clientName");
+ this.clientName = Optional.ofNullable(clientName);
+ return this;
+ }
+
+ public Builder clientName(Optional clientName) {
+ Utils.checkNotNull(clientName, "clientName");
+ this.clientName = clientName;
+ return this;
+ }
+
+ public Builder deviceName(String deviceName) {
+ Utils.checkNotNull(deviceName, "deviceName");
+ this.deviceName = Optional.ofNullable(deviceName);
+ return this;
+ }
+
+ public Builder deviceName(Optional deviceName) {
+ Utils.checkNotNull(deviceName, "deviceName");
+ this.deviceName = deviceName;
+ return this;
+ }
+
+ public Builder clientVersion(String clientVersion) {
+ Utils.checkNotNull(clientVersion, "clientVersion");
+ this.clientVersion = Optional.ofNullable(clientVersion);
+ return this;
+ }
+
+ public Builder clientVersion(Optional clientVersion) {
+ Utils.checkNotNull(clientVersion, "clientVersion");
+ this.clientVersion = clientVersion;
+ return this;
+ }
+
+ public Builder clientPlatform(String clientPlatform) {
+ Utils.checkNotNull(clientPlatform, "clientPlatform");
+ this.clientPlatform = Optional.ofNullable(clientPlatform);
+ return this;
+ }
+
+ public Builder clientPlatform(Optional clientPlatform) {
+ Utils.checkNotNull(clientPlatform, "clientPlatform");
+ this.clientPlatform = clientPlatform;
+ return this;
+ }
public GetTokenByPinIdRequest build() {
return new GetTokenByPinIdRequest(
- pinID);
+ pinID,
+ clientID,
+ clientName,
+ deviceName,
+ clientVersion,
+ clientPlatform);
}
}
}
diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java
index 9e564bf6..d0d0b1d8 100644
--- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java
+++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java
@@ -5,13 +5,12 @@
package dev.plexapi.sdk.models.operations;
import dev.plexapi.sdk.utils.Utils;
-import java.lang.Long;
import java.lang.String;
import java.util.Optional;
public class GetTokenByPinIdRequestBuilder {
- private Long pinID;
+ private GetTokenByPinIdRequest request;
private Optional serverURL = Optional.empty();
private final SDKMethodInterfaces.MethodCallGetTokenByPinId sdk;
@@ -19,9 +18,9 @@ public GetTokenByPinIdRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenByPin
this.sdk = sdk;
}
- public GetTokenByPinIdRequestBuilder pinID(long pinID) {
- Utils.checkNotNull(pinID, "pinID");
- this.pinID = pinID;
+ public GetTokenByPinIdRequestBuilder request(GetTokenByPinIdRequest request) {
+ Utils.checkNotNull(request, "request");
+ this.request = request;
return this;
}
@@ -40,7 +39,7 @@ public GetTokenByPinIdRequestBuilder serverURL(Optional serverURL) {
public GetTokenByPinIdResponse call() throws Exception {
return sdk.getTokenByPinId(
- pinID,
+ request,
serverURL);
}
}
diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java
index ef2c281e..a9960e23 100644
--- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java
+++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java
@@ -179,7 +179,7 @@ public class GetTokenDetailsUserPlexAccount {
private Optional mailingListActive;
/**
- * Your current mailing list status
+ * Your current mailing list status (active or unsubscribed)
*/
@JsonProperty("mailingListStatus")
private MailingListStatus mailingListStatus;
@@ -617,7 +617,7 @@ public Optional mailingListActive() {
}
/**
- * Your current mailing list status
+ * Your current mailing list status (active or unsubscribed)
*/
@JsonIgnore
public MailingListStatus mailingListStatus() {
@@ -1088,7 +1088,7 @@ public GetTokenDetailsUserPlexAccount withMailingListActive(Optional ma
}
/**
- * Your current mailing list status
+ * Your current mailing list status (active or unsubscribed)
*/
public GetTokenDetailsUserPlexAccount withMailingListStatus(MailingListStatus mailingListStatus) {
Utils.checkNotNull(mailingListStatus, "mailingListStatus");
@@ -1869,7 +1869,7 @@ public Builder mailingListActive(Optional mailingListActive) {
}
/**
- * Your current mailing list status
+ * Your current mailing list status (active or unsubscribed)
*/
public Builder mailingListStatus(MailingListStatus mailingListStatus) {
Utils.checkNotNull(mailingListStatus, "mailingListStatus");
diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MailingListStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/MailingListStatus.java
index e12942c3..9a216c5d 100644
--- a/src/main/java/dev/plexapi/sdk/models/operations/MailingListStatus.java
+++ b/src/main/java/dev/plexapi/sdk/models/operations/MailingListStatus.java
@@ -8,7 +8,7 @@
import java.lang.String;
/**
- * MailingListStatus - Your current mailing list status
+ * MailingListStatus - Your current mailing list status (active or unsubscribed)
*/
public enum MailingListStatus {
ACTIVE("active"),
diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java
index 4ed60d9b..8b71c92e 100644
--- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java
+++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java
@@ -8,7 +8,7 @@
import java.lang.String;
/**
- * PostUsersSignInDataMailingListStatus - Your current mailing list status
+ * PostUsersSignInDataMailingListStatus - Your current mailing list status (active or unsubscribed)
*/
public enum PostUsersSignInDataMailingListStatus {
ACTIVE("active"),
diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java
index 59609e55..c6bb7e6c 100644
--- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java
+++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java
@@ -179,7 +179,7 @@ public class PostUsersSignInDataUserPlexAccount {
private Optional mailingListActive;
/**
- * Your current mailing list status
+ * Your current mailing list status (active or unsubscribed)
*/
@JsonProperty("mailingListStatus")
private PostUsersSignInDataMailingListStatus mailingListStatus;
@@ -631,7 +631,7 @@ public Optional mailingListActive() {
}
/**
- * Your current mailing list status
+ * Your current mailing list status (active or unsubscribed)
*/
@JsonIgnore
public PostUsersSignInDataMailingListStatus mailingListStatus() {
@@ -1112,7 +1112,7 @@ public PostUsersSignInDataUserPlexAccount withMailingListActive(Optional mailingListActive) {
}
/**
- * Your current mailing list status
+ * Your current mailing list status (active or unsubscribed)
*/
public Builder mailingListStatus(PostUsersSignInDataMailingListStatus mailingListStatus) {
Utils.checkNotNull(mailingListStatus, "mailingListStatus");
diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java b/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java
index 200ed351..820666aa 100644
--- a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java
+++ b/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java
@@ -183,7 +183,7 @@ GetPinResponse getPin(
public interface MethodCallGetTokenByPinId {
GetTokenByPinIdResponse getTokenByPinId(
- long pinID,
+ GetTokenByPinIdRequest request,
Optional serverURL) throws Exception;
}
diff --git a/src/test/java/dev/plexapi/sdk/ActivitiesTests.java b/src/test/java/dev/plexapi/sdk/ActivitiesTests.java
new file mode 100644
index 00000000..c6f8cba3
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/ActivitiesTests.java
@@ -0,0 +1,56 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import dev.plexapi.sdk.models.operations.CancelServerActivitiesResponse;
+import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse;
+import java.lang.Exception;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class ActivitiesTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testActivities_GetServerActivities() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetServerActivitiesResponse res = sdk.activities().getServerActivities()
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testActivities_CancelServerActivities_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities()
+ .activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
+ .call();
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/AuthenticationTests.java b/src/test/java/dev/plexapi/sdk/AuthenticationTests.java
new file mode 100644
index 00000000..997a9b92
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/AuthenticationTests.java
@@ -0,0 +1,441 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.AutoSelectSubtitle;
+import dev.plexapi.sdk.models.operations.Billing;
+import dev.plexapi.sdk.models.operations.DefaultSubtitleAccessibility;
+import dev.plexapi.sdk.models.operations.DefaultSubtitleForced;
+import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationResponse;
+import dev.plexapi.sdk.models.operations.GetTokenDetailsAuthenticationResponseStatus;
+import dev.plexapi.sdk.models.operations.GetTokenDetailsAuthenticationStatus;
+import dev.plexapi.sdk.models.operations.GetTokenDetailsResponse;
+import dev.plexapi.sdk.models.operations.GetTokenDetailsStatus;
+import dev.plexapi.sdk.models.operations.GetTokenDetailsSubscription;
+import dev.plexapi.sdk.models.operations.GetTokenDetailsUserPlexAccount;
+import dev.plexapi.sdk.models.operations.GetTransientTokenQueryParamType;
+import dev.plexapi.sdk.models.operations.GetTransientTokenResponse;
+import dev.plexapi.sdk.models.operations.InternalPaymentMethod;
+import dev.plexapi.sdk.models.operations.MailingListStatus;
+import dev.plexapi.sdk.models.operations.MediaReviewsVisibility;
+import dev.plexapi.sdk.models.operations.PastSubscription;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataAuthenticationResponseStatus;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataAuthenticationStatus;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataAuthenticationSubscription;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataAutoSelectSubtitle;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataDefaultSubtitleAccessibility;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataDefaultSubtitleForced;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataMailingListStatus;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataMediaReviewsVisibility;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequest;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequestBody;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataServices;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataState;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataStatus;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataSubscription;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserProfile;
+import dev.plexapi.sdk.models.operations.PostUsersSignInDataWatchedIndicator;
+import dev.plexapi.sdk.models.operations.Scope;
+import dev.plexapi.sdk.models.operations.Services;
+import dev.plexapi.sdk.models.operations.Subscription;
+import dev.plexapi.sdk.models.operations.Trials;
+import dev.plexapi.sdk.models.operations.UserProfile;
+import dev.plexapi.sdk.models.operations.WatchedIndicator;
+import java.lang.Exception;
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.Optional;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class AuthenticationTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testAuthentication_GetTransientToken() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetTransientTokenResponse res = sdk.authentication().getTransientToken()
+ .type(GetTransientTokenQueryParamType.DELEGATION)
+ .scope(Scope.ALL)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testAuthentication_GetSourceConnectionInformation() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation()
+ .source("server://client-identifier")
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testAuthentication_GetTokenDetails() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetTokenDetailsResponse res = sdk.authentication().getTokenDetails()
+ .call();
+
+ assertEquals(
+ GetTokenDetailsUserPlexAccount.builder()
+ .adsConsent(false)
+ .adsConsentReminderAt(OffsetDateTime.parse("2022-06-24T05:32:09.341Z"))
+ .adsConsentSetAt(OffsetDateTime.parse("2022-05-01T23:18:27.767Z"))
+ .authToken("CxoUzBTSV5hsxjTpFKaf")
+ .country("US")
+ .email("username@email.com")
+ .friendlyName("friendlyUsername")
+ .entitlements(List.of(
+ "[]"))
+ .homeSize(1)
+ .id(13692262)
+ .joinedAt(1556281940L)
+ .locale("sv")
+ .mailingListStatus(MailingListStatus.ACTIVE)
+ .maxHomeSize(15)
+ .profile(UserProfile.builder()
+ .defaultAudioLanguage("ja")
+ .defaultSubtitleLanguage("en")
+ .autoSelectAudio(true)
+ .autoSelectSubtitle(AutoSelectSubtitle.Enable)
+ .defaultSubtitleAccessibility(DefaultSubtitleAccessibility.Enable)
+ .defaultSubtitleForced(DefaultSubtitleForced.Enable)
+ .watchedIndicator(WatchedIndicator.Enable)
+ .mediaReviewsVisibility(MediaReviewsVisibility.Enable)
+ .build())
+ .rememberExpiresAt(1556281940L)
+ .scrobbleTypes("")
+ .services(List.of(
+ Services.builder()
+ .identifier("metadata-dev")
+ .endpoint("https://epg.provider.plex.tv")
+ .token("DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv")
+ .secret("")
+ .status(GetTokenDetailsStatus.ONLINE)
+ .build()))
+ .subscription(Subscription.builder()
+ .active(true)
+ .subscribedAt("2021-04-12T18:21:12Z")
+ .status(GetTokenDetailsAuthenticationStatus.INACTIVE)
+ .build())
+ .subscriptionDescription("")
+ .subscriptions(List.of(
+ GetTokenDetailsSubscription.builder()
+ .active(true)
+ .subscribedAt("2021-04-12T18:21:12Z")
+ .status(GetTokenDetailsAuthenticationResponseStatus.INACTIVE)
+ .build()))
+ .thumb("https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101")
+ .title("UsernameTitle")
+ .username("Username")
+ .uuid("dae343c1f45beb4f")
+ .attributionPartner(Optional.empty())
+ .anonymous(false)
+ .backupCodesCreated(false)
+ .confirmed(false)
+ .emailOnlyAuth(false)
+ .experimentalFeatures(false)
+ .guest(false)
+ .hasPassword(true)
+ .home(false)
+ .homeAdmin(false)
+ .mailingListActive(false)
+ .pin("string")
+ .protected_(false)
+ .restricted(false)
+ .roles(List.of(
+ "string"))
+ .twoFactorEnabled(false)
+ .build(),
+ res.userPlexAccount().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testAuthentication_PostUsersSignInData() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder()
+ .requestBody(PostUsersSignInDataRequestBody.builder()
+ .login("username@email.com")
+ .password("password123")
+ .verificationCode("123456")
+ .build())
+ .build();
+
+ PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData()
+ .request(req)
+ .call();
+
+ assertEquals(
+ PostUsersSignInDataUserPlexAccount.builder()
+ .adsConsent(false)
+ .adsConsentReminderAt(OffsetDateTime.parse("2022-06-01T10:45:51.668Z"))
+ .adsConsentSetAt(OffsetDateTime.parse("2022-08-04T10:54:08.790Z"))
+ .authToken("CxoUzBTSV5hsxjTpFKaf")
+ .country("US")
+ .email("username@email.com")
+ .friendlyName("friendlyUsername")
+ .entitlements(List.of(
+ "[]"))
+ .homeSize(1)
+ .id(13692262)
+ .joinedAt(1556281940L)
+ .locale("ja")
+ .mailingListStatus(PostUsersSignInDataMailingListStatus.ACTIVE)
+ .maxHomeSize(15)
+ .profile(PostUsersSignInDataUserProfile.builder()
+ .defaultAudioLanguage("ja")
+ .defaultSubtitleLanguage("en")
+ .autoSelectAudio(true)
+ .autoSelectSubtitle(PostUsersSignInDataAutoSelectSubtitle.Enable)
+ .defaultSubtitleAccessibility(PostUsersSignInDataDefaultSubtitleAccessibility.Enable)
+ .defaultSubtitleForced(PostUsersSignInDataDefaultSubtitleForced.Enable)
+ .watchedIndicator(PostUsersSignInDataWatchedIndicator.Enable)
+ .mediaReviewsVisibility(PostUsersSignInDataMediaReviewsVisibility.Enable)
+ .build())
+ .rememberExpiresAt(1556281940L)
+ .scrobbleTypes("")
+ .services(List.of(
+ PostUsersSignInDataServices.builder()
+ .identifier("metadata-dev")
+ .endpoint("https://epg.provider.plex.tv")
+ .token("DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv")
+ .secret("")
+ .status(PostUsersSignInDataStatus.ONLINE)
+ .build()))
+ .subscription(PostUsersSignInDataSubscription.builder()
+ .active(true)
+ .subscribedAt("2021-04-12T18:21:12Z")
+ .status(PostUsersSignInDataAuthenticationStatus.INACTIVE)
+ .build())
+ .subscriptionDescription("")
+ .subscriptions(List.of(
+ PostUsersSignInDataAuthenticationSubscription.builder()
+ .active(true)
+ .subscribedAt("2021-04-12T18:21:12Z")
+ .status(PostUsersSignInDataAuthenticationResponseStatus.INACTIVE)
+ .build()))
+ .thumb("https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101")
+ .title("UsernameTitle")
+ .username("Username")
+ .uuid("dae343c1f45beb4f")
+ .attributionPartner(Optional.empty())
+ .pastSubscriptions(List.of(
+ PastSubscription.builder()
+ .id("")
+ .mode("")
+ .renewsAt(1556281940L)
+ .endsAt(1556281940L)
+ .type("plexpass")
+ .transfer("")
+ .state(PostUsersSignInDataState.ENDED)
+ .billing(Billing.builder()
+ .internalPaymentMethod(InternalPaymentMethod.builder()
+ .build())
+ .paymentMethodId(820994L)
+ .build())
+ .canceled(false)
+ .gracePeriod(false)
+ .onHold(false)
+ .canReactivate(false)
+ .canUpgrade(false)
+ .canDowngrade(false)
+ .canConvert(false)
+ .build()))
+ .trials(List.of(
+ Trials.builder()
+ .build()))
+ .anonymous(false)
+ .backupCodesCreated(false)
+ .confirmed(false)
+ .emailOnlyAuth(false)
+ .experimentalFeatures(false)
+ .guest(false)
+ .hasPassword(true)
+ .home(false)
+ .homeAdmin(false)
+ .mailingListActive(false)
+ .pin("string")
+ .protected_(false)
+ .restricted(false)
+ .roles(List.of(
+ "string"))
+ .twoFactorEnabled(false)
+ .build(),
+ res.userPlexAccount().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testAuthentication_PostUsersSignInData_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder()
+ .requestBody(PostUsersSignInDataRequestBody.builder()
+ .login("username@email.com")
+ .password("password123")
+ .verificationCode("123456")
+ .build())
+ .build();
+
+ PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData()
+ .request(req)
+ .call();
+
+ assertEquals(
+ PostUsersSignInDataUserPlexAccount.builder()
+ .adsConsent(false)
+ .adsConsentReminderAt(OffsetDateTime.parse("2022-04-17T10:09:07.050Z"))
+ .adsConsentSetAt(OffsetDateTime.parse("2024-07-07T09:18:10.249Z"))
+ .authToken("CxoUzBTSV5hsxjTpFKaf")
+ .country("US")
+ .email("username@email.com")
+ .friendlyName("friendlyUsername")
+ .entitlements(List.of(
+ "[]"))
+ .homeSize(1)
+ .id(13692262)
+ .joinedAt(1556281940L)
+ .locale("es")
+ .mailingListStatus(PostUsersSignInDataMailingListStatus.ACTIVE)
+ .maxHomeSize(15)
+ .profile(PostUsersSignInDataUserProfile.builder()
+ .defaultAudioLanguage("ja")
+ .defaultSubtitleLanguage("en")
+ .autoSelectAudio(true)
+ .autoSelectSubtitle(PostUsersSignInDataAutoSelectSubtitle.Enable)
+ .defaultSubtitleAccessibility(PostUsersSignInDataDefaultSubtitleAccessibility.Enable)
+ .defaultSubtitleForced(PostUsersSignInDataDefaultSubtitleForced.Enable)
+ .watchedIndicator(PostUsersSignInDataWatchedIndicator.Enable)
+ .mediaReviewsVisibility(PostUsersSignInDataMediaReviewsVisibility.Enable)
+ .build())
+ .rememberExpiresAt(1556281940L)
+ .scrobbleTypes("")
+ .services(List.of(
+ PostUsersSignInDataServices.builder()
+ .identifier("metadata-dev")
+ .endpoint("https://epg.provider.plex.tv")
+ .token("DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv")
+ .secret("")
+ .status(PostUsersSignInDataStatus.ONLINE)
+ .build()))
+ .subscription(PostUsersSignInDataSubscription.builder()
+ .active(true)
+ .subscribedAt("2021-04-12T18:21:12Z")
+ .status(PostUsersSignInDataAuthenticationStatus.INACTIVE)
+ .build())
+ .subscriptionDescription("")
+ .subscriptions(List.of(
+ PostUsersSignInDataAuthenticationSubscription.builder()
+ .active(true)
+ .subscribedAt("2021-04-12T18:21:12Z")
+ .status(PostUsersSignInDataAuthenticationResponseStatus.INACTIVE)
+ .build()))
+ .thumb("https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101")
+ .title("UsernameTitle")
+ .username("Username")
+ .uuid("dae343c1f45beb4f")
+ .attributionPartner(Optional.empty())
+ .pastSubscriptions(List.of(
+ PastSubscription.builder()
+ .id("")
+ .mode("")
+ .renewsAt(1556281940L)
+ .endsAt(1556281940L)
+ .type("plexpass")
+ .transfer("")
+ .state(PostUsersSignInDataState.ENDED)
+ .billing(Billing.builder()
+ .internalPaymentMethod(InternalPaymentMethod.builder()
+ .build())
+ .paymentMethodId(976460L)
+ .build())
+ .canceled(false)
+ .gracePeriod(false)
+ .onHold(false)
+ .canReactivate(false)
+ .canUpgrade(false)
+ .canDowngrade(false)
+ .canConvert(false)
+ .build()))
+ .trials(List.of(
+ Trials.builder()
+ .build()))
+ .anonymous(false)
+ .backupCodesCreated(false)
+ .confirmed(false)
+ .emailOnlyAuth(false)
+ .experimentalFeatures(false)
+ .guest(false)
+ .hasPassword(true)
+ .home(false)
+ .homeAdmin(false)
+ .mailingListActive(false)
+ .pin("string")
+ .protected_(false)
+ .restricted(false)
+ .roles(List.of(
+ "string"))
+ .twoFactorEnabled(false)
+ .build(),
+ res.userPlexAccount().get());
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/ButlerTests.java b/src/test/java/dev/plexapi/sdk/ButlerTests.java
new file mode 100644
index 00000000..87394e05
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/ButlerTests.java
@@ -0,0 +1,140 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.ButlerTask;
+import dev.plexapi.sdk.models.operations.ButlerTasks;
+import dev.plexapi.sdk.models.operations.GetButlerTasksResponse;
+import dev.plexapi.sdk.models.operations.GetButlerTasksResponseBody;
+import dev.plexapi.sdk.models.operations.PathParamTaskName;
+import dev.plexapi.sdk.models.operations.StartAllTasksResponse;
+import dev.plexapi.sdk.models.operations.StartTaskResponse;
+import dev.plexapi.sdk.models.operations.StopAllTasksResponse;
+import dev.plexapi.sdk.models.operations.StopTaskResponse;
+import dev.plexapi.sdk.models.operations.TaskName;
+import java.lang.Exception;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class ButlerTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testButler_GetButlerTasks() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetButlerTasksResponse res = sdk.butler().getButlerTasks()
+ .call();
+
+ assertEquals(
+ GetButlerTasksResponseBody.builder()
+ .butlerTasks(ButlerTasks.builder()
+ .butlerTask(List.of(
+ ButlerTask.builder()
+ .name("BackupDatabase")
+ .interval(3d)
+ .title("Backup Database")
+ .description("Create a backup copy of the server's database in the configured backup directory")
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testButler_StartAllTasks() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ StartAllTasksResponse res = sdk.butler().startAllTasks()
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testButler_StopAllTasks() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ StopAllTasksResponse res = sdk.butler().stopAllTasks()
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testButler_StartTask() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ StartTaskResponse res = sdk.butler().startTask()
+ .taskName(TaskName.GENERATE_CHAPTER_THUMBS)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testButler_StopTask() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ StopTaskResponse res = sdk.butler().stopTask()
+ .taskName(PathParamTaskName.DEEP_MEDIA_ANALYSIS)
+ .call();
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/HubsTests.java b/src/test/java/dev/plexapi/sdk/HubsTests.java
new file mode 100644
index 00000000..bdd0c504
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/HubsTests.java
@@ -0,0 +1,761 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.Collection;
+import dev.plexapi.sdk.models.operations.Country;
+import dev.plexapi.sdk.models.operations.Director;
+import dev.plexapi.sdk.models.operations.FlattenSeasons;
+import dev.plexapi.sdk.models.operations.Genre;
+import dev.plexapi.sdk.models.operations.GetGlobalHubsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetGlobalHubsMetadata;
+import dev.plexapi.sdk.models.operations.GetGlobalHubsResponse;
+import dev.plexapi.sdk.models.operations.GetGlobalHubsResponseBody;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsCountry;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsDirector;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsGenre;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsHub;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsMedia;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsMetadata;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsPart;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsResponse;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsResponseBody;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsRole;
+import dev.plexapi.sdk.models.operations.GetLibraryHubsWriter;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedActiveDirection;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedDefaultDirection;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedField;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedFieldType;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedFilter;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedHubsResponseType;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedHubsType;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedImage;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedMediaContainer;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedMetadata;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedOperator;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedRequest;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponse;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponseBody;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedSort;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedType;
+import dev.plexapi.sdk.models.operations.HasThumbnail;
+import dev.plexapi.sdk.models.operations.Hub;
+import dev.plexapi.sdk.models.operations.IncludeMeta;
+import dev.plexapi.sdk.models.operations.Media;
+import dev.plexapi.sdk.models.operations.MediaGuid;
+import dev.plexapi.sdk.models.operations.Meta;
+import dev.plexapi.sdk.models.operations.MetaDataRating;
+import dev.plexapi.sdk.models.operations.OnlyTransient;
+import dev.plexapi.sdk.models.operations.OptimizedForStreaming;
+import dev.plexapi.sdk.models.operations.Part;
+import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient;
+import dev.plexapi.sdk.models.operations.Role;
+import dev.plexapi.sdk.models.operations.ShowOrdering;
+import dev.plexapi.sdk.models.operations.Stream;
+import dev.plexapi.sdk.models.operations.Type;
+import dev.plexapi.sdk.models.operations.UltraBlurColors;
+import dev.plexapi.sdk.models.operations.Writer;
+import java.lang.Exception;
+import java.time.LocalDate;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class HubsTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testHubs_GetGlobalHubs() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
+ .count(6399.21d)
+ .onlyTransient(OnlyTransient.ZERO)
+ .call();
+
+ assertEquals(
+ GetGlobalHubsResponseBody.builder()
+ .mediaContainer(GetGlobalHubsMediaContainer.builder()
+ .size(8)
+ .allowSync(true)
+ .identifier("com.plexapp.plugins.library")
+ .hub(List.of(
+ Hub.builder()
+ .hubKey("/library/metadata/50768,65523,58188,57341,57302,57070")
+ .key("/playlists/all?type=15&sort=lastViewedAt:desc&playlistType=video,audio")
+ .title("Recent Playlists")
+ .type("playlist")
+ .hubIdentifier("home.playlists")
+ .context("hub.home.playlists")
+ .size(6)
+ .more(true)
+ .style("shelf")
+ .promoted(true)
+ .metadata(List.of(
+ GetGlobalHubsMetadata.builder()
+ .ratingKey("57070")
+ .key("/playlists/57070/items")
+ .guid("com.plexapp.agents.none://9fee6c5b-3143-4923-813e-57bd0190056c")
+ .type("playlist")
+ .title("November Movie Day")
+ .titleSort("Tracks")
+ .summary("")
+ .smart(false)
+ .playlistType("video")
+ .composite("/playlists/57070/composite/1668787730")
+ .icon("playlist://image.smart")
+ .viewCount(2)
+ .lastViewedAt(1668787732)
+ .duration(16873000)
+ .leafCount(3)
+ .addedAt(1668779618)
+ .updatedAt(1668787730)
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testHubs_GetRecentlyAdded() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder()
+ .contentDirectoryID(944669L)
+ .type(Type.TvShow)
+ .sectionID(2L)
+ .includeMeta(IncludeMeta.Enable)
+ .xPlexContainerStart(0)
+ .xPlexContainerSize(50)
+ .build();
+
+ GetRecentlyAddedResponse res = sdk.hubs().getRecentlyAdded()
+ .request(req)
+ .call();
+
+ assertEquals(
+ GetRecentlyAddedResponseBody.builder()
+ .mediaContainer(GetRecentlyAddedMediaContainer.builder()
+ .size(50d)
+ .identifier("com.plexapp.plugins.library")
+ .meta(Meta.builder()
+ .type(List.of(
+ GetRecentlyAddedType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetRecentlyAddedSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetRecentlyAddedActiveDirection.Ascending)
+ .defaultDirection(GetRecentlyAddedDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build(),
+ GetRecentlyAddedType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetRecentlyAddedSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetRecentlyAddedActiveDirection.Ascending)
+ .defaultDirection(GetRecentlyAddedDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build(),
+ GetRecentlyAddedSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetRecentlyAddedActiveDirection.Ascending)
+ .defaultDirection(GetRecentlyAddedDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build(),
+ GetRecentlyAddedSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetRecentlyAddedActiveDirection.Ascending)
+ .defaultDirection(GetRecentlyAddedDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build(),
+ GetRecentlyAddedType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetRecentlyAddedFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetRecentlyAddedSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetRecentlyAddedActiveDirection.Ascending)
+ .defaultDirection(GetRecentlyAddedDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build(),
+ GetRecentlyAddedSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetRecentlyAddedActiveDirection.Ascending)
+ .defaultDirection(GetRecentlyAddedDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetRecentlyAddedField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build()))
+ .fieldType(List.of(
+ GetRecentlyAddedFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetRecentlyAddedOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build(),
+ GetRecentlyAddedFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetRecentlyAddedOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build(),
+ GetRecentlyAddedFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetRecentlyAddedOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build()))
+ .build())
+ .metadata(List.of(
+ GetRecentlyAddedMetadata.builder()
+ .ratingKey("58683")
+ .key("/library/metadata/58683")
+ .guid("plex://movie/5d7768ba96b655001fdc0408")
+ .type(GetRecentlyAddedHubsType.Movie)
+ .title("Avatar: The Way of Water")
+ .summary("Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.")
+ .addedAt(1556281940L)
+ .studio("20th Century Studios")
+ .skipChildren(false)
+ .librarySectionID(1L)
+ .librarySectionTitle("Movies")
+ .librarySectionKey("/library/sections/1")
+ .slug("4-for-texas")
+ .contentRating("PG-13")
+ .rating(7.6d)
+ .audienceRating(9.2d)
+ .year(2022)
+ .seasonCount(2022)
+ .tagline("Return to Pandora.")
+ .flattenSeasons(FlattenSeasons.True)
+ .showOrdering(ShowOrdering.Dvd)
+ .thumb("/library/metadata/58683/thumb/1703239236")
+ .art("/library/metadata/58683/art/1703239236")
+ .banner("/library/metadata/58683/banner/1703239236")
+ .duration(11558112)
+ .originallyAvailableAt(LocalDate.parse("2022-12-14T00:00:00Z"))
+ .updatedAt(1556281940L)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .chapterSource("media")
+ .primaryExtraKey("/library/metadata/58684")
+ .ratingImage("rottentomatoes://image.rating.ripe")
+ .grandparentRatingKey("66")
+ .grandparentGuid("plex://show/5d9c081b170e24001f2a7be4")
+ .grandparentKey("/library/metadata/66")
+ .grandparentTitle("Caprica")
+ .grandparentThumb("/library/metadata/66/thumb/1705716261")
+ .parentSlug("alice-in-borderland-2020")
+ .grandparentSlug("alice-in-borderland-2020")
+ .grandparentArt("/library/metadata/66/art/1705716261")
+ .grandparentTheme("/library/metadata/66/theme/1705716261")
+ .media(List.of(
+ Media.builder()
+ .id(119534)
+ .duration(11558112)
+ .bitrate(25025)
+ .width(3840)
+ .height(2072)
+ .aspectRatio(1.85d)
+ .audioChannels(6)
+ .audioCodec("eac3")
+ .videoCodec("hevc")
+ .videoResolution("4k")
+ .container("mkv")
+ .videoFrameRate("24p")
+ .videoProfile("main 10")
+ .part(List.of(
+ Part.builder()
+ .id(119542)
+ .key("/library/parts/119542/1680457526/file.mkv")
+ .duration(11558112)
+ .file("/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv")
+ .size(36158371307L)
+ .container("mkv")
+ .videoProfile("main 10")
+ .audioProfile("dts")
+ .has64bitOffsets(false)
+ .optimizedForStreaming(false)
+ .indexes("sd")
+ .hasThumbnail(HasThumbnail.True)
+ .stream(List.of(
+ Stream.builder()
+ .id(272796L)
+ .streamType(1L)
+ .codec("h264")
+ .index(0L)
+ .default_(true)
+ .selected(true)
+ .bitrate(6273L)
+ .colorPrimaries("bt709")
+ .colorRange("tv")
+ .colorSpace("bt709")
+ .colorTrc("bt709")
+ .bitDepth(8L)
+ .chromaLocation("left")
+ .streamIdentifier("2")
+ .chromaSubsampling("4:2:0")
+ .codedHeight(1088L)
+ .codedWidth(1920L)
+ .frameRate(29.97d)
+ .hasScalingMatrix(false)
+ .hearingImpaired(false)
+ .closedCaptions(false)
+ .embeddedInVideo("1")
+ .height(1080L)
+ .level(40L)
+ .profile("main")
+ .refFrames(4L)
+ .scanType("progressive")
+ .width(1920L)
+ .displayTitle("1080p (H.264)")
+ .extendedDisplayTitle("1080p (H.264)")
+ .channels(2L)
+ .language("English")
+ .languageTag("en")
+ .languageCode("eng")
+ .audioChannelLayout("stereo")
+ .samplingRate(48000L)
+ .title("English")
+ .canAutoSync(false)
+ .build()))
+ .build()))
+ .audioProfile("dts")
+ .hasVoiceActivity(false)
+ .optimizedForStreaming(OptimizedForStreaming.Enable)
+ .has64bitOffsets(false)
+ .build()))
+ .genre(List.of(
+ Genre.builder()
+ .tag("Adventure")
+ .build()))
+ .country(List.of(
+ Country.builder()
+ .tag("United States of America")
+ .build()))
+ .director(List.of(
+ Director.builder()
+ .tag("James Cameron")
+ .build(),
+ Director.builder()
+ .tag("James Cameron")
+ .build()))
+ .writer(List.of(
+ Writer.builder()
+ .tag("James Cameron")
+ .build()))
+ .collection(List.of(
+ Collection.builder()
+ .tag("Working NL Subs")
+ .build()))
+ .role(List.of(
+ Role.builder()
+ .id(294129L)
+ .filter("actor=294129")
+ .thumb("https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg")
+ .tag("Mike Smith")
+ .tagKey("668e7e7b22bcad9064350c91")
+ .role("Self")
+ .build(),
+ Role.builder()
+ .id(294129L)
+ .filter("actor=294129")
+ .thumb("https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg")
+ .tag("Mike Smith")
+ .tagKey("668e7e7b22bcad9064350c91")
+ .role("Self")
+ .build(),
+ Role.builder()
+ .id(294129L)
+ .filter("actor=294129")
+ .thumb("https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg")
+ .tag("Mike Smith")
+ .tagKey("668e7e7b22bcad9064350c91")
+ .role("Self")
+ .build()))
+ .mediaGuid(List.of(
+ MediaGuid.builder()
+ .id("imdb://tt13015952")
+ .build(),
+ MediaGuid.builder()
+ .id("imdb://tt13015952")
+ .build(),
+ MediaGuid.builder()
+ .id("imdb://tt13015952")
+ .build()))
+ .ultraBlurColors(UltraBlurColors.builder()
+ .topLeft("11333b")
+ .topRight("0a232d")
+ .bottomRight("73958")
+ .bottomLeft("1f5066")
+ .build())
+ .metaDataRating(List.of(
+ MetaDataRating.builder()
+ .image("themoviedb://image.rating")
+ .value(3f)
+ .type("audience")
+ .build()))
+ .image(List.of(
+ GetRecentlyAddedImage.builder()
+ .alt("Episode 1")
+ .type(GetRecentlyAddedHubsResponseType.BACKGROUND)
+ .url("/library/metadata/45521/thumb/1644710589")
+ .build(),
+ GetRecentlyAddedImage.builder()
+ .alt("Episode 1")
+ .type(GetRecentlyAddedHubsResponseType.BACKGROUND)
+ .url("/library/metadata/45521/thumb/1644710589")
+ .build(),
+ GetRecentlyAddedImage.builder()
+ .alt("Episode 1")
+ .type(GetRecentlyAddedHubsResponseType.BACKGROUND)
+ .url("/library/metadata/45521/thumb/1644710589")
+ .build()))
+ .titleSort("Whale")
+ .viewCount(1)
+ .lastViewedAt(1682752242)
+ .originalTitle("映画 ブラッククローバー 魔法帝の剣")
+ .viewOffset(5222500)
+ .skipCount(1)
+ .index(1)
+ .theme("/library/metadata/1/theme/1705636920")
+ .leafCount(14)
+ .viewedLeafCount(0)
+ .childCount(1)
+ .hasPremiumExtras("1")
+ .hasPremiumPrimaryExtra("1")
+ .parentRatingKey("66")
+ .parentGuid("plex://show/5d9c081b170e24001f2a7be4")
+ .parentStudio("UCP")
+ .parentKey("/library/metadata/66")
+ .parentTitle("Caprica")
+ .parentIndex(1)
+ .parentYear(2010)
+ .parentThumb("/library/metadata/66/thumb/1705716261")
+ .parentTheme("/library/metadata/66/theme/1705716261")
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testHubs_GetLibraryHubs() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
+ .sectionId(5218.48d)
+ .count(4146.62d)
+ .onlyTransient(QueryParamOnlyTransient.ZERO)
+ .call();
+
+ assertEquals(
+ GetLibraryHubsResponseBody.builder()
+ .mediaContainer(GetLibraryHubsMediaContainer.builder()
+ .size(7)
+ .allowSync(true)
+ .identifier("com.plexapp.plugins.library")
+ .librarySectionID(1)
+ .librarySectionTitle("Movies")
+ .librarySectionUUID("322a231a-b7f7-49f5-920f-14c61199cd30")
+ .hub(List.of(
+ GetLibraryHubsHub.builder()
+ .key("/library/sections/1/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0")
+ .title("Recently Played Movies")
+ .type("movie")
+ .hubIdentifier("movie.recentlyviewed.1")
+ .context("hub.movie.recentlyviewed")
+ .size(6)
+ .more(true)
+ .style("shelf")
+ .hubKey("/library/metadata/66485,66098,57249,11449,5858,14944")
+ .metadata(List.of(
+ GetLibraryHubsMetadata.builder()
+ .ratingKey("14944")
+ .key("/library/metadata/14944")
+ .guid("plex://movie/5d77686eeb5d26001f1eb339")
+ .studio("Walt Disney Animation Studios")
+ .type("movie")
+ .title("Tangled")
+ .librarySectionTitle("Movies")
+ .librarySectionID(1)
+ .librarySectionKey("/library/sections/1")
+ .contentRating("PG")
+ .summary("The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is.")
+ .rating(8.9d)
+ .audienceRating(8.7d)
+ .viewCount(1)
+ .lastViewedAt(1704936047)
+ .year(2010)
+ .tagline("They're taking adventure to new lengths.")
+ .thumb("/library/metadata/14944/thumb/1705739847")
+ .art("/library/metadata/14944/art/1705739847")
+ .duration(6017237)
+ .originallyAvailableAt(LocalDate.parse("2010-11-24T00:00:00Z"))
+ .addedAt(1589412494)
+ .updatedAt(1705739847)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .primaryExtraKey("/library/metadata/14952")
+ .ratingImage("rottentomatoes://image.rating.ripe")
+ .media(List.of(
+ GetLibraryHubsMedia.builder()
+ .id(38247)
+ .duration(6017237)
+ .bitrate(2051)
+ .width(1920)
+ .height(1080)
+ .aspectRatio(1.78d)
+ .audioChannels(2)
+ .audioCodec("aac")
+ .videoCodec("h264")
+ .videoResolution("1080")
+ .container("mp4")
+ .videoFrameRate("24p")
+ .optimizedForStreaming(1)
+ .audioProfile("lc")
+ .has64bitOffsets(false)
+ .videoProfile("high")
+ .part(List.of(
+ GetLibraryHubsPart.builder()
+ .id(38247)
+ .key("/library/parts/38247/1589412494/file.mp4")
+ .duration(6017237)
+ .file("/movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4")
+ .size(1545647447)
+ .audioProfile("lc")
+ .container("mp4")
+ .has64bitOffsets(false)
+ .optimizedForStreaming(true)
+ .videoProfile("high")
+ .build()))
+ .build()))
+ .genre(List.of(
+ GetLibraryHubsGenre.builder()
+ .tag("Animation")
+ .build()))
+ .country(List.of(
+ GetLibraryHubsCountry.builder()
+ .tag("United States of America")
+ .build()))
+ .director(List.of(
+ GetLibraryHubsDirector.builder()
+ .tag("Nathan Greno")
+ .build()))
+ .role(List.of(
+ GetLibraryHubsRole.builder()
+ .tag("Donna Murphy")
+ .build()))
+ .writer(List.of(
+ GetLibraryHubsWriter.builder()
+ .tag("Wilhelm Grimm")
+ .build()))
+ .skipCount(1)
+ .chapterSource("media")
+ .build()))
+ .promoted(true)
+ .random(true)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/LibraryTests.java b/src/test/java/dev/plexapi/sdk/LibraryTests.java
new file mode 100644
index 00000000..11948421
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/LibraryTests.java
@@ -0,0 +1,2111 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.ActiveDirection;
+import dev.plexapi.sdk.models.operations.DefaultDirection;
+import dev.plexapi.sdk.models.operations.DeleteLibraryResponse;
+import dev.plexapi.sdk.models.operations.Field;
+import dev.plexapi.sdk.models.operations.FieldType;
+import dev.plexapi.sdk.models.operations.Force;
+import dev.plexapi.sdk.models.operations.GetAllLibrariesDirectory;
+import dev.plexapi.sdk.models.operations.GetAllLibrariesMediaContainer;
+import dev.plexapi.sdk.models.operations.GetAllLibrariesResponse;
+import dev.plexapi.sdk.models.operations.GetAllLibrariesResponseBody;
+import dev.plexapi.sdk.models.operations.GetFileHashResponse;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsDirectory;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsField;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsFieldType;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsFilter;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsOperator;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponse;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponseBody;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsSort;
+import dev.plexapi.sdk.models.operations.GetLibraryDetailsType;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsActiveDirection;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsCollection;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsCountry;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsDefaultDirection;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsDirector;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsField;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsFieldType;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsFilter;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsFlattenSeasons;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsGenre;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsHasThumbnail;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsImage;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryActiveDirection;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryDefaultDirection;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryField;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryFieldType;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryFilter;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryOperator;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryResponse200Type;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryResponseType;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibrarySort;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryType;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsMedia;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsMediaGuid;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsMeta;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsMetaDataRating;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsMetadata;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsOperator;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsOptimizedForStreaming;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsPart;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsQueryParamIncludeMeta;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsQueryParamType;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsResponse;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsResponseBody;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsRole;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsShowOrdering;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsSort;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsStream;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsType;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsUltraBlurColors;
+import dev.plexapi.sdk.models.operations.GetLibraryItemsWriter;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyCountry;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyDirector;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyGenre;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyMedia;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyMediaContainer;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyMetadata;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyPart;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyResponse;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyResponseBody;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyRole;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyStream;
+import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyWriter;
+import dev.plexapi.sdk.models.operations.GetMetadataChildrenDirectory;
+import dev.plexapi.sdk.models.operations.GetMetadataChildrenMediaContainer;
+import dev.plexapi.sdk.models.operations.GetMetadataChildrenMetadata;
+import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponse;
+import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponseBody;
+import dev.plexapi.sdk.models.operations.GetOnDeckGuids;
+import dev.plexapi.sdk.models.operations.GetOnDeckMedia;
+import dev.plexapi.sdk.models.operations.GetOnDeckMediaContainer;
+import dev.plexapi.sdk.models.operations.GetOnDeckMetadata;
+import dev.plexapi.sdk.models.operations.GetOnDeckPart;
+import dev.plexapi.sdk.models.operations.GetOnDeckResponse;
+import dev.plexapi.sdk.models.operations.GetOnDeckResponseBody;
+import dev.plexapi.sdk.models.operations.GetOnDeckStream;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryCountry;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryDirector;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryFilter;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryGenre;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryMedia;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryMediaContainer;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryMetadata;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryPart;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryRequest;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryResponse;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryResponseBody;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryRole;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryType;
+import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryWriter;
+import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataResponse;
+import dev.plexapi.sdk.models.operations.GetSearchLibraryMediaContainer;
+import dev.plexapi.sdk.models.operations.GetSearchLibraryMetadata;
+import dev.plexapi.sdk.models.operations.GetSearchLibraryQueryParamType;
+import dev.plexapi.sdk.models.operations.GetSearchLibraryResponse;
+import dev.plexapi.sdk.models.operations.GetSearchLibraryResponseBody;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentCountry;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentGenre;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentGuids;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentMediaContainer;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentMetadata;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamType;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponse;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponseBody;
+import dev.plexapi.sdk.models.operations.GetTopWatchedContentRole;
+import dev.plexapi.sdk.models.operations.Guids;
+import dev.plexapi.sdk.models.operations.IncludeDetails;
+import dev.plexapi.sdk.models.operations.IncludeGuids;
+import dev.plexapi.sdk.models.operations.Location;
+import dev.plexapi.sdk.models.operations.Operator;
+import dev.plexapi.sdk.models.operations.Producer;
+import dev.plexapi.sdk.models.operations.QueryParamIncludeMeta;
+import dev.plexapi.sdk.models.operations.QueryParamType;
+import dev.plexapi.sdk.models.operations.Ratings;
+import dev.plexapi.sdk.models.operations.Sort;
+import dev.plexapi.sdk.models.operations.Tag;
+import dev.plexapi.sdk.models.operations.User;
+import java.lang.Exception;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class LibraryTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetFileHash() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetFileHashResponse res = sdk.library().getFileHash()
+ .url("file://C:\Image.png&type=13")
+ .type(187.90d)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetRecentlyAddedLibrary() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder()
+ .type(QueryParamType.TvShow)
+ .contentDirectoryID(2L)
+ .pinnedContentDirectoryID(List.of(
+ 3L,
+ 5L,
+ 7L,
+ 13L,
+ 12L,
+ 1L,
+ 6L,
+ 14L,
+ 2L,
+ 10L,
+ 16L,
+ 17L))
+ .sectionID(2L)
+ .includeMeta(QueryParamIncludeMeta.Enable)
+ .xPlexContainerStart(0)
+ .xPlexContainerSize(50)
+ .build();
+
+ GetRecentlyAddedLibraryResponse res = sdk.library().getRecentlyAddedLibrary()
+ .request(req)
+ .call();
+
+ assertEquals(
+ GetRecentlyAddedLibraryResponseBody.builder()
+ .mediaContainer(GetRecentlyAddedLibraryMediaContainer.builder()
+ .type(List.of(
+ GetRecentlyAddedLibraryType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetRecentlyAddedLibraryFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ Sort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(ActiveDirection.Ascending)
+ .defaultDirection(DefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build(),
+ Sort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(ActiveDirection.Ascending)
+ .defaultDirection(DefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build(),
+ Sort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(ActiveDirection.Ascending)
+ .defaultDirection(DefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ Field.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ Field.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build(),
+ GetRecentlyAddedLibraryType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetRecentlyAddedLibraryFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ Sort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(ActiveDirection.Ascending)
+ .defaultDirection(DefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build(),
+ Sort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(ActiveDirection.Ascending)
+ .defaultDirection(DefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build(),
+ Sort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(ActiveDirection.Ascending)
+ .defaultDirection(DefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ Field.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ Field.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build()))
+ .fieldType(List.of(
+ FieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ Operator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build()))
+ .size(50d)
+ .identifier("com.plexapp.plugins.library")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1680021154d)
+ .metadata(List.of(
+ GetRecentlyAddedLibraryMetadata.builder()
+ .librarySectionID(1d)
+ .librarySectionTitle("Movies")
+ .librarySectionUUID("322a231a-b7f7-49f5-920f-14c61199cd30")
+ .ratingKey(59398d)
+ .key("/library/metadata/59398")
+ .guid("plex://movie/5e161a83bea6ac004126e148")
+ .studio("Marvel Studios")
+ .type("movie")
+ .title("Ant-Man and the Wasp: Quantumania")
+ .contentRating("PG-13")
+ .summary("Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.")
+ .rating(4.7d)
+ .audienceRating(8.3d)
+ .year(2023d)
+ .tagline("Witness the beginning of a new dynasty.")
+ .thumb("/library/metadata/59398/thumb/1681888010")
+ .art("/library/metadata/59398/art/1681888010")
+ .duration(7474422d)
+ .originallyAvailableAt(OffsetDateTime.parse("2023-02-15T00:00:00Z"))
+ .addedAt(1681803215d)
+ .updatedAt(1681888010d)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .chapterSource("media")
+ .primaryExtraKey("/library/metadata/59399")
+ .ratingImage("rottentomatoes://image.rating.rotten")
+ .media(List.of(
+ GetRecentlyAddedLibraryMedia.builder()
+ .id(120345d)
+ .duration(7474422d)
+ .bitrate(3623d)
+ .width(1920d)
+ .height(804d)
+ .aspectRatio(2.35d)
+ .audioChannels(6d)
+ .audioCodec("ac3")
+ .videoCodec("h264")
+ .videoResolution(1080d)
+ .container("mp4")
+ .videoFrameRate("24p")
+ .optimizedForStreaming(0d)
+ .videoProfile("high")
+ .part(List.of(
+ GetRecentlyAddedLibraryPart.builder()
+ .id(120353d)
+ .key("/library/parts/120353/1681803203/file.mp4")
+ .duration(7474422d)
+ .file("/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4")
+ .size(3395307162d)
+ .container("mp4")
+ .hasThumbnail(1d)
+ .videoProfile("high")
+ .build()))
+ .build()))
+ .genre(List.of(
+ GetRecentlyAddedLibraryGenre.builder()
+ .tag("Comedy")
+ .build()))
+ .director(List.of(
+ GetRecentlyAddedLibraryDirector.builder()
+ .tag("Peyton Reed")
+ .build()))
+ .writer(List.of(
+ GetRecentlyAddedLibraryWriter.builder()
+ .tag("Jeff Loveness")
+ .build()))
+ .country(List.of(
+ GetRecentlyAddedLibraryCountry.builder()
+ .tag("United States of America")
+ .build()))
+ .role(List.of(
+ GetRecentlyAddedLibraryRole.builder()
+ .tag("Paul Rudd")
+ .build(),
+ GetRecentlyAddedLibraryRole.builder()
+ .tag("Paul Rudd")
+ .build(),
+ GetRecentlyAddedLibraryRole.builder()
+ .tag("Paul Rudd")
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetAllLibraries() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetAllLibrariesResponse res = sdk.library().getAllLibraries()
+ .call();
+
+ assertEquals(
+ GetAllLibrariesResponseBody.builder()
+ .mediaContainer(GetAllLibrariesMediaContainer.builder()
+ .size(5)
+ .allowSync(false)
+ .title1("Plex Library")
+ .directory(List.of(
+ GetAllLibrariesDirectory.builder()
+ .allowSync(true)
+ .art("/:/resources/movie-fanart.jpg")
+ .composite("/library/sections/1/composite/1705615584")
+ .filters(true)
+ .refreshing(false)
+ .thumb("/:/resources/movie.png")
+ .key("1")
+ .type("movie")
+ .title("Movies")
+ .agent("tv.plex.agents.movie")
+ .scanner("Plex Movie")
+ .language("en-US")
+ .uuid("322a231a-b7f7-49f5-920f-14c61199cd30")
+ .updatedAt(1556281940L)
+ .createdAt(1556281940L)
+ .scannedAt(1556281940L)
+ .content(true)
+ .directory(true)
+ .contentChangedAt(1556281940L)
+ .hidden(0)
+ .location(List.of(
+ Location.builder()
+ .id(1)
+ .path("/movies")
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetLibraryDetails() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
+ .sectionKey(9518)
+ .includeDetails(IncludeDetails.ONE)
+ .call();
+
+ assertEquals(
+ GetLibraryDetailsResponseBody.builder()
+ .mediaContainer(GetLibraryDetailsMediaContainer.builder()
+ .size(29)
+ .allowSync(false)
+ .art("/:/resources/movie-fanart.jpg")
+ .content("secondary")
+ .identifier("com.plexapp.plugins.library")
+ .librarySectionID(1)
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1701731894)
+ .thumb("/:/resources/movie.png")
+ .title1("Movies")
+ .viewGroup("secondary")
+ .viewMode(65592)
+ .directory(List.of(
+ GetLibraryDetailsDirectory.builder()
+ .key("search?type=1")
+ .title("Search...")
+ .secondary(true)
+ .prompt("Search Movies")
+ .search(true)
+ .build()))
+ .type(List.of(
+ GetLibraryDetailsType.builder()
+ .key("/library/sections/1/all?type=1")
+ .type("movie")
+ .title("Movies")
+ .active(false)
+ .filter(List.of(
+ GetLibraryDetailsFilter.builder()
+ .filter("label")
+ .filterType("string")
+ .key("/library/sections/1/label")
+ .title("Labels")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetLibraryDetailsSort.builder()
+ .default_("asc")
+ .defaultDirection("desc")
+ .descKey("random:desc")
+ .firstCharacterKey("/library/sections/1/firstCharacter")
+ .key("random")
+ .title("Randomly")
+ .build()))
+ .field(List.of(
+ GetLibraryDetailsField.builder()
+ .key("label")
+ .title("Label")
+ .type("tag")
+ .subType("bitrate")
+ .build()))
+ .build()))
+ .fieldType(List.of(
+ GetLibraryDetailsFieldType.builder()
+ .type("resolution")
+ .operator(List.of(
+ GetLibraryDetailsOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_DeleteLibrary() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ DeleteLibraryResponse res = sdk.library().deleteLibrary()
+ .sectionKey(9518)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetLibraryItems_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetLibraryItemsRequest req = GetLibraryItemsRequest.builder()
+ .sectionKey(9518)
+ .tag(Tag.DIRECTOR)
+ .includeGuids(IncludeGuids.Enable)
+ .type(GetLibraryItemsQueryParamType.TvShow)
+ .includeMeta(GetLibraryItemsQueryParamIncludeMeta.Enable)
+ .xPlexContainerStart(0)
+ .xPlexContainerSize(50)
+ .build();
+
+ GetLibraryItemsResponse res = sdk.library().getLibraryItems()
+ .request(req)
+ .call();
+
+ assertEquals(
+ GetLibraryItemsResponseBody.builder()
+ .mediaContainer(GetLibraryItemsMediaContainer.builder()
+ .size(70)
+ .totalSize(170)
+ .offset(0)
+ .content("secondary")
+ .allowSync(true)
+ .art("/:/resources/movie-fanart.jpg")
+ .identifier("com.plexapp.plugins.library")
+ .librarySectionID(1L)
+ .librarySectionTitle("Movies")
+ .librarySectionUUID("322a231a-b7f7-49f5-920f-14c61199cd30")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1701731894)
+ .thumb("/:/resources/movie.png")
+ .title1("Movies")
+ .title2("Recently Released")
+ .viewGroup("movie")
+ .metadata(List.of(
+ GetLibraryItemsMetadata.builder()
+ .ratingKey("58683")
+ .key("/library/metadata/58683")
+ .guid("plex://movie/5d7768ba96b655001fdc0408")
+ .type(GetLibraryItemsLibraryType.Movie)
+ .title("Avatar: The Way of Water")
+ .summary("Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.")
+ .addedAt(1556281940L)
+ .studio("20th Century Studios")
+ .skipChildren(false)
+ .librarySectionID(1L)
+ .librarySectionTitle("Movies")
+ .librarySectionKey("/library/sections/1")
+ .slug("4-for-texas")
+ .contentRating("PG-13")
+ .rating(7.6d)
+ .audienceRating(9.2d)
+ .year(2022)
+ .seasonCount(2022)
+ .tagline("Return to Pandora.")
+ .flattenSeasons(GetLibraryItemsFlattenSeasons.True)
+ .showOrdering(GetLibraryItemsShowOrdering.Dvd)
+ .thumb("/library/metadata/58683/thumb/1703239236")
+ .art("/library/metadata/58683/art/1703239236")
+ .banner("/library/metadata/58683/banner/1703239236")
+ .duration(11558112)
+ .originallyAvailableAt(LocalDate.parse("2022-12-14T00:00:00Z"))
+ .updatedAt(1556281940L)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .chapterSource("media")
+ .primaryExtraKey("/library/metadata/58684")
+ .ratingImage("rottentomatoes://image.rating.ripe")
+ .grandparentRatingKey("66")
+ .grandparentGuid("plex://show/5d9c081b170e24001f2a7be4")
+ .grandparentKey("/library/metadata/66")
+ .grandparentTitle("Caprica")
+ .grandparentThumb("/library/metadata/66/thumb/1705716261")
+ .parentSlug("alice-in-borderland-2020")
+ .grandparentSlug("alice-in-borderland-2020")
+ .grandparentArt("/library/metadata/66/art/1705716261")
+ .grandparentTheme("/library/metadata/66/theme/1705716261")
+ .media(List.of(
+ GetLibraryItemsMedia.builder()
+ .id(119534)
+ .duration(11558112)
+ .bitrate(25025)
+ .width(3840)
+ .height(2072)
+ .aspectRatio(1.85d)
+ .audioChannels(6)
+ .audioCodec("eac3")
+ .videoCodec("hevc")
+ .videoResolution("4k")
+ .container("mkv")
+ .videoFrameRate("24p")
+ .videoProfile("main 10")
+ .part(List.of(
+ GetLibraryItemsPart.builder()
+ .id(119542)
+ .key("/library/parts/119542/1680457526/file.mkv")
+ .duration(11558112)
+ .file("/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv")
+ .size(36158371307L)
+ .container("mkv")
+ .videoProfile("main 10")
+ .audioProfile("dts")
+ .has64bitOffsets(false)
+ .optimizedForStreaming(false)
+ .indexes("sd")
+ .hasThumbnail(GetLibraryItemsHasThumbnail.True)
+ .stream(List.of(
+ GetLibraryItemsStream.builder()
+ .id(272796L)
+ .streamType(1L)
+ .codec("h264")
+ .index(0L)
+ .default_(true)
+ .selected(true)
+ .bitrate(6273L)
+ .colorPrimaries("bt709")
+ .colorRange("tv")
+ .colorSpace("bt709")
+ .colorTrc("bt709")
+ .bitDepth(8L)
+ .chromaLocation("left")
+ .streamIdentifier("2")
+ .chromaSubsampling("4:2:0")
+ .codedHeight(1088L)
+ .codedWidth(1920L)
+ .frameRate(29.97d)
+ .hasScalingMatrix(false)
+ .hearingImpaired(false)
+ .closedCaptions(false)
+ .embeddedInVideo("1")
+ .height(1080L)
+ .level(40L)
+ .profile("main")
+ .refFrames(4L)
+ .scanType("progressive")
+ .width(1920L)
+ .displayTitle("1080p (H.264)")
+ .extendedDisplayTitle("1080p (H.264)")
+ .channels(2L)
+ .language("English")
+ .languageTag("en")
+ .languageCode("eng")
+ .audioChannelLayout("stereo")
+ .samplingRate(48000L)
+ .title("English")
+ .canAutoSync(false)
+ .build()))
+ .build()))
+ .audioProfile("dts")
+ .hasVoiceActivity(false)
+ .optimizedForStreaming(GetLibraryItemsOptimizedForStreaming.Enable)
+ .has64bitOffsets(false)
+ .build()))
+ .genre(List.of(
+ GetLibraryItemsGenre.builder()
+ .tag("Adventure")
+ .build()))
+ .country(List.of(
+ GetLibraryItemsCountry.builder()
+ .tag("United States of America")
+ .build()))
+ .director(List.of(
+ GetLibraryItemsDirector.builder()
+ .tag("James Cameron")
+ .build()))
+ .writer(List.of(
+ GetLibraryItemsWriter.builder()
+ .tag("James Cameron")
+ .build()))
+ .collection(List.of(
+ GetLibraryItemsCollection.builder()
+ .tag("Working NL Subs")
+ .build()))
+ .role(List.of(
+ GetLibraryItemsRole.builder()
+ .id(294129L)
+ .filter("actor=294129")
+ .thumb("https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg")
+ .tag("Mike Smith")
+ .tagKey("668e7e7b22bcad9064350c91")
+ .role("Self")
+ .build()))
+ .mediaGuid(List.of(
+ GetLibraryItemsMediaGuid.builder()
+ .id("imdb://tt13015952")
+ .build()))
+ .ultraBlurColors(GetLibraryItemsUltraBlurColors.builder()
+ .topLeft("11333b")
+ .topRight("0a232d")
+ .bottomRight("73958")
+ .bottomLeft("1f5066")
+ .build())
+ .metaDataRating(List.of(
+ GetLibraryItemsMetaDataRating.builder()
+ .image("themoviedb://image.rating")
+ .value(3f)
+ .type("audience")
+ .build()))
+ .image(List.of(
+ GetLibraryItemsImage.builder()
+ .alt("Episode 1")
+ .type(GetLibraryItemsLibraryResponse200Type.BACKGROUND)
+ .url("/library/metadata/45521/thumb/1644710589")
+ .build()))
+ .titleSort("Whale")
+ .viewCount(1)
+ .lastViewedAt(1682752242)
+ .originalTitle("映画 ブラッククローバー 魔法帝の剣")
+ .viewOffset(5222500)
+ .skipCount(1)
+ .index(1)
+ .theme("/library/metadata/1/theme/1705636920")
+ .leafCount(14)
+ .viewedLeafCount(0)
+ .childCount(1)
+ .hasPremiumExtras("1")
+ .hasPremiumPrimaryExtra("1")
+ .parentRatingKey("66")
+ .parentGuid("plex://show/5d9c081b170e24001f2a7be4")
+ .parentStudio("UCP")
+ .parentKey("/library/metadata/66")
+ .parentTitle("Caprica")
+ .parentIndex(1)
+ .parentYear(2010)
+ .parentThumb("/library/metadata/66/thumb/1705716261")
+ .parentTheme("/library/metadata/66/theme/1705716261")
+ .build()))
+ .type(List.of(
+ GetLibraryItemsType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetLibraryItemsFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetLibraryItemsSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetLibraryItemsActiveDirection.Ascending)
+ .defaultDirection(GetLibraryItemsDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ GetLibraryItemsField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build()))
+ .fieldType(List.of(
+ GetLibraryItemsFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetLibraryItemsOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build()))
+ .nocache(true)
+ .viewMode(65592)
+ .mixedParents(true)
+ .meta(GetLibraryItemsMeta.builder()
+ .type(List.of(
+ GetLibraryItemsLibraryResponseType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetLibraryItemsLibraryFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetLibraryItemsLibrarySort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetLibraryItemsLibraryActiveDirection.Ascending)
+ .defaultDirection(GetLibraryItemsLibraryDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ GetLibraryItemsLibraryField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build()))
+ .fieldType(List.of(
+ GetLibraryItemsLibraryFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetLibraryItemsLibraryOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build()))
+ .build())
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetLibraryItems() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetLibraryItemsRequest req = GetLibraryItemsRequest.builder()
+ .sectionKey(9518)
+ .tag(Tag.DIRECTOR)
+ .includeGuids(IncludeGuids.Enable)
+ .type(GetLibraryItemsQueryParamType.TvShow)
+ .includeMeta(GetLibraryItemsQueryParamIncludeMeta.Enable)
+ .xPlexContainerStart(0)
+ .xPlexContainerSize(50)
+ .build();
+
+ GetLibraryItemsResponse res = sdk.library().getLibraryItems()
+ .request(req)
+ .call();
+
+ assertEquals(
+ GetLibraryItemsResponseBody.builder()
+ .mediaContainer(GetLibraryItemsMediaContainer.builder()
+ .size(70)
+ .totalSize(170)
+ .offset(0)
+ .content("secondary")
+ .allowSync(true)
+ .art("/:/resources/movie-fanart.jpg")
+ .identifier("com.plexapp.plugins.library")
+ .librarySectionID(1L)
+ .librarySectionTitle("Movies")
+ .librarySectionUUID("322a231a-b7f7-49f5-920f-14c61199cd30")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1701731894)
+ .thumb("/:/resources/movie.png")
+ .title1("Movies")
+ .title2("Recently Released")
+ .viewGroup("movie")
+ .metadata(List.of(
+ GetLibraryItemsMetadata.builder()
+ .ratingKey("58683")
+ .key("/library/metadata/58683")
+ .guid("plex://movie/5d7768ba96b655001fdc0408")
+ .type(GetLibraryItemsLibraryType.Movie)
+ .title("Avatar: The Way of Water")
+ .summary("Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.")
+ .addedAt(1556281940L)
+ .studio("20th Century Studios")
+ .skipChildren(false)
+ .librarySectionID(1L)
+ .librarySectionTitle("Movies")
+ .librarySectionKey("/library/sections/1")
+ .slug("4-for-texas")
+ .contentRating("PG-13")
+ .rating(7.6d)
+ .audienceRating(9.2d)
+ .year(2022)
+ .seasonCount(2022)
+ .tagline("Return to Pandora.")
+ .flattenSeasons(GetLibraryItemsFlattenSeasons.True)
+ .showOrdering(GetLibraryItemsShowOrdering.Dvd)
+ .thumb("/library/metadata/58683/thumb/1703239236")
+ .art("/library/metadata/58683/art/1703239236")
+ .banner("/library/metadata/58683/banner/1703239236")
+ .duration(11558112)
+ .originallyAvailableAt(LocalDate.parse("2022-12-14T00:00:00Z"))
+ .updatedAt(1556281940L)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .chapterSource("media")
+ .primaryExtraKey("/library/metadata/58684")
+ .ratingImage("rottentomatoes://image.rating.ripe")
+ .grandparentRatingKey("66")
+ .grandparentGuid("plex://show/5d9c081b170e24001f2a7be4")
+ .grandparentKey("/library/metadata/66")
+ .grandparentTitle("Caprica")
+ .grandparentThumb("/library/metadata/66/thumb/1705716261")
+ .parentSlug("alice-in-borderland-2020")
+ .grandparentSlug("alice-in-borderland-2020")
+ .grandparentArt("/library/metadata/66/art/1705716261")
+ .grandparentTheme("/library/metadata/66/theme/1705716261")
+ .media(List.of(
+ GetLibraryItemsMedia.builder()
+ .id(119534)
+ .duration(11558112)
+ .bitrate(25025)
+ .width(3840)
+ .height(2072)
+ .aspectRatio(1.85d)
+ .audioChannels(6)
+ .audioCodec("eac3")
+ .videoCodec("hevc")
+ .videoResolution("4k")
+ .container("mkv")
+ .videoFrameRate("24p")
+ .videoProfile("main 10")
+ .part(List.of(
+ GetLibraryItemsPart.builder()
+ .id(119542)
+ .key("/library/parts/119542/1680457526/file.mkv")
+ .duration(11558112)
+ .file("/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv")
+ .size(36158371307L)
+ .container("mkv")
+ .videoProfile("main 10")
+ .audioProfile("dts")
+ .has64bitOffsets(false)
+ .optimizedForStreaming(false)
+ .indexes("sd")
+ .hasThumbnail(GetLibraryItemsHasThumbnail.True)
+ .stream(List.of(
+ GetLibraryItemsStream.builder()
+ .id(272796L)
+ .streamType(1L)
+ .codec("h264")
+ .index(0L)
+ .default_(true)
+ .selected(true)
+ .bitrate(6273L)
+ .colorPrimaries("bt709")
+ .colorRange("tv")
+ .colorSpace("bt709")
+ .colorTrc("bt709")
+ .bitDepth(8L)
+ .chromaLocation("left")
+ .streamIdentifier("2")
+ .chromaSubsampling("4:2:0")
+ .codedHeight(1088L)
+ .codedWidth(1920L)
+ .frameRate(29.97d)
+ .hasScalingMatrix(false)
+ .hearingImpaired(false)
+ .closedCaptions(false)
+ .embeddedInVideo("1")
+ .height(1080L)
+ .level(40L)
+ .profile("main")
+ .refFrames(4L)
+ .scanType("progressive")
+ .width(1920L)
+ .displayTitle("1080p (H.264)")
+ .extendedDisplayTitle("1080p (H.264)")
+ .channels(2L)
+ .language("English")
+ .languageTag("en")
+ .languageCode("eng")
+ .audioChannelLayout("stereo")
+ .samplingRate(48000L)
+ .title("English")
+ .canAutoSync(false)
+ .build()))
+ .build()))
+ .audioProfile("dts")
+ .hasVoiceActivity(false)
+ .optimizedForStreaming(GetLibraryItemsOptimizedForStreaming.Enable)
+ .has64bitOffsets(false)
+ .build()))
+ .genre(List.of(
+ GetLibraryItemsGenre.builder()
+ .tag("Adventure")
+ .build()))
+ .country(List.of(
+ GetLibraryItemsCountry.builder()
+ .tag("United States of America")
+ .build()))
+ .director(List.of(
+ GetLibraryItemsDirector.builder()
+ .tag("James Cameron")
+ .build()))
+ .writer(List.of(
+ GetLibraryItemsWriter.builder()
+ .tag("James Cameron")
+ .build()))
+ .collection(List.of(
+ GetLibraryItemsCollection.builder()
+ .tag("Working NL Subs")
+ .build()))
+ .role(List.of(
+ GetLibraryItemsRole.builder()
+ .id(294129L)
+ .filter("actor=294129")
+ .thumb("https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg")
+ .tag("Mike Smith")
+ .tagKey("668e7e7b22bcad9064350c91")
+ .role("Self")
+ .build()))
+ .mediaGuid(List.of(
+ GetLibraryItemsMediaGuid.builder()
+ .id("imdb://tt13015952")
+ .build()))
+ .ultraBlurColors(GetLibraryItemsUltraBlurColors.builder()
+ .topLeft("11333b")
+ .topRight("0a232d")
+ .bottomRight("73958")
+ .bottomLeft("1f5066")
+ .build())
+ .metaDataRating(List.of(
+ GetLibraryItemsMetaDataRating.builder()
+ .image("themoviedb://image.rating")
+ .value(3f)
+ .type("audience")
+ .build()))
+ .image(List.of(
+ GetLibraryItemsImage.builder()
+ .alt("Episode 1")
+ .type(GetLibraryItemsLibraryResponse200Type.BACKGROUND)
+ .url("/library/metadata/45521/thumb/1644710589")
+ .build()))
+ .titleSort("Whale")
+ .viewCount(1)
+ .lastViewedAt(1682752242)
+ .originalTitle("映画 ブラッククローバー 魔法帝の剣")
+ .viewOffset(5222500)
+ .skipCount(1)
+ .index(1)
+ .theme("/library/metadata/1/theme/1705636920")
+ .leafCount(14)
+ .viewedLeafCount(0)
+ .childCount(1)
+ .hasPremiumExtras("1")
+ .hasPremiumPrimaryExtra("1")
+ .parentRatingKey("66")
+ .parentGuid("plex://show/5d9c081b170e24001f2a7be4")
+ .parentStudio("UCP")
+ .parentKey("/library/metadata/66")
+ .parentTitle("Caprica")
+ .parentIndex(1)
+ .parentYear(2010)
+ .parentThumb("/library/metadata/66/thumb/1705716261")
+ .parentTheme("/library/metadata/66/theme/1705716261")
+ .build()))
+ .type(List.of(
+ GetLibraryItemsType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetLibraryItemsFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetLibraryItemsFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetLibraryItemsSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetLibraryItemsActiveDirection.Ascending)
+ .defaultDirection(GetLibraryItemsDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build(),
+ GetLibraryItemsSort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetLibraryItemsActiveDirection.Ascending)
+ .defaultDirection(GetLibraryItemsDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ GetLibraryItemsField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build()))
+ .fieldType(List.of(
+ GetLibraryItemsFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetLibraryItemsOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build(),
+ GetLibraryItemsFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetLibraryItemsOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build(),
+ GetLibraryItemsFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetLibraryItemsOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build()))
+ .nocache(true)
+ .viewMode(65592)
+ .mixedParents(true)
+ .meta(GetLibraryItemsMeta.builder()
+ .type(List.of(
+ GetLibraryItemsLibraryResponseType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetLibraryItemsLibraryFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetLibraryItemsLibrarySort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetLibraryItemsLibraryActiveDirection.Ascending)
+ .defaultDirection(GetLibraryItemsLibraryDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ GetLibraryItemsLibraryField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetLibraryItemsLibraryField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build(),
+ GetLibraryItemsLibraryResponseType.builder()
+ .key("/library/sections/2/all?type=2")
+ .type("show")
+ .title("TV Shows")
+ .active(false)
+ .filter(List.of(
+ GetLibraryItemsLibraryFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetLibraryItemsLibraryFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build(),
+ GetLibraryItemsLibraryFilter.builder()
+ .filter("genre")
+ .filterType("string")
+ .key("/library/sections/2/genre?type=2")
+ .title("Genre")
+ .type("filter")
+ .build()))
+ .sort(List.of(
+ GetLibraryItemsLibrarySort.builder()
+ .key("titleSort")
+ .title("Title")
+ .default_("asc")
+ .active(false)
+ .activeDirection(GetLibraryItemsLibraryActiveDirection.Ascending)
+ .defaultDirection(GetLibraryItemsLibraryDefaultDirection.Ascending)
+ .descKey("titleSort:desc")
+ .firstCharacterKey("/library/sections/2/firstCharacter")
+ .build()))
+ .field(List.of(
+ GetLibraryItemsLibraryField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetLibraryItemsLibraryField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build(),
+ GetLibraryItemsLibraryField.builder()
+ .key("show.title")
+ .title("Show Title")
+ .type("string")
+ .subType("rating")
+ .build()))
+ .build()))
+ .fieldType(List.of(
+ GetLibraryItemsLibraryFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetLibraryItemsLibraryOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build(),
+ GetLibraryItemsLibraryFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetLibraryItemsLibraryOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build(),
+ GetLibraryItemsLibraryFieldType.builder()
+ .type("tag")
+ .operator(List.of(
+ GetLibraryItemsLibraryOperator.builder()
+ .key("=")
+ .title("is")
+ .build()))
+ .build()))
+ .build())
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetRefreshLibraryMetadata() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata()
+ .sectionKey(9518)
+ .force(Force.ONE)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetSearchLibrary() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSearchLibraryResponse res = sdk.library().getSearchLibrary()
+ .sectionKey(9518)
+ .type(GetSearchLibraryQueryParamType.TvShow)
+ .call();
+
+ assertEquals(
+ GetSearchLibraryResponseBody.builder()
+ .mediaContainer(GetSearchLibraryMediaContainer.builder()
+ .size(2)
+ .allowSync(false)
+ .art("/:/resources/show-fanart.jpg")
+ .identifier("com.plexapp.plugins.library")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1698860922)
+ .nocache(true)
+ .thumb("/:/resources/show.png")
+ .title1("TV Shows")
+ .title2("Search for ''")
+ .viewGroup("season")
+ .viewMode(65593)
+ .metadata(List.of(
+ GetSearchLibraryMetadata.builder()
+ .ratingKey("2")
+ .key("/library/metadata/2/children")
+ .parentRatingKey("1")
+ .guid("plex://season/602e67e766dfdb002c0a1b5b")
+ .parentGuid("plex://show/5d9c086c7d06d9001ffd27aa")
+ .parentStudio("Mutant Enemy Productions")
+ .type("season")
+ .title("Season 1")
+ .parentKey("/library/metadata/1")
+ .parentTitle("Firefly")
+ .summary("Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship \"Serenity\". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government \"The Alliance\"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space.")
+ .index(1)
+ .parentIndex(1)
+ .parentYear(2002)
+ .thumb("/library/metadata/2/thumb/1705636920")
+ .art("/library/metadata/1/art/1705636920")
+ .parentThumb("/library/metadata/1/thumb/1705636920")
+ .parentTheme("/library/metadata/1/theme/1705636920")
+ .addedAt(1705636916)
+ .updatedAt(1705636920)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetMetaDataByRatingKey() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey()
+ .ratingKey(9518L)
+ .call();
+
+ assertEquals(
+ GetMetaDataByRatingKeyResponseBody.builder()
+ .mediaContainer(GetMetaDataByRatingKeyMediaContainer.builder()
+ .size(1)
+ .allowSync(true)
+ .identifier("com.plexapp.plugins.library")
+ .librarySectionID(1)
+ .librarySectionTitle("Movies")
+ .librarySectionUUID("cfc899d7-3000-46f6-8489-b9592714ada5")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1698860922)
+ .metadata(List.of(
+ GetMetaDataByRatingKeyMetadata.builder()
+ .ratingKey("17")
+ .key("/library/metadata/17")
+ .guid("plex://movie/5d77683f6f4521001ea9dc53")
+ .studio("Universal Pictures")
+ .type("movie")
+ .title("Serenity")
+ .librarySectionTitle("Movies")
+ .librarySectionID(1)
+ .librarySectionKey("/library/sections/1")
+ .contentRating("PG-13")
+ .summary("Serenity continues the story of the TV series it was based upon (\"Firefly\"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job.")
+ .rating(8.2d)
+ .audienceRating(9.1d)
+ .year(2005)
+ .tagline("They aim to misbehave.")
+ .thumb("/library/metadata/17/thumb/1705637165")
+ .art("/library/metadata/17/art/1705637165")
+ .duration(141417)
+ .originallyAvailableAt(LocalDate.parse("2005-09-29T00:00:00Z"))
+ .addedAt(1705637164)
+ .updatedAt(1705637165)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .hasPremiumPrimaryExtra("1")
+ .ratingImage("rottentomatoes://image.rating.ripe")
+ .media(List.of(
+ GetMetaDataByRatingKeyMedia.builder()
+ .id(15)
+ .duration(141417)
+ .bitrate(2278)
+ .width(1920)
+ .height(814)
+ .aspectRatio(2.35d)
+ .audioChannels(2)
+ .audioCodec("aac")
+ .videoCodec("h264")
+ .videoResolution("1080")
+ .container("mp4")
+ .videoFrameRate("24p")
+ .optimizedForStreaming(0)
+ .audioProfile("lc")
+ .has64bitOffsets(false)
+ .videoProfile("high")
+ .part(List.of(
+ GetMetaDataByRatingKeyPart.builder()
+ .id(15)
+ .key("/library/parts/15/1705637151/file.mp4")
+ .duration(141417)
+ .file("/movies/Serenity (2005)/Serenity (2005).mp4")
+ .size(40271948)
+ .audioProfile("lc")
+ .container("mp4")
+ .has64bitOffsets(false)
+ .optimizedForStreaming(false)
+ .videoProfile("high")
+ .stream(List.of(
+ GetMetaDataByRatingKeyStream.builder()
+ .id(29)
+ .streamType(2)
+ .default_(true)
+ .codec("aac")
+ .index(0)
+ .bitrate(128)
+ .bitDepth(8)
+ .chromaLocation("left")
+ .chromaSubsampling("14520")
+ .codedHeight(816)
+ .codedWidth(1920)
+ .colorPrimaries("bt709")
+ .colorRange("tv")
+ .colorSpace("bt709")
+ .colorTrc("bt709")
+ .frameRate(24)
+ .hasScalingMatrix(false)
+ .height(814)
+ .level(40)
+ .profile("lc")
+ .refFrames(4)
+ .scanType("progressive")
+ .streamIdentifier("1")
+ .width(1920)
+ .displayTitle("English (AAC Stereo)")
+ .extendedDisplayTitle("English (AAC Stereo)")
+ .selected(true)
+ .channels(2)
+ .language("English")
+ .languageTag("en")
+ .languageCode("eng")
+ .samplingRate(44100)
+ .build()))
+ .build()))
+ .build()))
+ .genre(List.of(
+ GetMetaDataByRatingKeyGenre.builder()
+ .id(184)
+ .filter("genre=184")
+ .tag("Thriller")
+ .build()))
+ .country(List.of(
+ GetMetaDataByRatingKeyCountry.builder()
+ .id(116)
+ .filter("country=116")
+ .tag("United States of America")
+ .build()))
+ .guids(List.of(
+ Guids.builder()
+ .id("tvdb://2337")
+ .build()))
+ .ratings(List.of(
+ Ratings.builder()
+ .image("themoviedb://image.rating")
+ .value(7.4d)
+ .type("audience")
+ .build()))
+ .director(List.of(
+ GetMetaDataByRatingKeyDirector.builder()
+ .id(130)
+ .filter("director=130")
+ .tag("Joss Whedon")
+ .tagKey("5d776828880197001ec90e8f")
+ .thumb("https://metadata-static.plex.tv/people/5d776828880197001ec90e8f.jpg")
+ .build()))
+ .writer(List.of(
+ GetMetaDataByRatingKeyWriter.builder()
+ .id(132)
+ .filter("writer=132")
+ .tag("Joss Whedon")
+ .tagKey("5d776828880197001ec90e8f")
+ .thumb("https://metadata-static.plex.tv/people/5d776828880197001ec90e8f.jpg")
+ .build()))
+ .role(List.of(
+ GetMetaDataByRatingKeyRole.builder()
+ .id(220)
+ .filter("actor=220")
+ .tag("Dennis Keiffer")
+ .tagKey("5d77683554f42c001f8c4708")
+ .role("Bar Guy (uncredited)")
+ .thumb("https://metadata-static.plex.tv/6/people/648e9a7ea1d537bccfcd7615134b78ce.jpg")
+ .build()))
+ .producer(List.of(
+ Producer.builder()
+ .id(221)
+ .filter("producer=221")
+ .tag("Barry Mendel")
+ .tagKey("5d776826961905001eb90e2b")
+ .thumb("https://metadata-static.plex.tv/8/people/87877371326a964634d18556d94547e1.jpg")
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetMetadataChildren_IncludeStream() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
+ .ratingKey(6818.20d)
+ .includeElements("")
+ .call();
+
+ assertEquals(
+ GetMetadataChildrenResponseBody.builder()
+ .mediaContainer(GetMetadataChildrenMediaContainer.builder()
+ .size(3)
+ .allowSync(true)
+ .art("/library/metadata/30072/art/1705739923")
+ .identifier("com.plexapp.plugins.library")
+ .key("30072")
+ .librarySectionID(2)
+ .librarySectionTitle("TV Shows")
+ .librarySectionUUID("4bb2521c-8ba9-459b-aaee-8ab8bc35eabd")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1701731894)
+ .nocache(true)
+ .parentIndex(1)
+ .parentTitle("Reacher")
+ .parentYear(2022)
+ .summary("When retired Military Police Officer Jack Reacher is arrested for a murder he did not commit, he finds himself in the middle of a deadly conspiracy full of dirty cops, shady businessmen, and scheming politicians. With nothing but his wits, he must figure out what is happening in Margrave, Georgia.")
+ .theme("/library/metadata/30072/theme/1705739923")
+ .thumb("/library/metadata/30072/thumb/1705739923")
+ .title1("TV Shows")
+ .title2("Reacher")
+ .viewGroup("season")
+ .viewMode(65593)
+ .directory(List.of(
+ GetMetadataChildrenDirectory.builder()
+ .leafCount(16)
+ .thumb("/library/metadata/30072/thumb/1705739923")
+ .viewedLeafCount(16)
+ .key("/library/metadata/30072/allLeaves")
+ .title("All episodes")
+ .build()))
+ .metadata(List.of(
+ GetMetadataChildrenMetadata.builder()
+ .ratingKey("66488")
+ .key("/library/metadata/66488/children")
+ .parentRatingKey("30072")
+ .guid("plex://season/652aea6549508477c34c6000")
+ .parentGuid("plex://show/5d9c09190aaccd001f8f42f0")
+ .parentStudio("Amazon Studios")
+ .type("season")
+ .title("Season 2")
+ .parentKey("/library/metadata/30072")
+ .parentTitle("Reacher")
+ .summary("Based on\"Bad Luck and Trouble,\" when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind—revenge.")
+ .index(2)
+ .parentIndex(1)
+ .viewCount(11)
+ .lastViewedAt(1705646565)
+ .parentYear(2022)
+ .thumb("/library/metadata/66488/thumb/1703065033")
+ .art("/library/metadata/30072/art/1705739923")
+ .parentThumb("/library/metadata/30072/thumb/1705739923")
+ .parentTheme("/library/metadata/30072/theme/1705739923")
+ .leafCount(8)
+ .viewedLeafCount(8)
+ .addedAt(1702602021)
+ .updatedAt(1703065033)
+ .userRating(9)
+ .skipCount(1)
+ .lastRatedAt(1703881224)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetMetadataChildren_IncludeStreamOtheritem() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
+ .ratingKey(3595.08d)
+ .includeElements("")
+ .call();
+
+ assertEquals(
+ GetMetadataChildrenResponseBody.builder()
+ .mediaContainer(GetMetadataChildrenMediaContainer.builder()
+ .size(3)
+ .allowSync(true)
+ .art("/library/metadata/30072/art/1705739923")
+ .identifier("com.plexapp.plugins.library")
+ .key("30072")
+ .librarySectionID(2)
+ .librarySectionTitle("TV Shows")
+ .librarySectionUUID("4bb2521c-8ba9-459b-aaee-8ab8bc35eabd")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1701731894)
+ .nocache(true)
+ .parentIndex(1)
+ .parentTitle("Reacher")
+ .parentYear(2022)
+ .summary("When retired Military Police Officer Jack Reacher is arrested for a murder he did not commit, he finds himself in the middle of a deadly conspiracy full of dirty cops, shady businessmen, and scheming politicians. With nothing but his wits, he must figure out what is happening in Margrave, Georgia.")
+ .theme("/library/metadata/30072/theme/1705739923")
+ .thumb("/library/metadata/30072/thumb/1705739923")
+ .title1("TV Shows")
+ .title2("Reacher")
+ .viewGroup("season")
+ .viewMode(65593)
+ .directory(List.of(
+ GetMetadataChildrenDirectory.builder()
+ .leafCount(16)
+ .thumb("/library/metadata/30072/thumb/1705739923")
+ .viewedLeafCount(16)
+ .key("/library/metadata/30072/allLeaves")
+ .title("All episodes")
+ .build()))
+ .metadata(List.of(
+ GetMetadataChildrenMetadata.builder()
+ .ratingKey("66488")
+ .key("/library/metadata/66488/children")
+ .parentRatingKey("30072")
+ .guid("plex://season/652aea6549508477c34c6000")
+ .parentGuid("plex://show/5d9c09190aaccd001f8f42f0")
+ .parentStudio("Amazon Studios")
+ .type("season")
+ .title("Season 2")
+ .parentKey("/library/metadata/30072")
+ .parentTitle("Reacher")
+ .summary("Based on\"Bad Luck and Trouble,\" when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind—revenge.")
+ .index(2)
+ .parentIndex(1)
+ .viewCount(11)
+ .lastViewedAt(1705646565)
+ .parentYear(2022)
+ .thumb("/library/metadata/66488/thumb/1703065033")
+ .art("/library/metadata/30072/art/1705739923")
+ .parentThumb("/library/metadata/30072/thumb/1705739923")
+ .parentTheme("/library/metadata/30072/theme/1705739923")
+ .leafCount(8)
+ .viewedLeafCount(8)
+ .addedAt(1702602021)
+ .updatedAt(1703065033)
+ .userRating(9)
+ .skipCount(1)
+ .lastRatedAt(1703881224)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetMetadataChildren_IncludeStreamOtheritemAnotheritem() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
+ .ratingKey(4370.32d)
+ .includeElements("")
+ .call();
+
+ assertEquals(
+ GetMetadataChildrenResponseBody.builder()
+ .mediaContainer(GetMetadataChildrenMediaContainer.builder()
+ .size(3)
+ .allowSync(true)
+ .art("/library/metadata/30072/art/1705739923")
+ .identifier("com.plexapp.plugins.library")
+ .key("30072")
+ .librarySectionID(2)
+ .librarySectionTitle("TV Shows")
+ .librarySectionUUID("4bb2521c-8ba9-459b-aaee-8ab8bc35eabd")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1701731894)
+ .nocache(true)
+ .parentIndex(1)
+ .parentTitle("Reacher")
+ .parentYear(2022)
+ .summary("When retired Military Police Officer Jack Reacher is arrested for a murder he did not commit, he finds himself in the middle of a deadly conspiracy full of dirty cops, shady businessmen, and scheming politicians. With nothing but his wits, he must figure out what is happening in Margrave, Georgia.")
+ .theme("/library/metadata/30072/theme/1705739923")
+ .thumb("/library/metadata/30072/thumb/1705739923")
+ .title1("TV Shows")
+ .title2("Reacher")
+ .viewGroup("season")
+ .viewMode(65593)
+ .directory(List.of(
+ GetMetadataChildrenDirectory.builder()
+ .leafCount(16)
+ .thumb("/library/metadata/30072/thumb/1705739923")
+ .viewedLeafCount(16)
+ .key("/library/metadata/30072/allLeaves")
+ .title("All episodes")
+ .build()))
+ .metadata(List.of(
+ GetMetadataChildrenMetadata.builder()
+ .ratingKey("66488")
+ .key("/library/metadata/66488/children")
+ .parentRatingKey("30072")
+ .guid("plex://season/652aea6549508477c34c6000")
+ .parentGuid("plex://show/5d9c09190aaccd001f8f42f0")
+ .parentStudio("Amazon Studios")
+ .type("season")
+ .title("Season 2")
+ .parentKey("/library/metadata/30072")
+ .parentTitle("Reacher")
+ .summary("Based on\"Bad Luck and Trouble,\" when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind—revenge.")
+ .index(2)
+ .parentIndex(1)
+ .viewCount(11)
+ .lastViewedAt(1705646565)
+ .parentYear(2022)
+ .thumb("/library/metadata/66488/thumb/1703065033")
+ .art("/library/metadata/30072/art/1705739923")
+ .parentThumb("/library/metadata/30072/thumb/1705739923")
+ .parentTheme("/library/metadata/30072/theme/1705739923")
+ .leafCount(8)
+ .viewedLeafCount(8)
+ .addedAt(1702602021)
+ .updatedAt(1703065033)
+ .userRating(9)
+ .skipCount(1)
+ .lastRatedAt(1703881224)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetTopWatchedContent_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent()
+ .type(GetTopWatchedContentQueryParamType.TvShow)
+ .includeGuids(1L)
+ .call();
+
+ assertEquals(
+ GetTopWatchedContentResponseBody.builder()
+ .mediaContainer(GetTopWatchedContentMediaContainer.builder()
+ .size(1)
+ .allowSync(true)
+ .identifier("com.plexapp.plugins.library")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1698860922)
+ .metadata(List.of(
+ GetTopWatchedContentMetadata.builder()
+ .ratingKey("17")
+ .key("/library/metadata/17")
+ .guid("plex://movie/5d77683f6f4521001ea9dc53")
+ .slug("waterloo-road")
+ .studio("Universal Pictures")
+ .type("movie")
+ .title("Serenity")
+ .librarySectionTitle("Movies")
+ .librarySectionID(1)
+ .librarySectionKey("/library/sections/1")
+ .contentRating("PG-13")
+ .summary("Serenity continues the story of the TV series it was based upon (\"Firefly\"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job.")
+ .index(1L)
+ .audienceRating(9.1d)
+ .year(2005)
+ .tagline("They aim to misbehave.")
+ .thumb("/library/metadata/17/thumb/1705637165")
+ .art("/library/metadata/17/art/1705637165")
+ .duration(141417)
+ .originallyAvailableAt(LocalDate.parse("2005-09-29T00:00:00Z"))
+ .leafCount(222L)
+ .viewedLeafCount(100L)
+ .childCount(13L)
+ .addedAt(1705637164)
+ .updatedAt(1705637165)
+ .globalViewCount(80L)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .genre(List.of(
+ GetTopWatchedContentGenre.builder()
+ .id(184)
+ .filter("genre=184")
+ .tag("Thriller")
+ .build()))
+ .country(List.of(
+ GetTopWatchedContentCountry.builder()
+ .id(116)
+ .filter("country=116")
+ .tag("United States of America")
+ .build()))
+ .guids(List.of(
+ GetTopWatchedContentGuids.builder()
+ .id("tvdb://2337")
+ .build()))
+ .role(List.of(
+ GetTopWatchedContentRole.builder()
+ .id(220)
+ .filter("actor=220")
+ .tag("Dennis Keiffer")
+ .tagKey("5d77683554f42c001f8c4708")
+ .role("Bar Guy (uncredited)")
+ .thumb("https://metadata-static.plex.tv/6/people/648e9a7ea1d537bccfcd7615134b78ce.jpg")
+ .build()))
+ .user(List.of(
+ User.builder()
+ .id(220)
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLibrary_GetOnDeck() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetOnDeckResponse res = sdk.library().getOnDeck()
+ .call();
+
+ assertEquals(
+ GetOnDeckResponseBody.builder()
+ .mediaContainer(GetOnDeckMediaContainer.builder()
+ .size(16d)
+ .identifier("com.plexapp.plugins.library")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1680021154d)
+ .metadata(List.of(
+ GetOnDeckMetadata.builder()
+ .librarySectionID(2d)
+ .librarySectionTitle("TV Shows")
+ .librarySectionUUID("4bb2521c-8ba9-459b-aaee-8ab8bc35eabd")
+ .ratingKey(49564d)
+ .key("/library/metadata/49564")
+ .parentRatingKey(49557d)
+ .grandparentRatingKey(49556d)
+ .guid("plex://episode/5ea7d7402e7ab10042e74d4f")
+ .parentGuid("plex://season/602e754d67f4c8002ce54b3d")
+ .grandparentGuid("plex://show/5d9c090e705e7a001e6e94d8")
+ .type("episode")
+ .title("Circus")
+ .grandparentKey("/library/metadata/49556")
+ .parentKey("/library/metadata/49557")
+ .librarySectionKey("/library/sections/2")
+ .grandparentTitle("Bluey (2018)")
+ .parentTitle("Season 2")
+ .contentRating("TV-Y")
+ .summary("Bluey is the ringmaster in a game of circus with her friends but Hercules wants to play his motorcycle game instead. Luckily Bluey has a solution to keep everyone happy.")
+ .index(33d)
+ .parentIndex(2d)
+ .lastViewedAt(1681908352d)
+ .year(2018d)
+ .thumb("/library/metadata/49564/thumb/1654258204")
+ .art("/library/metadata/49556/art/1680939546")
+ .parentThumb("/library/metadata/49557/thumb/1654258204")
+ .grandparentThumb("/library/metadata/49556/thumb/1680939546")
+ .grandparentArt("/library/metadata/49556/art/1680939546")
+ .grandparentTheme("/library/metadata/49556/theme/1680939546")
+ .duration(420080d)
+ .originallyAvailableAt(OffsetDateTime.parse("2020-10-31T00:00:00Z"))
+ .addedAt(1654258196d)
+ .updatedAt(1654258204d)
+ .media(List.of(
+ GetOnDeckMedia.builder()
+ .id(80994d)
+ .duration(420080d)
+ .bitrate(1046d)
+ .width(1920d)
+ .height(1080d)
+ .aspectRatio(1.78d)
+ .audioChannels(2d)
+ .audioCodec("aac")
+ .videoCodec("hevc")
+ .videoResolution("1080")
+ .container("mkv")
+ .videoFrameRate("PAL")
+ .audioProfile("lc")
+ .videoProfile("main")
+ .part(List.of(
+ GetOnDeckPart.builder()
+ .id(80994d)
+ .key("/library/parts/80994/1655007810/file.mkv")
+ .duration(420080d)
+ .file("/tvshows/Bluey (2018)/Bluey (2018) - S02E33 - Circus.mkv")
+ .size(55148931d)
+ .audioProfile("lc")
+ .container("mkv")
+ .videoProfile("main")
+ .stream(List.of(
+ GetOnDeckStream.builder()
+ .id(211234d)
+ .streamType(1d)
+ .codec("hevc")
+ .index(0d)
+ .bitrate(918d)
+ .language("English")
+ .languageTag("en")
+ .languageCode("eng")
+ .bitDepth(8d)
+ .chromaLocation("left")
+ .chromaSubsampling("4:2:0")
+ .codedHeight(1080d)
+ .codedWidth(1920d)
+ .colorRange("tv")
+ .frameRate(25d)
+ .height(1080d)
+ .level(120d)
+ .profile("main")
+ .refFrames(1d)
+ .width(1920d)
+ .displayTitle("1080p (HEVC Main)")
+ .extendedDisplayTitle("1080p (HEVC Main)")
+ .build()))
+ .build()))
+ .build()))
+ .guids(List.of(
+ GetOnDeckGuids.builder()
+ .id("imdb://tt13303712")
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/LogTests.java b/src/test/java/dev/plexapi/sdk/LogTests.java
new file mode 100644
index 00000000..30d64778
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/LogTests.java
@@ -0,0 +1,85 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import dev.plexapi.sdk.models.operations.EnablePaperTrailResponse;
+import dev.plexapi.sdk.models.operations.Level;
+import dev.plexapi.sdk.models.operations.LogLineResponse;
+import dev.plexapi.sdk.models.operations.LogMultiLineResponse;
+import java.lang.Exception;
+import java.lang.String;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class LogTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLog_LogLine() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ LogLineResponse res = sdk.log().logLine()
+ .level(Level.ZERO)
+ .message("Test log message")
+ .source("Postman")
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLog_LogMultiLine() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman
+ level=1&message=Test%20message%203&source=postman";
+
+ LogMultiLineResponse res = sdk.log().logMultiLine()
+ .request(req)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testLog_EnablePaperTrail() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ EnablePaperTrailResponse res = sdk.log().enablePaperTrail()
+ .call();
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/MediaTests.java b/src/test/java/dev/plexapi/sdk/MediaTests.java
new file mode 100644
index 00000000..7bf248ed
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/MediaTests.java
@@ -0,0 +1,145 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import dev.plexapi.sdk.models.operations.GetBannerImageRequest;
+import dev.plexapi.sdk.models.operations.GetBannerImageResponse;
+import dev.plexapi.sdk.models.operations.GetThumbImageRequest;
+import dev.plexapi.sdk.models.operations.GetThumbImageResponse;
+import dev.plexapi.sdk.models.operations.MarkPlayedResponse;
+import dev.plexapi.sdk.models.operations.MarkUnplayedResponse;
+import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse;
+import java.lang.Exception;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class MediaTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testMedia_MarkPlayed() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ MarkPlayedResponse res = sdk.media().markPlayed()
+ .key(59398d)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testMedia_MarkUnplayed() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ MarkUnplayedResponse res = sdk.media().markUnplayed()
+ .key(59398d)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testMedia_UpdatePlayProgress_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
+ .key("")
+ .time(90000d)
+ .state("played")
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testMedia_GetBannerImage() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetBannerImageRequest req = GetBannerImageRequest.builder()
+ .ratingKey(9518L)
+ .width(396L)
+ .height(396L)
+ .minSize(1L)
+ .upscale(1L)
+ .xPlexToken("CV5xoxjTpFKUzBTShsaf")
+ .build();
+
+ GetBannerImageResponse res = sdk.media().getBannerImage()
+ .request(req)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testMedia_GetThumbImage() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetThumbImageRequest req = GetThumbImageRequest.builder()
+ .ratingKey(9518L)
+ .width(396L)
+ .height(396L)
+ .minSize(1L)
+ .upscale(1L)
+ .xPlexToken("CV5xoxjTpFKUzBTShsaf")
+ .build();
+
+ GetThumbImageResponse res = sdk.media().getThumbImage()
+ .request(req)
+ .call();
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/PlaylistsTests.java b/src/test/java/dev/plexapi/sdk/PlaylistsTests.java
new file mode 100644
index 00000000..5ec0d118
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/PlaylistsTests.java
@@ -0,0 +1,451 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.AddPlaylistContentsMediaContainer;
+import dev.plexapi.sdk.models.operations.AddPlaylistContentsMetadata;
+import dev.plexapi.sdk.models.operations.AddPlaylistContentsResponse;
+import dev.plexapi.sdk.models.operations.AddPlaylistContentsResponseBody;
+import dev.plexapi.sdk.models.operations.ClearPlaylistContentsResponse;
+import dev.plexapi.sdk.models.operations.CreatePlaylistMediaContainer;
+import dev.plexapi.sdk.models.operations.CreatePlaylistMetadata;
+import dev.plexapi.sdk.models.operations.CreatePlaylistQueryParamType;
+import dev.plexapi.sdk.models.operations.CreatePlaylistRequest;
+import dev.plexapi.sdk.models.operations.CreatePlaylistResponse;
+import dev.plexapi.sdk.models.operations.CreatePlaylistResponseBody;
+import dev.plexapi.sdk.models.operations.DeletePlaylistResponse;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsCountry;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsDirector;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsGenre;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsMedia;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsMetadata;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsPart;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsQueryParamType;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsResponse;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsResponseBody;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsRole;
+import dev.plexapi.sdk.models.operations.GetPlaylistContentsWriter;
+import dev.plexapi.sdk.models.operations.GetPlaylistMediaContainer;
+import dev.plexapi.sdk.models.operations.GetPlaylistMetadata;
+import dev.plexapi.sdk.models.operations.GetPlaylistResponse;
+import dev.plexapi.sdk.models.operations.GetPlaylistResponseBody;
+import dev.plexapi.sdk.models.operations.GetPlaylistsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetPlaylistsMetadata;
+import dev.plexapi.sdk.models.operations.GetPlaylistsResponse;
+import dev.plexapi.sdk.models.operations.GetPlaylistsResponseBody;
+import dev.plexapi.sdk.models.operations.PlaylistType;
+import dev.plexapi.sdk.models.operations.QueryParamForce;
+import dev.plexapi.sdk.models.operations.QueryParamSmart;
+import dev.plexapi.sdk.models.operations.Smart;
+import dev.plexapi.sdk.models.operations.UpdatePlaylistResponse;
+import dev.plexapi.sdk.models.operations.UploadPlaylistResponse;
+import java.lang.Exception;
+import java.time.LocalDate;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class PlaylistsTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_CreatePlaylist() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ CreatePlaylistRequest req = CreatePlaylistRequest.builder()
+ .title("")
+ .type(CreatePlaylistQueryParamType.PHOTO)
+ .smart(Smart.ONE)
+ .uri("https://comfortable-eyebrow.info/")
+ .build();
+
+ CreatePlaylistResponse res = sdk.playlists().createPlaylist()
+ .request(req)
+ .call();
+
+ assertEquals(
+ CreatePlaylistResponseBody.builder()
+ .mediaContainer(CreatePlaylistMediaContainer.builder()
+ .size(7)
+ .metadata(List.of(
+ CreatePlaylistMetadata.builder()
+ .ratingKey("96")
+ .key("/playlists/96/items")
+ .guid("com.plexapp.agents.none://a2f92937-1408-40e2-b022-63a8a9377e55")
+ .type("playlist")
+ .title("A Great Playlist")
+ .summary("What a great playlist")
+ .smart(false)
+ .playlistType("video")
+ .icon("playlist://image.smart")
+ .viewCount(1)
+ .lastViewedAt(1705719589)
+ .leafCount(1)
+ .addedAt(1705719589)
+ .updatedAt(1705724593)
+ .composite("/playlists/96/composite/1705724593")
+ .duration(141000)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_GetPlaylists() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetPlaylistsResponse res = sdk.playlists().getPlaylists()
+ .playlistType(PlaylistType.VIDEO)
+ .smart(QueryParamSmart.ZERO)
+ .call();
+
+ assertEquals(
+ GetPlaylistsResponseBody.builder()
+ .mediaContainer(GetPlaylistsMediaContainer.builder()
+ .size(4)
+ .metadata(List.of(
+ GetPlaylistsMetadata.builder()
+ .ratingKey("92")
+ .key("/playlists/92/items")
+ .guid("com.plexapp.agents.none://7ca5aaef-58e8-4828-9e21-c009c97f2903")
+ .type("playlist")
+ .title("Static Playlist")
+ .summary("A Great Playlist")
+ .smart(false)
+ .playlistType("video")
+ .composite("/playlists/92/composite/1705716440")
+ .icon("playlist://image.smart")
+ .viewCount(1)
+ .lastViewedAt(1705716298)
+ .duration(7328000)
+ .leafCount(32)
+ .addedAt(1705716298)
+ .updatedAt(1705716440)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_GetPlaylist() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetPlaylistResponse res = sdk.playlists().getPlaylist()
+ .playlistID(9883.74d)
+ .call();
+
+ assertEquals(
+ GetPlaylistResponseBody.builder()
+ .mediaContainer(GetPlaylistMediaContainer.builder()
+ .size(1)
+ .metadata(List.of(
+ GetPlaylistMetadata.builder()
+ .content("library://x/directory/%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1%26push%3D1%26title%3D2%26or%3D1%26title%3DSerenity%26pop%3D1")
+ .ratingKey("95")
+ .key("/playlists/95/items")
+ .guid("com.plexapp.agents.none://87425529-380f-44b8-a689-9a0537e7ec91")
+ .type("playlist")
+ .title("Smart Movie Playlist")
+ .summary("")
+ .smart(true)
+ .playlistType("video")
+ .composite("/playlists/95/composite/1705717387")
+ .icon("playlist://image.smart")
+ .duration(282000)
+ .leafCount(2)
+ .addedAt(1705716493)
+ .updatedAt(1705717387)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_DeletePlaylist() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ DeletePlaylistResponse res = sdk.playlists().deletePlaylist()
+ .playlistID(1020.45d)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_UpdatePlaylist() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
+ .playlistID(2088.77d)
+ .title("")
+ .summary("")
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_GetPlaylistContents() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents()
+ .playlistID(1613.10d)
+ .type(GetPlaylistContentsQueryParamType.TvShow)
+ .call();
+
+ assertEquals(
+ GetPlaylistContentsResponseBody.builder()
+ .mediaContainer(GetPlaylistContentsMediaContainer.builder()
+ .size(2)
+ .composite("/playlists/95/composite/1705717521")
+ .duration(282)
+ .leafCount(2)
+ .playlistType("video")
+ .ratingKey("95")
+ .smart(true)
+ .title("Smart Movie Playlist")
+ .metadata(List.of(
+ GetPlaylistContentsMetadata.builder()
+ .ratingKey("17")
+ .key("/library/metadata/17")
+ .guid("plex://movie/5d77683f6f4521001ea9dc53")
+ .studio("Universal Pictures")
+ .type("movie")
+ .title("Serenity")
+ .titleSort("Amazing Spider-Man 2")
+ .librarySectionTitle("Movies")
+ .librarySectionID(1)
+ .librarySectionKey("/library/sections/1")
+ .contentRating("PG-13")
+ .summary("Serenity continues the story of the TV series it was based upon (\"Firefly\"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job.")
+ .rating(8.2d)
+ .audienceRating(9.1d)
+ .year(2005)
+ .tagline("They aim to misbehave.")
+ .thumb("/library/metadata/17/thumb/1705637165")
+ .art("/library/metadata/17/art/1705637165")
+ .duration(141416)
+ .originallyAvailableAt(LocalDate.parse("2005-09-29T00:00:00Z"))
+ .addedAt(1705637164)
+ .updatedAt(1705637165)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .hasPremiumExtras("1")
+ .hasPremiumPrimaryExtra("1")
+ .ratingImage("rottentomatoes://image.rating.ripe")
+ .media(List.of(
+ GetPlaylistContentsMedia.builder()
+ .id(15)
+ .duration(141416)
+ .bitrate(2273)
+ .width(1920)
+ .height(814)
+ .aspectRatio(2.35d)
+ .audioChannels(2)
+ .audioCodec("aac")
+ .videoCodec("h264")
+ .videoResolution("1080")
+ .container("mp4")
+ .videoFrameRate("24p")
+ .optimizedForStreaming(0)
+ .audioProfile("lc")
+ .has64bitOffsets(false)
+ .videoProfile("high")
+ .part(List.of(
+ GetPlaylistContentsPart.builder()
+ .id(15)
+ .key("/library/parts/15/1705637151/file.mp4")
+ .duration(141416)
+ .file("/movies/Serenity (2005)/Serenity (2005).mp4")
+ .size(40271948)
+ .audioProfile("lc")
+ .container("mp4")
+ .has64bitOffsets(false)
+ .optimizedForStreaming(false)
+ .videoProfile("high")
+ .build()))
+ .build()))
+ .genre(List.of(
+ GetPlaylistContentsGenre.builder()
+ .tag("Action")
+ .build()))
+ .country(List.of(
+ GetPlaylistContentsCountry.builder()
+ .tag("United States of America")
+ .build()))
+ .director(List.of(
+ GetPlaylistContentsDirector.builder()
+ .tag("Joss Whedon")
+ .build()))
+ .writer(List.of(
+ GetPlaylistContentsWriter.builder()
+ .tag("Joss Whedon")
+ .build()))
+ .role(List.of(
+ GetPlaylistContentsRole.builder()
+ .tag("Gina Torres")
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_ClearPlaylistContents() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents()
+ .playlistID(6531.08d)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_AddPlaylistContents() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents()
+ .playlistID(2532.92d)
+ .uri("server://12345/com.plexapp.plugins.library/library/metadata/1")
+ .playQueueID(123d)
+ .call();
+
+ assertEquals(
+ AddPlaylistContentsResponseBody.builder()
+ .mediaContainer(AddPlaylistContentsMediaContainer.builder()
+ .size(1)
+ .leafCountAdded(1)
+ .leafCountRequested(1)
+ .metadata(List.of(
+ AddPlaylistContentsMetadata.builder()
+ .ratingKey("94")
+ .key("/playlists/94/items")
+ .guid("com.plexapp.agents.none://972e3047-83d6-4848-a000-261f0af26ba2")
+ .type("playlist")
+ .title("A great playlist")
+ .summary("One of my great playlists")
+ .smart(false)
+ .playlistType("video")
+ .composite("/playlists/94/composite/1705800070")
+ .duration(423000)
+ .leafCount(3)
+ .addedAt(1705716458)
+ .updatedAt(1705800070)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlaylists_UploadPlaylist() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ UploadPlaylistResponse res = sdk.playlists().uploadPlaylist()
+ .path("/home/barkley/playlist.m3u")
+ .force(QueryParamForce.ZERO)
+ .sectionID(1L)
+ .call();
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/PlexTests.java b/src/test/java/dev/plexapi/sdk/PlexTests.java
new file mode 100644
index 00000000..7fe1c3f5
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/PlexTests.java
@@ -0,0 +1,336 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.Connections;
+import dev.plexapi.sdk.models.operations.Friend;
+import dev.plexapi.sdk.models.operations.GeoData;
+import dev.plexapi.sdk.models.operations.GetCompanionsDataResponse;
+import dev.plexapi.sdk.models.operations.GetGeoDataGeoData;
+import dev.plexapi.sdk.models.operations.GetGeoDataResponse;
+import dev.plexapi.sdk.models.operations.GetHomeDataResponse;
+import dev.plexapi.sdk.models.operations.GetHomeDataResponseBody;
+import dev.plexapi.sdk.models.operations.GetPinAuthPinContainer;
+import dev.plexapi.sdk.models.operations.GetPinRequest;
+import dev.plexapi.sdk.models.operations.GetPinResponse;
+import dev.plexapi.sdk.models.operations.GetServerResourcesResponse;
+import dev.plexapi.sdk.models.operations.GetTokenByPinIdAuthPinContainer;
+import dev.plexapi.sdk.models.operations.GetTokenByPinIdGeoData;
+import dev.plexapi.sdk.models.operations.GetTokenByPinIdRequest;
+import dev.plexapi.sdk.models.operations.GetTokenByPinIdResponse;
+import dev.plexapi.sdk.models.operations.GetUserFriendsResponse;
+import dev.plexapi.sdk.models.operations.IncludeHttps;
+import dev.plexapi.sdk.models.operations.IncludeIPv6;
+import dev.plexapi.sdk.models.operations.IncludeRelay;
+import dev.plexapi.sdk.models.operations.PlexDevice;
+import dev.plexapi.sdk.models.operations.Protocol;
+import dev.plexapi.sdk.models.operations.ResponseBody;
+import dev.plexapi.sdk.models.operations.SharedServers;
+import dev.plexapi.sdk.models.operations.SharedSources;
+import dev.plexapi.sdk.models.operations.Status;
+import java.lang.Exception;
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.Optional;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+public class PlexTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlex_GetCompanionsData() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
+ .call();
+
+ assertEquals(
+ List.of(
+ ResponseBody.builder()
+ .identifier("tv.plex.sonos")
+ .baseURL("https://sonos.plex.tv")
+ .title("Sonos")
+ .linkURL("https://sonos.plex.tv/link")
+ .provides("client,player")
+ .token("")
+ .build()),
+ res.responseBodies().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlex_GetUserFriends() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetUserFriendsResponse res = sdk.plex().getUserFriends()
+ .call();
+
+ assertEquals(
+ List.of(
+ Friend.builder()
+ .email("username@email.com")
+ .friendlyName(Optional.empty())
+ .home(false)
+ .id(437587)
+ .sharedServers(List.of(
+ SharedServers.builder()
+ .build()))
+ .sharedSources(List.of(
+ SharedSources.builder()
+ .build()))
+ .status(Status.ACCEPTED)
+ .thumb("https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578")
+ .title("username123")
+ .username("username123")
+ .uuid("7d1916e0d8f6e76b")
+ .restricted(false)
+ .build()),
+ res.friends().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlex_GetGeoData() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetGeoDataResponse res = sdk.plex().getGeoData()
+ .call();
+
+ assertEquals(
+ GetGeoDataGeoData.builder()
+ .code("VI")
+ .continentCode("NA")
+ .country("United States Virgin Islands")
+ .city("Amsterdam")
+ .timeZone("America/St_Thomas")
+ .postalCode("802")
+ .subdivisions("Saint Thomas")
+ .coordinates("18.3381, -64.8941")
+ .europeanUnionMember(true)
+ .inPrivacyRestrictedCountry(true)
+ .inPrivacyRestrictedRegion(true)
+ .build(),
+ res.geoData().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlex_GetHomeData() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetHomeDataResponse res = sdk.plex().getHomeData()
+ .call();
+
+ assertEquals(
+ GetHomeDataResponseBody.builder()
+ .id(1841489d)
+ .name("Blindkitty38's home")
+ .guestUserID(58815432d)
+ .guestUserUUID("f3df4e01bfca0787")
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlex_GetServerResources() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetServerResourcesResponse res = sdk.plex().getServerResources()
+ .includeHttps(IncludeHttps.Enable)
+ .includeRelay(IncludeRelay.Enable)
+ .includeIPv6(IncludeIPv6.Enable)
+ .call();
+
+ assertEquals(
+ List.of(
+ PlexDevice.builder()
+ .name("")
+ .product("Small Wooden Fish")
+ .productVersion("")
+ .platform("")
+ .platformVersion("")
+ .device("Mobile")
+ .clientIdentifier("")
+ .createdAt(OffsetDateTime.parse("2019-06-24T11:38:02Z"))
+ .lastSeenAt(OffsetDateTime.parse("2019-06-24T11:38:02Z"))
+ .provides("")
+ .ownerId(528895L)
+ .sourceTitle("")
+ .publicAddress("")
+ .accessToken("")
+ .owned(false)
+ .home(false)
+ .synced(false)
+ .relay(false)
+ .presence(false)
+ .httpsRequired(false)
+ .publicAddressMatches(false)
+ .dnsRebindingProtection(false)
+ .natLoopbackSupported(false)
+ .connections(List.of(
+ Connections.builder()
+ .protocol(Protocol.HTTP)
+ .address("9000 Station Road")
+ .port(57017)
+ .uri("https://steep-independence.net")
+ .local(false)
+ .relay(false)
+ .iPv6(false)
+ .build()))
+ .build()),
+ res.plexDevices().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlex_GetPin_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetPinRequest req = GetPinRequest.builder()
+ .build();
+
+ GetPinResponse res = sdk.plex().getPin()
+ .request(req)
+ .call();
+
+ assertEquals(
+ GetPinAuthPinContainer.builder()
+ .id(308667304L)
+ .code("7RQZ")
+ .product("Tautulli")
+ .qr("https://plex.tv/api/v2/pins/qr/7RQZ")
+ .clientIdentifier("Tautulli")
+ .location(GeoData.builder()
+ .code("VI")
+ .continentCode("NA")
+ .country("United States Virgin Islands")
+ .city("Amsterdam")
+ .timeZone("America/St_Thomas")
+ .postalCode("802")
+ .subdivisions("Saint Thomas")
+ .coordinates("18.3381, -64.8941")
+ .europeanUnionMember(true)
+ .inPrivacyRestrictedCountry(true)
+ .inPrivacyRestrictedRegion(true)
+ .build())
+ .createdAt(OffsetDateTime.parse("2024-07-16T17:03:05Z"))
+ .expiresAt(OffsetDateTime.parse("2024-07-16T17:18:05Z"))
+ .trusted(false)
+ .expiresIn(876L)
+ .authToken(JsonNullable.of(null))
+ .newRegistration(JsonNullable.of(null))
+ .build(),
+ res.authPinContainer().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testPlex_GetTokenByPinId_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder()
+ .pinID(118274L)
+ .build();
+
+ GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
+ .request(req)
+ .call();
+
+ assertEquals(
+ GetTokenByPinIdAuthPinContainer.builder()
+ .id(308667304L)
+ .code("7RQZ")
+ .product("Tautulli")
+ .qr("https://plex.tv/api/v2/pins/qr/7RQZ")
+ .clientIdentifier("Tautulli")
+ .location(GetTokenByPinIdGeoData.builder()
+ .code("VI")
+ .continentCode("NA")
+ .country("United States Virgin Islands")
+ .city("Amsterdam")
+ .timeZone("America/St_Thomas")
+ .postalCode("802")
+ .subdivisions("Saint Thomas")
+ .coordinates("18.3381, -64.8941")
+ .europeanUnionMember(true)
+ .inPrivacyRestrictedCountry(true)
+ .inPrivacyRestrictedRegion(true)
+ .build())
+ .createdAt(OffsetDateTime.parse("2024-07-16T17:03:05Z"))
+ .expiresAt(OffsetDateTime.parse("2024-07-16T17:18:05Z"))
+ .trusted(false)
+ .expiresIn(876L)
+ .authToken(JsonNullable.of(null))
+ .newRegistration(JsonNullable.of(null))
+ .build(),
+ res.authPinContainer().get());
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/SearchTests.java b/src/test/java/dev/plexapi/sdk/SearchTests.java
new file mode 100644
index 00000000..77dda751
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/SearchTests.java
@@ -0,0 +1,190 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.GetSearchResultsCountry;
+import dev.plexapi.sdk.models.operations.GetSearchResultsDirector;
+import dev.plexapi.sdk.models.operations.GetSearchResultsGenre;
+import dev.plexapi.sdk.models.operations.GetSearchResultsMedia;
+import dev.plexapi.sdk.models.operations.GetSearchResultsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetSearchResultsMetadata;
+import dev.plexapi.sdk.models.operations.GetSearchResultsPart;
+import dev.plexapi.sdk.models.operations.GetSearchResultsResponse;
+import dev.plexapi.sdk.models.operations.GetSearchResultsResponseBody;
+import dev.plexapi.sdk.models.operations.GetSearchResultsRole;
+import dev.plexapi.sdk.models.operations.GetSearchResultsWriter;
+import dev.plexapi.sdk.models.operations.PerformSearchResponse;
+import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse;
+import dev.plexapi.sdk.models.operations.Provider;
+import java.lang.Exception;
+import java.time.OffsetDateTime;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class SearchTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSearch_PerformSearch() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ PerformSearchResponse res = sdk.search().performSearch()
+ .query("dylan")
+ .sectionId(4561.50d)
+ .limit(5d)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSearch_PerformVoiceSearch() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
+ .query("dead+poop")
+ .sectionId(5684.34d)
+ .limit(5d)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSearch_GetSearchResults() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSearchResultsResponse res = sdk.search().getSearchResults()
+ .query("110")
+ .call();
+
+ assertEquals(
+ GetSearchResultsResponseBody.builder()
+ .mediaContainer(GetSearchResultsMediaContainer.builder()
+ .size(26d)
+ .identifier("com.plexapp.plugins.library")
+ .mediaTagPrefix("/system/bundle/media/flags/")
+ .mediaTagVersion(1680021154d)
+ .metadata(List.of(
+ GetSearchResultsMetadata.builder()
+ .librarySectionID(1d)
+ .librarySectionTitle("Movies")
+ .librarySectionUUID("322a231a-b7f7-49f5-920f-14c61199cd30")
+ .sourceTitle("Hera")
+ .ratingKey(10398d)
+ .key("/library/metadata/10398")
+ .guid("plex://movie/5d7768284de0ee001fcc8f52")
+ .studio("Paramount")
+ .type("movie")
+ .title("Mission: Impossible")
+ .contentRating("PG-13")
+ .summary("When Ethan Hunt the leader of a crack espionage team whose perilous operation has gone awry with no explanation discovers that a mole has penetrated the CIA he's surprised to learn that he's the No. 1 suspect. To clear his name Hunt now must ferret out the real double agent and in the process even the score.")
+ .rating(6.6d)
+ .audienceRating(7.1d)
+ .year(1996d)
+ .tagline("Expect the impossible.")
+ .thumb("/library/metadata/10398/thumb/1679505055")
+ .art("/library/metadata/10398/art/1679505055")
+ .duration(6612628d)
+ .originallyAvailableAt(OffsetDateTime.parse("1996-05-22T00:00:00Z"))
+ .addedAt(1589234571d)
+ .updatedAt(1679505055d)
+ .audienceRatingImage("rottentomatoes://image.rating.upright")
+ .chapterSource("media")
+ .primaryExtraKey("/library/metadata/10501")
+ .ratingImage("rottentomatoes://image.rating.ripe")
+ .media(List.of(
+ GetSearchResultsMedia.builder()
+ .id(26610d)
+ .duration(6612628d)
+ .bitrate(4751d)
+ .width(1916d)
+ .height(796d)
+ .aspectRatio(2.35d)
+ .audioChannels(6d)
+ .audioCodec("aac")
+ .videoCodec("hevc")
+ .videoResolution(1080d)
+ .container("mkv")
+ .videoFrameRate("24p")
+ .audioProfile("lc")
+ .videoProfile("main 10")
+ .part(List.of(
+ GetSearchResultsPart.builder()
+ .id(26610d)
+ .key("/library/parts/26610/1589234571/file.mkv")
+ .duration(6612628d)
+ .file("/movies/Mission Impossible (1996)/Mission Impossible (1996) Bluray-1080p.mkv")
+ .size(3926903851d)
+ .audioProfile("lc")
+ .container("mkv")
+ .videoProfile("main 10")
+ .build()))
+ .build()))
+ .genre(List.of(
+ GetSearchResultsGenre.builder()
+ .tag("Action")
+ .build()))
+ .director(List.of(
+ GetSearchResultsDirector.builder()
+ .tag("Brian De Palma")
+ .build()))
+ .writer(List.of(
+ GetSearchResultsWriter.builder()
+ .tag("David Koepp")
+ .build()))
+ .country(List.of(
+ GetSearchResultsCountry.builder()
+ .tag("United States of America")
+ .build()))
+ .role(List.of(
+ GetSearchResultsRole.builder()
+ .tag("Tom Cruise")
+ .build()))
+ .build()))
+ .provider(List.of(
+ Provider.builder()
+ .key("/system/search")
+ .title("Local Network")
+ .type("mixed")
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/ServerTests.java b/src/test/java/dev/plexapi/sdk/ServerTests.java
new file mode 100644
index 00000000..c7552cd4
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/ServerTests.java
@@ -0,0 +1,381 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.Action;
+import dev.plexapi.sdk.models.operations.Device;
+import dev.plexapi.sdk.models.operations.Feature;
+import dev.plexapi.sdk.models.operations.GetAvailableClientsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetAvailableClientsResponse;
+import dev.plexapi.sdk.models.operations.GetAvailableClientsResponseBody;
+import dev.plexapi.sdk.models.operations.GetDevicesMediaContainer;
+import dev.plexapi.sdk.models.operations.GetDevicesResponse;
+import dev.plexapi.sdk.models.operations.GetDevicesResponseBody;
+import dev.plexapi.sdk.models.operations.GetMediaProvidersMediaContainer;
+import dev.plexapi.sdk.models.operations.GetMediaProvidersResponse;
+import dev.plexapi.sdk.models.operations.GetMediaProvidersResponseBody;
+import dev.plexapi.sdk.models.operations.GetMyPlexAccountResponse;
+import dev.plexapi.sdk.models.operations.GetMyPlexAccountResponseBody;
+import dev.plexapi.sdk.models.operations.GetResizedPhotoRequest;
+import dev.plexapi.sdk.models.operations.GetResizedPhotoResponse;
+import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse;
+import dev.plexapi.sdk.models.operations.GetServerIdentityMediaContainer;
+import dev.plexapi.sdk.models.operations.GetServerIdentityResponse;
+import dev.plexapi.sdk.models.operations.GetServerIdentityResponseBody;
+import dev.plexapi.sdk.models.operations.GetServerListMediaContainer;
+import dev.plexapi.sdk.models.operations.GetServerListResponse;
+import dev.plexapi.sdk.models.operations.GetServerListResponseBody;
+import dev.plexapi.sdk.models.operations.GetServerListServer;
+import dev.plexapi.sdk.models.operations.GetServerPreferencesMediaContainer;
+import dev.plexapi.sdk.models.operations.GetServerPreferencesResponse;
+import dev.plexapi.sdk.models.operations.GetServerPreferencesResponseBody;
+import dev.plexapi.sdk.models.operations.MediaProvider;
+import dev.plexapi.sdk.models.operations.MinSize;
+import dev.plexapi.sdk.models.operations.MyPlex;
+import dev.plexapi.sdk.models.operations.Server;
+import dev.plexapi.sdk.models.operations.Setting;
+import dev.plexapi.sdk.models.operations.Upscale;
+import java.lang.Exception;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class ServerTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetServerCapabilities() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetServerPreferences() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetServerPreferencesResponse res = sdk.server().getServerPreferences()
+ .call();
+
+ assertEquals(
+ GetServerPreferencesResponseBody.builder()
+ .mediaContainer(GetServerPreferencesMediaContainer.builder()
+ .size(161)
+ .setting(List.of(
+ Setting.builder()
+ .id("EnableDatabaseTrace")
+ .label("")
+ .summary("")
+ .type("bool")
+ .default_(false)
+ .value(false)
+ .hidden(true)
+ .advanced(false)
+ .group("")
+ .enumValues("1:admin only|2:everyone")
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetAvailableClients() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetAvailableClientsResponse res = sdk.server().getAvailableClients()
+ .call();
+
+ assertEquals(
+ GetAvailableClientsResponseBody.builder()
+ .mediaContainer(GetAvailableClientsMediaContainer.builder()
+ .size(1d)
+ .server(List.of(
+ Server.builder()
+ .name("iPad")
+ .host("10.10.10.102")
+ .address("10.10.10.102")
+ .port(32500d)
+ .machineIdentifier("A2E901F8-E016-43A7-ADFB-EF8CA8A4AC05")
+ .version("8.17")
+ .protocol("plex")
+ .product("Plex for iOS")
+ .deviceClass("tablet")
+ .protocolVersion(2d)
+ .protocolCapabilities("playback,playqueues,timeline,provider-playback")
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetDevices() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetDevicesResponse res = sdk.server().getDevices()
+ .call();
+
+ assertEquals(
+ GetDevicesResponseBody.builder()
+ .mediaContainer(GetDevicesMediaContainer.builder()
+ .size(151d)
+ .identifier("com.plexapp.system.devices")
+ .device(List.of(
+ Device.builder()
+ .id(1d)
+ .name("iPhone")
+ .platform("iOS")
+ .createdAt(1654131230d)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetServerIdentity() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetServerIdentityResponse res = sdk.server().getServerIdentity()
+ .call();
+
+ assertEquals(
+ GetServerIdentityResponseBody.builder()
+ .mediaContainer(GetServerIdentityMediaContainer.builder()
+ .size(0d)
+ .machineIdentifier("96f2fe7a78c9dc1f16a16bedbe90f98149be16b4")
+ .version("1.31.3.6868-28fc46b27")
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetMyPlexAccount() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount()
+ .call();
+
+ assertEquals(
+ GetMyPlexAccountResponseBody.builder()
+ .myPlex(MyPlex.builder()
+ .authToken("Z5v-PrNASDFpsaCi3CPK7")
+ .username("example.email@mail.com")
+ .mappingState("mapped")
+ .signInState("ok")
+ .publicAddress("140.20.68.140")
+ .publicPort(32400d)
+ .privateAddress("10.10.10.47")
+ .privatePort(32400d)
+ .subscriptionFeatures("federated-auth,hardware_transcoding,home,hwtranscode,item_clusters,kevin-bacon,livetv,loudness,lyrics,music-analysis,music_videos,pass,photo_autotags,photos-v5,photosV6-edit,photosV6-tv-albums,premium_music_metadata,radio,server-manager,session_bandwidth_restrictions,session_kick,shared-radio,sync,trailers,tuner-sharing,type-first,unsupportedtuners,webhooks")
+ .subscriptionState("Active")
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetResizedPhoto() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetResizedPhotoRequest req = GetResizedPhotoRequest.builder()
+ .width(110d)
+ .height(165d)
+ .opacity(100L)
+ .blur(20d)
+ .minSize(MinSize.ONE)
+ .upscale(Upscale.ONE)
+ .url("/library/metadata/49564/thumb/1654258204")
+ .build();
+
+ GetResizedPhotoResponse res = sdk.server().getResizedPhoto()
+ .request(req)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetMediaProviders() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetMediaProvidersResponse res = sdk.server().getMediaProviders()
+ .xPlexToken("CV5xoxjTpFKUzBTShsaf")
+ .call();
+
+ assertEquals(
+ GetMediaProvidersResponseBody.builder()
+ .mediaContainer(GetMediaProvidersMediaContainer.builder()
+ .mediaProvider(List.of(
+ MediaProvider.builder()
+ .feature(List.of(
+ Feature.builder()
+ .type("")
+ .flavor("global")
+ .scrobbleKey("/:/scrobble/new")
+ .unscrobbleKey("/:/unscrobble/new")
+ .action(List.of(
+ Action.builder()
+ .id("addToContinueWatching")
+ .key("/actions/addToContinueWatching")
+ .build()))
+ .build(),
+ Feature.builder()
+ .type("")
+ .flavor("global")
+ .scrobbleKey("/:/scrobble/new")
+ .unscrobbleKey("/:/unscrobble/new")
+ .action(List.of(
+ Action.builder()
+ .id("addToContinueWatching")
+ .key("/actions/addToContinueWatching")
+ .build(),
+ Action.builder()
+ .id("addToContinueWatching")
+ .key("/actions/addToContinueWatching")
+ .build()))
+ .build(),
+ Feature.builder()
+ .type("")
+ .flavor("global")
+ .scrobbleKey("/:/scrobble/new")
+ .unscrobbleKey("/:/unscrobble/new")
+ .action(List.of(
+ Action.builder()
+ .id("addToContinueWatching")
+ .key("/actions/addToContinueWatching")
+ .build(),
+ Action.builder()
+ .id("addToContinueWatching")
+ .key("/actions/addToContinueWatching")
+ .build()))
+ .build()))
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testServer_GetServerList() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetServerListResponse res = sdk.server().getServerList()
+ .call();
+
+ assertEquals(
+ GetServerListResponseBody.builder()
+ .mediaContainer(GetServerListMediaContainer.builder()
+ .size(1d)
+ .server(List.of(
+ GetServerListServer.builder()
+ .name("Hera")
+ .host("10.10.10.47")
+ .address("10.10.10.47")
+ .port(32400d)
+ .machineIdentifier("96f2fe7a78c9dc1f16a16bedbe90f98149be16b4")
+ .version("1.31.3.6868-28fc46b27")
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/SessionsTests.java b/src/test/java/dev/plexapi/sdk/SessionsTests.java
new file mode 100644
index 00000000..5fab149b
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/SessionsTests.java
@@ -0,0 +1,563 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.GetSessionHistoryMediaContainer;
+import dev.plexapi.sdk.models.operations.GetSessionHistoryMetadata;
+import dev.plexapi.sdk.models.operations.GetSessionHistoryResponse;
+import dev.plexapi.sdk.models.operations.GetSessionHistoryResponseBody;
+import dev.plexapi.sdk.models.operations.GetSessionsMedia;
+import dev.plexapi.sdk.models.operations.GetSessionsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetSessionsMetadata;
+import dev.plexapi.sdk.models.operations.GetSessionsPart;
+import dev.plexapi.sdk.models.operations.GetSessionsResponse;
+import dev.plexapi.sdk.models.operations.GetSessionsResponseBody;
+import dev.plexapi.sdk.models.operations.GetSessionsStream;
+import dev.plexapi.sdk.models.operations.GetSessionsUser;
+import dev.plexapi.sdk.models.operations.GetTranscodeSessionsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponse;
+import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponseBody;
+import dev.plexapi.sdk.models.operations.Player;
+import dev.plexapi.sdk.models.operations.QueryParamFilter;
+import dev.plexapi.sdk.models.operations.Session;
+import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse;
+import dev.plexapi.sdk.models.operations.TranscodeSession;
+import java.lang.Exception;
+import java.time.LocalDate;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class SessionsTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_GetSessions() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSessionsResponse res = sdk.sessions().getSessions()
+ .call();
+
+ assertEquals(
+ GetSessionsResponseBody.builder()
+ .mediaContainer(GetSessionsMediaContainer.builder()
+ .size(1)
+ .metadata(List.of(
+ GetSessionsMetadata.builder()
+ .addedAt(1705543312)
+ .art("/library/metadata/39904/art/1705310687")
+ .duration(186240)
+ .grandparentArt("/library/metadata/39904/art/1705310687")
+ .grandparentGuid("plex://artist/5d07bbfd403c6402904a6480")
+ .grandparentKey("/library/metadata/39904")
+ .grandparentRatingKey("39904")
+ .grandparentThumb("/library/metadata/39904/thumb/1705310687")
+ .grandparentTitle("Green Day")
+ .guid("plex://track/6535834f71f22f36f71a8e8f")
+ .index(1)
+ .key("/library/metadata/67085")
+ .librarySectionID("3")
+ .librarySectionKey("/library/sections/3")
+ .librarySectionTitle("Music")
+ .musicAnalysisVersion("1")
+ .parentGuid("plex://album/65394d6d472b8ab03ef47f12")
+ .parentIndex(1)
+ .parentKey("/library/metadata/67084")
+ .parentRatingKey("67084")
+ .parentStudio("Reprise Records")
+ .parentThumb("/library/metadata/67084/thumb/1705543314")
+ .parentTitle("Saviors")
+ .parentYear(2024)
+ .ratingCount(45885)
+ .ratingKey("67085")
+ .sessionKey("203")
+ .thumb("/library/metadata/67084/thumb/1705543314")
+ .title("The American Dream Is Killing Me")
+ .titleSort("American Dream Is Killing Me")
+ .type("track")
+ .updatedAt(1705543314)
+ .viewOffset(1000)
+ .media(List.of(
+ GetSessionsMedia.builder()
+ .audioChannels(2)
+ .audioCodec("flac")
+ .bitrate(1014)
+ .container("flac")
+ .duration(186240)
+ .id("130355")
+ .selected(true)
+ .part(List.of(
+ GetSessionsPart.builder()
+ .container("flac")
+ .duration(186240)
+ .file("/music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac")
+ .hasThumbnail("1")
+ .id("130625")
+ .key("/library/parts/130625/1705543268/file.flac")
+ .size(23644000)
+ .decision("directplay")
+ .selected(true)
+ .stream(List.of(
+ GetSessionsStream.builder()
+ .albumGain("-12.94")
+ .albumPeak("1.000000")
+ .albumRange("4.751014")
+ .audioChannelLayout("stereo")
+ .bitDepth(16)
+ .bitrate(1014)
+ .channels(2)
+ .codec("flac")
+ .displayTitle("FLAC (Stereo)")
+ .extendedDisplayTitle("FLAC (Stereo)")
+ .gain("-12.94")
+ .id("352487")
+ .index(0)
+ .loudness("-5.94")
+ .lra("1.74")
+ .peak("1.000000")
+ .samplingRate(44100)
+ .selected(true)
+ .streamType(2)
+ .location("direct")
+ .build()))
+ .build()))
+ .build()))
+ .user(GetSessionsUser.builder()
+ .id("1")
+ .thumb("https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661")
+ .title("Blindkitty38")
+ .build())
+ .player(Player.builder()
+ .address("10.10.10.171")
+ .machineIdentifier("3tsdzir85m2onc3qyr255aq1")
+ .model("standalone")
+ .platform("windows")
+ .platformVersion("10.0.22621")
+ .product("Plex for Windows")
+ .profile("Plex Desktop")
+ .remotePublicAddress("68.248.140.20")
+ .state("playing")
+ .title("DESKTOP-BL80MTD")
+ .version("1.85.0.4071-21128b56")
+ .local(true)
+ .relayed(false)
+ .secure(true)
+ .userID(1)
+ .build())
+ .session(Session.builder()
+ .id("93h7e00ncblxncqw9lkfaoxi")
+ .bandwidth(1050)
+ .location("lan")
+ .build())
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_GetSessionHistory_ViewedAtDescending() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
+ .sort("")
+ .accountId(1L)
+ .filter(QueryParamFilter.builder()
+ .build())
+ .librarySectionID(12L)
+ .call();
+
+ assertEquals(
+ GetSessionHistoryResponseBody.builder()
+ .mediaContainer(GetSessionHistoryMediaContainer.builder()
+ .size(10855)
+ .metadata(List.of(
+ GetSessionHistoryMetadata.builder()
+ .historyKey("/status/sessions/history/1")
+ .key("/library/metadata/32171")
+ .ratingKey("32171")
+ .librarySectionID("2")
+ .parentKey("/library/metadata/32170")
+ .grandparentKey("/library/metadata/32132")
+ .title("The Noise That Blue Makes")
+ .grandparentTitle("Taskmaster")
+ .type("episode")
+ .thumb("/library/metadata/32171/thumb/-1")
+ .parentThumb("/library/metadata/32170/thumb/1654134301")
+ .grandparentThumb("/library/metadata/32132/thumb/1703933346")
+ .grandparentArt("/library/metadata/32132/art/1703933346")
+ .index(1)
+ .parentIndex(13)
+ .originallyAvailableAt(LocalDate.parse("2022-04-14T00:00:00Z"))
+ .viewedAt(1654139223)
+ .accountID(1)
+ .deviceID(5)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_GetSessionHistory_ViewedAtAscending() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
+ .sort("")
+ .accountId(1L)
+ .filter(QueryParamFilter.builder()
+ .build())
+ .librarySectionID(12L)
+ .call();
+
+ assertEquals(
+ GetSessionHistoryResponseBody.builder()
+ .mediaContainer(GetSessionHistoryMediaContainer.builder()
+ .size(10855)
+ .metadata(List.of(
+ GetSessionHistoryMetadata.builder()
+ .historyKey("/status/sessions/history/1")
+ .key("/library/metadata/32171")
+ .ratingKey("32171")
+ .librarySectionID("2")
+ .parentKey("/library/metadata/32170")
+ .grandparentKey("/library/metadata/32132")
+ .title("The Noise That Blue Makes")
+ .grandparentTitle("Taskmaster")
+ .type("episode")
+ .thumb("/library/metadata/32171/thumb/-1")
+ .parentThumb("/library/metadata/32170/thumb/1654134301")
+ .grandparentThumb("/library/metadata/32132/thumb/1703933346")
+ .grandparentArt("/library/metadata/32132/art/1703933346")
+ .index(1)
+ .parentIndex(13)
+ .originallyAvailableAt(LocalDate.parse("2022-04-14T00:00:00Z"))
+ .viewedAt(1654139223)
+ .accountID(1)
+ .deviceID(5)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_GetSessionHistory_RatingDescending() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
+ .sort("")
+ .accountId(1L)
+ .filter(QueryParamFilter.builder()
+ .build())
+ .librarySectionID(12L)
+ .call();
+
+ assertEquals(
+ GetSessionHistoryResponseBody.builder()
+ .mediaContainer(GetSessionHistoryMediaContainer.builder()
+ .size(10855)
+ .metadata(List.of(
+ GetSessionHistoryMetadata.builder()
+ .historyKey("/status/sessions/history/1")
+ .key("/library/metadata/32171")
+ .ratingKey("32171")
+ .librarySectionID("2")
+ .parentKey("/library/metadata/32170")
+ .grandparentKey("/library/metadata/32132")
+ .title("The Noise That Blue Makes")
+ .grandparentTitle("Taskmaster")
+ .type("episode")
+ .thumb("/library/metadata/32171/thumb/-1")
+ .parentThumb("/library/metadata/32170/thumb/1654134301")
+ .grandparentThumb("/library/metadata/32132/thumb/1703933346")
+ .grandparentArt("/library/metadata/32132/art/1703933346")
+ .index(1)
+ .parentIndex(13)
+ .originallyAvailableAt(LocalDate.parse("2022-04-14T00:00:00Z"))
+ .viewedAt(1654139223)
+ .accountID(1)
+ .deviceID(5)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_GetSessionHistory_RatingAscending() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
+ .sort("")
+ .accountId(1L)
+ .filter(QueryParamFilter.builder()
+ .build())
+ .librarySectionID(12L)
+ .call();
+
+ assertEquals(
+ GetSessionHistoryResponseBody.builder()
+ .mediaContainer(GetSessionHistoryMediaContainer.builder()
+ .size(10855)
+ .metadata(List.of(
+ GetSessionHistoryMetadata.builder()
+ .historyKey("/status/sessions/history/1")
+ .key("/library/metadata/32171")
+ .ratingKey("32171")
+ .librarySectionID("2")
+ .parentKey("/library/metadata/32170")
+ .grandparentKey("/library/metadata/32132")
+ .title("The Noise That Blue Makes")
+ .grandparentTitle("Taskmaster")
+ .type("episode")
+ .thumb("/library/metadata/32171/thumb/-1")
+ .parentThumb("/library/metadata/32170/thumb/1654134301")
+ .grandparentThumb("/library/metadata/32132/thumb/1703933346")
+ .grandparentArt("/library/metadata/32132/art/1703933346")
+ .index(1)
+ .parentIndex(13)
+ .originallyAvailableAt(LocalDate.parse("2022-04-14T00:00:00Z"))
+ .viewedAt(1654139223)
+ .accountID(1)
+ .deviceID(5)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_GetSessionHistory_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
+ .sort("")
+ .accountId(1L)
+ .filter(QueryParamFilter.builder()
+ .build())
+ .librarySectionID(12L)
+ .call();
+
+ assertEquals(
+ GetSessionHistoryResponseBody.builder()
+ .mediaContainer(GetSessionHistoryMediaContainer.builder()
+ .size(10855)
+ .metadata(List.of(
+ GetSessionHistoryMetadata.builder()
+ .historyKey("/status/sessions/history/1")
+ .key("/library/metadata/32171")
+ .ratingKey("32171")
+ .librarySectionID("2")
+ .parentKey("/library/metadata/32170")
+ .grandparentKey("/library/metadata/32132")
+ .title("The Noise That Blue Makes")
+ .grandparentTitle("Taskmaster")
+ .type("episode")
+ .thumb("/library/metadata/32171/thumb/-1")
+ .parentThumb("/library/metadata/32170/thumb/1654134301")
+ .grandparentThumb("/library/metadata/32132/thumb/1703933346")
+ .grandparentArt("/library/metadata/32132/art/1703933346")
+ .index(1)
+ .parentIndex(13)
+ .originallyAvailableAt(LocalDate.parse("2022-04-14T00:00:00Z"))
+ .viewedAt(1654139223)
+ .accountID(1)
+ .deviceID(5)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_GetSessionHistory_ViewedAt() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
+ .sort("")
+ .accountId(1L)
+ .filter(QueryParamFilter.builder()
+ .build())
+ .librarySectionID(12L)
+ .call();
+
+ assertEquals(
+ GetSessionHistoryResponseBody.builder()
+ .mediaContainer(GetSessionHistoryMediaContainer.builder()
+ .size(10855)
+ .metadata(List.of(
+ GetSessionHistoryMetadata.builder()
+ .historyKey("/status/sessions/history/1")
+ .key("/library/metadata/32171")
+ .ratingKey("32171")
+ .librarySectionID("2")
+ .parentKey("/library/metadata/32170")
+ .grandparentKey("/library/metadata/32132")
+ .title("The Noise That Blue Makes")
+ .grandparentTitle("Taskmaster")
+ .type("episode")
+ .thumb("/library/metadata/32171/thumb/-1")
+ .parentThumb("/library/metadata/32170/thumb/1654134301")
+ .grandparentThumb("/library/metadata/32132/thumb/1703933346")
+ .grandparentArt("/library/metadata/32132/art/1703933346")
+ .index(1)
+ .parentIndex(13)
+ .originallyAvailableAt(LocalDate.parse("2022-04-14T00:00:00Z"))
+ .viewedAt(1654139223)
+ .accountID(1)
+ .deviceID(5)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_GetTranscodeSessions() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions()
+ .call();
+
+ assertEquals(
+ GetTranscodeSessionsResponseBody.builder()
+ .mediaContainer(GetTranscodeSessionsMediaContainer.builder()
+ .size(1)
+ .transcodeSession(List.of(
+ TranscodeSession.builder()
+ .key("vv3i2q2lax92qlzul1hbd4bx")
+ .throttled(false)
+ .complete(false)
+ .progress(1.7999999523162842d)
+ .size(-22)
+ .speed(25.100000381469727d)
+ .error(false)
+ .duration(1445695)
+ .remaining(53)
+ .context("streaming")
+ .sourceVideoCodec("h264")
+ .sourceAudioCodec("aac")
+ .videoDecision("transcode")
+ .audioDecision("transcode")
+ .subtitleDecision("burn")
+ .protocol("http")
+ .container("mkv")
+ .videoCodec("h264")
+ .audioCodec("opus")
+ .audioChannels(1)
+ .transcodeHwRequested(true)
+ .timeStamp(1705895805.4919229d)
+ .maxOffsetAvailable(29.53d)
+ .minOffsetAvailable(3.003000020980835d)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testSessions_StopTranscodeSession() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession()
+ .sessionKey("zz7llzqlx8w9vnrsbnwhbmep")
+ .call();
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/StatisticsTests.java b/src/test/java/dev/plexapi/sdk/StatisticsTests.java
new file mode 100644
index 00000000..cbdc6fab
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/StatisticsTests.java
@@ -0,0 +1,179 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.Account;
+import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsAccount;
+import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsDevice;
+import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponse;
+import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponseBody;
+import dev.plexapi.sdk.models.operations.GetResourcesStatisticsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponse;
+import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponseBody;
+import dev.plexapi.sdk.models.operations.GetStatisticsDevice;
+import dev.plexapi.sdk.models.operations.GetStatisticsMediaContainer;
+import dev.plexapi.sdk.models.operations.GetStatisticsResponse;
+import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody;
+import dev.plexapi.sdk.models.operations.StatisticsBandwidth;
+import dev.plexapi.sdk.models.operations.StatisticsMedia;
+import dev.plexapi.sdk.models.operations.StatisticsResources;
+import java.lang.Exception;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class StatisticsTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testStatistics_GetStatistics_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetStatisticsResponse res = sdk.statistics().getStatistics()
+ .timespan(4L)
+ .call();
+
+ assertEquals(
+ GetStatisticsResponseBody.builder()
+ .mediaContainer(GetStatisticsMediaContainer.builder()
+ .size(5497)
+ .device(List.of(
+ GetStatisticsDevice.builder()
+ .id(208)
+ .name("Roku Express")
+ .platform("Roku")
+ .clientIdentifier("793095d235660625108ef785cc7646e9")
+ .createdAt(1706470556)
+ .build()))
+ .account(List.of(
+ Account.builder()
+ .id(238960586)
+ .key("/accounts/238960586")
+ .name("Diane")
+ .defaultAudioLanguage("en")
+ .autoSelectAudio(true)
+ .defaultSubtitleLanguage("en")
+ .subtitleMode(1)
+ .thumb("https://plex.tv/users/50d83634246da1de/avatar?c=1707110967")
+ .build()))
+ .statisticsMedia(List.of(
+ StatisticsMedia.builder()
+ .accountID(1)
+ .deviceID(13)
+ .timespan(4)
+ .at(1707141600)
+ .metadataType(4)
+ .count(1)
+ .duration(1555)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testStatistics_GetResourcesStatistics_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics()
+ .timespan(4L)
+ .call();
+
+ assertEquals(
+ GetResourcesStatisticsResponseBody.builder()
+ .mediaContainer(GetResourcesStatisticsMediaContainer.builder()
+ .size(5497)
+ .statisticsResources(List.of(
+ StatisticsResources.builder()
+ .timespan(6L)
+ .at(1718384427L)
+ .hostCpuUtilization(1.276f)
+ .processCpuUtilization(0.025f)
+ .hostMemoryUtilization(17.026f)
+ .processMemoryUtilization(0.493f)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testStatistics_GetBandwidthStatistics_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics()
+ .timespan(4L)
+ .call();
+
+ assertEquals(
+ GetBandwidthStatisticsResponseBody.builder()
+ .mediaContainer(GetBandwidthStatisticsMediaContainer.builder()
+ .size(5497)
+ .device(List.of(
+ GetBandwidthStatisticsDevice.builder()
+ .id(208)
+ .name("Roku Express")
+ .platform("Roku")
+ .clientIdentifier("793095d235660625108ef785cc7646e9")
+ .createdAt(1706470556)
+ .build()))
+ .account(List.of(
+ GetBandwidthStatisticsAccount.builder()
+ .id(238960586)
+ .key("/accounts/238960586")
+ .name("Diane")
+ .defaultAudioLanguage("en")
+ .autoSelectAudio(true)
+ .defaultSubtitleLanguage("en")
+ .subtitleMode(1)
+ .thumb("https://plex.tv/users/50d83634246da1de/avatar?c=1707110967")
+ .build()))
+ .statisticsBandwidth(List.of(
+ StatisticsBandwidth.builder()
+ .accountID(238960586)
+ .deviceID(208)
+ .timespan(6L)
+ .at(1718387650)
+ .lan(true)
+ .bytes(22L)
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/UpdaterTests.java b/src/test/java/dev/plexapi/sdk/UpdaterTests.java
new file mode 100644
index 00000000..3426cf38
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/UpdaterTests.java
@@ -0,0 +1,120 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import dev.plexapi.sdk.models.operations.ApplyUpdatesResponse;
+import dev.plexapi.sdk.models.operations.CheckForUpdatesResponse;
+import dev.plexapi.sdk.models.operations.Download;
+import dev.plexapi.sdk.models.operations.GetUpdateStatusMediaContainer;
+import dev.plexapi.sdk.models.operations.GetUpdateStatusResponse;
+import dev.plexapi.sdk.models.operations.GetUpdateStatusResponseBody;
+import dev.plexapi.sdk.models.operations.Release;
+import dev.plexapi.sdk.models.operations.Skip;
+import dev.plexapi.sdk.models.operations.Tonight;
+import java.lang.Exception;
+import java.util.List;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class UpdaterTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testUpdater_GetUpdateStatus() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetUpdateStatusResponse res = sdk.updater().getUpdateStatus()
+ .call();
+
+ assertEquals(
+ GetUpdateStatusResponseBody.builder()
+ .mediaContainer(GetUpdateStatusMediaContainer.builder()
+ .size(1)
+ .canInstall(false)
+ .checkedAt(1705801232)
+ .downloadURL("https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx")
+ .status(0)
+ .release(List.of(
+ Release.builder()
+ .key("https://plex.tv/updater/releases/5136")
+ .version("1.40.0.7775-456fbaf97")
+ .added("(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish.\n(Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793)
+ (Music) Store track genres and add filtering options (#14653)
+ (Music) Support ID3v2.4 null-separated tags for genres and release type (#14653)
+ (View History) No longer create a view history entry for items marked as played (#10888)
+ (Web) Updated to 4.118.0")
+ .fixed("(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483)\n(Agents) It is possible that agents are not initialised during startup on rare occasions (#14654)
+ (Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667)
+ (Collection) Server could become unresponsive when collection membership changes (#14612)
+ (DVR) Previously watched recordings could be deleted without being watched again (#13779)
+ (Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501)
+ (Library) The Content Rating not equal to None filter does not work (#14620)
+ (Search) Album search results could contain all the album's tracks too (#14486)
+ (Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674)
+ (Transcoder) HW encoding would fail on devices with no rate control (#14222)
+ (Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)")
+ .downloadURL("https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx")
+ .state("notify")
+ .build()))
+ .build())
+ .build(),
+ res.object().get());
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testUpdater_CheckForUpdates_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ CheckForUpdatesResponse res = sdk.updater().checkForUpdates()
+ .download(Download.ONE)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testUpdater_ApplyUpdates_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ ApplyUpdatesResponse res = sdk.updater().applyUpdates()
+ .tonight(Tonight.ONE)
+ .skip(Skip.ONE)
+ .call();
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/VideoTests.java b/src/test/java/dev/plexapi/sdk/VideoTests.java
new file mode 100644
index 00000000..c76bba50
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/VideoTests.java
@@ -0,0 +1,92 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import dev.plexapi.sdk.models.operations.GetTimelineRequest;
+import dev.plexapi.sdk.models.operations.GetTimelineResponse;
+import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest;
+import dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse;
+import dev.plexapi.sdk.models.operations.State;
+import java.lang.Exception;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class VideoTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testVideo_GetTimeline_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetTimelineRequest req = GetTimelineRequest.builder()
+ .ratingKey(23409d)
+ .key("/library/metadata/23409")
+ .state(State.PLAYING)
+ .hasMDE(1d)
+ .time(2000d)
+ .duration(10000d)
+ .context("home:hub.continueWatching")
+ .playQueueItemID(1d)
+ .playBackTime(2000d)
+ .row(1d)
+ .build();
+
+ GetTimelineResponse res = sdk.video().getTimeline()
+ .request(req)
+ .call();
+
+
+ }
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testVideo_StartUniversalTranscode_() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder()
+ .hasMDE(1d)
+ .path("/library/metadata/23409")
+ .mediaIndex(0d)
+ .partIndex(0d)
+ .protocol("hls")
+ .fastSeek(0d)
+ .directPlay(0d)
+ .directStream(0d)
+ .subtitleSize(100d)
+ .subtites("burn")
+ .audioBoost(100d)
+ .location("lan")
+ .mediaBufferSize(102400d)
+ .session("zvcage8b7rkioqcm8f4uns4c")
+ .addDebugOverlay(0d)
+ .autoAdjustQuality(0d)
+ .build();
+
+ StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode()
+ .request(req)
+ .call();
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/dev/plexapi/sdk/WatchlistTests.java b/src/test/java/dev/plexapi/sdk/WatchlistTests.java
new file mode 100644
index 00000000..5ee7b024
--- /dev/null
+++ b/src/test/java/dev/plexapi/sdk/WatchlistTests.java
@@ -0,0 +1,44 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package dev.plexapi.sdk;
+
+import dev.plexapi.sdk.models.operations.Filter;
+import dev.plexapi.sdk.models.operations.GetWatchListRequest;
+import dev.plexapi.sdk.models.operations.GetWatchListResponse;
+import java.lang.Exception;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public class WatchlistTests {
+
+ @Disabled // test marked as skipped for java or generated unit tests not production ready yet
+ @Test
+ public void testWatchlist_GetWatchList() throws Exception {
+
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accessToken("")
+ .clientID("gcgzw5rz2xovp84b4vha3a40")
+ .clientName("Plex Web")
+ .clientVersion("4.133.0")
+ .clientPlatform("Chrome")
+ .deviceName("Linux")
+ .build();
+
+ GetWatchListRequest req = GetWatchListRequest.builder()
+ .filter(Filter.RELEASED)
+ .xPlexToken("CV5xoxjTpFKUzBTShsaf")
+ .xPlexContainerStart(0)
+ .xPlexContainerSize(50)
+ .build();
+
+ GetWatchListResponse res = sdk.watchlist().getWatchList()
+ .request(req)
+ .call();
+
+
+ }
+
+}
\ No newline at end of file