Compare commits

...

3 Commits

Author SHA1 Message Date
speakeasybot
9dc8821b31 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.474.0 2025-01-24 00:27:12 +00:00
speakeasybot
412b27f162 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2 2024-12-22 00:30:11 +00:00
speakeasybot
9c8fe4c95e ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2 2024-12-21 00:27:05 +00:00
191 changed files with 5089 additions and 2896 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.speakeasy/reports
# Ignore Gradle project-specific cache directory # Ignore Gradle project-specific cache directory
.gradle .gradle
# Ignore Gradle build output directory # Ignore Gradle build output directory

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false oAuth2PasswordEnabled: false
java: java:
version: 0.10.1 version: 0.11.2
additionalDependencies: [] additionalDependencies: []
additionalPlugins: [] additionalPlugins: []
artifactID: plexapi artifactID: plexapi

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.439.0 speakeasyVersion: 1.474.0
sources: sources:
my-source: my-source:
sourceNamespace: my-source sourceNamespace: my-source
@@ -8,19 +8,19 @@ sources:
- latest - latest
plexapi: plexapi:
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:37c6bfb15f4154eb89b112465107f20757411f22bd1cc7d0a04335df7127fcb4 sourceRevisionDigest: sha256:b146684d2d813daa8ba29e432a12334838753d0b20183beca8178a74ec4d895a
sourceBlobDigest: sha256:290473ebc909cada80ff428c685b897f4621cf121397e1417355e06d334e7206 sourceBlobDigest: sha256:58f51c4319fcda931d63950fd926e8650e20a2e1375e356bf3a930111e246a58
tags: tags:
- latest - latest
- main - speakeasy-sdk-regen-1737678352
targets: targets:
plexjava: plexjava:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:37c6bfb15f4154eb89b112465107f20757411f22bd1cc7d0a04335df7127fcb4 sourceRevisionDigest: sha256:b146684d2d813daa8ba29e432a12334838753d0b20183beca8178a74ec4d895a
sourceBlobDigest: sha256:290473ebc909cada80ff428c685b897f4621cf121397e1417355e06d334e7206 sourceBlobDigest: sha256:58f51c4319fcda931d63950fd926e8650e20a2e1375e356bf3a930111e246a58
codeSamplesNamespace: code-samples-java-plexjava codeSamplesNamespace: code-samples-java-plexjava
codeSamplesRevisionDigest: sha256:218724cff48118b26161c9ff5a0eb0f5aed771cea0d6bcef400db821dd019aea codeSamplesRevisionDigest: sha256:571a4757ffd51340135beada3f949e8caef8851996a95ffbf281398809f9b2f2
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest speakeasyVersion: latest

View File

