ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.406.0

This commit is contained in:
speakeasybot
2024-10-03 00:28:29 +00:00
parent fa542f04e1
commit 2e4350c8c4
247 changed files with 21314 additions and 5695 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
java:
version: 0.7.0
version: 0.8.0
additionalDependencies: []
additionalPlugins: []
artifactID: plexapi

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.405.6
speakeasyVersion: 1.406.0
sources:
my-source:
sourceNamespace: my-source
@@ -8,8 +8,8 @@ sources:
- latest
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:b377f79289070406b0d4adcf59fa6886c6c90cb13a7893c07b44cae956ee25e4
sourceBlobDigest: sha256:92072097f693005146db1ceb5728eee08693d61bb5578b26c32dcbe1cc32927f
sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
tags:
- latest
- main
@@ -17,10 +17,10 @@ targets:
plexjava:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:b377f79289070406b0d4adcf59fa6886c6c90cb13a7893c07b44cae956ee25e4
sourceBlobDigest: sha256:92072097f693005146db1ceb5728eee08693d61bb5578b26c32dcbe1cc32927f
sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
codeSamplesNamespace: code-samples-java-plexjava
codeSamplesRevisionDigest: sha256:ad2e918f9c50ecf860a405c94410f64a3ad90197c672258c177fd2e9d1f3d9a6
codeSamplesRevisionDigest: sha256:46ccc091bbcaf0f056953e6349cd4c115250f9fc4359e7a23f6364979e2be555
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

182
README.md
View File

