mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.406.0
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
lockVersion: 2.0.0
|
lockVersion: 2.0.0
|
||||||
id: 1732900d-e173-47c1-a90d-d45182eb35d9
|
id: 1732900d-e173-47c1-a90d-d45182eb35d9
|
||||||
management:
|
management:
|
||||||
docChecksum: 1ee2e5413af07e886e33659b9b269dd5
|
docChecksum: 23094f3a9fe02710a8628ad5456f5d42
|
||||||
docVersion: 0.0.3
|
docVersion: 0.0.3
|
||||||
speakeasyVersion: 1.406.0
|
speakeasyVersion: 1.406.0
|
||||||
generationVersion: 2.429.0
|
generationVersion: 2.429.0
|
||||||
releaseVersion: 0.8.0
|
releaseVersion: 0.9.0
|
||||||
configChecksum: c0c94b0c04fc6858e1ced149989e0cf6
|
configChecksum: 870175070f35ff1b0f848e5e0d3ef934
|
||||||
repoURL: https://github.com/LukeHagar/plexjava.git
|
repoURL: https://github.com/LukeHagar/plexjava.git
|
||||||
published: true
|
published: true
|
||||||
features:
|
features:
|
||||||
@@ -27,7 +27,6 @@ features:
|
|||||||
methodServerURLs: 2.82.1
|
methodServerURLs: 2.82.1
|
||||||
nameOverrides: 2.81.3
|
nameOverrides: 2.81.3
|
||||||
nullables: 0.1.0
|
nullables: 0.1.0
|
||||||
retries: 0.1.1
|
|
||||||
sdkHooks: 0.1.0
|
sdkHooks: 0.1.0
|
||||||
generatedFiles:
|
generatedFiles:
|
||||||
- .gitattributes
|
- .gitattributes
|
||||||
@@ -2798,7 +2797,7 @@ examples:
|
|||||||
speakeasy-default-get-token-details:
|
speakeasy-default-get-token-details:
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "active", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null}
|
application/json: {"adsConsent": true, "adsConsentReminderAt": 1556281940, "adsConsentSetAt": 1556281940, "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "active", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null}
|
||||||
"400":
|
"400":
|
||||||
application/json: {"errors": []}
|
application/json: {"errors": []}
|
||||||
"401":
|
"401":
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ generation:
|
|||||||
auth:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: true
|
oAuth2ClientCredentialsEnabled: true
|
||||||
java:
|
java:
|
||||||
version: 0.8.0
|
version: 0.9.0
|
||||||
additionalDependencies: []
|
additionalDependencies: []
|
||||||
additionalPlugins: []
|
additionalPlugins: []
|
||||||
artifactID: plexapi
|
artifactID: plexapi
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ sources:
|
|||||||
- latest
|
- latest
|
||||||
plexapi:
|
plexapi:
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
|
sourceRevisionDigest: sha256:790c7c67b0edef8c35ed69943d43e9c5bda385414c06f9c90410f93f546e5e4f
|
||||||
sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
|
sourceBlobDigest: sha256:3e48471b7e058840fc598ccd75b2cbf8187961c7e625fe7b606555ce9a9bf109
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- main
|
- main
|
||||||
@@ -17,10 +17,10 @@ targets:
|
|||||||
plexjava:
|
plexjava:
|
||||||
source: plexapi
|
source: plexapi
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
|
sourceRevisionDigest: sha256:790c7c67b0edef8c35ed69943d43e9c5bda385414c06f9c90410f93f546e5e4f
|
||||||
sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
|
sourceBlobDigest: sha256:3e48471b7e058840fc598ccd75b2cbf8187961c7e625fe7b606555ce9a9bf109
|
||||||
codeSamplesNamespace: code-samples-java-plexjava
|
codeSamplesNamespace: code-samples-java-plexjava
|
||||||
codeSamplesRevisionDigest: sha256:46ccc091bbcaf0f056953e6349cd4c115250f9fc4359e7a23f6364979e2be555
|
codeSamplesRevisionDigest: sha256:1be6f3e64a42e2f5a878957fcaa19df7ee718649f6503954dad2c4a934e4eed3
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
|
|||||||
103
README.md
103
README.md
@@ -45,7 +45,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
|
|||||||
* [SDK Installation](#sdk-installation)
|
* [SDK Installation](#sdk-installation)
|
||||||
* [SDK Example Usage](#sdk-example-usage)
|
* [SDK Example Usage](#sdk-example-usage)
|
||||||
* [Available Resources and Operations](#available-resources-and-operations)
|
* [Available Resources and Operations](#available-resources-and-operations)
|
||||||
* [Retries](#retries)
|
|
||||||
* [Error Handling](#error-handling)
|
* [Error Handling](#error-handling)
|
||||||
* [Server Selection](#server-selection)
|
* [Server Selection](#server-selection)
|
||||||
* [Authentication](#authentication)
|
* [Authentication](#authentication)
|
||||||
@@ -62,7 +61,7 @@ The samples below show how a published SDK artifact is used:
|
|||||||
|
|
||||||
Gradle:
|
Gradle:
|
||||||
```groovy
|
```groovy
|
||||||
implementation 'dev.plexapi:plexapi:0.8.0'
|
implementation 'dev.plexapi:plexapi:0.9.0'
|
||||||
```
|
```
|
||||||
|
|
||||||
Maven:
|
Maven:
|
||||||
@@ -70,7 +69,7 @@ Maven:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dev.plexapi</groupId>
|
<groupId>dev.plexapi</groupId>
|
||||||
<artifactId>plexapi</artifactId>
|
<artifactId>plexapi</artifactId>
|
||||||
<version>0.8.0</version>
|
<version>0.9.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -261,104 +260,6 @@ public class Application {
|
|||||||
</details>
|
</details>
|
||||||
<!-- End Available Resources and Operations [operations] -->
|
<!-- End Available Resources and Operations [operations] -->
|
||||||
|
|
||||||
<!-- Start Retries [retries] -->
|
|
||||||
## Retries
|
|
||||||
|
|
||||||
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.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()
|
|
||||||
.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()
|
|
||||||
.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.object().isPresent()) {
|
|
||||||
// handle response
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
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] -->
|
<!-- Start Error Handling [errors] -->
|
||||||
## Error Handling
|
## Error Handling
|
||||||
|
|
||||||
|
|||||||
12
RELEASES.md
12
RELEASES.md
@@ -148,4 +148,14 @@ Based on:
|
|||||||
### Generated
|
### Generated
|
||||||
- [java v0.8.0] .
|
- [java v0.8.0] .
|
||||||
### Releases
|
### Releases
|
||||||
- [Maven Central v0.8.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.8.0 - .
|
- [Maven Central v0.8.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.8.0 - .
|
||||||
|
|
||||||
|
## 2024-10-04 00:25:27
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc
|
||||||
|
- Speakeasy CLI 1.406.0 (2.429.0) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [java v0.9.0] .
|
||||||
|
### Releases
|
||||||
|
- [Maven Central v0.9.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.9.0 - .
|
||||||
@@ -63,7 +63,7 @@ tasks.withType(Javadoc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "dev.plexapi"
|
group = "dev.plexapi"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
|
|
||||||
sourcesJar {
|
sourcesJar {
|
||||||
archiveBaseName = "plexapi"
|
archiveBaseName = "plexapi"
|
||||||
@@ -101,7 +101,7 @@ publishing {
|
|||||||
maven(MavenPublication) {
|
maven(MavenPublication) {
|
||||||
groupId = 'dev.plexapi'
|
groupId = 'dev.plexapi'
|
||||||
artifactId = 'plexapi'
|
artifactId = 'plexapi'
|
||||||
version = '0.8.0'
|
version = '0.9.0'
|
||||||
|
|
||||||
from components.java
|
from components.java
|
||||||
|
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ The Meta object is only included in the response if the `includeMeta` parameter
|
|||||||
| `viewGroup` | *String* | :heavy_check_mark: | N/A | movie |
|
| `viewGroup` | *String* | :heavy_check_mark: | N/A | movie |
|
||||||
| `viewMode` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 65592 |
|
| `viewMode` | *Optional<Integer>* | :heavy_minus_sign: | N/A | 65592 |
|
||||||
| `mixedParents` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | true |
|
| `mixedParents` | *Optional<Boolean>* | :heavy_minus_sign: | N/A | true |
|
||||||
| `metadata` | List<[GetLibraryItemsMetadata](../../models/operations/GetLibraryItemsMetadata.md)> | :heavy_check_mark: | N/A | |
|
| `metadata` | List<[GetLibraryItemsMetadata](../../models/operations/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | |
|
||||||
| `meta` | [Optional<GetLibraryItemsMeta>](../../models/operations/GetLibraryItemsMeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |
|
| `meta` | [Optional<GetLibraryItemsMeta>](../../models/operations/GetLibraryItemsMeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |
|
||||||
File diff suppressed because one or more lines are too long
@@ -8,8 +8,8 @@ Logged in user details
|
|||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `adsConsent` | *Optional<Boolean>* | :heavy_check_mark: | Unknown | |
|
| `adsConsent` | *Optional<Boolean>* | :heavy_check_mark: | Unknown | |
|
||||||
| `adsConsentReminderAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | Unknown | |
|
| `adsConsentReminderAt` | *Optional<Long>* | :heavy_check_mark: | N/A | 1556281940 |
|
||||||
| `adsConsentSetAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | Unknown | |
|
| `adsConsentSetAt` | *Optional<Long>* | :heavy_check_mark: | N/A | 1556281940 |
|
||||||
| `anonymous` | *JsonNullable<Boolean>* | :heavy_minus_sign: | Unknown | |
|
| `anonymous` | *JsonNullable<Boolean>* | :heavy_minus_sign: | Unknown | |
|
||||||
| `authToken` | *String* | :heavy_check_mark: | The account token | CxoUzBTSV5hsxjTpFKaf |
|
| `authToken` | *String* | :heavy_check_mark: | The account token | CxoUzBTSV5hsxjTpFKaf |
|
||||||
| `backupCodesCreated` | *Optional<Boolean>* | :heavy_minus_sign: | If the two-factor authentication backup codes have been created | |
|
| `backupCodesCreated` | *Optional<Boolean>* | :heavy_minus_sign: | If the two-factor authentication backup codes have been created | |
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -8,8 +8,8 @@ Returns the user account data with a valid auth token
|
|||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `adsConsent` | *Optional<Boolean>* | :heavy_check_mark: | Unknown | |
|
| `adsConsent` | *Optional<Boolean>* | :heavy_check_mark: | Unknown | |
|
||||||
| `adsConsentReminderAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | Unknown | |
|
| `adsConsentReminderAt` | *Optional<Long>* | :heavy_check_mark: | N/A | 1556281940 |
|
||||||
| `adsConsentSetAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | Unknown | |
|
| `adsConsentSetAt` | *Optional<Long>* | :heavy_check_mark: | N/A | 1556281940 |
|
||||||
| `anonymous` | *JsonNullable<Boolean>* | :heavy_minus_sign: | Unknown | |
|
| `anonymous` | *JsonNullable<Boolean>* | :heavy_minus_sign: | Unknown | |
|
||||||
| `authToken` | *String* | :heavy_check_mark: | The account token | CxoUzBTSV5hsxjTpFKaf |
|
| `authToken` | *String* | :heavy_check_mark: | The account token | CxoUzBTSV5hsxjTpFKaf |
|
||||||
| `backupCodesCreated` | *Optional<Boolean>* | :heavy_minus_sign: | If the two-factor authentication backup codes have been created | |
|
| `backupCodesCreated` | *Optional<Boolean>* | :heavy_minus_sign: | If the two-factor authentication backup codes have been created | |
|
||||||
|
|||||||
@@ -17,27 +17,19 @@ import dev.plexapi.sdk.models.operations.GetServerActivitiesRequestBuilder;
|
|||||||
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse;
|
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse;
|
||||||
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody;
|
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody;
|
||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
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.
|
* 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.
|
||||||
@@ -76,22 +68,6 @@ public class Activities implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetServerActivitiesResponse getServerActivitiesDirect() throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -107,62 +83,45 @@ public class Activities implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getServerActivities",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -258,24 +217,6 @@ public class Activities implements
|
|||||||
*/
|
*/
|
||||||
public CancelServerActivitiesResponse cancelServerActivities(
|
public CancelServerActivitiesResponse cancelServerActivities(
|
||||||
String activityUUID) throws Exception {
|
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 request =
|
||||||
CancelServerActivitiesRequest
|
CancelServerActivitiesRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -299,62 +240,45 @@ public class Activities implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"cancelServerActivities",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -30,16 +30,11 @@ import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse;
|
|||||||
import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount;
|
import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount;
|
||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.models.operations.Scope;
|
import dev.plexapi.sdk.models.operations.Scope;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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.SerializedBody;
|
||||||
import dev.plexapi.sdk.utils.Utils.JsonShape;
|
import dev.plexapi.sdk.utils.Utils.JsonShape;
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
@@ -49,12 +44,9 @@ import java.lang.Object;
|
|||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
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
|
* API Calls regarding authentication for Plex Media Server
|
||||||
@@ -109,27 +101,6 @@ public class Authentication implements
|
|||||||
public GetTransientTokenResponse getTransientToken(
|
public GetTransientTokenResponse getTransientToken(
|
||||||
GetTransientTokenQueryParamType type,
|
GetTransientTokenQueryParamType type,
|
||||||
Scope scope) throws Exception {
|
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 request =
|
||||||
GetTransientTokenRequest
|
GetTransientTokenRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -157,62 +128,45 @@ public class Authentication implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getTransientToken",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -301,26 +255,6 @@ public class Authentication implements
|
|||||||
*/
|
*/
|
||||||
public GetSourceConnectionInformationResponse getSourceConnectionInformation(
|
public GetSourceConnectionInformationResponse getSourceConnectionInformation(
|
||||||
String source) throws Exception {
|
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 >= 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 request =
|
||||||
GetSourceConnectionInformationRequest
|
GetSourceConnectionInformationRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -347,62 +281,45 @@ public class Authentication implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getSourceConnectionInformation",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -485,24 +402,18 @@ public class Authentication implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetTokenDetailsResponse getTokenDetailsDirect() throws Exception {
|
public GetTokenDetailsResponse getTokenDetailsDirect() throws Exception {
|
||||||
return getTokenDetails(Optional.empty(), Optional.empty());
|
return getTokenDetails(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Token Details
|
* Get Token Details
|
||||||
* Get the User data from the provided X-Plex-Token
|
* Get the User data from the provided X-Plex-Token
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetTokenDetailsResponse getTokenDetails(
|
public GetTokenDetailsResponse getTokenDetails(
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
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>());
|
String _baseUrl = Utils.templateUrl(GET_TOKEN_DETAILS_SERVERS[0], new HashMap<String, String>());
|
||||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||||
_baseUrl = serverURL.get();
|
_baseUrl = serverURL.get();
|
||||||
@@ -520,62 +431,45 @@ public class Authentication implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getTokenDetails",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -671,7 +565,7 @@ public class Authentication implements
|
|||||||
*/
|
*/
|
||||||
public PostUsersSignInDataResponse postUsersSignInData(
|
public PostUsersSignInDataResponse postUsersSignInData(
|
||||||
PostUsersSignInDataRequest request) throws Exception {
|
PostUsersSignInDataRequest request) throws Exception {
|
||||||
return postUsersSignInData(request, Optional.empty(), Optional.empty());
|
return postUsersSignInData(request, Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -679,18 +573,12 @@ public class Authentication implements
|
|||||||
* Sign in user with username and password and return user data with Plex authentication token
|
* 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 request The request object containing all of the parameters for the API call.
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public PostUsersSignInDataResponse postUsersSignInData(
|
public PostUsersSignInDataResponse postUsersSignInData(
|
||||||
PostUsersSignInDataRequest request,
|
PostUsersSignInDataRequest request,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
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>());
|
String _baseUrl = Utils.templateUrl(POST_USERS_SIGN_IN_DATA_SERVERS[0], new HashMap<String, String>());
|
||||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||||
_baseUrl = serverURL.get();
|
_baseUrl = serverURL.get();
|
||||||
@@ -716,62 +604,45 @@ public class Authentication implements
|
|||||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"post-users-sign-in-data",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -32,27 +32,19 @@ import dev.plexapi.sdk.models.operations.StopTaskRequest;
|
|||||||
import dev.plexapi.sdk.models.operations.StopTaskRequestBuilder;
|
import dev.plexapi.sdk.models.operations.StopTaskRequestBuilder;
|
||||||
import dev.plexapi.sdk.models.operations.StopTaskResponse;
|
import dev.plexapi.sdk.models.operations.StopTaskResponse;
|
||||||
import dev.plexapi.sdk.models.operations.TaskName;
|
import dev.plexapi.sdk.models.operations.TaskName;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
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.
|
* Butler is the task manager of the Plex Media Server Ecosystem.
|
||||||
@@ -88,22 +80,6 @@ public class Butler implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetButlerTasksResponse getButlerTasksDirect() throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -119,62 +95,45 @@ public class Butler implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getButlerTasks",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -278,27 +237,6 @@ public class Butler implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public StartAllTasksResponse startAllTasksDirect() throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -314,62 +252,45 @@ public class Butler implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"startAllTasks",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -454,23 +375,6 @@ public class Butler implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public StopAllTasksResponse stopAllTasksDirect() throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -486,62 +390,45 @@ public class Butler implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"stopAllTasks",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -636,29 +523,6 @@ public class Butler implements
|
|||||||
*/
|
*/
|
||||||
public StartTaskResponse startTask(
|
public StartTaskResponse startTask(
|
||||||
TaskName taskName) throws Exception {
|
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 request =
|
||||||
StartTaskRequest
|
StartTaskRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -682,62 +546,45 @@ public class Butler implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"startTask",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -824,25 +671,6 @@ public class Butler implements
|
|||||||
*/
|
*/
|
||||||
public StopTaskResponse stopTask(
|
public StopTaskResponse stopTask(
|
||||||
PathParamTaskName taskName) throws Exception {
|
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 request =
|
||||||
StopTaskRequest
|
StopTaskRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -866,62 +694,45 @@ public class Butler implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"stopTask",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -25,16 +25,11 @@ import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponseBody;
|
|||||||
import dev.plexapi.sdk.models.operations.OnlyTransient;
|
import dev.plexapi.sdk.models.operations.OnlyTransient;
|
||||||
import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient;
|
import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient;
|
||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
@@ -42,11 +37,8 @@ import java.lang.Exception;
|
|||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
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.
|
* Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
||||||
@@ -80,7 +72,7 @@ public class Hubs implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetGlobalHubsResponse getGlobalHubsDirect() throws Exception {
|
public GetGlobalHubsResponse getGlobalHubsDirect() throws Exception {
|
||||||
return getGlobalHubs(Optional.empty(), Optional.empty(), Optional.empty());
|
return getGlobalHubs(Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,18 +80,12 @@ public class Hubs implements
|
|||||||
* Get Global Hubs filtered by the parameters provided.
|
* Get Global Hubs filtered by the parameters provided.
|
||||||
* @param count The number of items to return with each hub.
|
* @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 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
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetGlobalHubsResponse getGlobalHubs(
|
public GetGlobalHubsResponse getGlobalHubs(
|
||||||
Optional<Double> count,
|
Optional<Double> count,
|
||||||
Optional<? extends OnlyTransient> onlyTransient,
|
Optional<? extends OnlyTransient> onlyTransient) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
GetGlobalHubsRequest request =
|
GetGlobalHubsRequest request =
|
||||||
GetGlobalHubsRequest
|
GetGlobalHubsRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -127,62 +113,45 @@ public class Hubs implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getGlobalHubs",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -280,25 +249,6 @@ public class Hubs implements
|
|||||||
*/
|
*/
|
||||||
public GetRecentlyAddedResponse getRecentlyAdded(
|
public GetRecentlyAddedResponse getRecentlyAdded(
|
||||||
GetRecentlyAddedRequest request) throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -319,62 +269,45 @@ public class Hubs implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"get-recently-added",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -440,7 +373,7 @@ public class Hubs implements
|
|||||||
*/
|
*/
|
||||||
public GetLibraryHubsResponse getLibraryHubs(
|
public GetLibraryHubsResponse getLibraryHubs(
|
||||||
double sectionId) throws Exception {
|
double sectionId) throws Exception {
|
||||||
return getLibraryHubs(sectionId, Optional.empty(), Optional.empty(), Optional.empty());
|
return getLibraryHubs(sectionId, Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -450,19 +383,13 @@ public class Hubs implements
|
|||||||
* @param sectionId the Id of the library to query
|
* @param sectionId the Id of the library to query
|
||||||
* @param count The number of items to return with each hub.
|
* @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 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
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetLibraryHubsResponse getLibraryHubs(
|
public GetLibraryHubsResponse getLibraryHubs(
|
||||||
double sectionId,
|
double sectionId,
|
||||||
Optional<Double> count,
|
Optional<Double> count,
|
||||||
Optional<? extends QueryParamOnlyTransient> onlyTransient,
|
Optional<? extends QueryParamOnlyTransient> onlyTransient) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
GetLibraryHubsRequest request =
|
GetLibraryHubsRequest request =
|
||||||
GetLibraryHubsRequest
|
GetLibraryHubsRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -493,62 +420,45 @@ public class Hubs implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getLibraryHubs",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -21,16 +21,11 @@ import dev.plexapi.sdk.models.operations.LogLineResponse;
|
|||||||
import dev.plexapi.sdk.models.operations.LogMultiLineRequestBuilder;
|
import dev.plexapi.sdk.models.operations.LogMultiLineRequestBuilder;
|
||||||
import dev.plexapi.sdk.models.operations.LogMultiLineResponse;
|
import dev.plexapi.sdk.models.operations.LogMultiLineResponse;
|
||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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.SerializedBody;
|
||||||
import dev.plexapi.sdk.utils.Utils.JsonShape;
|
import dev.plexapi.sdk.utils.Utils.JsonShape;
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
@@ -40,11 +35,8 @@ import java.lang.Object;
|
|||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
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
|
* Submit logs to the Log Handler for Plex Media Server
|
||||||
@@ -92,35 +84,6 @@ public class Log implements
|
|||||||
Level level,
|
Level level,
|
||||||
String message,
|
String message,
|
||||||
String source) throws Exception {
|
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 request =
|
||||||
LogLineRequest
|
LogLineRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -149,62 +112,45 @@ public class Log implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"logLine",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -331,45 +277,6 @@ public class Log implements
|
|||||||
*/
|
*/
|
||||||
public LogMultiLineResponse logMultiLine(
|
public LogMultiLineResponse logMultiLine(
|
||||||
String request) throws Exception {
|
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&message=Sample%20log%20entry&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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -398,62 +305,45 @@ public class Log implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"logMultiLine",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -538,23 +428,6 @@ public class Log implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public EnablePaperTrailResponse enablePaperTrailDirect() throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -570,62 +443,45 @@ public class Log implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"enablePaperTrail",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -32,27 +32,19 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
|||||||
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest;
|
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest;
|
||||||
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequestBuilder;
|
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequestBuilder;
|
||||||
import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse;
|
import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
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
|
* API Calls interacting with Plex Media Server Media
|
||||||
@@ -90,24 +82,6 @@ public class Media implements
|
|||||||
*/
|
*/
|
||||||
public MarkPlayedResponse markPlayed(
|
public MarkPlayedResponse markPlayed(
|
||||||
double key) throws Exception {
|
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 request =
|
||||||
MarkPlayedRequest
|
MarkPlayedRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -134,62 +108,45 @@ public class Media implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"markPlayed",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -274,24 +231,6 @@ public class Media implements
|
|||||||
*/
|
*/
|
||||||
public MarkUnplayedResponse markUnplayed(
|
public MarkUnplayedResponse markUnplayed(
|
||||||
double key) throws Exception {
|
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 request =
|
||||||
MarkUnplayedRequest
|
MarkUnplayedRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -318,62 +257,45 @@ public class Media implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"markUnplayed",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -464,29 +386,6 @@ public class Media implements
|
|||||||
String key,
|
String key,
|
||||||
double time,
|
double time,
|
||||||
String state) throws Exception {
|
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 request =
|
||||||
UpdatePlayProgressRequest
|
UpdatePlayProgressRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -515,62 +414,45 @@ public class Media implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"updatePlayProgress",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -655,24 +537,6 @@ public class Media implements
|
|||||||
*/
|
*/
|
||||||
public GetBannerImageResponse getBannerImage(
|
public GetBannerImageResponse getBannerImage(
|
||||||
GetBannerImageRequest request) throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -696,62 +560,45 @@ public class Media implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"get-banner-image",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -847,24 +694,6 @@ public class Media implements
|
|||||||
*/
|
*/
|
||||||
public GetThumbImageResponse getThumbImage(
|
public GetThumbImageResponse getThumbImage(
|
||||||
GetThumbImageRequest request) throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -888,62 +717,45 @@ public class Media implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"get-thumb-image",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -47,28 +47,20 @@ import dev.plexapi.sdk.models.operations.IncludeRelay;
|
|||||||
import dev.plexapi.sdk.models.operations.PlexDevice;
|
import dev.plexapi.sdk.models.operations.PlexDevice;
|
||||||
import dev.plexapi.sdk.models.operations.ResponseBody;
|
import dev.plexapi.sdk.models.operations.ResponseBody;
|
||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
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
|
* API Calls that perform operations directly against https://Plex.tv
|
||||||
@@ -148,24 +140,18 @@ public class Plex implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetCompanionsDataResponse getCompanionsDataDirect() throws Exception {
|
public GetCompanionsDataResponse getCompanionsDataDirect() throws Exception {
|
||||||
return getCompanionsData(Optional.empty(), Optional.empty());
|
return getCompanionsData(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Companions Data
|
* Get Companions Data
|
||||||
* Get Companions Data
|
* Get Companions Data
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetCompanionsDataResponse getCompanionsData(
|
public GetCompanionsDataResponse getCompanionsData(
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
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>());
|
String _baseUrl = Utils.templateUrl(GET_COMPANIONS_DATA_SERVERS[0], new HashMap<String, String>());
|
||||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||||
_baseUrl = serverURL.get();
|
_baseUrl = serverURL.get();
|
||||||
@@ -183,62 +169,45 @@ public class Plex implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getCompanionsData",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -332,24 +301,18 @@ public class Plex implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetUserFriendsResponse getUserFriendsDirect() throws Exception {
|
public GetUserFriendsResponse getUserFriendsDirect() throws Exception {
|
||||||
return getUserFriends(Optional.empty(), Optional.empty());
|
return getUserFriends(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get list of friends of the user logged in
|
* Get list of friends of the user logged in
|
||||||
* Get friends of provided auth token.
|
* Get friends of provided auth token.
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetUserFriendsResponse getUserFriends(
|
public GetUserFriendsResponse getUserFriends(
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
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>());
|
String _baseUrl = Utils.templateUrl(GET_USER_FRIENDS_SERVERS[0], new HashMap<String, String>());
|
||||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||||
_baseUrl = serverURL.get();
|
_baseUrl = serverURL.get();
|
||||||
@@ -367,62 +330,45 @@ public class Plex implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getUserFriends",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -516,24 +462,18 @@ public class Plex implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetGeoDataResponse getGeoDataDirect() throws Exception {
|
public GetGeoDataResponse getGeoDataDirect() throws Exception {
|
||||||
return getGeoData(Optional.empty(), Optional.empty());
|
return getGeoData(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Geo Data
|
* Get Geo Data
|
||||||
* Returns the geolocation and locale data of the caller
|
* Returns the geolocation and locale data of the caller
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetGeoDataResponse getGeoData(
|
public GetGeoDataResponse getGeoData(
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
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>());
|
String _baseUrl = Utils.templateUrl(GET_GEO_DATA_SERVERS[0], new HashMap<String, String>());
|
||||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||||
_baseUrl = serverURL.get();
|
_baseUrl = serverURL.get();
|
||||||
@@ -548,62 +488,45 @@ public class Plex implements
|
|||||||
SDKConfiguration.USER_AGENT);
|
SDKConfiguration.USER_AGENT);
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getGeoData",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -697,22 +620,6 @@ public class Plex implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetHomeDataResponse getHomeDataDirect() throws Exception {
|
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(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -728,62 +635,45 @@ public class Plex implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getHomeData",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -877,7 +767,7 @@ public class Plex implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetServerResourcesResponse getServerResourcesDirect() throws Exception {
|
public GetServerResourcesResponse getServerResourcesDirect() throws Exception {
|
||||||
return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -890,7 +780,6 @@ public class Plex implements
|
|||||||
* @param includeIPv6 Include IPv6 entries in the results
|
* @param includeIPv6 Include IPv6 entries in the results
|
||||||
* @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
* @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
@@ -899,12 +788,7 @@ public class Plex implements
|
|||||||
Optional<? extends IncludeRelay> includeRelay,
|
Optional<? extends IncludeRelay> includeRelay,
|
||||||
Optional<? extends IncludeIPv6> includeIPv6,
|
Optional<? extends IncludeIPv6> includeIPv6,
|
||||||
Optional<String> clientID,
|
Optional<String> clientID,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
GetServerResourcesRequest request =
|
GetServerResourcesRequest request =
|
||||||
GetServerResourcesRequest
|
GetServerResourcesRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -937,62 +821,45 @@ public class Plex implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"get-server-resources",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -1088,7 +955,7 @@ public class Plex implements
|
|||||||
*/
|
*/
|
||||||
public GetPinResponse getPin(
|
public GetPinResponse getPin(
|
||||||
GetPinRequest request) throws Exception {
|
GetPinRequest request) throws Exception {
|
||||||
return getPin(request, Optional.empty(), Optional.empty());
|
return getPin(request, Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1096,18 +963,12 @@ public class Plex implements
|
|||||||
* Retrieve a Pin ID from Plex.tv to use for authentication flows
|
* 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 request The request object containing all of the parameters for the API call.
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetPinResponse getPin(
|
public GetPinResponse getPin(
|
||||||
GetPinRequest request,
|
GetPinRequest request,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
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>());
|
String _baseUrl = Utils.templateUrl(GET_PIN_SERVERS[0], new HashMap<String, String>());
|
||||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||||
_baseUrl = serverURL.get();
|
_baseUrl = serverURL.get();
|
||||||
@@ -1128,62 +989,45 @@ public class Plex implements
|
|||||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getPin",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -1263,7 +1107,7 @@ public class Plex implements
|
|||||||
*/
|
*/
|
||||||
public GetTokenByPinIdResponse getTokenByPinId(
|
public GetTokenByPinIdResponse getTokenByPinId(
|
||||||
GetTokenByPinIdRequest request) throws Exception {
|
GetTokenByPinIdRequest request) throws Exception {
|
||||||
return getTokenByPinId(request, Optional.empty(), Optional.empty());
|
return getTokenByPinId(request, Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1271,18 +1115,12 @@ public class Plex implements
|
|||||||
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
|
* 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 request The request object containing all of the parameters for the API call.
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetTokenByPinIdResponse getTokenByPinId(
|
public GetTokenByPinIdResponse getTokenByPinId(
|
||||||
GetTokenByPinIdRequest request,
|
GetTokenByPinIdRequest request,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
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>());
|
String _baseUrl = Utils.templateUrl(GET_TOKEN_BY_PIN_ID_SERVERS[0], new HashMap<String, String>());
|
||||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||||
_baseUrl = serverURL.get();
|
_baseUrl = serverURL.get();
|
||||||
@@ -1300,62 +1138,45 @@ public class Plex implements
|
|||||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getTokenByPinId",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"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));
|
||||||
}
|
}
|
||||||
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
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class SDKConfiguration {
|
|||||||
} };
|
} };
|
||||||
private static final String LANGUAGE = "java";
|
private static final String LANGUAGE = "java";
|
||||||
public static final String OPENAPI_DOC_VERSION = "0.0.3";
|
public static final String OPENAPI_DOC_VERSION = "0.0.3";
|
||||||
public static final String SDK_VERSION = "0.8.0";
|
public static final String SDK_VERSION = "0.9.0";
|
||||||
public static final String GEN_VERSION = "2.429.0";
|
public static final String GEN_VERSION = "2.429.0";
|
||||||
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
|
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
|
||||||
public static final String USER_AGENT =
|
public static final String USER_AGENT =
|
||||||
|
|||||||
@@ -23,16 +23,11 @@ import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequest;
|
|||||||
import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequestBuilder;
|
import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequestBuilder;
|
||||||
import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse;
|
import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse;
|
||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
@@ -40,11 +35,8 @@ import java.lang.Exception;
|
|||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API Calls that perform search operations with Plex Media Server
|
* API Calls that perform search operations with Plex Media Server
|
||||||
@@ -104,7 +96,7 @@ public class Search implements
|
|||||||
*/
|
*/
|
||||||
public PerformSearchResponse performSearch(
|
public PerformSearchResponse performSearch(
|
||||||
String query) throws Exception {
|
String query) throws Exception {
|
||||||
return performSearch(query, Optional.empty(), Optional.empty(), Optional.empty());
|
return performSearch(query, Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -125,19 +117,13 @@ public class Search implements
|
|||||||
* @param query The query term
|
* @param query The query term
|
||||||
* @param sectionId This gives context to the search, and can result in re-ordering of search result hubs
|
* @param sectionId This gives context to the search, and can result in re-ordering of search result hubs
|
||||||
* @param limit The number of items to return per hub
|
* @param limit The number of items to return per hub
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public PerformSearchResponse performSearch(
|
public PerformSearchResponse performSearch(
|
||||||
String query,
|
String query,
|
||||||
Optional<Double> sectionId,
|
Optional<Double> sectionId,
|
||||||
Optional<Double> limit,
|
Optional<Double> limit) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
PerformSearchRequest request =
|
PerformSearchRequest request =
|
||||||
PerformSearchRequest
|
PerformSearchRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -166,62 +152,45 @@ public class Search implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"performSearch",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"performSearch",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"performSearch",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"performSearch",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"performSearch",
|
|
||||||
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(
|
|
||||||
"performSearch",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"performSearch",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -314,7 +283,7 @@ public class Search implements
|
|||||||
*/
|
*/
|
||||||
public PerformVoiceSearchResponse performVoiceSearch(
|
public PerformVoiceSearchResponse performVoiceSearch(
|
||||||
String query) throws Exception {
|
String query) throws Exception {
|
||||||
return performVoiceSearch(query, Optional.empty(), Optional.empty(), Optional.empty());
|
return performVoiceSearch(query, Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -327,19 +296,13 @@ public class Search implements
|
|||||||
* @param query The query term
|
* @param query The query term
|
||||||
* @param sectionId This gives context to the search, and can result in re-ordering of search result hubs
|
* @param sectionId This gives context to the search, and can result in re-ordering of search result hubs
|
||||||
* @param limit The number of items to return per hub
|
* @param limit The number of items to return per hub
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public PerformVoiceSearchResponse performVoiceSearch(
|
public PerformVoiceSearchResponse performVoiceSearch(
|
||||||
String query,
|
String query,
|
||||||
Optional<Double> sectionId,
|
Optional<Double> sectionId,
|
||||||
Optional<Double> limit,
|
Optional<Double> limit) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
PerformVoiceSearchRequest request =
|
PerformVoiceSearchRequest request =
|
||||||
PerformVoiceSearchRequest
|
PerformVoiceSearchRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -368,62 +331,45 @@ public class Search implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"performVoiceSearch",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"performVoiceSearch",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"performVoiceSearch",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"performVoiceSearch",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"performVoiceSearch",
|
|
||||||
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(
|
|
||||||
"performVoiceSearch",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"performVoiceSearch",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -508,24 +454,6 @@ public class Search implements
|
|||||||
*/
|
*/
|
||||||
public GetSearchResultsResponse getSearchResults(
|
public GetSearchResultsResponse getSearchResults(
|
||||||
String query) throws Exception {
|
String query) throws Exception {
|
||||||
return getSearchResults(query, Optional.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Search Results
|
|
||||||
* This will search the database for the string provided.
|
|
||||||
* @param query The search query string to use
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
|
||||||
* @throws Exception if the API call fails
|
|
||||||
*/
|
|
||||||
public GetSearchResultsResponse getSearchResults(
|
|
||||||
String query,
|
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
GetSearchResultsRequest request =
|
GetSearchResultsRequest request =
|
||||||
GetSearchResultsRequest
|
GetSearchResultsRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -552,62 +480,45 @@ public class Search implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getSearchResults",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getSearchResults",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getSearchResults",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getSearchResults",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getSearchResults",
|
|
||||||
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(
|
|
||||||
"getSearchResults",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getSearchResults",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -29,16 +29,11 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
|||||||
import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequest;
|
import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequest;
|
||||||
import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequestBuilder;
|
import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequestBuilder;
|
||||||
import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse;
|
import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
@@ -46,11 +41,8 @@ import java.lang.Long;
|
|||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API Calls that perform search operations with Plex Media Server Sessions
|
* API Calls that perform search operations with Plex Media Server Sessions
|
||||||
@@ -85,22 +77,6 @@ public class Sessions implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetSessionsResponse getSessionsDirect() throws Exception {
|
public GetSessionsResponse getSessionsDirect() throws Exception {
|
||||||
return getSessions(Optional.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Active Sessions
|
|
||||||
* This will retrieve the "Now Playing" Information of the PMS.
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
|
||||||
* @throws Exception if the API call fails
|
|
||||||
*/
|
|
||||||
public GetSessionsResponse getSessions(
|
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
String _baseUrl = Utils.templateUrl(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -116,62 +92,45 @@ public class Sessions implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getSessions",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getSessions",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getSessions",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getSessions",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getSessions",
|
|
||||||
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(
|
|
||||||
"getSessions",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getSessions",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -265,7 +224,7 @@ public class Sessions implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetSessionHistoryResponse getSessionHistoryDirect() throws Exception {
|
public GetSessionHistoryResponse getSessionHistoryDirect() throws Exception {
|
||||||
return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -280,7 +239,6 @@ public class Sessions implements
|
|||||||
|
|
||||||
* @param librarySectionID Filters the results based on the id of a valid library section
|
* @param librarySectionID Filters the results based on the id of a valid library section
|
||||||
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
@@ -288,12 +246,7 @@ public class Sessions implements
|
|||||||
Optional<String> sort,
|
Optional<String> sort,
|
||||||
Optional<Long> accountId,
|
Optional<Long> accountId,
|
||||||
Optional<? extends QueryParamFilter> filter,
|
Optional<? extends QueryParamFilter> filter,
|
||||||
Optional<Long> librarySectionID,
|
Optional<Long> librarySectionID) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
GetSessionHistoryRequest request =
|
GetSessionHistoryRequest request =
|
||||||
GetSessionHistoryRequest
|
GetSessionHistoryRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -323,62 +276,45 @@ public class Sessions implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getSessionHistory",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getSessionHistory",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getSessionHistory",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getSessionHistory",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getSessionHistory",
|
|
||||||
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(
|
|
||||||
"getSessionHistory",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getSessionHistory",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -472,22 +408,6 @@ public class Sessions implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception {
|
public GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception {
|
||||||
return getTranscodeSessions(Optional.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Transcode Sessions
|
|
||||||
* Get Transcode Sessions
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
|
||||||
* @throws Exception if the API call fails
|
|
||||||
*/
|
|
||||||
public GetTranscodeSessionsResponse getTranscodeSessions(
|
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
String _baseUrl = Utils.templateUrl(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -503,62 +423,45 @@ public class Sessions implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getTranscodeSessions",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getTranscodeSessions",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getTranscodeSessions",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getTranscodeSessions",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getTranscodeSessions",
|
|
||||||
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(
|
|
||||||
"getTranscodeSessions",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getTranscodeSessions",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -654,24 +557,6 @@ public class Sessions implements
|
|||||||
*/
|
*/
|
||||||
public StopTranscodeSessionResponse stopTranscodeSession(
|
public StopTranscodeSessionResponse stopTranscodeSession(
|
||||||
String sessionKey) throws Exception {
|
String sessionKey) throws Exception {
|
||||||
return stopTranscodeSession(sessionKey, Optional.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stop a Transcode Session
|
|
||||||
* Stop a Transcode Session
|
|
||||||
* @param sessionKey the Key of the transcode session to stop
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
|
||||||
* @throws Exception if the API call fails
|
|
||||||
*/
|
|
||||||
public StopTranscodeSessionResponse stopTranscodeSession(
|
|
||||||
String sessionKey,
|
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
StopTranscodeSessionRequest request =
|
StopTranscodeSessionRequest request =
|
||||||
StopTranscodeSessionRequest
|
StopTranscodeSessionRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -695,62 +580,45 @@ public class Sessions implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"stopTranscodeSession",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"stopTranscodeSession",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"stopTranscodeSession",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"stopTranscodeSession",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"stopTranscodeSession",
|
|
||||||
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(
|
|
||||||
"stopTranscodeSession",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"stopTranscodeSession",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -25,16 +25,11 @@ import dev.plexapi.sdk.models.operations.GetStatisticsRequestBuilder;
|
|||||||
import dev.plexapi.sdk.models.operations.GetStatisticsResponse;
|
import dev.plexapi.sdk.models.operations.GetStatisticsResponse;
|
||||||
import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody;
|
import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody;
|
||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
@@ -42,11 +37,8 @@ import java.lang.Long;
|
|||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API Calls that perform operations with Plex Media Server Statistics
|
* API Calls that perform operations with Plex Media Server Statistics
|
||||||
@@ -80,7 +72,7 @@ public class Statistics implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetStatisticsResponse getStatisticsDirect() throws Exception {
|
public GetStatisticsResponse getStatisticsDirect() throws Exception {
|
||||||
return getStatistics(Optional.empty(), Optional.empty());
|
return getStatistics(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,17 +81,11 @@ public class Statistics implements
|
|||||||
* @param timespan The timespan to retrieve statistics for
|
* @param timespan The timespan to retrieve statistics for
|
||||||
the exact meaning of this parameter is not known
|
the exact meaning of this parameter is not known
|
||||||
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetStatisticsResponse getStatistics(
|
public GetStatisticsResponse getStatistics(
|
||||||
Optional<Long> timespan,
|
Optional<Long> timespan) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
GetStatisticsRequest request =
|
GetStatisticsRequest request =
|
||||||
GetStatisticsRequest
|
GetStatisticsRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -126,62 +112,45 @@ public class Statistics implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getStatistics",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getStatistics",
|
|
||||||
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(
|
|
||||||
"getStatistics",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getStatistics",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -275,7 +244,7 @@ public class Statistics implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetResourcesStatisticsResponse getResourcesStatisticsDirect() throws Exception {
|
public GetResourcesStatisticsResponse getResourcesStatisticsDirect() throws Exception {
|
||||||
return getResourcesStatistics(Optional.empty(), Optional.empty());
|
return getResourcesStatistics(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -284,17 +253,11 @@ public class Statistics implements
|
|||||||
* @param timespan The timespan to retrieve statistics for
|
* @param timespan The timespan to retrieve statistics for
|
||||||
the exact meaning of this parameter is not known
|
the exact meaning of this parameter is not known
|
||||||
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetResourcesStatisticsResponse getResourcesStatistics(
|
public GetResourcesStatisticsResponse getResourcesStatistics(
|
||||||
Optional<Long> timespan,
|
Optional<Long> timespan) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
GetResourcesStatisticsRequest request =
|
GetResourcesStatisticsRequest request =
|
||||||
GetResourcesStatisticsRequest
|
GetResourcesStatisticsRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -321,62 +284,45 @@ public class Statistics implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getResourcesStatistics",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getResourcesStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getResourcesStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getResourcesStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getResourcesStatistics",
|
|
||||||
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(
|
|
||||||
"getResourcesStatistics",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getResourcesStatistics",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -470,7 +416,7 @@ public class Statistics implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetBandwidthStatisticsResponse getBandwidthStatisticsDirect() throws Exception {
|
public GetBandwidthStatisticsResponse getBandwidthStatisticsDirect() throws Exception {
|
||||||
return getBandwidthStatistics(Optional.empty(), Optional.empty());
|
return getBandwidthStatistics(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -479,17 +425,11 @@ public class Statistics implements
|
|||||||
* @param timespan The timespan to retrieve statistics for
|
* @param timespan The timespan to retrieve statistics for
|
||||||
the exact meaning of this parameter is not known
|
the exact meaning of this parameter is not known
|
||||||
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetBandwidthStatisticsResponse getBandwidthStatistics(
|
public GetBandwidthStatisticsResponse getBandwidthStatistics(
|
||||||
Optional<Long> timespan,
|
Optional<Long> timespan) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
GetBandwidthStatisticsRequest request =
|
GetBandwidthStatisticsRequest request =
|
||||||
GetBandwidthStatisticsRequest
|
GetBandwidthStatisticsRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -516,62 +456,45 @@ public class Statistics implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getBandwidthStatistics",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getBandwidthStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getBandwidthStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getBandwidthStatistics",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getBandwidthStatistics",
|
|
||||||
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(
|
|
||||||
"getBandwidthStatistics",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getBandwidthStatistics",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -25,27 +25,19 @@ import dev.plexapi.sdk.models.operations.GetUpdateStatusResponseBody;
|
|||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.models.operations.Skip;
|
import dev.plexapi.sdk.models.operations.Skip;
|
||||||
import dev.plexapi.sdk.models.operations.Tonight;
|
import dev.plexapi.sdk.models.operations.Tonight;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This describes the API for searching and applying updates to the Plex Media Server.
|
* This describes the API for searching and applying updates to the Plex Media Server.
|
||||||
@@ -80,22 +72,6 @@ public class Updater implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetUpdateStatusResponse getUpdateStatusDirect() throws Exception {
|
public GetUpdateStatusResponse getUpdateStatusDirect() throws Exception {
|
||||||
return getUpdateStatus(Optional.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Querying status of updates
|
|
||||||
* Querying status of updates
|
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
|
||||||
* @throws Exception if the API call fails
|
|
||||||
*/
|
|
||||||
public GetUpdateStatusResponse getUpdateStatus(
|
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
String _baseUrl = Utils.templateUrl(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -111,62 +87,45 @@ public class Updater implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getUpdateStatus",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getUpdateStatus",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getUpdateStatus",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getUpdateStatus",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getUpdateStatus",
|
|
||||||
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(
|
|
||||||
"getUpdateStatus",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getUpdateStatus",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -260,24 +219,18 @@ public class Updater implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public CheckForUpdatesResponse checkForUpdatesDirect() throws Exception {
|
public CheckForUpdatesResponse checkForUpdatesDirect() throws Exception {
|
||||||
return checkForUpdates(Optional.empty(), Optional.empty());
|
return checkForUpdates(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checking for updates
|
* Checking for updates
|
||||||
* Checking for updates
|
* Checking for updates
|
||||||
* @param download Indicate that you want to start download any updates found.
|
* @param download Indicate that you want to start download any updates found.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public CheckForUpdatesResponse checkForUpdates(
|
public CheckForUpdatesResponse checkForUpdates(
|
||||||
Optional<? extends Download> download,
|
Optional<? extends Download> download) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
CheckForUpdatesRequest request =
|
CheckForUpdatesRequest request =
|
||||||
CheckForUpdatesRequest
|
CheckForUpdatesRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -304,62 +257,45 @@ public class Updater implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"checkForUpdates",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"checkForUpdates",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"checkForUpdates",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"checkForUpdates",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"checkForUpdates",
|
|
||||||
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(
|
|
||||||
"checkForUpdates",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"checkForUpdates",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -444,7 +380,7 @@ public class Updater implements
|
|||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public ApplyUpdatesResponse applyUpdatesDirect() throws Exception {
|
public ApplyUpdatesResponse applyUpdatesDirect() throws Exception {
|
||||||
return applyUpdates(Optional.empty(), Optional.empty(), Optional.empty());
|
return applyUpdates(Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -453,18 +389,12 @@ public class Updater implements
|
|||||||
*
|
*
|
||||||
* @param tonight Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install
|
* @param tonight Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install
|
||||||
* @param skip Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`.
|
* @param skip Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public ApplyUpdatesResponse applyUpdates(
|
public ApplyUpdatesResponse applyUpdates(
|
||||||
Optional<? extends Tonight> tonight,
|
Optional<? extends Tonight> tonight,
|
||||||
Optional<? extends Skip> skip,
|
Optional<? extends Skip> skip) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
ApplyUpdatesRequest request =
|
ApplyUpdatesRequest request =
|
||||||
ApplyUpdatesRequest
|
ApplyUpdatesRequest
|
||||||
.builder()
|
.builder()
|
||||||
@@ -492,62 +422,45 @@ public class Updater implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"applyUpdates",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "500", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"applyUpdates",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"applyUpdates",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"applyUpdates",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"applyUpdates",
|
|
||||||
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(
|
|
||||||
"applyUpdates",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"applyUpdates",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -17,27 +17,19 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
|||||||
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest;
|
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest;
|
||||||
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequestBuilder;
|
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequestBuilder;
|
||||||
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse;
|
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API Calls that perform operations with Plex Media Server Videos
|
* API Calls that perform operations with Plex Media Server Videos
|
||||||
@@ -72,24 +64,6 @@ public class Video implements
|
|||||||
*/
|
*/
|
||||||
public GetTimelineResponse getTimeline(
|
public GetTimelineResponse getTimeline(
|
||||||
GetTimelineRequest request) throws Exception {
|
GetTimelineRequest request) throws Exception {
|
||||||
return getTimeline(request, Optional.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the timeline for a media item
|
|
||||||
* Get the timeline for a 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 GetTimelineResponse getTimeline(
|
|
||||||
GetTimelineRequest request,
|
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
String _baseUrl = Utils.templateUrl(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -110,62 +84,45 @@ public class Video implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"getTimeline",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"getTimeline",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"getTimeline",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"getTimeline",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"getTimeline",
|
|
||||||
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(
|
|
||||||
"getTimeline",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"getTimeline",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
@@ -250,24 +207,6 @@ public class Video implements
|
|||||||
*/
|
*/
|
||||||
public StartUniversalTranscodeResponse startUniversalTranscode(
|
public StartUniversalTranscodeResponse startUniversalTranscode(
|
||||||
StartUniversalTranscodeRequest request) throws Exception {
|
StartUniversalTranscodeRequest request) throws Exception {
|
||||||
return startUniversalTranscode(request, Optional.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start Universal Transcode
|
|
||||||
* Begin a Universal Transcode Session
|
|
||||||
* @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 StartUniversalTranscodeResponse startUniversalTranscode(
|
|
||||||
StartUniversalTranscodeRequest request,
|
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
String _baseUrl = Utils.templateUrl(
|
String _baseUrl = Utils.templateUrl(
|
||||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||||
String _url = Utils.generateURL(
|
String _url = Utils.generateURL(
|
||||||
@@ -288,62 +227,45 @@ public class Video implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"startUniversalTranscode",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"startUniversalTranscode",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"startUniversalTranscode",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"startUniversalTranscode",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"startUniversalTranscode",
|
|
||||||
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(
|
|
||||||
"startUniversalTranscode",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
Optional.empty(),
|
|
||||||
Optional.of(_e));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.retryConfig(_retryConfig)
|
|
||||||
.statusCodes(_statusCodes)
|
|
||||||
.build();
|
|
||||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
|
||||||
.afterSuccess(
|
|
||||||
new AfterSuccessContextImpl(
|
|
||||||
"startUniversalTranscode",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -13,28 +13,20 @@ import dev.plexapi.sdk.models.operations.GetWatchListRequestBuilder;
|
|||||||
import dev.plexapi.sdk.models.operations.GetWatchListResponse;
|
import dev.plexapi.sdk.models.operations.GetWatchListResponse;
|
||||||
import dev.plexapi.sdk.models.operations.GetWatchListResponseBody;
|
import dev.plexapi.sdk.models.operations.GetWatchListResponseBody;
|
||||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
|
||||||
import dev.plexapi.sdk.utils.HTTPClient;
|
import dev.plexapi.sdk.utils.HTTPClient;
|
||||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
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 dev.plexapi.sdk.utils.Utils;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API Calls that perform operations with Plex Media Server Watchlists
|
* API Calls that perform operations with Plex Media Server Watchlists
|
||||||
@@ -78,7 +70,7 @@ public class Watchlist implements
|
|||||||
*/
|
*/
|
||||||
public GetWatchListResponse getWatchList(
|
public GetWatchListResponse getWatchList(
|
||||||
GetWatchListRequest request) throws Exception {
|
GetWatchListRequest request) throws Exception {
|
||||||
return getWatchList(request, Optional.empty(), Optional.empty());
|
return getWatchList(request, Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,18 +78,12 @@ public class Watchlist implements
|
|||||||
* Get User Watchlist
|
* Get User Watchlist
|
||||||
* @param request The request object containing all of the parameters for the API call.
|
* @param request The request object containing all of the parameters for the API call.
|
||||||
* @param serverURL Overrides the server URL.
|
* @param serverURL Overrides the server URL.
|
||||||
* @param options additional options
|
|
||||||
* @return The response from the API call
|
* @return The response from the API call
|
||||||
* @throws Exception if the API call fails
|
* @throws Exception if the API call fails
|
||||||
*/
|
*/
|
||||||
public GetWatchListResponse getWatchList(
|
public GetWatchListResponse getWatchList(
|
||||||
GetWatchListRequest request,
|
GetWatchListRequest request,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception {
|
||||||
Optional<Options> options) throws Exception {
|
|
||||||
|
|
||||||
if (options.isPresent()) {
|
|
||||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
|
||||||
}
|
|
||||||
String _baseUrl = Utils.templateUrl(GET_WATCH_LIST_SERVERS[0], new HashMap<String, String>());
|
String _baseUrl = Utils.templateUrl(GET_WATCH_LIST_SERVERS[0], new HashMap<String, String>());
|
||||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||||
_baseUrl = serverURL.get();
|
_baseUrl = serverURL.get();
|
||||||
@@ -123,62 +109,45 @@ public class Watchlist implements
|
|||||||
this.sdkConfiguration.securitySource.getSecurity());
|
this.sdkConfiguration.securitySource.getSecurity());
|
||||||
|
|
||||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||||
HTTPRequest _finalReq = _req;
|
HttpRequest _r =
|
||||||
RetryConfig _retryConfig;
|
sdkConfiguration.hooks()
|
||||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
.beforeRequest(
|
||||||
_retryConfig = options.get().retryConfig().get();
|
new BeforeRequestContextImpl(
|
||||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
"get-watch-list",
|
||||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
Optional.of(List.of()),
|
||||||
} else {
|
sdkConfiguration.securitySource()),
|
||||||
_retryConfig = RetryConfig.builder()
|
_req.build());
|
||||||
.backoff(BackoffStrategy.builder()
|
HttpResponse<InputStream> _httpRes;
|
||||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
try {
|
||||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
_httpRes = _client.send(_r);
|
||||||
.baseFactor((double)(1.5))
|
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
_httpRes = sdkConfiguration.hooks()
|
||||||
.retryConnectError(true)
|
.afterError(
|
||||||
.build())
|
new AfterErrorContextImpl(
|
||||||
.build();
|
"get-watch-list",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.of(_httpRes),
|
||||||
|
Optional.empty());
|
||||||
|
} else {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterSuccess(
|
||||||
|
new AfterSuccessContextImpl(
|
||||||
|
"get-watch-list",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
_httpRes);
|
||||||
|
}
|
||||||
|
} catch (Exception _e) {
|
||||||
|
_httpRes = sdkConfiguration.hooks()
|
||||||
|
.afterError(
|
||||||
|
new AfterErrorContextImpl(
|
||||||
|
"get-watch-list",
|
||||||
|
Optional.of(List.of()),
|
||||||
|
sdkConfiguration.securitySource()),
|
||||||
|
Optional.empty(),
|
||||||
|
Optional.of(_e));
|
||||||
}
|
}
|
||||||
List<String> _statusCodes = new ArrayList<>();
|
|
||||||
_statusCodes.add("5XX");
|
|
||||||
Retries _retries = Retries.builder()
|
|
||||||
.action(() -> {
|
|
||||||
HttpRequest _r = null;
|
|
||||||
try {
|
|
||||||
_r = sdkConfiguration.hooks()
|
|
||||||
.beforeRequest(
|
|
||||||
new BeforeRequestContextImpl(
|
|
||||||
"get-watch-list",
|
|
||||||
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-watch-list",
|
|
||||||
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-watch-list",
|
|
||||||
Optional.of(List.of()),
|
|
||||||
sdkConfiguration.securitySource()),
|
|
||||||
_retries.run());
|
|
||||||
String _contentType = _httpRes
|
String _contentType = _httpRes
|
||||||
.headers()
|
.headers()
|
||||||
.firstValue("Content-Type")
|
.firstValue("Content-Type")
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
@@ -16,7 +14,6 @@ public class AddPlaylistContentsRequestBuilder {
|
|||||||
private Double playlistID;
|
private Double playlistID;
|
||||||
private String uri;
|
private String uri;
|
||||||
private Optional<Double> playQueueID = Optional.empty();
|
private Optional<Double> playQueueID = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallAddPlaylistContents sdk;
|
private final SDKMethodInterfaces.MethodCallAddPlaylistContents sdk;
|
||||||
|
|
||||||
public AddPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallAddPlaylistContents sdk) {
|
public AddPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallAddPlaylistContents sdk) {
|
||||||
@@ -46,27 +43,12 @@ public class AddPlaylistContentsRequestBuilder {
|
|||||||
this.playQueueID = playQueueID;
|
this.playQueueID = playQueueID;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddPlaylistContentsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AddPlaylistContentsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AddPlaylistContentsResponse call() throws Exception {
|
public AddPlaylistContentsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.addPlaylistContents(
|
return sdk.addPlaylistContents(
|
||||||
playlistID,
|
playlistID,
|
||||||
uri,
|
uri,
|
||||||
playQueueID,
|
playQueueID);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@@ -13,7 +11,6 @@ public class ApplyUpdatesRequestBuilder {
|
|||||||
|
|
||||||
private Optional<? extends Tonight> tonight = Optional.empty();
|
private Optional<? extends Tonight> tonight = Optional.empty();
|
||||||
private Optional<? extends Skip> skip = Optional.empty();
|
private Optional<? extends Skip> skip = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallApplyUpdates sdk;
|
private final SDKMethodInterfaces.MethodCallApplyUpdates sdk;
|
||||||
|
|
||||||
public ApplyUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallApplyUpdates sdk) {
|
public ApplyUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallApplyUpdates sdk) {
|
||||||
@@ -43,26 +40,11 @@ public class ApplyUpdatesRequestBuilder {
|
|||||||
this.skip = skip;
|
this.skip = skip;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApplyUpdatesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApplyUpdatesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApplyUpdatesResponse call() throws Exception {
|
public ApplyUpdatesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.applyUpdates(
|
return sdk.applyUpdates(
|
||||||
tonight,
|
tonight,
|
||||||
skip,
|
skip);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class CancelServerActivitiesRequestBuilder {
|
public class CancelServerActivitiesRequestBuilder {
|
||||||
|
|
||||||
private String activityUUID;
|
private String activityUUID;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallCancelServerActivities sdk;
|
private final SDKMethodInterfaces.MethodCallCancelServerActivities sdk;
|
||||||
|
|
||||||
public CancelServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallCancelServerActivities sdk) {
|
public CancelServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallCancelServerActivities sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class CancelServerActivitiesRequestBuilder {
|
|||||||
this.activityUUID = activityUUID;
|
this.activityUUID = activityUUID;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CancelServerActivitiesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CancelServerActivitiesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CancelServerActivitiesResponse call() throws Exception {
|
public CancelServerActivitiesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.cancelServerActivities(
|
return sdk.cancelServerActivities(
|
||||||
activityUUID,
|
activityUUID);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public class CheckForUpdatesRequestBuilder {
|
public class CheckForUpdatesRequestBuilder {
|
||||||
|
|
||||||
private Optional<? extends Download> download = Optional.empty();
|
private Optional<? extends Download> download = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallCheckForUpdates sdk;
|
private final SDKMethodInterfaces.MethodCallCheckForUpdates sdk;
|
||||||
|
|
||||||
public CheckForUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallCheckForUpdates sdk) {
|
public CheckForUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallCheckForUpdates sdk) {
|
||||||
@@ -30,25 +27,10 @@ public class CheckForUpdatesRequestBuilder {
|
|||||||
this.download = download;
|
this.download = download;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckForUpdatesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CheckForUpdatesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CheckForUpdatesResponse call() throws Exception {
|
public CheckForUpdatesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.checkForUpdates(
|
return sdk.checkForUpdates(
|
||||||
download,
|
download);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class ClearPlaylistContentsRequestBuilder {
|
public class ClearPlaylistContentsRequestBuilder {
|
||||||
|
|
||||||
private Double playlistID;
|
private Double playlistID;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallClearPlaylistContents sdk;
|
private final SDKMethodInterfaces.MethodCallClearPlaylistContents sdk;
|
||||||
|
|
||||||
public ClearPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallClearPlaylistContents sdk) {
|
public ClearPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallClearPlaylistContents sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class ClearPlaylistContentsRequestBuilder {
|
|||||||
this.playlistID = playlistID;
|
this.playlistID = playlistID;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClearPlaylistContentsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClearPlaylistContentsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClearPlaylistContentsResponse call() throws Exception {
|
public ClearPlaylistContentsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.clearPlaylistContents(
|
return sdk.clearPlaylistContents(
|
||||||
playlistID,
|
playlistID);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class CreatePlaylistRequestBuilder {
|
public class CreatePlaylistRequestBuilder {
|
||||||
|
|
||||||
private CreatePlaylistRequest request;
|
private CreatePlaylistRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallCreatePlaylist sdk;
|
private final SDKMethodInterfaces.MethodCallCreatePlaylist sdk;
|
||||||
|
|
||||||
public CreatePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallCreatePlaylist sdk) {
|
public CreatePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallCreatePlaylist sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class CreatePlaylistRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CreatePlaylistRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CreatePlaylistRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CreatePlaylistResponse call() throws Exception {
|
public CreatePlaylistResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.createPlaylist(
|
return sdk.createPlaylist(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class DeleteLibraryRequestBuilder {
|
public class DeleteLibraryRequestBuilder {
|
||||||
|
|
||||||
private Integer sectionKey;
|
private Integer sectionKey;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallDeleteLibrary sdk;
|
private final SDKMethodInterfaces.MethodCallDeleteLibrary sdk;
|
||||||
|
|
||||||
public DeleteLibraryRequestBuilder(SDKMethodInterfaces.MethodCallDeleteLibrary sdk) {
|
public DeleteLibraryRequestBuilder(SDKMethodInterfaces.MethodCallDeleteLibrary sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class DeleteLibraryRequestBuilder {
|
|||||||
this.sectionKey = sectionKey;
|
this.sectionKey = sectionKey;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeleteLibraryRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DeleteLibraryRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DeleteLibraryResponse call() throws Exception {
|
public DeleteLibraryResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.deleteLibrary(
|
return sdk.deleteLibrary(
|
||||||
sectionKey,
|
sectionKey);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class DeletePlaylistRequestBuilder {
|
public class DeletePlaylistRequestBuilder {
|
||||||
|
|
||||||
private Double playlistID;
|
private Double playlistID;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallDeletePlaylist sdk;
|
private final SDKMethodInterfaces.MethodCallDeletePlaylist sdk;
|
||||||
|
|
||||||
public DeletePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallDeletePlaylist sdk) {
|
public DeletePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallDeletePlaylist sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class DeletePlaylistRequestBuilder {
|
|||||||
this.playlistID = playlistID;
|
this.playlistID = playlistID;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeletePlaylistRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DeletePlaylistRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DeletePlaylistResponse call() throws Exception {
|
public DeletePlaylistResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.deletePlaylist(
|
return sdk.deletePlaylist(
|
||||||
playlistID,
|
playlistID);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class EnablePaperTrailRequestBuilder {
|
public class EnablePaperTrailRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallEnablePaperTrail sdk;
|
private final SDKMethodInterfaces.MethodCallEnablePaperTrail sdk;
|
||||||
|
|
||||||
public EnablePaperTrailRequestBuilder(SDKMethodInterfaces.MethodCallEnablePaperTrail sdk) {
|
public EnablePaperTrailRequestBuilder(SDKMethodInterfaces.MethodCallEnablePaperTrail sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnablePaperTrailRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnablePaperTrailRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnablePaperTrailResponse call() throws Exception {
|
public EnablePaperTrailResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.enablePaperTrailDirect();
|
||||||
.build());
|
|
||||||
return sdk.enablePaperTrail(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetAllLibrariesRequestBuilder {
|
public class GetAllLibrariesRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetAllLibraries sdk;
|
private final SDKMethodInterfaces.MethodCallGetAllLibraries sdk;
|
||||||
|
|
||||||
public GetAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetAllLibraries sdk) {
|
public GetAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetAllLibraries sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetAllLibrariesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetAllLibrariesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetAllLibrariesResponse call() throws Exception {
|
public GetAllLibrariesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getAllLibrariesDirect();
|
||||||
.build());
|
|
||||||
return sdk.getAllLibraries(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetAvailableClientsRequestBuilder {
|
public class GetAvailableClientsRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetAvailableClients sdk;
|
private final SDKMethodInterfaces.MethodCallGetAvailableClients sdk;
|
||||||
|
|
||||||
public GetAvailableClientsRequestBuilder(SDKMethodInterfaces.MethodCallGetAvailableClients sdk) {
|
public GetAvailableClientsRequestBuilder(SDKMethodInterfaces.MethodCallGetAvailableClients sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetAvailableClientsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetAvailableClientsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetAvailableClientsResponse call() throws Exception {
|
public GetAvailableClientsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getAvailableClientsDirect();
|
||||||
.build());
|
|
||||||
return sdk.getAvailableClients(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -13,7 +11,6 @@ import java.util.Optional;
|
|||||||
public class GetBandwidthStatisticsRequestBuilder {
|
public class GetBandwidthStatisticsRequestBuilder {
|
||||||
|
|
||||||
private Optional<Long> timespan = Optional.empty();
|
private Optional<Long> timespan = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk;
|
private final SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk;
|
||||||
|
|
||||||
public GetBandwidthStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk) {
|
public GetBandwidthStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk) {
|
||||||
@@ -31,25 +28,10 @@ public class GetBandwidthStatisticsRequestBuilder {
|
|||||||
this.timespan = timespan;
|
this.timespan = timespan;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetBandwidthStatisticsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetBandwidthStatisticsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetBandwidthStatisticsResponse call() throws Exception {
|
public GetBandwidthStatisticsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getBandwidthStatistics(
|
return sdk.getBandwidthStatistics(
|
||||||
timespan,
|
timespan);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetBannerImageRequestBuilder {
|
public class GetBannerImageRequestBuilder {
|
||||||
|
|
||||||
private GetBannerImageRequest request;
|
private GetBannerImageRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetBannerImage sdk;
|
private final SDKMethodInterfaces.MethodCallGetBannerImage sdk;
|
||||||
|
|
||||||
public GetBannerImageRequestBuilder(SDKMethodInterfaces.MethodCallGetBannerImage sdk) {
|
public GetBannerImageRequestBuilder(SDKMethodInterfaces.MethodCallGetBannerImage sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class GetBannerImageRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetBannerImageRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetBannerImageRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetBannerImageResponse call() throws Exception {
|
public GetBannerImageResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getBannerImage(
|
return sdk.getBannerImage(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetButlerTasksRequestBuilder {
|
public class GetButlerTasksRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetButlerTasks sdk;
|
private final SDKMethodInterfaces.MethodCallGetButlerTasks sdk;
|
||||||
|
|
||||||
public GetButlerTasksRequestBuilder(SDKMethodInterfaces.MethodCallGetButlerTasks sdk) {
|
public GetButlerTasksRequestBuilder(SDKMethodInterfaces.MethodCallGetButlerTasks sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetButlerTasksRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetButlerTasksRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetButlerTasksResponse call() throws Exception {
|
public GetButlerTasksResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getButlerTasksDirect();
|
||||||
.build());
|
|
||||||
return sdk.getButlerTasks(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -13,7 +11,6 @@ import java.util.Optional;
|
|||||||
public class GetCompanionsDataRequestBuilder {
|
public class GetCompanionsDataRequestBuilder {
|
||||||
|
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetCompanionsData sdk;
|
private final SDKMethodInterfaces.MethodCallGetCompanionsData sdk;
|
||||||
|
|
||||||
public GetCompanionsDataRequestBuilder(SDKMethodInterfaces.MethodCallGetCompanionsData sdk) {
|
public GetCompanionsDataRequestBuilder(SDKMethodInterfaces.MethodCallGetCompanionsData sdk) {
|
||||||
@@ -31,25 +28,10 @@ public class GetCompanionsDataRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetCompanionsDataRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetCompanionsDataRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetCompanionsDataResponse call() throws Exception {
|
public GetCompanionsDataResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getCompanionsData(
|
return sdk.getCompanionsData(
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetDevicesRequestBuilder {
|
public class GetDevicesRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetDevices sdk;
|
private final SDKMethodInterfaces.MethodCallGetDevices sdk;
|
||||||
|
|
||||||
public GetDevicesRequestBuilder(SDKMethodInterfaces.MethodCallGetDevices sdk) {
|
public GetDevicesRequestBuilder(SDKMethodInterfaces.MethodCallGetDevices sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetDevicesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetDevicesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetDevicesResponse call() throws Exception {
|
public GetDevicesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getDevicesDirect();
|
||||||
.build());
|
|
||||||
return sdk.getDevices(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
@@ -15,7 +13,6 @@ public class GetFileHashRequestBuilder {
|
|||||||
|
|
||||||
private String url;
|
private String url;
|
||||||
private Optional<Double> type = Optional.empty();
|
private Optional<Double> type = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetFileHash sdk;
|
private final SDKMethodInterfaces.MethodCallGetFileHash sdk;
|
||||||
|
|
||||||
public GetFileHashRequestBuilder(SDKMethodInterfaces.MethodCallGetFileHash sdk) {
|
public GetFileHashRequestBuilder(SDKMethodInterfaces.MethodCallGetFileHash sdk) {
|
||||||
@@ -39,26 +36,11 @@ public class GetFileHashRequestBuilder {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetFileHashRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetFileHashRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetFileHashResponse call() throws Exception {
|
public GetFileHashResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getFileHash(
|
return sdk.getFileHash(
|
||||||
url,
|
url,
|
||||||
type,
|
type);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -13,7 +11,6 @@ import java.util.Optional;
|
|||||||
public class GetGeoDataRequestBuilder {
|
public class GetGeoDataRequestBuilder {
|
||||||
|
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetGeoData sdk;
|
private final SDKMethodInterfaces.MethodCallGetGeoData sdk;
|
||||||
|
|
||||||
public GetGeoDataRequestBuilder(SDKMethodInterfaces.MethodCallGetGeoData sdk) {
|
public GetGeoDataRequestBuilder(SDKMethodInterfaces.MethodCallGetGeoData sdk) {
|
||||||
@@ -31,25 +28,10 @@ public class GetGeoDataRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetGeoDataRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetGeoDataRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetGeoDataResponse call() throws Exception {
|
public GetGeoDataResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getGeoData(
|
return sdk.getGeoData(
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -14,7 +12,6 @@ public class GetGlobalHubsRequestBuilder {
|
|||||||
|
|
||||||
private Optional<Double> count = Optional.empty();
|
private Optional<Double> count = Optional.empty();
|
||||||
private Optional<? extends OnlyTransient> onlyTransient = Optional.empty();
|
private Optional<? extends OnlyTransient> onlyTransient = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetGlobalHubs sdk;
|
private final SDKMethodInterfaces.MethodCallGetGlobalHubs sdk;
|
||||||
|
|
||||||
public GetGlobalHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetGlobalHubs sdk) {
|
public GetGlobalHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetGlobalHubs sdk) {
|
||||||
@@ -44,26 +41,11 @@ public class GetGlobalHubsRequestBuilder {
|
|||||||
this.onlyTransient = onlyTransient;
|
this.onlyTransient = onlyTransient;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetGlobalHubsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetGlobalHubsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetGlobalHubsResponse call() throws Exception {
|
public GetGlobalHubsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getGlobalHubs(
|
return sdk.getGlobalHubs(
|
||||||
count,
|
count,
|
||||||
onlyTransient,
|
onlyTransient);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetHomeDataRequestBuilder {
|
public class GetHomeDataRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetHomeData sdk;
|
private final SDKMethodInterfaces.MethodCallGetHomeData sdk;
|
||||||
|
|
||||||
public GetHomeDataRequestBuilder(SDKMethodInterfaces.MethodCallGetHomeData sdk) {
|
public GetHomeDataRequestBuilder(SDKMethodInterfaces.MethodCallGetHomeData sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetHomeDataRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetHomeDataRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetHomeDataResponse call() throws Exception {
|
public GetHomeDataResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getHomeDataDirect();
|
||||||
.build());
|
|
||||||
return sdk.getHomeData(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ package dev.plexapi.sdk.models.operations;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import dev.plexapi.sdk.utils.LazySingletonValue;
|
import dev.plexapi.sdk.utils.LazySingletonValue;
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -19,7 +17,6 @@ public class GetLibraryDetailsRequestBuilder {
|
|||||||
"0",
|
"0",
|
||||||
new TypeReference<Optional<? extends IncludeDetails>>() {});
|
new TypeReference<Optional<? extends IncludeDetails>>() {});
|
||||||
private Integer sectionKey;
|
private Integer sectionKey;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetLibraryDetails sdk;
|
private final SDKMethodInterfaces.MethodCallGetLibraryDetails sdk;
|
||||||
|
|
||||||
public GetLibraryDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryDetails sdk) {
|
public GetLibraryDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryDetails sdk) {
|
||||||
@@ -43,29 +40,14 @@ public class GetLibraryDetailsRequestBuilder {
|
|||||||
this.sectionKey = sectionKey;
|
this.sectionKey = sectionKey;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetLibraryDetailsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetLibraryDetailsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetLibraryDetailsResponse call() throws Exception {
|
public GetLibraryDetailsResponse call() throws Exception {
|
||||||
if (includeDetails == null) {
|
if (includeDetails == null) {
|
||||||
includeDetails = _SINGLETON_VALUE_IncludeDetails.value();
|
includeDetails = _SINGLETON_VALUE_IncludeDetails.value();
|
||||||
} Optional<Options> options = Optional.of(Options.builder()
|
}
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getLibraryDetails(
|
return sdk.getLibraryDetails(
|
||||||
includeDetails,
|
includeDetails,
|
||||||
sectionKey,
|
sectionKey);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final LazySingletonValue<Optional<? extends IncludeDetails>> _SINGLETON_VALUE_IncludeDetails =
|
private static final LazySingletonValue<Optional<? extends IncludeDetails>> _SINGLETON_VALUE_IncludeDetails =
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -15,7 +13,6 @@ public class GetLibraryHubsRequestBuilder {
|
|||||||
private Double sectionId;
|
private Double sectionId;
|
||||||
private Optional<Double> count = Optional.empty();
|
private Optional<Double> count = Optional.empty();
|
||||||
private Optional<? extends QueryParamOnlyTransient> onlyTransient = Optional.empty();
|
private Optional<? extends QueryParamOnlyTransient> onlyTransient = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetLibraryHubs sdk;
|
private final SDKMethodInterfaces.MethodCallGetLibraryHubs sdk;
|
||||||
|
|
||||||
public GetLibraryHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryHubs sdk) {
|
public GetLibraryHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryHubs sdk) {
|
||||||
@@ -51,27 +48,12 @@ public class GetLibraryHubsRequestBuilder {
|
|||||||
this.onlyTransient = onlyTransient;
|
this.onlyTransient = onlyTransient;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetLibraryHubsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetLibraryHubsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetLibraryHubsResponse call() throws Exception {
|
public GetLibraryHubsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getLibraryHubs(
|
return sdk.getLibraryHubs(
|
||||||
sectionId,
|
sectionId,
|
||||||
count,
|
count,
|
||||||
onlyTransient,
|
onlyTransient);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,8 +96,9 @@ public class GetLibraryItemsMediaContainer {
|
|||||||
@JsonProperty("mixedParents")
|
@JsonProperty("mixedParents")
|
||||||
private Optional<Boolean> mixedParents;
|
private Optional<Boolean> mixedParents;
|
||||||
|
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
@JsonProperty("Metadata")
|
@JsonProperty("Metadata")
|
||||||
private List<GetLibraryItemsMetadata> metadata;
|
private Optional<? extends List<GetLibraryItemsMetadata>> metadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
|
* The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
|
||||||
@@ -130,7 +131,7 @@ public class GetLibraryItemsMediaContainer {
|
|||||||
@JsonProperty("viewGroup") String viewGroup,
|
@JsonProperty("viewGroup") String viewGroup,
|
||||||
@JsonProperty("viewMode") Optional<Integer> viewMode,
|
@JsonProperty("viewMode") Optional<Integer> viewMode,
|
||||||
@JsonProperty("mixedParents") Optional<Boolean> mixedParents,
|
@JsonProperty("mixedParents") Optional<Boolean> mixedParents,
|
||||||
@JsonProperty("Metadata") List<GetLibraryItemsMetadata> metadata,
|
@JsonProperty("Metadata") Optional<? extends List<GetLibraryItemsMetadata>> metadata,
|
||||||
@JsonProperty("Meta") Optional<? extends GetLibraryItemsMeta> meta) {
|
@JsonProperty("Meta") Optional<? extends GetLibraryItemsMeta> meta) {
|
||||||
Utils.checkNotNull(type, "type");
|
Utils.checkNotNull(type, "type");
|
||||||
Utils.checkNotNull(fieldType, "fieldType");
|
Utils.checkNotNull(fieldType, "fieldType");
|
||||||
@@ -196,9 +197,8 @@ public class GetLibraryItemsMediaContainer {
|
|||||||
String thumb,
|
String thumb,
|
||||||
String title1,
|
String title1,
|
||||||
String title2,
|
String title2,
|
||||||
String viewGroup,
|
String viewGroup) {
|
||||||
List<GetLibraryItemsMetadata> metadata) {
|
this(Optional.empty(), Optional.empty(), size, totalSize, offset, content, allowSync, Optional.empty(), art, identifier, librarySectionID, librarySectionTitle, librarySectionUUID, mediaTagPrefix, mediaTagVersion, thumb, title1, title2, viewGroup, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||||
this(Optional.empty(), Optional.empty(), size, totalSize, offset, content, allowSync, Optional.empty(), art, identifier, librarySectionID, librarySectionTitle, librarySectionUUID, mediaTagPrefix, mediaTagVersion, thumb, title1, title2, viewGroup, Optional.empty(), Optional.empty(), metadata, Optional.empty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -308,9 +308,10 @@ public class GetLibraryItemsMediaContainer {
|
|||||||
return mixedParents;
|
return mixedParents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public List<GetLibraryItemsMetadata> metadata() {
|
public Optional<List<GetLibraryItemsMetadata>> metadata() {
|
||||||
return metadata;
|
return (Optional<List<GetLibraryItemsMetadata>>) metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -484,6 +485,12 @@ public class GetLibraryItemsMediaContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public GetLibraryItemsMediaContainer withMetadata(List<GetLibraryItemsMetadata> metadata) {
|
public GetLibraryItemsMediaContainer withMetadata(List<GetLibraryItemsMetadata> metadata) {
|
||||||
|
Utils.checkNotNull(metadata, "metadata");
|
||||||
|
this.metadata = Optional.ofNullable(metadata);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetLibraryItemsMediaContainer withMetadata(Optional<? extends List<GetLibraryItemsMetadata>> metadata) {
|
||||||
Utils.checkNotNull(metadata, "metadata");
|
Utils.checkNotNull(metadata, "metadata");
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
||||||
return this;
|
return this;
|
||||||
@@ -644,7 +651,7 @@ public class GetLibraryItemsMediaContainer {
|
|||||||
|
|
||||||
private Optional<Boolean> mixedParents = Optional.empty();
|
private Optional<Boolean> mixedParents = Optional.empty();
|
||||||
|
|
||||||
private List<GetLibraryItemsMetadata> metadata;
|
private Optional<? extends List<GetLibraryItemsMetadata>> metadata = Optional.empty();
|
||||||
|
|
||||||
private Optional<? extends GetLibraryItemsMeta> meta = Optional.empty();
|
private Optional<? extends GetLibraryItemsMeta> meta = Optional.empty();
|
||||||
|
|
||||||
@@ -809,6 +816,12 @@ public class GetLibraryItemsMediaContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Builder metadata(List<GetLibraryItemsMetadata> metadata) {
|
public Builder metadata(List<GetLibraryItemsMetadata> metadata) {
|
||||||
|
Utils.checkNotNull(metadata, "metadata");
|
||||||
|
this.metadata = Optional.ofNullable(metadata);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder metadata(Optional<? extends List<GetLibraryItemsMetadata>> metadata) {
|
||||||
Utils.checkNotNull(metadata, "metadata");
|
Utils.checkNotNull(metadata, "metadata");
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetLibraryItemsRequestBuilder {
|
public class GetLibraryItemsRequestBuilder {
|
||||||
|
|
||||||
private GetLibraryItemsRequest request;
|
private GetLibraryItemsRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetLibraryItems sdk;
|
private final SDKMethodInterfaces.MethodCallGetLibraryItems sdk;
|
||||||
|
|
||||||
public GetLibraryItemsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryItems sdk) {
|
public GetLibraryItemsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryItems sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class GetLibraryItemsRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetLibraryItemsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetLibraryItemsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetLibraryItemsResponse call() throws Exception {
|
public GetLibraryItemsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getLibraryItems(
|
return sdk.getLibraryItems(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetMediaProvidersRequestBuilder {
|
public class GetMediaProvidersRequestBuilder {
|
||||||
|
|
||||||
private String xPlexToken;
|
private String xPlexToken;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetMediaProviders sdk;
|
private final SDKMethodInterfaces.MethodCallGetMediaProviders sdk;
|
||||||
|
|
||||||
public GetMediaProvidersRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaProviders sdk) {
|
public GetMediaProvidersRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaProviders sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class GetMediaProvidersRequestBuilder {
|
|||||||
this.xPlexToken = xPlexToken;
|
this.xPlexToken = xPlexToken;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetMediaProvidersRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetMediaProvidersRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetMediaProvidersResponse call() throws Exception {
|
public GetMediaProvidersResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getMediaProviders(
|
return sdk.getMediaProviders(
|
||||||
xPlexToken,
|
xPlexToken);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetMetaDataByRatingKeyRequestBuilder {
|
public class GetMetaDataByRatingKeyRequestBuilder {
|
||||||
|
|
||||||
private Long ratingKey;
|
private Long ratingKey;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetMetaDataByRatingKey sdk;
|
private final SDKMethodInterfaces.MethodCallGetMetaDataByRatingKey sdk;
|
||||||
|
|
||||||
public GetMetaDataByRatingKeyRequestBuilder(SDKMethodInterfaces.MethodCallGetMetaDataByRatingKey sdk) {
|
public GetMetaDataByRatingKeyRequestBuilder(SDKMethodInterfaces.MethodCallGetMetaDataByRatingKey sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class GetMetaDataByRatingKeyRequestBuilder {
|
|||||||
this.ratingKey = ratingKey;
|
this.ratingKey = ratingKey;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetMetaDataByRatingKeyRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetMetaDataByRatingKeyRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetMetaDataByRatingKeyResponse call() throws Exception {
|
public GetMetaDataByRatingKeyResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getMetaDataByRatingKey(
|
return sdk.getMetaDataByRatingKey(
|
||||||
ratingKey,
|
ratingKey);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
@@ -15,7 +13,6 @@ public class GetMetadataChildrenRequestBuilder {
|
|||||||
|
|
||||||
private Double ratingKey;
|
private Double ratingKey;
|
||||||
private Optional<String> includeElements = Optional.empty();
|
private Optional<String> includeElements = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetMetadataChildren sdk;
|
private final SDKMethodInterfaces.MethodCallGetMetadataChildren sdk;
|
||||||
|
|
||||||
public GetMetadataChildrenRequestBuilder(SDKMethodInterfaces.MethodCallGetMetadataChildren sdk) {
|
public GetMetadataChildrenRequestBuilder(SDKMethodInterfaces.MethodCallGetMetadataChildren sdk) {
|
||||||
@@ -39,26 +36,11 @@ public class GetMetadataChildrenRequestBuilder {
|
|||||||
this.includeElements = includeElements;
|
this.includeElements = includeElements;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetMetadataChildrenRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetMetadataChildrenRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetMetadataChildrenResponse call() throws Exception {
|
public GetMetadataChildrenResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getMetadataChildren(
|
return sdk.getMetadataChildren(
|
||||||
ratingKey,
|
ratingKey,
|
||||||
includeElements,
|
includeElements);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetMyPlexAccountRequestBuilder {
|
public class GetMyPlexAccountRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk;
|
private final SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk;
|
||||||
|
|
||||||
public GetMyPlexAccountRequestBuilder(SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk) {
|
public GetMyPlexAccountRequestBuilder(SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetMyPlexAccountRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetMyPlexAccountRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetMyPlexAccountResponse call() throws Exception {
|
public GetMyPlexAccountResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getMyPlexAccountDirect();
|
||||||
.build());
|
|
||||||
return sdk.getMyPlexAccount(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetOnDeckRequestBuilder {
|
public class GetOnDeckRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetOnDeck sdk;
|
private final SDKMethodInterfaces.MethodCallGetOnDeck sdk;
|
||||||
|
|
||||||
public GetOnDeckRequestBuilder(SDKMethodInterfaces.MethodCallGetOnDeck sdk) {
|
public GetOnDeckRequestBuilder(SDKMethodInterfaces.MethodCallGetOnDeck sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetOnDeckRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetOnDeckRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetOnDeckResponse call() throws Exception {
|
public GetOnDeckResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getOnDeckDirect();
|
||||||
.build());
|
|
||||||
return sdk.getOnDeck(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -14,7 +12,6 @@ public class GetPinRequestBuilder {
|
|||||||
|
|
||||||
private GetPinRequest request;
|
private GetPinRequest request;
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetPin sdk;
|
private final SDKMethodInterfaces.MethodCallGetPin sdk;
|
||||||
|
|
||||||
public GetPinRequestBuilder(SDKMethodInterfaces.MethodCallGetPin sdk) {
|
public GetPinRequestBuilder(SDKMethodInterfaces.MethodCallGetPin sdk) {
|
||||||
@@ -38,26 +35,11 @@ public class GetPinRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetPinRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetPinRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetPinResponse call() throws Exception {
|
public GetPinResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getPin(
|
return sdk.getPin(
|
||||||
request,
|
request,
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,13 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetPlaylistContentsRequestBuilder {
|
public class GetPlaylistContentsRequestBuilder {
|
||||||
|
|
||||||
private Double playlistID;
|
private Double playlistID;
|
||||||
private GetPlaylistContentsQueryParamType type;
|
private GetPlaylistContentsQueryParamType type;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetPlaylistContents sdk;
|
private final SDKMethodInterfaces.MethodCallGetPlaylistContents sdk;
|
||||||
|
|
||||||
public GetPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylistContents sdk) {
|
public GetPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylistContents sdk) {
|
||||||
@@ -32,26 +28,11 @@ public class GetPlaylistContentsRequestBuilder {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetPlaylistContentsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetPlaylistContentsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetPlaylistContentsResponse call() throws Exception {
|
public GetPlaylistContentsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getPlaylistContents(
|
return sdk.getPlaylistContents(
|
||||||
playlistID,
|
playlistID,
|
||||||
type,
|
type);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetPlaylistRequestBuilder {
|
public class GetPlaylistRequestBuilder {
|
||||||
|
|
||||||
private Double playlistID;
|
private Double playlistID;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetPlaylist sdk;
|
private final SDKMethodInterfaces.MethodCallGetPlaylist sdk;
|
||||||
|
|
||||||
public GetPlaylistRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylist sdk) {
|
public GetPlaylistRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylist sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class GetPlaylistRequestBuilder {
|
|||||||
this.playlistID = playlistID;
|
this.playlistID = playlistID;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetPlaylistRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetPlaylistRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetPlaylistResponse call() throws Exception {
|
public GetPlaylistResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getPlaylist(
|
return sdk.getPlaylist(
|
||||||
playlistID,
|
playlistID);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@@ -13,7 +11,6 @@ public class GetPlaylistsRequestBuilder {
|
|||||||
|
|
||||||
private Optional<? extends PlaylistType> playlistType = Optional.empty();
|
private Optional<? extends PlaylistType> playlistType = Optional.empty();
|
||||||
private Optional<? extends QueryParamSmart> smart = Optional.empty();
|
private Optional<? extends QueryParamSmart> smart = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetPlaylists sdk;
|
private final SDKMethodInterfaces.MethodCallGetPlaylists sdk;
|
||||||
|
|
||||||
public GetPlaylistsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylists sdk) {
|
public GetPlaylistsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylists sdk) {
|
||||||
@@ -43,26 +40,11 @@ public class GetPlaylistsRequestBuilder {
|
|||||||
this.smart = smart;
|
this.smart = smart;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetPlaylistsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetPlaylistsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetPlaylistsResponse call() throws Exception {
|
public GetPlaylistsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getPlaylists(
|
return sdk.getPlaylists(
|
||||||
playlistType,
|
playlistType,
|
||||||
smart,
|
smart);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetRecentlyAddedLibraryRequestBuilder {
|
public class GetRecentlyAddedLibraryRequestBuilder {
|
||||||
|
|
||||||
private GetRecentlyAddedLibraryRequest request;
|
private GetRecentlyAddedLibraryRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk;
|
private final SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk;
|
||||||
|
|
||||||
public GetRecentlyAddedLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk) {
|
public GetRecentlyAddedLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class GetRecentlyAddedLibraryRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetRecentlyAddedLibraryRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetRecentlyAddedLibraryRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetRecentlyAddedLibraryResponse call() throws Exception {
|
public GetRecentlyAddedLibraryResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getRecentlyAddedLibrary(
|
return sdk.getRecentlyAddedLibrary(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetRecentlyAddedRequestBuilder {
|
public class GetRecentlyAddedRequestBuilder {
|
||||||
|
|
||||||
private GetRecentlyAddedRequest request;
|
private GetRecentlyAddedRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk;
|
private final SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk;
|
||||||
|
|
||||||
public GetRecentlyAddedRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk) {
|
public GetRecentlyAddedRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class GetRecentlyAddedRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetRecentlyAddedRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetRecentlyAddedRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetRecentlyAddedResponse call() throws Exception {
|
public GetRecentlyAddedResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getRecentlyAdded(
|
return sdk.getRecentlyAdded(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -14,7 +12,6 @@ public class GetRefreshLibraryMetadataRequestBuilder {
|
|||||||
|
|
||||||
private Optional<? extends Force> force = Optional.empty();
|
private Optional<? extends Force> force = Optional.empty();
|
||||||
private Integer sectionKey;
|
private Integer sectionKey;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk;
|
private final SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk;
|
||||||
|
|
||||||
public GetRefreshLibraryMetadataRequestBuilder(SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk) {
|
public GetRefreshLibraryMetadataRequestBuilder(SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk) {
|
||||||
@@ -38,26 +35,11 @@ public class GetRefreshLibraryMetadataRequestBuilder {
|
|||||||
this.sectionKey = sectionKey;
|
this.sectionKey = sectionKey;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetRefreshLibraryMetadataRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetRefreshLibraryMetadataRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetRefreshLibraryMetadataResponse call() throws Exception {
|
public GetRefreshLibraryMetadataResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getRefreshLibraryMetadata(
|
return sdk.getRefreshLibraryMetadata(
|
||||||
force,
|
force,
|
||||||
sectionKey,
|
sectionKey);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetResizedPhotoRequestBuilder {
|
public class GetResizedPhotoRequestBuilder {
|
||||||
|
|
||||||
private GetResizedPhotoRequest request;
|
private GetResizedPhotoRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetResizedPhoto sdk;
|
private final SDKMethodInterfaces.MethodCallGetResizedPhoto sdk;
|
||||||
|
|
||||||
public GetResizedPhotoRequestBuilder(SDKMethodInterfaces.MethodCallGetResizedPhoto sdk) {
|
public GetResizedPhotoRequestBuilder(SDKMethodInterfaces.MethodCallGetResizedPhoto sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class GetResizedPhotoRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetResizedPhotoRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetResizedPhotoRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetResizedPhotoResponse call() throws Exception {
|
public GetResizedPhotoResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getResizedPhoto(
|
return sdk.getResizedPhoto(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -13,7 +11,6 @@ import java.util.Optional;
|
|||||||
public class GetResourcesStatisticsRequestBuilder {
|
public class GetResourcesStatisticsRequestBuilder {
|
||||||
|
|
||||||
private Optional<Long> timespan = Optional.empty();
|
private Optional<Long> timespan = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk;
|
private final SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk;
|
||||||
|
|
||||||
public GetResourcesStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk) {
|
public GetResourcesStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk) {
|
||||||
@@ -31,25 +28,10 @@ public class GetResourcesStatisticsRequestBuilder {
|
|||||||
this.timespan = timespan;
|
this.timespan = timespan;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetResourcesStatisticsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetResourcesStatisticsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetResourcesStatisticsResponse call() throws Exception {
|
public GetResourcesStatisticsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getResourcesStatistics(
|
return sdk.getResourcesStatistics(
|
||||||
timespan,
|
timespan);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetSearchAllLibrariesRequestBuilder {
|
public class GetSearchAllLibrariesRequestBuilder {
|
||||||
|
|
||||||
private GetSearchAllLibrariesRequest request;
|
private GetSearchAllLibrariesRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk;
|
private final SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk;
|
||||||
|
|
||||||
public GetSearchAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk) {
|
public GetSearchAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class GetSearchAllLibrariesRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetSearchAllLibrariesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSearchAllLibrariesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSearchAllLibrariesResponse call() throws Exception {
|
public GetSearchAllLibrariesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getSearchAllLibraries(
|
return sdk.getSearchAllLibraries(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,13 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetSearchLibraryRequestBuilder {
|
public class GetSearchLibraryRequestBuilder {
|
||||||
|
|
||||||
private Integer sectionKey;
|
private Integer sectionKey;
|
||||||
private GetSearchLibraryQueryParamType type;
|
private GetSearchLibraryQueryParamType type;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetSearchLibrary sdk;
|
private final SDKMethodInterfaces.MethodCallGetSearchLibrary sdk;
|
||||||
|
|
||||||
public GetSearchLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchLibrary sdk) {
|
public GetSearchLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchLibrary sdk) {
|
||||||
@@ -32,26 +28,11 @@ public class GetSearchLibraryRequestBuilder {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetSearchLibraryRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSearchLibraryRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSearchLibraryResponse call() throws Exception {
|
public GetSearchLibraryResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getSearchLibrary(
|
return sdk.getSearchLibrary(
|
||||||
sectionKey,
|
sectionKey,
|
||||||
type,
|
type);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetSearchResultsRequestBuilder {
|
public class GetSearchResultsRequestBuilder {
|
||||||
|
|
||||||
private String query;
|
private String query;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetSearchResults sdk;
|
private final SDKMethodInterfaces.MethodCallGetSearchResults sdk;
|
||||||
|
|
||||||
public GetSearchResultsRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchResults sdk) {
|
public GetSearchResultsRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchResults sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class GetSearchResultsRequestBuilder {
|
|||||||
this.query = query;
|
this.query = query;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetSearchResultsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSearchResultsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSearchResultsResponse call() throws Exception {
|
public GetSearchResultsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getSearchResults(
|
return sdk.getSearchResults(
|
||||||
query,
|
query);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetServerActivitiesRequestBuilder {
|
public class GetServerActivitiesRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetServerActivities sdk;
|
private final SDKMethodInterfaces.MethodCallGetServerActivities sdk;
|
||||||
|
|
||||||
public GetServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerActivities sdk) {
|
public GetServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerActivities sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetServerActivitiesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerActivitiesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerActivitiesResponse call() throws Exception {
|
public GetServerActivitiesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getServerActivitiesDirect();
|
||||||
.build());
|
|
||||||
return sdk.getServerActivities(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetServerCapabilitiesRequestBuilder {
|
public class GetServerCapabilitiesRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetServerCapabilities sdk;
|
private final SDKMethodInterfaces.MethodCallGetServerCapabilities sdk;
|
||||||
|
|
||||||
public GetServerCapabilitiesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerCapabilities sdk) {
|
public GetServerCapabilitiesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerCapabilities sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetServerCapabilitiesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerCapabilitiesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerCapabilitiesResponse call() throws Exception {
|
public GetServerCapabilitiesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getServerCapabilitiesDirect();
|
||||||
.build());
|
|
||||||
return sdk.getServerCapabilities(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetServerIdentityRequestBuilder {
|
public class GetServerIdentityRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetServerIdentity sdk;
|
private final SDKMethodInterfaces.MethodCallGetServerIdentity sdk;
|
||||||
|
|
||||||
public GetServerIdentityRequestBuilder(SDKMethodInterfaces.MethodCallGetServerIdentity sdk) {
|
public GetServerIdentityRequestBuilder(SDKMethodInterfaces.MethodCallGetServerIdentity sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetServerIdentityRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerIdentityRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerIdentityResponse call() throws Exception {
|
public GetServerIdentityResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getServerIdentityDirect();
|
||||||
.build());
|
|
||||||
return sdk.getServerIdentity(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetServerListRequestBuilder {
|
public class GetServerListRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetServerList sdk;
|
private final SDKMethodInterfaces.MethodCallGetServerList sdk;
|
||||||
|
|
||||||
public GetServerListRequestBuilder(SDKMethodInterfaces.MethodCallGetServerList sdk) {
|
public GetServerListRequestBuilder(SDKMethodInterfaces.MethodCallGetServerList sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetServerListRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerListRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerListResponse call() throws Exception {
|
public GetServerListResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getServerListDirect();
|
||||||
.build());
|
|
||||||
return sdk.getServerList(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetServerPreferencesRequestBuilder {
|
public class GetServerPreferencesRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetServerPreferences sdk;
|
private final SDKMethodInterfaces.MethodCallGetServerPreferences sdk;
|
||||||
|
|
||||||
public GetServerPreferencesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerPreferences sdk) {
|
public GetServerPreferencesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerPreferences sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetServerPreferencesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerPreferencesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerPreferencesResponse call() throws Exception {
|
public GetServerPreferencesResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getServerPreferencesDirect();
|
||||||
.build());
|
|
||||||
return sdk.getServerPreferences(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ package dev.plexapi.sdk.models.operations;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import dev.plexapi.sdk.utils.LazySingletonValue;
|
import dev.plexapi.sdk.utils.LazySingletonValue;
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -28,7 +26,6 @@ public class GetServerResourcesRequestBuilder {
|
|||||||
new TypeReference<Optional<? extends IncludeIPv6>>() {});
|
new TypeReference<Optional<? extends IncludeIPv6>>() {});
|
||||||
private Optional<String> clientID = Optional.empty();
|
private Optional<String> clientID = Optional.empty();
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetServerResources sdk;
|
private final SDKMethodInterfaces.MethodCallGetServerResources sdk;
|
||||||
|
|
||||||
public GetServerResourcesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerResources sdk) {
|
public GetServerResourcesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerResources sdk) {
|
||||||
@@ -94,18 +91,6 @@ public class GetServerResourcesRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetServerResourcesRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerResourcesRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetServerResourcesResponse call() throws Exception {
|
public GetServerResourcesResponse call() throws Exception {
|
||||||
if (includeHttps == null) {
|
if (includeHttps == null) {
|
||||||
@@ -116,16 +101,13 @@ public class GetServerResourcesRequestBuilder {
|
|||||||
}
|
}
|
||||||
if (includeIPv6 == null) {
|
if (includeIPv6 == null) {
|
||||||
includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value();
|
includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value();
|
||||||
} Optional<Options> options = Optional.of(Options.builder()
|
}
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getServerResources(
|
return sdk.getServerResources(
|
||||||
includeHttps,
|
includeHttps,
|
||||||
includeRelay,
|
includeRelay,
|
||||||
includeIPv6,
|
includeIPv6,
|
||||||
clientID,
|
clientID,
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final LazySingletonValue<Optional<? extends IncludeHttps>> _SINGLETON_VALUE_IncludeHttps =
|
private static final LazySingletonValue<Optional<? extends IncludeHttps>> _SINGLETON_VALUE_IncludeHttps =
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
@@ -17,7 +15,6 @@ public class GetSessionHistoryRequestBuilder {
|
|||||||
private Optional<Long> accountId = Optional.empty();
|
private Optional<Long> accountId = Optional.empty();
|
||||||
private Optional<? extends QueryParamFilter> filter = Optional.empty();
|
private Optional<? extends QueryParamFilter> filter = Optional.empty();
|
||||||
private Optional<Long> librarySectionID = Optional.empty();
|
private Optional<Long> librarySectionID = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetSessionHistory sdk;
|
private final SDKMethodInterfaces.MethodCallGetSessionHistory sdk;
|
||||||
|
|
||||||
public GetSessionHistoryRequestBuilder(SDKMethodInterfaces.MethodCallGetSessionHistory sdk) {
|
public GetSessionHistoryRequestBuilder(SDKMethodInterfaces.MethodCallGetSessionHistory sdk) {
|
||||||
@@ -71,28 +68,13 @@ public class GetSessionHistoryRequestBuilder {
|
|||||||
this.librarySectionID = librarySectionID;
|
this.librarySectionID = librarySectionID;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetSessionHistoryRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSessionHistoryRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSessionHistoryResponse call() throws Exception {
|
public GetSessionHistoryResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getSessionHistory(
|
return sdk.getSessionHistory(
|
||||||
sort,
|
sort,
|
||||||
accountId,
|
accountId,
|
||||||
filter,
|
filter,
|
||||||
librarySectionID,
|
librarySectionID);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetSessionsRequestBuilder {
|
public class GetSessionsRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetSessions sdk;
|
private final SDKMethodInterfaces.MethodCallGetSessions sdk;
|
||||||
|
|
||||||
public GetSessionsRequestBuilder(SDKMethodInterfaces.MethodCallGetSessions sdk) {
|
public GetSessionsRequestBuilder(SDKMethodInterfaces.MethodCallGetSessions sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetSessionsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSessionsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSessionsResponse call() throws Exception {
|
public GetSessionsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getSessionsDirect();
|
||||||
.build());
|
|
||||||
return sdk.getSessions(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetSourceConnectionInformationRequestBuilder {
|
public class GetSourceConnectionInformationRequestBuilder {
|
||||||
|
|
||||||
private String source;
|
private String source;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetSourceConnectionInformation sdk;
|
private final SDKMethodInterfaces.MethodCallGetSourceConnectionInformation sdk;
|
||||||
|
|
||||||
public GetSourceConnectionInformationRequestBuilder(SDKMethodInterfaces.MethodCallGetSourceConnectionInformation sdk) {
|
public GetSourceConnectionInformationRequestBuilder(SDKMethodInterfaces.MethodCallGetSourceConnectionInformation sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class GetSourceConnectionInformationRequestBuilder {
|
|||||||
this.source = source;
|
this.source = source;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetSourceConnectionInformationRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSourceConnectionInformationRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetSourceConnectionInformationResponse call() throws Exception {
|
public GetSourceConnectionInformationResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getSourceConnectionInformation(
|
return sdk.getSourceConnectionInformation(
|
||||||
source,
|
source);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -13,7 +11,6 @@ import java.util.Optional;
|
|||||||
public class GetStatisticsRequestBuilder {
|
public class GetStatisticsRequestBuilder {
|
||||||
|
|
||||||
private Optional<Long> timespan = Optional.empty();
|
private Optional<Long> timespan = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetStatistics sdk;
|
private final SDKMethodInterfaces.MethodCallGetStatistics sdk;
|
||||||
|
|
||||||
public GetStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetStatistics sdk) {
|
public GetStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetStatistics sdk) {
|
||||||
@@ -31,25 +28,10 @@ public class GetStatisticsRequestBuilder {
|
|||||||
this.timespan = timespan;
|
this.timespan = timespan;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetStatisticsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetStatisticsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetStatisticsResponse call() throws Exception {
|
public GetStatisticsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getStatistics(
|
return sdk.getStatistics(
|
||||||
timespan,
|
timespan);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetThumbImageRequestBuilder {
|
public class GetThumbImageRequestBuilder {
|
||||||
|
|
||||||
private GetThumbImageRequest request;
|
private GetThumbImageRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetThumbImage sdk;
|
private final SDKMethodInterfaces.MethodCallGetThumbImage sdk;
|
||||||
|
|
||||||
public GetThumbImageRequestBuilder(SDKMethodInterfaces.MethodCallGetThumbImage sdk) {
|
public GetThumbImageRequestBuilder(SDKMethodInterfaces.MethodCallGetThumbImage sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class GetThumbImageRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetThumbImageRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetThumbImageRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetThumbImageResponse call() throws Exception {
|
public GetThumbImageResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getThumbImage(
|
return sdk.getThumbImage(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetTimelineRequestBuilder {
|
public class GetTimelineRequestBuilder {
|
||||||
|
|
||||||
private GetTimelineRequest request;
|
private GetTimelineRequest request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetTimeline sdk;
|
private final SDKMethodInterfaces.MethodCallGetTimeline sdk;
|
||||||
|
|
||||||
public GetTimelineRequestBuilder(SDKMethodInterfaces.MethodCallGetTimeline sdk) {
|
public GetTimelineRequestBuilder(SDKMethodInterfaces.MethodCallGetTimeline sdk) {
|
||||||
@@ -24,25 +20,10 @@ public class GetTimelineRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetTimelineRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTimelineRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTimelineResponse call() throws Exception {
|
public GetTimelineResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getTimeline(
|
return sdk.getTimeline(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -14,7 +12,6 @@ public class GetTokenByPinIdRequestBuilder {
|
|||||||
|
|
||||||
private GetTokenByPinIdRequest request;
|
private GetTokenByPinIdRequest request;
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetTokenByPinId sdk;
|
private final SDKMethodInterfaces.MethodCallGetTokenByPinId sdk;
|
||||||
|
|
||||||
public GetTokenByPinIdRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenByPinId sdk) {
|
public GetTokenByPinIdRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenByPinId sdk) {
|
||||||
@@ -38,26 +35,11 @@ public class GetTokenByPinIdRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetTokenByPinIdRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTokenByPinIdRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTokenByPinIdResponse call() throws Exception {
|
public GetTokenByPinIdResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getTokenByPinId(
|
return sdk.getTokenByPinId(
|
||||||
request,
|
request,
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -13,7 +11,6 @@ import java.util.Optional;
|
|||||||
public class GetTokenDetailsRequestBuilder {
|
public class GetTokenDetailsRequestBuilder {
|
||||||
|
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetTokenDetails sdk;
|
private final SDKMethodInterfaces.MethodCallGetTokenDetails sdk;
|
||||||
|
|
||||||
public GetTokenDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenDetails sdk) {
|
public GetTokenDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenDetails sdk) {
|
||||||
@@ -31,25 +28,10 @@ public class GetTokenDetailsRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetTokenDetailsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTokenDetailsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTokenDetailsResponse call() throws Exception {
|
public GetTokenDetailsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getTokenDetails(
|
return sdk.getTokenDetails(
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import java.lang.Long;
|
|||||||
import java.lang.Override;
|
import java.lang.Override;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.lang.SuppressWarnings;
|
import java.lang.SuppressWarnings;
|
||||||
import java.time.OffsetDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -39,19 +38,13 @@ public class GetTokenDetailsUserPlexAccount {
|
|||||||
@JsonProperty("adsConsent")
|
@JsonProperty("adsConsent")
|
||||||
private Optional<Boolean> adsConsent;
|
private Optional<Boolean> adsConsent;
|
||||||
|
|
||||||
/**
|
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
@JsonInclude(Include.ALWAYS)
|
@JsonInclude(Include.ALWAYS)
|
||||||
@JsonProperty("adsConsentReminderAt")
|
@JsonProperty("adsConsentReminderAt")
|
||||||
private Optional<OffsetDateTime> adsConsentReminderAt;
|
private Optional<Long> adsConsentReminderAt;
|
||||||
|
|
||||||
/**
|
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
@JsonInclude(Include.ALWAYS)
|
@JsonInclude(Include.ALWAYS)
|
||||||
@JsonProperty("adsConsentSetAt")
|
@JsonProperty("adsConsentSetAt")
|
||||||
private Optional<OffsetDateTime> adsConsentSetAt;
|
private Optional<Long> adsConsentSetAt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unknown
|
* Unknown
|
||||||
@@ -292,8 +285,8 @@ public class GetTokenDetailsUserPlexAccount {
|
|||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetTokenDetailsUserPlexAccount(
|
public GetTokenDetailsUserPlexAccount(
|
||||||
@JsonProperty("adsConsent") Optional<Boolean> adsConsent,
|
@JsonProperty("adsConsent") Optional<Boolean> adsConsent,
|
||||||
@JsonProperty("adsConsentReminderAt") Optional<OffsetDateTime> adsConsentReminderAt,
|
@JsonProperty("adsConsentReminderAt") Optional<Long> adsConsentReminderAt,
|
||||||
@JsonProperty("adsConsentSetAt") Optional<OffsetDateTime> adsConsentSetAt,
|
@JsonProperty("adsConsentSetAt") Optional<Long> adsConsentSetAt,
|
||||||
@JsonProperty("anonymous") JsonNullable<Boolean> anonymous,
|
@JsonProperty("anonymous") JsonNullable<Boolean> anonymous,
|
||||||
@JsonProperty("authToken") String authToken,
|
@JsonProperty("authToken") String authToken,
|
||||||
@JsonProperty("backupCodesCreated") Optional<Boolean> backupCodesCreated,
|
@JsonProperty("backupCodesCreated") Optional<Boolean> backupCodesCreated,
|
||||||
@@ -448,19 +441,13 @@ public class GetTokenDetailsUserPlexAccount {
|
|||||||
return adsConsent;
|
return adsConsent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Optional<OffsetDateTime> adsConsentReminderAt() {
|
public Optional<Long> adsConsentReminderAt() {
|
||||||
return adsConsentReminderAt;
|
return adsConsentReminderAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Optional<OffsetDateTime> adsConsentSetAt() {
|
public Optional<Long> adsConsentSetAt() {
|
||||||
return adsConsentSetAt;
|
return adsConsentSetAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,37 +768,25 @@ public class GetTokenDetailsUserPlexAccount {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public GetTokenDetailsUserPlexAccount withAdsConsentReminderAt(long adsConsentReminderAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public GetTokenDetailsUserPlexAccount withAdsConsentReminderAt(OffsetDateTime adsConsentReminderAt) {
|
|
||||||
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
||||||
this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
|
this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public GetTokenDetailsUserPlexAccount withAdsConsentReminderAt(Optional<Long> adsConsentReminderAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public GetTokenDetailsUserPlexAccount withAdsConsentReminderAt(Optional<OffsetDateTime> adsConsentReminderAt) {
|
|
||||||
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
||||||
this.adsConsentReminderAt = adsConsentReminderAt;
|
this.adsConsentReminderAt = adsConsentReminderAt;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public GetTokenDetailsUserPlexAccount withAdsConsentSetAt(long adsConsentSetAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public GetTokenDetailsUserPlexAccount withAdsConsentSetAt(OffsetDateTime adsConsentSetAt) {
|
|
||||||
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
||||||
this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
|
this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public GetTokenDetailsUserPlexAccount withAdsConsentSetAt(Optional<Long> adsConsentSetAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public GetTokenDetailsUserPlexAccount withAdsConsentSetAt(Optional<OffsetDateTime> adsConsentSetAt) {
|
|
||||||
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
||||||
this.adsConsentSetAt = adsConsentSetAt;
|
this.adsConsentSetAt = adsConsentSetAt;
|
||||||
return this;
|
return this;
|
||||||
@@ -1459,9 +1434,9 @@ public class GetTokenDetailsUserPlexAccount {
|
|||||||
|
|
||||||
private Optional<Boolean> adsConsent = Optional.empty();
|
private Optional<Boolean> adsConsent = Optional.empty();
|
||||||
|
|
||||||
private Optional<OffsetDateTime> adsConsentReminderAt = Optional.empty();
|
private Optional<Long> adsConsentReminderAt = Optional.empty();
|
||||||
|
|
||||||
private Optional<OffsetDateTime> adsConsentSetAt = Optional.empty();
|
private Optional<Long> adsConsentSetAt = Optional.empty();
|
||||||
|
|
||||||
private JsonNullable<Boolean> anonymous;
|
private JsonNullable<Boolean> anonymous;
|
||||||
|
|
||||||
@@ -1562,37 +1537,25 @@ public class GetTokenDetailsUserPlexAccount {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder adsConsentReminderAt(long adsConsentReminderAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public Builder adsConsentReminderAt(OffsetDateTime adsConsentReminderAt) {
|
|
||||||
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
||||||
this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
|
this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder adsConsentReminderAt(Optional<Long> adsConsentReminderAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public Builder adsConsentReminderAt(Optional<OffsetDateTime> adsConsentReminderAt) {
|
|
||||||
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
||||||
this.adsConsentReminderAt = adsConsentReminderAt;
|
this.adsConsentReminderAt = adsConsentReminderAt;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder adsConsentSetAt(long adsConsentSetAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public Builder adsConsentSetAt(OffsetDateTime adsConsentSetAt) {
|
|
||||||
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
||||||
this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
|
this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder adsConsentSetAt(Optional<Long> adsConsentSetAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public Builder adsConsentSetAt(Optional<OffsetDateTime> adsConsentSetAt) {
|
|
||||||
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
||||||
this.adsConsentSetAt = adsConsentSetAt;
|
this.adsConsentSetAt = adsConsentSetAt;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -14,7 +12,6 @@ public class GetTopWatchedContentRequestBuilder {
|
|||||||
|
|
||||||
private Optional<Long> includeGuids = Optional.empty();
|
private Optional<Long> includeGuids = Optional.empty();
|
||||||
private GetTopWatchedContentQueryParamType type;
|
private GetTopWatchedContentQueryParamType type;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk;
|
private final SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk;
|
||||||
|
|
||||||
public GetTopWatchedContentRequestBuilder(SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk) {
|
public GetTopWatchedContentRequestBuilder(SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk) {
|
||||||
@@ -38,26 +35,11 @@ public class GetTopWatchedContentRequestBuilder {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetTopWatchedContentRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTopWatchedContentRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTopWatchedContentResponse call() throws Exception {
|
public GetTopWatchedContentResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getTopWatchedContent(
|
return sdk.getTopWatchedContent(
|
||||||
includeGuids,
|
includeGuids,
|
||||||
type,
|
type);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetTranscodeSessionsRequestBuilder {
|
public class GetTranscodeSessionsRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetTranscodeSessions sdk;
|
private final SDKMethodInterfaces.MethodCallGetTranscodeSessions sdk;
|
||||||
|
|
||||||
public GetTranscodeSessionsRequestBuilder(SDKMethodInterfaces.MethodCallGetTranscodeSessions sdk) {
|
public GetTranscodeSessionsRequestBuilder(SDKMethodInterfaces.MethodCallGetTranscodeSessions sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetTranscodeSessionsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTranscodeSessionsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTranscodeSessionsResponse call() throws Exception {
|
public GetTranscodeSessionsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getTranscodeSessionsDirect();
|
||||||
.build());
|
|
||||||
return sdk.getTranscodeSessions(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetTransientTokenRequestBuilder {
|
public class GetTransientTokenRequestBuilder {
|
||||||
|
|
||||||
private GetTransientTokenQueryParamType type;
|
private GetTransientTokenQueryParamType type;
|
||||||
private Scope scope;
|
private Scope scope;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetTransientToken sdk;
|
private final SDKMethodInterfaces.MethodCallGetTransientToken sdk;
|
||||||
|
|
||||||
public GetTransientTokenRequestBuilder(SDKMethodInterfaces.MethodCallGetTransientToken sdk) {
|
public GetTransientTokenRequestBuilder(SDKMethodInterfaces.MethodCallGetTransientToken sdk) {
|
||||||
@@ -31,26 +27,11 @@ public class GetTransientTokenRequestBuilder {
|
|||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetTransientTokenRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTransientTokenRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetTransientTokenResponse call() throws Exception {
|
public GetTransientTokenResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getTransientToken(
|
return sdk.getTransientToken(
|
||||||
type,
|
type,
|
||||||
scope,
|
scope);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class GetUpdateStatusRequestBuilder {
|
public class GetUpdateStatusRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetUpdateStatus sdk;
|
private final SDKMethodInterfaces.MethodCallGetUpdateStatus sdk;
|
||||||
|
|
||||||
public GetUpdateStatusRequestBuilder(SDKMethodInterfaces.MethodCallGetUpdateStatus sdk) {
|
public GetUpdateStatusRequestBuilder(SDKMethodInterfaces.MethodCallGetUpdateStatus sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetUpdateStatusRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetUpdateStatusRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetUpdateStatusResponse call() throws Exception {
|
public GetUpdateStatusResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.getUpdateStatusDirect();
|
||||||
.build());
|
|
||||||
return sdk.getUpdateStatus(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -13,7 +11,6 @@ import java.util.Optional;
|
|||||||
public class GetUserFriendsRequestBuilder {
|
public class GetUserFriendsRequestBuilder {
|
||||||
|
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetUserFriends sdk;
|
private final SDKMethodInterfaces.MethodCallGetUserFriends sdk;
|
||||||
|
|
||||||
public GetUserFriendsRequestBuilder(SDKMethodInterfaces.MethodCallGetUserFriends sdk) {
|
public GetUserFriendsRequestBuilder(SDKMethodInterfaces.MethodCallGetUserFriends sdk) {
|
||||||
@@ -31,25 +28,10 @@ public class GetUserFriendsRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetUserFriendsRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetUserFriendsRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetUserFriendsResponse call() throws Exception {
|
public GetUserFriendsResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getUserFriends(
|
return sdk.getUserFriends(
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -14,7 +12,6 @@ public class GetWatchListRequestBuilder {
|
|||||||
|
|
||||||
private GetWatchListRequest request;
|
private GetWatchListRequest request;
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallGetWatchList sdk;
|
private final SDKMethodInterfaces.MethodCallGetWatchList sdk;
|
||||||
|
|
||||||
public GetWatchListRequestBuilder(SDKMethodInterfaces.MethodCallGetWatchList sdk) {
|
public GetWatchListRequestBuilder(SDKMethodInterfaces.MethodCallGetWatchList sdk) {
|
||||||
@@ -38,26 +35,11 @@ public class GetWatchListRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetWatchListRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetWatchListRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetWatchListResponse call() throws Exception {
|
public GetWatchListResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.getWatchList(
|
return sdk.getWatchList(
|
||||||
request,
|
request,
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,18 +4,14 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class LogLineRequestBuilder {
|
public class LogLineRequestBuilder {
|
||||||
|
|
||||||
private Level level;
|
private Level level;
|
||||||
private String message;
|
private String message;
|
||||||
private String source;
|
private String source;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallLogLine sdk;
|
private final SDKMethodInterfaces.MethodCallLogLine sdk;
|
||||||
|
|
||||||
public LogLineRequestBuilder(SDKMethodInterfaces.MethodCallLogLine sdk) {
|
public LogLineRequestBuilder(SDKMethodInterfaces.MethodCallLogLine sdk) {
|
||||||
@@ -39,27 +35,12 @@ public class LogLineRequestBuilder {
|
|||||||
this.source = source;
|
this.source = source;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LogLineRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LogLineRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LogLineResponse call() throws Exception {
|
public LogLineResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.logLine(
|
return sdk.logLine(
|
||||||
level,
|
level,
|
||||||
message,
|
message,
|
||||||
source,
|
source);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class LogMultiLineRequestBuilder {
|
public class LogMultiLineRequestBuilder {
|
||||||
|
|
||||||
private String request;
|
private String request;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallLogMultiLine sdk;
|
private final SDKMethodInterfaces.MethodCallLogMultiLine sdk;
|
||||||
|
|
||||||
public LogMultiLineRequestBuilder(SDKMethodInterfaces.MethodCallLogMultiLine sdk) {
|
public LogMultiLineRequestBuilder(SDKMethodInterfaces.MethodCallLogMultiLine sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class LogMultiLineRequestBuilder {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LogMultiLineRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LogMultiLineRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LogMultiLineResponse call() throws Exception {
|
public LogMultiLineResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.logMultiLine(
|
return sdk.logMultiLine(
|
||||||
request,
|
request);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class MarkPlayedRequestBuilder {
|
public class MarkPlayedRequestBuilder {
|
||||||
|
|
||||||
private Double key;
|
private Double key;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallMarkPlayed sdk;
|
private final SDKMethodInterfaces.MethodCallMarkPlayed sdk;
|
||||||
|
|
||||||
public MarkPlayedRequestBuilder(SDKMethodInterfaces.MethodCallMarkPlayed sdk) {
|
public MarkPlayedRequestBuilder(SDKMethodInterfaces.MethodCallMarkPlayed sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class MarkPlayedRequestBuilder {
|
|||||||
this.key = key;
|
this.key = key;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MarkPlayedRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MarkPlayedRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MarkPlayedResponse call() throws Exception {
|
public MarkPlayedResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.markPlayed(
|
return sdk.markPlayed(
|
||||||
key,
|
key);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class MarkUnplayedRequestBuilder {
|
public class MarkUnplayedRequestBuilder {
|
||||||
|
|
||||||
private Double key;
|
private Double key;
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallMarkUnplayed sdk;
|
private final SDKMethodInterfaces.MethodCallMarkUnplayed sdk;
|
||||||
|
|
||||||
public MarkUnplayedRequestBuilder(SDKMethodInterfaces.MethodCallMarkUnplayed sdk) {
|
public MarkUnplayedRequestBuilder(SDKMethodInterfaces.MethodCallMarkUnplayed sdk) {
|
||||||
@@ -25,25 +21,10 @@ public class MarkUnplayedRequestBuilder {
|
|||||||
this.key = key;
|
this.key = key;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MarkUnplayedRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MarkUnplayedRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MarkUnplayedResponse call() throws Exception {
|
public MarkUnplayedResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.markUnplayed(
|
return sdk.markUnplayed(
|
||||||
key,
|
key);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ package dev.plexapi.sdk.models.operations;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import dev.plexapi.sdk.utils.LazySingletonValue;
|
import dev.plexapi.sdk.utils.LazySingletonValue;
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
@@ -21,7 +19,6 @@ public class PerformSearchRequestBuilder {
|
|||||||
"limit",
|
"limit",
|
||||||
"3",
|
"3",
|
||||||
new TypeReference<Optional<Double>>() {});
|
new TypeReference<Optional<Double>>() {});
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallPerformSearch sdk;
|
private final SDKMethodInterfaces.MethodCallPerformSearch sdk;
|
||||||
|
|
||||||
public PerformSearchRequestBuilder(SDKMethodInterfaces.MethodCallPerformSearch sdk) {
|
public PerformSearchRequestBuilder(SDKMethodInterfaces.MethodCallPerformSearch sdk) {
|
||||||
@@ -57,30 +54,15 @@ public class PerformSearchRequestBuilder {
|
|||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PerformSearchRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PerformSearchRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PerformSearchResponse call() throws Exception {
|
public PerformSearchResponse call() throws Exception {
|
||||||
if (limit == null) {
|
if (limit == null) {
|
||||||
limit = _SINGLETON_VALUE_Limit.value();
|
limit = _SINGLETON_VALUE_Limit.value();
|
||||||
} Optional<Options> options = Optional.of(Options.builder()
|
}
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.performSearch(
|
return sdk.performSearch(
|
||||||
query,
|
query,
|
||||||
sectionId,
|
sectionId,
|
||||||
limit,
|
limit);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final LazySingletonValue<Optional<Double>> _SINGLETON_VALUE_Limit =
|
private static final LazySingletonValue<Optional<Double>> _SINGLETON_VALUE_Limit =
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ package dev.plexapi.sdk.models.operations;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import dev.plexapi.sdk.utils.LazySingletonValue;
|
import dev.plexapi.sdk.utils.LazySingletonValue;
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
@@ -21,7 +19,6 @@ public class PerformVoiceSearchRequestBuilder {
|
|||||||
"limit",
|
"limit",
|
||||||
"3",
|
"3",
|
||||||
new TypeReference<Optional<Double>>() {});
|
new TypeReference<Optional<Double>>() {});
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallPerformVoiceSearch sdk;
|
private final SDKMethodInterfaces.MethodCallPerformVoiceSearch sdk;
|
||||||
|
|
||||||
public PerformVoiceSearchRequestBuilder(SDKMethodInterfaces.MethodCallPerformVoiceSearch sdk) {
|
public PerformVoiceSearchRequestBuilder(SDKMethodInterfaces.MethodCallPerformVoiceSearch sdk) {
|
||||||
@@ -57,30 +54,15 @@ public class PerformVoiceSearchRequestBuilder {
|
|||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PerformVoiceSearchRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PerformVoiceSearchRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PerformVoiceSearchResponse call() throws Exception {
|
public PerformVoiceSearchResponse call() throws Exception {
|
||||||
if (limit == null) {
|
if (limit == null) {
|
||||||
limit = _SINGLETON_VALUE_Limit.value();
|
limit = _SINGLETON_VALUE_Limit.value();
|
||||||
} Optional<Options> options = Optional.of(Options.builder()
|
}
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.performVoiceSearch(
|
return sdk.performVoiceSearch(
|
||||||
query,
|
query,
|
||||||
sectionId,
|
sectionId,
|
||||||
limit,
|
limit);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final LazySingletonValue<Optional<Double>> _SINGLETON_VALUE_Limit =
|
private static final LazySingletonValue<Optional<Double>> _SINGLETON_VALUE_Limit =
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -14,7 +12,6 @@ public class PostUsersSignInDataRequestBuilder {
|
|||||||
|
|
||||||
private PostUsersSignInDataRequest request;
|
private PostUsersSignInDataRequest request;
|
||||||
private Optional<String> serverURL = Optional.empty();
|
private Optional<String> serverURL = Optional.empty();
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallPostUsersSignInData sdk;
|
private final SDKMethodInterfaces.MethodCallPostUsersSignInData sdk;
|
||||||
|
|
||||||
public PostUsersSignInDataRequestBuilder(SDKMethodInterfaces.MethodCallPostUsersSignInData sdk) {
|
public PostUsersSignInDataRequestBuilder(SDKMethodInterfaces.MethodCallPostUsersSignInData sdk) {
|
||||||
@@ -38,26 +35,11 @@ public class PostUsersSignInDataRequestBuilder {
|
|||||||
this.serverURL = serverURL;
|
this.serverURL = serverURL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PostUsersSignInDataRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PostUsersSignInDataRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PostUsersSignInDataResponse call() throws Exception {
|
public PostUsersSignInDataResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
|
||||||
.build());
|
|
||||||
return sdk.postUsersSignInData(
|
return sdk.postUsersSignInData(
|
||||||
request,
|
request,
|
||||||
serverURL,
|
serverURL);
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import java.lang.Long;
|
|||||||
import java.lang.Override;
|
import java.lang.Override;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.lang.SuppressWarnings;
|
import java.lang.SuppressWarnings;
|
||||||
import java.time.OffsetDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -39,19 +38,13 @@ public class PostUsersSignInDataUserPlexAccount {
|
|||||||
@JsonProperty("adsConsent")
|
@JsonProperty("adsConsent")
|
||||||
private Optional<Boolean> adsConsent;
|
private Optional<Boolean> adsConsent;
|
||||||
|
|
||||||
/**
|
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
@JsonInclude(Include.ALWAYS)
|
@JsonInclude(Include.ALWAYS)
|
||||||
@JsonProperty("adsConsentReminderAt")
|
@JsonProperty("adsConsentReminderAt")
|
||||||
private Optional<OffsetDateTime> adsConsentReminderAt;
|
private Optional<Long> adsConsentReminderAt;
|
||||||
|
|
||||||
/**
|
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
@JsonInclude(Include.ALWAYS)
|
@JsonInclude(Include.ALWAYS)
|
||||||
@JsonProperty("adsConsentSetAt")
|
@JsonProperty("adsConsentSetAt")
|
||||||
private Optional<OffsetDateTime> adsConsentSetAt;
|
private Optional<Long> adsConsentSetAt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unknown
|
* Unknown
|
||||||
@@ -298,8 +291,8 @@ public class PostUsersSignInDataUserPlexAccount {
|
|||||||
@JsonCreator
|
@JsonCreator
|
||||||
public PostUsersSignInDataUserPlexAccount(
|
public PostUsersSignInDataUserPlexAccount(
|
||||||
@JsonProperty("adsConsent") Optional<Boolean> adsConsent,
|
@JsonProperty("adsConsent") Optional<Boolean> adsConsent,
|
||||||
@JsonProperty("adsConsentReminderAt") Optional<OffsetDateTime> adsConsentReminderAt,
|
@JsonProperty("adsConsentReminderAt") Optional<Long> adsConsentReminderAt,
|
||||||
@JsonProperty("adsConsentSetAt") Optional<OffsetDateTime> adsConsentSetAt,
|
@JsonProperty("adsConsentSetAt") Optional<Long> adsConsentSetAt,
|
||||||
@JsonProperty("anonymous") JsonNullable<Boolean> anonymous,
|
@JsonProperty("anonymous") JsonNullable<Boolean> anonymous,
|
||||||
@JsonProperty("authToken") String authToken,
|
@JsonProperty("authToken") String authToken,
|
||||||
@JsonProperty("backupCodesCreated") Optional<Boolean> backupCodesCreated,
|
@JsonProperty("backupCodesCreated") Optional<Boolean> backupCodesCreated,
|
||||||
@@ -462,19 +455,13 @@ public class PostUsersSignInDataUserPlexAccount {
|
|||||||
return adsConsent;
|
return adsConsent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Optional<OffsetDateTime> adsConsentReminderAt() {
|
public Optional<Long> adsConsentReminderAt() {
|
||||||
return adsConsentReminderAt;
|
return adsConsentReminderAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Optional<OffsetDateTime> adsConsentSetAt() {
|
public Optional<Long> adsConsentSetAt() {
|
||||||
return adsConsentSetAt;
|
return adsConsentSetAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -805,37 +792,25 @@ public class PostUsersSignInDataUserPlexAccount {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public PostUsersSignInDataUserPlexAccount withAdsConsentReminderAt(long adsConsentReminderAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public PostUsersSignInDataUserPlexAccount withAdsConsentReminderAt(OffsetDateTime adsConsentReminderAt) {
|
|
||||||
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
||||||
this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
|
this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public PostUsersSignInDataUserPlexAccount withAdsConsentReminderAt(Optional<Long> adsConsentReminderAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public PostUsersSignInDataUserPlexAccount withAdsConsentReminderAt(Optional<OffsetDateTime> adsConsentReminderAt) {
|
|
||||||
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
||||||
this.adsConsentReminderAt = adsConsentReminderAt;
|
this.adsConsentReminderAt = adsConsentReminderAt;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public PostUsersSignInDataUserPlexAccount withAdsConsentSetAt(long adsConsentSetAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public PostUsersSignInDataUserPlexAccount withAdsConsentSetAt(OffsetDateTime adsConsentSetAt) {
|
|
||||||
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
||||||
this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
|
this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public PostUsersSignInDataUserPlexAccount withAdsConsentSetAt(Optional<Long> adsConsentSetAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public PostUsersSignInDataUserPlexAccount withAdsConsentSetAt(Optional<OffsetDateTime> adsConsentSetAt) {
|
|
||||||
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
||||||
this.adsConsentSetAt = adsConsentSetAt;
|
this.adsConsentSetAt = adsConsentSetAt;
|
||||||
return this;
|
return this;
|
||||||
@@ -1501,9 +1476,9 @@ public class PostUsersSignInDataUserPlexAccount {
|
|||||||
|
|
||||||
private Optional<Boolean> adsConsent = Optional.empty();
|
private Optional<Boolean> adsConsent = Optional.empty();
|
||||||
|
|
||||||
private Optional<OffsetDateTime> adsConsentReminderAt = Optional.empty();
|
private Optional<Long> adsConsentReminderAt = Optional.empty();
|
||||||
|
|
||||||
private Optional<OffsetDateTime> adsConsentSetAt = Optional.empty();
|
private Optional<Long> adsConsentSetAt = Optional.empty();
|
||||||
|
|
||||||
private JsonNullable<Boolean> anonymous;
|
private JsonNullable<Boolean> anonymous;
|
||||||
|
|
||||||
@@ -1608,37 +1583,25 @@ public class PostUsersSignInDataUserPlexAccount {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder adsConsentReminderAt(long adsConsentReminderAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public Builder adsConsentReminderAt(OffsetDateTime adsConsentReminderAt) {
|
|
||||||
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
||||||
this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
|
this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder adsConsentReminderAt(Optional<Long> adsConsentReminderAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public Builder adsConsentReminderAt(Optional<OffsetDateTime> adsConsentReminderAt) {
|
|
||||||
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
|
||||||
this.adsConsentReminderAt = adsConsentReminderAt;
|
this.adsConsentReminderAt = adsConsentReminderAt;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder adsConsentSetAt(long adsConsentSetAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public Builder adsConsentSetAt(OffsetDateTime adsConsentSetAt) {
|
|
||||||
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
||||||
this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
|
this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder adsConsentSetAt(Optional<Long> adsConsentSetAt) {
|
||||||
* Unknown
|
|
||||||
*/
|
|
||||||
public Builder adsConsentSetAt(Optional<OffsetDateTime> adsConsentSetAt) {
|
|
||||||
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
|
||||||
this.adsConsentSetAt = adsConsentSetAt;
|
this.adsConsentSetAt = adsConsentSetAt;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
import java.lang.Exception;
|
import java.lang.Exception;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
@@ -15,72 +14,61 @@ public class SDKMethodInterfaces {
|
|||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetServerCapabilities {
|
public interface MethodCallGetServerCapabilities {
|
||||||
GetServerCapabilitiesResponse getServerCapabilities(
|
GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetServerPreferences {
|
public interface MethodCallGetServerPreferences {
|
||||||
GetServerPreferencesResponse getServerPreferences(
|
GetServerPreferencesResponse getServerPreferencesDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetAvailableClients {
|
public interface MethodCallGetAvailableClients {
|
||||||
GetAvailableClientsResponse getAvailableClients(
|
GetAvailableClientsResponse getAvailableClientsDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetDevices {
|
public interface MethodCallGetDevices {
|
||||||
GetDevicesResponse getDevices(
|
GetDevicesResponse getDevicesDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetServerIdentity {
|
public interface MethodCallGetServerIdentity {
|
||||||
GetServerIdentityResponse getServerIdentity(
|
GetServerIdentityResponse getServerIdentityDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetMyPlexAccount {
|
public interface MethodCallGetMyPlexAccount {
|
||||||
GetMyPlexAccountResponse getMyPlexAccount(
|
GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetResizedPhoto {
|
public interface MethodCallGetResizedPhoto {
|
||||||
GetResizedPhotoResponse getResizedPhoto(
|
GetResizedPhotoResponse getResizedPhoto(
|
||||||
GetResizedPhotoRequest request,
|
GetResizedPhotoRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetMediaProviders {
|
public interface MethodCallGetMediaProviders {
|
||||||
GetMediaProvidersResponse getMediaProviders(
|
GetMediaProvidersResponse getMediaProviders(
|
||||||
String xPlexToken,
|
String xPlexToken) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetServerList {
|
public interface MethodCallGetServerList {
|
||||||
GetServerListResponse getServerList(
|
GetServerListResponse getServerListDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallMarkPlayed {
|
public interface MethodCallMarkPlayed {
|
||||||
MarkPlayedResponse markPlayed(
|
MarkPlayedResponse markPlayed(
|
||||||
double key,
|
double key) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallMarkUnplayed {
|
public interface MethodCallMarkUnplayed {
|
||||||
MarkUnplayedResponse markUnplayed(
|
MarkUnplayedResponse markUnplayed(
|
||||||
double key,
|
double key) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -88,108 +76,92 @@ public class SDKMethodInterfaces {
|
|||||||
UpdatePlayProgressResponse updatePlayProgress(
|
UpdatePlayProgressResponse updatePlayProgress(
|
||||||
String key,
|
String key,
|
||||||
double time,
|
double time,
|
||||||
String state,
|
String state) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetBannerImage {
|
public interface MethodCallGetBannerImage {
|
||||||
GetBannerImageResponse getBannerImage(
|
GetBannerImageResponse getBannerImage(
|
||||||
GetBannerImageRequest request,
|
GetBannerImageRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetThumbImage {
|
public interface MethodCallGetThumbImage {
|
||||||
GetThumbImageResponse getThumbImage(
|
GetThumbImageResponse getThumbImage(
|
||||||
GetThumbImageRequest request,
|
GetThumbImageRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetTimeline {
|
public interface MethodCallGetTimeline {
|
||||||
GetTimelineResponse getTimeline(
|
GetTimelineResponse getTimeline(
|
||||||
GetTimelineRequest request,
|
GetTimelineRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallStartUniversalTranscode {
|
public interface MethodCallStartUniversalTranscode {
|
||||||
StartUniversalTranscodeResponse startUniversalTranscode(
|
StartUniversalTranscodeResponse startUniversalTranscode(
|
||||||
StartUniversalTranscodeRequest request,
|
StartUniversalTranscodeRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetServerActivities {
|
public interface MethodCallGetServerActivities {
|
||||||
GetServerActivitiesResponse getServerActivities(
|
GetServerActivitiesResponse getServerActivitiesDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallCancelServerActivities {
|
public interface MethodCallCancelServerActivities {
|
||||||
CancelServerActivitiesResponse cancelServerActivities(
|
CancelServerActivitiesResponse cancelServerActivities(
|
||||||
String activityUUID,
|
String activityUUID) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetButlerTasks {
|
public interface MethodCallGetButlerTasks {
|
||||||
GetButlerTasksResponse getButlerTasks(
|
GetButlerTasksResponse getButlerTasksDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallStartAllTasks {
|
public interface MethodCallStartAllTasks {
|
||||||
StartAllTasksResponse startAllTasks(
|
StartAllTasksResponse startAllTasksDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallStopAllTasks {
|
public interface MethodCallStopAllTasks {
|
||||||
StopAllTasksResponse stopAllTasks(
|
StopAllTasksResponse stopAllTasksDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallStartTask {
|
public interface MethodCallStartTask {
|
||||||
StartTaskResponse startTask(
|
StartTaskResponse startTask(
|
||||||
TaskName taskName,
|
TaskName taskName) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallStopTask {
|
public interface MethodCallStopTask {
|
||||||
StopTaskResponse stopTask(
|
StopTaskResponse stopTask(
|
||||||
PathParamTaskName taskName,
|
PathParamTaskName taskName) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetCompanionsData {
|
public interface MethodCallGetCompanionsData {
|
||||||
GetCompanionsDataResponse getCompanionsData(
|
GetCompanionsDataResponse getCompanionsData(
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetUserFriends {
|
public interface MethodCallGetUserFriends {
|
||||||
GetUserFriendsResponse getUserFriends(
|
GetUserFriendsResponse getUserFriends(
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetGeoData {
|
public interface MethodCallGetGeoData {
|
||||||
GetGeoDataResponse getGeoData(
|
GetGeoDataResponse getGeoData(
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetHomeData {
|
public interface MethodCallGetHomeData {
|
||||||
GetHomeDataResponse getHomeData(
|
GetHomeDataResponse getHomeDataDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -199,39 +171,34 @@ public class SDKMethodInterfaces {
|
|||||||
Optional<? extends IncludeRelay> includeRelay,
|
Optional<? extends IncludeRelay> includeRelay,
|
||||||
Optional<? extends IncludeIPv6> includeIPv6,
|
Optional<? extends IncludeIPv6> includeIPv6,
|
||||||
Optional<String> clientID,
|
Optional<String> clientID,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetPin {
|
public interface MethodCallGetPin {
|
||||||
GetPinResponse getPin(
|
GetPinResponse getPin(
|
||||||
GetPinRequest request,
|
GetPinRequest request,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetTokenByPinId {
|
public interface MethodCallGetTokenByPinId {
|
||||||
GetTokenByPinIdResponse getTokenByPinId(
|
GetTokenByPinIdResponse getTokenByPinId(
|
||||||
GetTokenByPinIdRequest request,
|
GetTokenByPinIdRequest request,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetGlobalHubs {
|
public interface MethodCallGetGlobalHubs {
|
||||||
GetGlobalHubsResponse getGlobalHubs(
|
GetGlobalHubsResponse getGlobalHubs(
|
||||||
Optional<Double> count,
|
Optional<Double> count,
|
||||||
Optional<? extends OnlyTransient> onlyTransient,
|
Optional<? extends OnlyTransient> onlyTransient) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetRecentlyAdded {
|
public interface MethodCallGetRecentlyAdded {
|
||||||
GetRecentlyAddedResponse getRecentlyAdded(
|
GetRecentlyAddedResponse getRecentlyAdded(
|
||||||
GetRecentlyAddedRequest request,
|
GetRecentlyAddedRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -239,8 +206,7 @@ public class SDKMethodInterfaces {
|
|||||||
GetLibraryHubsResponse getLibraryHubs(
|
GetLibraryHubsResponse getLibraryHubs(
|
||||||
double sectionId,
|
double sectionId,
|
||||||
Optional<Double> count,
|
Optional<Double> count,
|
||||||
Optional<? extends QueryParamOnlyTransient> onlyTransient,
|
Optional<? extends QueryParamOnlyTransient> onlyTransient) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -248,8 +214,7 @@ public class SDKMethodInterfaces {
|
|||||||
PerformSearchResponse performSearch(
|
PerformSearchResponse performSearch(
|
||||||
String query,
|
String query,
|
||||||
Optional<Double> sectionId,
|
Optional<Double> sectionId,
|
||||||
Optional<Double> limit,
|
Optional<Double> limit) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -257,118 +222,102 @@ public class SDKMethodInterfaces {
|
|||||||
PerformVoiceSearchResponse performVoiceSearch(
|
PerformVoiceSearchResponse performVoiceSearch(
|
||||||
String query,
|
String query,
|
||||||
Optional<Double> sectionId,
|
Optional<Double> sectionId,
|
||||||
Optional<Double> limit,
|
Optional<Double> limit) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetSearchResults {
|
public interface MethodCallGetSearchResults {
|
||||||
GetSearchResultsResponse getSearchResults(
|
GetSearchResultsResponse getSearchResults(
|
||||||
String query,
|
String query) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetFileHash {
|
public interface MethodCallGetFileHash {
|
||||||
GetFileHashResponse getFileHash(
|
GetFileHashResponse getFileHash(
|
||||||
String url,
|
String url,
|
||||||
Optional<Double> type,
|
Optional<Double> type) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetRecentlyAddedLibrary {
|
public interface MethodCallGetRecentlyAddedLibrary {
|
||||||
GetRecentlyAddedLibraryResponse getRecentlyAddedLibrary(
|
GetRecentlyAddedLibraryResponse getRecentlyAddedLibrary(
|
||||||
GetRecentlyAddedLibraryRequest request,
|
GetRecentlyAddedLibraryRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetAllLibraries {
|
public interface MethodCallGetAllLibraries {
|
||||||
GetAllLibrariesResponse getAllLibraries(
|
GetAllLibrariesResponse getAllLibrariesDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetLibraryDetails {
|
public interface MethodCallGetLibraryDetails {
|
||||||
GetLibraryDetailsResponse getLibraryDetails(
|
GetLibraryDetailsResponse getLibraryDetails(
|
||||||
Optional<? extends IncludeDetails> includeDetails,
|
Optional<? extends IncludeDetails> includeDetails,
|
||||||
int sectionKey,
|
int sectionKey) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallDeleteLibrary {
|
public interface MethodCallDeleteLibrary {
|
||||||
DeleteLibraryResponse deleteLibrary(
|
DeleteLibraryResponse deleteLibrary(
|
||||||
int sectionKey,
|
int sectionKey) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetLibraryItems {
|
public interface MethodCallGetLibraryItems {
|
||||||
GetLibraryItemsResponse getLibraryItems(
|
GetLibraryItemsResponse getLibraryItems(
|
||||||
GetLibraryItemsRequest request,
|
GetLibraryItemsRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetRefreshLibraryMetadata {
|
public interface MethodCallGetRefreshLibraryMetadata {
|
||||||
GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata(
|
GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata(
|
||||||
Optional<? extends Force> force,
|
Optional<? extends Force> force,
|
||||||
int sectionKey,
|
int sectionKey) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetSearchLibrary {
|
public interface MethodCallGetSearchLibrary {
|
||||||
GetSearchLibraryResponse getSearchLibrary(
|
GetSearchLibraryResponse getSearchLibrary(
|
||||||
int sectionKey,
|
int sectionKey,
|
||||||
GetSearchLibraryQueryParamType type,
|
GetSearchLibraryQueryParamType type) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetSearchAllLibraries {
|
public interface MethodCallGetSearchAllLibraries {
|
||||||
GetSearchAllLibrariesResponse getSearchAllLibraries(
|
GetSearchAllLibrariesResponse getSearchAllLibraries(
|
||||||
GetSearchAllLibrariesRequest request,
|
GetSearchAllLibrariesRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetMetaDataByRatingKey {
|
public interface MethodCallGetMetaDataByRatingKey {
|
||||||
GetMetaDataByRatingKeyResponse getMetaDataByRatingKey(
|
GetMetaDataByRatingKeyResponse getMetaDataByRatingKey(
|
||||||
long ratingKey,
|
long ratingKey) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetMetadataChildren {
|
public interface MethodCallGetMetadataChildren {
|
||||||
GetMetadataChildrenResponse getMetadataChildren(
|
GetMetadataChildrenResponse getMetadataChildren(
|
||||||
double ratingKey,
|
double ratingKey,
|
||||||
Optional<String> includeElements,
|
Optional<String> includeElements) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetTopWatchedContent {
|
public interface MethodCallGetTopWatchedContent {
|
||||||
GetTopWatchedContentResponse getTopWatchedContent(
|
GetTopWatchedContentResponse getTopWatchedContent(
|
||||||
Optional<Long> includeGuids,
|
Optional<Long> includeGuids,
|
||||||
GetTopWatchedContentQueryParamType type,
|
GetTopWatchedContentQueryParamType type) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetOnDeck {
|
public interface MethodCallGetOnDeck {
|
||||||
GetOnDeckResponse getOnDeck(
|
GetOnDeckResponse getOnDeckDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetWatchList {
|
public interface MethodCallGetWatchList {
|
||||||
GetWatchListResponse getWatchList(
|
GetWatchListResponse getWatchList(
|
||||||
GetWatchListRequest request,
|
GetWatchListRequest request,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -376,50 +325,43 @@ public class SDKMethodInterfaces {
|
|||||||
LogLineResponse logLine(
|
LogLineResponse logLine(
|
||||||
Level level,
|
Level level,
|
||||||
String message,
|
String message,
|
||||||
String source,
|
String source) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallLogMultiLine {
|
public interface MethodCallLogMultiLine {
|
||||||
LogMultiLineResponse logMultiLine(
|
LogMultiLineResponse logMultiLine(
|
||||||
String request,
|
String request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallEnablePaperTrail {
|
public interface MethodCallEnablePaperTrail {
|
||||||
EnablePaperTrailResponse enablePaperTrail(
|
EnablePaperTrailResponse enablePaperTrailDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallCreatePlaylist {
|
public interface MethodCallCreatePlaylist {
|
||||||
CreatePlaylistResponse createPlaylist(
|
CreatePlaylistResponse createPlaylist(
|
||||||
CreatePlaylistRequest request,
|
CreatePlaylistRequest request) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetPlaylists {
|
public interface MethodCallGetPlaylists {
|
||||||
GetPlaylistsResponse getPlaylists(
|
GetPlaylistsResponse getPlaylists(
|
||||||
Optional<? extends PlaylistType> playlistType,
|
Optional<? extends PlaylistType> playlistType,
|
||||||
Optional<? extends QueryParamSmart> smart,
|
Optional<? extends QueryParamSmart> smart) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetPlaylist {
|
public interface MethodCallGetPlaylist {
|
||||||
GetPlaylistResponse getPlaylist(
|
GetPlaylistResponse getPlaylist(
|
||||||
double playlistID,
|
double playlistID) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallDeletePlaylist {
|
public interface MethodCallDeletePlaylist {
|
||||||
DeletePlaylistResponse deletePlaylist(
|
DeletePlaylistResponse deletePlaylist(
|
||||||
double playlistID,
|
double playlistID) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -427,23 +369,20 @@ public class SDKMethodInterfaces {
|
|||||||
UpdatePlaylistResponse updatePlaylist(
|
UpdatePlaylistResponse updatePlaylist(
|
||||||
double playlistID,
|
double playlistID,
|
||||||
Optional<String> title,
|
Optional<String> title,
|
||||||
Optional<String> summary,
|
Optional<String> summary) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetPlaylistContents {
|
public interface MethodCallGetPlaylistContents {
|
||||||
GetPlaylistContentsResponse getPlaylistContents(
|
GetPlaylistContentsResponse getPlaylistContents(
|
||||||
double playlistID,
|
double playlistID,
|
||||||
GetPlaylistContentsQueryParamType type,
|
GetPlaylistContentsQueryParamType type) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallClearPlaylistContents {
|
public interface MethodCallClearPlaylistContents {
|
||||||
ClearPlaylistContentsResponse clearPlaylistContents(
|
ClearPlaylistContentsResponse clearPlaylistContents(
|
||||||
double playlistID,
|
double playlistID) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -451,8 +390,7 @@ public class SDKMethodInterfaces {
|
|||||||
AddPlaylistContentsResponse addPlaylistContents(
|
AddPlaylistContentsResponse addPlaylistContents(
|
||||||
double playlistID,
|
double playlistID,
|
||||||
String uri,
|
String uri,
|
||||||
Optional<Double> playQueueID,
|
Optional<Double> playQueueID) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -460,65 +398,56 @@ public class SDKMethodInterfaces {
|
|||||||
UploadPlaylistResponse uploadPlaylist(
|
UploadPlaylistResponse uploadPlaylist(
|
||||||
String path,
|
String path,
|
||||||
QueryParamForce force,
|
QueryParamForce force,
|
||||||
long sectionID,
|
long sectionID) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetTransientToken {
|
public interface MethodCallGetTransientToken {
|
||||||
GetTransientTokenResponse getTransientToken(
|
GetTransientTokenResponse getTransientToken(
|
||||||
GetTransientTokenQueryParamType type,
|
GetTransientTokenQueryParamType type,
|
||||||
Scope scope,
|
Scope scope) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetSourceConnectionInformation {
|
public interface MethodCallGetSourceConnectionInformation {
|
||||||
GetSourceConnectionInformationResponse getSourceConnectionInformation(
|
GetSourceConnectionInformationResponse getSourceConnectionInformation(
|
||||||
String source,
|
String source) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetTokenDetails {
|
public interface MethodCallGetTokenDetails {
|
||||||
GetTokenDetailsResponse getTokenDetails(
|
GetTokenDetailsResponse getTokenDetails(
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallPostUsersSignInData {
|
public interface MethodCallPostUsersSignInData {
|
||||||
PostUsersSignInDataResponse postUsersSignInData(
|
PostUsersSignInDataResponse postUsersSignInData(
|
||||||
PostUsersSignInDataRequest request,
|
PostUsersSignInDataRequest request,
|
||||||
Optional<String> serverURL,
|
Optional<String> serverURL) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetStatistics {
|
public interface MethodCallGetStatistics {
|
||||||
GetStatisticsResponse getStatistics(
|
GetStatisticsResponse getStatistics(
|
||||||
Optional<Long> timespan,
|
Optional<Long> timespan) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetResourcesStatistics {
|
public interface MethodCallGetResourcesStatistics {
|
||||||
GetResourcesStatisticsResponse getResourcesStatistics(
|
GetResourcesStatisticsResponse getResourcesStatistics(
|
||||||
Optional<Long> timespan,
|
Optional<Long> timespan) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetBandwidthStatistics {
|
public interface MethodCallGetBandwidthStatistics {
|
||||||
GetBandwidthStatisticsResponse getBandwidthStatistics(
|
GetBandwidthStatisticsResponse getBandwidthStatistics(
|
||||||
Optional<Long> timespan,
|
Optional<Long> timespan) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetSessions {
|
public interface MethodCallGetSessions {
|
||||||
GetSessionsResponse getSessions(
|
GetSessionsResponse getSessionsDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -527,42 +456,36 @@ public class SDKMethodInterfaces {
|
|||||||
Optional<String> sort,
|
Optional<String> sort,
|
||||||
Optional<Long> accountId,
|
Optional<Long> accountId,
|
||||||
Optional<? extends QueryParamFilter> filter,
|
Optional<? extends QueryParamFilter> filter,
|
||||||
Optional<Long> librarySectionID,
|
Optional<Long> librarySectionID) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetTranscodeSessions {
|
public interface MethodCallGetTranscodeSessions {
|
||||||
GetTranscodeSessionsResponse getTranscodeSessions(
|
GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallStopTranscodeSession {
|
public interface MethodCallStopTranscodeSession {
|
||||||
StopTranscodeSessionResponse stopTranscodeSession(
|
StopTranscodeSessionResponse stopTranscodeSession(
|
||||||
String sessionKey,
|
String sessionKey) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallGetUpdateStatus {
|
public interface MethodCallGetUpdateStatus {
|
||||||
GetUpdateStatusResponse getUpdateStatus(
|
GetUpdateStatusResponse getUpdateStatusDirect() throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallCheckForUpdates {
|
public interface MethodCallCheckForUpdates {
|
||||||
CheckForUpdatesResponse checkForUpdates(
|
CheckForUpdatesResponse checkForUpdates(
|
||||||
Optional<? extends Download> download,
|
Optional<? extends Download> download) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface MethodCallApplyUpdates {
|
public interface MethodCallApplyUpdates {
|
||||||
ApplyUpdatesResponse applyUpdates(
|
ApplyUpdatesResponse applyUpdates(
|
||||||
Optional<? extends Tonight> tonight,
|
Optional<? extends Tonight> tonight,
|
||||||
Optional<? extends Skip> skip,
|
Optional<? extends Skip> skip) throws Exception;
|
||||||
Optional<Options> options) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,37 +4,17 @@
|
|||||||
|
|
||||||
package dev.plexapi.sdk.models.operations;
|
package dev.plexapi.sdk.models.operations;
|
||||||
|
|
||||||
import dev.plexapi.sdk.utils.Options;
|
|
||||||
import dev.plexapi.sdk.utils.RetryConfig;
|
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class StartAllTasksRequestBuilder {
|
public class StartAllTasksRequestBuilder {
|
||||||
|
|
||||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
|
||||||
private final SDKMethodInterfaces.MethodCallStartAllTasks sdk;
|
private final SDKMethodInterfaces.MethodCallStartAllTasks sdk;
|
||||||
|
|
||||||
public StartAllTasksRequestBuilder(SDKMethodInterfaces.MethodCallStartAllTasks sdk) {
|
public StartAllTasksRequestBuilder(SDKMethodInterfaces.MethodCallStartAllTasks sdk) {
|
||||||
this.sdk = sdk;
|
this.sdk = sdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StartAllTasksRequestBuilder retryConfig(RetryConfig retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = Optional.of(retryConfig);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public StartAllTasksRequestBuilder retryConfig(Optional<RetryConfig> retryConfig) {
|
|
||||||
Utils.checkNotNull(retryConfig, "retryConfig");
|
|
||||||
this.retryConfig = retryConfig;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public StartAllTasksResponse call() throws Exception {
|
public StartAllTasksResponse call() throws Exception {
|
||||||
Optional<Options> options = Optional.of(Options.builder()
|
|
||||||
.retryConfig(retryConfig)
|
return sdk.startAllTasksDirect();
|
||||||
.build());
|
|
||||||
return sdk.startAllTasks(
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user