@@ -41,13 +41,21 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
<!-- Start Table of Contents [toc] --> <!-- Start Table of Contents [toc] -->
## Table of Contents ## Table of Contents
<!-- $toc-max-depth=2 -->
* [plexapi](#plexapi)
* [Plex Media Server OpenAPI Specification](#plex-media-server-openapi-specification)
* [Documentation](#documentation)
* [SDKs](#sdks)
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Authentication](#authentication)
* [Development](#development)
* [Maturity](#maturity)
* [Contributions](#contributions)
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Authentication](#authentication)
<!-- End Table of Contents [toc] --> <!-- End Table of Contents [toc] -->
<!-- Start SDK Installation [installation] --> <!-- Start SDK Installation [installation] -->
@@ -61,7 +69,7 @@ The samples below show how a published SDK artifact is used:
Gradle: Gradle:
```groovy ```groovy
implementation 'dev.plexapi:plexapi:0.10.1' implementation 'dev.plexapi:plexapi:0.11.2'
``` ```
Maven: Maven:
@@ -69,7 +77,7 @@ Maven:
<dependency> <dependency>
<groupId>dev.plexapi</groupId> <groupId>dev.plexapi</groupId>
<artifactId>plexapi</artifactId> <artifactId>plexapi</artifactId>
<version>0.10.1</version> <version>0.11.2</version>
</dependency> </dependency>
``` ```
@@ -108,11 +116,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -290,11 +293,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -337,11 +335,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.serverURL("https://10.10.10.47:32400") .serverURL("https://10.10.10.47:32400")
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -372,11 +365,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetCompanionsDataResponse res = sdk.plex().getCompanionsData() GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
@@ -418,11 +406,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()

View File

@@ -178,4 +178,34 @@ Based on:
### Generated ### Generated
- [java v0.10.1] . - [java v0.10.1] .
### Releases ### Releases
- [Maven Central v0.10.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.10.1 - . - [Maven Central v0.10.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.10.1 - .
## 2024-12-21 00:25:42
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.459.2 (2.483.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.11.0] .
### Releases
- [Maven Central v0.11.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.11.0 - .
## 2024-12-22 00:28:49
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.459.2 (2.483.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.11.1] .
### Releases
- [Maven Central v0.11.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.11.1 - .
## 2025-01-24 00:25:37
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.474.0 (2.495.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.11.2] .
### Releases
- [Maven Central v0.11.2] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.11.2 - .

View File

@@ -14,11 +14,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()

View File

@@ -63,7 +63,7 @@ tasks.withType(Javadoc) {
} }
group = "dev.plexapi" group = "dev.plexapi"
version = "0.10.1" version = "0.11.2"
sourcesJar { sourcesJar {
archiveBaseName = "plexapi" archiveBaseName = "plexapi"
@@ -101,7 +101,7 @@ publishing {
maven(MavenPublication) { maven(MavenPublication) {
groupId = 'dev.plexapi' groupId = 'dev.plexapi'
artifactId = 'plexapi' artifactId = 'plexapi'
version = '0.10.1' version = '0.11.2'
from components.java from components.java
@@ -144,16 +144,16 @@ if (!project.hasProperty('skip.signing')) {
} }
} }
dependencies { dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2' api 'com.fasterxml.jackson.core:jackson-annotations:2.18.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2' implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2'
implementation 'org.apache.httpcomponents:httpclient:4.5.14' api('org.openapitools:jackson-databind-nullable:0.2.6') {exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'}
implementation 'org.apache.httpcomponents:httpmime:4.5.14' implementation 'org.apache.httpcomponents.client5:httpclient5:5.4.1'
implementation 'commons-io:commons-io:2.15.1' implementation 'commons-io:commons-io:2.18.0'
} }
apply from: 'build-extras.gradle' apply from: 'build-extras.gradle'

View File

@@ -23,11 +23,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -58,11 +53,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerPreferencesResponse res = sdk.server().getServerPreferences() GetServerPreferencesResponse res = sdk.server().getServerPreferences()
@@ -93,11 +83,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
@@ -129,11 +114,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
MarkPlayedResponse res = sdk.media().markPlayed() MarkPlayedResponse res = sdk.media().markPlayed()
@@ -165,11 +145,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTimelineRequest req = GetTimelineRequest.builder() GetTimelineRequest req = GetTimelineRequest.builder()
@@ -212,11 +187,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
MarkUnplayedResponse res = sdk.media().markUnplayed() MarkUnplayedResponse res = sdk.media().markUnplayed()
@@ -246,11 +216,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerActivitiesResponse res = sdk.activities().getServerActivities() GetServerActivitiesResponse res = sdk.activities().getServerActivities()
@@ -281,11 +246,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities()
@@ -315,11 +275,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StopAllTasksResponse res = sdk.butler().stopAllTasks() StopAllTasksResponse res = sdk.butler().stopAllTasks()
@@ -348,11 +303,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetButlerTasksResponse res = sdk.butler().getButlerTasks() GetButlerTasksResponse res = sdk.butler().getButlerTasks()
@@ -383,11 +333,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StartAllTasksResponse res = sdk.butler().startAllTasks() StartAllTasksResponse res = sdk.butler().startAllTasks()
@@ -417,11 +362,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StopTaskResponse res = sdk.butler().stopTask() StopTaskResponse res = sdk.butler().stopTask()
@@ -452,11 +392,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StartTaskResponse res = sdk.butler().startTask() StartTaskResponse res = sdk.butler().startTask()
@@ -486,11 +421,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetAvailableClientsResponse res = sdk.server().getAvailableClients() GetAvailableClientsResponse res = sdk.server().getAvailableClients()
@@ -521,11 +451,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetCompanionsDataResponse res = sdk.plex().getCompanionsData() GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
@@ -556,11 +481,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetDevicesResponse res = sdk.server().getDevices() GetDevicesResponse res = sdk.server().getDevices()
@@ -591,11 +511,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetUserFriendsResponse res = sdk.plex().getUserFriends() GetUserFriendsResponse res = sdk.plex().getUserFriends()
@@ -625,11 +540,6 @@ actions:
public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetGeoDataResponse res = sdk.plex().getGeoData() GetGeoDataResponse res = sdk.plex().getGeoData()
@@ -660,11 +570,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetHomeDataResponse res = sdk.plex().getHomeData() GetHomeDataResponse res = sdk.plex().getHomeData()
@@ -696,11 +601,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
@@ -734,11 +634,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder() GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder()
@@ -779,16 +674,11 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
PerformSearchResponse res = sdk.search().performSearch() PerformSearchResponse res = sdk.search().performSearch()
.query("dylan") .query("dylan")
.sectionId(9372.69d) .sectionId(9487.88d)
.limit(5d) .limit(5d)
.call(); .call();
@@ -815,16 +705,11 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
.query("dead+poop") .query("dead+poop")
.sectionId(4094.80d) .sectionId(4094.8d)
.limit(5d) .limit(5d)
.call(); .call();
@@ -852,17 +737,12 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
.sectionId(6728.76d) .sectionId(6728.76d)
.count(639.24d) .count(6728.76d)
.onlyTransient(QueryParamOnlyTransient.ONE) .onlyTransient(QueryParamOnlyTransient.ZERO)
.call(); .call();
if (res.object().isPresent()) { if (res.object().isPresent()) {
@@ -888,11 +768,6 @@ actions:
public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerIdentityResponse res = sdk.server().getServerIdentity() GetServerIdentityResponse res = sdk.server().getServerIdentity()
@@ -924,11 +799,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent()
@@ -961,11 +831,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetFileHashResponse res = sdk.library().getFileHash() GetFileHashResponse res = sdk.library().getFileHash()
@@ -996,11 +861,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey()
@@ -1033,11 +893,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetBannerImageRequest req = GetBannerImageRequest.builder() GetBannerImageRequest req = GetBannerImageRequest.builder()
@@ -1078,16 +933,11 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
.ratingKey(1539.15d) .ratingKey(1539.14d)
.includeElements("<value>") .includeElements("Stream")
.call(); .call();
if (res.object().isPresent()) { if (res.object().isPresent()) {
@@ -1116,11 +966,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetThumbImageRequest req = GetThumbImageRequest.builder() GetThumbImageRequest req = GetThumbImageRequest.builder()
@@ -1161,11 +1006,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetOnDeckResponse res = sdk.library().getOnDeck() GetOnDeckResponse res = sdk.library().getOnDeck()
@@ -1200,11 +1040,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder() GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder()
@@ -1263,15 +1098,11 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder() GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder()
.query("<value>") .query("<value>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.searchTypes(List.of( .searchTypes(List.of(
SearchTypes.PEOPLE)) SearchTypes.PEOPLE))
.includeCollections(QueryParamIncludeCollections.Enable) .includeCollections(QueryParamIncludeCollections.Enable)
@@ -1307,11 +1138,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetAllLibrariesResponse res = sdk.library().getAllLibraries() GetAllLibrariesResponse res = sdk.library().getAllLibraries()
@@ -1344,11 +1170,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetWatchListRequest req = GetWatchListRequest.builder() GetWatchListRequest req = GetWatchListRequest.builder()
@@ -1387,11 +1208,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
DeleteLibraryResponse res = sdk.library().deleteLibrary() DeleteLibraryResponse res = sdk.library().deleteLibrary()
@@ -1422,11 +1238,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
@@ -1460,11 +1271,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata()
@@ -1496,11 +1302,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSearchLibraryResponse res = sdk.library().getSearchLibrary() GetSearchLibraryResponse res = sdk.library().getSearchLibrary()
@@ -1538,11 +1339,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() GetLibraryItemsRequest req = GetLibraryItemsRequest.builder()
@@ -1585,11 +1381,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
LogLineResponse res = sdk.log().logLine() LogLineResponse res = sdk.log().logLine()
@@ -1622,15 +1413,9 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman";
level=1&message=Test%20message%203&source=postman";
LogMultiLineResponse res = sdk.log().logMultiLine() LogMultiLineResponse res = sdk.log().logMultiLine()
.request(req) .request(req)
@@ -1659,11 +1444,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
EnablePaperTrailResponse res = sdk.log().enablePaperTrail() EnablePaperTrailResponse res = sdk.log().enablePaperTrail()
@@ -1692,11 +1472,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetMediaProvidersResponse res = sdk.server().getMediaProviders() GetMediaProvidersResponse res = sdk.server().getMediaProviders()
@@ -1728,11 +1503,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount()
@@ -1766,19 +1536,14 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() GetResizedPhotoRequest req = GetResizedPhotoRequest.builder()
.width(110d) .width(110d)
.height(165d) .height(165d)
.opacity(100L) .opacity(100L)
.blur(20d) .blur(0d)
.minSize(MinSize.ZERO) .minSize(MinSize.ONE)
.upscale(Upscale.ONE) .upscale(Upscale.ONE)
.url("/library/metadata/49564/thumb/1654258204") .url("/library/metadata/49564/thumb/1654258204")
.build(); .build();
@@ -1809,14 +1574,15 @@ actions:
public static void main(String[] args) throws GetPinBadRequest, Exception { public static void main(String[] args) throws GetPinBadRequest, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetPinRequest req = GetPinRequest.builder() GetPinRequest req = GetPinRequest.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.strong(false)
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.build(); .build();
GetPinResponse res = sdk.plex().getPin() GetPinResponse res = sdk.plex().getPin()
@@ -1848,15 +1614,15 @@ actions:
public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder() GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder()
.pinID(408895L) .pinID(408895L)
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.build(); .build();
GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
@@ -1890,11 +1656,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetPlaylistsResponse res = sdk.playlists().getPlaylists() GetPlaylistsResponse res = sdk.playlists().getPlaylists()
@@ -1930,11 +1691,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
CreatePlaylistRequest req = CreatePlaylistRequest.builder() CreatePlaylistRequest req = CreatePlaylistRequest.builder()
@@ -1974,11 +1730,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() UploadPlaylistResponse res = sdk.playlists().uploadPlaylist()
@@ -2010,11 +1761,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
DeletePlaylistResponse res = sdk.playlists().deletePlaylist() DeletePlaylistResponse res = sdk.playlists().deletePlaylist()
@@ -2044,11 +1790,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetPlaylistResponse res = sdk.playlists().getPlaylist() GetPlaylistResponse res = sdk.playlists().getPlaylist()
@@ -2080,15 +1821,10 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
.playlistID(3915.00d) .playlistID(3915d)
.title("<value>") .title("<value>")
.summary("<value>") .summary("<value>")
.call(); .call();
@@ -2116,11 +1852,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents()
@@ -2151,11 +1882,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents()
@@ -2188,15 +1914,10 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents()
.playlistID(8502.00d) .playlistID(8502.01d)
.uri("server://12345/com.plexapp.plugins.library/library/metadata/1") .uri("server://12345/com.plexapp.plugins.library/library/metadata/1")
.playQueueID(123d) .playQueueID(123d)
.call(); .call();
@@ -2229,11 +1950,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerResourcesResponse res = sdk.plex().getServerResources() GetServerResourcesResponse res = sdk.plex().getServerResources()
@@ -2268,11 +1984,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSearchResultsResponse res = sdk.search().getSearchResults() GetSearchResultsResponse res = sdk.search().getSearchResults()
@@ -2304,15 +2015,10 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation()
.source("server://client-identifier") .source("provider://provider-identifier")
.call(); .call();
// handle response // handle response
@@ -2340,11 +2046,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTransientTokenResponse res = sdk.authentication().getTransientToken() GetTransientTokenResponse res = sdk.authentication().getTransientToken()
@@ -2375,11 +2076,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerListResponse res = sdk.server().getServerList() GetServerListResponse res = sdk.server().getServerList()
@@ -2410,11 +2106,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics()
@@ -2446,11 +2137,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetStatisticsResponse res = sdk.statistics().getStatistics() GetStatisticsResponse res = sdk.statistics().getStatistics()
@@ -2482,11 +2168,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics()
@@ -2518,11 +2199,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSessionsResponse res = sdk.sessions().getSessions() GetSessionsResponse res = sdk.sessions().getSessions()
@@ -2554,15 +2230,10 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
.sort("<value>") .sort("viewedAt:desc")
.accountId(1L) .accountId(1L)
.filter(QueryParamFilter.builder() .filter(QueryParamFilter.builder()
.build()) .build())
@@ -2594,11 +2265,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions()
@@ -2629,11 +2295,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession()
@@ -2665,11 +2326,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
ApplyUpdatesResponse res = sdk.updater().applyUpdates() ApplyUpdatesResponse res = sdk.updater().applyUpdates()
@@ -2701,11 +2357,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
CheckForUpdatesResponse res = sdk.updater().checkForUpdates() CheckForUpdatesResponse res = sdk.updater().checkForUpdates()
@@ -2735,11 +2386,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() GetUpdateStatusResponse res = sdk.updater().getUpdateStatus()
@@ -2770,11 +2416,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() GetTokenDetailsResponse res = sdk.authentication().getTokenDetails()
@@ -2806,17 +2447,18 @@ actions:
public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder() PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.requestBody(PostUsersSignInDataRequestBody.builder() .requestBody(PostUsersSignInDataRequestBody.builder()
.login("username@email.com") .login("username@email.com")
.password("password123") .password("password123")
.rememberMe(false)
.verificationCode("123456") .verificationCode("123456")
.build()) .build())
.build(); .build();
@@ -2851,11 +2493,6 @@ actions:
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder()

View File

@@ -0,0 +1,11 @@
# EnableCreditsMarkerGeneration
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
## Values
| Name | Value |
| ---------------- | ---------------- |
| `LibraryDefault` | -1 |
| `Disabled` | 0 |

View File

@@ -0,0 +1,12 @@
# EpisodeSort
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
## Values
| Name | Value |
| ---------------- | ---------------- |
| `LibraryDefault` | -1 |
| `OldestFirst` | 0 |
| `NewestFirst` | 1 |

View File

@@ -1,9 +1,12 @@
# FlattenSeasons # FlattenSeasons
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
## Values ## Values
| Name | Value | | Name | Value |
| ------- | ------- | | ---------------- | ---------------- |
| `False` | 0 | | `LibraryDefault` | -1 |
| `True` | 1 | | `Hide` | 0 |
| `Show` | 1 |

View File

@@ -0,0 +1,11 @@
# GetLibraryItemsEnableCreditsMarkerGeneration
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
## Values
| Name | Value |
| ---------------- | ---------------- |
| `LibraryDefault` | -1 |
| `Disabled` | 0 |

View File

@@ -0,0 +1,12 @@
# GetLibraryItemsEpisodeSort
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
## Values
| Name | Value |
| ---------------- | ---------------- |
| `LibraryDefault` | -1 |
| `OldestFirst` | 0 |
| `NewestFirst` | 1 |

View File

@@ -1,9 +1,12 @@
# GetLibraryItemsFlattenSeasons # GetLibraryItemsFlattenSeasons
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
## Values ## Values
| Name | Value | | Name | Value |
| ------- | ------- | | ---------------- | ---------------- |
| `False` | 0 | | `LibraryDefault` | -1 |
| `True` | 1 | | `Hide` | 0 |
| `Show` | 1 |

View File

@@ -23,8 +23,10 @@
| `year` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 | | `year` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 |
| `seasonCount` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 | | `seasonCount` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 |
| `tagline` | *Optional\<String>* | :heavy_minus_sign: | N/A | Return to Pandora. | | `tagline` | *Optional\<String>* | :heavy_minus_sign: | N/A | Return to Pandora. |
| `flattenSeasons` | [Optional\<GetLibraryItemsFlattenSeasons>](../../models/operations/GetLibraryItemsFlattenSeasons.md) | :heavy_minus_sign: | N/A | 1 | | `flattenSeasons` | [Optional\<GetLibraryItemsFlattenSeasons>](../../models/operations/GetLibraryItemsFlattenSeasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
| `showOrdering` | [Optional\<GetLibraryItemsShowOrdering>](../../models/operations/GetLibraryItemsShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show <br/>None = Library default, <br/>tmdbAiring = The Movie Database (Aired), <br/>aired = TheTVDB (Aired), <br/>dvd = TheTVDB (DVD), <br/>absolute = TheTVDB (Absolute)).<br/> | dvd | | `episodeSort` | [Optional\<GetLibraryItemsEpisodeSort>](../../models/operations/GetLibraryItemsEpisodeSort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
| `enableCreditsMarkerGeneration` | [Optional\<GetLibraryItemsEnableCreditsMarkerGeneration>](../../models/operations/GetLibraryItemsEnableCreditsMarkerGeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
| `showOrdering` | [Optional\<GetLibraryItemsShowOrdering>](../../models/operations/GetLibraryItemsShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | | `thumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
| `art` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | | `art` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
| `banner` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | | `banner` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 |

View File

@@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season
| `TvShow` | 2 | | `TvShow` | 2 |
| `Season` | 3 | | `Season` | 3 |
| `Episode` | 4 | | `Episode` | 4 |
| `Audio` | 8 | | `Audio` | 8 |
| `Album` | 9 |
| `Track` | 10 |

View File

@@ -1,20 +1,20 @@
# GetLibraryItemsShowOrdering # GetLibraryItemsShowOrdering
Setting that indicates the episode ordering for the show Setting that indicates the episode ordering for the show
None = Library default, None = Library default,
tmdbAiring = The Movie Database (Aired), tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired), tvdbAiring = TheTVDB (Aired),
dvd = TheTVDB (DVD), tvdbDvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)). tvdbAbsolute = TheTVDB (Absolute)).
## Values ## Values
| Name | Value | | Name | Value |
| ------------ | ------------ | | -------------- | -------------- |
| `None` | None | | `None` | None |
| `TmdbAiring` | tmdbAiring | | `TmdbAiring` | tmdbAiring |
| `Aired` | aired | | `TvdbAiring` | tvdbAiring |
| `Dvd` | dvd | | `TvdbDvd` | tvdbDvd |
| `Absolute` | absolute | | `TvdbAbsolute` | tvdbAbsolute |

View File

@@ -14,6 +14,11 @@
| `librarySectionTitle` | *Optional\<String>* | :heavy_minus_sign: | N/A | Movies | | `librarySectionTitle` | *Optional\<String>* | :heavy_minus_sign: | N/A | Movies |
| `librarySectionID` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1 | | `librarySectionID` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `librarySectionKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/sections/1 | | `librarySectionKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/sections/1 |
| `grandparentTitle` | *Optional\<String>* | :heavy_minus_sign: | The name of the album artist for the track when audio, and the name of the TV show for the episode when video. | |
| `parentTitle` | *Optional\<String>* | :heavy_minus_sign: | The name of the album for the track when audio, and the name of the season for the episode when TV show. | |
| `originalTitle` | *Optional\<String>* | :heavy_minus_sign: | The orginal untranslated name of the media item when non-english. | |
| `index` | *Optional\<Long>* | :heavy_minus_sign: | The index starting from 0 of this media item in the MetaData array. | |
| `parentIndex` | *Optional\<Long>* | :heavy_minus_sign: | The parent index starting from 0 of this media item in the parent MetaData array. | |
| `contentRating` | *Optional\<String>* | :heavy_minus_sign: | N/A | PG-13 | | `contentRating` | *Optional\<String>* | :heavy_minus_sign: | N/A | PG-13 |
| `summary` | *Optional\<String>* | :heavy_minus_sign: | N/A | 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. | | `summary` | *Optional\<String>* | :heavy_minus_sign: | N/A | 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` | *Optional\<Double>* | :heavy_minus_sign: | N/A | 8.2 | | `rating` | *Optional\<Double>* | :heavy_minus_sign: | N/A | 8.2 |

View File

@@ -6,7 +6,7 @@
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `strong` | *Optional\<Boolean>* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | | | `strong` | *Optional\<Boolean>* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | |
| `clientID` | *Optional\<String>* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientID` | *String* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `clientName` | *Optional\<String>* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | | `clientName` | *Optional\<String>* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `deviceNickname` | *Optional\<String>* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | | `deviceNickname` | *Optional\<String>* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `clientVersion` | *Optional\<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | | `clientVersion` | *Optional\<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |

View File

@@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season
| `TvShow` | 2 | | `TvShow` | 2 |
| `Season` | 3 | | `Season` | 3 |
| `Episode` | 4 | | `Episode` | 4 |
| `Audio` | 8 | | `Audio` | 8 |
| `Album` | 9 |
| `Track` | 10 |

View File

@@ -23,8 +23,10 @@
| `year` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 | | `year` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 |
| `seasonCount` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 | | `seasonCount` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 |
| `tagline` | *Optional\<String>* | :heavy_minus_sign: | N/A | Return to Pandora. | | `tagline` | *Optional\<String>* | :heavy_minus_sign: | N/A | Return to Pandora. |
| `flattenSeasons` | [Optional\<FlattenSeasons>](../../models/operations/FlattenSeasons.md) | :heavy_minus_sign: | N/A | 1 | | `flattenSeasons` | [Optional\<FlattenSeasons>](../../models/operations/FlattenSeasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
| `showOrdering` | [Optional\<ShowOrdering>](../../models/operations/ShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show <br/>None = Library default, <br/>tmdbAiring = The Movie Database (Aired), <br/>aired = TheTVDB (Aired), <br/>dvd = TheTVDB (DVD), <br/>absolute = TheTVDB (Absolute)).<br/> | dvd | | `episodeSort` | [Optional\<EpisodeSort>](../../models/operations/EpisodeSort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
| `enableCreditsMarkerGeneration` | [Optional\<EnableCreditsMarkerGeneration>](../../models/operations/EnableCreditsMarkerGeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
| `showOrdering` | [Optional\<ShowOrdering>](../../models/operations/ShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | | `thumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
| `art` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | | `art` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
| `banner` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | | `banner` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 |

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesEnableCreditsMarkerGeneration
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
## Values
| Name | Value |
| ---------------- | ---------------- |
| `LibraryDefault` | -1 |
| `Disabled` | 0 |

View File

@@ -0,0 +1,12 @@
# GetSearchAllLibrariesEpisodeSort
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
## Values
| Name | Value |
| ---------------- | ---------------- |
| `LibraryDefault` | -1 |
| `OldestFirst` | 0 |
| `NewestFirst` | 1 |

View File

@@ -1,9 +1,12 @@
# GetSearchAllLibrariesFlattenSeasons # GetSearchAllLibrariesFlattenSeasons
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
## Values ## Values
| Name | Value | | Name | Value |
| ------- | ------- | | ---------------- | ---------------- |
| `False` | 0 | | `LibraryDefault` | -1 |
| `True` | 1 | | `Hide` | 0 |
| `Show` | 1 |

View File

@@ -23,8 +23,10 @@
| `year` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 | | `year` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 |
| `seasonCount` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 | | `seasonCount` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2022 |
| `tagline` | *Optional\<String>* | :heavy_minus_sign: | N/A | Return to Pandora. | | `tagline` | *Optional\<String>* | :heavy_minus_sign: | N/A | Return to Pandora. |
| `flattenSeasons` | [Optional\<GetSearchAllLibrariesFlattenSeasons>](../../models/operations/GetSearchAllLibrariesFlattenSeasons.md) | :heavy_minus_sign: | N/A | 1 | | `flattenSeasons` | [Optional\<GetSearchAllLibrariesFlattenSeasons>](../../models/operations/GetSearchAllLibrariesFlattenSeasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
| `showOrdering` | [Optional\<GetSearchAllLibrariesShowOrdering>](../../models/operations/GetSearchAllLibrariesShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show <br/>None = Library default, <br/>tmdbAiring = The Movie Database (Aired), <br/>aired = TheTVDB (Aired), <br/>dvd = TheTVDB (DVD), <br/>absolute = TheTVDB (Absolute)).<br/> | dvd | | `episodeSort` | [Optional\<GetSearchAllLibrariesEpisodeSort>](../../models/operations/GetSearchAllLibrariesEpisodeSort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
| `enableCreditsMarkerGeneration` | [Optional\<GetSearchAllLibrariesEnableCreditsMarkerGeneration>](../../models/operations/GetSearchAllLibrariesEnableCreditsMarkerGeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
| `showOrdering` | [Optional\<GetSearchAllLibrariesShowOrdering>](../../models/operations/GetSearchAllLibrariesShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | | `thumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
| `art` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | | `art` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
| `banner` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | | `banner` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 |

View File

@@ -6,7 +6,7 @@
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `query` | *String* | :heavy_check_mark: | The search query term. | | | `query` | *String* | :heavy_check_mark: | The search query term. | |
| `clientID` | *Optional\<String>* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientID` | *String* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `limit` | *Optional\<Long>* | :heavy_minus_sign: | Limit the number of results returned. | | | `limit` | *Optional\<Long>* | :heavy_minus_sign: | Limit the number of results returned. | |
| `searchTypes` | List\<[SearchTypes](../../models/operations/SearchTypes.md)> | :heavy_minus_sign: | A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.<br/> | movies,music,otherVideos,people,tv | | `searchTypes` | List\<[SearchTypes](../../models/operations/SearchTypes.md)> | :heavy_minus_sign: | A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.<br/> | movies,music,otherVideos,people,tv |
| `includeCollections` | [Optional\<QueryParamIncludeCollections>](../../models/operations/QueryParamIncludeCollections.md) | :heavy_minus_sign: | Whether to include collections in the search results. | 1 | | `includeCollections` | [Optional\<QueryParamIncludeCollections>](../../models/operations/QueryParamIncludeCollections.md) | :heavy_minus_sign: | Whether to include collections in the search results. | 1 |

View File

@@ -1,20 +1,20 @@
# GetSearchAllLibrariesShowOrdering # GetSearchAllLibrariesShowOrdering
Setting that indicates the episode ordering for the show Setting that indicates the episode ordering for the show
None = Library default, None = Library default,
tmdbAiring = The Movie Database (Aired), tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired), tvdbAiring = TheTVDB (Aired),
dvd = TheTVDB (DVD), tvdbDvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)). tvdbAbsolute = TheTVDB (Absolute)).
## Values ## Values
| Name | Value | | Name | Value |
| ------------ | ------------ | | -------------- | -------------- |
| `None` | None | | `None` | None |
| `TmdbAiring` | tmdbAiring | | `TmdbAiring` | tmdbAiring |
| `Aired` | aired | | `TvdbAiring` | tvdbAiring |
| `Dvd` | dvd | | `TvdbDvd` | tvdbDvd |
| `Absolute` | absolute | | `TvdbAbsolute` | tvdbAbsolute |

View File

@@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season
| `TvShow` | 2 | | `TvShow` | 2 |
| `Season` | 3 | | `Season` | 3 |
| `Episode` | 4 | | `Episode` | 4 |
| `Audio` | 8 | | `Audio` | 8 |
| `Album` | 9 |
| `Track` | 10 |

View File

@@ -8,4 +8,4 @@
| `includeHttps` | [Optional\<IncludeHttps>](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | | `includeHttps` | [Optional\<IncludeHttps>](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 |
| `includeRelay` | [Optional\<IncludeRelay>](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 | | `includeRelay` | [Optional\<IncludeRelay>](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 |
| `includeIPv6` | [Optional\<IncludeIPv6>](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | | `includeIPv6` | [Optional\<IncludeIPv6>](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| `clientID` | *Optional\<String>* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientID` | *String* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |

View File

@@ -3,42 +3,43 @@
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `addedAt` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1705543312 | | `addedAt` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1705543312 |
| `art` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 | | `art` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 |
| `duration` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 186240 | | `duration` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 186240 |
| `grandparentArt` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 | | `grandparentArt` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 |
| `grandparentGuid` | *Optional\<String>* | :heavy_minus_sign: | N/A | plex://artist/5d07bbfd403c6402904a6480 | | `grandparentGuid` | *Optional\<String>* | :heavy_minus_sign: | N/A | plex://artist/5d07bbfd403c6402904a6480 |
| `grandparentKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/39904 | | `grandparentKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/39904 |
| `grandparentRatingKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | 39904 | | `grandparentRatingKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | 39904 |
| `grandparentThumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/39904/thumb/1705310687 | | `grandparentThumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/39904/thumb/1705310687 |
| `grandparentTitle` | *Optional\<String>* | :heavy_minus_sign: | N/A | Green Day | | `grandparentTitle` | *Optional\<String>* | :heavy_minus_sign: | N/A | Green Day |
| `guid` | *Optional\<String>* | :heavy_minus_sign: | N/A | plex://track/6535834f71f22f36f71a8e8f | | `guid` | *Optional\<String>* | :heavy_minus_sign: | N/A | plex://track/6535834f71f22f36f71a8e8f |
| `index` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1 | | `index` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `key` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/67085 | | `key` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/67085 |
| `librarySectionID` | *Optional\<String>* | :heavy_minus_sign: | N/A | 3 | | `librarySectionID` | *Optional\<String>* | :heavy_minus_sign: | N/A | 3 |
| `librarySectionKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/sections/3 | | `librarySectionKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/sections/3 |
| `librarySectionTitle` | *Optional\<String>* | :heavy_minus_sign: | N/A | Music | | `librarySectionTitle` | *Optional\<String>* | :heavy_minus_sign: | N/A | Music |
| `musicAnalysisVersion` | *Optional\<String>* | :heavy_minus_sign: | N/A | 1 | | `musicAnalysisVersion` | *Optional\<String>* | :heavy_minus_sign: | N/A | 1 |
| `parentGuid` | *Optional\<String>* | :heavy_minus_sign: | N/A | plex://album/65394d6d472b8ab03ef47f12 | | `originalTitle` | *Optional\<String>* | :heavy_minus_sign: | The original untranslated name of the media item when non-english, or the track artist if an audio Item has an album artist | The American Dream Is Killing Me |
| `parentIndex` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1 | | `parentGuid` | *Optional\<String>* | :heavy_minus_sign: | N/A | plex://album/65394d6d472b8ab03ef47f12 |
| `parentKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/67084 | | `parentIndex` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `parentRatingKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | 67084 | | `parentKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/67084 |
| `parentStudio` | *Optional\<String>* | :heavy_minus_sign: | N/A | Reprise Records | | `parentRatingKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | 67084 |
| `parentThumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 | | `parentStudio` | *Optional\<String>* | :heavy_minus_sign: | N/A | Reprise Records |
| `parentTitle` | *Optional\<String>* | :heavy_minus_sign: | N/A | Saviors | | `parentThumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 |
| `parentYear` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2024 | | `parentTitle` | *Optional\<String>* | :heavy_minus_sign: | N/A | Saviors |
| `ratingCount` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 45885 | | `parentYear` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 2024 |
| `ratingKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | 67085 | | `ratingCount` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 45885 |
| `sessionKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | 203 | | `ratingKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | 67085 |
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 | | `sessionKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | 203 |
| `title` | *Optional\<String>* | :heavy_minus_sign: | N/A | The American Dream Is Killing Me | | `thumb` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 |
| `titleSort` | *Optional\<String>* | :heavy_minus_sign: | N/A | American Dream Is Killing Me | | `title` | *Optional\<String>* | :heavy_minus_sign: | N/A | The American Dream Is Killing Me |
| `type` | *Optional\<String>* | :heavy_minus_sign: | N/A | track | | `titleSort` | *Optional\<String>* | :heavy_minus_sign: | N/A | American Dream Is Killing Me |
| `updatedAt` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1705543314 | | `type` | *Optional\<String>* | :heavy_minus_sign: | N/A | track |
| `viewOffset` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1000 | | `updatedAt` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1705543314 |
| `media` | List\<[GetSessionsMedia](../../models/operations/GetSessionsMedia.md)> | :heavy_minus_sign: | N/A | | | `viewOffset` | *Optional\<Integer>* | :heavy_minus_sign: | N/A | 1000 |
| `user` | [Optional\<GetSessionsUser>](../../models/operations/GetSessionsUser.md) | :heavy_minus_sign: | N/A | | | `media` | List\<[GetSessionsMedia](../../models/operations/GetSessionsMedia.md)> | :heavy_minus_sign: | N/A | |
| `player` | [Optional\<Player>](../../models/operations/Player.md) | :heavy_minus_sign: | N/A | | | `user` | [Optional\<GetSessionsUser>](../../models/operations/GetSessionsUser.md) | :heavy_minus_sign: | N/A | |
| `session` | [Optional\<Session>](../../models/operations/Session.md) | :heavy_minus_sign: | N/A | | | `player` | [Optional\<Player>](../../models/operations/Player.md) | :heavy_minus_sign: | N/A | |
| `session` | [Optional\<Session>](../../models/operations/Session.md) | :heavy_minus_sign: | N/A | |

View File

@@ -6,7 +6,7 @@
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | | | `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | |
| `clientID` | *Optional\<String>* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientID` | *String* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `clientName` | *Optional\<String>* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | | `clientName` | *Optional\<String>* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `deviceNickname` | *Optional\<String>* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | | `deviceNickname` | *Optional\<String>* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `clientVersion` | *Optional\<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | | `clientVersion` | *Optional\<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |

View File

@@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season
| `TvShow` | 2 | | `TvShow` | 2 |
| `Season` | 3 | | `Season` | 3 |
| `Episode` | 4 | | `Episode` | 4 |
| `Audio` | 8 | | `Audio` | 8 |
| `Album` | 9 |
| `Track` | 10 |

View File

@@ -5,7 +5,7 @@
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `clientID` | *Optional\<String>* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientID` | *String* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `clientName` | *Optional\<String>* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | | `clientName` | *Optional\<String>* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `deviceNickname` | *Optional\<String>* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | | `deviceNickname` | *Optional\<String>* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `clientVersion` | *Optional\<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | | `clientVersion` | *Optional\<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |

View File

@@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season
| `TvShow` | 2 | | `TvShow` | 2 |
| `Season` | 3 | | `Season` | 3 |
| `Episode` | 4 | | `Episode` | 4 |
| `Audio` | 8 | | `Audio` | 8 |
| `Album` | 9 |
| `Track` | 10 |

View File

@@ -1,20 +1,20 @@
# ShowOrdering # ShowOrdering
Setting that indicates the episode ordering for the show Setting that indicates the episode ordering for the show
None = Library default, None = Library default,
tmdbAiring = The Movie Database (Aired), tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired), tvdbAiring = TheTVDB (Aired),
dvd = TheTVDB (DVD), tvdbDvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)). tvdbAbsolute = TheTVDB (Absolute)).
## Values ## Values
| Name | Value | | Name | Value |
| ------------ | ------------ | | -------------- | -------------- |
| `None` | None | | `None` | None |
| `TmdbAiring` | tmdbAiring | | `TmdbAiring` | tmdbAiring |
| `Aired` | aired | | `TvdbAiring` | tvdbAiring |
| `Dvd` | dvd | | `TvdbDvd` | tvdbDvd |
| `Absolute` | absolute | | `TvdbAbsolute` | tvdbAbsolute |

View File

@@ -25,4 +25,5 @@ A key representing a specific tag within the section.
| `RATING` | rating | | `RATING` | rating |
| `RESOLUTION` | resolution | | `RESOLUTION` | resolution |
| `FIRST_CHARACTER` | firstCharacter | | `FIRST_CHARACTER` | firstCharacter |
| `FOLDER` | folder | | `FOLDER` | folder |
| `ALBUMS` | albums |

View File

@@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season
| `TvShow` | 2 | | `TvShow` | 2 |
| `Season` | 3 | | `Season` | 3 |
| `Episode` | 4 | | `Episode` | 4 |
| `Audio` | 8 | | `Audio` | 8 |
| `Album` | 9 |
| `Track` | 10 |

View File

@@ -38,11 +38,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerActivitiesResponse res = sdk.activities().getServerActivities() GetServerActivitiesResponse res = sdk.activities().getServerActivities()
@@ -88,11 +83,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities()

View File

@@ -37,11 +37,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTransientTokenResponse res = sdk.authentication().getTransientToken() GetTransientTokenResponse res = sdk.authentication().getTransientToken()
@@ -96,15 +91,10 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation()
.source("server://client-identifier") .source("provider://provider-identifier")
.call(); .call();
// handle response // handle response
@@ -151,11 +141,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() GetTokenDetailsResponse res = sdk.authentication().getTokenDetails()
@@ -208,17 +193,18 @@ public class Application {
public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder() PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.requestBody(PostUsersSignInDataRequestBody.builder() .requestBody(PostUsersSignInDataRequestBody.builder()
.login("username@email.com") .login("username@email.com")
.password("password123") .password("password123")
.rememberMe(false)
.verificationCode("123456") .verificationCode("123456")
.build()) .build())
.build(); .build();

View File

@@ -35,11 +35,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetButlerTasksResponse res = sdk.butler().getButlerTasks() GetButlerTasksResponse res = sdk.butler().getButlerTasks()
@@ -90,11 +85,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StartAllTasksResponse res = sdk.butler().startAllTasks() StartAllTasksResponse res = sdk.butler().startAllTasks()
@@ -139,11 +129,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StopAllTasksResponse res = sdk.butler().stopAllTasks() StopAllTasksResponse res = sdk.butler().stopAllTasks()
@@ -193,11 +178,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StartTaskResponse res = sdk.butler().startTask() StartTaskResponse res = sdk.butler().startTask()
@@ -250,11 +230,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StopTaskResponse res = sdk.butler().stopTask() StopTaskResponse res = sdk.butler().stopTask()

View File

@@ -34,11 +34,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
@@ -95,11 +90,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder() GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder()
@@ -161,17 +151,12 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
.sectionId(6728.76d) .sectionId(6728.76d)
.count(639.24d) .count(6728.76d)
.onlyTransient(QueryParamOnlyTransient.ONE) .onlyTransient(QueryParamOnlyTransient.ZERO)
.call(); .call();
if (res.object().isPresent()) { if (res.object().isPresent()) {

View File

@@ -43,11 +43,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetFileHashResponse res = sdk.library().getFileHash() GetFileHashResponse res = sdk.library().getFileHash()
@@ -105,11 +100,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder() GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder()
@@ -190,11 +180,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetAllLibrariesResponse res = sdk.library().getAllLibraries() GetAllLibrariesResponse res = sdk.library().getAllLibraries()
@@ -280,11 +265,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
@@ -339,11 +319,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
DeleteLibraryResponse res = sdk.library().deleteLibrary() DeleteLibraryResponse res = sdk.library().deleteLibrary()
@@ -395,6 +370,7 @@ Fetches details from a specific section of the library identified by a section k
- `resolution`: Items categorized by resolution. - `resolution`: Items categorized by resolution.
- `firstCharacter`: Items categorized by the first letter. - `firstCharacter`: Items categorized by the first letter.
- `folder`: Items categorized by folder. - `folder`: Items categorized by folder.
- `albums`: Items categorized by album.
### Example Usage ### Example Usage
@@ -419,11 +395,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() GetLibraryItemsRequest req = GetLibraryItemsRequest.builder()
@@ -488,11 +459,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata()
@@ -564,11 +530,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSearchLibraryResponse res = sdk.library().getSearchLibrary() GetSearchLibraryResponse res = sdk.library().getSearchLibrary()
@@ -629,15 +590,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder() GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder()
.query("<value>") .query("<value>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.searchTypes(List.of( .searchTypes(List.of(
SearchTypes.PEOPLE)) SearchTypes.PEOPLE))
.includeCollections(QueryParamIncludeCollections.Enable) .includeCollections(QueryParamIncludeCollections.Enable)
@@ -695,11 +652,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey()
@@ -753,16 +705,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
.ratingKey(1539.15d) .ratingKey(1539.14d)
.includeElements("<value>") .includeElements("Stream")
.call(); .call();
if (res.object().isPresent()) { if (res.object().isPresent()) {
@@ -814,11 +761,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent()
@@ -874,11 +816,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetOnDeckResponse res = sdk.library().getOnDeck() GetOnDeckResponse res = sdk.library().getOnDeck()

View File

@@ -35,11 +35,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
LogLineResponse res = sdk.log().logLine() LogLineResponse res = sdk.log().logLine()
@@ -116,15 +111,9 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman";
level=1&message=Test%20message%203&source=postman";
LogMultiLineResponse res = sdk.log().logMultiLine() LogMultiLineResponse res = sdk.log().logMultiLine()
.request(req) .request(req)
@@ -175,11 +164,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
EnablePaperTrailResponse res = sdk.log().enablePaperTrail() EnablePaperTrailResponse res = sdk.log().enablePaperTrail()

View File

@@ -35,11 +35,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
MarkPlayedResponse res = sdk.media().markPlayed() MarkPlayedResponse res = sdk.media().markPlayed()
@@ -90,11 +85,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
MarkUnplayedResponse res = sdk.media().markUnplayed() MarkUnplayedResponse res = sdk.media().markUnplayed()
@@ -146,11 +136,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
@@ -206,11 +191,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetBannerImageRequest req = GetBannerImageRequest.builder() GetBannerImageRequest req = GetBannerImageRequest.builder()
@@ -273,11 +253,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetThumbImageRequest req = GetThumbImageRequest.builder() GetThumbImageRequest req = GetThumbImageRequest.builder()

View File

@@ -48,11 +48,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
CreatePlaylistRequest req = CreatePlaylistRequest.builder() CreatePlaylistRequest req = CreatePlaylistRequest.builder()
@@ -114,11 +109,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetPlaylistsResponse res = sdk.playlists().getPlaylists() GetPlaylistsResponse res = sdk.playlists().getPlaylists()
@@ -175,11 +165,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetPlaylistResponse res = sdk.playlists().getPlaylist() GetPlaylistResponse res = sdk.playlists().getPlaylist()
@@ -233,11 +218,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
DeletePlaylistResponse res = sdk.playlists().deletePlaylist() DeletePlaylistResponse res = sdk.playlists().deletePlaylist()
@@ -289,15 +269,10 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
.playlistID(3915.00d) .playlistID(3915d)
.title("<value>") .title("<value>")
.summary("<value>") .summary("<value>")
.call(); .call();
@@ -353,11 +328,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents()
@@ -413,11 +383,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents()
@@ -470,15 +435,10 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents()
.playlistID(8502.00d) .playlistID(8502.01d)
.uri("server://12345/com.plexapp.plugins.library/library/metadata/1") .uri("server://12345/com.plexapp.plugins.library/library/metadata/1")
.playQueueID(123d) .playQueueID(123d)
.call(); .call();
@@ -533,11 +493,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() UploadPlaylistResponse res = sdk.playlists().uploadPlaylist()

View File

@@ -37,11 +37,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetCompanionsDataResponse res = sdk.plex().getCompanionsData() GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
@@ -93,11 +88,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetUserFriendsResponse res = sdk.plex().getUserFriends() GetUserFriendsResponse res = sdk.plex().getUserFriends()
@@ -148,11 +138,6 @@ public class Application {
public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetGeoDataResponse res = sdk.plex().getGeoData() GetGeoDataResponse res = sdk.plex().getGeoData()
@@ -204,11 +189,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetHomeDataResponse res = sdk.plex().getHomeData() GetHomeDataResponse res = sdk.plex().getHomeData()
@@ -257,11 +237,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerResourcesResponse res = sdk.plex().getServerResources() GetServerResourcesResponse res = sdk.plex().getServerResources()
@@ -285,7 +260,7 @@ public class Application {
| `includeHttps` | [Optional\<IncludeHttps>](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | | `includeHttps` | [Optional\<IncludeHttps>](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 |
| `includeRelay` | [Optional\<IncludeRelay>](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 | | `includeRelay` | [Optional\<IncludeRelay>](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 |
| `includeIPv6` | [Optional\<IncludeIPv6>](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | | `includeIPv6` | [Optional\<IncludeIPv6>](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| `clientID` | *Optional\<String>* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientID` | *String* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | | `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
### Response ### Response
@@ -320,14 +295,15 @@ public class Application {
public static void main(String[] args) throws GetPinBadRequest, Exception { public static void main(String[] args) throws GetPinBadRequest, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetPinRequest req = GetPinRequest.builder() GetPinRequest req = GetPinRequest.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.strong(false)
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.build(); .build();
GetPinResponse res = sdk.plex().getPin() GetPinResponse res = sdk.plex().getPin()
@@ -380,15 +356,15 @@ public class Application {
public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder() GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder()
.pinID(408895L) .pinID(408895L)
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.build(); .build();
GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()

View File

@@ -26,3 +26,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/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) | - | | 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) | - | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
### Available Operations

View File

@@ -45,16 +45,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
PerformSearchResponse res = sdk.search().performSearch() PerformSearchResponse res = sdk.search().performSearch()
.query("dylan") .query("dylan")
.sectionId(9372.69d) .sectionId(9487.88d)
.limit(5d) .limit(5d)
.call(); .call();
@@ -108,16 +103,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
.query("dead+poop") .query("dead+poop")
.sectionId(4094.80d) .sectionId(4094.8d)
.limit(5d) .limit(5d)
.call(); .call();
@@ -167,11 +157,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSearchResultsResponse res = sdk.search().getSearchResults() GetSearchResultsResponse res = sdk.search().getSearchResults()

View File

@@ -39,11 +39,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -89,11 +84,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerPreferencesResponse res = sdk.server().getServerPreferences() GetServerPreferencesResponse res = sdk.server().getServerPreferences()
@@ -139,11 +129,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetAvailableClientsResponse res = sdk.server().getAvailableClients() GetAvailableClientsResponse res = sdk.server().getAvailableClients()
@@ -189,11 +174,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetDevicesResponse res = sdk.server().getDevices() GetDevicesResponse res = sdk.server().getDevices()
@@ -237,11 +217,6 @@ public class Application {
public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerIdentityResponse res = sdk.server().getServerIdentity() GetServerIdentityResponse res = sdk.server().getServerIdentity()
@@ -286,11 +261,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount()
@@ -340,19 +310,14 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() GetResizedPhotoRequest req = GetResizedPhotoRequest.builder()
.width(110d) .width(110d)
.height(165d) .height(165d)
.opacity(100L) .opacity(100L)
.blur(20d) .blur(0d)
.minSize(MinSize.ZERO) .minSize(MinSize.ONE)
.upscale(Upscale.ONE) .upscale(Upscale.ONE)
.url("/library/metadata/49564/thumb/1654258204") .url("/library/metadata/49564/thumb/1654258204")
.build(); .build();
@@ -405,11 +370,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetMediaProvidersResponse res = sdk.server().getMediaProviders() GetMediaProvidersResponse res = sdk.server().getMediaProviders()
@@ -462,11 +422,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetServerListResponse res = sdk.server().getServerList() GetServerListResponse res = sdk.server().getServerList()

View File

@@ -34,11 +34,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSessionsResponse res = sdk.sessions().getSessions() GetSessionsResponse res = sdk.sessions().getSessions()
@@ -85,15 +80,10 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
.sort("<value>") .sort("viewedAt:desc")
.accountId(1L) .accountId(1L)
.filter(QueryParamFilter.builder() .filter(QueryParamFilter.builder()
.build()) .build())
@@ -149,11 +139,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions()
@@ -199,11 +184,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession()

View File

@@ -33,11 +33,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetStatisticsResponse res = sdk.statistics().getStatistics() GetStatisticsResponse res = sdk.statistics().getStatistics()
@@ -90,11 +85,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics()
@@ -147,11 +137,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics()

View File

@@ -34,11 +34,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() GetUpdateStatusResponse res = sdk.updater().getUpdateStatus()
@@ -85,11 +80,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
CheckForUpdatesResponse res = sdk.updater().checkForUpdates() CheckForUpdatesResponse res = sdk.updater().checkForUpdates()
@@ -143,11 +133,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
ApplyUpdatesResponse res = sdk.updater().applyUpdates() ApplyUpdatesResponse res = sdk.updater().applyUpdates()

View File

@@ -34,11 +34,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetTimelineRequest req = GetTimelineRequest.builder() GetTimelineRequest req = GetTimelineRequest.builder()
@@ -103,11 +98,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder()

View File

@@ -33,11 +33,6 @@ public class Application {
PlexAPI sdk = PlexAPI.builder() PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>") .accessToken("<YOUR_API_KEY_HERE>")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build(); .build();
GetWatchListRequest req = GetWatchListRequest.builder() GetWatchListRequest req = GetWatchListRequest.builder()

View File

@@ -78,10 +78,10 @@ public class Activities implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -89,7 +89,7 @@ public class Activities implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getServerActivities", "getServerActivities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -100,7 +100,7 @@ public class Activities implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getServerActivities", "getServerActivities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -109,7 +109,7 @@ public class Activities implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getServerActivities", "getServerActivities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -118,7 +118,7 @@ public class Activities implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getServerActivities", "getServerActivities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -182,7 +182,15 @@ public class Activities implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -229,16 +237,16 @@ public class Activities implements
CancelServerActivitiesRequest.class, CancelServerActivitiesRequest.class,
_baseUrl, _baseUrl,
"/activities/{activityUUID}", "/activities/{activityUUID}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "DELETE"); HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -246,7 +254,7 @@ public class Activities implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"cancelServerActivities", "cancelServerActivities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -257,7 +265,7 @@ public class Activities implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"cancelServerActivities", "cancelServerActivities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -266,7 +274,7 @@ public class Activities implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"cancelServerActivities", "cancelServerActivities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -275,7 +283,7 @@ public class Activities implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"cancelServerActivities", "cancelServerActivities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -328,7 +336,15 @@ public class Activities implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -122,11 +122,11 @@ public class Authentication implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetTransientTokenRequest.class, GetTransientTokenRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -134,7 +134,7 @@ public class Authentication implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getTransientToken", "getTransientToken",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -145,7 +145,7 @@ public class Authentication implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTransientToken", "getTransientToken",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -154,7 +154,7 @@ public class Authentication implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getTransientToken", "getTransientToken",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -163,7 +163,7 @@ public class Authentication implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTransientToken", "getTransientToken",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -216,7 +216,15 @@ public class Authentication implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -275,11 +283,11 @@ public class Authentication implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetSourceConnectionInformationRequest.class, GetSourceConnectionInformationRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -287,7 +295,7 @@ public class Authentication implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getSourceConnectionInformation", "getSourceConnectionInformation",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -298,7 +306,7 @@ public class Authentication implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getSourceConnectionInformation", "getSourceConnectionInformation",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -307,7 +315,7 @@ public class Authentication implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getSourceConnectionInformation", "getSourceConnectionInformation",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -316,7 +324,7 @@ public class Authentication implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getSourceConnectionInformation", "getSourceConnectionInformation",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -369,7 +377,15 @@ public class Authentication implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -426,10 +442,10 @@ public class Authentication implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -437,7 +453,7 @@ public class Authentication implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getTokenDetails", "getTokenDetails",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -448,7 +464,7 @@ public class Authentication implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTokenDetails", "getTokenDetails",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -457,7 +473,7 @@ public class Authentication implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getTokenDetails", "getTokenDetails",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -466,7 +482,7 @@ public class Authentication implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTokenDetails", "getTokenDetails",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -530,7 +546,15 @@ public class Authentication implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -601,8 +625,8 @@ public class Authentication implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = Optional.empty();
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -610,7 +634,7 @@ public class Authentication implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"post-users-sign-in-data", "post-users-sign-in-data",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -621,7 +645,7 @@ public class Authentication implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"post-users-sign-in-data", "post-users-sign-in-data",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -630,7 +654,7 @@ public class Authentication implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"post-users-sign-in-data", "post-users-sign-in-data",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -639,7 +663,7 @@ public class Authentication implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"post-users-sign-in-data", "post-users-sign-in-data",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -703,7 +727,15 @@ public class Authentication implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -90,10 +90,10 @@ public class Butler implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -101,7 +101,7 @@ public class Butler implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getButlerTasks", "getButlerTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -112,7 +112,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getButlerTasks", "getButlerTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -121,7 +121,7 @@ public class Butler implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getButlerTasks", "getButlerTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -130,7 +130,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getButlerTasks", "getButlerTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -194,7 +194,15 @@ public class Butler implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -247,10 +255,10 @@ public class Butler implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -258,7 +266,7 @@ public class Butler implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"startAllTasks", "startAllTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -269,7 +277,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"startAllTasks", "startAllTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -278,7 +286,7 @@ public class Butler implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"startAllTasks", "startAllTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -287,7 +295,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"startAllTasks", "startAllTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -340,7 +348,15 @@ public class Butler implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -385,10 +401,10 @@ public class Butler implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -396,7 +412,7 @@ public class Butler implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"stopAllTasks", "stopAllTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -407,7 +423,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"stopAllTasks", "stopAllTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -416,7 +432,7 @@ public class Butler implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"stopAllTasks", "stopAllTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -425,7 +441,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"stopAllTasks", "stopAllTasks",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -478,7 +494,15 @@ public class Butler implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -535,16 +559,16 @@ public class Butler implements
StartTaskRequest.class, StartTaskRequest.class,
_baseUrl, _baseUrl,
"/butler/{taskName}", "/butler/{taskName}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "POST"); HTTPRequest _req = new HTTPRequest(_url, "POST");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -552,7 +576,7 @@ public class Butler implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"startTask", "startTask",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -563,7 +587,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"startTask", "startTask",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -572,7 +596,7 @@ public class Butler implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"startTask", "startTask",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -581,7 +605,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"startTask", "startTask",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -634,7 +658,15 @@ public class Butler implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -683,16 +715,16 @@ public class Butler implements
StopTaskRequest.class, StopTaskRequest.class,
_baseUrl, _baseUrl,
"/butler/{taskName}", "/butler/{taskName}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "DELETE"); HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -700,7 +732,7 @@ public class Butler implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"stopTask", "stopTask",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -711,7 +743,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"stopTask", "stopTask",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -720,7 +752,7 @@ public class Butler implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"stopTask", "stopTask",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -729,7 +761,7 @@ public class Butler implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"stopTask", "stopTask",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -782,7 +814,15 @@ public class Butler implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -107,11 +107,11 @@ public class Hubs implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetGlobalHubsRequest.class, GetGlobalHubsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -119,7 +119,7 @@ public class Hubs implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getGlobalHubs", "getGlobalHubs",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -130,7 +130,7 @@ public class Hubs implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getGlobalHubs", "getGlobalHubs",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -139,7 +139,7 @@ public class Hubs implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getGlobalHubs", "getGlobalHubs",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -148,7 +148,7 @@ public class Hubs implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getGlobalHubs", "getGlobalHubs",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -212,7 +212,15 @@ public class Hubs implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -263,11 +271,11 @@ public class Hubs implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetRecentlyAddedRequest.class, GetRecentlyAddedRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -275,7 +283,7 @@ public class Hubs implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-recently-added", "get-recently-added",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -286,7 +294,7 @@ public class Hubs implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-recently-added", "get-recently-added",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -295,7 +303,7 @@ public class Hubs implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-recently-added", "get-recently-added",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -304,7 +312,7 @@ public class Hubs implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-recently-added", "get-recently-added",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -336,7 +344,15 @@ public class Hubs implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -404,7 +420,7 @@ public class Hubs implements
GetLibraryHubsRequest.class, GetLibraryHubsRequest.class,
_baseUrl, _baseUrl,
"/hubs/sections/{sectionId}", "/hubs/sections/{sectionId}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -414,11 +430,11 @@ public class Hubs implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetLibraryHubsRequest.class, GetLibraryHubsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -426,7 +442,7 @@ public class Hubs implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getLibraryHubs", "getLibraryHubs",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -437,7 +453,7 @@ public class Hubs implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getLibraryHubs", "getLibraryHubs",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -446,7 +462,7 @@ public class Hubs implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getLibraryHubs", "getLibraryHubs",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -455,7 +471,7 @@ public class Hubs implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getLibraryHubs", "getLibraryHubs",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -519,7 +535,15 @@ public class Hubs implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -179,11 +179,11 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetFileHashRequest.class, GetFileHashRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -191,7 +191,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getFileHash", "getFileHash",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -202,7 +202,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getFileHash", "getFileHash",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -211,7 +211,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getFileHash", "getFileHash",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -220,7 +220,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getFileHash", "getFileHash",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -273,7 +273,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -324,11 +332,11 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetRecentlyAddedLibraryRequest.class, GetRecentlyAddedLibraryRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -336,7 +344,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-recently-added-library", "get-recently-added-library",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -347,7 +355,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-recently-added-library", "get-recently-added-library",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -356,7 +364,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-recently-added-library", "get-recently-added-library",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -365,7 +373,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-recently-added-library", "get-recently-added-library",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -429,7 +437,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -484,10 +500,10 @@ public class Library implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -495,7 +511,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-all-libraries", "get-all-libraries",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -506,7 +522,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-all-libraries", "get-all-libraries",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -515,7 +531,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-all-libraries", "get-all-libraries",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -524,7 +540,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-all-libraries", "get-all-libraries",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -588,7 +604,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -773,7 +797,7 @@ public class Library implements
GetLibraryDetailsRequest.class, GetLibraryDetailsRequest.class,
_baseUrl, _baseUrl,
"/library/sections/{sectionKey}", "/library/sections/{sectionKey}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -783,11 +807,11 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetLibraryDetailsRequest.class, GetLibraryDetailsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -795,7 +819,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-library-details", "get-library-details",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -806,7 +830,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-library-details", "get-library-details",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -815,7 +839,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-library-details", "get-library-details",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -824,7 +848,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-library-details", "get-library-details",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -888,7 +912,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -937,16 +969,16 @@ public class Library implements
DeleteLibraryRequest.class, DeleteLibraryRequest.class,
_baseUrl, _baseUrl,
"/library/sections/{sectionKey}", "/library/sections/{sectionKey}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "DELETE"); HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -954,7 +986,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"deleteLibrary", "deleteLibrary",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -965,7 +997,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"deleteLibrary", "deleteLibrary",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -974,7 +1006,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"deleteLibrary", "deleteLibrary",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -983,7 +1015,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"deleteLibrary", "deleteLibrary",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1036,7 +1068,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1075,6 +1115,7 @@ public class Library implements
* - `resolution`: Items categorized by resolution. * - `resolution`: Items categorized by resolution.
* - `firstCharacter`: Items categorized by the first letter. * - `firstCharacter`: Items categorized by the first letter.
* - `folder`: Items categorized by folder. * - `folder`: Items categorized by folder.
* - `albums`: Items categorized by album.
* *
* @return The call builder * @return The call builder
*/ */
@@ -1104,6 +1145,7 @@ public class Library implements
* - `resolution`: Items categorized by resolution. * - `resolution`: Items categorized by resolution.
* - `firstCharacter`: Items categorized by the first letter. * - `firstCharacter`: Items categorized by the first letter.
* - `folder`: Items categorized by folder. * - `folder`: Items categorized by folder.
* - `albums`: Items categorized by album.
* *
* @param request The request object containing all of the parameters for the API call. * @param request The request object containing all of the parameters for the API call.
* @return The response from the API call * @return The response from the API call
@@ -1117,7 +1159,7 @@ public class Library implements
GetLibraryItemsRequest.class, GetLibraryItemsRequest.class,
_baseUrl, _baseUrl,
"/library/sections/{sectionKey}/{tag}", "/library/sections/{sectionKey}/{tag}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -1127,11 +1169,11 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetLibraryItemsRequest.class, GetLibraryItemsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1139,7 +1181,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-library-items", "get-library-items",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1150,7 +1192,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-library-items", "get-library-items",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1159,7 +1201,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-library-items", "get-library-items",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1168,7 +1210,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-library-items", "get-library-items",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1232,7 +1274,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1301,7 +1351,7 @@ public class Library implements
GetRefreshLibraryMetadataRequest.class, GetRefreshLibraryMetadataRequest.class,
_baseUrl, _baseUrl,
"/library/sections/{sectionKey}/refresh", "/library/sections/{sectionKey}/refresh",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -1311,11 +1361,11 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetRefreshLibraryMetadataRequest.class, GetRefreshLibraryMetadataRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1323,7 +1373,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-refresh-library-metadata", "get-refresh-library-metadata",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1334,7 +1384,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-refresh-library-metadata", "get-refresh-library-metadata",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1343,7 +1393,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-refresh-library-metadata", "get-refresh-library-metadata",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1352,7 +1402,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-refresh-library-metadata", "get-refresh-library-metadata",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1405,7 +1455,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1499,7 +1557,7 @@ public class Library implements
GetSearchLibraryRequest.class, GetSearchLibraryRequest.class,
_baseUrl, _baseUrl,
"/library/sections/{sectionKey}/search", "/library/sections/{sectionKey}/search",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -1509,11 +1567,11 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetSearchLibraryRequest.class, GetSearchLibraryRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1521,7 +1579,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-search-library", "get-search-library",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1532,7 +1590,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-search-library", "get-search-library",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1541,7 +1599,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-search-library", "get-search-library",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1550,7 +1608,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-search-library", "get-search-library",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1614,7 +1672,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1665,12 +1731,12 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetSearchAllLibrariesRequest.class, GetSearchAllLibrariesRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1678,7 +1744,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-search-all-libraries", "get-search-all-libraries",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1689,7 +1755,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-search-all-libraries", "get-search-all-libraries",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1698,7 +1764,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-search-all-libraries", "get-search-all-libraries",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1707,7 +1773,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-search-all-libraries", "get-search-all-libraries",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1771,7 +1837,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1820,16 +1894,16 @@ public class Library implements
GetMetaDataByRatingKeyRequest.class, GetMetaDataByRatingKeyRequest.class,
_baseUrl, _baseUrl,
"/library/metadata/{ratingKey}", "/library/metadata/{ratingKey}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1837,7 +1911,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-meta-data-by-rating-key", "get-meta-data-by-rating-key",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1848,7 +1922,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-meta-data-by-rating-key", "get-meta-data-by-rating-key",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1857,7 +1931,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-meta-data-by-rating-key", "get-meta-data-by-rating-key",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1866,7 +1940,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-meta-data-by-rating-key", "get-meta-data-by-rating-key",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1930,7 +2004,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1996,7 +2078,7 @@ public class Library implements
GetMetadataChildrenRequest.class, GetMetadataChildrenRequest.class,
_baseUrl, _baseUrl,
"/library/metadata/{ratingKey}/children", "/library/metadata/{ratingKey}/children",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -2006,11 +2088,11 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetMetadataChildrenRequest.class, GetMetadataChildrenRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -2018,7 +2100,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getMetadataChildren", "getMetadataChildren",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -2029,7 +2111,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getMetadataChildren", "getMetadataChildren",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -2038,7 +2120,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getMetadataChildren", "getMetadataChildren",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -2047,7 +2129,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getMetadataChildren", "getMetadataChildren",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -2111,7 +2193,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -2197,11 +2287,11 @@ public class Library implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetTopWatchedContentRequest.class, GetTopWatchedContentRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -2209,7 +2299,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getTopWatchedContent", "getTopWatchedContent",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -2220,7 +2310,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTopWatchedContent", "getTopWatchedContent",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -2229,7 +2319,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getTopWatchedContent", "getTopWatchedContent",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -2238,7 +2328,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTopWatchedContent", "getTopWatchedContent",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -2302,7 +2392,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -2347,10 +2445,10 @@ public class Library implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -2358,7 +2456,7 @@ public class Library implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getOnDeck", "getOnDeck",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -2369,7 +2467,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getOnDeck", "getOnDeck",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -2378,7 +2476,7 @@ public class Library implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getOnDeck", "getOnDeck",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -2387,7 +2485,7 @@ public class Library implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getOnDeck", "getOnDeck",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -2451,7 +2549,15 @@ public class Library implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -106,11 +106,11 @@ public class Log implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
LogLineRequest.class, LogLineRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -118,7 +118,7 @@ public class Log implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"logLine", "logLine",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -129,7 +129,7 @@ public class Log implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"logLine", "logLine",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -138,7 +138,7 @@ public class Log implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"logLine", "logLine",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -147,7 +147,7 @@ public class Log implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"logLine", "logLine",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -200,7 +200,15 @@ public class Log implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -300,10 +308,10 @@ public class Log implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -311,7 +319,7 @@ public class Log implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"logMultiLine", "logMultiLine",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -322,7 +330,7 @@ public class Log implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"logMultiLine", "logMultiLine",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -331,7 +339,7 @@ public class Log implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"logMultiLine", "logMultiLine",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -340,7 +348,7 @@ public class Log implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"logMultiLine", "logMultiLine",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -393,7 +401,15 @@ public class Log implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -438,10 +454,10 @@ public class Log implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -449,7 +465,7 @@ public class Log implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"enablePaperTrail", "enablePaperTrail",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -460,7 +476,7 @@ public class Log implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"enablePaperTrail", "enablePaperTrail",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -469,7 +485,7 @@ public class Log implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"enablePaperTrail", "enablePaperTrail",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -478,7 +494,7 @@ public class Log implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"enablePaperTrail", "enablePaperTrail",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -531,7 +547,15 @@ public class Log implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -102,11 +102,11 @@ public class Media implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
MarkPlayedRequest.class, MarkPlayedRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -114,7 +114,7 @@ public class Media implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"markPlayed", "markPlayed",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -125,7 +125,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"markPlayed", "markPlayed",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -134,7 +134,7 @@ public class Media implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"markPlayed", "markPlayed",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -143,7 +143,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"markPlayed", "markPlayed",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -196,7 +196,15 @@ public class Media implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -251,11 +259,11 @@ public class Media implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
MarkUnplayedRequest.class, MarkUnplayedRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -263,7 +271,7 @@ public class Media implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"markUnplayed", "markUnplayed",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -274,7 +282,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"markUnplayed", "markUnplayed",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -283,7 +291,7 @@ public class Media implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"markUnplayed", "markUnplayed",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -292,7 +300,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"markUnplayed", "markUnplayed",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -345,7 +353,15 @@ public class Media implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -408,11 +424,11 @@ public class Media implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
UpdatePlayProgressRequest.class, UpdatePlayProgressRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -420,7 +436,7 @@ public class Media implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"updatePlayProgress", "updatePlayProgress",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -431,7 +447,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"updatePlayProgress", "updatePlayProgress",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -440,7 +456,7 @@ public class Media implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"updatePlayProgress", "updatePlayProgress",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -449,7 +465,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"updatePlayProgress", "updatePlayProgress",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -502,7 +518,15 @@ public class Media implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -543,7 +567,7 @@ public class Media implements
GetBannerImageRequest.class, GetBannerImageRequest.class,
_baseUrl, _baseUrl,
"/library/metadata/{ratingKey}/banner", "/library/metadata/{ratingKey}/banner",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "image/jpeg") _req.addHeader("Accept", "image/jpeg")
@@ -553,12 +577,12 @@ public class Media implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetBannerImageRequest.class, GetBannerImageRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -566,7 +590,7 @@ public class Media implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-banner-image", "get-banner-image",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -577,7 +601,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-banner-image", "get-banner-image",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -586,7 +610,7 @@ public class Media implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-banner-image", "get-banner-image",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -595,7 +619,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-banner-image", "get-banner-image",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -659,7 +683,15 @@ public class Media implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -700,7 +732,7 @@ public class Media implements
GetThumbImageRequest.class, GetThumbImageRequest.class,
_baseUrl, _baseUrl,
"/library/metadata/{ratingKey}/thumb", "/library/metadata/{ratingKey}/thumb",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "image/jpeg") _req.addHeader("Accept", "image/jpeg")
@@ -710,12 +742,12 @@ public class Media implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetThumbImageRequest.class, GetThumbImageRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -723,7 +755,7 @@ public class Media implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-thumb-image", "get-thumb-image",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -734,7 +766,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-thumb-image", "get-thumb-image",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -743,7 +775,7 @@ public class Media implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-thumb-image", "get-thumb-image",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -752,7 +784,7 @@ public class Media implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-thumb-image", "get-thumb-image",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -816,7 +848,15 @@ public class Media implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -139,11 +139,11 @@ public class Playlists implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
CreatePlaylistRequest.class, CreatePlaylistRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -151,7 +151,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"createPlaylist", "createPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -162,7 +162,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"createPlaylist", "createPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -171,7 +171,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"createPlaylist", "createPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -180,7 +180,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"createPlaylist", "createPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -244,7 +244,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -312,11 +320,11 @@ public class Playlists implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetPlaylistsRequest.class, GetPlaylistsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -324,7 +332,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getPlaylists", "getPlaylists",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -335,7 +343,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getPlaylists", "getPlaylists",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -344,7 +352,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getPlaylists", "getPlaylists",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -353,7 +361,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getPlaylists", "getPlaylists",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -417,7 +425,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -468,16 +484,16 @@ public class Playlists implements
GetPlaylistRequest.class, GetPlaylistRequest.class,
_baseUrl, _baseUrl,
"/playlists/{playlistID}", "/playlists/{playlistID}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -485,7 +501,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getPlaylist", "getPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -496,7 +512,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getPlaylist", "getPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -505,7 +521,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getPlaylist", "getPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -514,7 +530,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getPlaylist", "getPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -578,7 +594,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -627,16 +651,16 @@ public class Playlists implements
DeletePlaylistRequest.class, DeletePlaylistRequest.class,
_baseUrl, _baseUrl,
"/playlists/{playlistID}", "/playlists/{playlistID}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "DELETE"); HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -644,7 +668,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"deletePlaylist", "deletePlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -655,7 +679,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"deletePlaylist", "deletePlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -664,7 +688,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"deletePlaylist", "deletePlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -673,7 +697,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"deletePlaylist", "deletePlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -726,7 +750,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -794,7 +826,7 @@ public class Playlists implements
UpdatePlaylistRequest.class, UpdatePlaylistRequest.class,
_baseUrl, _baseUrl,
"/playlists/{playlistID}", "/playlists/{playlistID}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "PUT"); HTTPRequest _req = new HTTPRequest(_url, "PUT");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -804,11 +836,11 @@ public class Playlists implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
UpdatePlaylistRequest.class, UpdatePlaylistRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -816,7 +848,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"updatePlaylist", "updatePlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -827,7 +859,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"updatePlaylist", "updatePlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -836,7 +868,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"updatePlaylist", "updatePlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -845,7 +877,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"updatePlaylist", "updatePlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -898,7 +930,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -962,7 +1002,7 @@ public class Playlists implements
GetPlaylistContentsRequest.class, GetPlaylistContentsRequest.class,
_baseUrl, _baseUrl,
"/playlists/{playlistID}/items", "/playlists/{playlistID}/items",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -972,11 +1012,11 @@ public class Playlists implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetPlaylistContentsRequest.class, GetPlaylistContentsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -984,7 +1024,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getPlaylistContents", "getPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -995,7 +1035,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getPlaylistContents", "getPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1004,7 +1044,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getPlaylistContents", "getPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1013,7 +1053,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getPlaylistContents", "getPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1077,7 +1117,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1126,16 +1174,16 @@ public class Playlists implements
ClearPlaylistContentsRequest.class, ClearPlaylistContentsRequest.class,
_baseUrl, _baseUrl,
"/playlists/{playlistID}/items", "/playlists/{playlistID}/items",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "DELETE"); HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1143,7 +1191,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"clearPlaylistContents", "clearPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1154,7 +1202,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"clearPlaylistContents", "clearPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1163,7 +1211,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"clearPlaylistContents", "clearPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1172,7 +1220,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"clearPlaylistContents", "clearPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1225,7 +1273,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1298,7 +1354,7 @@ public class Playlists implements
AddPlaylistContentsRequest.class, AddPlaylistContentsRequest.class,
_baseUrl, _baseUrl,
"/playlists/{playlistID}/items", "/playlists/{playlistID}/items",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "PUT"); HTTPRequest _req = new HTTPRequest(_url, "PUT");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -1308,11 +1364,11 @@ public class Playlists implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
AddPlaylistContentsRequest.class, AddPlaylistContentsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1320,7 +1376,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"addPlaylistContents", "addPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1331,7 +1387,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"addPlaylistContents", "addPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1340,7 +1396,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"addPlaylistContents", "addPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1349,7 +1405,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"addPlaylistContents", "addPlaylistContents",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1413,7 +1469,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1486,11 +1550,11 @@ public class Playlists implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
UploadPlaylistRequest.class, UploadPlaylistRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1498,7 +1562,7 @@ public class Playlists implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"uploadPlaylist", "uploadPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1509,7 +1573,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"uploadPlaylist", "uploadPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1518,7 +1582,7 @@ public class Playlists implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"uploadPlaylist", "uploadPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1527,7 +1591,7 @@ public class Playlists implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"uploadPlaylist", "uploadPlaylist",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1580,7 +1644,15 @@ public class Playlists implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -164,10 +164,10 @@ public class Plex implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -175,7 +175,7 @@ public class Plex implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getCompanionsData", "getCompanionsData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -186,7 +186,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getCompanionsData", "getCompanionsData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -195,7 +195,7 @@ public class Plex implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getCompanionsData", "getCompanionsData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -204,7 +204,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getCompanionsData", "getCompanionsData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -268,7 +268,15 @@ public class Plex implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -325,10 +333,10 @@ public class Plex implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -336,7 +344,7 @@ public class Plex implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getUserFriends", "getUserFriends",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -347,7 +355,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getUserFriends", "getUserFriends",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -356,7 +364,7 @@ public class Plex implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getUserFriends", "getUserFriends",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -365,7 +373,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getUserFriends", "getUserFriends",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -429,7 +437,15 @@ public class Plex implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -486,7 +502,7 @@ public class Plex implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = Optional.empty();
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -494,7 +510,7 @@ public class Plex implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getGeoData", "getGeoData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -505,7 +521,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getGeoData", "getGeoData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -514,7 +530,7 @@ public class Plex implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getGeoData", "getGeoData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -523,7 +539,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getGeoData", "getGeoData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -587,7 +603,15 @@ public class Plex implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -630,10 +654,10 @@ public class Plex implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -641,7 +665,7 @@ public class Plex implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getHomeData", "getHomeData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -652,7 +676,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getHomeData", "getHomeData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -661,7 +685,7 @@ public class Plex implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getHomeData", "getHomeData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -670,7 +694,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getHomeData", "getHomeData",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -734,7 +758,15 @@ public class Plex implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -763,11 +795,13 @@ public class Plex implements
/** /**
* Get Server Resources * Get Server Resources
* Get Plex server access tokens and server connections * Get Plex server access tokens and server connections
* @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
* @return The response from the API call * @return The response from the API call
* @throws Exception if the API call fails * @throws Exception if the API call fails
*/ */
public GetServerResourcesResponse getServerResourcesDirect() throws Exception { public GetServerResourcesResponse getServerResources(
return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); String clientID) throws Exception {
return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), clientID, Optional.empty());
} }
/** /**
@@ -787,7 +821,7 @@ public class Plex implements
Optional<? extends IncludeHttps> includeHttps, Optional<? extends IncludeHttps> includeHttps,
Optional<? extends IncludeRelay> includeRelay, Optional<? extends IncludeRelay> includeRelay,
Optional<? extends IncludeIPv6> includeIPv6, Optional<? extends IncludeIPv6> includeIPv6,
Optional<String> clientID, String clientID,
Optional<String> serverURL) throws Exception { Optional<String> serverURL) throws Exception {
GetServerResourcesRequest request = GetServerResourcesRequest request =
GetServerResourcesRequest GetServerResourcesRequest
@@ -814,12 +848,12 @@ public class Plex implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetServerResourcesRequest.class, GetServerResourcesRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -827,7 +861,7 @@ public class Plex implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-server-resources", "get-server-resources",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -838,7 +872,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-server-resources", "get-server-resources",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -847,7 +881,7 @@ public class Plex implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-server-resources", "get-server-resources",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -856,7 +890,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-server-resources", "get-server-resources",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -920,7 +954,15 @@ public class Plex implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -985,9 +1027,9 @@ public class Plex implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetPinRequest.class, GetPinRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = Optional.empty();
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -995,7 +1037,7 @@ public class Plex implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getPin", "getPin",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1006,7 +1048,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getPin", "getPin",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1015,7 +1057,7 @@ public class Plex implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getPin", "getPin",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1024,7 +1066,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getPin", "getPin",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1072,7 +1114,15 @@ public class Plex implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1129,14 +1179,14 @@ public class Plex implements
GetTokenByPinIdRequest.class, GetTokenByPinIdRequest.class,
_baseUrl, _baseUrl,
"/pins/{pinID}", "/pins/{pinID}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = Optional.empty();
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1144,7 +1194,7 @@ public class Plex implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getTokenByPinId", "getTokenByPinId",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1155,7 +1205,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTokenByPinId", "getTokenByPinId",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1164,7 +1214,7 @@ public class Plex implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getTokenByPinId", "getTokenByPinId",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1173,7 +1223,7 @@ public class Plex implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTokenByPinId", "getTokenByPinId",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1237,7 +1287,15 @@ public class Plex implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -5,7 +5,6 @@
package dev.plexapi.sdk; package dev.plexapi.sdk;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient; import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.SpeakeasyHTTPClient; import dev.plexapi.sdk.utils.SpeakeasyHTTPClient;
@@ -13,6 +12,7 @@ import dev.plexapi.sdk.utils.Utils;
import java.lang.String; import java.lang.String;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.function.Consumer;
/** /**
* Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server * Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
@@ -458,89 +458,16 @@ public class PlexAPI {
return this; return this;
} }
/** // Visible for testing, may be accessed via reflection in tests
* Allows setting the clientID parameter for all supported operations. Builder _hooks(dev.plexapi.sdk.utils.Hooks hooks) {
* sdkConfiguration.setHooks(hooks);
* @param clientID The value to set. return this;
* @return The builder instance.
*/
public Builder clientID(String clientID) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
}
this.sdkConfiguration.globals.get("parameters").get("header").put("clientID", clientID);
return this;
} }
/** // Visible for testing, may be accessed via reflection in tests
* Allows setting the clientName parameter for all supported operations. Builder _hooks(Consumer<? super dev.plexapi.sdk.utils.Hooks> consumer) {
* consumer.accept(sdkConfiguration.hooks());
* @param clientName The value to set. return this;
* @return The builder instance.
*/
public Builder clientName(String clientName) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
}
this.sdkConfiguration.globals.get("parameters").get("header").put("clientName", clientName);
return this;
}
/**
* Allows setting the clientVersion parameter for all supported operations.
*
* @param clientVersion The value to set.
* @return The builder instance.
*/
public Builder clientVersion(String clientVersion) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
}
this.sdkConfiguration.globals.get("parameters").get("header").put("clientVersion", clientVersion);
return this;
}
/**
* Allows setting the platform parameter for all supported operations.
*
* @param platform The value to set.
* @return The builder instance.
*/
public Builder platform(String platform) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
}
this.sdkConfiguration.globals.get("parameters").get("header").put("platform", platform);
return this;
}
/**
* Allows setting the deviceNickname parameter for all supported operations.
*
* @param deviceNickname The value to set.
* @return The builder instance.
*/
public Builder deviceNickname(String deviceNickname) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
}
this.sdkConfiguration.globals.get("parameters").get("header").put("deviceNickname", deviceNickname);
return this;
}
// Visible for testing, will be accessed via reflection
void _hooks(dev.plexapi.sdk.utils.Hooks hooks) {
sdkConfiguration.setHooks(hooks);
} }
/** /**

View File

@@ -9,7 +9,7 @@ import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.Hook.SdkInitData; import dev.plexapi.sdk.utils.Hook.SdkInitData;
import dev.plexapi.sdk.utils.Hooks; import dev.plexapi.sdk.utils.Hooks;
import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.RetryConfig;
import java.lang.Object; import dev.plexapi.sdk.utils.Utils;
import java.lang.String; import java.lang.String;
import java.lang.SuppressWarnings; import java.lang.SuppressWarnings;
import java.util.ArrayList; import java.util.ArrayList;
@@ -24,9 +24,16 @@ class SDKConfiguration {
public Optional<SecuritySource> securitySource() { public Optional<SecuritySource> securitySource() {
return Optional.ofNullable(securitySource); return Optional.ofNullable(securitySource);
} }
public HTTPClient defaultClient; public HTTPClient defaultClient;
public String serverUrl; public String serverUrl;
public String resolvedServerUrl() {
return Utils.templateUrl(serverUrl, getServerVariableDefaults());
}
public int serverIdx = 0; public int serverIdx = 0;
@SuppressWarnings("serial")
List<Map<String, String>> serverDefaults = new ArrayList<>(){ { List<Map<String, String>> serverDefaults = new ArrayList<>(){ {
add(new HashMap<>(){ { add(new HashMap<>(){ {
put("protocol", "https"); put("protocol", "https");
@@ -36,8 +43,8 @@ class SDKConfiguration {
} }; } };
private static final String LANGUAGE = "java"; private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "0.0.3"; public static final String OPENAPI_DOC_VERSION = "0.0.3";
public static final String SDK_VERSION = "0.10.1"; public static final String SDK_VERSION = "0.11.2";
public static final String GEN_VERSION = "2.457.9"; public static final String GEN_VERSION = "2.495.0";
private static final String BASE_PACKAGE = "dev.plexapi.sdk"; private static final String BASE_PACKAGE = "dev.plexapi.sdk";
public static final String USER_AGENT = public static final String USER_AGENT =
String.format("speakeasy-sdk/%s %s %s %s %s", String.format("speakeasy-sdk/%s %s %s %s %s",
@@ -64,18 +71,15 @@ class SDKConfiguration {
public void initialize() { public void initialize() {
SDKHooks.initialize(_hooks); SDKHooks.initialize(_hooks);
// apply the sdk init hook immediately // apply the sdk init hook immediately
SdkInitData data = _hooks.sdkInit(new SdkInitData(serverUrl, defaultClient)); SdkInitData data = _hooks.sdkInit(new SdkInitData(resolvedServerUrl(), defaultClient));
this.serverUrl = data.baseUrl(); this.serverUrl = data.baseUrl();
this.defaultClient = data.client(); this.defaultClient = data.client();
} }
@SuppressWarnings("serial")
public Map<String, Map<String, Map<String,Object>>> globals = new HashMap<>(){ {
put("parameters", new HashMap<>());
} };
public Map<String, String> getServerVariableDefaults() {
return serverDefaults.get(this.serverIdx); public Map<String, String> getServerVariableDefaults() {
} return serverDefaults.get(this.serverIdx);
}
public Optional<RetryConfig> retryConfig = Optional.empty(); public Optional<RetryConfig> retryConfig = Optional.empty();
} }

View File

@@ -146,11 +146,11 @@ public class Search implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
PerformSearchRequest.class, PerformSearchRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -158,7 +158,7 @@ public class Search implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"performSearch", "performSearch",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -169,7 +169,7 @@ public class Search implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"performSearch", "performSearch",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -178,7 +178,7 @@ public class Search implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"performSearch", "performSearch",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -187,7 +187,7 @@ public class Search implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"performSearch", "performSearch",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -240,7 +240,15 @@ public class Search implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -325,11 +333,11 @@ public class Search implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
PerformVoiceSearchRequest.class, PerformVoiceSearchRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -337,7 +345,7 @@ public class Search implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"performVoiceSearch", "performVoiceSearch",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -348,7 +356,7 @@ public class Search implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"performVoiceSearch", "performVoiceSearch",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -357,7 +365,7 @@ public class Search implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"performVoiceSearch", "performVoiceSearch",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -366,7 +374,7 @@ public class Search implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"performVoiceSearch", "performVoiceSearch",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -419,7 +427,15 @@ public class Search implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -474,11 +490,11 @@ public class Search implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetSearchResultsRequest.class, GetSearchResultsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -486,7 +502,7 @@ public class Search implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getSearchResults", "getSearchResults",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -497,7 +513,7 @@ public class Search implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getSearchResults", "getSearchResults",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -506,7 +522,7 @@ public class Search implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getSearchResults", "getSearchResults",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -515,7 +531,7 @@ public class Search implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getSearchResults", "getSearchResults",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -579,7 +595,15 @@ public class Search implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -114,10 +114,10 @@ public class Server implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -125,7 +125,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getServerCapabilities", "getServerCapabilities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -136,7 +136,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getServerCapabilities", "getServerCapabilities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -145,7 +145,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getServerCapabilities", "getServerCapabilities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -154,7 +154,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getServerCapabilities", "getServerCapabilities",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -218,7 +218,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -261,10 +269,10 @@ public class Server implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -272,7 +280,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getServerPreferences", "getServerPreferences",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -283,7 +291,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getServerPreferences", "getServerPreferences",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -292,7 +300,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getServerPreferences", "getServerPreferences",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -301,7 +309,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getServerPreferences", "getServerPreferences",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -365,7 +373,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -408,10 +424,10 @@ public class Server implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -419,7 +435,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getAvailableClients", "getAvailableClients",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -430,7 +446,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getAvailableClients", "getAvailableClients",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -439,7 +455,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getAvailableClients", "getAvailableClients",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -448,7 +464,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getAvailableClients", "getAvailableClients",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -512,7 +528,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -555,10 +579,10 @@ public class Server implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -566,7 +590,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getDevices", "getDevices",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -577,7 +601,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getDevices", "getDevices",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -586,7 +610,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getDevices", "getDevices",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -595,7 +619,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getDevices", "getDevices",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -659,7 +683,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -702,7 +734,7 @@ public class Server implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = Optional.empty();
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -710,7 +742,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-server-identity", "get-server-identity",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -721,7 +753,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-server-identity", "get-server-identity",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -730,7 +762,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-server-identity", "get-server-identity",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -739,7 +771,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-server-identity", "get-server-identity",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -787,7 +819,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -830,10 +870,10 @@ public class Server implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -841,7 +881,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getMyPlexAccount", "getMyPlexAccount",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -852,7 +892,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getMyPlexAccount", "getMyPlexAccount",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -861,7 +901,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getMyPlexAccount", "getMyPlexAccount",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -870,7 +910,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getMyPlexAccount", "getMyPlexAccount",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -934,7 +974,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -985,11 +1033,11 @@ public class Server implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetResizedPhotoRequest.class, GetResizedPhotoRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -997,7 +1045,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getResizedPhoto", "getResizedPhoto",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1008,7 +1056,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getResizedPhoto", "getResizedPhoto",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1017,7 +1065,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getResizedPhoto", "getResizedPhoto",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1026,7 +1074,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getResizedPhoto", "getResizedPhoto",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1079,7 +1127,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1130,11 +1186,11 @@ public class Server implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1142,7 +1198,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-media-providers", "get-media-providers",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1153,7 +1209,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-media-providers", "get-media-providers",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1162,7 +1218,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-media-providers", "get-media-providers",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1171,7 +1227,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-media-providers", "get-media-providers",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1235,7 +1291,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -1278,10 +1342,10 @@ public class Server implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -1289,7 +1353,7 @@ public class Server implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getServerList", "getServerList",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -1300,7 +1364,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getServerList", "getServerList",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -1309,7 +1373,7 @@ public class Server implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getServerList", "getServerList",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -1318,7 +1382,7 @@ public class Server implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getServerList", "getServerList",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -1382,7 +1446,15 @@ public class Server implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -87,10 +87,10 @@ public class Sessions implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -98,7 +98,7 @@ public class Sessions implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getSessions", "getSessions",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -109,7 +109,7 @@ public class Sessions implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getSessions", "getSessions",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -118,7 +118,7 @@ public class Sessions implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getSessions", "getSessions",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -127,7 +127,7 @@ public class Sessions implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getSessions", "getSessions",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -191,7 +191,15 @@ public class Sessions implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -270,11 +278,11 @@ public class Sessions implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetSessionHistoryRequest.class, GetSessionHistoryRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -282,7 +290,7 @@ public class Sessions implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getSessionHistory", "getSessionHistory",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -293,7 +301,7 @@ public class Sessions implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getSessionHistory", "getSessionHistory",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -302,7 +310,7 @@ public class Sessions implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getSessionHistory", "getSessionHistory",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -311,7 +319,7 @@ public class Sessions implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getSessionHistory", "getSessionHistory",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -375,7 +383,15 @@ public class Sessions implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -418,10 +434,10 @@ public class Sessions implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -429,7 +445,7 @@ public class Sessions implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getTranscodeSessions", "getTranscodeSessions",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -440,7 +456,7 @@ public class Sessions implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTranscodeSessions", "getTranscodeSessions",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -449,7 +465,7 @@ public class Sessions implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getTranscodeSessions", "getTranscodeSessions",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -458,7 +474,7 @@ public class Sessions implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTranscodeSessions", "getTranscodeSessions",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -522,7 +538,15 @@ public class Sessions implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -569,16 +593,16 @@ public class Sessions implements
StopTranscodeSessionRequest.class, StopTranscodeSessionRequest.class,
_baseUrl, _baseUrl,
"/transcode/sessions/{sessionKey}", "/transcode/sessions/{sessionKey}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "DELETE"); HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -586,7 +610,7 @@ public class Sessions implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"stopTranscodeSession", "stopTranscodeSession",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -597,7 +621,7 @@ public class Sessions implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"stopTranscodeSession", "stopTranscodeSession",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -606,7 +630,7 @@ public class Sessions implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"stopTranscodeSession", "stopTranscodeSession",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -615,7 +639,7 @@ public class Sessions implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"stopTranscodeSession", "stopTranscodeSession",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -668,7 +692,15 @@ public class Sessions implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -106,11 +106,11 @@ public class Statistics implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetStatisticsRequest.class, GetStatisticsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -118,7 +118,7 @@ public class Statistics implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getStatistics", "getStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -129,7 +129,7 @@ public class Statistics implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getStatistics", "getStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -138,7 +138,7 @@ public class Statistics implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getStatistics", "getStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -147,7 +147,7 @@ public class Statistics implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getStatistics", "getStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -211,7 +211,15 @@ public class Statistics implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -278,11 +286,11 @@ public class Statistics implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetResourcesStatisticsRequest.class, GetResourcesStatisticsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -290,7 +298,7 @@ public class Statistics implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getResourcesStatistics", "getResourcesStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -301,7 +309,7 @@ public class Statistics implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getResourcesStatistics", "getResourcesStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -310,7 +318,7 @@ public class Statistics implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getResourcesStatistics", "getResourcesStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -319,7 +327,7 @@ public class Statistics implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getResourcesStatistics", "getResourcesStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -383,7 +391,15 @@ public class Statistics implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -450,11 +466,11 @@ public class Statistics implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetBandwidthStatisticsRequest.class, GetBandwidthStatisticsRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -462,7 +478,7 @@ public class Statistics implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getBandwidthStatistics", "getBandwidthStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -473,7 +489,7 @@ public class Statistics implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getBandwidthStatistics", "getBandwidthStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -482,7 +498,7 @@ public class Statistics implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getBandwidthStatistics", "getBandwidthStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -491,7 +507,7 @@ public class Statistics implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getBandwidthStatistics", "getBandwidthStatistics",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -555,7 +571,15 @@ public class Statistics implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -82,10 +82,10 @@ public class Updater implements
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
.addHeader("user-agent", .addHeader("user-agent",
SDKConfiguration.USER_AGENT); SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -93,7 +93,7 @@ public class Updater implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getUpdateStatus", "getUpdateStatus",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -104,7 +104,7 @@ public class Updater implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getUpdateStatus", "getUpdateStatus",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -113,7 +113,7 @@ public class Updater implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getUpdateStatus", "getUpdateStatus",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -122,7 +122,7 @@ public class Updater implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getUpdateStatus", "getUpdateStatus",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -186,7 +186,15 @@ public class Updater implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -251,11 +259,11 @@ public class Updater implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
CheckForUpdatesRequest.class, CheckForUpdatesRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -263,7 +271,7 @@ public class Updater implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"checkForUpdates", "checkForUpdates",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -274,7 +282,7 @@ public class Updater implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"checkForUpdates", "checkForUpdates",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -283,7 +291,7 @@ public class Updater implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"checkForUpdates", "checkForUpdates",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -292,7 +300,7 @@ public class Updater implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"checkForUpdates", "checkForUpdates",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -345,7 +353,15 @@ public class Updater implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -416,11 +432,11 @@ public class Updater implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
ApplyUpdatesRequest.class, ApplyUpdatesRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -428,7 +444,7 @@ public class Updater implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"applyUpdates", "applyUpdates",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -439,7 +455,7 @@ public class Updater implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"applyUpdates", "applyUpdates",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -448,7 +464,7 @@ public class Updater implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"applyUpdates", "applyUpdates",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -457,7 +473,7 @@ public class Updater implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"applyUpdates", "applyUpdates",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -510,7 +526,15 @@ public class Updater implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "500", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -78,11 +78,11 @@ public class Video implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetTimelineRequest.class, GetTimelineRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -90,7 +90,7 @@ public class Video implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"getTimeline", "getTimeline",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -101,7 +101,7 @@ public class Video implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTimeline", "getTimeline",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -110,7 +110,7 @@ public class Video implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"getTimeline", "getTimeline",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -119,7 +119,7 @@ public class Video implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"getTimeline", "getTimeline",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -172,7 +172,15 @@ public class Video implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,
@@ -221,11 +229,11 @@ public class Video implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
StartUniversalTranscodeRequest.class, StartUniversalTranscodeRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -233,7 +241,7 @@ public class Video implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"startUniversalTranscode", "startUniversalTranscode",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -244,7 +252,7 @@ public class Video implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"startUniversalTranscode", "startUniversalTranscode",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -253,7 +261,7 @@ public class Video implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"startUniversalTranscode", "startUniversalTranscode",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -262,7 +270,7 @@ public class Video implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"startUniversalTranscode", "startUniversalTranscode",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -315,7 +323,15 @@ public class Video implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -92,7 +92,7 @@ public class Watchlist implements
GetWatchListRequest.class, GetWatchListRequest.class,
_baseUrl, _baseUrl,
"/library/sections/watchlist/{filter}", "/library/sections/watchlist/{filter}",
request, this.sdkConfiguration.globals); request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET"); HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json") _req.addHeader("Accept", "application/json")
@@ -102,12 +102,12 @@ public class Watchlist implements
_req.addQueryParams(Utils.getQueryParams( _req.addQueryParams(Utils.getQueryParams(
GetWatchListRequest.class, GetWatchListRequest.class,
request, request,
this.sdkConfiguration.globals)); null));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); _req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req, Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity()); this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient; HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r = HttpRequest _r =
sdkConfiguration.hooks() sdkConfiguration.hooks()
@@ -115,7 +115,7 @@ public class Watchlist implements
new BeforeRequestContextImpl( new BeforeRequestContextImpl(
"get-watch-list", "get-watch-list",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_req.build()); _req.build());
HttpResponse<InputStream> _httpRes; HttpResponse<InputStream> _httpRes;
try { try {
@@ -126,7 +126,7 @@ public class Watchlist implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-watch-list", "get-watch-list",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.of(_httpRes), Optional.of(_httpRes),
Optional.empty()); Optional.empty());
} else { } else {
@@ -135,7 +135,7 @@ public class Watchlist implements
new AfterSuccessContextImpl( new AfterSuccessContextImpl(
"get-watch-list", "get-watch-list",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
_httpRes); _httpRes);
} }
} catch (Exception _e) { } catch (Exception _e) {
@@ -144,7 +144,7 @@ public class Watchlist implements
new AfterErrorContextImpl( new AfterErrorContextImpl(
"get-watch-list", "get-watch-list",
Optional.of(List.of()), Optional.of(List.of()),
sdkConfiguration.securitySource()), _hookSecuritySource),
Optional.empty(), Optional.empty(),
Optional.of(_e)); Optional.of(_e));
} }
@@ -208,7 +208,15 @@ public class Watchlist implements
Utils.extractByteArrayFromBody(_httpRes)); Utils.extractByteArrayFromBody(_httpRes));
} }
} }
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content // no content
throw new SDKError( throw new SDKError(
_httpRes, _httpRes,

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* ActiveDirection - The direction of the sort. Can be either `asc` or `desc`. * ActiveDirection - The direction of the sort. Can be either `asc` or `desc`.
@@ -25,4 +27,13 @@ public enum ActiveDirection {
public String value() { public String value() {
return value; return value;
} }
public static Optional<ActiveDirection> fromValue(String value) {
for (ActiveDirection o: ActiveDirection.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -5,6 +5,8 @@
package dev.plexapi.sdk.models.operations; package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/** /**
* AutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) * AutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
@@ -23,4 +25,13 @@ public enum AutoSelectSubtitle {
public int value() { public int value() {
return value; return value;
} }
public static Optional<AutoSelectSubtitle> fromValue(int value) {
for (AutoSelectSubtitle o: AutoSelectSubtitle.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* CreatePlaylistQueryParamType - type of playlist to create * CreatePlaylistQueryParamType - type of playlist to create
@@ -25,4 +27,13 @@ public enum CreatePlaylistQueryParamType {
public String value() { public String value() {
return value; return value;
} }
public static Optional<CreatePlaylistQueryParamType> fromValue(String value) {
for (CreatePlaylistQueryParamType o: CreatePlaylistQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* DefaultDirection - The direction of the sort. Can be either `asc` or `desc`. * DefaultDirection - The direction of the sort. Can be either `asc` or `desc`.
@@ -25,4 +27,13 @@ public enum DefaultDirection {
public String value() { public String value() {
return value; return value;
} }
public static Optional<DefaultDirection> fromValue(String value) {
for (DefaultDirection o: DefaultDirection.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -5,6 +5,8 @@
package dev.plexapi.sdk.models.operations; package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/** /**
* DefaultSubtitleAccessibility - The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) * DefaultSubtitleAccessibility - The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)
@@ -23,4 +25,13 @@ public enum DefaultSubtitleAccessibility {
public int value() { public int value() {
return value; return value;
} }
public static Optional<DefaultSubtitleAccessibility> fromValue(int value) {
for (DefaultSubtitleAccessibility o: DefaultSubtitleAccessibility.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -5,6 +5,8 @@
package dev.plexapi.sdk.models.operations; package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/** /**
* DefaultSubtitleForced - The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) * DefaultSubtitleForced - The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)
@@ -23,4 +25,13 @@ public enum DefaultSubtitleForced {
public int value() { public int value() {
return value; return value;
} }
public static Optional<DefaultSubtitleForced> fromValue(int value) {
for (DefaultSubtitleForced o: DefaultSubtitleForced.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -5,6 +5,8 @@
package dev.plexapi.sdk.models.operations; package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/** /**
* Download - Indicate that you want to start download any updates found. * Download - Indicate that you want to start download any updates found.
@@ -23,4 +25,13 @@ public enum Download {
public long value() { public long value() {
return value; return value;
} }
public static Optional<Download> fromValue(long value) {
for (Download o: Download.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -0,0 +1,38 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/**
* EnableCreditsMarkerGeneration - Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public enum EnableCreditsMarkerGeneration {
LibraryDefault("-1"),
Disabled("0");
@JsonValue
private final String value;
private EnableCreditsMarkerGeneration(String value) {
this.value = value;
}
public String value() {
return value;
}
public static Optional<EnableCreditsMarkerGeneration> fromValue(String value) {
for (EnableCreditsMarkerGeneration o: EnableCreditsMarkerGeneration.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,39 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/**
* EpisodeSort - Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
*/
public enum EpisodeSort {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1");
@JsonValue
private final String value;
private EpisodeSort(String value) {
this.value = value;
}
public String value() {
return value;
}
public static Optional<EpisodeSort> fromValue(String value) {
for (EpisodeSort o: EpisodeSort.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* Filter - Filter * Filter - Filter
@@ -25,4 +27,13 @@ public enum Filter {
public String value() { public String value() {
return value; return value;
} }
public static Optional<Filter> fromValue(String value) {
for (Filter o: Filter.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,10 +6,16 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/**
* FlattenSeasons - Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public enum FlattenSeasons { public enum FlattenSeasons {
False("0"), LibraryDefault("-1"),
True("1"); Hide("0"),
Show("1");
@JsonValue @JsonValue
private final String value; private final String value;
@@ -21,4 +27,13 @@ public enum FlattenSeasons {
public String value() { public String value() {
return value; return value;
} }
public static Optional<FlattenSeasons> fromValue(String value) {
for (FlattenSeasons o: FlattenSeasons.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -5,6 +5,8 @@
package dev.plexapi.sdk.models.operations; package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/** /**
* Force - Force the refresh even if the library is already being refreshed. * Force - Force the refresh even if the library is already being refreshed.
@@ -23,4 +25,13 @@ public enum Force {
public long value() { public long value() {
return value; return value;
} }
public static Optional<Force> fromValue(long value) {
for (Force o: Force.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* GetLibraryItemsActiveDirection - The direction of the sort. Can be either `asc` or `desc`. * GetLibraryItemsActiveDirection - The direction of the sort. Can be either `asc` or `desc`.
@@ -25,4 +27,13 @@ public enum GetLibraryItemsActiveDirection {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsActiveDirection> fromValue(String value) {
for (GetLibraryItemsActiveDirection o: GetLibraryItemsActiveDirection.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* GetLibraryItemsDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. * GetLibraryItemsDefaultDirection - The direction of the sort. Can be either `asc` or `desc`.
@@ -25,4 +27,13 @@ public enum GetLibraryItemsDefaultDirection {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsDefaultDirection> fromValue(String value) {
for (GetLibraryItemsDefaultDirection o: GetLibraryItemsDefaultDirection.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -0,0 +1,38 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/**
* GetLibraryItemsEnableCreditsMarkerGeneration - Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public enum GetLibraryItemsEnableCreditsMarkerGeneration {
LibraryDefault("-1"),
Disabled("0");
@JsonValue
private final String value;
private GetLibraryItemsEnableCreditsMarkerGeneration(String value) {
this.value = value;
}
public String value() {
return value;
}
public static Optional<GetLibraryItemsEnableCreditsMarkerGeneration> fromValue(String value) {
for (GetLibraryItemsEnableCreditsMarkerGeneration o: GetLibraryItemsEnableCreditsMarkerGeneration.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,39 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/**
* GetLibraryItemsEpisodeSort - Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
*/
public enum GetLibraryItemsEpisodeSort {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1");
@JsonValue
private final String value;
private GetLibraryItemsEpisodeSort(String value) {
this.value = value;
}
public String value() {
return value;
}
public static Optional<GetLibraryItemsEpisodeSort> fromValue(String value) {
for (GetLibraryItemsEpisodeSort o: GetLibraryItemsEpisodeSort.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -6,10 +6,16 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/**
* GetLibraryItemsFlattenSeasons - Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public enum GetLibraryItemsFlattenSeasons { public enum GetLibraryItemsFlattenSeasons {
False("0"), LibraryDefault("-1"),
True("1"); Hide("0"),
Show("1");
@JsonValue @JsonValue
private final String value; private final String value;
@@ -21,4 +27,13 @@ public enum GetLibraryItemsFlattenSeasons {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsFlattenSeasons> fromValue(String value) {
for (GetLibraryItemsFlattenSeasons o: GetLibraryItemsFlattenSeasons.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public enum GetLibraryItemsHasThumbnail { public enum GetLibraryItemsHasThumbnail {
False("0"), False("0"),
@@ -21,4 +23,13 @@ public enum GetLibraryItemsHasThumbnail {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsHasThumbnail> fromValue(String value) {
for (GetLibraryItemsHasThumbnail o: GetLibraryItemsHasThumbnail.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* GetLibraryItemsLibraryActiveDirection - The direction of the sort. Can be either `asc` or `desc`. * GetLibraryItemsLibraryActiveDirection - The direction of the sort. Can be either `asc` or `desc`.
@@ -25,4 +27,13 @@ public enum GetLibraryItemsLibraryActiveDirection {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsLibraryActiveDirection> fromValue(String value) {
for (GetLibraryItemsLibraryActiveDirection o: GetLibraryItemsLibraryActiveDirection.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* GetLibraryItemsLibraryDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. * GetLibraryItemsLibraryDefaultDirection - The direction of the sort. Can be either `asc` or `desc`.
@@ -25,4 +27,13 @@ public enum GetLibraryItemsLibraryDefaultDirection {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsLibraryDefaultDirection> fromValue(String value) {
for (GetLibraryItemsLibraryDefaultDirection o: GetLibraryItemsLibraryDefaultDirection.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public enum GetLibraryItemsLibraryResponse200Type { public enum GetLibraryItemsLibraryResponse200Type {
COVER_POSTER("coverPoster"), COVER_POSTER("coverPoster"),
@@ -23,4 +25,13 @@ public enum GetLibraryItemsLibraryResponse200Type {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsLibraryResponse200Type> fromValue(String value) {
for (GetLibraryItemsLibraryResponse200Type o: GetLibraryItemsLibraryResponse200Type.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* GetLibraryItemsLibraryType - The type of media content * GetLibraryItemsLibraryType - The type of media content
@@ -27,4 +29,13 @@ public enum GetLibraryItemsLibraryType {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsLibraryType> fromValue(String value) {
for (GetLibraryItemsLibraryType o: GetLibraryItemsLibraryType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -10,8 +10,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.utils.LazySingletonValue;
import dev.plexapi.sdk.utils.Utils; import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean; import java.lang.Boolean;
import java.lang.Double; import java.lang.Double;
@@ -103,17 +101,34 @@ public class GetLibraryItemsMetadata {
@JsonProperty("tagline") @JsonProperty("tagline")
private Optional<String> tagline; private Optional<String> tagline;
/**
* Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
@JsonInclude(Include.NON_ABSENT) @JsonInclude(Include.NON_ABSENT)
@JsonProperty("flattenSeasons") @JsonProperty("flattenSeasons")
private Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons; private Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons;
/** /**
* Setting that indicates the episode ordering for the show * Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
* None = Library default, */
* tmdbAiring = The Movie Database (Aired), @JsonInclude(Include.NON_ABSENT)
* aired = TheTVDB (Aired), @JsonProperty("episodeSort")
* dvd = TheTVDB (DVD), private Optional<? extends GetLibraryItemsEpisodeSort> episodeSort;
* absolute = TheTVDB (Absolute)).
/**
* Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("enableCreditsMarkerGeneration")
private Optional<? extends GetLibraryItemsEnableCreditsMarkerGeneration> enableCreditsMarkerGeneration;
/**
* Setting that indicates the episode ordering for the show
* None = Library default,
* tmdbAiring = The Movie Database (Aired),
* tvdbAiring = TheTVDB (Aired),
* tvdbDvd = TheTVDB (DVD),
* tvdbAbsolute = TheTVDB (Absolute)).
* *
*/ */
@JsonInclude(Include.NON_ABSENT) @JsonInclude(Include.NON_ABSENT)
@@ -374,6 +389,8 @@ public class GetLibraryItemsMetadata {
@JsonProperty("seasonCount") Optional<Integer> seasonCount, @JsonProperty("seasonCount") Optional<Integer> seasonCount,
@JsonProperty("tagline") Optional<String> tagline, @JsonProperty("tagline") Optional<String> tagline,
@JsonProperty("flattenSeasons") Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons, @JsonProperty("flattenSeasons") Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons,
@JsonProperty("episodeSort") Optional<? extends GetLibraryItemsEpisodeSort> episodeSort,
@JsonProperty("enableCreditsMarkerGeneration") Optional<? extends GetLibraryItemsEnableCreditsMarkerGeneration> enableCreditsMarkerGeneration,
@JsonProperty("showOrdering") Optional<? extends GetLibraryItemsShowOrdering> showOrdering, @JsonProperty("showOrdering") Optional<? extends GetLibraryItemsShowOrdering> showOrdering,
@JsonProperty("thumb") Optional<String> thumb, @JsonProperty("thumb") Optional<String> thumb,
@JsonProperty("art") Optional<String> art, @JsonProperty("art") Optional<String> art,
@@ -448,6 +465,8 @@ public class GetLibraryItemsMetadata {
Utils.checkNotNull(seasonCount, "seasonCount"); Utils.checkNotNull(seasonCount, "seasonCount");
Utils.checkNotNull(tagline, "tagline"); Utils.checkNotNull(tagline, "tagline");
Utils.checkNotNull(flattenSeasons, "flattenSeasons"); Utils.checkNotNull(flattenSeasons, "flattenSeasons");
Utils.checkNotNull(episodeSort, "episodeSort");
Utils.checkNotNull(enableCreditsMarkerGeneration, "enableCreditsMarkerGeneration");
Utils.checkNotNull(showOrdering, "showOrdering"); Utils.checkNotNull(showOrdering, "showOrdering");
Utils.checkNotNull(thumb, "thumb"); Utils.checkNotNull(thumb, "thumb");
Utils.checkNotNull(art, "art"); Utils.checkNotNull(art, "art");
@@ -522,6 +541,8 @@ public class GetLibraryItemsMetadata {
this.seasonCount = seasonCount; this.seasonCount = seasonCount;
this.tagline = tagline; this.tagline = tagline;
this.flattenSeasons = flattenSeasons; this.flattenSeasons = flattenSeasons;
this.episodeSort = episodeSort;
this.enableCreditsMarkerGeneration = enableCreditsMarkerGeneration;
this.showOrdering = showOrdering; this.showOrdering = showOrdering;
this.thumb = thumb; this.thumb = thumb;
this.art = art; this.art = art;
@@ -587,7 +608,7 @@ public class GetLibraryItemsMetadata {
String title, String title,
String summary, String summary,
long addedAt) { long addedAt) {
this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
} }
/** /**
@@ -689,6 +710,9 @@ public class GetLibraryItemsMetadata {
return tagline; return tagline;
} }
/**
* Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@JsonIgnore @JsonIgnore
public Optional<GetLibraryItemsFlattenSeasons> flattenSeasons() { public Optional<GetLibraryItemsFlattenSeasons> flattenSeasons() {
@@ -696,12 +720,30 @@ public class GetLibraryItemsMetadata {
} }
/** /**
* Setting that indicates the episode ordering for the show * Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
* None = Library default, */
* tmdbAiring = The Movie Database (Aired), @SuppressWarnings("unchecked")
* aired = TheTVDB (Aired), @JsonIgnore
* dvd = TheTVDB (DVD), public Optional<GetLibraryItemsEpisodeSort> episodeSort() {
* absolute = TheTVDB (Absolute)). return (Optional<GetLibraryItemsEpisodeSort>) episodeSort;
}
/**
* Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<GetLibraryItemsEnableCreditsMarkerGeneration> enableCreditsMarkerGeneration() {
return (Optional<GetLibraryItemsEnableCreditsMarkerGeneration>) enableCreditsMarkerGeneration;
}
/**
* Setting that indicates the episode ordering for the show
* None = Library default,
* tmdbAiring = The Movie Database (Aired),
* tvdbAiring = TheTVDB (Aired),
* tvdbDvd = TheTVDB (DVD),
* tvdbAbsolute = TheTVDB (Absolute)).
* *
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -1203,12 +1245,18 @@ public class GetLibraryItemsMetadata {
return this; return this;
} }
/**
* Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public GetLibraryItemsMetadata withFlattenSeasons(GetLibraryItemsFlattenSeasons flattenSeasons) { public GetLibraryItemsMetadata withFlattenSeasons(GetLibraryItemsFlattenSeasons flattenSeasons) {
Utils.checkNotNull(flattenSeasons, "flattenSeasons"); Utils.checkNotNull(flattenSeasons, "flattenSeasons");
this.flattenSeasons = Optional.ofNullable(flattenSeasons); this.flattenSeasons = Optional.ofNullable(flattenSeasons);
return this; return this;
} }
/**
* Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public GetLibraryItemsMetadata withFlattenSeasons(Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons) { public GetLibraryItemsMetadata withFlattenSeasons(Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons) {
Utils.checkNotNull(flattenSeasons, "flattenSeasons"); Utils.checkNotNull(flattenSeasons, "flattenSeasons");
this.flattenSeasons = flattenSeasons; this.flattenSeasons = flattenSeasons;
@@ -1216,12 +1264,48 @@ public class GetLibraryItemsMetadata {
} }
/** /**
* Setting that indicates the episode ordering for the show * Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
* None = Library default, */
* tmdbAiring = The Movie Database (Aired), public GetLibraryItemsMetadata withEpisodeSort(GetLibraryItemsEpisodeSort episodeSort) {
* aired = TheTVDB (Aired), Utils.checkNotNull(episodeSort, "episodeSort");
* dvd = TheTVDB (DVD), this.episodeSort = Optional.ofNullable(episodeSort);
* absolute = TheTVDB (Absolute)). return this;
}
/**
* Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
*/
public GetLibraryItemsMetadata withEpisodeSort(Optional<? extends GetLibraryItemsEpisodeSort> episodeSort) {
Utils.checkNotNull(episodeSort, "episodeSort");
this.episodeSort = episodeSort;
return this;
}
/**
* Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public GetLibraryItemsMetadata withEnableCreditsMarkerGeneration(GetLibraryItemsEnableCreditsMarkerGeneration enableCreditsMarkerGeneration) {
Utils.checkNotNull(enableCreditsMarkerGeneration, "enableCreditsMarkerGeneration");
this.enableCreditsMarkerGeneration = Optional.ofNullable(enableCreditsMarkerGeneration);
return this;
}
/**
* Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public GetLibraryItemsMetadata withEnableCreditsMarkerGeneration(Optional<? extends GetLibraryItemsEnableCreditsMarkerGeneration> enableCreditsMarkerGeneration) {
Utils.checkNotNull(enableCreditsMarkerGeneration, "enableCreditsMarkerGeneration");
this.enableCreditsMarkerGeneration = enableCreditsMarkerGeneration;
return this;
}
/**
* Setting that indicates the episode ordering for the show
* None = Library default,
* tmdbAiring = The Movie Database (Aired),
* tvdbAiring = TheTVDB (Aired),
* tvdbDvd = TheTVDB (DVD),
* tvdbAbsolute = TheTVDB (Absolute)).
* *
*/ */
public GetLibraryItemsMetadata withShowOrdering(GetLibraryItemsShowOrdering showOrdering) { public GetLibraryItemsMetadata withShowOrdering(GetLibraryItemsShowOrdering showOrdering) {
@@ -1231,12 +1315,12 @@ public class GetLibraryItemsMetadata {
} }
/** /**
* Setting that indicates the episode ordering for the show * Setting that indicates the episode ordering for the show
* None = Library default, * None = Library default,
* tmdbAiring = The Movie Database (Aired), * tmdbAiring = The Movie Database (Aired),
* aired = TheTVDB (Aired), * tvdbAiring = TheTVDB (Aired),
* dvd = TheTVDB (DVD), * tvdbDvd = TheTVDB (DVD),
* absolute = TheTVDB (Absolute)). * tvdbAbsolute = TheTVDB (Absolute)).
* *
*/ */
public GetLibraryItemsMetadata withShowOrdering(Optional<? extends GetLibraryItemsShowOrdering> showOrdering) { public GetLibraryItemsMetadata withShowOrdering(Optional<? extends GetLibraryItemsShowOrdering> showOrdering) {
@@ -1949,6 +2033,8 @@ public class GetLibraryItemsMetadata {
Objects.deepEquals(this.seasonCount, other.seasonCount) && Objects.deepEquals(this.seasonCount, other.seasonCount) &&
Objects.deepEquals(this.tagline, other.tagline) && Objects.deepEquals(this.tagline, other.tagline) &&
Objects.deepEquals(this.flattenSeasons, other.flattenSeasons) && Objects.deepEquals(this.flattenSeasons, other.flattenSeasons) &&
Objects.deepEquals(this.episodeSort, other.episodeSort) &&
Objects.deepEquals(this.enableCreditsMarkerGeneration, other.enableCreditsMarkerGeneration) &&
Objects.deepEquals(this.showOrdering, other.showOrdering) && Objects.deepEquals(this.showOrdering, other.showOrdering) &&
Objects.deepEquals(this.thumb, other.thumb) && Objects.deepEquals(this.thumb, other.thumb) &&
Objects.deepEquals(this.art, other.art) && Objects.deepEquals(this.art, other.art) &&
@@ -2028,6 +2114,8 @@ public class GetLibraryItemsMetadata {
seasonCount, seasonCount,
tagline, tagline,
flattenSeasons, flattenSeasons,
episodeSort,
enableCreditsMarkerGeneration,
showOrdering, showOrdering,
thumb, thumb,
art, art,
@@ -2107,6 +2195,8 @@ public class GetLibraryItemsMetadata {
"seasonCount", seasonCount, "seasonCount", seasonCount,
"tagline", tagline, "tagline", tagline,
"flattenSeasons", flattenSeasons, "flattenSeasons", flattenSeasons,
"episodeSort", episodeSort,
"enableCreditsMarkerGeneration", enableCreditsMarkerGeneration,
"showOrdering", showOrdering, "showOrdering", showOrdering,
"thumb", thumb, "thumb", thumb,
"art", art, "art", art,
@@ -2202,7 +2292,11 @@ public class GetLibraryItemsMetadata {
private Optional<String> tagline = Optional.empty(); private Optional<String> tagline = Optional.empty();
private Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons; private Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons = Optional.empty();
private Optional<? extends GetLibraryItemsEpisodeSort> episodeSort = Optional.empty();
private Optional<? extends GetLibraryItemsEnableCreditsMarkerGeneration> enableCreditsMarkerGeneration = Optional.empty();
private Optional<? extends GetLibraryItemsShowOrdering> showOrdering = Optional.empty(); private Optional<? extends GetLibraryItemsShowOrdering> showOrdering = Optional.empty();
@@ -2507,12 +2601,18 @@ public class GetLibraryItemsMetadata {
return this; return this;
} }
/**
* Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public Builder flattenSeasons(GetLibraryItemsFlattenSeasons flattenSeasons) { public Builder flattenSeasons(GetLibraryItemsFlattenSeasons flattenSeasons) {
Utils.checkNotNull(flattenSeasons, "flattenSeasons"); Utils.checkNotNull(flattenSeasons, "flattenSeasons");
this.flattenSeasons = Optional.ofNullable(flattenSeasons); this.flattenSeasons = Optional.ofNullable(flattenSeasons);
return this; return this;
} }
/**
* Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public Builder flattenSeasons(Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons) { public Builder flattenSeasons(Optional<? extends GetLibraryItemsFlattenSeasons> flattenSeasons) {
Utils.checkNotNull(flattenSeasons, "flattenSeasons"); Utils.checkNotNull(flattenSeasons, "flattenSeasons");
this.flattenSeasons = flattenSeasons; this.flattenSeasons = flattenSeasons;
@@ -2520,12 +2620,48 @@ public class GetLibraryItemsMetadata {
} }
/** /**
* Setting that indicates the episode ordering for the show * Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
* None = Library default, */
* tmdbAiring = The Movie Database (Aired), public Builder episodeSort(GetLibraryItemsEpisodeSort episodeSort) {
* aired = TheTVDB (Aired), Utils.checkNotNull(episodeSort, "episodeSort");
* dvd = TheTVDB (DVD), this.episodeSort = Optional.ofNullable(episodeSort);
* absolute = TheTVDB (Absolute)). return this;
}
/**
* Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
*/
public Builder episodeSort(Optional<? extends GetLibraryItemsEpisodeSort> episodeSort) {
Utils.checkNotNull(episodeSort, "episodeSort");
this.episodeSort = episodeSort;
return this;
}
/**
* Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public Builder enableCreditsMarkerGeneration(GetLibraryItemsEnableCreditsMarkerGeneration enableCreditsMarkerGeneration) {
Utils.checkNotNull(enableCreditsMarkerGeneration, "enableCreditsMarkerGeneration");
this.enableCreditsMarkerGeneration = Optional.ofNullable(enableCreditsMarkerGeneration);
return this;
}
/**
* Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public Builder enableCreditsMarkerGeneration(Optional<? extends GetLibraryItemsEnableCreditsMarkerGeneration> enableCreditsMarkerGeneration) {
Utils.checkNotNull(enableCreditsMarkerGeneration, "enableCreditsMarkerGeneration");
this.enableCreditsMarkerGeneration = enableCreditsMarkerGeneration;
return this;
}
/**
* Setting that indicates the episode ordering for the show
* None = Library default,
* tmdbAiring = The Movie Database (Aired),
* tvdbAiring = TheTVDB (Aired),
* tvdbDvd = TheTVDB (DVD),
* tvdbAbsolute = TheTVDB (Absolute)).
* *
*/ */
public Builder showOrdering(GetLibraryItemsShowOrdering showOrdering) { public Builder showOrdering(GetLibraryItemsShowOrdering showOrdering) {
@@ -2535,12 +2671,12 @@ public class GetLibraryItemsMetadata {
} }
/** /**
* Setting that indicates the episode ordering for the show * Setting that indicates the episode ordering for the show
* None = Library default, * None = Library default,
* tmdbAiring = The Movie Database (Aired), * tmdbAiring = The Movie Database (Aired),
* aired = TheTVDB (Aired), * tvdbAiring = TheTVDB (Aired),
* dvd = TheTVDB (DVD), * tvdbDvd = TheTVDB (DVD),
* absolute = TheTVDB (Absolute)). * tvdbAbsolute = TheTVDB (Absolute)).
* *
*/ */
public Builder showOrdering(Optional<? extends GetLibraryItemsShowOrdering> showOrdering) { public Builder showOrdering(Optional<? extends GetLibraryItemsShowOrdering> showOrdering) {
@@ -3225,9 +3361,7 @@ public class GetLibraryItemsMetadata {
} }
public GetLibraryItemsMetadata build() { public GetLibraryItemsMetadata build() {
if (flattenSeasons == null) { return new GetLibraryItemsMetadata(
flattenSeasons = _SINGLETON_VALUE_FlattenSeasons.value();
} return new GetLibraryItemsMetadata(
ratingKey, ratingKey,
key, key,
guid, guid,
@@ -3247,6 +3381,8 @@ public class GetLibraryItemsMetadata {
seasonCount, seasonCount,
tagline, tagline,
flattenSeasons, flattenSeasons,
episodeSort,
enableCreditsMarkerGeneration,
showOrdering, showOrdering,
thumb, thumb,
art, art,
@@ -3303,12 +3439,6 @@ public class GetLibraryItemsMetadata {
parentThumb, parentThumb,
parentTheme); parentTheme);
} }
private static final LazySingletonValue<Optional<? extends GetLibraryItemsFlattenSeasons>> _SINGLETON_VALUE_FlattenSeasons =
new LazySingletonValue<>(
"flattenSeasons",
"\"0\"",
new TypeReference<Optional<? extends GetLibraryItemsFlattenSeasons>>() {});
} }
} }

View File

@@ -5,6 +5,8 @@
package dev.plexapi.sdk.models.operations; package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
public enum GetLibraryItemsOptimizedForStreaming { public enum GetLibraryItemsOptimizedForStreaming {
Disable(0), Disable(0),
@@ -20,4 +22,13 @@ public enum GetLibraryItemsOptimizedForStreaming {
public int value() { public int value() {
return value; return value;
} }
public static Optional<GetLibraryItemsOptimizedForStreaming> fromValue(int value) {
for (GetLibraryItemsOptimizedForStreaming o: GetLibraryItemsOptimizedForStreaming.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -5,6 +5,8 @@
package dev.plexapi.sdk.models.operations; package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/** /**
* GetLibraryItemsQueryParamIncludeMeta - Adds the Meta object to the response * GetLibraryItemsQueryParamIncludeMeta - Adds the Meta object to the response
@@ -24,4 +26,13 @@ public enum GetLibraryItemsQueryParamIncludeMeta {
public int value() { public int value() {
return value; return value;
} }
public static Optional<GetLibraryItemsQueryParamIncludeMeta> fromValue(int value) {
for (GetLibraryItemsQueryParamIncludeMeta o: GetLibraryItemsQueryParamIncludeMeta.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -5,6 +5,8 @@
package dev.plexapi.sdk.models.operations; package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/** /**
* GetLibraryItemsQueryParamType - The type of media to retrieve. * GetLibraryItemsQueryParamType - The type of media to retrieve.
@@ -20,7 +22,9 @@ public enum GetLibraryItemsQueryParamType {
TvShow(2L), TvShow(2L),
Season(3L), Season(3L),
Episode(4L), Episode(4L),
Audio(8L); Audio(8L),
Album(9L),
Track(10L);
@JsonValue @JsonValue
private final long value; private final long value;
@@ -32,4 +36,13 @@ public enum GetLibraryItemsQueryParamType {
public long value() { public long value() {
return value; return value;
} }
public static Optional<GetLibraryItemsQueryParamType> fromValue(long value) {
for (GetLibraryItemsQueryParamType o: GetLibraryItemsQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

View File

@@ -6,22 +6,24 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import java.lang.String; import java.lang.String;
import java.util.Objects;
import java.util.Optional;
/** /**
* GetLibraryItemsShowOrdering - Setting that indicates the episode ordering for the show * GetLibraryItemsShowOrdering - Setting that indicates the episode ordering for the show
* None = Library default, * None = Library default,
* tmdbAiring = The Movie Database (Aired), * tmdbAiring = The Movie Database (Aired),
* aired = TheTVDB (Aired), * tvdbAiring = TheTVDB (Aired),
* dvd = TheTVDB (DVD), * tvdbDvd = TheTVDB (DVD),
* absolute = TheTVDB (Absolute)). * tvdbAbsolute = TheTVDB (Absolute)).
* *
*/ */
public enum GetLibraryItemsShowOrdering { public enum GetLibraryItemsShowOrdering {
None("None"), None("None"),
TmdbAiring("tmdbAiring"), TmdbAiring("tmdbAiring"),
Aired("aired"), TvdbAiring("tvdbAiring"),
Dvd("dvd"), TvdbDvd("tvdbDvd"),
Absolute("absolute"); TvdbAbsolute("tvdbAbsolute");
@JsonValue @JsonValue
private final String value; private final String value;
@@ -33,4 +35,13 @@ public enum GetLibraryItemsShowOrdering {
public String value() { public String value() {
return value; return value;
} }
public static Optional<GetLibraryItemsShowOrdering> fromValue(String value) {
for (GetLibraryItemsShowOrdering o: GetLibraryItemsShowOrdering.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
} }

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