@@ -45,7 +45,7 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Global Parameters](#global-parameters)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Authentication](#authentication)
@@ -62,7 +62,7 @@ The samples below show how a published SDK artifact is used:
Gradle:
```groovy
implementation 'dev.plexapi:plexapi:0.7.0'
implementation 'dev.plexapi:plexapi:0.8.0'
```
Maven:
@@ -70,7 +70,7 @@ Maven:
<dependency>
<groupId>dev.plexapi</groupId>
<artifactId>plexapi</artifactId>
<version>0.7.0</version>
<version>0.8.0</version>
</dependency>
```
@@ -109,11 +109,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -169,6 +169,7 @@ public class Application {
* [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
* [getRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
* [getSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library
* [getSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
* [getMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey
* [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
@@ -260,68 +261,103 @@ public class Application {
</details>
<!-- End Available Resources and Operations [operations] -->
<!-- Start Global Parameters [global-parameters] -->
## Global Parameters
<!-- Start Retries [retries] -->
## Retries
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
### Available Globals
The following global parameters are available.
| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| clientID | java.lang.String | | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) |
| clientName | java.lang.String | | The clientName parameter. |
| clientVersion | java.lang.String | | The clientVersion parameter. |
| clientPlatform | java.lang.String | | The clientPlatform parameter. |
| deviceName | java.lang.String | | The deviceName parameter. |
### Example
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, you can provide a `RetryConfig` object through the `retryConfig` builder method:
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest;
import dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized;
import dev.plexapi.sdk.models.operations.GetServerResourcesResponse;
import dev.plexapi.sdk.models.operations.IncludeHttps;
import dev.plexapi.sdk.models.operations.IncludeIPv6;
import dev.plexapi.sdk.models.operations.IncludeRelay;
import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest;
import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized;
import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.RetryConfig;
import java.lang.Exception;
import java.util.concurrent.TimeUnit;
public class Application {
public static void main(String[] args) throws GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception {
public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerResourcesResponse res = sdk.plex().getServerResources()
.includeHttps(IncludeHttps.Enable)
.includeRelay(IncludeRelay.Enable)
.includeIPv6(IncludeIPv6.Enable)
.clientID("gcgzw5rz2xovp84b4vha3a40")
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
.retryConfig(RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(1L, TimeUnit.MILLISECONDS)
.maxInterval(50L, TimeUnit.MILLISECONDS)
.maxElapsedTime(1000L, TimeUnit.MILLISECONDS)
.baseFactor(1.1)
.jitterFactor(0.15)
.retryConnectError(false)
.build())
.build())
.call();
if (res.plexDevices().isPresent()) {
if (res.object().isPresent()) {
// handle response
}
}
}
```
<!-- End Global Parameters [global-parameters] -->
If you'd like to override the default retry strategy for all operations that support retries, you can provide a configuration at SDK initialization:
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest;
import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized;
import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.RetryConfig;
import java.lang.Exception;
import java.util.concurrent.TimeUnit;
public class Application {
public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.retryConfig(RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(1L, TimeUnit.MILLISECONDS)
.maxInterval(50L, TimeUnit.MILLISECONDS)
.maxElapsedTime(1000L, TimeUnit.MILLISECONDS)
.baseFactor(1.1)
.jitterFactor(0.15)
.retryConnectError(false)
.build())
.build())
.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();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
<!-- End Retries [retries] -->
<!-- Start Error Handling [errors] -->
## Error Handling
@@ -353,11 +389,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -400,11 +436,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.serverIndex(0)
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -443,11 +479,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.serverURL("{protocol}://{ip}:{port}")
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -478,11 +514,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
@@ -524,11 +560,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()

View File

@@ -138,4 +138,14 @@ Based on:
### Generated
- [java v0.7.0] .
### Releases
- [Maven Central v0.7.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.7.0 - .
- [Maven Central v0.7.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.7.0 - .
## 2024-10-03 00:26:50
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.406.0 (2.429.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.8.0] .
### Releases
- [Maven Central v0.8.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.8.0 - .

View File

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

View File

@@ -63,7 +63,7 @@ tasks.withType(Javadoc) {
}
group = "dev.plexapi"
version = "0.7.0"
version = "0.8.0"
sourcesJar {
archiveBaseName = "plexapi"
@@ -101,7 +101,7 @@ publishing {
maven(MavenPublication) {
groupId = 'dev.plexapi'
artifactId = 'plexapi'
version = '0.7.0'
version = '0.8.0'
from components.java

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesBadRequest
Bad Request - A parameter was not specified, or was specified incorrectly.
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `errors` | List<[GetSearchAllLibrariesErrors](../../models/errors/GetSearchAllLibrariesErrors.md)> | :heavy_minus_sign: | N/A |
| `rawResponse` | [HttpResponse<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -0,0 +1,10 @@
# GetSearchAllLibrariesErrors
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `code` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1000 |
| `message` | *Optional<String>* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
| `status` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 400 |

View File

@@ -0,0 +1,10 @@
# GetSearchAllLibrariesLibraryErrors
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `code` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1001 |
| `message` | *Optional<String>* | :heavy_minus_sign: | N/A | User could not be authenticated |
| `status` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 401 |

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesUnauthorized
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `errors` | List<[GetSearchAllLibrariesLibraryErrors](../../models/errors/GetSearchAllLibrariesLibraryErrors.md)> | :heavy_minus_sign: | N/A |
| `rawResponse` | [HttpResponse<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -1,102 +0,0 @@
# Features
## Values
| Name | Value |
| ----------------------------------------- | ----------------------------------------- |
| `ANDROID_DOLBY_VISION` | Android - Dolby Vision |
| `ANDROID_PI_P` | Android - PiP |
| `CU_SUNSET` | CU Sunset |
| `HRK_ENABLE_EUR` | HRK_enable_EUR |
| `TREBLE_SHOW_FEATURES` | TREBLE-show-features |
| `AD_COUNTDOWN_TIMER` | ad-countdown-timer |
| `ADAPTIVE_BITRATE` | adaptive_bitrate |
| `ALBUM_TYPES` | album-types |
| `ALLOW_DVR` | allow_dvr |
| `AMAZON_LOOP_DEBUG` | amazon-loop-debug |
| `AVOD_AD_ANALYSIS` | avod-ad-analysis |
| `AVOD_NEW_MEDIA` | avod-new-media |
| `BLACKLIST_GET_SIGNIN` | blacklist_get_signin |
| `BOOST_VOICES` | boost-voices |
| `CAMERA_UPLOAD` | camera_upload |
| `CLIENT_RADIO_STATIONS` | client-radio-stations |
| `CLOUDFLARE_TURNSTILE_REQUIRED` | cloudflare-turnstile-required |
| `CLOUDSYNC` | cloudsync |
| `COLLECTIONS` | collections |
| `COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS` | comments_and_replies_push_notifications |
| `COMMUNITY_ACCESS_PLEX_TV` | community_access_plex_tv |
| `COMPANIONS_SONOS` | companions_sonos |
| `CONTENT_FILTER` | content_filter |
| `CUSTOM_HOME_REMOVAL` | custom-home-removal |
| `DISABLE_HOME_USER_FRIENDSHIPS` | disable_home_user_friendships |
| `DISABLE_SHARING_FRIENDSHIPS` | disable_sharing_friendships |
| `DOWNLOADS_GATING` | downloads-gating |
| `DRM_SUPPORT` | drm_support |
| `DVR` | dvr |
| `DVR_BLOCK_UNSUPPORTED_COUNTRIES` | dvr-block-unsupported-countries |
| `EPG_RECENT_CHANNELS` | epg-recent-channels |
| `EXCLUDE_RESTRICTIONS` | exclude restrictions |
| `FEDERATED_AUTH` | federated-auth |
| `FRIEND_REQUEST_PUSH_NOTIFICATIONS` | friend_request_push_notifications |
| `GRANDFATHER_SYNC` | grandfather-sync |
| `GUIDED_UPGRADE` | guided-upgrade |
| `HARDWARE_TRANSCODING` | hardware_transcoding |
| `HOME` | home |
| `HWTRANSCODE` | hwtranscode |
| `IMAGGA_V2` | imagga-v2 |
| `INCREASE_PASSWORD_COMPLEXITY` | increase-password-complexity |
| `IOS14_PRIVACY_BANNER` | ios14-privacy-banner |
| `ITERABLE_NOTIFICATION_TOKENS` | iterable-notification-tokens |
| `ITEM_CLUSTERS` | item_clusters |
| `KEEP_PAYMENT_METHOD` | keep-payment-method |
| `KEVIN_BACON` | kevin-bacon |
| `KOREA_CONSENT` | korea-consent |
| `LE_ISRG_ROOT_X1` | le_isrg_root_x1 |
| `LETS_ENCRYPT` | lets_encrypt |
| `LIGHTNING_DVR_PIVOT` | lightning-dvr-pivot |
| `LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS` | live-tv-support-incomplete-segments |
| `LIVETV` | livetv |
| `LYRICS` | lyrics |
| `METADATA_SEARCH` | metadata_search |
| `MUSIC_ANALYSIS` | music-analysis |
| `MUSIC_VIDEOS` | music_videos |
| `NEW_PLEX_PASS_PRICES` | new_plex_pass_prices |
| `NEWS_PROVIDER_SUNSET_MODAL` | news-provider-sunset-modal |
| `NOMINATIM` | nominatim |
| `PASS` | pass |
| `PHOTOS_FAVORITES` | photos-favorites |
| `PHOTOS_METADATA_EDITION` | photos-metadata-edition |
| `PHOTOS_V6_EDIT` | photosV6-edit |
| `PHOTOS_V6_TV_ALBUMS` | photosV6-tv-albums |
| `PMS_HEALTH` | pms_health |
| `PREMIUM_DASHBOARD` | premium-dashboard |
| `PREMIUM_MUSIC_METADATA` | premium_music_metadata |
| `RADIO` | radio |
| `RATE_LIMIT_CLIENT_TOKEN` | rate-limit-client-token |
| `SCROBBLING_SERVICE_PLEX_TV` | scrobbling-service-plex-tv |
| `SESSION_BANDWIDTH_RESTRICTIONS` | session_bandwidth_restrictions |
| `SESSION_KICK` | session_kick |
| `SHARED_SERVER_NOTIFICATION` | shared_server_notification |
| `SHARED_SOURCE_NOTIFICATION` | shared_source_notification |
| `SIGNIN_NOTIFICATION` | signin_notification |
| `SIGNIN_WITH_APPLE` | signin_with_apple |
| `SILENCE_REMOVAL` | silence-removal |
| `SLEEP_TIMER` | sleep-timer |
| `SPRING_SERVE_AD_PROVIDER` | spring_serve_ad_provider |
| `SYNC` | sync |
| `SWEET_FADES` | sweet-fades |
| `TRANSCODER_CACHE` | transcoder_cache |
| `TRAILERS` | trailers |
| `TUNER_SHARING` | tuner-sharing |
| `TWO_FACTOR_AUTHENTICATION` | two-factor-authentication |
| `UNSUPPORTEDTUNERS` | unsupportedtuners |
| `UPGRADE3DS2` | upgrade-3ds2 |
| `VISUALIZERS` | visualizers |
| `VOD_SCHEMA` | vod-schema |
| `VOD_CLOUDFLARE` | vod_cloudflare |
| `VOLUME_LEVELING` | volume-leveling |
| `WATCH_TOGETHER_INVITE` | watch-together-invite |
| `WATCHLIST_RSS` | watchlist-rss |
| `WEB_SERVER_DASHBOARD` | web_server_dashboard |
| `WEBHOOKS` | webhooks |

View File

@@ -3,26 +3,26 @@
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true |
| `art` | *String* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
| `composite` | *String* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 |
| `filters` | *boolean* | :heavy_check_mark: | N/A | true |
| `refreshing` | *boolean* | :heavy_check_mark: | N/A | false |
| `thumb` | *String* | :heavy_check_mark: | N/A | /:/resources/movie.png |
| `key` | *String* | :heavy_check_mark: | N/A | 1 |
| `type` | *String* | :heavy_check_mark: | N/A | movie |
| `title` | *String* | :heavy_check_mark: | N/A | Movies |
| `agent` | *String* | :heavy_check_mark: | N/A | tv.plex.agents.movie |
| `scanner` | *String* | :heavy_check_mark: | N/A | Plex Movie |
| `language` | *String* | :heavy_check_mark: | N/A | en-US |
| `uuid` | *String* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `updatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `createdAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `scannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `content` | *boolean* | :heavy_check_mark: | N/A | true |
| `directory` | *boolean* | :heavy_check_mark: | N/A | true |
| `contentChangedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `hidden` | *int* | :heavy_check_mark: | N/A | 0 |
| `location` | List<[Location](../../models/operations/Location.md)> | :heavy_check_mark: | N/A | |
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true |
| `art` | *String* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
| `composite` | *String* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 |
| `filters` | *boolean* | :heavy_check_mark: | N/A | true |
| `refreshing` | *boolean* | :heavy_check_mark: | N/A | false |
| `thumb` | *String* | :heavy_check_mark: | N/A | /:/resources/movie.png |
| `key` | *String* | :heavy_check_mark: | N/A | 1 |
| `type` | *String* | :heavy_check_mark: | N/A | movie |
| `title` | *String* | :heavy_check_mark: | N/A | Movies |
| `agent` | *String* | :heavy_check_mark: | N/A | tv.plex.agents.movie |
| `scanner` | *String* | :heavy_check_mark: | N/A | Plex Movie |
| `language` | *String* | :heavy_check_mark: | N/A | en-US |
| `uuid` | *String* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `updatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `createdAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `scannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `content` | *boolean* | :heavy_check_mark: | N/A | true |
| `directory` | *boolean* | :heavy_check_mark: | N/A | true |
| `contentChangedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `hidden` | *int* | :heavy_check_mark: | N/A | 0 |
| `location` | List<[GetAllLibrariesLocation](../../models/operations/GetAllLibrariesLocation.md)> | :heavy_check_mark: | N/A | |

View File

@@ -0,0 +1,9 @@
# GetAllLibrariesLocation
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `id` | *int* | :heavy_check_mark: | N/A | 1 |
| `path` | *String* | :heavy_check_mark: | N/A | /movies |

View File

@@ -10,4 +10,4 @@
| `height` | *long* | :heavy_check_mark: | N/A | 396 |
| `minSize` | *long* | :heavy_check_mark: | N/A | 1 |
| `upscale` | *long* | :heavy_check_mark: | N/A | 1 |
| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |

View File

@@ -5,5 +5,5 @@
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| `includeDetails` | [Optional<IncludeDetails>](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
| `includeDetails` | [Optional<IncludeDetails>](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |

View File

@@ -0,0 +1,8 @@
# GetLibraryItemsLocation
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `path` | *Optional<String>* | :heavy_minus_sign: | N/A | /TV Shows/House |

View File

@@ -6,19 +6,19 @@
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `id` | *int* | :heavy_check_mark: | N/A | 119534 |
| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 |
| `bitrate` | *int* | :heavy_check_mark: | N/A | 25025 |
| `width` | *int* | :heavy_check_mark: | N/A | 3840 |
| `height` | *int* | :heavy_check_mark: | N/A | 2072 |
| `aspectRatio` | *double* | :heavy_check_mark: | N/A | 1.85 |
| `duration` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 11558112 |
| `bitrate` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 25025 |
| `width` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 3840 |
| `height` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 2072 |
| `aspectRatio` | *Optional<Double>* | :heavy_minus_sign: | N/A | 1.85 |
| `audioProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | dts |
| `audioChannels` | *int* | :heavy_check_mark: | N/A | 6 |
| `audioCodec` | *String* | :heavy_check_mark: | N/A | eac3 |
| `videoCodec` | *String* | :heavy_check_mark: | N/A | hevc |
| `videoResolution` | *String* | :heavy_check_mark: | N/A | 4k |
| `audioChannels` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 6 |
| `audioCodec` | *Optional<String>* | :heavy_minus_sign: | N/A | eac3 |
| `videoCodec` | *Optional<String>* | :heavy_minus_sign: | N/A | hevc |
| `videoResolution` | *Optional<String>* | :heavy_minus_sign: | N/A | 4k |
| `container` | *String* | :heavy_check_mark: | N/A | mkv |
| `videoFrameRate` | *String* | :heavy_check_mark: | N/A | 24p |
| `videoProfile` | *String* | :heavy_check_mark: | N/A | main 10 |
| `videoFrameRate` | *Optional<String>* | :heavy_minus_sign: | N/A | 24p |
| `videoProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | main 10 |
| `hasVoiceActivity` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `optimizedForStreaming` | [Optional<GetLibraryItemsOptimizedForStreaming>](../../models/operations/GetLibraryItemsOptimizedForStreaming.md) | :heavy_minus_sign: | N/A | 1 |
| `has64bitOffsets` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |

View File

@@ -52,6 +52,7 @@
| `writer` | List<[GetLibraryItemsWriter](../../models/operations/GetLibraryItemsWriter.md)> | :heavy_minus_sign: | N/A | |
| `collection` | List<[GetLibraryItemsCollection](../../models/operations/GetLibraryItemsCollection.md)> | :heavy_minus_sign: | N/A | |
| `role` | List<[GetLibraryItemsRole](../../models/operations/GetLibraryItemsRole.md)> | :heavy_minus_sign: | N/A | |
| `location` | List<[GetLibraryItemsLocation](../../models/operations/GetLibraryItemsLocation.md)> | :heavy_minus_sign: | N/A | |
| `mediaGuid` | List<[GetLibraryItemsMediaGuid](../../models/operations/GetLibraryItemsMediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> | |
| `ultraBlurColors` | [Optional<GetLibraryItemsUltraBlurColors>](../../models/operations/GetLibraryItemsUltraBlurColors.md) | :heavy_minus_sign: | N/A | |
| `metaDataRating` | List<[GetLibraryItemsMetaDataRating](../../models/operations/GetLibraryItemsMetaDataRating.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -7,14 +7,14 @@
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `id` | *int* | :heavy_check_mark: | N/A | 119542 |
| `key` | *String* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv |
| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 |
| `duration` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 11558112 |
| `file` | *String* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv |
| `size` | *long* | :heavy_check_mark: | N/A | 36158371307 |
| `container` | *String* | :heavy_check_mark: | The container format of the media file.<br/> | mkv |
| `audioProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | dts |
| `has64bitOffsets` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `optimizedForStreaming` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `videoProfile` | *String* | :heavy_check_mark: | N/A | main 10 |
| `videoProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | main 10 |
| `indexes` | *Optional<String>* | :heavy_minus_sign: | N/A | sd |
| `hasThumbnail` | [Optional<GetLibraryItemsHasThumbnail>](../../models/operations/GetLibraryItemsHasThumbnail.md) | :heavy_minus_sign: | N/A | 1 |
| `stream` | List<[GetLibraryItemsStream](../../models/operations/GetLibraryItemsStream.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -5,10 +5,10 @@
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| `tag` | [Tag](../../models/operations/Tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | |
| `includeGuids` | [Optional<IncludeGuids>](../../models/operations/IncludeGuids.md) | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
| `type` | [Optional<GetLibraryItemsQueryParamType>](../../models/operations/GetLibraryItemsQueryParamType.md) | :heavy_minus_sign: | The type of media to retrieve.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| `includeMeta` | [Optional<GetLibraryItemsQueryParamIncludeMeta>](../../models/operations/GetLibraryItemsQueryParamIncludeMeta.md) | :heavy_minus_sign: | Adds the Meta object to the response<br/> | 1 |
| `xPlexContainerStart` | *Optional<Integer>* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/>By default this is 0<br/> | 0 |
| `xPlexContainerSize` | *Optional<Integer>* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/>By default this is 50<br/> | 50 |

View File

@@ -3,6 +3,6 @@
## Fields
| Field | Type | Required | Description | Example |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| Field | Type | Required | Description | Example |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |

View File

@@ -15,7 +15,7 @@
| `title` | *Optional<String>* | :heavy_minus_sign: | N/A | Season 2 |
| `parentKey` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/30072 |
| `parentTitle` | *Optional<String>* | :heavy_minus_sign: | N/A | Reacher |
| `summary` | *Optional<String>* | :heavy_minus_sign: | N/A | Based on"Bad Luck and Trouble," when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mindrevenge. |
| `summary` | *Optional<String>* | :heavy_minus_sign: | N/A | Based on"Bad Luck and Trouble," when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind-revenge. |
| `index` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 2 |
| `parentIndex` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `viewCount` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 11 |

View File

@@ -3,11 +3,11 @@
## Fields
| 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/> | |
| `clientID` | *Optional<String>* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 |
| `clientName` | *Optional<String>* | :heavy_minus_sign: | N/A | Plex Web |
| `deviceName` | *Optional<String>* | :heavy_minus_sign: | N/A | Linux |
| `clientVersion` | *Optional<String>* | :heavy_minus_sign: | N/A | 4.133.0 |
| `clientPlatform` | *Optional<String>* | :heavy_minus_sign: | N/A | Chrome |
| 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/> | |
| `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 |
| `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 |
| `clientVersion` | *Optional<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `platform` | *Optional<String>* | :heavy_minus_sign: | The platform of the client application. | Roku |

View File

@@ -52,6 +52,7 @@
| `writer` | List<[Writer](../../models/operations/Writer.md)> | :heavy_minus_sign: | N/A | |
| `collection` | List<[Collection](../../models/operations/Collection.md)> | :heavy_minus_sign: | N/A | |
| `role` | List<[Role](../../models/operations/Role.md)> | :heavy_minus_sign: | N/A | |
| `location` | List<[Location](../../models/operations/Location.md)> | :heavy_minus_sign: | N/A | |
| `mediaGuid` | List<[MediaGuid](../../models/operations/MediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> | |
| `ultraBlurColors` | [Optional<UltraBlurColors>](../../models/operations/UltraBlurColors.md) | :heavy_minus_sign: | N/A | |
| `metaDataRating` | List<[MetaDataRating](../../models/operations/MetaDataRating.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -5,5 +5,5 @@
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| `force` | [Optional<Force>](../../models/operations/Force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 |
| `force` | [Optional<Force>](../../models/operations/Force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |

View File

@@ -0,0 +1,8 @@
# GetSearchAllLibrariesCollection
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `tag` | *Optional<String>* | :heavy_minus_sign: | N/A | Working NL Subs |

View File

@@ -0,0 +1,8 @@
# GetSearchAllLibrariesCountry
## Fields
| Field | Type | Required | Description | Example |
| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ |
| `tag` | *Optional<String>* | :heavy_minus_sign: | N/A | United States of America |

View File

@@ -0,0 +1,8 @@
# GetSearchAllLibrariesDirector
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `tag` | *Optional<String>* | :heavy_minus_sign: | N/A | James Cameron |

View File

@@ -0,0 +1,9 @@
# GetSearchAllLibrariesFlattenSeasons
## Values
| Name | Value |
| ------- | ------- |
| `False` | 0 |
| `True` | 1 |

View File

@@ -0,0 +1,8 @@
# GetSearchAllLibrariesGenre
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `tag` | *Optional<String>* | :heavy_minus_sign: | N/A | Adventure |

View File

@@ -0,0 +1,9 @@
# GetSearchAllLibrariesHasThumbnail
## Values
| Name | Value |
| ------- | ------- |
| `False` | 0 |
| `True` | 1 |

View File

@@ -0,0 +1,10 @@
# GetSearchAllLibrariesImage
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `alt` | *String* | :heavy_check_mark: | N/A | Episode 1 |
| `type` | [GetSearchAllLibrariesLibraryType](../../models/operations/GetSearchAllLibrariesLibraryType.md) | :heavy_check_mark: | N/A | background |
| `url` | *String* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 |

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesLibraryType
## Values
| Name | Value |
| -------------- | -------------- |
| `COVER_POSTER` | coverPoster |
| `BACKGROUND` | background |
| `SNAPSHOT` | snapshot |
| `CLEAR_LOGO` | clearLogo |

View File

@@ -0,0 +1,8 @@
# GetSearchAllLibrariesLocation
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `path` | *Optional<String>* | :heavy_minus_sign: | N/A | /TV Shows/House |

View File

@@ -0,0 +1,25 @@
# GetSearchAllLibrariesMedia
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `id` | *int* | :heavy_check_mark: | N/A | 119534 |
| `duration` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 11558112 |
| `bitrate` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 25025 |
| `width` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 3840 |
| `height` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 2072 |
| `aspectRatio` | *Optional<Double>* | :heavy_minus_sign: | N/A | 1.85 |
| `audioProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | dts |
| `audioChannels` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 6 |
| `audioCodec` | *Optional<String>* | :heavy_minus_sign: | N/A | eac3 |
| `videoCodec` | *Optional<String>* | :heavy_minus_sign: | N/A | hevc |
| `videoResolution` | *Optional<String>* | :heavy_minus_sign: | N/A | 4k |
| `container` | *String* | :heavy_check_mark: | N/A | mkv |
| `videoFrameRate` | *Optional<String>* | :heavy_minus_sign: | N/A | 24p |
| `videoProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | main 10 |
| `hasVoiceActivity` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `optimizedForStreaming` | [Optional<GetSearchAllLibrariesOptimizedForStreaming>](../../models/operations/GetSearchAllLibrariesOptimizedForStreaming.md) | :heavy_minus_sign: | N/A | 1 |
| `has64bitOffsets` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `part` | List<[GetSearchAllLibrariesPart](../../models/operations/GetSearchAllLibrariesPart.md)> | :heavy_check_mark: | N/A | |

View File

@@ -0,0 +1,9 @@
# GetSearchAllLibrariesMediaContainer
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| `size` | *double* | :heavy_check_mark: | N/A |
| `searchResult` | List<[SearchResult](../../models/operations/SearchResult.md)> | :heavy_check_mark: | N/A |

View File

@@ -0,0 +1,8 @@
# GetSearchAllLibrariesMediaGuid
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `id` | *String* | :heavy_check_mark: | Can be one of the following formats:<br/>imdb://tt13015952, tmdb://2434012, tvdb://7945991<br/> | imdb://tt13015952 |

View File

@@ -0,0 +1,10 @@
# GetSearchAllLibrariesMetaDataRating
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| `image` | *String* | :heavy_check_mark: | A URI or path to the rating image. | themoviedb://image.rating |
| `value` | *float* | :heavy_check_mark: | The value of the rating. | 3 |
| `type` | *String* | :heavy_check_mark: | The type of rating (e.g., audience, critic). | audience |

View File

@@ -0,0 +1,81 @@
# GetSearchAllLibrariesMetadata
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ratingKey` | *String* | :heavy_check_mark: | The rating key (Media ID) of this media item.<br/>Note: This is always an integer, but is represented as a string in the API.<br/> | 58683 |
| `key` | *String* | :heavy_check_mark: | N/A | /library/metadata/58683 |
| `guid` | *String* | :heavy_check_mark: | N/A | plex://movie/5d7768ba96b655001fdc0408 |
| `studio` | *Optional<String>* | :heavy_minus_sign: | N/A | 20th Century Studios |
| `skipChildren` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `librarySectionID` | *Optional<Long>* | :heavy_minus_sign: | N/A | 1 |
| `librarySectionTitle` | *Optional<String>* | :heavy_minus_sign: | N/A | Movies |
| `librarySectionKey` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/sections/1 |
| `type` | [GetSearchAllLibrariesType](../../models/operations/GetSearchAllLibrariesType.md) | :heavy_check_mark: | The type of media content<br/> | movie |
| `title` | *String* | :heavy_check_mark: | N/A | Avatar: The Way of Water |
| `slug` | *Optional<String>* | :heavy_minus_sign: | N/A | 4-for-texas |
| `contentRating` | *Optional<String>* | :heavy_minus_sign: | N/A | PG-13 |
| `summary` | *String* | :heavy_check_mark: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. |
| `rating` | *Optional<Double>* | :heavy_minus_sign: | N/A | 7.6 |
| `audienceRating` | *Optional<Double>* | :heavy_minus_sign: | N/A | 9.2 |
| `year` | *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. |
| `flattenSeasons` | [Optional<GetSearchAllLibrariesFlattenSeasons>](../../models/operations/GetSearchAllLibrariesFlattenSeasons.md) | :heavy_minus_sign: | N/A | 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 |
| `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 |
| `banner` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 |
| `duration` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 11558112 |
| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC |
| `addedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `updatedAt` | *Optional<Long>* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 |
| `audienceRatingImage` | *Optional<String>* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright |
| `chapterSource` | *Optional<String>* | :heavy_minus_sign: | N/A | media |
| `primaryExtraKey` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/58684 |
| `ratingImage` | *Optional<String>* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe |
| `grandparentRatingKey` | *Optional<String>* | :heavy_minus_sign: | N/A | 66 |
| `grandparentGuid` | *Optional<String>* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
| `grandparentKey` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/66 |
| `grandparentTitle` | *Optional<String>* | :heavy_minus_sign: | N/A | Caprica |
| `grandparentThumb` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
| `parentSlug` | *Optional<String>* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 |
| `grandparentSlug` | *Optional<String>* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 |
| `grandparentArt` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 |
| `grandparentTheme` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |
| `media` | List<[GetSearchAllLibrariesMedia](../../models/operations/GetSearchAllLibrariesMedia.md)> | :heavy_minus_sign: | The Media object is only included when type query is `4` or higher.<br/> | |
| `genre` | List<[GetSearchAllLibrariesGenre](../../models/operations/GetSearchAllLibrariesGenre.md)> | :heavy_minus_sign: | N/A | |
| `country` | List<[GetSearchAllLibrariesCountry](../../models/operations/GetSearchAllLibrariesCountry.md)> | :heavy_minus_sign: | N/A | |
| `director` | List<[GetSearchAllLibrariesDirector](../../models/operations/GetSearchAllLibrariesDirector.md)> | :heavy_minus_sign: | N/A | |
| `writer` | List<[GetSearchAllLibrariesWriter](../../models/operations/GetSearchAllLibrariesWriter.md)> | :heavy_minus_sign: | N/A | |
| `collection` | List<[GetSearchAllLibrariesCollection](../../models/operations/GetSearchAllLibrariesCollection.md)> | :heavy_minus_sign: | N/A | |
| `role` | List<[GetSearchAllLibrariesRole](../../models/operations/GetSearchAllLibrariesRole.md)> | :heavy_minus_sign: | N/A | |
| `location` | List<[GetSearchAllLibrariesLocation](../../models/operations/GetSearchAllLibrariesLocation.md)> | :heavy_minus_sign: | N/A | |
| `mediaGuid` | List<[GetSearchAllLibrariesMediaGuid](../../models/operations/GetSearchAllLibrariesMediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> | |
| `ultraBlurColors` | [Optional<GetSearchAllLibrariesUltraBlurColors>](../../models/operations/GetSearchAllLibrariesUltraBlurColors.md) | :heavy_minus_sign: | N/A | |
| `metaDataRating` | List<[GetSearchAllLibrariesMetaDataRating](../../models/operations/GetSearchAllLibrariesMetaDataRating.md)> | :heavy_minus_sign: | N/A | |
| `image` | List<[GetSearchAllLibrariesImage](../../models/operations/GetSearchAllLibrariesImage.md)> | :heavy_minus_sign: | N/A | |
| `titleSort` | *Optional<String>* | :heavy_minus_sign: | N/A | Whale |
| `viewCount` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `lastViewedAt` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1682752242 |
| `originalTitle` | *Optional<String>* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 |
| `viewOffset` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 5222500 |
| `skipCount` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `index` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `theme` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 |
| `leafCount` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 14 |
| `viewedLeafCount` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 0 |
| `childCount` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `hasPremiumExtras` | *Optional<String>* | :heavy_minus_sign: | N/A | 1 |
| `hasPremiumPrimaryExtra` | *Optional<String>* | :heavy_minus_sign: | N/A | 1 |
| `parentRatingKey` | *Optional<String>* | :heavy_minus_sign: | The rating key of the parent item.<br/> | 66 |
| `parentGuid` | *Optional<String>* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
| `parentStudio` | *Optional<String>* | :heavy_minus_sign: | N/A | UCP |
| `parentKey` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/66 |
| `parentTitle` | *Optional<String>* | :heavy_minus_sign: | N/A | Caprica |
| `parentIndex` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 1 |
| `parentYear` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 2010 |
| `parentThumb` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
| `parentTheme` | *Optional<String>* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |

View File

@@ -0,0 +1,9 @@
# GetSearchAllLibrariesOptimizedForStreaming
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,20 @@
# GetSearchAllLibrariesPart
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `id` | *int* | :heavy_check_mark: | N/A | 119542 |
| `key` | *String* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv |
| `duration` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 11558112 |
| `file` | *String* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv |
| `size` | *long* | :heavy_check_mark: | N/A | 36158371307 |
| `container` | *String* | :heavy_check_mark: | The container format of the media file.<br/> | mkv |
| `audioProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | dts |
| `has64bitOffsets` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `optimizedForStreaming` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `videoProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | main 10 |
| `indexes` | *Optional<String>* | :heavy_minus_sign: | N/A | sd |
| `hasThumbnail` | [Optional<GetSearchAllLibrariesHasThumbnail>](../../models/operations/GetSearchAllLibrariesHasThumbnail.md) | :heavy_minus_sign: | N/A | 1 |
| `stream` | List<[GetSearchAllLibrariesStream](../../models/operations/GetSearchAllLibrariesStream.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -0,0 +1,13 @@
# GetSearchAllLibrariesRequest
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `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 |
| `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 |
| `includeCollections` | [Optional<QueryParamIncludeCollections>](../../models/operations/QueryParamIncludeCollections.md) | :heavy_minus_sign: | Whether to include collections in the search results. | 1 |
| `includeExternalMedia` | [Optional<QueryParamIncludeExternalMedia>](../../models/operations/QueryParamIncludeExternalMedia.md) | :heavy_minus_sign: | Whether to include external media in the search results. | 1 |

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesResponse
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [HttpResponse<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `object` | [Optional<GetSearchAllLibrariesResponseBody>](../../models/operations/GetSearchAllLibrariesResponseBody.md) | :heavy_minus_sign: | The libraries available on the Server |

View File

@@ -0,0 +1,10 @@
# GetSearchAllLibrariesResponseBody
The libraries available on the Server
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `mediaContainer` | [GetSearchAllLibrariesMediaContainer](../../models/operations/GetSearchAllLibrariesMediaContainer.md) | :heavy_check_mark: | N/A |

View File

@@ -0,0 +1,13 @@
# GetSearchAllLibrariesRole
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `id` | *Optional<Long>* | :heavy_minus_sign: | The ID of the tag or actor. | 294129 |
| `filter` | *Optional<String>* | :heavy_minus_sign: | The filter used to find the actor or tag. | actor=294129 |
| `thumb` | *Optional<String>* | :heavy_minus_sign: | The thumbnail of the actor | https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg |
| `tag` | *Optional<String>* | :heavy_minus_sign: | The name of the tag or actor. | Mike Smith |
| `tagKey` | *Optional<String>* | :heavy_minus_sign: | Unique identifier for the tag. | 668e7e7b22bcad9064350c91 |
| `role` | *Optional<String>* | :heavy_minus_sign: | The role of the actor or tag in the media. | Self |

View File

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

View File

@@ -0,0 +1,45 @@
# GetSearchAllLibrariesStream
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| `id` | *long* | :heavy_check_mark: | N/A | 272796 |
| `streamType` | *long* | :heavy_check_mark: | Type of stream (1 = video, 2 = audio, 3 = subtitle) | 1 |
| `default_` | *Optional<Boolean>* | :heavy_minus_sign: | Indicates if this is the default stream | true |
| `selected` | *Optional<Boolean>* | :heavy_minus_sign: | Indicates if the stream is selected | true |
| `codec` | *String* | :heavy_check_mark: | Codec used by the stream | h264 |
| `index` | *long* | :heavy_check_mark: | The index of the stream | 0 |
| `bitrate` | *Optional<Long>* | :heavy_minus_sign: | The bitrate of the stream in kbps | 6273 |
| `colorPrimaries` | *Optional<String>* | :heavy_minus_sign: | The color primaries of the video stream | bt709 |
| `colorRange` | *Optional<String>* | :heavy_minus_sign: | The color range of the video stream | tv |
| `colorSpace` | *Optional<String>* | :heavy_minus_sign: | The color space of the video stream | bt709 |
| `colorTrc` | *Optional<String>* | :heavy_minus_sign: | The transfer characteristics (TRC) of the video stream | bt709 |
| `bitDepth` | *Optional<Long>* | :heavy_minus_sign: | The bit depth of the video stream | 8 |
| `chromaLocation` | *Optional<String>* | :heavy_minus_sign: | The chroma location of the video stream | left |
| `streamIdentifier` | *Optional<String>* | :heavy_minus_sign: | The identifier of the video stream | 2 |
| `chromaSubsampling` | *Optional<String>* | :heavy_minus_sign: | The chroma subsampling format | 4:2:0 |
| `codedHeight` | *Optional<Long>* | :heavy_minus_sign: | The coded height of the video stream | 1088 |
| `codedWidth` | *Optional<Long>* | :heavy_minus_sign: | The coded width of the video stream | 1920 |
| `frameRate` | *Optional<Double>* | :heavy_minus_sign: | The frame rate of the video stream | 29.97 |
| `hasScalingMatrix` | *Optional<Boolean>* | :heavy_minus_sign: | Indicates if the stream has a scaling matrix | false |
| `hearingImpaired` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `closedCaptions` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `embeddedInVideo` | *Optional<String>* | :heavy_minus_sign: | N/A | 1 |
| `height` | *Optional<Long>* | :heavy_minus_sign: | The height of the video stream | 1080 |
| `level` | *Optional<Long>* | :heavy_minus_sign: | The level of the video codec | 40 |
| `profile` | *Optional<String>* | :heavy_minus_sign: | The profile of the video codec | main |
| `refFrames` | *Optional<Long>* | :heavy_minus_sign: | Number of reference frames | 4 |
| `scanType` | *Optional<String>* | :heavy_minus_sign: | The scan type (progressive or interlaced) | progressive |
| `width` | *Optional<Long>* | :heavy_minus_sign: | The width of the video stream | 1920 |
| `displayTitle` | *Optional<String>* | :heavy_minus_sign: | Display title of the stream | 1080p (H.264) |
| `extendedDisplayTitle` | *Optional<String>* | :heavy_minus_sign: | Extended display title of the stream | 1080p (H.264) |
| `channels` | *Optional<Long>* | :heavy_minus_sign: | Number of audio channels (for audio streams) | 2 |
| `language` | *Optional<String>* | :heavy_minus_sign: | The language of the stream (for audio/subtitle streams) | English |
| `languageTag` | *Optional<String>* | :heavy_minus_sign: | Language tag of the stream | en |
| `languageCode` | *Optional<String>* | :heavy_minus_sign: | Language code of the stream | eng |
| `audioChannelLayout` | *Optional<String>* | :heavy_minus_sign: | The audio channel layout | stereo |
| `samplingRate` | *Optional<Long>* | :heavy_minus_sign: | Sampling rate of the audio stream in Hz | 48000 |
| `title` | *Optional<String>* | :heavy_minus_sign: | Title of the subtitle track (for subtitle streams) | English |
| `canAutoSync` | *Optional<Boolean>* | :heavy_minus_sign: | Indicates if the subtitle stream can auto-sync | false |

View File

@@ -0,0 +1,14 @@
# GetSearchAllLibrariesType
The type of media content
## Values
| Name | Value |
| --------- | --------- |
| `Movie` | movie |
| `TvShow` | show |
| `Season` | season |
| `Episode` | episode |

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesUltraBlurColors
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `topLeft` | *String* | :heavy_check_mark: | N/A | 11333b |
| `topRight` | *String* | :heavy_check_mark: | N/A | 0a232d |
| `bottomRight` | *String* | :heavy_check_mark: | N/A | 73958 |
| `bottomLeft` | *String* | :heavy_check_mark: | N/A | 1f5066 |

View File

@@ -0,0 +1,8 @@
# GetSearchAllLibrariesWriter
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `tag` | *Optional<String>* | :heavy_minus_sign: | N/A | James Cameron |

View File

@@ -3,9 +3,9 @@
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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 |
| `includeIPv6` | [Optional<IncludeIPv6>](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| `clientID` | *Optional<String>* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 |
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `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 |
| `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 |

View File

@@ -10,4 +10,4 @@
| `height` | *long* | :heavy_check_mark: | N/A | 396 |
| `minSize` | *long* | :heavy_check_mark: | N/A | 1 |
| `upscale` | *long* | :heavy_check_mark: | N/A | 1 |
| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |

View File

@@ -3,11 +3,11 @@
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | |
| `clientID` | *Optional<String>* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 |
| `clientName` | *Optional<String>* | :heavy_minus_sign: | N/A | Plex Web |
| `deviceName` | *Optional<String>* | :heavy_minus_sign: | N/A | Linux |
| `clientVersion` | *Optional<String>* | :heavy_minus_sign: | N/A | 4.133.0 |
| `clientPlatform` | *Optional<String>* | :heavy_minus_sign: | N/A | Chrome |
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `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 |
| `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 |
| `clientVersion` | *Optional<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `platform` | *Optional<String>* | :heavy_minus_sign: | The platform of the client application. | Roku |

View File

@@ -1,102 +0,0 @@
# GetTokenDetailsFeatures
## Values
| Name | Value |
| ----------------------------------------- | ----------------------------------------- |
| `ANDROID_DOLBY_VISION` | Android - Dolby Vision |
| `ANDROID_PI_P` | Android - PiP |
| `CU_SUNSET` | CU Sunset |
| `HRK_ENABLE_EUR` | HRK_enable_EUR |
| `TREBLE_SHOW_FEATURES` | TREBLE-show-features |
| `AD_COUNTDOWN_TIMER` | ad-countdown-timer |
| `ADAPTIVE_BITRATE` | adaptive_bitrate |
| `ALBUM_TYPES` | album-types |
| `ALLOW_DVR` | allow_dvr |
| `AMAZON_LOOP_DEBUG` | amazon-loop-debug |
| `AVOD_AD_ANALYSIS` | avod-ad-analysis |
| `AVOD_NEW_MEDIA` | avod-new-media |
| `BLACKLIST_GET_SIGNIN` | blacklist_get_signin |
| `BOOST_VOICES` | boost-voices |
| `CAMERA_UPLOAD` | camera_upload |
| `CLIENT_RADIO_STATIONS` | client-radio-stations |
| `CLOUDFLARE_TURNSTILE_REQUIRED` | cloudflare-turnstile-required |
| `CLOUDSYNC` | cloudsync |
| `COLLECTIONS` | collections |
| `COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS` | comments_and_replies_push_notifications |
| `COMMUNITY_ACCESS_PLEX_TV` | community_access_plex_tv |
| `COMPANIONS_SONOS` | companions_sonos |
| `CONTENT_FILTER` | content_filter |
| `CUSTOM_HOME_REMOVAL` | custom-home-removal |
| `DISABLE_HOME_USER_FRIENDSHIPS` | disable_home_user_friendships |
| `DISABLE_SHARING_FRIENDSHIPS` | disable_sharing_friendships |
| `DOWNLOADS_GATING` | downloads-gating |
| `DRM_SUPPORT` | drm_support |
| `DVR` | dvr |
| `DVR_BLOCK_UNSUPPORTED_COUNTRIES` | dvr-block-unsupported-countries |
| `EPG_RECENT_CHANNELS` | epg-recent-channels |
| `EXCLUDE_RESTRICTIONS` | exclude restrictions |
| `FEDERATED_AUTH` | federated-auth |
| `FRIEND_REQUEST_PUSH_NOTIFICATIONS` | friend_request_push_notifications |
| `GRANDFATHER_SYNC` | grandfather-sync |
| `GUIDED_UPGRADE` | guided-upgrade |
| `HARDWARE_TRANSCODING` | hardware_transcoding |
| `HOME` | home |
| `HWTRANSCODE` | hwtranscode |
| `IMAGGA_V2` | imagga-v2 |
| `INCREASE_PASSWORD_COMPLEXITY` | increase-password-complexity |
| `IOS14_PRIVACY_BANNER` | ios14-privacy-banner |
| `ITERABLE_NOTIFICATION_TOKENS` | iterable-notification-tokens |
| `ITEM_CLUSTERS` | item_clusters |
| `KEEP_PAYMENT_METHOD` | keep-payment-method |
| `KEVIN_BACON` | kevin-bacon |
| `KOREA_CONSENT` | korea-consent |
| `LE_ISRG_ROOT_X1` | le_isrg_root_x1 |
| `LETS_ENCRYPT` | lets_encrypt |
| `LIGHTNING_DVR_PIVOT` | lightning-dvr-pivot |
| `LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS` | live-tv-support-incomplete-segments |
| `LIVETV` | livetv |
| `LYRICS` | lyrics |
| `METADATA_SEARCH` | metadata_search |
| `MUSIC_ANALYSIS` | music-analysis |
| `MUSIC_VIDEOS` | music_videos |
| `NEW_PLEX_PASS_PRICES` | new_plex_pass_prices |
| `NEWS_PROVIDER_SUNSET_MODAL` | news-provider-sunset-modal |
| `NOMINATIM` | nominatim |
| `PASS` | pass |
| `PHOTOS_FAVORITES` | photos-favorites |
| `PHOTOS_METADATA_EDITION` | photos-metadata-edition |
| `PHOTOS_V6_EDIT` | photosV6-edit |
| `PHOTOS_V6_TV_ALBUMS` | photosV6-tv-albums |
| `PMS_HEALTH` | pms_health |
| `PREMIUM_DASHBOARD` | premium-dashboard |
| `PREMIUM_MUSIC_METADATA` | premium_music_metadata |
| `RADIO` | radio |
| `RATE_LIMIT_CLIENT_TOKEN` | rate-limit-client-token |
| `SCROBBLING_SERVICE_PLEX_TV` | scrobbling-service-plex-tv |
| `SESSION_BANDWIDTH_RESTRICTIONS` | session_bandwidth_restrictions |
| `SESSION_KICK` | session_kick |
| `SHARED_SERVER_NOTIFICATION` | shared_server_notification |
| `SHARED_SOURCE_NOTIFICATION` | shared_source_notification |
| `SIGNIN_NOTIFICATION` | signin_notification |
| `SIGNIN_WITH_APPLE` | signin_with_apple |
| `SILENCE_REMOVAL` | silence-removal |
| `SLEEP_TIMER` | sleep-timer |
| `SPRING_SERVE_AD_PROVIDER` | spring_serve_ad_provider |
| `SYNC` | sync |
| `SWEET_FADES` | sweet-fades |
| `TRANSCODER_CACHE` | transcoder_cache |
| `TRAILERS` | trailers |
| `TUNER_SHARING` | tuner-sharing |
| `TWO_FACTOR_AUTHENTICATION` | two-factor-authentication |
| `UNSUPPORTEDTUNERS` | unsupportedtuners |
| `UPGRADE3DS2` | upgrade-3ds2 |
| `VISUALIZERS` | visualizers |
| `VOD_SCHEMA` | vod-schema |
| `VOD_CLOUDFLARE` | vod_cloudflare |
| `VOLUME_LEVELING` | volume-leveling |
| `WATCH_TOGETHER_INVITE` | watch-together-invite |
| `WATCHLIST_RSS` | watchlist-rss |
| `WEB_SERVER_DASHBOARD` | web_server_dashboard |
| `WEBHOOKS` | webhooks |

View File

@@ -5,7 +5,7 @@
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `features` | List<[GetTokenDetailsFeatures](../../models/operations/GetTokenDetailsFeatures.md)> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | |
| `features` | List<*String*> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | |
| `active` | *Optional<Boolean>* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true |
| `subscribedAt` | *JsonNullable<String>* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z |
| `status` | [Optional<GetTokenDetailsAuthenticationResponseStatus>](../../models/operations/GetTokenDetailsAuthenticationResponseStatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive |

View File

@@ -5,5 +5,5 @@
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | [GetTopWatchedContentQueryParamType](../../models/operations/GetTopWatchedContentQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
| `includeGuids` | *Optional<Long>* | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
| `includeGuids` | *Optional<Long>* | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
| `type` | [GetTopWatchedContentQueryParamType](../../models/operations/GetTopWatchedContentQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |

View File

@@ -13,4 +13,4 @@
| `includeExternalMedia` | [Optional<IncludeExternalMedia>](../../models/operations/IncludeExternalMedia.md) | :heavy_minus_sign: | include external media in the results<br/> | |
| `xPlexContainerStart` | *Optional<Integer>* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/>By default this is 0<br/> | 0 |
| `xPlexContainerSize` | *Optional<Integer>* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/>By default this is 50<br/> | 50 |
| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |

View File

@@ -5,5 +5,4 @@
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `id` | *int* | :heavy_check_mark: | N/A | 1 |
| `path` | *String* | :heavy_check_mark: | N/A | /movies |
| `path` | *Optional<String>* | :heavy_minus_sign: | N/A | /TV Shows/House |

View File

@@ -6,19 +6,19 @@
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `id` | *int* | :heavy_check_mark: | N/A | 119534 |
| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 |
| `bitrate` | *int* | :heavy_check_mark: | N/A | 25025 |
| `width` | *int* | :heavy_check_mark: | N/A | 3840 |
| `height` | *int* | :heavy_check_mark: | N/A | 2072 |
| `aspectRatio` | *double* | :heavy_check_mark: | N/A | 1.85 |
| `duration` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 11558112 |
| `bitrate` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 25025 |
| `width` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 3840 |
| `height` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 2072 |
| `aspectRatio` | *Optional<Double>* | :heavy_minus_sign: | N/A | 1.85 |
| `audioProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | dts |
| `audioChannels` | *int* | :heavy_check_mark: | N/A | 6 |
| `audioCodec` | *String* | :heavy_check_mark: | N/A | eac3 |
| `videoCodec` | *String* | :heavy_check_mark: | N/A | hevc |
| `videoResolution` | *String* | :heavy_check_mark: | N/A | 4k |
| `audioChannels` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 6 |
| `audioCodec` | *Optional<String>* | :heavy_minus_sign: | N/A | eac3 |
| `videoCodec` | *Optional<String>* | :heavy_minus_sign: | N/A | hevc |
| `videoResolution` | *Optional<String>* | :heavy_minus_sign: | N/A | 4k |
| `container` | *String* | :heavy_check_mark: | N/A | mkv |
| `videoFrameRate` | *String* | :heavy_check_mark: | N/A | 24p |
| `videoProfile` | *String* | :heavy_check_mark: | N/A | main 10 |
| `videoFrameRate` | *Optional<String>* | :heavy_minus_sign: | N/A | 24p |
| `videoProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | main 10 |
| `hasVoiceActivity` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `optimizedForStreaming` | [Optional<OptimizedForStreaming>](../../models/operations/OptimizedForStreaming.md) | :heavy_minus_sign: | N/A | 1 |
| `has64bitOffsets` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |

View File

@@ -7,14 +7,14 @@
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `id` | *int* | :heavy_check_mark: | N/A | 119542 |
| `key` | *String* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv |
| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 |
| `duration` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 11558112 |
| `file` | *String* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv |
| `size` | *long* | :heavy_check_mark: | N/A | 36158371307 |
| `container` | *String* | :heavy_check_mark: | The container format of the media file.<br/> | mkv |
| `audioProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | dts |
| `has64bitOffsets` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `optimizedForStreaming` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | false |
| `videoProfile` | *String* | :heavy_check_mark: | N/A | main 10 |
| `videoProfile` | *Optional<String>* | :heavy_minus_sign: | N/A | main 10 |
| `indexes` | *Optional<String>* | :heavy_minus_sign: | N/A | sd |
| `hasThumbnail` | [Optional<HasThumbnail>](../../models/operations/HasThumbnail.md) | :heavy_minus_sign: | N/A | 1 |
| `stream` | List<[Stream](../../models/operations/Stream.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -1,102 +0,0 @@
# PostUsersSignInDataAuthenticationFeatures
## Values
| Name | Value |
| ----------------------------------------- | ----------------------------------------- |
| `ANDROID_DOLBY_VISION` | Android - Dolby Vision |
| `ANDROID_PI_P` | Android - PiP |
| `CU_SUNSET` | CU Sunset |
| `HRK_ENABLE_EUR` | HRK_enable_EUR |
| `TREBLE_SHOW_FEATURES` | TREBLE-show-features |
| `AD_COUNTDOWN_TIMER` | ad-countdown-timer |
| `ADAPTIVE_BITRATE` | adaptive_bitrate |
| `ALBUM_TYPES` | album-types |
| `ALLOW_DVR` | allow_dvr |
| `AMAZON_LOOP_DEBUG` | amazon-loop-debug |
| `AVOD_AD_ANALYSIS` | avod-ad-analysis |
| `AVOD_NEW_MEDIA` | avod-new-media |
| `BLACKLIST_GET_SIGNIN` | blacklist_get_signin |
| `BOOST_VOICES` | boost-voices |
| `CAMERA_UPLOAD` | camera_upload |
| `CLIENT_RADIO_STATIONS` | client-radio-stations |
| `CLOUDFLARE_TURNSTILE_REQUIRED` | cloudflare-turnstile-required |
| `CLOUDSYNC` | cloudsync |
| `COLLECTIONS` | collections |
| `COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS` | comments_and_replies_push_notifications |
| `COMMUNITY_ACCESS_PLEX_TV` | community_access_plex_tv |
| `COMPANIONS_SONOS` | companions_sonos |
| `CONTENT_FILTER` | content_filter |
| `CUSTOM_HOME_REMOVAL` | custom-home-removal |
| `DISABLE_HOME_USER_FRIENDSHIPS` | disable_home_user_friendships |
| `DISABLE_SHARING_FRIENDSHIPS` | disable_sharing_friendships |
| `DOWNLOADS_GATING` | downloads-gating |
| `DRM_SUPPORT` | drm_support |
| `DVR` | dvr |
| `DVR_BLOCK_UNSUPPORTED_COUNTRIES` | dvr-block-unsupported-countries |
| `EPG_RECENT_CHANNELS` | epg-recent-channels |
| `EXCLUDE_RESTRICTIONS` | exclude restrictions |
| `FEDERATED_AUTH` | federated-auth |
| `FRIEND_REQUEST_PUSH_NOTIFICATIONS` | friend_request_push_notifications |
| `GRANDFATHER_SYNC` | grandfather-sync |
| `GUIDED_UPGRADE` | guided-upgrade |
| `HARDWARE_TRANSCODING` | hardware_transcoding |
| `HOME` | home |
| `HWTRANSCODE` | hwtranscode |
| `IMAGGA_V2` | imagga-v2 |
| `INCREASE_PASSWORD_COMPLEXITY` | increase-password-complexity |
| `IOS14_PRIVACY_BANNER` | ios14-privacy-banner |
| `ITERABLE_NOTIFICATION_TOKENS` | iterable-notification-tokens |
| `ITEM_CLUSTERS` | item_clusters |
| `KEEP_PAYMENT_METHOD` | keep-payment-method |
| `KEVIN_BACON` | kevin-bacon |
| `KOREA_CONSENT` | korea-consent |
| `LE_ISRG_ROOT_X1` | le_isrg_root_x1 |
| `LETS_ENCRYPT` | lets_encrypt |
| `LIGHTNING_DVR_PIVOT` | lightning-dvr-pivot |
| `LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS` | live-tv-support-incomplete-segments |
| `LIVETV` | livetv |
| `LYRICS` | lyrics |
| `METADATA_SEARCH` | metadata_search |
| `MUSIC_ANALYSIS` | music-analysis |
| `MUSIC_VIDEOS` | music_videos |
| `NEW_PLEX_PASS_PRICES` | new_plex_pass_prices |
| `NEWS_PROVIDER_SUNSET_MODAL` | news-provider-sunset-modal |
| `NOMINATIM` | nominatim |
| `PASS` | pass |
| `PHOTOS_FAVORITES` | photos-favorites |
| `PHOTOS_METADATA_EDITION` | photos-metadata-edition |
| `PHOTOS_V6_EDIT` | photosV6-edit |
| `PHOTOS_V6_TV_ALBUMS` | photosV6-tv-albums |
| `PMS_HEALTH` | pms_health |
| `PREMIUM_DASHBOARD` | premium-dashboard |
| `PREMIUM_MUSIC_METADATA` | premium_music_metadata |
| `RADIO` | radio |
| `RATE_LIMIT_CLIENT_TOKEN` | rate-limit-client-token |
| `SCROBBLING_SERVICE_PLEX_TV` | scrobbling-service-plex-tv |
| `SESSION_BANDWIDTH_RESTRICTIONS` | session_bandwidth_restrictions |
| `SESSION_KICK` | session_kick |
| `SHARED_SERVER_NOTIFICATION` | shared_server_notification |
| `SHARED_SOURCE_NOTIFICATION` | shared_source_notification |
| `SIGNIN_NOTIFICATION` | signin_notification |
| `SIGNIN_WITH_APPLE` | signin_with_apple |
| `SILENCE_REMOVAL` | silence-removal |
| `SLEEP_TIMER` | sleep-timer |
| `SPRING_SERVE_AD_PROVIDER` | spring_serve_ad_provider |
| `SYNC` | sync |
| `SWEET_FADES` | sweet-fades |
| `TRANSCODER_CACHE` | transcoder_cache |
| `TRAILERS` | trailers |
| `TUNER_SHARING` | tuner-sharing |
| `TWO_FACTOR_AUTHENTICATION` | two-factor-authentication |
| `UNSUPPORTEDTUNERS` | unsupportedtuners |
| `UPGRADE3DS2` | upgrade-3ds2 |
| `VISUALIZERS` | visualizers |
| `VOD_SCHEMA` | vod-schema |
| `VOD_CLOUDFLARE` | vod_cloudflare |
| `VOLUME_LEVELING` | volume-leveling |
| `WATCH_TOGETHER_INVITE` | watch-together-invite |
| `WATCHLIST_RSS` | watchlist-rss |
| `WEB_SERVER_DASHBOARD` | web_server_dashboard |
| `WEBHOOKS` | webhooks |

View File

@@ -5,7 +5,7 @@
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `features` | List<[PostUsersSignInDataAuthenticationFeatures](../../models/operations/PostUsersSignInDataAuthenticationFeatures.md)> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | |
| `features` | List<*String*> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | |
| `active` | *Optional<Boolean>* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true |
| `subscribedAt` | *JsonNullable<String>* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z |
| `status` | [Optional<PostUsersSignInDataAuthenticationResponseStatus>](../../models/operations/PostUsersSignInDataAuthenticationResponseStatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive |

View File

@@ -1,102 +0,0 @@
# PostUsersSignInDataFeatures
## Values
| Name | Value |
| ----------------------------------------- | ----------------------------------------- |
| `ANDROID_DOLBY_VISION` | Android - Dolby Vision |
| `ANDROID_PI_P` | Android - PiP |
| `CU_SUNSET` | CU Sunset |
| `HRK_ENABLE_EUR` | HRK_enable_EUR |
| `TREBLE_SHOW_FEATURES` | TREBLE-show-features |
| `AD_COUNTDOWN_TIMER` | ad-countdown-timer |
| `ADAPTIVE_BITRATE` | adaptive_bitrate |
| `ALBUM_TYPES` | album-types |
| `ALLOW_DVR` | allow_dvr |
| `AMAZON_LOOP_DEBUG` | amazon-loop-debug |
| `AVOD_AD_ANALYSIS` | avod-ad-analysis |
| `AVOD_NEW_MEDIA` | avod-new-media |
| `BLACKLIST_GET_SIGNIN` | blacklist_get_signin |
| `BOOST_VOICES` | boost-voices |
| `CAMERA_UPLOAD` | camera_upload |
| `CLIENT_RADIO_STATIONS` | client-radio-stations |
| `CLOUDFLARE_TURNSTILE_REQUIRED` | cloudflare-turnstile-required |
| `CLOUDSYNC` | cloudsync |
| `COLLECTIONS` | collections |
| `COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS` | comments_and_replies_push_notifications |
| `COMMUNITY_ACCESS_PLEX_TV` | community_access_plex_tv |
| `COMPANIONS_SONOS` | companions_sonos |
| `CONTENT_FILTER` | content_filter |
| `CUSTOM_HOME_REMOVAL` | custom-home-removal |
| `DISABLE_HOME_USER_FRIENDSHIPS` | disable_home_user_friendships |
| `DISABLE_SHARING_FRIENDSHIPS` | disable_sharing_friendships |
| `DOWNLOADS_GATING` | downloads-gating |
| `DRM_SUPPORT` | drm_support |
| `DVR` | dvr |
| `DVR_BLOCK_UNSUPPORTED_COUNTRIES` | dvr-block-unsupported-countries |
| `EPG_RECENT_CHANNELS` | epg-recent-channels |
| `EXCLUDE_RESTRICTIONS` | exclude restrictions |
| `FEDERATED_AUTH` | federated-auth |
| `FRIEND_REQUEST_PUSH_NOTIFICATIONS` | friend_request_push_notifications |
| `GRANDFATHER_SYNC` | grandfather-sync |
| `GUIDED_UPGRADE` | guided-upgrade |
| `HARDWARE_TRANSCODING` | hardware_transcoding |
| `HOME` | home |
| `HWTRANSCODE` | hwtranscode |
| `IMAGGA_V2` | imagga-v2 |
| `INCREASE_PASSWORD_COMPLEXITY` | increase-password-complexity |
| `IOS14_PRIVACY_BANNER` | ios14-privacy-banner |
| `ITERABLE_NOTIFICATION_TOKENS` | iterable-notification-tokens |
| `ITEM_CLUSTERS` | item_clusters |
| `KEEP_PAYMENT_METHOD` | keep-payment-method |
| `KEVIN_BACON` | kevin-bacon |
| `KOREA_CONSENT` | korea-consent |
| `LE_ISRG_ROOT_X1` | le_isrg_root_x1 |
| `LETS_ENCRYPT` | lets_encrypt |
| `LIGHTNING_DVR_PIVOT` | lightning-dvr-pivot |
| `LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS` | live-tv-support-incomplete-segments |
| `LIVETV` | livetv |
| `LYRICS` | lyrics |
| `METADATA_SEARCH` | metadata_search |
| `MUSIC_ANALYSIS` | music-analysis |
| `MUSIC_VIDEOS` | music_videos |
| `NEW_PLEX_PASS_PRICES` | new_plex_pass_prices |
| `NEWS_PROVIDER_SUNSET_MODAL` | news-provider-sunset-modal |
| `NOMINATIM` | nominatim |
| `PASS` | pass |
| `PHOTOS_FAVORITES` | photos-favorites |
| `PHOTOS_METADATA_EDITION` | photos-metadata-edition |
| `PHOTOS_V6_EDIT` | photosV6-edit |
| `PHOTOS_V6_TV_ALBUMS` | photosV6-tv-albums |
| `PMS_HEALTH` | pms_health |
| `PREMIUM_DASHBOARD` | premium-dashboard |
| `PREMIUM_MUSIC_METADATA` | premium_music_metadata |
| `RADIO` | radio |
| `RATE_LIMIT_CLIENT_TOKEN` | rate-limit-client-token |
| `SCROBBLING_SERVICE_PLEX_TV` | scrobbling-service-plex-tv |
| `SESSION_BANDWIDTH_RESTRICTIONS` | session_bandwidth_restrictions |
| `SESSION_KICK` | session_kick |
| `SHARED_SERVER_NOTIFICATION` | shared_server_notification |
| `SHARED_SOURCE_NOTIFICATION` | shared_source_notification |
| `SIGNIN_NOTIFICATION` | signin_notification |
| `SIGNIN_WITH_APPLE` | signin_with_apple |
| `SILENCE_REMOVAL` | silence-removal |
| `SLEEP_TIMER` | sleep-timer |
| `SPRING_SERVE_AD_PROVIDER` | spring_serve_ad_provider |
| `SYNC` | sync |
| `SWEET_FADES` | sweet-fades |
| `TRANSCODER_CACHE` | transcoder_cache |
| `TRAILERS` | trailers |
| `TUNER_SHARING` | tuner-sharing |
| `TWO_FACTOR_AUTHENTICATION` | two-factor-authentication |
| `UNSUPPORTEDTUNERS` | unsupportedtuners |
| `UPGRADE3DS2` | upgrade-3ds2 |
| `VISUALIZERS` | visualizers |
| `VOD_SCHEMA` | vod-schema |
| `VOD_CLOUDFLARE` | vod_cloudflare |
| `VOLUME_LEVELING` | volume-leveling |
| `WATCH_TOGETHER_INVITE` | watch-together-invite |
| `WATCHLIST_RSS` | watchlist-rss |
| `WEB_SERVER_DASHBOARD` | web_server_dashboard |
| `WEBHOOKS` | webhooks |

View File

@@ -3,11 +3,11 @@
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientID` | *Optional<String>* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 |
| `clientName` | *Optional<String>* | :heavy_minus_sign: | N/A | Plex Web |
| `deviceName` | *Optional<String>* | :heavy_minus_sign: | N/A | Linux |
| `clientVersion` | *Optional<String>* | :heavy_minus_sign: | N/A | 4.133.0 |
| `clientPlatform` | *Optional<String>* | :heavy_minus_sign: | N/A | Chrome |
| `requestBody` | [Optional<PostUsersSignInDataRequestBody>](../../models/operations/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | |
| 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 |
| `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 |
| `clientVersion` | *Optional<String>* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `platform` | *Optional<String>* | :heavy_minus_sign: | The platform of the client application. | Roku |
| `requestBody` | [Optional<PostUsersSignInDataRequestBody>](../../models/operations/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | |

View File

@@ -7,7 +7,7 @@ If the accounts Plex Pass subscription is active
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `features` | List<[PostUsersSignInDataFeatures](../../models/operations/PostUsersSignInDataFeatures.md)> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | |
| `features` | List<*String*> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | |
| `active` | *Optional<Boolean>* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true |
| `subscribedAt` | *JsonNullable<String>* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z |
| `status` | [Optional<PostUsersSignInDataAuthenticationStatus>](../../models/operations/PostUsersSignInDataAuthenticationStatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive |

View File

@@ -0,0 +1,11 @@
# QueryParamIncludeCollections
Whether to include collections in the search results.
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,11 @@
# QueryParamIncludeExternalMedia
Whether to include external media in the search results.
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,9 @@
# SearchResult
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `score` | *float* | :heavy_check_mark: | N/A |
| `metadata` | [GetSearchAllLibrariesMetadata](../../models/operations/GetSearchAllLibrariesMetadata.md) | :heavy_check_mark: | N/A |

View File

@@ -0,0 +1,12 @@
# SearchTypes
## Values
| Name | Value |
| -------------- | -------------- |
| `MOVIES` | movies |
| `MUSIC` | music |
| `OTHER_VIDEOS` | otherVideos |
| `PEOPLE` | people |
| `TV` | tv |

View File

@@ -7,7 +7,7 @@ If the accounts Plex Pass subscription is active
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `features` | List<[Features](../../models/operations/Features.md)> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | |
| `features` | List<*String*> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | |
| `active` | *Optional<Boolean>* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true |
| `subscribedAt` | *JsonNullable<String>* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z |
| `status` | [Optional<GetTokenDetailsAuthenticationStatus>](../../models/operations/GetTokenDetailsAuthenticationStatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive |

View File

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

View File

@@ -37,11 +37,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetTransientTokenResponse res = sdk.authentication().getTransientToken()
@@ -96,11 +96,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation()
@@ -151,11 +151,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetTokenDetailsResponse res = sdk.authentication().getTokenDetails()
@@ -208,11 +208,11 @@ public class Application {
public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder()

View File

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

View File

@@ -34,11 +34,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
@@ -95,11 +95,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder()
@@ -161,11 +161,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()

View File

@@ -16,6 +16,7 @@ API Calls interacting with Plex Media Server Libraries
* [getLibraryItems](#getlibraryitems) - Get Library Items
* [getRefreshLibraryMetadata](#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
* [getSearchLibrary](#getsearchlibrary) - Search Library
* [getSearchAllLibraries](#getsearchalllibraries) - Search All Libraries
* [getMetaDataByRatingKey](#getmetadatabyratingkey) - Get Metadata by RatingKey
* [getMetadataChildren](#getmetadatachildren) - Get Items Children
* [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content
@@ -42,11 +43,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetFileHashResponse res = sdk.library().getFileHash()
@@ -104,11 +105,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder()
@@ -189,11 +190,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetAllLibrariesResponse res = sdk.library().getAllLibraries()
@@ -279,16 +280,16 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
.sectionKey(9518)
.includeDetails(IncludeDetails.ZERO)
.sectionKey(9518)
.call();
if (res.object().isPresent()) {
@@ -302,8 +303,8 @@ public class Application {
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| `includeDetails` | [Optional<IncludeDetails>](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
### Response
@@ -338,11 +339,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
DeleteLibraryResponse res = sdk.library().deleteLibrary()
@@ -418,16 +419,16 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetLibraryItemsRequest req = GetLibraryItemsRequest.builder()
.sectionKey(9518)
.tag(Tag.EDITION)
.sectionKey(9518)
.includeGuids(IncludeGuids.Enable)
.type(GetLibraryItemsQueryParamType.TvShow)
.includeMeta(GetLibraryItemsQueryParamIncludeMeta.Enable)
@@ -487,16 +488,16 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata()
.sectionKey(9518)
.force(Force.ONE)
.sectionKey(9518)
.call();
// handle response
@@ -508,8 +509,8 @@ public class Application {
| Parameter | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| `force` | [Optional<Force>](../../models/operations/Force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
### Response
@@ -563,11 +564,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetSearchLibraryResponse res = sdk.library().getSearchLibrary()
@@ -601,6 +602,77 @@ public class Application {
| models/errors/GetSearchLibraryUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSearchAllLibraries
Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.
### Example Usage
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesBadRequest;
import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesUnauthorized;
import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequest;
import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponse;
import dev.plexapi.sdk.models.operations.QueryParamIncludeCollections;
import dev.plexapi.sdk.models.operations.QueryParamIncludeExternalMedia;
import dev.plexapi.sdk.models.operations.SearchTypes;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws GetSearchAllLibrariesBadRequest, GetSearchAllLibrariesUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.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();
GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder()
.query("<value>")
.searchTypes(List.of(
SearchTypes.PEOPLE))
.includeCollections(QueryParamIncludeCollections.Enable)
.includeExternalMedia(QueryParamIncludeExternalMedia.Enable)
.build();
GetSearchAllLibrariesResponse res = sdk.library().getSearchAllLibraries()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `request` | [GetSearchAllLibrariesRequest](../../models/operations/GetSearchAllLibrariesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetSearchAllLibrariesResponse](../../models/operations/GetSearchAllLibrariesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| models/errors/GetSearchAllLibrariesBadRequest | 400 | application/json |
| models/errors/GetSearchAllLibrariesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getMetaDataByRatingKey
This endpoint will return the metadata of a library item specified with the ratingKey.
@@ -623,11 +695,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey()
@@ -681,11 +753,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
@@ -742,16 +814,16 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent()
.type(GetTopWatchedContentQueryParamType.TvShow)
.includeGuids(1L)
.type(GetTopWatchedContentQueryParamType.TvShow)
.call();
if (res.object().isPresent()) {
@@ -765,8 +837,8 @@ public class Application {
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | [GetTopWatchedContentQueryParamType](../../models/operations/GetTopWatchedContentQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
| `includeGuids` | *Optional<Long>* | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
| `type` | [GetTopWatchedContentQueryParamType](../../models/operations/GetTopWatchedContentQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
### Response
@@ -802,11 +874,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetOnDeckResponse res = sdk.library().getOnDeck()

View File

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

View File

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

View File

@@ -48,11 +48,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
CreatePlaylistRequest req = CreatePlaylistRequest.builder()
@@ -114,11 +114,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetPlaylistsResponse res = sdk.playlists().getPlaylists()
@@ -175,11 +175,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetPlaylistResponse res = sdk.playlists().getPlaylist()
@@ -233,11 +233,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
DeletePlaylistResponse res = sdk.playlists().deletePlaylist()
@@ -289,11 +289,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
@@ -353,11 +353,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents()
@@ -413,11 +413,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents()
@@ -470,11 +470,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents()
@@ -533,11 +533,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
UploadPlaylistResponse res = sdk.playlists().uploadPlaylist()

View File

@@ -37,11 +37,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
@@ -93,11 +93,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetUserFriendsResponse res = sdk.plex().getUserFriends()
@@ -148,11 +148,11 @@ public class Application {
public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetGeoDataResponse res = sdk.plex().getGeoData()
@@ -204,11 +204,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetHomeDataResponse res = sdk.plex().getHomeData()
@@ -257,18 +257,18 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerResourcesResponse res = sdk.plex().getServerResources()
.includeHttps(IncludeHttps.Enable)
.includeRelay(IncludeRelay.Enable)
.includeIPv6(IncludeIPv6.Enable)
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.call();
if (res.plexDevices().isPresent()) {
@@ -280,13 +280,13 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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 |
| `includeIPv6` | [Optional<IncludeIPv6>](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| `clientID` | *Optional<String>* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `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 |
| `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 |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
### Response
@@ -320,11 +320,11 @@ public class Application {
public static void main(String[] args) throws GetPinBadRequest, Exception {
PlexAPI sdk = PlexAPI.builder()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetPinRequest req = GetPinRequest.builder()
@@ -380,11 +380,11 @@ public class Application {
public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception {
PlexAPI sdk = PlexAPI.builder()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder()

View File

@@ -25,4 +25,4 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -

View File

@@ -45,11 +45,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
PerformSearchResponse res = sdk.search().performSearch()
@@ -108,11 +108,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
@@ -167,11 +167,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetSearchResultsResponse res = sdk.search().getSearchResults()

View File

@@ -39,11 +39,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
@@ -89,11 +89,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerPreferencesResponse res = sdk.server().getServerPreferences()
@@ -139,11 +139,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetAvailableClientsResponse res = sdk.server().getAvailableClients()
@@ -189,11 +189,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetDevicesResponse res = sdk.server().getDevices()
@@ -237,11 +237,11 @@ public class Application {
public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception {
PlexAPI sdk = PlexAPI.builder()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerIdentityResponse res = sdk.server().getServerIdentity()
@@ -286,11 +286,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount()
@@ -340,11 +340,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetResizedPhotoRequest req = GetResizedPhotoRequest.builder()
@@ -405,11 +405,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetMediaProvidersResponse res = sdk.server().getMediaProviders()
@@ -425,9 +425,9 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |
### Response
@@ -462,11 +462,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetServerListResponse res = sdk.server().getServerList()

View File

@@ -34,11 +34,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetSessionsResponse res = sdk.sessions().getSessions()
@@ -85,11 +85,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
@@ -149,11 +149,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions()
@@ -199,11 +199,11 @@ public class Application {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.clientVersion("2.4.1")
.platform("Roku")
.deviceNickname("Roku 3")
.build();
StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession()

View File

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

View File

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

View File

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

View File

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

View File

@@ -17,19 +17,27 @@ import dev.plexapi.sdk.models.operations.GetServerActivitiesRequestBuilder;
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse;
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Options;
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
import dev.plexapi.sdk.utils.Retries;
import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
@@ -68,6 +76,22 @@ public class Activities implements
* @throws Exception if the API call fails
*/
public GetServerActivitiesResponse getServerActivitiesDirect() throws Exception {
return getServerActivities(Optional.empty());
}
/**
* Get Server Activities
* Get Server Activities
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetServerActivitiesResponse getServerActivities(
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -83,45 +107,62 @@ public class Activities implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -217,6 +258,24 @@ public class Activities implements
*/
public CancelServerActivitiesResponse cancelServerActivities(
String activityUUID) throws Exception {
return cancelServerActivities(activityUUID, Optional.empty());
}
/**
* Cancel Server Activities
* Cancel Server Activities
* @param activityUUID The UUID of the activity to cancel.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public CancelServerActivitiesResponse cancelServerActivities(
String activityUUID,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
CancelServerActivitiesRequest request =
CancelServerActivitiesRequest
.builder()
@@ -240,45 +299,62 @@ public class Activities implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"cancelServerActivities",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")

View File

@@ -30,11 +30,16 @@ import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse;
import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.models.operations.Scope;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Options;
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
import dev.plexapi.sdk.utils.Retries;
import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.SerializedBody;
import dev.plexapi.sdk.utils.Utils.JsonShape;
import dev.plexapi.sdk.utils.Utils;
@@ -44,9 +49,12 @@ import java.lang.Object;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* API Calls regarding authentication for Plex Media Server
@@ -101,6 +109,27 @@ public class Authentication implements
public GetTransientTokenResponse getTransientToken(
GetTransientTokenQueryParamType type,
Scope scope) throws Exception {
return getTransientToken(type, scope, Optional.empty());
}
/**
* Get a Transient Token
* This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
*
* @param type `delegation` - This is the only supported `type` parameter.
* @param scope `all` - This is the only supported `scope` parameter.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetTransientTokenResponse getTransientToken(
GetTransientTokenQueryParamType type,
Scope scope,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
GetTransientTokenRequest request =
GetTransientTokenRequest
.builder()
@@ -128,45 +157,62 @@ public class Authentication implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTransientToken",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -255,6 +301,26 @@ public class Authentication implements
*/
public GetSourceConnectionInformationResponse getSourceConnectionInformation(
String source) throws Exception {
return getSourceConnectionInformation(source, Optional.empty());
}
/**
* Get Source Connection Information
* If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
* Note: requires Plex Media Server &gt;= 1.15.4.
*
* @param source The source identifier with an included prefix.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetSourceConnectionInformationResponse getSourceConnectionInformation(
String source,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
GetSourceConnectionInformationRequest request =
GetSourceConnectionInformationRequest
.builder()
@@ -281,45 +347,62 @@ public class Authentication implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getSourceConnectionInformation",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -402,18 +485,24 @@ public class Authentication implements
* @throws Exception if the API call fails
*/
public GetTokenDetailsResponse getTokenDetailsDirect() throws Exception {
return getTokenDetails(Optional.empty());
return getTokenDetails(Optional.empty(), Optional.empty());
}
/**
* Get Token Details
* Get the User data from the provided X-Plex-Token
* @param serverURL Overrides the server URL.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetTokenDetailsResponse getTokenDetails(
Optional<String> serverURL) throws Exception {
Optional<String> serverURL,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(GET_TOKEN_DETAILS_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
@@ -431,45 +520,62 @@ public class Authentication implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getTokenDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTokenDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTokenDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTokenDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getTokenDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTokenDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTokenDetails",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -565,7 +671,7 @@ public class Authentication implements
*/
public PostUsersSignInDataResponse postUsersSignInData(
PostUsersSignInDataRequest request) throws Exception {
return postUsersSignInData(request, Optional.empty());
return postUsersSignInData(request, Optional.empty(), Optional.empty());
}
/**
@@ -573,12 +679,18 @@ public class Authentication implements
* Sign in user with username and password and return user data with Plex authentication token
* @param request The request object containing all of the parameters for the API call.
* @param serverURL Overrides the server URL.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public PostUsersSignInDataResponse postUsersSignInData(
PostUsersSignInDataRequest request,
Optional<String> serverURL) throws Exception {
Optional<String> serverURL,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(POST_USERS_SIGN_IN_DATA_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
@@ -601,52 +713,65 @@ public class Authentication implements
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
SDKConfiguration.USER_AGENT);
_req.addQueryParams(Utils.getQueryParams(
PostUsersSignInDataRequest.class,
request,
this.sdkConfiguration.globals));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"post-users-sign-in-data",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")

View File

@@ -32,19 +32,27 @@ import dev.plexapi.sdk.models.operations.StopTaskRequest;
import dev.plexapi.sdk.models.operations.StopTaskRequestBuilder;
import dev.plexapi.sdk.models.operations.StopTaskResponse;
import dev.plexapi.sdk.models.operations.TaskName;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Options;
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
import dev.plexapi.sdk.utils.Retries;
import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* Butler is the task manager of the Plex Media Server Ecosystem.
@@ -80,6 +88,22 @@ public class Butler implements
* @throws Exception if the API call fails
*/
public GetButlerTasksResponse getButlerTasksDirect() throws Exception {
return getButlerTasks(Optional.empty());
}
/**
* Get Butler tasks
* Returns a list of butler tasks
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetButlerTasksResponse getButlerTasks(
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -95,45 +119,62 @@ public class Butler implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getButlerTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -237,6 +278,27 @@ public class Butler implements
* @throws Exception if the API call fails
*/
public StartAllTasksResponse startAllTasksDirect() throws Exception {
return startAllTasks(Optional.empty());
}
/**
* Start all Butler tasks
* This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
* 1. Any tasks not scheduled to run on the current day will be skipped.
* 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
* 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
* 4. If we are outside the configured window, the task will start immediately.
*
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public StartAllTasksResponse startAllTasks(
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -252,45 +314,62 @@ public class Butler implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"startAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -375,6 +454,23 @@ public class Butler implements
* @throws Exception if the API call fails
*/
public StopAllTasksResponse stopAllTasksDirect() throws Exception {
return stopAllTasks(Optional.empty());
}
/**
* Stop all Butler tasks
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
*
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public StopAllTasksResponse stopAllTasks(
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -390,45 +486,62 @@ public class Butler implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"stopAllTasks",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -523,6 +636,29 @@ public class Butler implements
*/
public StartTaskResponse startTask(
TaskName taskName) throws Exception {
return startTask(taskName, Optional.empty());
}
/**
* Start a single Butler task
* This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
* 1. Any tasks not scheduled to run on the current day will be skipped.
* 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
* 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
* 4. If we are outside the configured window, the task will start immediately.
*
* @param taskName the name of the task to be started.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public StartTaskResponse startTask(
TaskName taskName,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
StartTaskRequest request =
StartTaskRequest
.builder()
@@ -546,45 +682,62 @@ public class Butler implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"startTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -671,6 +824,25 @@ public class Butler implements
*/
public StopTaskResponse stopTask(
PathParamTaskName taskName) throws Exception {
return stopTask(taskName, Optional.empty());
}
/**
* Stop a single Butler task
* This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
*
* @param taskName The name of the task to be started.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public StopTaskResponse stopTask(
PathParamTaskName taskName,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
StopTaskRequest request =
StopTaskRequest
.builder()
@@ -694,45 +866,62 @@ public class Butler implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"stopTask",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")

View File

@@ -25,11 +25,16 @@ import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponseBody;
import dev.plexapi.sdk.models.operations.OnlyTransient;
import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Options;
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
import dev.plexapi.sdk.utils.Retries;
import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Double;
@@ -37,8 +42,11 @@ import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
@@ -72,7 +80,7 @@ public class Hubs implements
* @throws Exception if the API call fails
*/
public GetGlobalHubsResponse getGlobalHubsDirect() throws Exception {
return getGlobalHubs(Optional.empty(), Optional.empty());
return getGlobalHubs(Optional.empty(), Optional.empty(), Optional.empty());
}
/**
@@ -80,12 +88,18 @@ public class Hubs implements
* Get Global Hubs filtered by the parameters provided.
* @param count The number of items to return with each hub.
* @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetGlobalHubsResponse getGlobalHubs(
Optional<Double> count,
Optional<? extends OnlyTransient> onlyTransient) throws Exception {
Optional<? extends OnlyTransient> onlyTransient,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
GetGlobalHubsRequest request =
GetGlobalHubsRequest
.builder()
@@ -113,45 +127,62 @@ public class Hubs implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getGlobalHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -249,6 +280,25 @@ public class Hubs implements
*/
public GetRecentlyAddedResponse getRecentlyAdded(
GetRecentlyAddedRequest request) throws Exception {
return getRecentlyAdded(request, Optional.empty());
}
/**
* Get Recently Added
* This endpoint will return the recently added content.
*
* @param request The request object containing all of the parameters for the API call.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetRecentlyAddedResponse getRecentlyAdded(
GetRecentlyAddedRequest request,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -269,45 +319,62 @@ public class Hubs implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-recently-added",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-recently-added",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-recently-added",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-recently-added",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-recently-added",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-recently-added",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-recently-added",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -373,7 +440,7 @@ public class Hubs implements
*/
public GetLibraryHubsResponse getLibraryHubs(
double sectionId) throws Exception {
return getLibraryHubs(sectionId, Optional.empty(), Optional.empty());
return getLibraryHubs(sectionId, Optional.empty(), Optional.empty(), Optional.empty());
}
/**
@@ -383,13 +450,19 @@ public class Hubs implements
* @param sectionId the Id of the library to query
* @param count The number of items to return with each hub.
* @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetLibraryHubsResponse getLibraryHubs(
double sectionId,
Optional<Double> count,
Optional<? extends QueryParamOnlyTransient> onlyTransient) throws Exception {
Optional<? extends QueryParamOnlyTransient> onlyTransient,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
GetLibraryHubsRequest request =
GetLibraryHubsRequest
.builder()
@@ -420,45 +493,62 @@ public class Hubs implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getLibraryHubs",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")

File diff suppressed because it is too large Load Diff

View File

@@ -21,11 +21,16 @@ import dev.plexapi.sdk.models.operations.LogLineResponse;
import dev.plexapi.sdk.models.operations.LogMultiLineRequestBuilder;
import dev.plexapi.sdk.models.operations.LogMultiLineResponse;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Options;
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
import dev.plexapi.sdk.utils.Retries;
import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.SerializedBody;
import dev.plexapi.sdk.utils.Utils.JsonShape;
import dev.plexapi.sdk.utils.Utils;
@@ -35,8 +40,11 @@ import java.lang.Object;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* Submit logs to the Log Handler for Plex Media Server
@@ -84,6 +92,35 @@ public class Log implements
Level level,
String message,
String source) throws Exception {
return logLine(level, message, source, Optional.empty());
}
/**
* Logging a single line message.
* This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
*
* @param level An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose
* @param message The text of the message to write to the log.
* @param source a string indicating the source of the message.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public LogLineResponse logLine(
Level level,
String message,
String source,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
LogLineRequest request =
LogLineRequest
.builder()
@@ -112,45 +149,62 @@ public class Log implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"logLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -277,6 +331,45 @@ public class Log implements
*/
public LogMultiLineResponse logMultiLine(
String request) throws Exception {
return logMultiLine(request, Optional.empty());
}
/**
* Logging a multi-line message
* This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
* It accepts a text/plain request body, where each line represents a distinct log entry.
* Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
*
* Log entries are separated by a newline character (`\n`).
* Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
* This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
*
* The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
* - `0`: Error - Critical issues that require immediate attention.
* - `1`: Warning - Important events that are not critical but may indicate potential issues.
* - `2`: Info - General informational messages about system operation.
* - `3`: Debug - Detailed information useful for debugging purposes.
* - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
*
* The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
*
* Example of a single log entry format:
* `level=4&amp;message=Sample%20log%20entry&amp;source=applicationName`
*
* Ensure each parameter is properly URL-encoded to avoid interpretation issues.
*
* @param request The request object containing all of the parameters for the API call.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public LogMultiLineResponse logMultiLine(
String request,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -305,45 +398,62 @@ public class Log implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"logMultiLine",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -428,6 +538,23 @@ public class Log implements
* @throws Exception if the API call fails
*/
public EnablePaperTrailResponse enablePaperTrailDirect() throws Exception {
return enablePaperTrail(Optional.empty());
}
/**
* Enabling Papertrail
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
*
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public EnablePaperTrailResponse enablePaperTrail(
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -443,45 +570,62 @@ public class Log implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"enablePaperTrail",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")

View File

@@ -32,19 +32,27 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest;
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequestBuilder;
import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Options;
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
import dev.plexapi.sdk.utils.Retries;
import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* API Calls interacting with Plex Media Server Media
@@ -82,6 +90,24 @@ public class Media implements
*/
public MarkPlayedResponse markPlayed(
double key) throws Exception {
return markPlayed(key, Optional.empty());
}
/**
* Mark Media Played
* This will mark the provided media key as Played.
* @param key The media key to mark as played
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public MarkPlayedResponse markPlayed(
double key,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
MarkPlayedRequest request =
MarkPlayedRequest
.builder()
@@ -108,45 +134,62 @@ public class Media implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"markPlayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -231,6 +274,24 @@ public class Media implements
*/
public MarkUnplayedResponse markUnplayed(
double key) throws Exception {
return markUnplayed(key, Optional.empty());
}
/**
* Mark Media Unplayed
* This will mark the provided media key as Unplayed.
* @param key The media key to mark as Unplayed
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public MarkUnplayedResponse markUnplayed(
double key,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
MarkUnplayedRequest request =
MarkUnplayedRequest
.builder()
@@ -257,45 +318,62 @@ public class Media implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"markUnplayed",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -386,6 +464,29 @@ public class Media implements
String key,
double time,
String state) throws Exception {
return updatePlayProgress(key, time, state, Optional.empty());
}
/**
* Update Media Play Progress
* This API command can be used to update the play progress of a media item.
*
* @param key the media key
* @param time The time, in milliseconds, used to set the media playback progress.
* @param state The playback state of the media item.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public UpdatePlayProgressResponse updatePlayProgress(
String key,
double time,
String state,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
UpdatePlayProgressRequest request =
UpdatePlayProgressRequest
.builder()
@@ -414,45 +515,62 @@ public class Media implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"updatePlayProgress",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -537,6 +655,24 @@ public class Media implements
*/
public GetBannerImageResponse getBannerImage(
GetBannerImageRequest request) throws Exception {
return getBannerImage(request, Optional.empty());
}
/**
* Get Banner Image
* Gets the banner image of the media item
* @param request The request object containing all of the parameters for the API call.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetBannerImageResponse getBannerImage(
GetBannerImageRequest request,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -554,50 +690,68 @@ public class Media implements
GetBannerImageRequest.class,
request,
this.sdkConfiguration.globals));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-banner-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -693,6 +847,24 @@ public class Media implements
*/
public GetThumbImageResponse getThumbImage(
GetThumbImageRequest request) throws Exception {
return getThumbImage(request, Optional.empty());
}
/**
* Get Thumb Image
* Gets the thumbnail image of the media item
* @param request The request object containing all of the parameters for the API call.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetThumbImageResponse getThumbImage(
GetThumbImageRequest request,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -710,50 +882,68 @@ public class Media implements
GetThumbImageRequest.class,
request,
this.sdkConfiguration.globals));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-thumb-image",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")

File diff suppressed because it is too large Load Diff

View File

@@ -47,20 +47,28 @@ import dev.plexapi.sdk.models.operations.IncludeRelay;
import dev.plexapi.sdk.models.operations.PlexDevice;
import dev.plexapi.sdk.models.operations.ResponseBody;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.BackoffStrategy;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Options;
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
import dev.plexapi.sdk.utils.Retries;
import dev.plexapi.sdk.utils.RetryConfig;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* API Calls that perform operations directly against https://Plex.tv
@@ -140,18 +148,24 @@ public class Plex implements
* @throws Exception if the API call fails
*/
public GetCompanionsDataResponse getCompanionsDataDirect() throws Exception {
return getCompanionsData(Optional.empty());
return getCompanionsData(Optional.empty(), Optional.empty());
}
/**
* Get Companions Data
* Get Companions Data
* @param serverURL Overrides the server URL.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetCompanionsDataResponse getCompanionsData(
Optional<String> serverURL) throws Exception {
Optional<String> serverURL,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(GET_COMPANIONS_DATA_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
@@ -169,45 +183,62 @@ public class Plex implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getCompanionsData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getCompanionsData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getCompanionsData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getCompanionsData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getCompanionsData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getCompanionsData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getCompanionsData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -301,18 +332,24 @@ public class Plex implements
* @throws Exception if the API call fails
*/
public GetUserFriendsResponse getUserFriendsDirect() throws Exception {
return getUserFriends(Optional.empty());
return getUserFriends(Optional.empty(), Optional.empty());
}
/**
* Get list of friends of the user logged in
* Get friends of provided auth token.
* @param serverURL Overrides the server URL.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetUserFriendsResponse getUserFriends(
Optional<String> serverURL) throws Exception {
Optional<String> serverURL,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(GET_USER_FRIENDS_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
@@ -330,45 +367,62 @@ public class Plex implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getUserFriends",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getUserFriends",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getUserFriends",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getUserFriends",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getUserFriends",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getUserFriends",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getUserFriends",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -462,18 +516,24 @@ public class Plex implements
* @throws Exception if the API call fails
*/
public GetGeoDataResponse getGeoDataDirect() throws Exception {
return getGeoData(Optional.empty());
return getGeoData(Optional.empty(), Optional.empty());
}
/**
* Get Geo Data
* Returns the geolocation and locale data of the caller
* @param serverURL Overrides the server URL.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetGeoDataResponse getGeoData(
Optional<String> serverURL) throws Exception {
Optional<String> serverURL,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(GET_GEO_DATA_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
@@ -488,45 +548,62 @@ public class Plex implements
SDKConfiguration.USER_AGENT);
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getGeoData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getGeoData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getGeoData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getGeoData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getGeoData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getGeoData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getGeoData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -620,6 +697,22 @@ public class Plex implements
* @throws Exception if the API call fails
*/
public GetHomeDataResponse getHomeDataDirect() throws Exception {
return getHomeData(Optional.empty());
}
/**
* Get Plex Home Data
* Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetHomeDataResponse getHomeData(
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
@@ -635,45 +728,62 @@ public class Plex implements
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getHomeData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getHomeData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getHomeData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getHomeData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getHomeData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getHomeData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getHomeData",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -767,7 +877,7 @@ public class Plex implements
* @throws Exception if the API call fails
*/
public GetServerResourcesResponse getServerResourcesDirect() throws Exception {
return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
}
/**
@@ -778,8 +888,9 @@ public class Plex implements
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
* @param includeIPv6 Include IPv6 entries in the results
* @param clientID The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device)
* @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
* @param serverURL Overrides the server URL.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
@@ -788,7 +899,12 @@ public class Plex implements
Optional<? extends IncludeRelay> includeRelay,
Optional<? extends IncludeIPv6> includeIPv6,
Optional<String> clientID,
Optional<String> serverURL) throws Exception {
Optional<String> serverURL,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
GetServerResourcesRequest request =
GetServerResourcesRequest
.builder()
@@ -815,50 +931,68 @@ public class Plex implements
GetServerResourcesRequest.class,
request,
this.sdkConfiguration.globals));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-server-resources",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-server-resources",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-server-resources",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-server-resources",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-server-resources",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-server-resources",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-server-resources",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -954,7 +1088,7 @@ public class Plex implements
*/
public GetPinResponse getPin(
GetPinRequest request) throws Exception {
return getPin(request, Optional.empty());
return getPin(request, Optional.empty(), Optional.empty());
}
/**
@@ -962,12 +1096,18 @@ public class Plex implements
* Retrieve a Pin ID from Plex.tv to use for authentication flows
* @param request The request object containing all of the parameters for the API call.
* @param serverURL Overrides the server URL.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetPinResponse getPin(
GetPinRequest request,
Optional<String> serverURL) throws Exception {
Optional<String> serverURL,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(GET_PIN_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
@@ -985,47 +1125,65 @@ public class Plex implements
GetPinRequest.class,
request,
this.sdkConfiguration.globals));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getPin",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getPin",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getPin",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getPin",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getPin",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getPin",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getPin",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
@@ -1105,7 +1263,7 @@ public class Plex implements
*/
public GetTokenByPinIdResponse getTokenByPinId(
GetTokenByPinIdRequest request) throws Exception {
return getTokenByPinId(request, Optional.empty());
return getTokenByPinId(request, Optional.empty(), Optional.empty());
}
/**
@@ -1113,12 +1271,18 @@ public class Plex implements
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
* @param request The request object containing all of the parameters for the API call.
* @param serverURL Overrides the server URL.
* @param options additional options
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetTokenByPinIdResponse getTokenByPinId(
GetTokenByPinIdRequest request,
Optional<String> serverURL) throws Exception {
Optional<String> serverURL,
Optional<Options> options) throws Exception {
if (options.isPresent()) {
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
}
String _baseUrl = Utils.templateUrl(GET_TOKEN_BY_PIN_ID_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
@@ -1133,52 +1297,65 @@ public class Plex implements
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
SDKConfiguration.USER_AGENT);
_req.addQueryParams(Utils.getQueryParams(
GetTokenByPinIdRequest.class,
request,
this.sdkConfiguration.globals));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getTokenByPinId",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTokenByPinId",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTokenByPinId",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTokenByPinId",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
HTTPRequest _finalReq = _req;
RetryConfig _retryConfig;
if (options.isPresent() && options.get().retryConfig().isPresent()) {
_retryConfig = options.get().retryConfig().get();
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
_retryConfig = this.sdkConfiguration.retryConfig.get();
} else {
_retryConfig = RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(500, TimeUnit.MILLISECONDS)
.maxInterval(60000, TimeUnit.MILLISECONDS)
.baseFactor((double)(1.5))
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
.retryConnectError(true)
.build())
.build();
}
List<String> _statusCodes = new ArrayList<>();
_statusCodes.add("5XX");
Retries _retries = Retries.builder()
.action(() -> {
HttpRequest _r = null;
try {
_r = sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"getTokenByPinId",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_finalReq.build());
} catch (Exception _e) {
throw new NonRetryableException(_e);
}
try {
return _client.send(_r);
} catch (Exception _e) {
return sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"getTokenByPinId",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
Optional.empty(),
Optional.of(_e));
}
})
.retryConfig(_retryConfig)
.statusCodes(_statusCodes)
.build();
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"getTokenByPinId",
Optional.of(List.of()),
sdkConfiguration.securitySource()),
_retries.run());
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")

View File

@@ -39,7 +39,7 @@ import java.util.Optional;
* | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
* | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
* | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
* | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
* | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
*
*/
public class PlexAPI {
@@ -465,11 +465,11 @@ public class PlexAPI {
* @return The builder instance.
*/
public Builder clientID(String clientID) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
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("queryParam").put("clientID", clientID);
this.sdkConfiguration.globals.get("parameters").get("header").put("clientID", clientID);
return this;
}
@@ -481,11 +481,11 @@ public class PlexAPI {
* @return The builder instance.
*/
public Builder clientName(String clientName) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
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("queryParam").put("clientName", clientName);
this.sdkConfiguration.globals.get("parameters").get("header").put("clientName", clientName);
return this;
}
@@ -497,43 +497,43 @@ public class PlexAPI {
* @return The builder instance.
*/
public Builder clientVersion(String clientVersion) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
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("queryParam").put("clientVersion", clientVersion);
this.sdkConfiguration.globals.get("parameters").get("header").put("clientVersion", clientVersion);
return this;
}
/**
* Allows setting the clientPlatform parameter for all supported operations.
* Allows setting the platform parameter for all supported operations.
*
* @param clientPlatform The value to set.
* @param platform The value to set.
* @return The builder instance.
*/
public Builder clientPlatform(String clientPlatform) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
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("queryParam").put("clientPlatform", clientPlatform);
this.sdkConfiguration.globals.get("parameters").get("header").put("platform", platform);
return this;
}
/**
* Allows setting the deviceName parameter for all supported operations.
* Allows setting the deviceNickname parameter for all supported operations.
*
* @param deviceName The value to set.
* @param deviceNickname The value to set.
* @return The builder instance.
*/
public Builder deviceName(String deviceName) {
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
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("queryParam").put("deviceName", deviceName);
this.sdkConfiguration.globals.get("parameters").get("header").put("deviceNickname", deviceNickname);
return this;
}

View File

@@ -36,8 +36,8 @@ class SDKConfiguration {
} };
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "0.0.3";
public static final String SDK_VERSION = "0.7.0";
public static final String GEN_VERSION = "2.428.1";
public static final String SDK_VERSION = "0.8.0";
public static final String GEN_VERSION = "2.429.0";
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
public static final String USER_AGENT =
String.format("speakeasy-sdk/%s %s %s %s %s",

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