mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-07 04:20:49 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.406.0
This commit is contained in:
@@ -17,19 +17,27 @@ import dev.plexapi.sdk.models.operations.GetServerActivitiesRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse;
|
||||
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
|
||||
@@ -68,6 +76,22 @@ public class Activities implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetServerActivitiesResponse getServerActivitiesDirect() throws Exception {
|
||||
return getServerActivities(Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Server Activities
|
||||
* Get Server Activities
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetServerActivitiesResponse getServerActivities(
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -83,45 +107,62 @@ public class Activities implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -217,6 +258,24 @@ public class Activities implements
|
||||
*/
|
||||
public CancelServerActivitiesResponse cancelServerActivities(
|
||||
String activityUUID) throws Exception {
|
||||
return cancelServerActivities(activityUUID, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel Server Activities
|
||||
* Cancel Server Activities
|
||||
* @param activityUUID The UUID of the activity to cancel.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public CancelServerActivitiesResponse cancelServerActivities(
|
||||
String activityUUID,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
CancelServerActivitiesRequest request =
|
||||
CancelServerActivitiesRequest
|
||||
.builder()
|
||||
@@ -240,45 +299,62 @@ public class Activities implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"cancelServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"cancelServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"cancelServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"cancelServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"cancelServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"cancelServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"cancelServerActivities",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -30,11 +30,16 @@ import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse;
|
||||
import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.models.operations.Scope;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.SerializedBody;
|
||||
import dev.plexapi.sdk.utils.Utils.JsonShape;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
@@ -44,9 +49,12 @@ import java.lang.Object;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* API Calls regarding authentication for Plex Media Server
|
||||
@@ -101,6 +109,27 @@ public class Authentication implements
|
||||
public GetTransientTokenResponse getTransientToken(
|
||||
GetTransientTokenQueryParamType type,
|
||||
Scope scope) throws Exception {
|
||||
return getTransientToken(type, scope, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Transient Token
|
||||
* This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
|
||||
*
|
||||
* @param type `delegation` - This is the only supported `type` parameter.
|
||||
* @param scope `all` - This is the only supported `scope` parameter.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetTransientTokenResponse getTransientToken(
|
||||
GetTransientTokenQueryParamType type,
|
||||
Scope scope,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetTransientTokenRequest request =
|
||||
GetTransientTokenRequest
|
||||
.builder()
|
||||
@@ -128,45 +157,62 @@ public class Authentication implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getTransientToken",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTransientToken",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getTransientToken",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTransientToken",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getTransientToken",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTransientToken",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getTransientToken",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -255,6 +301,26 @@ public class Authentication implements
|
||||
*/
|
||||
public GetSourceConnectionInformationResponse getSourceConnectionInformation(
|
||||
String source) throws Exception {
|
||||
return getSourceConnectionInformation(source, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Source Connection Information
|
||||
* If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
|
||||
* Note: requires Plex Media Server >= 1.15.4.
|
||||
*
|
||||
* @param source The source identifier with an included prefix.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetSourceConnectionInformationResponse getSourceConnectionInformation(
|
||||
String source,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetSourceConnectionInformationRequest request =
|
||||
GetSourceConnectionInformationRequest
|
||||
.builder()
|
||||
@@ -281,45 +347,62 @@ public class Authentication implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getSourceConnectionInformation",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getSourceConnectionInformation",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getSourceConnectionInformation",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getSourceConnectionInformation",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getSourceConnectionInformation",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getSourceConnectionInformation",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getSourceConnectionInformation",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -402,18 +485,24 @@ public class Authentication implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetTokenDetailsResponse getTokenDetailsDirect() throws Exception {
|
||||
return getTokenDetails(Optional.empty());
|
||||
return getTokenDetails(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Token Details
|
||||
* Get the User data from the provided X-Plex-Token
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetTokenDetailsResponse getTokenDetails(
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(GET_TOKEN_DETAILS_SERVERS[0], new HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
@@ -431,45 +520,62 @@ public class Authentication implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getTokenDetails",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTokenDetails",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getTokenDetails",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTokenDetails",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getTokenDetails",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTokenDetails",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getTokenDetails",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -565,7 +671,7 @@ public class Authentication implements
|
||||
*/
|
||||
public PostUsersSignInDataResponse postUsersSignInData(
|
||||
PostUsersSignInDataRequest request) throws Exception {
|
||||
return postUsersSignInData(request, Optional.empty());
|
||||
return postUsersSignInData(request, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -573,12 +679,18 @@ public class Authentication implements
|
||||
* Sign in user with username and password and return user data with Plex authentication token
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public PostUsersSignInDataResponse postUsersSignInData(
|
||||
PostUsersSignInDataRequest request,
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(POST_USERS_SIGN_IN_DATA_SERVERS[0], new HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
@@ -601,52 +713,65 @@ public class Authentication implements
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
SDKConfiguration.USER_AGENT);
|
||||
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
PostUsersSignInDataRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"post-users-sign-in-data",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"post-users-sign-in-data",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"post-users-sign-in-data",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"post-users-sign-in-data",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"post-users-sign-in-data",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"post-users-sign-in-data",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"post-users-sign-in-data",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -32,19 +32,27 @@ import dev.plexapi.sdk.models.operations.StopTaskRequest;
|
||||
import dev.plexapi.sdk.models.operations.StopTaskRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.StopTaskResponse;
|
||||
import dev.plexapi.sdk.models.operations.TaskName;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Butler is the task manager of the Plex Media Server Ecosystem.
|
||||
@@ -80,6 +88,22 @@ public class Butler implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetButlerTasksResponse getButlerTasksDirect() throws Exception {
|
||||
return getButlerTasks(Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Butler tasks
|
||||
* Returns a list of butler tasks
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetButlerTasksResponse getButlerTasks(
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -95,45 +119,62 @@ public class Butler implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getButlerTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getButlerTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getButlerTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getButlerTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getButlerTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getButlerTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getButlerTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -237,6 +278,27 @@ public class Butler implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public StartAllTasksResponse startAllTasksDirect() throws Exception {
|
||||
return startAllTasks(Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Start all Butler tasks
|
||||
* This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
|
||||
* 1. Any tasks not scheduled to run on the current day will be skipped.
|
||||
* 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
|
||||
* 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
|
||||
* 4. If we are outside the configured window, the task will start immediately.
|
||||
*
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public StartAllTasksResponse startAllTasks(
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -252,45 +314,62 @@ public class Butler implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"startAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"startAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"startAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"startAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"startAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"startAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"startAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -375,6 +454,23 @@ public class Butler implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public StopAllTasksResponse stopAllTasksDirect() throws Exception {
|
||||
return stopAllTasks(Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop all Butler tasks
|
||||
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
||||
*
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public StopAllTasksResponse stopAllTasks(
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -390,45 +486,62 @@ public class Butler implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"stopAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"stopAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"stopAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"stopAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"stopAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"stopAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"stopAllTasks",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -523,6 +636,29 @@ public class Butler implements
|
||||
*/
|
||||
public StartTaskResponse startTask(
|
||||
TaskName taskName) throws Exception {
|
||||
return startTask(taskName, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a single Butler task
|
||||
* This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
|
||||
* 1. Any tasks not scheduled to run on the current day will be skipped.
|
||||
* 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
|
||||
* 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
|
||||
* 4. If we are outside the configured window, the task will start immediately.
|
||||
*
|
||||
* @param taskName the name of the task to be started.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public StartTaskResponse startTask(
|
||||
TaskName taskName,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
StartTaskRequest request =
|
||||
StartTaskRequest
|
||||
.builder()
|
||||
@@ -546,45 +682,62 @@ public class Butler implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"startTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"startTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"startTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"startTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"startTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"startTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"startTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -671,6 +824,25 @@ public class Butler implements
|
||||
*/
|
||||
public StopTaskResponse stopTask(
|
||||
PathParamTaskName taskName) throws Exception {
|
||||
return stopTask(taskName, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop a single Butler task
|
||||
* This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
|
||||
*
|
||||
* @param taskName The name of the task to be started.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public StopTaskResponse stopTask(
|
||||
PathParamTaskName taskName,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
StopTaskRequest request =
|
||||
StopTaskRequest
|
||||
.builder()
|
||||
@@ -694,45 +866,62 @@ public class Butler implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"stopTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"stopTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"stopTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"stopTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"stopTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"stopTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"stopTask",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -25,11 +25,16 @@ import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.OnlyTransient;
|
||||
import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Double;
|
||||
@@ -37,8 +42,11 @@ import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
||||
@@ -72,7 +80,7 @@ public class Hubs implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetGlobalHubsResponse getGlobalHubsDirect() throws Exception {
|
||||
return getGlobalHubs(Optional.empty(), Optional.empty());
|
||||
return getGlobalHubs(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,12 +88,18 @@ public class Hubs implements
|
||||
* Get Global Hubs filtered by the parameters provided.
|
||||
* @param count The number of items to return with each hub.
|
||||
* @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetGlobalHubsResponse getGlobalHubs(
|
||||
Optional<Double> count,
|
||||
Optional<? extends OnlyTransient> onlyTransient) throws Exception {
|
||||
Optional<? extends OnlyTransient> onlyTransient,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetGlobalHubsRequest request =
|
||||
GetGlobalHubsRequest
|
||||
.builder()
|
||||
@@ -113,45 +127,62 @@ public class Hubs implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getGlobalHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getGlobalHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getGlobalHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getGlobalHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getGlobalHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getGlobalHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getGlobalHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -249,6 +280,25 @@ public class Hubs implements
|
||||
*/
|
||||
public GetRecentlyAddedResponse getRecentlyAdded(
|
||||
GetRecentlyAddedRequest request) throws Exception {
|
||||
return getRecentlyAdded(request, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Recently Added
|
||||
* This endpoint will return the recently added content.
|
||||
*
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetRecentlyAddedResponse getRecentlyAdded(
|
||||
GetRecentlyAddedRequest request,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -269,45 +319,62 @@ public class Hubs implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-recently-added",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-recently-added",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"get-recently-added",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-recently-added",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-recently-added",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-recently-added",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"get-recently-added",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -373,7 +440,7 @@ public class Hubs implements
|
||||
*/
|
||||
public GetLibraryHubsResponse getLibraryHubs(
|
||||
double sectionId) throws Exception {
|
||||
return getLibraryHubs(sectionId, Optional.empty(), Optional.empty());
|
||||
return getLibraryHubs(sectionId, Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,13 +450,19 @@ public class Hubs implements
|
||||
* @param sectionId the Id of the library to query
|
||||
* @param count The number of items to return with each hub.
|
||||
* @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetLibraryHubsResponse getLibraryHubs(
|
||||
double sectionId,
|
||||
Optional<Double> count,
|
||||
Optional<? extends QueryParamOnlyTransient> onlyTransient) throws Exception {
|
||||
Optional<? extends QueryParamOnlyTransient> onlyTransient,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetLibraryHubsRequest request =
|
||||
GetLibraryHubsRequest
|
||||
.builder()
|
||||
@@ -420,45 +493,62 @@ public class Hubs implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getLibraryHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getLibraryHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getLibraryHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getLibraryHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getLibraryHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getLibraryHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getLibraryHubs",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,11 +21,16 @@ import dev.plexapi.sdk.models.operations.LogLineResponse;
|
||||
import dev.plexapi.sdk.models.operations.LogMultiLineRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.LogMultiLineResponse;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.SerializedBody;
|
||||
import dev.plexapi.sdk.utils.Utils.JsonShape;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
@@ -35,8 +40,11 @@ import java.lang.Object;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Submit logs to the Log Handler for Plex Media Server
|
||||
@@ -84,6 +92,35 @@ public class Log implements
|
||||
Level level,
|
||||
String message,
|
||||
String source) throws Exception {
|
||||
return logLine(level, message, source, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Logging a single line message.
|
||||
* This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
|
||||
*
|
||||
* @param level An integer log level to write to the PMS log with.
|
||||
0: Error
|
||||
1: Warning
|
||||
2: Info
|
||||
3: Debug
|
||||
4: Verbose
|
||||
|
||||
* @param message The text of the message to write to the log.
|
||||
* @param source a string indicating the source of the message.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public LogLineResponse logLine(
|
||||
Level level,
|
||||
String message,
|
||||
String source,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
LogLineRequest request =
|
||||
LogLineRequest
|
||||
.builder()
|
||||
@@ -112,45 +149,62 @@ public class Log implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"logLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"logLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"logLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"logLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"logLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"logLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"logLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -277,6 +331,45 @@ public class Log implements
|
||||
*/
|
||||
public LogMultiLineResponse logMultiLine(
|
||||
String request) throws Exception {
|
||||
return logMultiLine(request, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Logging a multi-line message
|
||||
* This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
|
||||
* It accepts a text/plain request body, where each line represents a distinct log entry.
|
||||
* Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
|
||||
*
|
||||
* Log entries are separated by a newline character (`\n`).
|
||||
* Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
|
||||
* This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
|
||||
*
|
||||
* The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
|
||||
* - `0`: Error - Critical issues that require immediate attention.
|
||||
* - `1`: Warning - Important events that are not critical but may indicate potential issues.
|
||||
* - `2`: Info - General informational messages about system operation.
|
||||
* - `3`: Debug - Detailed information useful for debugging purposes.
|
||||
* - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
|
||||
*
|
||||
* The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
|
||||
*
|
||||
* Example of a single log entry format:
|
||||
* `level=4&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(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -305,45 +398,62 @@ public class Log implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"logMultiLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"logMultiLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"logMultiLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"logMultiLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"logMultiLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"logMultiLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"logMultiLine",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -428,6 +538,23 @@ public class Log implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public EnablePaperTrailResponse enablePaperTrailDirect() throws Exception {
|
||||
return enablePaperTrail(Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Enabling Papertrail
|
||||
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
|
||||
*
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public EnablePaperTrailResponse enablePaperTrail(
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -443,45 +570,62 @@ public class Log implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"enablePaperTrail",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"enablePaperTrail",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"enablePaperTrail",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"enablePaperTrail",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"enablePaperTrail",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"enablePaperTrail",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"enablePaperTrail",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -32,19 +32,27 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest;
|
||||
import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* API Calls interacting with Plex Media Server Media
|
||||
@@ -82,6 +90,24 @@ public class Media implements
|
||||
*/
|
||||
public MarkPlayedResponse markPlayed(
|
||||
double key) throws Exception {
|
||||
return markPlayed(key, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark Media Played
|
||||
* This will mark the provided media key as Played.
|
||||
* @param key The media key to mark as played
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public MarkPlayedResponse markPlayed(
|
||||
double key,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
MarkPlayedRequest request =
|
||||
MarkPlayedRequest
|
||||
.builder()
|
||||
@@ -108,45 +134,62 @@ public class Media implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"markPlayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"markPlayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"markPlayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"markPlayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"markPlayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"markPlayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"markPlayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -231,6 +274,24 @@ public class Media implements
|
||||
*/
|
||||
public MarkUnplayedResponse markUnplayed(
|
||||
double key) throws Exception {
|
||||
return markUnplayed(key, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark Media Unplayed
|
||||
* This will mark the provided media key as Unplayed.
|
||||
* @param key The media key to mark as Unplayed
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public MarkUnplayedResponse markUnplayed(
|
||||
double key,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
MarkUnplayedRequest request =
|
||||
MarkUnplayedRequest
|
||||
.builder()
|
||||
@@ -257,45 +318,62 @@ public class Media implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"markUnplayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"markUnplayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"markUnplayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"markUnplayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"markUnplayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"markUnplayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"markUnplayed",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -386,6 +464,29 @@ public class Media implements
|
||||
String key,
|
||||
double time,
|
||||
String state) throws Exception {
|
||||
return updatePlayProgress(key, time, state, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Media Play Progress
|
||||
* This API command can be used to update the play progress of a media item.
|
||||
*
|
||||
* @param key the media key
|
||||
* @param time The time, in milliseconds, used to set the media playback progress.
|
||||
* @param state The playback state of the media item.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public UpdatePlayProgressResponse updatePlayProgress(
|
||||
String key,
|
||||
double time,
|
||||
String state,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
UpdatePlayProgressRequest request =
|
||||
UpdatePlayProgressRequest
|
||||
.builder()
|
||||
@@ -414,45 +515,62 @@ public class Media implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"updatePlayProgress",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"updatePlayProgress",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"updatePlayProgress",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"updatePlayProgress",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"updatePlayProgress",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"updatePlayProgress",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"updatePlayProgress",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -537,6 +655,24 @@ public class Media implements
|
||||
*/
|
||||
public GetBannerImageResponse getBannerImage(
|
||||
GetBannerImageRequest request) throws Exception {
|
||||
return getBannerImage(request, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Banner Image
|
||||
* Gets the banner image of the media item
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetBannerImageResponse getBannerImage(
|
||||
GetBannerImageRequest request,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -554,50 +690,68 @@ public class Media implements
|
||||
GetBannerImageRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-banner-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-banner-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"get-banner-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-banner-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-banner-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-banner-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"get-banner-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -693,6 +847,24 @@ public class Media implements
|
||||
*/
|
||||
public GetThumbImageResponse getThumbImage(
|
||||
GetThumbImageRequest request) throws Exception {
|
||||
return getThumbImage(request, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Thumb Image
|
||||
* Gets the thumbnail image of the media item
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetThumbImageResponse getThumbImage(
|
||||
GetThumbImageRequest request,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -710,50 +882,68 @@ public class Media implements
|
||||
GetThumbImageRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-thumb-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-thumb-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"get-thumb-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-thumb-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-thumb-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-thumb-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"get-thumb-image",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -47,20 +47,28 @@ import dev.plexapi.sdk.models.operations.IncludeRelay;
|
||||
import dev.plexapi.sdk.models.operations.PlexDevice;
|
||||
import dev.plexapi.sdk.models.operations.ResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* API Calls that perform operations directly against https://Plex.tv
|
||||
@@ -140,18 +148,24 @@ public class Plex implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetCompanionsDataResponse getCompanionsDataDirect() throws Exception {
|
||||
return getCompanionsData(Optional.empty());
|
||||
return getCompanionsData(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Companions Data
|
||||
* Get Companions Data
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetCompanionsDataResponse getCompanionsData(
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(GET_COMPANIONS_DATA_SERVERS[0], new HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
@@ -169,45 +183,62 @@ public class Plex implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getCompanionsData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getCompanionsData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getCompanionsData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getCompanionsData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getCompanionsData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getCompanionsData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getCompanionsData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -301,18 +332,24 @@ public class Plex implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetUserFriendsResponse getUserFriendsDirect() throws Exception {
|
||||
return getUserFriends(Optional.empty());
|
||||
return getUserFriends(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of friends of the user logged in
|
||||
* Get friends of provided auth token.
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetUserFriendsResponse getUserFriends(
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(GET_USER_FRIENDS_SERVERS[0], new HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
@@ -330,45 +367,62 @@ public class Plex implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getUserFriends",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getUserFriends",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getUserFriends",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getUserFriends",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getUserFriends",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getUserFriends",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getUserFriends",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -462,18 +516,24 @@ public class Plex implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetGeoDataResponse getGeoDataDirect() throws Exception {
|
||||
return getGeoData(Optional.empty());
|
||||
return getGeoData(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Geo Data
|
||||
* Returns the geolocation and locale data of the caller
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetGeoDataResponse getGeoData(
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(GET_GEO_DATA_SERVERS[0], new HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
@@ -488,45 +548,62 @@ public class Plex implements
|
||||
SDKConfiguration.USER_AGENT);
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getGeoData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getGeoData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getGeoData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getGeoData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getGeoData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getGeoData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getGeoData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -620,6 +697,22 @@ public class Plex implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetHomeDataResponse getHomeDataDirect() throws Exception {
|
||||
return getHomeData(Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plex Home Data
|
||||
* Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetHomeDataResponse getHomeData(
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -635,45 +728,62 @@ public class Plex implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getHomeData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getHomeData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getHomeData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getHomeData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getHomeData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getHomeData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getHomeData",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -767,7 +877,7 @@ public class Plex implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetServerResourcesResponse getServerResourcesDirect() throws Exception {
|
||||
return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -778,8 +888,9 @@ public class Plex implements
|
||||
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
|
||||
|
||||
* @param includeIPv6 Include IPv6 entries in the results
|
||||
* @param clientID The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device)
|
||||
* @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
@@ -788,7 +899,12 @@ public class Plex implements
|
||||
Optional<? extends IncludeRelay> includeRelay,
|
||||
Optional<? extends IncludeIPv6> includeIPv6,
|
||||
Optional<String> clientID,
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetServerResourcesRequest request =
|
||||
GetServerResourcesRequest
|
||||
.builder()
|
||||
@@ -815,50 +931,68 @@ public class Plex implements
|
||||
GetServerResourcesRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-server-resources",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-server-resources",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"get-server-resources",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-server-resources",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-server-resources",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-server-resources",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"get-server-resources",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -954,7 +1088,7 @@ public class Plex implements
|
||||
*/
|
||||
public GetPinResponse getPin(
|
||||
GetPinRequest request) throws Exception {
|
||||
return getPin(request, Optional.empty());
|
||||
return getPin(request, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -962,12 +1096,18 @@ public class Plex implements
|
||||
* Retrieve a Pin ID from Plex.tv to use for authentication flows
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetPinResponse getPin(
|
||||
GetPinRequest request,
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(GET_PIN_SERVERS[0], new HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
@@ -985,47 +1125,65 @@ public class Plex implements
|
||||
GetPinRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getPin",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getPin",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getPin",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getPin",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getPin",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getPin",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getPin",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -1105,7 +1263,7 @@ public class Plex implements
|
||||
*/
|
||||
public GetTokenByPinIdResponse getTokenByPinId(
|
||||
GetTokenByPinIdRequest request) throws Exception {
|
||||
return getTokenByPinId(request, Optional.empty());
|
||||
return getTokenByPinId(request, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1113,12 +1271,18 @@ public class Plex implements
|
||||
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetTokenByPinIdResponse getTokenByPinId(
|
||||
GetTokenByPinIdRequest request,
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(GET_TOKEN_BY_PIN_ID_SERVERS[0], new HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
@@ -1133,52 +1297,65 @@ public class Plex implements
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
SDKConfiguration.USER_AGENT);
|
||||
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
GetTokenByPinIdRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getTokenByPinId",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTokenByPinId",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getTokenByPinId",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTokenByPinId",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getTokenByPinId",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_finalReq.build());
|
||||
} catch (Exception _e) {
|
||||
throw new NonRetryableException(_e);
|
||||
}
|
||||
try {
|
||||
return _client.send(_r);
|
||||
} catch (Exception _e) {
|
||||
return sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"getTokenByPinId",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
})
|
||||
.retryConfig(_retryConfig)
|
||||
.statusCodes(_statusCodes)
|
||||
.build();
|
||||
HttpResponse<InputStream> _httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
"getTokenByPinId",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_retries.run());
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.util.Optional;
|
||||
* | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||
* | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||
* | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||
* | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
* | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
*
|
||||
*/
|
||||
public class PlexAPI {
|
||||
@@ -465,11 +465,11 @@ public class PlexAPI {
|
||||
* @return The builder instance.
|
||||
*/
|
||||
public Builder clientID(String clientID) {
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
|
||||
}
|
||||
|
||||
this.sdkConfiguration.globals.get("parameters").get("queryParam").put("clientID", clientID);
|
||||
this.sdkConfiguration.globals.get("parameters").get("header").put("clientID", clientID);
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -481,11 +481,11 @@ public class PlexAPI {
|
||||
* @return The builder instance.
|
||||
*/
|
||||
public Builder clientName(String clientName) {
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
|
||||
}
|
||||
|
||||
this.sdkConfiguration.globals.get("parameters").get("queryParam").put("clientName", clientName);
|
||||
this.sdkConfiguration.globals.get("parameters").get("header").put("clientName", clientName);
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -497,43 +497,43 @@ public class PlexAPI {
|
||||
* @return The builder instance.
|
||||
*/
|
||||
public Builder clientVersion(String clientVersion) {
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
|
||||
}
|
||||
|
||||
this.sdkConfiguration.globals.get("parameters").get("queryParam").put("clientVersion", clientVersion);
|
||||
this.sdkConfiguration.globals.get("parameters").get("header").put("clientVersion", clientVersion);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows setting the clientPlatform parameter for all supported operations.
|
||||
* Allows setting the platform parameter for all supported operations.
|
||||
*
|
||||
* @param clientPlatform The value to set.
|
||||
* @param platform The value to set.
|
||||
* @return The builder instance.
|
||||
*/
|
||||
public Builder clientPlatform(String clientPlatform) {
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
|
||||
public Builder platform(String platform) {
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
|
||||
}
|
||||
|
||||
this.sdkConfiguration.globals.get("parameters").get("queryParam").put("clientPlatform", clientPlatform);
|
||||
this.sdkConfiguration.globals.get("parameters").get("header").put("platform", platform);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows setting the deviceName parameter for all supported operations.
|
||||
* Allows setting the deviceNickname parameter for all supported operations.
|
||||
*
|
||||
* @param deviceName The value to set.
|
||||
* @param deviceNickname The value to set.
|
||||
* @return The builder instance.
|
||||
*/
|
||||
public Builder deviceName(String deviceName) {
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>());
|
||||
public Builder deviceNickname(String deviceNickname) {
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
|
||||
}
|
||||
|
||||
this.sdkConfiguration.globals.get("parameters").get("queryParam").put("deviceName", deviceName);
|
||||
this.sdkConfiguration.globals.get("parameters").get("header").put("deviceNickname", deviceNickname);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ class SDKConfiguration {
|
||||
} };
|
||||
private static final String LANGUAGE = "java";
|
||||
public static final String OPENAPI_DOC_VERSION = "0.0.3";
|
||||
public static final String SDK_VERSION = "0.7.0";
|
||||
public static final String GEN_VERSION = "2.428.1";
|
||||
public static final String SDK_VERSION = "0.8.0";
|
||||
public static final String GEN_VERSION = "2.429.0";
|
||||
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
|
||||
public static final String USER_AGENT =
|
||||
String.format("speakeasy-sdk/%s %s %s %s %s",
|
||||
|
||||
@@ -23,11 +23,16 @@ import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequest;
|
||||
import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Double;
|
||||
@@ -35,8 +40,11 @@ import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* API Calls that perform search operations with Plex Media Server
|
||||
@@ -96,7 +104,7 @@ public class Search implements
|
||||
*/
|
||||
public PerformSearchResponse performSearch(
|
||||
String query) throws Exception {
|
||||
return performSearch(query, Optional.empty(), Optional.empty());
|
||||
return performSearch(query, Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,13 +125,19 @@ public class Search implements
|
||||
* @param query The query term
|
||||
* @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 options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public PerformSearchResponse performSearch(
|
||||
String query,
|
||||
Optional<Double> sectionId,
|
||||
Optional<Double> limit) throws Exception {
|
||||
Optional<Double> limit,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
PerformSearchRequest request =
|
||||
PerformSearchRequest
|
||||
.builder()
|
||||
@@ -152,45 +166,62 @@ public class Search implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"performSearch",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -283,7 +314,7 @@ public class Search implements
|
||||
*/
|
||||
public PerformVoiceSearchResponse performVoiceSearch(
|
||||
String query) throws Exception {
|
||||
return performVoiceSearch(query, Optional.empty(), Optional.empty());
|
||||
return performVoiceSearch(query, Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,13 +327,19 @@ public class Search implements
|
||||
* @param query The query term
|
||||
* @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 options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public PerformVoiceSearchResponse performVoiceSearch(
|
||||
String query,
|
||||
Optional<Double> sectionId,
|
||||
Optional<Double> limit) throws Exception {
|
||||
Optional<Double> limit,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
PerformVoiceSearchRequest request =
|
||||
PerformVoiceSearchRequest
|
||||
.builder()
|
||||
@@ -331,45 +368,62 @@ public class Search implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"performVoiceSearch",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -454,6 +508,24 @@ public class Search implements
|
||||
*/
|
||||
public GetSearchResultsResponse getSearchResults(
|
||||
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
|
||||
.builder()
|
||||
@@ -480,45 +552,62 @@ public class Search implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getSearchResults",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,11 +29,16 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequest;
|
||||
import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
@@ -41,8 +46,11 @@ import java.lang.Long;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* API Calls that perform search operations with Plex Media Server Sessions
|
||||
@@ -77,6 +85,22 @@ public class Sessions implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
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(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -92,45 +116,62 @@ public class Sessions implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getSessions",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -224,7 +265,7 @@ public class Sessions implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetSessionHistoryResponse getSessionHistoryDirect() throws Exception {
|
||||
return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,6 +280,7 @@ public class Sessions implements
|
||||
|
||||
* @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
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
@@ -246,7 +288,12 @@ public class Sessions implements
|
||||
Optional<String> sort,
|
||||
Optional<Long> accountId,
|
||||
Optional<? extends QueryParamFilter> filter,
|
||||
Optional<Long> librarySectionID) throws Exception {
|
||||
Optional<Long> librarySectionID,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetSessionHistoryRequest request =
|
||||
GetSessionHistoryRequest
|
||||
.builder()
|
||||
@@ -276,45 +323,62 @@ public class Sessions implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getSessionHistory",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -408,6 +472,22 @@ public class Sessions implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
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(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -423,45 +503,62 @@ public class Sessions implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getTranscodeSessions",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -557,6 +654,24 @@ public class Sessions implements
|
||||
*/
|
||||
public StopTranscodeSessionResponse stopTranscodeSession(
|
||||
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
|
||||
.builder()
|
||||
@@ -580,45 +695,62 @@ public class Sessions implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"stopTranscodeSession",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -25,11 +25,16 @@ import dev.plexapi.sdk.models.operations.GetStatisticsRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetStatisticsResponse;
|
||||
import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
@@ -37,8 +42,11 @@ import java.lang.Long;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Statistics
|
||||
@@ -72,7 +80,7 @@ public class Statistics implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetStatisticsResponse getStatisticsDirect() throws Exception {
|
||||
return getStatistics(Optional.empty());
|
||||
return getStatistics(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,11 +89,17 @@ public class Statistics implements
|
||||
* @param timespan The timespan to retrieve statistics for
|
||||
the exact meaning of this parameter is not known
|
||||
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetStatisticsResponse getStatistics(
|
||||
Optional<Long> timespan) throws Exception {
|
||||
Optional<Long> timespan,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetStatisticsRequest request =
|
||||
GetStatisticsRequest
|
||||
.builder()
|
||||
@@ -112,45 +126,62 @@ public class Statistics implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getStatistics",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -244,7 +275,7 @@ public class Statistics implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetResourcesStatisticsResponse getResourcesStatisticsDirect() throws Exception {
|
||||
return getResourcesStatistics(Optional.empty());
|
||||
return getResourcesStatistics(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,11 +284,17 @@ public class Statistics implements
|
||||
* @param timespan The timespan to retrieve statistics for
|
||||
the exact meaning of this parameter is not known
|
||||
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetResourcesStatisticsResponse getResourcesStatistics(
|
||||
Optional<Long> timespan) throws Exception {
|
||||
Optional<Long> timespan,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetResourcesStatisticsRequest request =
|
||||
GetResourcesStatisticsRequest
|
||||
.builder()
|
||||
@@ -284,45 +321,62 @@ public class Statistics implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getResourcesStatistics",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -416,7 +470,7 @@ public class Statistics implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetBandwidthStatisticsResponse getBandwidthStatisticsDirect() throws Exception {
|
||||
return getBandwidthStatistics(Optional.empty());
|
||||
return getBandwidthStatistics(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -425,11 +479,17 @@ public class Statistics implements
|
||||
* @param timespan The timespan to retrieve statistics for
|
||||
the exact meaning of this parameter is not known
|
||||
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetBandwidthStatisticsResponse getBandwidthStatistics(
|
||||
Optional<Long> timespan) throws Exception {
|
||||
Optional<Long> timespan,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
GetBandwidthStatisticsRequest request =
|
||||
GetBandwidthStatisticsRequest
|
||||
.builder()
|
||||
@@ -456,45 +516,62 @@ public class Statistics implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getBandwidthStatistics",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -25,19 +25,27 @@ import dev.plexapi.sdk.models.operations.GetUpdateStatusResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.models.operations.Skip;
|
||||
import dev.plexapi.sdk.models.operations.Tonight;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* This describes the API for searching and applying updates to the Plex Media Server.
|
||||
@@ -72,6 +80,22 @@ public class Updater implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
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(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -87,45 +111,62 @@ public class Updater implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getUpdateStatus",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -219,18 +260,24 @@ public class Updater implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public CheckForUpdatesResponse checkForUpdatesDirect() throws Exception {
|
||||
return checkForUpdates(Optional.empty());
|
||||
return checkForUpdates(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking for updates
|
||||
* Checking for updates
|
||||
* @param download Indicate that you want to start download any updates found.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public CheckForUpdatesResponse checkForUpdates(
|
||||
Optional<? extends Download> download) throws Exception {
|
||||
Optional<? extends Download> download,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
CheckForUpdatesRequest request =
|
||||
CheckForUpdatesRequest
|
||||
.builder()
|
||||
@@ -257,45 +304,62 @@ public class Updater implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"checkForUpdates",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -380,7 +444,7 @@ public class Updater implements
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public ApplyUpdatesResponse applyUpdatesDirect() throws Exception {
|
||||
return applyUpdates(Optional.empty(), Optional.empty());
|
||||
return applyUpdates(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -389,12 +453,18 @@ 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 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
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public ApplyUpdatesResponse applyUpdates(
|
||||
Optional<? extends Tonight> tonight,
|
||||
Optional<? extends Skip> skip) throws Exception {
|
||||
Optional<? extends Skip> skip,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
ApplyUpdatesRequest request =
|
||||
ApplyUpdatesRequest
|
||||
.builder()
|
||||
@@ -422,45 +492,62 @@ public class Updater implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"applyUpdates",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "500", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -17,19 +17,27 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest;
|
||||
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Videos
|
||||
@@ -64,6 +72,24 @@ public class Video implements
|
||||
*/
|
||||
public GetTimelineResponse getTimeline(
|
||||
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(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -84,45 +110,62 @@ public class Video implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"getTimeline",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
@@ -207,6 +250,24 @@ public class Video implements
|
||||
*/
|
||||
public StartUniversalTranscodeResponse startUniversalTranscode(
|
||||
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(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
@@ -227,45 +288,62 @@ public class Video implements
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"startUniversalTranscode",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -13,20 +13,28 @@ import dev.plexapi.sdk.models.operations.GetWatchListRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetWatchListResponse;
|
||||
import dev.plexapi.sdk.models.operations.GetWatchListResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.utils.BackoffStrategy;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.Options;
|
||||
import dev.plexapi.sdk.utils.Retries.NonRetryableException;
|
||||
import dev.plexapi.sdk.utils.Retries;
|
||||
import dev.plexapi.sdk.utils.RetryConfig;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Exception;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Watchlists
|
||||
@@ -70,7 +78,7 @@ public class Watchlist implements
|
||||
*/
|
||||
public GetWatchListResponse getWatchList(
|
||||
GetWatchListRequest request) throws Exception {
|
||||
return getWatchList(request, Optional.empty());
|
||||
return getWatchList(request, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,12 +86,18 @@ public class Watchlist implements
|
||||
* Get User Watchlist
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @param options additional options
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetWatchListResponse getWatchList(
|
||||
GetWatchListRequest request,
|
||||
Optional<String> serverURL) throws Exception {
|
||||
Optional<String> serverURL,
|
||||
Optional<Options> options) throws Exception {
|
||||
|
||||
if (options.isPresent()) {
|
||||
options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG));
|
||||
}
|
||||
String _baseUrl = Utils.templateUrl(GET_WATCH_LIST_SERVERS[0], new HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
@@ -103,50 +117,68 @@ public class Watchlist implements
|
||||
GetWatchListRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-watch-list",
|
||||
Optional.of(List.of()),
|
||||
sdkConfiguration.securitySource()),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
"get-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));
|
||||
HTTPRequest _finalReq = _req;
|
||||
RetryConfig _retryConfig;
|
||||
if (options.isPresent() && options.get().retryConfig().isPresent()) {
|
||||
_retryConfig = options.get().retryConfig().get();
|
||||
} else if (this.sdkConfiguration.retryConfig.isPresent()) {
|
||||
_retryConfig = this.sdkConfiguration.retryConfig.get();
|
||||
} else {
|
||||
_retryConfig = RetryConfig.builder()
|
||||
.backoff(BackoffStrategy.builder()
|
||||
.initialInterval(500, TimeUnit.MILLISECONDS)
|
||||
.maxInterval(60000, TimeUnit.MILLISECONDS)
|
||||
.baseFactor((double)(1.5))
|
||||
.maxElapsedTime(3600000, TimeUnit.MILLISECONDS)
|
||||
.retryConnectError(true)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
List<String> _statusCodes = new ArrayList<>();
|
||||
_statusCodes.add("5XX");
|
||||
Retries _retries = Retries.builder()
|
||||
.action(() -> {
|
||||
HttpRequest _r = null;
|
||||
try {
|
||||
_r = sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
"get-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
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* GetSearchAllLibrariesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
*/
|
||||
public class GetSearchAllLibrariesBadRequest extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends List<GetSearchAllLibrariesErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("RawResponse")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesBadRequest(
|
||||
@JsonProperty("errors") Optional<? extends List<GetSearchAllLibrariesErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesBadRequest() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Optional<List<GetSearchAllLibrariesErrors>> errors(){
|
||||
return (Optional<List<GetSearchAllLibrariesErrors>>) errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Optional<HttpResponse<InputStream>> rawResponse(){
|
||||
return (Optional<HttpResponse<InputStream>>) rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesBadRequest withErrors(List<GetSearchAllLibrariesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesBadRequest withErrors(Optional<? extends List<GetSearchAllLibrariesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSearchAllLibrariesBadRequest withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSearchAllLibrariesBadRequest withRawResponse(Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesBadRequest other = (GetSearchAllLibrariesBadRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.errors, other.errors) &&
|
||||
Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesBadRequest.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends List<GetSearchAllLibrariesErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(List<GetSearchAllLibrariesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends List<GetSearchAllLibrariesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesBadRequest build() {
|
||||
return new GetSearchAllLibrariesBadRequest(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.errors;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("code")
|
||||
private Optional<Integer> code;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("message")
|
||||
private Optional<String> message;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("status")
|
||||
private Optional<Integer> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesErrors(
|
||||
@JsonProperty("code") Optional<Integer> code,
|
||||
@JsonProperty("message") Optional<String> message,
|
||||
@JsonProperty("status") Optional<Integer> status) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
Utils.checkNotNull(message, "message");
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> code() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> status() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesErrors withCode(int code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesErrors withCode(Optional<Integer> code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesErrors withMessage(String message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = Optional.ofNullable(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesErrors withMessage(Optional<String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesErrors withStatus(int status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesErrors withStatus(Optional<Integer> status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesErrors other = (GetSearchAllLibrariesErrors) o;
|
||||
return
|
||||
Objects.deepEquals(this.code, other.code) &&
|
||||
Objects.deepEquals(this.message, other.message) &&
|
||||
Objects.deepEquals(this.status, other.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesErrors.class,
|
||||
"code", code,
|
||||
"message", message,
|
||||
"status", status);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<Integer> code = Optional.empty();
|
||||
|
||||
private Optional<String> message = Optional.empty();
|
||||
|
||||
private Optional<Integer> status = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder code(int code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder code(Optional<Integer> code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder message(String message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = Optional.ofNullable(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder message(Optional<String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(int status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(Optional<Integer> status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesErrors build() {
|
||||
return new GetSearchAllLibrariesErrors(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.errors;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesLibraryErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("code")
|
||||
private Optional<Integer> code;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("message")
|
||||
private Optional<String> message;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("status")
|
||||
private Optional<Integer> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesLibraryErrors(
|
||||
@JsonProperty("code") Optional<Integer> code,
|
||||
@JsonProperty("message") Optional<String> message,
|
||||
@JsonProperty("status") Optional<Integer> status) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
Utils.checkNotNull(message, "message");
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLibraryErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> code() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> status() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLibraryErrors withCode(int code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLibraryErrors withCode(Optional<Integer> code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLibraryErrors withMessage(String message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = Optional.ofNullable(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLibraryErrors withMessage(Optional<String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLibraryErrors withStatus(int status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLibraryErrors withStatus(Optional<Integer> status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesLibraryErrors other = (GetSearchAllLibrariesLibraryErrors) o;
|
||||
return
|
||||
Objects.deepEquals(this.code, other.code) &&
|
||||
Objects.deepEquals(this.message, other.message) &&
|
||||
Objects.deepEquals(this.status, other.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesLibraryErrors.class,
|
||||
"code", code,
|
||||
"message", message,
|
||||
"status", status);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<Integer> code = Optional.empty();
|
||||
|
||||
private Optional<String> message = Optional.empty();
|
||||
|
||||
private Optional<Integer> status = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder code(int code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder code(Optional<Integer> code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder message(String message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = Optional.ofNullable(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder message(Optional<String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(int status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(Optional<Integer> status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLibraryErrors build() {
|
||||
return new GetSearchAllLibrariesLibraryErrors(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* GetSearchAllLibrariesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetSearchAllLibrariesUnauthorized extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends List<GetSearchAllLibrariesLibraryErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("RawResponse")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesUnauthorized(
|
||||
@JsonProperty("errors") Optional<? extends List<GetSearchAllLibrariesLibraryErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUnauthorized() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Optional<List<GetSearchAllLibrariesLibraryErrors>> errors(){
|
||||
return (Optional<List<GetSearchAllLibrariesLibraryErrors>>) errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Optional<HttpResponse<InputStream>> rawResponse(){
|
||||
return (Optional<HttpResponse<InputStream>>) rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUnauthorized withErrors(List<GetSearchAllLibrariesLibraryErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUnauthorized withErrors(Optional<? extends List<GetSearchAllLibrariesLibraryErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSearchAllLibrariesUnauthorized withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSearchAllLibrariesUnauthorized withRawResponse(Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesUnauthorized other = (GetSearchAllLibrariesUnauthorized) o;
|
||||
return
|
||||
Objects.deepEquals(this.errors, other.errors) &&
|
||||
Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesUnauthorized.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends List<GetSearchAllLibrariesLibraryErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(List<GetSearchAllLibrariesLibraryErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends List<GetSearchAllLibrariesLibraryErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUnauthorized build() {
|
||||
return new GetSearchAllLibrariesUnauthorized(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.lang.String;
|
||||
@@ -14,6 +16,7 @@ public class AddPlaylistContentsRequestBuilder {
|
||||
private Double playlistID;
|
||||
private String uri;
|
||||
private Optional<Double> playQueueID = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallAddPlaylistContents sdk;
|
||||
|
||||
public AddPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallAddPlaylistContents sdk) {
|
||||
@@ -43,12 +46,27 @@ public class AddPlaylistContentsRequestBuilder {
|
||||
this.playQueueID = playQueueID;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.addPlaylistContents(
|
||||
playlistID,
|
||||
uri,
|
||||
playQueueID);
|
||||
playQueueID,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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;
|
||||
|
||||
@@ -11,6 +13,7 @@ public class ApplyUpdatesRequestBuilder {
|
||||
|
||||
private Optional<? extends Tonight> tonight = Optional.empty();
|
||||
private Optional<? extends Skip> skip = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallApplyUpdates sdk;
|
||||
|
||||
public ApplyUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallApplyUpdates sdk) {
|
||||
@@ -40,11 +43,26 @@ public class ApplyUpdatesRequestBuilder {
|
||||
this.skip = skip;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.applyUpdates(
|
||||
tonight,
|
||||
skip);
|
||||
skip,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@
|
||||
|
||||
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.lang.String;
|
||||
import java.util.Optional;
|
||||
|
||||
public class CancelServerActivitiesRequestBuilder {
|
||||
|
||||
private String activityUUID;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallCancelServerActivities sdk;
|
||||
|
||||
public CancelServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallCancelServerActivities sdk) {
|
||||
@@ -21,10 +25,25 @@ public class CancelServerActivitiesRequestBuilder {
|
||||
this.activityUUID = activityUUID;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.cancelServerActivities(
|
||||
activityUUID);
|
||||
activityUUID,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,15 @@
|
||||
|
||||
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 CheckForUpdatesRequestBuilder {
|
||||
|
||||
private Optional<? extends Download> download = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallCheckForUpdates sdk;
|
||||
|
||||
public CheckForUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallCheckForUpdates sdk) {
|
||||
@@ -27,10 +30,25 @@ public class CheckForUpdatesRequestBuilder {
|
||||
this.download = download;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.checkForUpdates(
|
||||
download);
|
||||
download,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.util.Optional;
|
||||
|
||||
public class ClearPlaylistContentsRequestBuilder {
|
||||
|
||||
private Double playlistID;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallClearPlaylistContents sdk;
|
||||
|
||||
public ClearPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallClearPlaylistContents sdk) {
|
||||
@@ -21,10 +25,25 @@ public class ClearPlaylistContentsRequestBuilder {
|
||||
this.playlistID = playlistID;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.clearPlaylistContents(
|
||||
playlistID);
|
||||
playlistID,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,15 @@
|
||||
|
||||
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 CreatePlaylistRequestBuilder {
|
||||
|
||||
private CreatePlaylistRequest request;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallCreatePlaylist sdk;
|
||||
|
||||
public CreatePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallCreatePlaylist sdk) {
|
||||
@@ -20,10 +24,25 @@ public class CreatePlaylistRequestBuilder {
|
||||
this.request = request;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.createPlaylist(
|
||||
request);
|
||||
request,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@
|
||||
|
||||
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.lang.Integer;
|
||||
import java.util.Optional;
|
||||
|
||||
public class DeleteLibraryRequestBuilder {
|
||||
|
||||
private Integer sectionKey;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallDeleteLibrary sdk;
|
||||
|
||||
public DeleteLibraryRequestBuilder(SDKMethodInterfaces.MethodCallDeleteLibrary sdk) {
|
||||
@@ -21,10 +25,25 @@ public class DeleteLibraryRequestBuilder {
|
||||
this.sectionKey = sectionKey;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.deleteLibrary(
|
||||
sectionKey);
|
||||
sectionKey,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.util.Optional;
|
||||
|
||||
public class DeletePlaylistRequestBuilder {
|
||||
|
||||
private Double playlistID;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallDeletePlaylist sdk;
|
||||
|
||||
public DeletePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallDeletePlaylist sdk) {
|
||||
@@ -21,10 +25,25 @@ public class DeletePlaylistRequestBuilder {
|
||||
this.playlistID = playlistID;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.deletePlaylist(
|
||||
playlistID);
|
||||
playlistID,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,37 @@
|
||||
|
||||
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 {
|
||||
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallEnablePaperTrail sdk;
|
||||
|
||||
public EnablePaperTrailRequestBuilder(SDKMethodInterfaces.MethodCallEnablePaperTrail 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 {
|
||||
|
||||
return sdk.enablePaperTrailDirect();
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.enablePaperTrail(
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.lang.String;
|
||||
|
||||
public enum Features {
|
||||
ANDROID_DOLBY_VISION("Android - Dolby Vision"),
|
||||
ANDROID_PI_P("Android - PiP"),
|
||||
CU_SUNSET("CU Sunset"),
|
||||
HRK_ENABLE_EUR("HRK_enable_EUR"),
|
||||
TREBLE_SHOW_FEATURES("TREBLE-show-features"),
|
||||
AD_COUNTDOWN_TIMER("ad-countdown-timer"),
|
||||
ADAPTIVE_BITRATE("adaptive_bitrate"),
|
||||
ALBUM_TYPES("album-types"),
|
||||
ALLOW_DVR("allow_dvr"),
|
||||
AMAZON_LOOP_DEBUG("amazon-loop-debug"),
|
||||
AVOD_AD_ANALYSIS("avod-ad-analysis"),
|
||||
AVOD_NEW_MEDIA("avod-new-media"),
|
||||
BLACKLIST_GET_SIGNIN("blacklist_get_signin"),
|
||||
BOOST_VOICES("boost-voices"),
|
||||
CAMERA_UPLOAD("camera_upload"),
|
||||
CLIENT_RADIO_STATIONS("client-radio-stations"),
|
||||
CLOUDFLARE_TURNSTILE_REQUIRED("cloudflare-turnstile-required"),
|
||||
CLOUDSYNC("cloudsync"),
|
||||
COLLECTIONS("collections"),
|
||||
COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS("comments_and_replies_push_notifications"),
|
||||
COMMUNITY_ACCESS_PLEX_TV("community_access_plex_tv"),
|
||||
COMPANIONS_SONOS("companions_sonos"),
|
||||
CONTENT_FILTER("content_filter"),
|
||||
CUSTOM_HOME_REMOVAL("custom-home-removal"),
|
||||
DISABLE_HOME_USER_FRIENDSHIPS("disable_home_user_friendships"),
|
||||
DISABLE_SHARING_FRIENDSHIPS("disable_sharing_friendships"),
|
||||
DOWNLOADS_GATING("downloads-gating"),
|
||||
DRM_SUPPORT("drm_support"),
|
||||
DVR("dvr"),
|
||||
DVR_BLOCK_UNSUPPORTED_COUNTRIES("dvr-block-unsupported-countries"),
|
||||
EPG_RECENT_CHANNELS("epg-recent-channels"),
|
||||
EXCLUDE_RESTRICTIONS("exclude restrictions"),
|
||||
FEDERATED_AUTH("federated-auth"),
|
||||
FRIEND_REQUEST_PUSH_NOTIFICATIONS("friend_request_push_notifications"),
|
||||
GRANDFATHER_SYNC("grandfather-sync"),
|
||||
GUIDED_UPGRADE("guided-upgrade"),
|
||||
HARDWARE_TRANSCODING("hardware_transcoding"),
|
||||
HOME("home"),
|
||||
HWTRANSCODE("hwtranscode"),
|
||||
IMAGGA_V2("imagga-v2"),
|
||||
INCREASE_PASSWORD_COMPLEXITY("increase-password-complexity"),
|
||||
IOS14_PRIVACY_BANNER("ios14-privacy-banner"),
|
||||
ITERABLE_NOTIFICATION_TOKENS("iterable-notification-tokens"),
|
||||
ITEM_CLUSTERS("item_clusters"),
|
||||
KEEP_PAYMENT_METHOD("keep-payment-method"),
|
||||
KEVIN_BACON("kevin-bacon"),
|
||||
KOREA_CONSENT("korea-consent"),
|
||||
LE_ISRG_ROOT_X1("le_isrg_root_x1"),
|
||||
LETS_ENCRYPT("lets_encrypt"),
|
||||
LIGHTNING_DVR_PIVOT("lightning-dvr-pivot"),
|
||||
LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS("live-tv-support-incomplete-segments"),
|
||||
LIVETV("livetv"),
|
||||
LYRICS("lyrics"),
|
||||
METADATA_SEARCH("metadata_search"),
|
||||
MUSIC_ANALYSIS("music-analysis"),
|
||||
MUSIC_VIDEOS("music_videos"),
|
||||
NEW_PLEX_PASS_PRICES("new_plex_pass_prices"),
|
||||
NEWS_PROVIDER_SUNSET_MODAL("news-provider-sunset-modal"),
|
||||
NOMINATIM("nominatim"),
|
||||
PASS("pass"),
|
||||
PHOTOS_FAVORITES("photos-favorites"),
|
||||
PHOTOS_METADATA_EDITION("photos-metadata-edition"),
|
||||
PHOTOS_V6_EDIT("photosV6-edit"),
|
||||
PHOTOS_V6_TV_ALBUMS("photosV6-tv-albums"),
|
||||
PMS_HEALTH("pms_health"),
|
||||
PREMIUM_DASHBOARD("premium-dashboard"),
|
||||
PREMIUM_MUSIC_METADATA("premium_music_metadata"),
|
||||
RADIO("radio"),
|
||||
RATE_LIMIT_CLIENT_TOKEN("rate-limit-client-token"),
|
||||
SCROBBLING_SERVICE_PLEX_TV("scrobbling-service-plex-tv"),
|
||||
SESSION_BANDWIDTH_RESTRICTIONS("session_bandwidth_restrictions"),
|
||||
SESSION_KICK("session_kick"),
|
||||
SHARED_SERVER_NOTIFICATION("shared_server_notification"),
|
||||
SHARED_SOURCE_NOTIFICATION("shared_source_notification"),
|
||||
SIGNIN_NOTIFICATION("signin_notification"),
|
||||
SIGNIN_WITH_APPLE("signin_with_apple"),
|
||||
SILENCE_REMOVAL("silence-removal"),
|
||||
SLEEP_TIMER("sleep-timer"),
|
||||
SPRING_SERVE_AD_PROVIDER("spring_serve_ad_provider"),
|
||||
SYNC("sync"),
|
||||
SWEET_FADES("sweet-fades"),
|
||||
TRANSCODER_CACHE("transcoder_cache"),
|
||||
TRAILERS("trailers"),
|
||||
TUNER_SHARING("tuner-sharing"),
|
||||
TWO_FACTOR_AUTHENTICATION("two-factor-authentication"),
|
||||
UNSUPPORTEDTUNERS("unsupportedtuners"),
|
||||
UPGRADE3DS2("upgrade-3ds2"),
|
||||
VISUALIZERS("visualizers"),
|
||||
VOD_SCHEMA("vod-schema"),
|
||||
VOD_CLOUDFLARE("vod_cloudflare"),
|
||||
VOLUME_LEVELING("volume-leveling"),
|
||||
WATCH_TOGETHER_INVITE("watch-together-invite"),
|
||||
WATCHLIST_RSS("watchlist-rss"),
|
||||
WEB_SERVER_DASHBOARD("web_server_dashboard"),
|
||||
WEBHOOKS("webhooks");
|
||||
|
||||
@JsonValue
|
||||
private final String value;
|
||||
|
||||
private Features(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class GetAllLibrariesDirectory {
|
||||
private int hidden;
|
||||
|
||||
@JsonProperty("Location")
|
||||
private List<Location> location;
|
||||
private List<GetAllLibrariesLocation> location;
|
||||
|
||||
@JsonCreator
|
||||
public GetAllLibrariesDirectory(
|
||||
@@ -117,7 +117,7 @@ public class GetAllLibrariesDirectory {
|
||||
@JsonProperty("directory") boolean directory,
|
||||
@JsonProperty("contentChangedAt") long contentChangedAt,
|
||||
@JsonProperty("hidden") int hidden,
|
||||
@JsonProperty("Location") List<Location> location) {
|
||||
@JsonProperty("Location") List<GetAllLibrariesLocation> location) {
|
||||
Utils.checkNotNull(allowSync, "allowSync");
|
||||
Utils.checkNotNull(art, "art");
|
||||
Utils.checkNotNull(composite, "composite");
|
||||
@@ -275,7 +275,7 @@ public class GetAllLibrariesDirectory {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<Location> location() {
|
||||
public List<GetAllLibrariesLocation> location() {
|
||||
return location;
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ public class GetAllLibrariesDirectory {
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesDirectory withLocation(List<Location> location) {
|
||||
public GetAllLibrariesDirectory withLocation(List<GetAllLibrariesLocation> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = location;
|
||||
return this;
|
||||
@@ -548,7 +548,7 @@ public class GetAllLibrariesDirectory {
|
||||
|
||||
private Integer hidden;
|
||||
|
||||
private List<Location> location;
|
||||
private List<GetAllLibrariesLocation> location;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
@@ -686,7 +686,7 @@ public class GetAllLibrariesDirectory {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder location(List<Location> location) {
|
||||
public Builder location(List<GetAllLibrariesLocation> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = location;
|
||||
return this;
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class GetAllLibrariesLocation {
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
@JsonProperty("path")
|
||||
private String path;
|
||||
|
||||
@JsonCreator
|
||||
public GetAllLibrariesLocation(
|
||||
@JsonProperty("id") int id,
|
||||
@JsonProperty("path") String path) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.id = id;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String path() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetAllLibrariesLocation withId(int id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesLocation withPath(String path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetAllLibrariesLocation other = (GetAllLibrariesLocation) o;
|
||||
return
|
||||
Objects.deepEquals(this.id, other.id) &&
|
||||
Objects.deepEquals(this.path, other.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetAllLibrariesLocation.class,
|
||||
"id", id,
|
||||
"path", path);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String path;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder id(int id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder path(String path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesLocation build() {
|
||||
return new GetAllLibrariesLocation(
|
||||
id,
|
||||
path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,37 @@
|
||||
|
||||
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 {
|
||||
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetAllLibraries sdk;
|
||||
|
||||
public GetAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetAllLibraries 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 {
|
||||
|
||||
return sdk.getAllLibrariesDirect();
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getAllLibraries(
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,37 @@
|
||||
|
||||
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 {
|
||||
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetAvailableClients sdk;
|
||||
|
||||
public GetAvailableClientsRequestBuilder(SDKMethodInterfaces.MethodCallGetAvailableClients 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 {
|
||||
|
||||
return sdk.getAvailableClientsDirect();
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getAvailableClients(
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.Long;
|
||||
import java.util.Optional;
|
||||
@@ -11,6 +13,7 @@ import java.util.Optional;
|
||||
public class GetBandwidthStatisticsRequestBuilder {
|
||||
|
||||
private Optional<Long> timespan = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk;
|
||||
|
||||
public GetBandwidthStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk) {
|
||||
@@ -28,10 +31,25 @@ public class GetBandwidthStatisticsRequestBuilder {
|
||||
this.timespan = timespan;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getBandwidthStatistics(
|
||||
timespan);
|
||||
timespan,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ public class GetBannerImageRequest {
|
||||
private long upscale;
|
||||
|
||||
/**
|
||||
* Plex Authentication Token
|
||||
* An authentication token, obtained from plex.tv
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")
|
||||
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")
|
||||
private String xPlexToken;
|
||||
|
||||
@JsonCreator
|
||||
@@ -92,7 +92,7 @@ public class GetBannerImageRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Plex Authentication Token
|
||||
* An authentication token, obtained from plex.tv
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String xPlexToken() {
|
||||
@@ -137,7 +137,7 @@ public class GetBannerImageRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Plex Authentication Token
|
||||
* An authentication token, obtained from plex.tv
|
||||
*/
|
||||
public GetBannerImageRequest withXPlexToken(String xPlexToken) {
|
||||
Utils.checkNotNull(xPlexToken, "xPlexToken");
|
||||
@@ -237,7 +237,7 @@ public class GetBannerImageRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Plex Authentication Token
|
||||
* An authentication token, obtained from plex.tv
|
||||
*/
|
||||
public Builder xPlexToken(String xPlexToken) {
|
||||
Utils.checkNotNull(xPlexToken, "xPlexToken");
|
||||
|
||||
@@ -4,11 +4,15 @@
|
||||
|
||||
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 GetBannerImageRequestBuilder {
|
||||
|
||||
private GetBannerImageRequest request;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetBannerImage sdk;
|
||||
|
||||
public GetBannerImageRequestBuilder(SDKMethodInterfaces.MethodCallGetBannerImage sdk) {
|
||||
@@ -20,10 +24,25 @@ public class GetBannerImageRequestBuilder {
|
||||
this.request = request;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getBannerImage(
|
||||
request);
|
||||
request,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,37 @@
|
||||
|
||||
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 {
|
||||
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetButlerTasks sdk;
|
||||
|
||||
public GetButlerTasksRequestBuilder(SDKMethodInterfaces.MethodCallGetButlerTasks 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 {
|
||||
|
||||
return sdk.getButlerTasksDirect();
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getButlerTasks(
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.String;
|
||||
import java.util.Optional;
|
||||
@@ -11,6 +13,7 @@ import java.util.Optional;
|
||||
public class GetCompanionsDataRequestBuilder {
|
||||
|
||||
private Optional<String> serverURL = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetCompanionsData sdk;
|
||||
|
||||
public GetCompanionsDataRequestBuilder(SDKMethodInterfaces.MethodCallGetCompanionsData sdk) {
|
||||
@@ -28,10 +31,25 @@ public class GetCompanionsDataRequestBuilder {
|
||||
this.serverURL = serverURL;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getCompanionsData(
|
||||
serverURL);
|
||||
serverURL,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,37 @@
|
||||
|
||||
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 {
|
||||
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetDevices sdk;
|
||||
|
||||
public GetDevicesRequestBuilder(SDKMethodInterfaces.MethodCallGetDevices 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 {
|
||||
|
||||
return sdk.getDevicesDirect();
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getDevices(
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.lang.String;
|
||||
@@ -13,6 +15,7 @@ public class GetFileHashRequestBuilder {
|
||||
|
||||
private String url;
|
||||
private Optional<Double> type = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetFileHash sdk;
|
||||
|
||||
public GetFileHashRequestBuilder(SDKMethodInterfaces.MethodCallGetFileHash sdk) {
|
||||
@@ -36,11 +39,26 @@ public class GetFileHashRequestBuilder {
|
||||
this.type = type;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getFileHash(
|
||||
url,
|
||||
type);
|
||||
type,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.String;
|
||||
import java.util.Optional;
|
||||
@@ -11,6 +13,7 @@ import java.util.Optional;
|
||||
public class GetGeoDataRequestBuilder {
|
||||
|
||||
private Optional<String> serverURL = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetGeoData sdk;
|
||||
|
||||
public GetGeoDataRequestBuilder(SDKMethodInterfaces.MethodCallGetGeoData sdk) {
|
||||
@@ -28,10 +31,25 @@ public class GetGeoDataRequestBuilder {
|
||||
this.serverURL = serverURL;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getGeoData(
|
||||
serverURL);
|
||||
serverURL,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.util.Optional;
|
||||
@@ -12,6 +14,7 @@ public class GetGlobalHubsRequestBuilder {
|
||||
|
||||
private Optional<Double> count = Optional.empty();
|
||||
private Optional<? extends OnlyTransient> onlyTransient = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetGlobalHubs sdk;
|
||||
|
||||
public GetGlobalHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetGlobalHubs sdk) {
|
||||
@@ -41,11 +44,26 @@ public class GetGlobalHubsRequestBuilder {
|
||||
this.onlyTransient = onlyTransient;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getGlobalHubs(
|
||||
count,
|
||||
onlyTransient);
|
||||
onlyTransient,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,37 @@
|
||||
|
||||
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 {
|
||||
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetHomeData sdk;
|
||||
|
||||
public GetHomeDataRequestBuilder(SDKMethodInterfaces.MethodCallGetHomeData 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 {
|
||||
|
||||
return sdk.getHomeDataDirect();
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getHomeData(
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,6 @@ import java.util.Optional;
|
||||
|
||||
public class GetLibraryDetailsRequest {
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")
|
||||
private int sectionKey;
|
||||
|
||||
/**
|
||||
* Whether or not to include details for a section (types, filters, and sorts).
|
||||
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
|
||||
@@ -37,29 +29,27 @@ public class GetLibraryDetailsRequest {
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDetails")
|
||||
private Optional<? extends IncludeDetails> includeDetails;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryDetailsRequest(
|
||||
int sectionKey,
|
||||
Optional<? extends IncludeDetails> includeDetails) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
Utils.checkNotNull(includeDetails, "includeDetails");
|
||||
this.sectionKey = sectionKey;
|
||||
this.includeDetails = includeDetails;
|
||||
}
|
||||
|
||||
public GetLibraryDetailsRequest(
|
||||
int sectionKey) {
|
||||
this(sectionKey, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int sectionKey() {
|
||||
return sectionKey;
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")
|
||||
private int sectionKey;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryDetailsRequest(
|
||||
Optional<? extends IncludeDetails> includeDetails,
|
||||
int sectionKey) {
|
||||
Utils.checkNotNull(includeDetails, "includeDetails");
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.includeDetails = includeDetails;
|
||||
this.sectionKey = sectionKey;
|
||||
}
|
||||
|
||||
public GetLibraryDetailsRequest(
|
||||
int sectionKey) {
|
||||
this(Optional.empty(), sectionKey);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,19 +63,18 @@ public class GetLibraryDetailsRequest {
|
||||
return (Optional<IncludeDetails>) includeDetails;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public GetLibraryDetailsRequest withSectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
@JsonIgnore
|
||||
public int sectionKey() {
|
||||
return sectionKey;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,6 +98,17 @@ public class GetLibraryDetailsRequest {
|
||||
this.includeDetails = includeDetails;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public GetLibraryDetailsRequest withSectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
@@ -120,45 +120,34 @@ public class GetLibraryDetailsRequest {
|
||||
}
|
||||
GetLibraryDetailsRequest other = (GetLibraryDetailsRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.sectionKey, other.sectionKey) &&
|
||||
Objects.deepEquals(this.includeDetails, other.includeDetails);
|
||||
Objects.deepEquals(this.includeDetails, other.includeDetails) &&
|
||||
Objects.deepEquals(this.sectionKey, other.sectionKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
sectionKey,
|
||||
includeDetails);
|
||||
includeDetails,
|
||||
sectionKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetLibraryDetailsRequest.class,
|
||||
"sectionKey", sectionKey,
|
||||
"includeDetails", includeDetails);
|
||||
"includeDetails", includeDetails,
|
||||
"sectionKey", sectionKey);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Integer sectionKey;
|
||||
private Optional<? extends IncludeDetails> includeDetails;
|
||||
|
||||
private Optional<? extends IncludeDetails> includeDetails;
|
||||
private Integer sectionKey;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public Builder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not to include details for a section (types, filters, and sorts).
|
||||
* Only exists for backwards compatibility, media providers other than the server libraries have it on always.
|
||||
@@ -180,13 +169,24 @@ public class GetLibraryDetailsRequest {
|
||||
this.includeDetails = includeDetails;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public Builder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryDetailsRequest build() {
|
||||
if (includeDetails == null) {
|
||||
includeDetails = _SINGLETON_VALUE_IncludeDetails.value();
|
||||
} return new GetLibraryDetailsRequest(
|
||||
sectionKey,
|
||||
includeDetails);
|
||||
includeDetails,
|
||||
sectionKey);
|
||||
}
|
||||
|
||||
private static final LazySingletonValue<Optional<? extends IncludeDetails>> _SINGLETON_VALUE_IncludeDetails =
|
||||
|
||||
@@ -6,28 +6,25 @@ package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
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 java.lang.Integer;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetLibraryDetailsRequestBuilder {
|
||||
|
||||
private Integer sectionKey;
|
||||
private Optional<? extends IncludeDetails> includeDetails = Utils.readDefaultOrConstValue(
|
||||
"includeDetails",
|
||||
"0",
|
||||
new TypeReference<Optional<? extends IncludeDetails>>() {});
|
||||
private Integer sectionKey;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetLibraryDetails sdk;
|
||||
|
||||
public GetLibraryDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryDetails sdk) {
|
||||
this.sdk = sdk;
|
||||
}
|
||||
|
||||
public GetLibraryDetailsRequestBuilder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryDetailsRequestBuilder includeDetails(IncludeDetails includeDetails) {
|
||||
Utils.checkNotNull(includeDetails, "includeDetails");
|
||||
@@ -41,13 +38,34 @@ public class GetLibraryDetailsRequestBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryDetailsRequestBuilder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
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 {
|
||||
if (includeDetails == null) {
|
||||
includeDetails = _SINGLETON_VALUE_IncludeDetails.value();
|
||||
}
|
||||
} Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getLibraryDetails(
|
||||
includeDetails,
|
||||
sectionKey,
|
||||
includeDetails);
|
||||
options);
|
||||
}
|
||||
|
||||
private static final LazySingletonValue<Optional<? extends IncludeDetails>> _SINGLETON_VALUE_IncludeDetails =
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.util.Optional;
|
||||
@@ -13,6 +15,7 @@ public class GetLibraryHubsRequestBuilder {
|
||||
private Double sectionId;
|
||||
private Optional<Double> count = Optional.empty();
|
||||
private Optional<? extends QueryParamOnlyTransient> onlyTransient = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetLibraryHubs sdk;
|
||||
|
||||
public GetLibraryHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryHubs sdk) {
|
||||
@@ -48,12 +51,27 @@ public class GetLibraryHubsRequestBuilder {
|
||||
this.onlyTransient = onlyTransient;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getLibraryHubs(
|
||||
sectionId,
|
||||
count,
|
||||
onlyTransient);
|
||||
onlyTransient,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetLibraryItemsLocation {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("path")
|
||||
private Optional<String> path;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryItemsLocation(
|
||||
@JsonProperty("path") Optional<String> path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public GetLibraryItemsLocation() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> path() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetLibraryItemsLocation withPath(String path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = Optional.ofNullable(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsLocation withPath(Optional<String> path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetLibraryItemsLocation other = (GetLibraryItemsLocation) o;
|
||||
return
|
||||
Objects.deepEquals(this.path, other.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetLibraryItemsLocation.class,
|
||||
"path", path);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<String> path = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder path(String path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = Optional.ofNullable(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder path(Optional<String> path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsLocation build() {
|
||||
return new GetLibraryItemsLocation(
|
||||
path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,45 +29,56 @@ public class GetLibraryItemsMedia {
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("duration")
|
||||
private int duration;
|
||||
private Optional<Integer> duration;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("bitrate")
|
||||
private int bitrate;
|
||||
private Optional<Integer> bitrate;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("width")
|
||||
private int width;
|
||||
private Optional<Integer> width;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("height")
|
||||
private int height;
|
||||
private Optional<Integer> height;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("aspectRatio")
|
||||
private double aspectRatio;
|
||||
private Optional<Double> aspectRatio;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("audioProfile")
|
||||
private Optional<String> audioProfile;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("audioChannels")
|
||||
private int audioChannels;
|
||||
private Optional<Integer> audioChannels;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("audioCodec")
|
||||
private String audioCodec;
|
||||
private Optional<String> audioCodec;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoCodec")
|
||||
private String videoCodec;
|
||||
private Optional<String> videoCodec;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoResolution")
|
||||
private String videoResolution;
|
||||
private Optional<String> videoResolution;
|
||||
|
||||
@JsonProperty("container")
|
||||
private String container;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoFrameRate")
|
||||
private String videoFrameRate;
|
||||
private Optional<String> videoFrameRate;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoProfile")
|
||||
private String videoProfile;
|
||||
private Optional<String> videoProfile;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("hasVoiceActivity")
|
||||
@@ -87,19 +98,19 @@ public class GetLibraryItemsMedia {
|
||||
@JsonCreator
|
||||
public GetLibraryItemsMedia(
|
||||
@JsonProperty("id") int id,
|
||||
@JsonProperty("duration") int duration,
|
||||
@JsonProperty("bitrate") int bitrate,
|
||||
@JsonProperty("width") int width,
|
||||
@JsonProperty("height") int height,
|
||||
@JsonProperty("aspectRatio") double aspectRatio,
|
||||
@JsonProperty("duration") Optional<Integer> duration,
|
||||
@JsonProperty("bitrate") Optional<Integer> bitrate,
|
||||
@JsonProperty("width") Optional<Integer> width,
|
||||
@JsonProperty("height") Optional<Integer> height,
|
||||
@JsonProperty("aspectRatio") Optional<Double> aspectRatio,
|
||||
@JsonProperty("audioProfile") Optional<String> audioProfile,
|
||||
@JsonProperty("audioChannels") int audioChannels,
|
||||
@JsonProperty("audioCodec") String audioCodec,
|
||||
@JsonProperty("videoCodec") String videoCodec,
|
||||
@JsonProperty("videoResolution") String videoResolution,
|
||||
@JsonProperty("audioChannels") Optional<Integer> audioChannels,
|
||||
@JsonProperty("audioCodec") Optional<String> audioCodec,
|
||||
@JsonProperty("videoCodec") Optional<String> videoCodec,
|
||||
@JsonProperty("videoResolution") Optional<String> videoResolution,
|
||||
@JsonProperty("container") String container,
|
||||
@JsonProperty("videoFrameRate") String videoFrameRate,
|
||||
@JsonProperty("videoProfile") String videoProfile,
|
||||
@JsonProperty("videoFrameRate") Optional<String> videoFrameRate,
|
||||
@JsonProperty("videoProfile") Optional<String> videoProfile,
|
||||
@JsonProperty("hasVoiceActivity") Optional<Boolean> hasVoiceActivity,
|
||||
@JsonProperty("optimizedForStreaming") Optional<? extends GetLibraryItemsOptimizedForStreaming> optimizedForStreaming,
|
||||
@JsonProperty("has64bitOffsets") Optional<Boolean> has64bitOffsets,
|
||||
@@ -144,20 +155,9 @@ public class GetLibraryItemsMedia {
|
||||
|
||||
public GetLibraryItemsMedia(
|
||||
int id,
|
||||
int duration,
|
||||
int bitrate,
|
||||
int width,
|
||||
int height,
|
||||
double aspectRatio,
|
||||
int audioChannels,
|
||||
String audioCodec,
|
||||
String videoCodec,
|
||||
String videoResolution,
|
||||
String container,
|
||||
String videoFrameRate,
|
||||
String videoProfile,
|
||||
List<GetLibraryItemsPart> part) {
|
||||
this(id, duration, bitrate, width, height, aspectRatio, Optional.empty(), audioChannels, audioCodec, videoCodec, videoResolution, container, videoFrameRate, videoProfile, Optional.empty(), Optional.empty(), Optional.empty(), part);
|
||||
this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), part);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@@ -166,27 +166,27 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int duration() {
|
||||
public Optional<Integer> duration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int bitrate() {
|
||||
public Optional<Integer> bitrate() {
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int width() {
|
||||
public Optional<Integer> width() {
|
||||
return width;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int height() {
|
||||
public Optional<Integer> height() {
|
||||
return height;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public double aspectRatio() {
|
||||
public Optional<Double> aspectRatio() {
|
||||
return aspectRatio;
|
||||
}
|
||||
|
||||
@@ -196,22 +196,22 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int audioChannels() {
|
||||
public Optional<Integer> audioChannels() {
|
||||
return audioChannels;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String audioCodec() {
|
||||
public Optional<String> audioCodec() {
|
||||
return audioCodec;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String videoCodec() {
|
||||
public Optional<String> videoCodec() {
|
||||
return videoCodec;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String videoResolution() {
|
||||
public Optional<String> videoResolution() {
|
||||
return videoResolution;
|
||||
}
|
||||
|
||||
@@ -221,12 +221,12 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String videoFrameRate() {
|
||||
public Optional<String> videoFrameRate() {
|
||||
return videoFrameRate;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String videoProfile() {
|
||||
public Optional<String> videoProfile() {
|
||||
return videoProfile;
|
||||
}
|
||||
|
||||
@@ -262,30 +262,60 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withDuration(int duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = Optional.ofNullable(duration);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withDuration(Optional<Integer> duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = duration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withBitrate(int bitrate) {
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
this.bitrate = Optional.ofNullable(bitrate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withBitrate(Optional<Integer> bitrate) {
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
this.bitrate = bitrate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withWidth(int width) {
|
||||
Utils.checkNotNull(width, "width");
|
||||
this.width = Optional.ofNullable(width);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withWidth(Optional<Integer> width) {
|
||||
Utils.checkNotNull(width, "width");
|
||||
this.width = width;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withHeight(int height) {
|
||||
Utils.checkNotNull(height, "height");
|
||||
this.height = Optional.ofNullable(height);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withHeight(Optional<Integer> height) {
|
||||
Utils.checkNotNull(height, "height");
|
||||
this.height = height;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withAspectRatio(double aspectRatio) {
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
this.aspectRatio = Optional.ofNullable(aspectRatio);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withAspectRatio(Optional<Double> aspectRatio) {
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
this.aspectRatio = aspectRatio;
|
||||
return this;
|
||||
@@ -304,24 +334,48 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withAudioChannels(int audioChannels) {
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
this.audioChannels = Optional.ofNullable(audioChannels);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withAudioChannels(Optional<Integer> audioChannels) {
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
this.audioChannels = audioChannels;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withAudioCodec(String audioCodec) {
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
this.audioCodec = Optional.ofNullable(audioCodec);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withAudioCodec(Optional<String> audioCodec) {
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
this.audioCodec = audioCodec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withVideoCodec(String videoCodec) {
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
this.videoCodec = Optional.ofNullable(videoCodec);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withVideoCodec(Optional<String> videoCodec) {
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
this.videoCodec = videoCodec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withVideoResolution(String videoResolution) {
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
this.videoResolution = Optional.ofNullable(videoResolution);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withVideoResolution(Optional<String> videoResolution) {
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
this.videoResolution = videoResolution;
|
||||
return this;
|
||||
@@ -334,12 +388,24 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withVideoFrameRate(String videoFrameRate) {
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
this.videoFrameRate = Optional.ofNullable(videoFrameRate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withVideoFrameRate(Optional<String> videoFrameRate) {
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
this.videoFrameRate = videoFrameRate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withVideoProfile(String videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = Optional.ofNullable(videoProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMedia withVideoProfile(Optional<String> videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = videoProfile;
|
||||
return this;
|
||||
@@ -467,31 +533,31 @@ public class GetLibraryItemsMedia {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer duration;
|
||||
private Optional<Integer> duration = Optional.empty();
|
||||
|
||||
private Integer bitrate;
|
||||
private Optional<Integer> bitrate = Optional.empty();
|
||||
|
||||
private Integer width;
|
||||
private Optional<Integer> width = Optional.empty();
|
||||
|
||||
private Integer height;
|
||||
private Optional<Integer> height = Optional.empty();
|
||||
|
||||
private Double aspectRatio;
|
||||
private Optional<Double> aspectRatio = Optional.empty();
|
||||
|
||||
private Optional<String> audioProfile = Optional.empty();
|
||||
|
||||
private Integer audioChannels;
|
||||
private Optional<Integer> audioChannels = Optional.empty();
|
||||
|
||||
private String audioCodec;
|
||||
private Optional<String> audioCodec = Optional.empty();
|
||||
|
||||
private String videoCodec;
|
||||
private Optional<String> videoCodec = Optional.empty();
|
||||
|
||||
private String videoResolution;
|
||||
private Optional<String> videoResolution = Optional.empty();
|
||||
|
||||
private String container;
|
||||
|
||||
private String videoFrameRate;
|
||||
private Optional<String> videoFrameRate = Optional.empty();
|
||||
|
||||
private String videoProfile;
|
||||
private Optional<String> videoProfile = Optional.empty();
|
||||
|
||||
private Optional<Boolean> hasVoiceActivity = Optional.empty();
|
||||
|
||||
@@ -512,30 +578,60 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
public Builder duration(int duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = Optional.ofNullable(duration);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder duration(Optional<Integer> duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = duration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder bitrate(int bitrate) {
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
this.bitrate = Optional.ofNullable(bitrate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder bitrate(Optional<Integer> bitrate) {
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
this.bitrate = bitrate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder width(int width) {
|
||||
Utils.checkNotNull(width, "width");
|
||||
this.width = Optional.ofNullable(width);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder width(Optional<Integer> width) {
|
||||
Utils.checkNotNull(width, "width");
|
||||
this.width = width;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder height(int height) {
|
||||
Utils.checkNotNull(height, "height");
|
||||
this.height = Optional.ofNullable(height);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder height(Optional<Integer> height) {
|
||||
Utils.checkNotNull(height, "height");
|
||||
this.height = height;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder aspectRatio(double aspectRatio) {
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
this.aspectRatio = Optional.ofNullable(aspectRatio);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder aspectRatio(Optional<Double> aspectRatio) {
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
this.aspectRatio = aspectRatio;
|
||||
return this;
|
||||
@@ -554,24 +650,48 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
public Builder audioChannels(int audioChannels) {
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
this.audioChannels = Optional.ofNullable(audioChannels);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioChannels(Optional<Integer> audioChannels) {
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
this.audioChannels = audioChannels;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioCodec(String audioCodec) {
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
this.audioCodec = Optional.ofNullable(audioCodec);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioCodec(Optional<String> audioCodec) {
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
this.audioCodec = audioCodec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoCodec(String videoCodec) {
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
this.videoCodec = Optional.ofNullable(videoCodec);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoCodec(Optional<String> videoCodec) {
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
this.videoCodec = videoCodec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoResolution(String videoResolution) {
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
this.videoResolution = Optional.ofNullable(videoResolution);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoResolution(Optional<String> videoResolution) {
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
this.videoResolution = videoResolution;
|
||||
return this;
|
||||
@@ -584,12 +704,24 @@ public class GetLibraryItemsMedia {
|
||||
}
|
||||
|
||||
public Builder videoFrameRate(String videoFrameRate) {
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
this.videoFrameRate = Optional.ofNullable(videoFrameRate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoFrameRate(Optional<String> videoFrameRate) {
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
this.videoFrameRate = videoFrameRate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoProfile(String videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = Optional.ofNullable(videoProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoProfile(Optional<String> videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = videoProfile;
|
||||
return this;
|
||||
|
||||
@@ -237,6 +237,10 @@ public class GetLibraryItemsMetadata {
|
||||
@JsonProperty("Role")
|
||||
private Optional<? extends List<GetLibraryItemsRole>> role;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("Location")
|
||||
private Optional<? extends List<GetLibraryItemsLocation>> location;
|
||||
|
||||
/**
|
||||
* The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
|
||||
*
|
||||
@@ -398,6 +402,7 @@ public class GetLibraryItemsMetadata {
|
||||
@JsonProperty("Writer") Optional<? extends List<GetLibraryItemsWriter>> writer,
|
||||
@JsonProperty("Collection") Optional<? extends List<GetLibraryItemsCollection>> collection,
|
||||
@JsonProperty("Role") Optional<? extends List<GetLibraryItemsRole>> role,
|
||||
@JsonProperty("Location") Optional<? extends List<GetLibraryItemsLocation>> location,
|
||||
@JsonProperty("Guid") Optional<? extends List<GetLibraryItemsMediaGuid>> mediaGuid,
|
||||
@JsonProperty("UltraBlurColors") Optional<? extends GetLibraryItemsUltraBlurColors> ultraBlurColors,
|
||||
@JsonProperty("Rating") Optional<? extends List<GetLibraryItemsMetaDataRating>> metaDataRating,
|
||||
@@ -471,6 +476,7 @@ public class GetLibraryItemsMetadata {
|
||||
Utils.checkNotNull(writer, "writer");
|
||||
Utils.checkNotNull(collection, "collection");
|
||||
Utils.checkNotNull(role, "role");
|
||||
Utils.checkNotNull(location, "location");
|
||||
Utils.checkNotNull(mediaGuid, "mediaGuid");
|
||||
Utils.checkNotNull(ultraBlurColors, "ultraBlurColors");
|
||||
Utils.checkNotNull(metaDataRating, "metaDataRating");
|
||||
@@ -544,6 +550,7 @@ public class GetLibraryItemsMetadata {
|
||||
this.writer = writer;
|
||||
this.collection = collection;
|
||||
this.role = role;
|
||||
this.location = location;
|
||||
this.mediaGuid = mediaGuid;
|
||||
this.ultraBlurColors = ultraBlurColors;
|
||||
this.metaDataRating = metaDataRating;
|
||||
@@ -580,7 +587,7 @@ public class GetLibraryItemsMetadata {
|
||||
String title,
|
||||
String summary,
|
||||
long addedAt) {
|
||||
this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -855,6 +862,12 @@ public class GetLibraryItemsMetadata {
|
||||
return (Optional<List<GetLibraryItemsRole>>) role;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<List<GetLibraryItemsLocation>> location() {
|
||||
return (Optional<List<GetLibraryItemsLocation>>) location;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
|
||||
*
|
||||
@@ -1567,6 +1580,18 @@ public class GetLibraryItemsMetadata {
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMetadata withLocation(List<GetLibraryItemsLocation> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = Optional.ofNullable(location);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsMetadata withLocation(Optional<? extends List<GetLibraryItemsLocation>> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = location;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
|
||||
*
|
||||
@@ -1952,6 +1977,7 @@ public class GetLibraryItemsMetadata {
|
||||
Objects.deepEquals(this.writer, other.writer) &&
|
||||
Objects.deepEquals(this.collection, other.collection) &&
|
||||
Objects.deepEquals(this.role, other.role) &&
|
||||
Objects.deepEquals(this.location, other.location) &&
|
||||
Objects.deepEquals(this.mediaGuid, other.mediaGuid) &&
|
||||
Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) &&
|
||||
Objects.deepEquals(this.metaDataRating, other.metaDataRating) &&
|
||||
@@ -2030,6 +2056,7 @@ public class GetLibraryItemsMetadata {
|
||||
writer,
|
||||
collection,
|
||||
role,
|
||||
location,
|
||||
mediaGuid,
|
||||
ultraBlurColors,
|
||||
metaDataRating,
|
||||
@@ -2108,6 +2135,7 @@ public class GetLibraryItemsMetadata {
|
||||
"writer", writer,
|
||||
"collection", collection,
|
||||
"role", role,
|
||||
"location", location,
|
||||
"mediaGuid", mediaGuid,
|
||||
"ultraBlurColors", ultraBlurColors,
|
||||
"metaDataRating", metaDataRating,
|
||||
@@ -2232,6 +2260,8 @@ public class GetLibraryItemsMetadata {
|
||||
|
||||
private Optional<? extends List<GetLibraryItemsRole>> role = Optional.empty();
|
||||
|
||||
private Optional<? extends List<GetLibraryItemsLocation>> location = Optional.empty();
|
||||
|
||||
private Optional<? extends List<GetLibraryItemsMediaGuid>> mediaGuid = Optional.empty();
|
||||
|
||||
private Optional<? extends GetLibraryItemsUltraBlurColors> ultraBlurColors = Optional.empty();
|
||||
@@ -2854,6 +2884,18 @@ public class GetLibraryItemsMetadata {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder location(List<GetLibraryItemsLocation> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = Optional.ofNullable(location);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder location(Optional<? extends List<GetLibraryItemsLocation>> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = location;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
|
||||
*
|
||||
@@ -3233,6 +3275,7 @@ public class GetLibraryItemsMetadata {
|
||||
writer,
|
||||
collection,
|
||||
role,
|
||||
location,
|
||||
mediaGuid,
|
||||
ultraBlurColors,
|
||||
metaDataRating,
|
||||
|
||||
@@ -32,8 +32,9 @@ public class GetLibraryItemsPart {
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("duration")
|
||||
private int duration;
|
||||
private Optional<Integer> duration;
|
||||
|
||||
@JsonProperty("file")
|
||||
private String file;
|
||||
@@ -60,8 +61,9 @@ public class GetLibraryItemsPart {
|
||||
@JsonProperty("optimizedForStreaming")
|
||||
private Optional<Boolean> optimizedForStreaming;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoProfile")
|
||||
private String videoProfile;
|
||||
private Optional<String> videoProfile;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("indexes")
|
||||
@@ -79,14 +81,14 @@ public class GetLibraryItemsPart {
|
||||
public GetLibraryItemsPart(
|
||||
@JsonProperty("id") int id,
|
||||
@JsonProperty("key") String key,
|
||||
@JsonProperty("duration") int duration,
|
||||
@JsonProperty("duration") Optional<Integer> duration,
|
||||
@JsonProperty("file") String file,
|
||||
@JsonProperty("size") long size,
|
||||
@JsonProperty("container") String container,
|
||||
@JsonProperty("audioProfile") Optional<String> audioProfile,
|
||||
@JsonProperty("has64bitOffsets") Optional<Boolean> has64bitOffsets,
|
||||
@JsonProperty("optimizedForStreaming") Optional<Boolean> optimizedForStreaming,
|
||||
@JsonProperty("videoProfile") String videoProfile,
|
||||
@JsonProperty("videoProfile") Optional<String> videoProfile,
|
||||
@JsonProperty("indexes") Optional<String> indexes,
|
||||
@JsonProperty("hasThumbnail") Optional<? extends GetLibraryItemsHasThumbnail> hasThumbnail,
|
||||
@JsonProperty("Stream") Optional<? extends List<GetLibraryItemsStream>> stream) {
|
||||
@@ -121,12 +123,10 @@ public class GetLibraryItemsPart {
|
||||
public GetLibraryItemsPart(
|
||||
int id,
|
||||
String key,
|
||||
int duration,
|
||||
String file,
|
||||
long size,
|
||||
String container,
|
||||
String videoProfile) {
|
||||
this(id, key, duration, file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), videoProfile, Optional.empty(), Optional.empty(), Optional.empty());
|
||||
String container) {
|
||||
this(id, key, Optional.empty(), file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@@ -140,7 +140,7 @@ public class GetLibraryItemsPart {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int duration() {
|
||||
public Optional<Integer> duration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public class GetLibraryItemsPart {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String videoProfile() {
|
||||
public Optional<String> videoProfile() {
|
||||
return videoProfile;
|
||||
}
|
||||
|
||||
@@ -217,6 +217,12 @@ public class GetLibraryItemsPart {
|
||||
}
|
||||
|
||||
public GetLibraryItemsPart withDuration(int duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = Optional.ofNullable(duration);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsPart withDuration(Optional<Integer> duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = duration;
|
||||
return this;
|
||||
@@ -281,6 +287,12 @@ public class GetLibraryItemsPart {
|
||||
}
|
||||
|
||||
public GetLibraryItemsPart withVideoProfile(String videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = Optional.ofNullable(videoProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsPart withVideoProfile(Optional<String> videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = videoProfile;
|
||||
return this;
|
||||
@@ -389,7 +401,7 @@ public class GetLibraryItemsPart {
|
||||
|
||||
private String key;
|
||||
|
||||
private Integer duration;
|
||||
private Optional<Integer> duration = Optional.empty();
|
||||
|
||||
private String file;
|
||||
|
||||
@@ -403,7 +415,7 @@ public class GetLibraryItemsPart {
|
||||
|
||||
private Optional<Boolean> optimizedForStreaming = Optional.empty();
|
||||
|
||||
private String videoProfile;
|
||||
private Optional<String> videoProfile = Optional.empty();
|
||||
|
||||
private Optional<String> indexes = Optional.empty();
|
||||
|
||||
@@ -428,6 +440,12 @@ public class GetLibraryItemsPart {
|
||||
}
|
||||
|
||||
public Builder duration(int duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = Optional.ofNullable(duration);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder duration(Optional<Integer> duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = duration;
|
||||
return this;
|
||||
@@ -492,6 +510,12 @@ public class GetLibraryItemsPart {
|
||||
}
|
||||
|
||||
public Builder videoProfile(String videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = Optional.ofNullable(videoProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoProfile(Optional<String> videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = videoProfile;
|
||||
return this;
|
||||
|
||||
@@ -21,14 +21,6 @@ import java.util.Optional;
|
||||
|
||||
public class GetLibraryItemsRequest {
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")
|
||||
private int sectionKey;
|
||||
|
||||
/**
|
||||
* A key representing a specific tag within the section.
|
||||
*/
|
||||
@@ -54,6 +46,14 @@ public class GetLibraryItemsRequest {
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")
|
||||
private Optional<? extends GetLibraryItemsQueryParamType> type;
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")
|
||||
private int sectionKey;
|
||||
|
||||
/**
|
||||
* Adds the Meta object to the response
|
||||
*
|
||||
@@ -81,43 +81,33 @@ public class GetLibraryItemsRequest {
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryItemsRequest(
|
||||
int sectionKey,
|
||||
Tag tag,
|
||||
Optional<? extends IncludeGuids> includeGuids,
|
||||
Optional<? extends GetLibraryItemsQueryParamType> type,
|
||||
int sectionKey,
|
||||
Optional<? extends GetLibraryItemsQueryParamIncludeMeta> includeMeta,
|
||||
Optional<Integer> xPlexContainerStart,
|
||||
Optional<Integer> xPlexContainerSize) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
Utils.checkNotNull(includeGuids, "includeGuids");
|
||||
Utils.checkNotNull(type, "type");
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
Utils.checkNotNull(includeMeta, "includeMeta");
|
||||
Utils.checkNotNull(xPlexContainerStart, "xPlexContainerStart");
|
||||
Utils.checkNotNull(xPlexContainerSize, "xPlexContainerSize");
|
||||
this.sectionKey = sectionKey;
|
||||
this.tag = tag;
|
||||
this.includeGuids = includeGuids;
|
||||
this.type = type;
|
||||
this.sectionKey = sectionKey;
|
||||
this.includeMeta = includeMeta;
|
||||
this.xPlexContainerStart = xPlexContainerStart;
|
||||
this.xPlexContainerSize = xPlexContainerSize;
|
||||
}
|
||||
|
||||
public GetLibraryItemsRequest(
|
||||
int sectionKey,
|
||||
Tag tag) {
|
||||
this(sectionKey, tag, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int sectionKey() {
|
||||
return sectionKey;
|
||||
Tag tag,
|
||||
int sectionKey) {
|
||||
this(tag, Optional.empty(), Optional.empty(), sectionKey, Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,6 +143,16 @@ public class GetLibraryItemsRequest {
|
||||
return (Optional<GetLibraryItemsQueryParamType>) type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int sectionKey() {
|
||||
return sectionKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the Meta object to the response
|
||||
*
|
||||
@@ -189,17 +189,6 @@ public class GetLibraryItemsRequest {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public GetLibraryItemsRequest withSectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A key representing a specific tag within the section.
|
||||
*/
|
||||
@@ -259,6 +248,17 @@ public class GetLibraryItemsRequest {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public GetLibraryItemsRequest withSectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the Meta object to the response
|
||||
*
|
||||
@@ -337,10 +337,10 @@ public class GetLibraryItemsRequest {
|
||||
}
|
||||
GetLibraryItemsRequest other = (GetLibraryItemsRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.sectionKey, other.sectionKey) &&
|
||||
Objects.deepEquals(this.tag, other.tag) &&
|
||||
Objects.deepEquals(this.includeGuids, other.includeGuids) &&
|
||||
Objects.deepEquals(this.type, other.type) &&
|
||||
Objects.deepEquals(this.sectionKey, other.sectionKey) &&
|
||||
Objects.deepEquals(this.includeMeta, other.includeMeta) &&
|
||||
Objects.deepEquals(this.xPlexContainerStart, other.xPlexContainerStart) &&
|
||||
Objects.deepEquals(this.xPlexContainerSize, other.xPlexContainerSize);
|
||||
@@ -349,10 +349,10 @@ public class GetLibraryItemsRequest {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
sectionKey,
|
||||
tag,
|
||||
includeGuids,
|
||||
type,
|
||||
sectionKey,
|
||||
includeMeta,
|
||||
xPlexContainerStart,
|
||||
xPlexContainerSize);
|
||||
@@ -361,10 +361,10 @@ public class GetLibraryItemsRequest {
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetLibraryItemsRequest.class,
|
||||
"sectionKey", sectionKey,
|
||||
"tag", tag,
|
||||
"includeGuids", includeGuids,
|
||||
"type", type,
|
||||
"sectionKey", sectionKey,
|
||||
"includeMeta", includeMeta,
|
||||
"xPlexContainerStart", xPlexContainerStart,
|
||||
"xPlexContainerSize", xPlexContainerSize);
|
||||
@@ -372,14 +372,14 @@ public class GetLibraryItemsRequest {
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Integer sectionKey;
|
||||
|
||||
private Tag tag;
|
||||
|
||||
private Optional<? extends IncludeGuids> includeGuids;
|
||||
|
||||
private Optional<? extends GetLibraryItemsQueryParamType> type = Optional.empty();
|
||||
|
||||
private Integer sectionKey;
|
||||
|
||||
private Optional<? extends GetLibraryItemsQueryParamIncludeMeta> includeMeta;
|
||||
|
||||
private Optional<Integer> xPlexContainerStart;
|
||||
@@ -390,17 +390,6 @@ public class GetLibraryItemsRequest {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public Builder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A key representing a specific tag within the section.
|
||||
*/
|
||||
@@ -460,6 +449,17 @@ public class GetLibraryItemsRequest {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public Builder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the Meta object to the response
|
||||
*
|
||||
@@ -541,10 +541,10 @@ public class GetLibraryItemsRequest {
|
||||
if (xPlexContainerSize == null) {
|
||||
xPlexContainerSize = _SINGLETON_VALUE_XPlexContainerSize.value();
|
||||
} return new GetLibraryItemsRequest(
|
||||
sectionKey,
|
||||
tag,
|
||||
includeGuids,
|
||||
type,
|
||||
sectionKey,
|
||||
includeMeta,
|
||||
xPlexContainerStart,
|
||||
xPlexContainerSize);
|
||||
|
||||
@@ -4,11 +4,15 @@
|
||||
|
||||
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 GetLibraryItemsRequestBuilder {
|
||||
|
||||
private GetLibraryItemsRequest request;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetLibraryItems sdk;
|
||||
|
||||
public GetLibraryItemsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryItems sdk) {
|
||||
@@ -20,10 +24,25 @@ public class GetLibraryItemsRequestBuilder {
|
||||
this.request = request;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getLibraryItems(
|
||||
request);
|
||||
request,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ import java.util.Objects;
|
||||
public class GetMediaProvidersRequest {
|
||||
|
||||
/**
|
||||
* Plex Authentication Token
|
||||
* An authentication token, obtained from plex.tv
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")
|
||||
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")
|
||||
private String xPlexToken;
|
||||
|
||||
@JsonCreator
|
||||
@@ -30,7 +30,7 @@ public class GetMediaProvidersRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Plex Authentication Token
|
||||
* An authentication token, obtained from plex.tv
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String xPlexToken() {
|
||||
@@ -42,7 +42,7 @@ public class GetMediaProvidersRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Plex Authentication Token
|
||||
* An authentication token, obtained from plex.tv
|
||||
*/
|
||||
public GetMediaProvidersRequest withXPlexToken(String xPlexToken) {
|
||||
Utils.checkNotNull(xPlexToken, "xPlexToken");
|
||||
@@ -84,7 +84,7 @@ public class GetMediaProvidersRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Plex Authentication Token
|
||||
* An authentication token, obtained from plex.tv
|
||||
*/
|
||||
public Builder xPlexToken(String xPlexToken) {
|
||||
Utils.checkNotNull(xPlexToken, "xPlexToken");
|
||||
|
||||
@@ -4,12 +4,16 @@
|
||||
|
||||
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.lang.String;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetMediaProvidersRequestBuilder {
|
||||
|
||||
private String xPlexToken;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetMediaProviders sdk;
|
||||
|
||||
public GetMediaProvidersRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaProviders sdk) {
|
||||
@@ -21,10 +25,25 @@ public class GetMediaProvidersRequestBuilder {
|
||||
this.xPlexToken = xPlexToken;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getMediaProviders(
|
||||
xPlexToken);
|
||||
xPlexToken,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@
|
||||
|
||||
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.lang.Long;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetMetaDataByRatingKeyRequestBuilder {
|
||||
|
||||
private Long ratingKey;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetMetaDataByRatingKey sdk;
|
||||
|
||||
public GetMetaDataByRatingKeyRequestBuilder(SDKMethodInterfaces.MethodCallGetMetaDataByRatingKey sdk) {
|
||||
@@ -21,10 +25,25 @@ public class GetMetaDataByRatingKeyRequestBuilder {
|
||||
this.ratingKey = ratingKey;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getMetaDataByRatingKey(
|
||||
ratingKey);
|
||||
ratingKey,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.lang.String;
|
||||
@@ -13,6 +15,7 @@ public class GetMetadataChildrenRequestBuilder {
|
||||
|
||||
private Double ratingKey;
|
||||
private Optional<String> includeElements = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetMetadataChildren sdk;
|
||||
|
||||
public GetMetadataChildrenRequestBuilder(SDKMethodInterfaces.MethodCallGetMetadataChildren sdk) {
|
||||
@@ -36,11 +39,26 @@ public class GetMetadataChildrenRequestBuilder {
|
||||
this.includeElements = includeElements;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getMetadataChildren(
|
||||
ratingKey,
|
||||
includeElements);
|
||||
includeElements,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,37 @@
|
||||
|
||||
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 {
|
||||
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk;
|
||||
|
||||
public GetMyPlexAccountRequestBuilder(SDKMethodInterfaces.MethodCallGetMyPlexAccount 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 {
|
||||
|
||||
return sdk.getMyPlexAccountDirect();
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getMyPlexAccount(
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,37 @@
|
||||
|
||||
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 {
|
||||
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetOnDeck sdk;
|
||||
|
||||
public GetOnDeckRequestBuilder(SDKMethodInterfaces.MethodCallGetOnDeck 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 {
|
||||
|
||||
return sdk.getOnDeckDirect();
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getOnDeck(
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,43 +30,55 @@ public class GetPinRequest {
|
||||
private Optional<Boolean> strong;
|
||||
|
||||
/**
|
||||
* The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device)
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")
|
||||
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")
|
||||
private Optional<String> clientID;
|
||||
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product")
|
||||
/**
|
||||
* The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
*/
|
||||
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")
|
||||
private Optional<String> clientName;
|
||||
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device")
|
||||
private Optional<String> deviceName;
|
||||
/**
|
||||
* A relatively friendly name for the client device
|
||||
*/
|
||||
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")
|
||||
private Optional<String> deviceNickname;
|
||||
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version")
|
||||
/**
|
||||
* The version of the client application.
|
||||
*/
|
||||
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")
|
||||
private Optional<String> clientVersion;
|
||||
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform")
|
||||
private Optional<String> clientPlatform;
|
||||
/**
|
||||
* The platform of the client application.
|
||||
*/
|
||||
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")
|
||||
private Optional<String> platform;
|
||||
|
||||
@JsonCreator
|
||||
public GetPinRequest(
|
||||
Optional<Boolean> strong,
|
||||
Optional<String> clientID,
|
||||
Optional<String> clientName,
|
||||
Optional<String> deviceName,
|
||||
Optional<String> deviceNickname,
|
||||
Optional<String> clientVersion,
|
||||
Optional<String> clientPlatform) {
|
||||
Optional<String> platform) {
|
||||
Utils.checkNotNull(strong, "strong");
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
Utils.checkNotNull(clientName, "clientName");
|
||||
Utils.checkNotNull(deviceName, "deviceName");
|
||||
Utils.checkNotNull(deviceNickname, "deviceNickname");
|
||||
Utils.checkNotNull(clientVersion, "clientVersion");
|
||||
Utils.checkNotNull(clientPlatform, "clientPlatform");
|
||||
Utils.checkNotNull(platform, "platform");
|
||||
this.strong = strong;
|
||||
this.clientID = clientID;
|
||||
this.clientName = clientName;
|
||||
this.deviceName = deviceName;
|
||||
this.deviceNickname = deviceNickname;
|
||||
this.clientVersion = clientVersion;
|
||||
this.clientPlatform = clientPlatform;
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
public GetPinRequest() {
|
||||
@@ -85,31 +97,43 @@ public class GetPinRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device)
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> clientID() {
|
||||
return clientID;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> clientName() {
|
||||
return clientName;
|
||||
}
|
||||
|
||||
/**
|
||||
* A relatively friendly name for the client device
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> deviceName() {
|
||||
return deviceName;
|
||||
public Optional<String> deviceNickname() {
|
||||
return deviceNickname;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version of the client application.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> clientVersion() {
|
||||
return clientVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* The platform of the client application.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> clientPlatform() {
|
||||
return clientPlatform;
|
||||
public Optional<String> platform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -141,7 +165,7 @@ public class GetPinRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device)
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
public GetPinRequest withClientID(String clientID) {
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
@@ -150,7 +174,7 @@ public class GetPinRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device)
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
public GetPinRequest withClientID(Optional<String> clientID) {
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
@@ -158,51 +182,75 @@ public class GetPinRequest {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
*/
|
||||
public GetPinRequest withClientName(String clientName) {
|
||||
Utils.checkNotNull(clientName, "clientName");
|
||||
this.clientName = Optional.ofNullable(clientName);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
*/
|
||||
public GetPinRequest withClientName(Optional<String> clientName) {
|
||||
Utils.checkNotNull(clientName, "clientName");
|
||||
this.clientName = clientName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetPinRequest withDeviceName(String deviceName) {
|
||||
Utils.checkNotNull(deviceName, "deviceName");
|
||||
this.deviceName = Optional.ofNullable(deviceName);
|
||||
/**
|
||||
* A relatively friendly name for the client device
|
||||
*/
|
||||
public GetPinRequest withDeviceNickname(String deviceNickname) {
|
||||
Utils.checkNotNull(deviceNickname, "deviceNickname");
|
||||
this.deviceNickname = Optional.ofNullable(deviceNickname);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetPinRequest withDeviceName(Optional<String> deviceName) {
|
||||
Utils.checkNotNull(deviceName, "deviceName");
|
||||
this.deviceName = deviceName;
|
||||
/**
|
||||
* A relatively friendly name for the client device
|
||||
*/
|
||||
public GetPinRequest withDeviceNickname(Optional<String> deviceNickname) {
|
||||
Utils.checkNotNull(deviceNickname, "deviceNickname");
|
||||
this.deviceNickname = deviceNickname;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version of the client application.
|
||||
*/
|
||||
public GetPinRequest withClientVersion(String clientVersion) {
|
||||
Utils.checkNotNull(clientVersion, "clientVersion");
|
||||
this.clientVersion = Optional.ofNullable(clientVersion);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version of the client application.
|
||||
*/
|
||||
public GetPinRequest withClientVersion(Optional<String> clientVersion) {
|
||||
Utils.checkNotNull(clientVersion, "clientVersion");
|
||||
this.clientVersion = clientVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetPinRequest withClientPlatform(String clientPlatform) {
|
||||
Utils.checkNotNull(clientPlatform, "clientPlatform");
|
||||
this.clientPlatform = Optional.ofNullable(clientPlatform);
|
||||
/**
|
||||
* The platform of the client application.
|
||||
*/
|
||||
public GetPinRequest withPlatform(String platform) {
|
||||
Utils.checkNotNull(platform, "platform");
|
||||
this.platform = Optional.ofNullable(platform);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetPinRequest withClientPlatform(Optional<String> clientPlatform) {
|
||||
Utils.checkNotNull(clientPlatform, "clientPlatform");
|
||||
this.clientPlatform = clientPlatform;
|
||||
/**
|
||||
* The platform of the client application.
|
||||
*/
|
||||
public GetPinRequest withPlatform(Optional<String> platform) {
|
||||
Utils.checkNotNull(platform, "platform");
|
||||
this.platform = platform;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -219,9 +267,9 @@ public class GetPinRequest {
|
||||
Objects.deepEquals(this.strong, other.strong) &&
|
||||
Objects.deepEquals(this.clientID, other.clientID) &&
|
||||
Objects.deepEquals(this.clientName, other.clientName) &&
|
||||
Objects.deepEquals(this.deviceName, other.deviceName) &&
|
||||
Objects.deepEquals(this.deviceNickname, other.deviceNickname) &&
|
||||
Objects.deepEquals(this.clientVersion, other.clientVersion) &&
|
||||
Objects.deepEquals(this.clientPlatform, other.clientPlatform);
|
||||
Objects.deepEquals(this.platform, other.platform);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -230,9 +278,9 @@ public class GetPinRequest {
|
||||
strong,
|
||||
clientID,
|
||||
clientName,
|
||||
deviceName,
|
||||
deviceNickname,
|
||||
clientVersion,
|
||||
clientPlatform);
|
||||
platform);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -241,9 +289,9 @@ public class GetPinRequest {
|
||||
"strong", strong,
|
||||
"clientID", clientID,
|
||||
"clientName", clientName,
|
||||
"deviceName", deviceName,
|
||||
"deviceNickname", deviceNickname,
|
||||
"clientVersion", clientVersion,
|
||||
"clientPlatform", clientPlatform);
|
||||
"platform", platform);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
@@ -254,11 +302,11 @@ public class GetPinRequest {
|
||||
|
||||
private Optional<String> clientName = Optional.empty();
|
||||
|
||||
private Optional<String> deviceName = Optional.empty();
|
||||
private Optional<String> deviceNickname = Optional.empty();
|
||||
|
||||
private Optional<String> clientVersion = Optional.empty();
|
||||
|
||||
private Optional<String> clientPlatform = Optional.empty();
|
||||
private Optional<String> platform = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
@@ -289,7 +337,7 @@ public class GetPinRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device)
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
public Builder clientID(String clientID) {
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
@@ -298,7 +346,7 @@ public class GetPinRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device)
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
public Builder clientID(Optional<String> clientID) {
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
@@ -306,51 +354,75 @@ public class GetPinRequest {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
*/
|
||||
public Builder clientName(String clientName) {
|
||||
Utils.checkNotNull(clientName, "clientName");
|
||||
this.clientName = Optional.ofNullable(clientName);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
*/
|
||||
public Builder clientName(Optional<String> clientName) {
|
||||
Utils.checkNotNull(clientName, "clientName");
|
||||
this.clientName = clientName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder deviceName(String deviceName) {
|
||||
Utils.checkNotNull(deviceName, "deviceName");
|
||||
this.deviceName = Optional.ofNullable(deviceName);
|
||||
/**
|
||||
* A relatively friendly name for the client device
|
||||
*/
|
||||
public Builder deviceNickname(String deviceNickname) {
|
||||
Utils.checkNotNull(deviceNickname, "deviceNickname");
|
||||
this.deviceNickname = Optional.ofNullable(deviceNickname);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder deviceName(Optional<String> deviceName) {
|
||||
Utils.checkNotNull(deviceName, "deviceName");
|
||||
this.deviceName = deviceName;
|
||||
/**
|
||||
* A relatively friendly name for the client device
|
||||
*/
|
||||
public Builder deviceNickname(Optional<String> deviceNickname) {
|
||||
Utils.checkNotNull(deviceNickname, "deviceNickname");
|
||||
this.deviceNickname = deviceNickname;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version of the client application.
|
||||
*/
|
||||
public Builder clientVersion(String clientVersion) {
|
||||
Utils.checkNotNull(clientVersion, "clientVersion");
|
||||
this.clientVersion = Optional.ofNullable(clientVersion);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version of the client application.
|
||||
*/
|
||||
public Builder clientVersion(Optional<String> clientVersion) {
|
||||
Utils.checkNotNull(clientVersion, "clientVersion");
|
||||
this.clientVersion = clientVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clientPlatform(String clientPlatform) {
|
||||
Utils.checkNotNull(clientPlatform, "clientPlatform");
|
||||
this.clientPlatform = Optional.ofNullable(clientPlatform);
|
||||
/**
|
||||
* The platform of the client application.
|
||||
*/
|
||||
public Builder platform(String platform) {
|
||||
Utils.checkNotNull(platform, "platform");
|
||||
this.platform = Optional.ofNullable(platform);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clientPlatform(Optional<String> clientPlatform) {
|
||||
Utils.checkNotNull(clientPlatform, "clientPlatform");
|
||||
this.clientPlatform = clientPlatform;
|
||||
/**
|
||||
* The platform of the client application.
|
||||
*/
|
||||
public Builder platform(Optional<String> platform) {
|
||||
Utils.checkNotNull(platform, "platform");
|
||||
this.platform = platform;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -361,9 +433,9 @@ public class GetPinRequest {
|
||||
strong,
|
||||
clientID,
|
||||
clientName,
|
||||
deviceName,
|
||||
deviceNickname,
|
||||
clientVersion,
|
||||
clientPlatform);
|
||||
platform);
|
||||
}
|
||||
|
||||
private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_Strong =
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.String;
|
||||
import java.util.Optional;
|
||||
@@ -12,6 +14,7 @@ public class GetPinRequestBuilder {
|
||||
|
||||
private GetPinRequest request;
|
||||
private Optional<String> serverURL = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetPin sdk;
|
||||
|
||||
public GetPinRequestBuilder(SDKMethodInterfaces.MethodCallGetPin sdk) {
|
||||
@@ -35,11 +38,26 @@ public class GetPinRequestBuilder {
|
||||
this.serverURL = serverURL;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getPin(
|
||||
request,
|
||||
serverURL);
|
||||
serverURL,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,17 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetPlaylistContentsRequestBuilder {
|
||||
|
||||
private Double playlistID;
|
||||
private GetPlaylistContentsQueryParamType type;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetPlaylistContents sdk;
|
||||
|
||||
public GetPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylistContents sdk) {
|
||||
@@ -28,11 +32,26 @@ public class GetPlaylistContentsRequestBuilder {
|
||||
this.type = type;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getPlaylistContents(
|
||||
playlistID,
|
||||
type);
|
||||
type,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@
|
||||
|
||||
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.lang.Double;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetPlaylistRequestBuilder {
|
||||
|
||||
private Double playlistID;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetPlaylist sdk;
|
||||
|
||||
public GetPlaylistRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylist sdk) {
|
||||
@@ -21,10 +25,25 @@ public class GetPlaylistRequestBuilder {
|
||||
this.playlistID = playlistID;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getPlaylist(
|
||||
playlistID);
|
||||
playlistID,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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;
|
||||
|
||||
@@ -11,6 +13,7 @@ public class GetPlaylistsRequestBuilder {
|
||||
|
||||
private Optional<? extends PlaylistType> playlistType = Optional.empty();
|
||||
private Optional<? extends QueryParamSmart> smart = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetPlaylists sdk;
|
||||
|
||||
public GetPlaylistsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylists sdk) {
|
||||
@@ -40,11 +43,26 @@ public class GetPlaylistsRequestBuilder {
|
||||
this.smart = smart;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getPlaylists(
|
||||
playlistType,
|
||||
smart);
|
||||
smart,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,15 @@
|
||||
|
||||
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 GetRecentlyAddedLibraryRequestBuilder {
|
||||
|
||||
private GetRecentlyAddedLibraryRequest request;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk;
|
||||
|
||||
public GetRecentlyAddedLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk) {
|
||||
@@ -20,10 +24,25 @@ public class GetRecentlyAddedLibraryRequestBuilder {
|
||||
this.request = request;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getRecentlyAddedLibrary(
|
||||
request);
|
||||
request,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,6 +237,10 @@ public class GetRecentlyAddedMetadata {
|
||||
@JsonProperty("Role")
|
||||
private Optional<? extends List<Role>> role;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("Location")
|
||||
private Optional<? extends List<Location>> location;
|
||||
|
||||
/**
|
||||
* The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
|
||||
*
|
||||
@@ -398,6 +402,7 @@ public class GetRecentlyAddedMetadata {
|
||||
@JsonProperty("Writer") Optional<? extends List<Writer>> writer,
|
||||
@JsonProperty("Collection") Optional<? extends List<Collection>> collection,
|
||||
@JsonProperty("Role") Optional<? extends List<Role>> role,
|
||||
@JsonProperty("Location") Optional<? extends List<Location>> location,
|
||||
@JsonProperty("Guid") Optional<? extends List<MediaGuid>> mediaGuid,
|
||||
@JsonProperty("UltraBlurColors") Optional<? extends UltraBlurColors> ultraBlurColors,
|
||||
@JsonProperty("Rating") Optional<? extends List<MetaDataRating>> metaDataRating,
|
||||
@@ -471,6 +476,7 @@ public class GetRecentlyAddedMetadata {
|
||||
Utils.checkNotNull(writer, "writer");
|
||||
Utils.checkNotNull(collection, "collection");
|
||||
Utils.checkNotNull(role, "role");
|
||||
Utils.checkNotNull(location, "location");
|
||||
Utils.checkNotNull(mediaGuid, "mediaGuid");
|
||||
Utils.checkNotNull(ultraBlurColors, "ultraBlurColors");
|
||||
Utils.checkNotNull(metaDataRating, "metaDataRating");
|
||||
@@ -544,6 +550,7 @@ public class GetRecentlyAddedMetadata {
|
||||
this.writer = writer;
|
||||
this.collection = collection;
|
||||
this.role = role;
|
||||
this.location = location;
|
||||
this.mediaGuid = mediaGuid;
|
||||
this.ultraBlurColors = ultraBlurColors;
|
||||
this.metaDataRating = metaDataRating;
|
||||
@@ -580,7 +587,7 @@ public class GetRecentlyAddedMetadata {
|
||||
String title,
|
||||
String summary,
|
||||
long addedAt) {
|
||||
this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -855,6 +862,12 @@ public class GetRecentlyAddedMetadata {
|
||||
return (Optional<List<Role>>) role;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<List<Location>> location() {
|
||||
return (Optional<List<Location>>) location;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
|
||||
*
|
||||
@@ -1567,6 +1580,18 @@ public class GetRecentlyAddedMetadata {
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetRecentlyAddedMetadata withLocation(List<Location> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = Optional.ofNullable(location);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetRecentlyAddedMetadata withLocation(Optional<? extends List<Location>> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = location;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
|
||||
*
|
||||
@@ -1952,6 +1977,7 @@ public class GetRecentlyAddedMetadata {
|
||||
Objects.deepEquals(this.writer, other.writer) &&
|
||||
Objects.deepEquals(this.collection, other.collection) &&
|
||||
Objects.deepEquals(this.role, other.role) &&
|
||||
Objects.deepEquals(this.location, other.location) &&
|
||||
Objects.deepEquals(this.mediaGuid, other.mediaGuid) &&
|
||||
Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) &&
|
||||
Objects.deepEquals(this.metaDataRating, other.metaDataRating) &&
|
||||
@@ -2030,6 +2056,7 @@ public class GetRecentlyAddedMetadata {
|
||||
writer,
|
||||
collection,
|
||||
role,
|
||||
location,
|
||||
mediaGuid,
|
||||
ultraBlurColors,
|
||||
metaDataRating,
|
||||
@@ -2108,6 +2135,7 @@ public class GetRecentlyAddedMetadata {
|
||||
"writer", writer,
|
||||
"collection", collection,
|
||||
"role", role,
|
||||
"location", location,
|
||||
"mediaGuid", mediaGuid,
|
||||
"ultraBlurColors", ultraBlurColors,
|
||||
"metaDataRating", metaDataRating,
|
||||
@@ -2232,6 +2260,8 @@ public class GetRecentlyAddedMetadata {
|
||||
|
||||
private Optional<? extends List<Role>> role = Optional.empty();
|
||||
|
||||
private Optional<? extends List<Location>> location = Optional.empty();
|
||||
|
||||
private Optional<? extends List<MediaGuid>> mediaGuid = Optional.empty();
|
||||
|
||||
private Optional<? extends UltraBlurColors> ultraBlurColors = Optional.empty();
|
||||
@@ -2854,6 +2884,18 @@ public class GetRecentlyAddedMetadata {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder location(List<Location> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = Optional.ofNullable(location);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder location(Optional<? extends List<Location>> location) {
|
||||
Utils.checkNotNull(location, "location");
|
||||
this.location = location;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
|
||||
*
|
||||
@@ -3233,6 +3275,7 @@ public class GetRecentlyAddedMetadata {
|
||||
writer,
|
||||
collection,
|
||||
role,
|
||||
location,
|
||||
mediaGuid,
|
||||
ultraBlurColors,
|
||||
metaDataRating,
|
||||
|
||||
@@ -4,11 +4,15 @@
|
||||
|
||||
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 GetRecentlyAddedRequestBuilder {
|
||||
|
||||
private GetRecentlyAddedRequest request;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk;
|
||||
|
||||
public GetRecentlyAddedRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk) {
|
||||
@@ -20,10 +24,25 @@ public class GetRecentlyAddedRequestBuilder {
|
||||
this.request = request;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getRecentlyAdded(
|
||||
request);
|
||||
request,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,12 @@ import java.util.Optional;
|
||||
|
||||
public class GetRefreshLibraryMetadataRequest {
|
||||
|
||||
/**
|
||||
* Force the refresh even if the library is already being refreshed.
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=force")
|
||||
private Optional<? extends Force> force;
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
@@ -27,25 +33,28 @@ public class GetRefreshLibraryMetadataRequest {
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")
|
||||
private int sectionKey;
|
||||
|
||||
/**
|
||||
* Force the refresh even if the library is already being refreshed.
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=force")
|
||||
private Optional<? extends Force> force;
|
||||
|
||||
@JsonCreator
|
||||
public GetRefreshLibraryMetadataRequest(
|
||||
int sectionKey,
|
||||
Optional<? extends Force> force) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
Optional<? extends Force> force,
|
||||
int sectionKey) {
|
||||
Utils.checkNotNull(force, "force");
|
||||
this.sectionKey = sectionKey;
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.force = force;
|
||||
this.sectionKey = sectionKey;
|
||||
}
|
||||
|
||||
public GetRefreshLibraryMetadataRequest(
|
||||
int sectionKey) {
|
||||
this(sectionKey, Optional.empty());
|
||||
this(Optional.empty(), sectionKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Force the refresh even if the library is already being refreshed.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Force> force() {
|
||||
return (Optional<Force>) force;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,30 +67,10 @@ public class GetRefreshLibraryMetadataRequest {
|
||||
return sectionKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force the refresh even if the library is already being refreshed.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Force> force() {
|
||||
return (Optional<Force>) force;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public GetRefreshLibraryMetadataRequest withSectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force the refresh even if the library is already being refreshed.
|
||||
*/
|
||||
@@ -99,6 +88,17 @@ public class GetRefreshLibraryMetadataRequest {
|
||||
this.force = force;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public GetRefreshLibraryMetadataRequest withSectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
@@ -110,45 +110,34 @@ public class GetRefreshLibraryMetadataRequest {
|
||||
}
|
||||
GetRefreshLibraryMetadataRequest other = (GetRefreshLibraryMetadataRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.sectionKey, other.sectionKey) &&
|
||||
Objects.deepEquals(this.force, other.force);
|
||||
Objects.deepEquals(this.force, other.force) &&
|
||||
Objects.deepEquals(this.sectionKey, other.sectionKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
sectionKey,
|
||||
force);
|
||||
force,
|
||||
sectionKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetRefreshLibraryMetadataRequest.class,
|
||||
"sectionKey", sectionKey,
|
||||
"force", force);
|
||||
"force", force,
|
||||
"sectionKey", sectionKey);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Integer sectionKey;
|
||||
private Optional<? extends Force> force = Optional.empty();
|
||||
|
||||
private Optional<? extends Force> force = Optional.empty();
|
||||
private Integer sectionKey;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public Builder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force the refresh even if the library is already being refreshed.
|
||||
*/
|
||||
@@ -166,11 +155,22 @@ public class GetRefreshLibraryMetadataRequest {
|
||||
this.force = force;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*
|
||||
*/
|
||||
public Builder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetRefreshLibraryMetadataRequest build() {
|
||||
return new GetRefreshLibraryMetadataRequest(
|
||||
sectionKey,
|
||||
force);
|
||||
force,
|
||||
sectionKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,25 +4,22 @@
|
||||
|
||||
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.lang.Integer;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetRefreshLibraryMetadataRequestBuilder {
|
||||
|
||||
private Integer sectionKey;
|
||||
private Optional<? extends Force> force = Optional.empty();
|
||||
private Integer sectionKey;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk;
|
||||
|
||||
public GetRefreshLibraryMetadataRequestBuilder(SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk) {
|
||||
this.sdk = sdk;
|
||||
}
|
||||
|
||||
public GetRefreshLibraryMetadataRequestBuilder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetRefreshLibraryMetadataRequestBuilder force(Force force) {
|
||||
Utils.checkNotNull(force, "force");
|
||||
@@ -36,10 +33,31 @@ public class GetRefreshLibraryMetadataRequestBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetRefreshLibraryMetadataResponse call() throws Exception {
|
||||
public GetRefreshLibraryMetadataRequestBuilder sectionKey(int sectionKey) {
|
||||
Utils.checkNotNull(sectionKey, "sectionKey");
|
||||
this.sectionKey = sectionKey;
|
||||
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 {
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getRefreshLibraryMetadata(
|
||||
force,
|
||||
sectionKey,
|
||||
force);
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,15 @@
|
||||
|
||||
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 GetResizedPhotoRequestBuilder {
|
||||
|
||||
private GetResizedPhotoRequest request;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetResizedPhoto sdk;
|
||||
|
||||
public GetResizedPhotoRequestBuilder(SDKMethodInterfaces.MethodCallGetResizedPhoto sdk) {
|
||||
@@ -20,10 +24,25 @@ public class GetResizedPhotoRequestBuilder {
|
||||
this.request = request;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getResizedPhoto(
|
||||
request);
|
||||
request,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
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.lang.Long;
|
||||
import java.util.Optional;
|
||||
@@ -11,6 +13,7 @@ import java.util.Optional;
|
||||
public class GetResourcesStatisticsRequestBuilder {
|
||||
|
||||
private Optional<Long> timespan = Optional.empty();
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk;
|
||||
|
||||
public GetResourcesStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk) {
|
||||
@@ -28,10 +31,25 @@ public class GetResourcesStatisticsRequestBuilder {
|
||||
this.timespan = timespan;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getResourcesStatistics(
|
||||
timespan);
|
||||
timespan,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesCollection {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("tag")
|
||||
private Optional<String> tag;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesCollection(
|
||||
@JsonProperty("tag") Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesCollection() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> tag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesCollection withTag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesCollection withTag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesCollection other = (GetSearchAllLibrariesCollection) o;
|
||||
return
|
||||
Objects.deepEquals(this.tag, other.tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesCollection.class,
|
||||
"tag", tag);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<String> tag = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder tag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder tag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesCollection build() {
|
||||
return new GetSearchAllLibrariesCollection(
|
||||
tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesCountry {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("tag")
|
||||
private Optional<String> tag;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesCountry(
|
||||
@JsonProperty("tag") Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesCountry() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> tag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesCountry withTag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesCountry withTag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesCountry other = (GetSearchAllLibrariesCountry) o;
|
||||
return
|
||||
Objects.deepEquals(this.tag, other.tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesCountry.class,
|
||||
"tag", tag);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<String> tag = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder tag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder tag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesCountry build() {
|
||||
return new GetSearchAllLibrariesCountry(
|
||||
tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesDirector {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("tag")
|
||||
private Optional<String> tag;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesDirector(
|
||||
@JsonProperty("tag") Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesDirector() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> tag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesDirector withTag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesDirector withTag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesDirector other = (GetSearchAllLibrariesDirector) o;
|
||||
return
|
||||
Objects.deepEquals(this.tag, other.tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesDirector.class,
|
||||
"tag", tag);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<String> tag = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder tag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder tag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesDirector build() {
|
||||
return new GetSearchAllLibrariesDirector(
|
||||
tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.lang.String;
|
||||
|
||||
public enum GetSearchAllLibrariesFlattenSeasons {
|
||||
False("0"),
|
||||
True("1");
|
||||
|
||||
@JsonValue
|
||||
private final String value;
|
||||
|
||||
private GetSearchAllLibrariesFlattenSeasons(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesGenre {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("tag")
|
||||
private Optional<String> tag;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesGenre(
|
||||
@JsonProperty("tag") Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesGenre() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> tag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesGenre withTag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesGenre withTag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesGenre other = (GetSearchAllLibrariesGenre) o;
|
||||
return
|
||||
Objects.deepEquals(this.tag, other.tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesGenre.class,
|
||||
"tag", tag);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<String> tag = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder tag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder tag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesGenre build() {
|
||||
return new GetSearchAllLibrariesGenre(
|
||||
tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.lang.String;
|
||||
|
||||
public enum GetSearchAllLibrariesHasThumbnail {
|
||||
False("0"),
|
||||
True("1");
|
||||
|
||||
@JsonValue
|
||||
private final String value;
|
||||
|
||||
private GetSearchAllLibrariesHasThumbnail(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesImage {
|
||||
|
||||
@JsonProperty("alt")
|
||||
private String alt;
|
||||
|
||||
@JsonProperty("type")
|
||||
private GetSearchAllLibrariesLibraryType type;
|
||||
|
||||
@JsonProperty("url")
|
||||
private String url;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesImage(
|
||||
@JsonProperty("alt") String alt,
|
||||
@JsonProperty("type") GetSearchAllLibrariesLibraryType type,
|
||||
@JsonProperty("url") String url) {
|
||||
Utils.checkNotNull(alt, "alt");
|
||||
Utils.checkNotNull(type, "type");
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.alt = alt;
|
||||
this.type = type;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String alt() {
|
||||
return alt;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public GetSearchAllLibrariesLibraryType type() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String url() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesImage withAlt(String alt) {
|
||||
Utils.checkNotNull(alt, "alt");
|
||||
this.alt = alt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesImage withType(GetSearchAllLibrariesLibraryType type) {
|
||||
Utils.checkNotNull(type, "type");
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesImage withUrl(String url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesImage other = (GetSearchAllLibrariesImage) o;
|
||||
return
|
||||
Objects.deepEquals(this.alt, other.alt) &&
|
||||
Objects.deepEquals(this.type, other.type) &&
|
||||
Objects.deepEquals(this.url, other.url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
alt,
|
||||
type,
|
||||
url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesImage.class,
|
||||
"alt", alt,
|
||||
"type", type,
|
||||
"url", url);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String alt;
|
||||
|
||||
private GetSearchAllLibrariesLibraryType type;
|
||||
|
||||
private String url;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder alt(String alt) {
|
||||
Utils.checkNotNull(alt, "alt");
|
||||
this.alt = alt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder type(GetSearchAllLibrariesLibraryType type) {
|
||||
Utils.checkNotNull(type, "type");
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder url(String url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesImage build() {
|
||||
return new GetSearchAllLibrariesImage(
|
||||
alt,
|
||||
type,
|
||||
url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.lang.String;
|
||||
|
||||
public enum GetSearchAllLibrariesLibraryType {
|
||||
COVER_POSTER("coverPoster"),
|
||||
BACKGROUND("background"),
|
||||
SNAPSHOT("snapshot"),
|
||||
CLEAR_LOGO("clearLogo");
|
||||
|
||||
@JsonValue
|
||||
private final String value;
|
||||
|
||||
private GetSearchAllLibrariesLibraryType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesLocation {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("path")
|
||||
private Optional<String> path;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesLocation(
|
||||
@JsonProperty("path") Optional<String> path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLocation() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> path() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLocation withPath(String path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = Optional.ofNullable(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLocation withPath(Optional<String> path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesLocation other = (GetSearchAllLibrariesLocation) o;
|
||||
return
|
||||
Objects.deepEquals(this.path, other.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesLocation.class,
|
||||
"path", path);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<String> path = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder path(String path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = Optional.ofNullable(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder path(Optional<String> path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesLocation build() {
|
||||
return new GetSearchAllLibrariesLocation(
|
||||
path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,803 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import dev.plexapi.sdk.utils.LazySingletonValue;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Double;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesMedia {
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("duration")
|
||||
private Optional<Integer> duration;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("bitrate")
|
||||
private Optional<Integer> bitrate;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("width")
|
||||
private Optional<Integer> width;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("height")
|
||||
private Optional<Integer> height;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("aspectRatio")
|
||||
private Optional<Double> aspectRatio;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("audioProfile")
|
||||
private Optional<String> audioProfile;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("audioChannels")
|
||||
private Optional<Integer> audioChannels;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("audioCodec")
|
||||
private Optional<String> audioCodec;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoCodec")
|
||||
private Optional<String> videoCodec;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoResolution")
|
||||
private Optional<String> videoResolution;
|
||||
|
||||
@JsonProperty("container")
|
||||
private String container;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoFrameRate")
|
||||
private Optional<String> videoFrameRate;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoProfile")
|
||||
private Optional<String> videoProfile;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("hasVoiceActivity")
|
||||
private Optional<Boolean> hasVoiceActivity;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("optimizedForStreaming")
|
||||
private Optional<? extends GetSearchAllLibrariesOptimizedForStreaming> optimizedForStreaming;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("has64bitOffsets")
|
||||
private Optional<Boolean> has64bitOffsets;
|
||||
|
||||
@JsonProperty("Part")
|
||||
private List<GetSearchAllLibrariesPart> part;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesMedia(
|
||||
@JsonProperty("id") int id,
|
||||
@JsonProperty("duration") Optional<Integer> duration,
|
||||
@JsonProperty("bitrate") Optional<Integer> bitrate,
|
||||
@JsonProperty("width") Optional<Integer> width,
|
||||
@JsonProperty("height") Optional<Integer> height,
|
||||
@JsonProperty("aspectRatio") Optional<Double> aspectRatio,
|
||||
@JsonProperty("audioProfile") Optional<String> audioProfile,
|
||||
@JsonProperty("audioChannels") Optional<Integer> audioChannels,
|
||||
@JsonProperty("audioCodec") Optional<String> audioCodec,
|
||||
@JsonProperty("videoCodec") Optional<String> videoCodec,
|
||||
@JsonProperty("videoResolution") Optional<String> videoResolution,
|
||||
@JsonProperty("container") String container,
|
||||
@JsonProperty("videoFrameRate") Optional<String> videoFrameRate,
|
||||
@JsonProperty("videoProfile") Optional<String> videoProfile,
|
||||
@JsonProperty("hasVoiceActivity") Optional<Boolean> hasVoiceActivity,
|
||||
@JsonProperty("optimizedForStreaming") Optional<? extends GetSearchAllLibrariesOptimizedForStreaming> optimizedForStreaming,
|
||||
@JsonProperty("has64bitOffsets") Optional<Boolean> has64bitOffsets,
|
||||
@JsonProperty("Part") List<GetSearchAllLibrariesPart> part) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
Utils.checkNotNull(width, "width");
|
||||
Utils.checkNotNull(height, "height");
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
Utils.checkNotNull(container, "container");
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity");
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
Utils.checkNotNull(part, "part");
|
||||
this.id = id;
|
||||
this.duration = duration;
|
||||
this.bitrate = bitrate;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.aspectRatio = aspectRatio;
|
||||
this.audioProfile = audioProfile;
|
||||
this.audioChannels = audioChannels;
|
||||
this.audioCodec = audioCodec;
|
||||
this.videoCodec = videoCodec;
|
||||
this.videoResolution = videoResolution;
|
||||
this.container = container;
|
||||
this.videoFrameRate = videoFrameRate;
|
||||
this.videoProfile = videoProfile;
|
||||
this.hasVoiceActivity = hasVoiceActivity;
|
||||
this.optimizedForStreaming = optimizedForStreaming;
|
||||
this.has64bitOffsets = has64bitOffsets;
|
||||
this.part = part;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia(
|
||||
int id,
|
||||
String container,
|
||||
List<GetSearchAllLibrariesPart> part) {
|
||||
this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), part);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> duration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> bitrate() {
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> width() {
|
||||
return width;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> height() {
|
||||
return height;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Double> aspectRatio() {
|
||||
return aspectRatio;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> audioProfile() {
|
||||
return audioProfile;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> audioChannels() {
|
||||
return audioChannels;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> audioCodec() {
|
||||
return audioCodec;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> videoCodec() {
|
||||
return videoCodec;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> videoResolution() {
|
||||
return videoResolution;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String container() {
|
||||
return container;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> videoFrameRate() {
|
||||
return videoFrameRate;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> videoProfile() {
|
||||
return videoProfile;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Boolean> hasVoiceActivity() {
|
||||
return hasVoiceActivity;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<GetSearchAllLibrariesOptimizedForStreaming> optimizedForStreaming() {
|
||||
return (Optional<GetSearchAllLibrariesOptimizedForStreaming>) optimizedForStreaming;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Boolean> has64bitOffsets() {
|
||||
return has64bitOffsets;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<GetSearchAllLibrariesPart> part() {
|
||||
return part;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withId(int id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withDuration(int duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = Optional.ofNullable(duration);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withDuration(Optional<Integer> duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = duration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withBitrate(int bitrate) {
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
this.bitrate = Optional.ofNullable(bitrate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withBitrate(Optional<Integer> bitrate) {
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
this.bitrate = bitrate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withWidth(int width) {
|
||||
Utils.checkNotNull(width, "width");
|
||||
this.width = Optional.ofNullable(width);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withWidth(Optional<Integer> width) {
|
||||
Utils.checkNotNull(width, "width");
|
||||
this.width = width;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withHeight(int height) {
|
||||
Utils.checkNotNull(height, "height");
|
||||
this.height = Optional.ofNullable(height);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withHeight(Optional<Integer> height) {
|
||||
Utils.checkNotNull(height, "height");
|
||||
this.height = height;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withAspectRatio(double aspectRatio) {
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
this.aspectRatio = Optional.ofNullable(aspectRatio);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withAspectRatio(Optional<Double> aspectRatio) {
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
this.aspectRatio = aspectRatio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withAudioProfile(String audioProfile) {
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
this.audioProfile = Optional.ofNullable(audioProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withAudioProfile(Optional<String> audioProfile) {
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
this.audioProfile = audioProfile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withAudioChannels(int audioChannels) {
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
this.audioChannels = Optional.ofNullable(audioChannels);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withAudioChannels(Optional<Integer> audioChannels) {
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
this.audioChannels = audioChannels;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withAudioCodec(String audioCodec) {
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
this.audioCodec = Optional.ofNullable(audioCodec);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withAudioCodec(Optional<String> audioCodec) {
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
this.audioCodec = audioCodec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withVideoCodec(String videoCodec) {
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
this.videoCodec = Optional.ofNullable(videoCodec);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withVideoCodec(Optional<String> videoCodec) {
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
this.videoCodec = videoCodec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withVideoResolution(String videoResolution) {
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
this.videoResolution = Optional.ofNullable(videoResolution);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withVideoResolution(Optional<String> videoResolution) {
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
this.videoResolution = videoResolution;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withContainer(String container) {
|
||||
Utils.checkNotNull(container, "container");
|
||||
this.container = container;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withVideoFrameRate(String videoFrameRate) {
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
this.videoFrameRate = Optional.ofNullable(videoFrameRate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withVideoFrameRate(Optional<String> videoFrameRate) {
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
this.videoFrameRate = videoFrameRate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withVideoProfile(String videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = Optional.ofNullable(videoProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withVideoProfile(Optional<String> videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = videoProfile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withHasVoiceActivity(boolean hasVoiceActivity) {
|
||||
Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity");
|
||||
this.hasVoiceActivity = Optional.ofNullable(hasVoiceActivity);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withHasVoiceActivity(Optional<Boolean> hasVoiceActivity) {
|
||||
Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity");
|
||||
this.hasVoiceActivity = hasVoiceActivity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withOptimizedForStreaming(GetSearchAllLibrariesOptimizedForStreaming optimizedForStreaming) {
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withOptimizedForStreaming(Optional<? extends GetSearchAllLibrariesOptimizedForStreaming> optimizedForStreaming) {
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
this.optimizedForStreaming = optimizedForStreaming;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withHas64bitOffsets(boolean has64bitOffsets) {
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
this.has64bitOffsets = Optional.ofNullable(has64bitOffsets);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withHas64bitOffsets(Optional<Boolean> has64bitOffsets) {
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
this.has64bitOffsets = has64bitOffsets;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia withPart(List<GetSearchAllLibrariesPart> part) {
|
||||
Utils.checkNotNull(part, "part");
|
||||
this.part = part;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesMedia other = (GetSearchAllLibrariesMedia) o;
|
||||
return
|
||||
Objects.deepEquals(this.id, other.id) &&
|
||||
Objects.deepEquals(this.duration, other.duration) &&
|
||||
Objects.deepEquals(this.bitrate, other.bitrate) &&
|
||||
Objects.deepEquals(this.width, other.width) &&
|
||||
Objects.deepEquals(this.height, other.height) &&
|
||||
Objects.deepEquals(this.aspectRatio, other.aspectRatio) &&
|
||||
Objects.deepEquals(this.audioProfile, other.audioProfile) &&
|
||||
Objects.deepEquals(this.audioChannels, other.audioChannels) &&
|
||||
Objects.deepEquals(this.audioCodec, other.audioCodec) &&
|
||||
Objects.deepEquals(this.videoCodec, other.videoCodec) &&
|
||||
Objects.deepEquals(this.videoResolution, other.videoResolution) &&
|
||||
Objects.deepEquals(this.container, other.container) &&
|
||||
Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) &&
|
||||
Objects.deepEquals(this.videoProfile, other.videoProfile) &&
|
||||
Objects.deepEquals(this.hasVoiceActivity, other.hasVoiceActivity) &&
|
||||
Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) &&
|
||||
Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) &&
|
||||
Objects.deepEquals(this.part, other.part);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
duration,
|
||||
bitrate,
|
||||
width,
|
||||
height,
|
||||
aspectRatio,
|
||||
audioProfile,
|
||||
audioChannels,
|
||||
audioCodec,
|
||||
videoCodec,
|
||||
videoResolution,
|
||||
container,
|
||||
videoFrameRate,
|
||||
videoProfile,
|
||||
hasVoiceActivity,
|
||||
optimizedForStreaming,
|
||||
has64bitOffsets,
|
||||
part);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesMedia.class,
|
||||
"id", id,
|
||||
"duration", duration,
|
||||
"bitrate", bitrate,
|
||||
"width", width,
|
||||
"height", height,
|
||||
"aspectRatio", aspectRatio,
|
||||
"audioProfile", audioProfile,
|
||||
"audioChannels", audioChannels,
|
||||
"audioCodec", audioCodec,
|
||||
"videoCodec", videoCodec,
|
||||
"videoResolution", videoResolution,
|
||||
"container", container,
|
||||
"videoFrameRate", videoFrameRate,
|
||||
"videoProfile", videoProfile,
|
||||
"hasVoiceActivity", hasVoiceActivity,
|
||||
"optimizedForStreaming", optimizedForStreaming,
|
||||
"has64bitOffsets", has64bitOffsets,
|
||||
"part", part);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Optional<Integer> duration = Optional.empty();
|
||||
|
||||
private Optional<Integer> bitrate = Optional.empty();
|
||||
|
||||
private Optional<Integer> width = Optional.empty();
|
||||
|
||||
private Optional<Integer> height = Optional.empty();
|
||||
|
||||
private Optional<Double> aspectRatio = Optional.empty();
|
||||
|
||||
private Optional<String> audioProfile = Optional.empty();
|
||||
|
||||
private Optional<Integer> audioChannels = Optional.empty();
|
||||
|
||||
private Optional<String> audioCodec = Optional.empty();
|
||||
|
||||
private Optional<String> videoCodec = Optional.empty();
|
||||
|
||||
private Optional<String> videoResolution = Optional.empty();
|
||||
|
||||
private String container;
|
||||
|
||||
private Optional<String> videoFrameRate = Optional.empty();
|
||||
|
||||
private Optional<String> videoProfile = Optional.empty();
|
||||
|
||||
private Optional<Boolean> hasVoiceActivity = Optional.empty();
|
||||
|
||||
private Optional<? extends GetSearchAllLibrariesOptimizedForStreaming> optimizedForStreaming;
|
||||
|
||||
private Optional<Boolean> has64bitOffsets = Optional.empty();
|
||||
|
||||
private List<GetSearchAllLibrariesPart> part;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder id(int id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder duration(int duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = Optional.ofNullable(duration);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder duration(Optional<Integer> duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = duration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder bitrate(int bitrate) {
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
this.bitrate = Optional.ofNullable(bitrate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder bitrate(Optional<Integer> bitrate) {
|
||||
Utils.checkNotNull(bitrate, "bitrate");
|
||||
this.bitrate = bitrate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder width(int width) {
|
||||
Utils.checkNotNull(width, "width");
|
||||
this.width = Optional.ofNullable(width);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder width(Optional<Integer> width) {
|
||||
Utils.checkNotNull(width, "width");
|
||||
this.width = width;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder height(int height) {
|
||||
Utils.checkNotNull(height, "height");
|
||||
this.height = Optional.ofNullable(height);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder height(Optional<Integer> height) {
|
||||
Utils.checkNotNull(height, "height");
|
||||
this.height = height;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder aspectRatio(double aspectRatio) {
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
this.aspectRatio = Optional.ofNullable(aspectRatio);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder aspectRatio(Optional<Double> aspectRatio) {
|
||||
Utils.checkNotNull(aspectRatio, "aspectRatio");
|
||||
this.aspectRatio = aspectRatio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioProfile(String audioProfile) {
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
this.audioProfile = Optional.ofNullable(audioProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioProfile(Optional<String> audioProfile) {
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
this.audioProfile = audioProfile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioChannels(int audioChannels) {
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
this.audioChannels = Optional.ofNullable(audioChannels);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioChannels(Optional<Integer> audioChannels) {
|
||||
Utils.checkNotNull(audioChannels, "audioChannels");
|
||||
this.audioChannels = audioChannels;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioCodec(String audioCodec) {
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
this.audioCodec = Optional.ofNullable(audioCodec);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioCodec(Optional<String> audioCodec) {
|
||||
Utils.checkNotNull(audioCodec, "audioCodec");
|
||||
this.audioCodec = audioCodec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoCodec(String videoCodec) {
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
this.videoCodec = Optional.ofNullable(videoCodec);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoCodec(Optional<String> videoCodec) {
|
||||
Utils.checkNotNull(videoCodec, "videoCodec");
|
||||
this.videoCodec = videoCodec;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoResolution(String videoResolution) {
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
this.videoResolution = Optional.ofNullable(videoResolution);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoResolution(Optional<String> videoResolution) {
|
||||
Utils.checkNotNull(videoResolution, "videoResolution");
|
||||
this.videoResolution = videoResolution;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder container(String container) {
|
||||
Utils.checkNotNull(container, "container");
|
||||
this.container = container;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoFrameRate(String videoFrameRate) {
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
this.videoFrameRate = Optional.ofNullable(videoFrameRate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoFrameRate(Optional<String> videoFrameRate) {
|
||||
Utils.checkNotNull(videoFrameRate, "videoFrameRate");
|
||||
this.videoFrameRate = videoFrameRate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoProfile(String videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = Optional.ofNullable(videoProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoProfile(Optional<String> videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = videoProfile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder hasVoiceActivity(boolean hasVoiceActivity) {
|
||||
Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity");
|
||||
this.hasVoiceActivity = Optional.ofNullable(hasVoiceActivity);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder hasVoiceActivity(Optional<Boolean> hasVoiceActivity) {
|
||||
Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity");
|
||||
this.hasVoiceActivity = hasVoiceActivity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder optimizedForStreaming(GetSearchAllLibrariesOptimizedForStreaming optimizedForStreaming) {
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder optimizedForStreaming(Optional<? extends GetSearchAllLibrariesOptimizedForStreaming> optimizedForStreaming) {
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
this.optimizedForStreaming = optimizedForStreaming;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder has64bitOffsets(boolean has64bitOffsets) {
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
this.has64bitOffsets = Optional.ofNullable(has64bitOffsets);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder has64bitOffsets(Optional<Boolean> has64bitOffsets) {
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
this.has64bitOffsets = has64bitOffsets;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder part(List<GetSearchAllLibrariesPart> part) {
|
||||
Utils.checkNotNull(part, "part");
|
||||
this.part = part;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMedia build() {
|
||||
if (optimizedForStreaming == null) {
|
||||
optimizedForStreaming = _SINGLETON_VALUE_OptimizedForStreaming.value();
|
||||
} return new GetSearchAllLibrariesMedia(
|
||||
id,
|
||||
duration,
|
||||
bitrate,
|
||||
width,
|
||||
height,
|
||||
aspectRatio,
|
||||
audioProfile,
|
||||
audioChannels,
|
||||
audioCodec,
|
||||
videoCodec,
|
||||
videoResolution,
|
||||
container,
|
||||
videoFrameRate,
|
||||
videoProfile,
|
||||
hasVoiceActivity,
|
||||
optimizedForStreaming,
|
||||
has64bitOffsets,
|
||||
part);
|
||||
}
|
||||
|
||||
private static final LazySingletonValue<Optional<? extends GetSearchAllLibrariesOptimizedForStreaming>> _SINGLETON_VALUE_OptimizedForStreaming =
|
||||
new LazySingletonValue<>(
|
||||
"optimizedForStreaming",
|
||||
"0",
|
||||
new TypeReference<Optional<? extends GetSearchAllLibrariesOptimizedForStreaming>>() {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Double;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesMediaContainer {
|
||||
|
||||
@JsonProperty("size")
|
||||
private double size;
|
||||
|
||||
@JsonProperty("SearchResult")
|
||||
private List<SearchResult> searchResult;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesMediaContainer(
|
||||
@JsonProperty("size") double size,
|
||||
@JsonProperty("SearchResult") List<SearchResult> searchResult) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
Utils.checkNotNull(searchResult, "searchResult");
|
||||
this.size = size;
|
||||
this.searchResult = searchResult;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public double size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<SearchResult> searchResult() {
|
||||
return searchResult;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMediaContainer withSize(double size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMediaContainer withSearchResult(List<SearchResult> searchResult) {
|
||||
Utils.checkNotNull(searchResult, "searchResult");
|
||||
this.searchResult = searchResult;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesMediaContainer other = (GetSearchAllLibrariesMediaContainer) o;
|
||||
return
|
||||
Objects.deepEquals(this.size, other.size) &&
|
||||
Objects.deepEquals(this.searchResult, other.searchResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
size,
|
||||
searchResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesMediaContainer.class,
|
||||
"size", size,
|
||||
"searchResult", searchResult);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Double size;
|
||||
|
||||
private List<SearchResult> searchResult;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder size(double size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder searchResult(List<SearchResult> searchResult) {
|
||||
Utils.checkNotNull(searchResult, "searchResult");
|
||||
this.searchResult = searchResult;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMediaContainer build() {
|
||||
return new GetSearchAllLibrariesMediaContainer(
|
||||
size,
|
||||
searchResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesMediaGuid {
|
||||
|
||||
/**
|
||||
* Can be one of the following formats:
|
||||
* imdb://tt13015952, tmdb://2434012, tvdb://7945991
|
||||
*
|
||||
*/
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesMediaGuid(
|
||||
@JsonProperty("id") String id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be one of the following formats:
|
||||
* imdb://tt13015952, tmdb://2434012, tvdb://7945991
|
||||
*
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be one of the following formats:
|
||||
* imdb://tt13015952, tmdb://2434012, tvdb://7945991
|
||||
*
|
||||
*/
|
||||
public GetSearchAllLibrariesMediaGuid withId(String id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesMediaGuid other = (GetSearchAllLibrariesMediaGuid) o;
|
||||
return
|
||||
Objects.deepEquals(this.id, other.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesMediaGuid.class,
|
||||
"id", id);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String id;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be one of the following formats:
|
||||
* imdb://tt13015952, tmdb://2434012, tvdb://7945991
|
||||
*
|
||||
*/
|
||||
public Builder id(String id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMediaGuid build() {
|
||||
return new GetSearchAllLibrariesMediaGuid(
|
||||
id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Float;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesMetaDataRating {
|
||||
|
||||
/**
|
||||
* A URI or path to the rating image.
|
||||
*/
|
||||
@JsonProperty("image")
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* The value of the rating.
|
||||
*/
|
||||
@JsonProperty("value")
|
||||
private float value;
|
||||
|
||||
/**
|
||||
* The type of rating (e.g., audience, critic).
|
||||
*/
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesMetaDataRating(
|
||||
@JsonProperty("image") String image,
|
||||
@JsonProperty("value") float value,
|
||||
@JsonProperty("type") String type) {
|
||||
Utils.checkNotNull(image, "image");
|
||||
Utils.checkNotNull(value, "value");
|
||||
Utils.checkNotNull(type, "type");
|
||||
this.image = image;
|
||||
this.value = value;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* A URI or path to the rating image.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String image() {
|
||||
return image;
|
||||
}
|
||||
|
||||
/**
|
||||
* The value of the rating.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public float value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of rating (e.g., audience, critic).
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String type() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* A URI or path to the rating image.
|
||||
*/
|
||||
public GetSearchAllLibrariesMetaDataRating withImage(String image) {
|
||||
Utils.checkNotNull(image, "image");
|
||||
this.image = image;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The value of the rating.
|
||||
*/
|
||||
public GetSearchAllLibrariesMetaDataRating withValue(float value) {
|
||||
Utils.checkNotNull(value, "value");
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of rating (e.g., audience, critic).
|
||||
*/
|
||||
public GetSearchAllLibrariesMetaDataRating withType(String type) {
|
||||
Utils.checkNotNull(type, "type");
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesMetaDataRating other = (GetSearchAllLibrariesMetaDataRating) o;
|
||||
return
|
||||
Objects.deepEquals(this.image, other.image) &&
|
||||
Objects.deepEquals(this.value, other.value) &&
|
||||
Objects.deepEquals(this.type, other.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
image,
|
||||
value,
|
||||
type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesMetaDataRating.class,
|
||||
"image", image,
|
||||
"value", value,
|
||||
"type", type);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String image;
|
||||
|
||||
private Float value;
|
||||
|
||||
private String type;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* A URI or path to the rating image.
|
||||
*/
|
||||
public Builder image(String image) {
|
||||
Utils.checkNotNull(image, "image");
|
||||
this.image = image;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The value of the rating.
|
||||
*/
|
||||
public Builder value(float value) {
|
||||
Utils.checkNotNull(value, "value");
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of rating (e.g., audience, critic).
|
||||
*/
|
||||
public Builder type(String type) {
|
||||
Utils.checkNotNull(type, "type");
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesMetaDataRating build() {
|
||||
return new GetSearchAllLibrariesMetaDataRating(
|
||||
image,
|
||||
value,
|
||||
type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
public enum GetSearchAllLibrariesOptimizedForStreaming {
|
||||
Disable(0),
|
||||
Enable(1);
|
||||
|
||||
@JsonValue
|
||||
private final int value;
|
||||
|
||||
private GetSearchAllLibrariesOptimizedForStreaming(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,586 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import dev.plexapi.sdk.utils.LazySingletonValue;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesPart {
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("duration")
|
||||
private Optional<Integer> duration;
|
||||
|
||||
@JsonProperty("file")
|
||||
private String file;
|
||||
|
||||
@JsonProperty("size")
|
||||
private long size;
|
||||
|
||||
/**
|
||||
* The container format of the media file.
|
||||
*
|
||||
*/
|
||||
@JsonProperty("container")
|
||||
private String container;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("audioProfile")
|
||||
private Optional<String> audioProfile;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("has64bitOffsets")
|
||||
private Optional<Boolean> has64bitOffsets;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("optimizedForStreaming")
|
||||
private Optional<Boolean> optimizedForStreaming;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("videoProfile")
|
||||
private Optional<String> videoProfile;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("indexes")
|
||||
private Optional<String> indexes;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("hasThumbnail")
|
||||
private Optional<? extends GetSearchAllLibrariesHasThumbnail> hasThumbnail;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("Stream")
|
||||
private Optional<? extends List<GetSearchAllLibrariesStream>> stream;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesPart(
|
||||
@JsonProperty("id") int id,
|
||||
@JsonProperty("key") String key,
|
||||
@JsonProperty("duration") Optional<Integer> duration,
|
||||
@JsonProperty("file") String file,
|
||||
@JsonProperty("size") long size,
|
||||
@JsonProperty("container") String container,
|
||||
@JsonProperty("audioProfile") Optional<String> audioProfile,
|
||||
@JsonProperty("has64bitOffsets") Optional<Boolean> has64bitOffsets,
|
||||
@JsonProperty("optimizedForStreaming") Optional<Boolean> optimizedForStreaming,
|
||||
@JsonProperty("videoProfile") Optional<String> videoProfile,
|
||||
@JsonProperty("indexes") Optional<String> indexes,
|
||||
@JsonProperty("hasThumbnail") Optional<? extends GetSearchAllLibrariesHasThumbnail> hasThumbnail,
|
||||
@JsonProperty("Stream") Optional<? extends List<GetSearchAllLibrariesStream>> stream) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
Utils.checkNotNull(key, "key");
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
Utils.checkNotNull(file, "file");
|
||||
Utils.checkNotNull(size, "size");
|
||||
Utils.checkNotNull(container, "container");
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
Utils.checkNotNull(indexes, "indexes");
|
||||
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
|
||||
Utils.checkNotNull(stream, "stream");
|
||||
this.id = id;
|
||||
this.key = key;
|
||||
this.duration = duration;
|
||||
this.file = file;
|
||||
this.size = size;
|
||||
this.container = container;
|
||||
this.audioProfile = audioProfile;
|
||||
this.has64bitOffsets = has64bitOffsets;
|
||||
this.optimizedForStreaming = optimizedForStreaming;
|
||||
this.videoProfile = videoProfile;
|
||||
this.indexes = indexes;
|
||||
this.hasThumbnail = hasThumbnail;
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart(
|
||||
int id,
|
||||
String key,
|
||||
String file,
|
||||
long size,
|
||||
String container) {
|
||||
this(id, key, Optional.empty(), file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String key() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Integer> duration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String file() {
|
||||
return file;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public long size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* The container format of the media file.
|
||||
*
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String container() {
|
||||
return container;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> audioProfile() {
|
||||
return audioProfile;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Boolean> has64bitOffsets() {
|
||||
return has64bitOffsets;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<Boolean> optimizedForStreaming() {
|
||||
return optimizedForStreaming;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> videoProfile() {
|
||||
return videoProfile;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> indexes() {
|
||||
return indexes;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<GetSearchAllLibrariesHasThumbnail> hasThumbnail() {
|
||||
return (Optional<GetSearchAllLibrariesHasThumbnail>) hasThumbnail;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<List<GetSearchAllLibrariesStream>> stream() {
|
||||
return (Optional<List<GetSearchAllLibrariesStream>>) stream;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withId(int id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withKey(String key) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withDuration(int duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = Optional.ofNullable(duration);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withDuration(Optional<Integer> duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = duration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withFile(String file) {
|
||||
Utils.checkNotNull(file, "file");
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withSize(long size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The container format of the media file.
|
||||
*
|
||||
*/
|
||||
public GetSearchAllLibrariesPart withContainer(String container) {
|
||||
Utils.checkNotNull(container, "container");
|
||||
this.container = container;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withAudioProfile(String audioProfile) {
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
this.audioProfile = Optional.ofNullable(audioProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withAudioProfile(Optional<String> audioProfile) {
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
this.audioProfile = audioProfile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withHas64bitOffsets(boolean has64bitOffsets) {
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
this.has64bitOffsets = Optional.ofNullable(has64bitOffsets);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withHas64bitOffsets(Optional<Boolean> has64bitOffsets) {
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
this.has64bitOffsets = has64bitOffsets;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withOptimizedForStreaming(boolean optimizedForStreaming) {
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withOptimizedForStreaming(Optional<Boolean> optimizedForStreaming) {
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
this.optimizedForStreaming = optimizedForStreaming;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withVideoProfile(String videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = Optional.ofNullable(videoProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withVideoProfile(Optional<String> videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = videoProfile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withIndexes(String indexes) {
|
||||
Utils.checkNotNull(indexes, "indexes");
|
||||
this.indexes = Optional.ofNullable(indexes);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withIndexes(Optional<String> indexes) {
|
||||
Utils.checkNotNull(indexes, "indexes");
|
||||
this.indexes = indexes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withHasThumbnail(GetSearchAllLibrariesHasThumbnail hasThumbnail) {
|
||||
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
|
||||
this.hasThumbnail = Optional.ofNullable(hasThumbnail);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withHasThumbnail(Optional<? extends GetSearchAllLibrariesHasThumbnail> hasThumbnail) {
|
||||
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
|
||||
this.hasThumbnail = hasThumbnail;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withStream(List<GetSearchAllLibrariesStream> stream) {
|
||||
Utils.checkNotNull(stream, "stream");
|
||||
this.stream = Optional.ofNullable(stream);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart withStream(Optional<? extends List<GetSearchAllLibrariesStream>> stream) {
|
||||
Utils.checkNotNull(stream, "stream");
|
||||
this.stream = stream;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesPart other = (GetSearchAllLibrariesPart) o;
|
||||
return
|
||||
Objects.deepEquals(this.id, other.id) &&
|
||||
Objects.deepEquals(this.key, other.key) &&
|
||||
Objects.deepEquals(this.duration, other.duration) &&
|
||||
Objects.deepEquals(this.file, other.file) &&
|
||||
Objects.deepEquals(this.size, other.size) &&
|
||||
Objects.deepEquals(this.container, other.container) &&
|
||||
Objects.deepEquals(this.audioProfile, other.audioProfile) &&
|
||||
Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) &&
|
||||
Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) &&
|
||||
Objects.deepEquals(this.videoProfile, other.videoProfile) &&
|
||||
Objects.deepEquals(this.indexes, other.indexes) &&
|
||||
Objects.deepEquals(this.hasThumbnail, other.hasThumbnail) &&
|
||||
Objects.deepEquals(this.stream, other.stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
key,
|
||||
duration,
|
||||
file,
|
||||
size,
|
||||
container,
|
||||
audioProfile,
|
||||
has64bitOffsets,
|
||||
optimizedForStreaming,
|
||||
videoProfile,
|
||||
indexes,
|
||||
hasThumbnail,
|
||||
stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesPart.class,
|
||||
"id", id,
|
||||
"key", key,
|
||||
"duration", duration,
|
||||
"file", file,
|
||||
"size", size,
|
||||
"container", container,
|
||||
"audioProfile", audioProfile,
|
||||
"has64bitOffsets", has64bitOffsets,
|
||||
"optimizedForStreaming", optimizedForStreaming,
|
||||
"videoProfile", videoProfile,
|
||||
"indexes", indexes,
|
||||
"hasThumbnail", hasThumbnail,
|
||||
"stream", stream);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String key;
|
||||
|
||||
private Optional<Integer> duration = Optional.empty();
|
||||
|
||||
private String file;
|
||||
|
||||
private Long size;
|
||||
|
||||
private String container;
|
||||
|
||||
private Optional<String> audioProfile = Optional.empty();
|
||||
|
||||
private Optional<Boolean> has64bitOffsets = Optional.empty();
|
||||
|
||||
private Optional<Boolean> optimizedForStreaming = Optional.empty();
|
||||
|
||||
private Optional<String> videoProfile = Optional.empty();
|
||||
|
||||
private Optional<String> indexes = Optional.empty();
|
||||
|
||||
private Optional<? extends GetSearchAllLibrariesHasThumbnail> hasThumbnail;
|
||||
|
||||
private Optional<? extends List<GetSearchAllLibrariesStream>> stream = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder id(int id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder key(String key) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder duration(int duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = Optional.ofNullable(duration);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder duration(Optional<Integer> duration) {
|
||||
Utils.checkNotNull(duration, "duration");
|
||||
this.duration = duration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder file(String file) {
|
||||
Utils.checkNotNull(file, "file");
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder size(long size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The container format of the media file.
|
||||
*
|
||||
*/
|
||||
public Builder container(String container) {
|
||||
Utils.checkNotNull(container, "container");
|
||||
this.container = container;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioProfile(String audioProfile) {
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
this.audioProfile = Optional.ofNullable(audioProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder audioProfile(Optional<String> audioProfile) {
|
||||
Utils.checkNotNull(audioProfile, "audioProfile");
|
||||
this.audioProfile = audioProfile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder has64bitOffsets(boolean has64bitOffsets) {
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
this.has64bitOffsets = Optional.ofNullable(has64bitOffsets);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder has64bitOffsets(Optional<Boolean> has64bitOffsets) {
|
||||
Utils.checkNotNull(has64bitOffsets, "has64bitOffsets");
|
||||
this.has64bitOffsets = has64bitOffsets;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder optimizedForStreaming(boolean optimizedForStreaming) {
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder optimizedForStreaming(Optional<Boolean> optimizedForStreaming) {
|
||||
Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming");
|
||||
this.optimizedForStreaming = optimizedForStreaming;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoProfile(String videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = Optional.ofNullable(videoProfile);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder videoProfile(Optional<String> videoProfile) {
|
||||
Utils.checkNotNull(videoProfile, "videoProfile");
|
||||
this.videoProfile = videoProfile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder indexes(String indexes) {
|
||||
Utils.checkNotNull(indexes, "indexes");
|
||||
this.indexes = Optional.ofNullable(indexes);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder indexes(Optional<String> indexes) {
|
||||
Utils.checkNotNull(indexes, "indexes");
|
||||
this.indexes = indexes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder hasThumbnail(GetSearchAllLibrariesHasThumbnail hasThumbnail) {
|
||||
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
|
||||
this.hasThumbnail = Optional.ofNullable(hasThumbnail);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder hasThumbnail(Optional<? extends GetSearchAllLibrariesHasThumbnail> hasThumbnail) {
|
||||
Utils.checkNotNull(hasThumbnail, "hasThumbnail");
|
||||
this.hasThumbnail = hasThumbnail;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder stream(List<GetSearchAllLibrariesStream> stream) {
|
||||
Utils.checkNotNull(stream, "stream");
|
||||
this.stream = Optional.ofNullable(stream);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder stream(Optional<? extends List<GetSearchAllLibrariesStream>> stream) {
|
||||
Utils.checkNotNull(stream, "stream");
|
||||
this.stream = stream;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesPart build() {
|
||||
if (hasThumbnail == null) {
|
||||
hasThumbnail = _SINGLETON_VALUE_HasThumbnail.value();
|
||||
} return new GetSearchAllLibrariesPart(
|
||||
id,
|
||||
key,
|
||||
duration,
|
||||
file,
|
||||
size,
|
||||
container,
|
||||
audioProfile,
|
||||
has64bitOffsets,
|
||||
optimizedForStreaming,
|
||||
videoProfile,
|
||||
indexes,
|
||||
hasThumbnail,
|
||||
stream);
|
||||
}
|
||||
|
||||
private static final LazySingletonValue<Optional<? extends GetSearchAllLibrariesHasThumbnail>> _SINGLETON_VALUE_HasThumbnail =
|
||||
new LazySingletonValue<>(
|
||||
"hasThumbnail",
|
||||
"\"0\"",
|
||||
new TypeReference<Optional<? extends GetSearchAllLibrariesHasThumbnail>>() {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import dev.plexapi.sdk.utils.LazySingletonValue;
|
||||
import dev.plexapi.sdk.utils.SpeakeasyMetadata;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesRequest {
|
||||
|
||||
/**
|
||||
* The search query term.
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")
|
||||
private String query;
|
||||
|
||||
/**
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")
|
||||
private Optional<String> clientID;
|
||||
|
||||
/**
|
||||
* Limit the number of results returned.
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit")
|
||||
private Optional<Long> limit;
|
||||
|
||||
/**
|
||||
* A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
|
||||
*
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=false,name=searchTypes")
|
||||
private Optional<? extends List<SearchTypes>> searchTypes;
|
||||
|
||||
/**
|
||||
* Whether to include collections in the search results.
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeCollections")
|
||||
private Optional<? extends QueryParamIncludeCollections> includeCollections;
|
||||
|
||||
/**
|
||||
* Whether to include external media in the search results.
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeExternalMedia")
|
||||
private Optional<? extends QueryParamIncludeExternalMedia> includeExternalMedia;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesRequest(
|
||||
String query,
|
||||
Optional<String> clientID,
|
||||
Optional<Long> limit,
|
||||
Optional<? extends List<SearchTypes>> searchTypes,
|
||||
Optional<? extends QueryParamIncludeCollections> includeCollections,
|
||||
Optional<? extends QueryParamIncludeExternalMedia> includeExternalMedia) {
|
||||
Utils.checkNotNull(query, "query");
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
Utils.checkNotNull(limit, "limit");
|
||||
Utils.checkNotNull(searchTypes, "searchTypes");
|
||||
Utils.checkNotNull(includeCollections, "includeCollections");
|
||||
Utils.checkNotNull(includeExternalMedia, "includeExternalMedia");
|
||||
this.query = query;
|
||||
this.clientID = clientID;
|
||||
this.limit = limit;
|
||||
this.searchTypes = searchTypes;
|
||||
this.includeCollections = includeCollections;
|
||||
this.includeExternalMedia = includeExternalMedia;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesRequest(
|
||||
String query) {
|
||||
this(query, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* The search query term.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String query() {
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> clientID() {
|
||||
return clientID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit the number of results returned.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<Long> limit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<List<SearchTypes>> searchTypes() {
|
||||
return (Optional<List<SearchTypes>>) searchTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include collections in the search results.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<QueryParamIncludeCollections> includeCollections() {
|
||||
return (Optional<QueryParamIncludeCollections>) includeCollections;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include external media in the search results.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<QueryParamIncludeExternalMedia> includeExternalMedia() {
|
||||
return (Optional<QueryParamIncludeExternalMedia>) includeExternalMedia;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* The search query term.
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withQuery(String query) {
|
||||
Utils.checkNotNull(query, "query");
|
||||
this.query = query;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withClientID(String clientID) {
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
this.clientID = Optional.ofNullable(clientID);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withClientID(Optional<String> clientID) {
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
this.clientID = clientID;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit the number of results returned.
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withLimit(long limit) {
|
||||
Utils.checkNotNull(limit, "limit");
|
||||
this.limit = Optional.ofNullable(limit);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit the number of results returned.
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withLimit(Optional<Long> limit) {
|
||||
Utils.checkNotNull(limit, "limit");
|
||||
this.limit = limit;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
|
||||
*
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withSearchTypes(List<SearchTypes> searchTypes) {
|
||||
Utils.checkNotNull(searchTypes, "searchTypes");
|
||||
this.searchTypes = Optional.ofNullable(searchTypes);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
|
||||
*
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withSearchTypes(Optional<? extends List<SearchTypes>> searchTypes) {
|
||||
Utils.checkNotNull(searchTypes, "searchTypes");
|
||||
this.searchTypes = searchTypes;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include collections in the search results.
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withIncludeCollections(QueryParamIncludeCollections includeCollections) {
|
||||
Utils.checkNotNull(includeCollections, "includeCollections");
|
||||
this.includeCollections = Optional.ofNullable(includeCollections);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include collections in the search results.
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withIncludeCollections(Optional<? extends QueryParamIncludeCollections> includeCollections) {
|
||||
Utils.checkNotNull(includeCollections, "includeCollections");
|
||||
this.includeCollections = includeCollections;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include external media in the search results.
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withIncludeExternalMedia(QueryParamIncludeExternalMedia includeExternalMedia) {
|
||||
Utils.checkNotNull(includeExternalMedia, "includeExternalMedia");
|
||||
this.includeExternalMedia = Optional.ofNullable(includeExternalMedia);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include external media in the search results.
|
||||
*/
|
||||
public GetSearchAllLibrariesRequest withIncludeExternalMedia(Optional<? extends QueryParamIncludeExternalMedia> includeExternalMedia) {
|
||||
Utils.checkNotNull(includeExternalMedia, "includeExternalMedia");
|
||||
this.includeExternalMedia = includeExternalMedia;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesRequest other = (GetSearchAllLibrariesRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.query, other.query) &&
|
||||
Objects.deepEquals(this.clientID, other.clientID) &&
|
||||
Objects.deepEquals(this.limit, other.limit) &&
|
||||
Objects.deepEquals(this.searchTypes, other.searchTypes) &&
|
||||
Objects.deepEquals(this.includeCollections, other.includeCollections) &&
|
||||
Objects.deepEquals(this.includeExternalMedia, other.includeExternalMedia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
query,
|
||||
clientID,
|
||||
limit,
|
||||
searchTypes,
|
||||
includeCollections,
|
||||
includeExternalMedia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesRequest.class,
|
||||
"query", query,
|
||||
"clientID", clientID,
|
||||
"limit", limit,
|
||||
"searchTypes", searchTypes,
|
||||
"includeCollections", includeCollections,
|
||||
"includeExternalMedia", includeExternalMedia);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String query;
|
||||
|
||||
private Optional<String> clientID = Optional.empty();
|
||||
|
||||
private Optional<Long> limit = Optional.empty();
|
||||
|
||||
private Optional<? extends List<SearchTypes>> searchTypes = Optional.empty();
|
||||
|
||||
private Optional<? extends QueryParamIncludeCollections> includeCollections;
|
||||
|
||||
private Optional<? extends QueryParamIncludeExternalMedia> includeExternalMedia;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* The search query term.
|
||||
*/
|
||||
public Builder query(String query) {
|
||||
Utils.checkNotNull(query, "query");
|
||||
this.query = query;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
public Builder clientID(String clientID) {
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
this.clientID = Optional.ofNullable(clientID);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
*/
|
||||
public Builder clientID(Optional<String> clientID) {
|
||||
Utils.checkNotNull(clientID, "clientID");
|
||||
this.clientID = clientID;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit the number of results returned.
|
||||
*/
|
||||
public Builder limit(long limit) {
|
||||
Utils.checkNotNull(limit, "limit");
|
||||
this.limit = Optional.ofNullable(limit);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit the number of results returned.
|
||||
*/
|
||||
public Builder limit(Optional<Long> limit) {
|
||||
Utils.checkNotNull(limit, "limit");
|
||||
this.limit = limit;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
|
||||
*
|
||||
*/
|
||||
public Builder searchTypes(List<SearchTypes> searchTypes) {
|
||||
Utils.checkNotNull(searchTypes, "searchTypes");
|
||||
this.searchTypes = Optional.ofNullable(searchTypes);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
|
||||
*
|
||||
*/
|
||||
public Builder searchTypes(Optional<? extends List<SearchTypes>> searchTypes) {
|
||||
Utils.checkNotNull(searchTypes, "searchTypes");
|
||||
this.searchTypes = searchTypes;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include collections in the search results.
|
||||
*/
|
||||
public Builder includeCollections(QueryParamIncludeCollections includeCollections) {
|
||||
Utils.checkNotNull(includeCollections, "includeCollections");
|
||||
this.includeCollections = Optional.ofNullable(includeCollections);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include collections in the search results.
|
||||
*/
|
||||
public Builder includeCollections(Optional<? extends QueryParamIncludeCollections> includeCollections) {
|
||||
Utils.checkNotNull(includeCollections, "includeCollections");
|
||||
this.includeCollections = includeCollections;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include external media in the search results.
|
||||
*/
|
||||
public Builder includeExternalMedia(QueryParamIncludeExternalMedia includeExternalMedia) {
|
||||
Utils.checkNotNull(includeExternalMedia, "includeExternalMedia");
|
||||
this.includeExternalMedia = Optional.ofNullable(includeExternalMedia);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to include external media in the search results.
|
||||
*/
|
||||
public Builder includeExternalMedia(Optional<? extends QueryParamIncludeExternalMedia> includeExternalMedia) {
|
||||
Utils.checkNotNull(includeExternalMedia, "includeExternalMedia");
|
||||
this.includeExternalMedia = includeExternalMedia;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesRequest build() {
|
||||
if (includeCollections == null) {
|
||||
includeCollections = _SINGLETON_VALUE_IncludeCollections.value();
|
||||
}
|
||||
if (includeExternalMedia == null) {
|
||||
includeExternalMedia = _SINGLETON_VALUE_IncludeExternalMedia.value();
|
||||
} return new GetSearchAllLibrariesRequest(
|
||||
query,
|
||||
clientID,
|
||||
limit,
|
||||
searchTypes,
|
||||
includeCollections,
|
||||
includeExternalMedia);
|
||||
}
|
||||
|
||||
private static final LazySingletonValue<Optional<? extends QueryParamIncludeCollections>> _SINGLETON_VALUE_IncludeCollections =
|
||||
new LazySingletonValue<>(
|
||||
"includeCollections",
|
||||
"0",
|
||||
new TypeReference<Optional<? extends QueryParamIncludeCollections>>() {});
|
||||
|
||||
private static final LazySingletonValue<Optional<? extends QueryParamIncludeExternalMedia>> _SINGLETON_VALUE_IncludeExternalMedia =
|
||||
new LazySingletonValue<>(
|
||||
"includeExternalMedia",
|
||||
"0",
|
||||
new TypeReference<Optional<? extends QueryParamIncludeExternalMedia>>() {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
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 GetSearchAllLibrariesRequestBuilder {
|
||||
|
||||
private GetSearchAllLibrariesRequest request;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk;
|
||||
|
||||
public GetSearchAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk) {
|
||||
this.sdk = sdk;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesRequestBuilder request(GetSearchAllLibrariesRequest request) {
|
||||
Utils.checkNotNull(request, "request");
|
||||
this.request = request;
|
||||
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 {
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getSearchAllLibraries(
|
||||
request,
|
||||
options);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.Response;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesResponse implements Response {
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
private int statusCode;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
/**
|
||||
* The libraries available on the Server
|
||||
*/
|
||||
private Optional<? extends GetSearchAllLibrariesResponseBody> object;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesResponse(
|
||||
String contentType,
|
||||
int statusCode,
|
||||
HttpResponse<InputStream> rawResponse,
|
||||
Optional<? extends GetSearchAllLibrariesResponseBody> object) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.contentType = contentType;
|
||||
this.statusCode = statusCode;
|
||||
this.rawResponse = rawResponse;
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesResponse(
|
||||
String contentType,
|
||||
int statusCode,
|
||||
HttpResponse<InputStream> rawResponse) {
|
||||
this(contentType, statusCode, rawResponse, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String contentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int statusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonIgnore
|
||||
public HttpResponse<InputStream> rawResponse() {
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* The libraries available on the Server
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<GetSearchAllLibrariesResponseBody> object() {
|
||||
return (Optional<GetSearchAllLibrariesResponseBody>) object;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public GetSearchAllLibrariesResponse withContentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public GetSearchAllLibrariesResponse withStatusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSearchAllLibrariesResponse withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The libraries available on the Server
|
||||
*/
|
||||
public GetSearchAllLibrariesResponse withObject(GetSearchAllLibrariesResponseBody object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = Optional.ofNullable(object);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The libraries available on the Server
|
||||
*/
|
||||
public GetSearchAllLibrariesResponse withObject(Optional<? extends GetSearchAllLibrariesResponseBody> object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesResponse other = (GetSearchAllLibrariesResponse) o;
|
||||
return
|
||||
Objects.deepEquals(this.contentType, other.contentType) &&
|
||||
Objects.deepEquals(this.statusCode, other.statusCode) &&
|
||||
Objects.deepEquals(this.rawResponse, other.rawResponse) &&
|
||||
Objects.deepEquals(this.object, other.object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse,
|
||||
object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesResponse.class,
|
||||
"contentType", contentType,
|
||||
"statusCode", statusCode,
|
||||
"rawResponse", rawResponse,
|
||||
"object", object);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String contentType;
|
||||
|
||||
private Integer statusCode;
|
||||
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
private Optional<? extends GetSearchAllLibrariesResponseBody> object = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public Builder contentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public Builder statusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The libraries available on the Server
|
||||
*/
|
||||
public Builder object(GetSearchAllLibrariesResponseBody object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = Optional.ofNullable(object);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The libraries available on the Server
|
||||
*/
|
||||
public Builder object(Optional<? extends GetSearchAllLibrariesResponseBody> object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesResponse build() {
|
||||
return new GetSearchAllLibrariesResponse(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse,
|
||||
object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* GetSearchAllLibrariesResponseBody - The libraries available on the Server
|
||||
*/
|
||||
|
||||
public class GetSearchAllLibrariesResponseBody {
|
||||
|
||||
@JsonProperty("MediaContainer")
|
||||
private GetSearchAllLibrariesMediaContainer mediaContainer;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesResponseBody(
|
||||
@JsonProperty("MediaContainer") GetSearchAllLibrariesMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public GetSearchAllLibrariesMediaContainer mediaContainer() {
|
||||
return mediaContainer;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesResponseBody withMediaContainer(GetSearchAllLibrariesMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesResponseBody other = (GetSearchAllLibrariesResponseBody) o;
|
||||
return
|
||||
Objects.deepEquals(this.mediaContainer, other.mediaContainer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
mediaContainer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesResponseBody.class,
|
||||
"mediaContainer", mediaContainer);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private GetSearchAllLibrariesMediaContainer mediaContainer;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder mediaContainer(GetSearchAllLibrariesMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesResponseBody build() {
|
||||
return new GetSearchAllLibrariesResponseBody(
|
||||
mediaContainer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,428 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesRole {
|
||||
|
||||
/**
|
||||
* The ID of the tag or actor.
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("id")
|
||||
private Optional<Long> id;
|
||||
|
||||
/**
|
||||
* The filter used to find the actor or tag.
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("filter")
|
||||
private Optional<String> filter;
|
||||
|
||||
/**
|
||||
* The thumbnail of the actor
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("thumb")
|
||||
private Optional<String> thumb;
|
||||
|
||||
/**
|
||||
* The name of the tag or actor.
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("tag")
|
||||
private Optional<String> tag;
|
||||
|
||||
/**
|
||||
* Unique identifier for the tag.
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("tagKey")
|
||||
private Optional<String> tagKey;
|
||||
|
||||
/**
|
||||
* The role of the actor or tag in the media.
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("role")
|
||||
private Optional<String> role;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesRole(
|
||||
@JsonProperty("id") Optional<Long> id,
|
||||
@JsonProperty("filter") Optional<String> filter,
|
||||
@JsonProperty("thumb") Optional<String> thumb,
|
||||
@JsonProperty("tag") Optional<String> tag,
|
||||
@JsonProperty("tagKey") Optional<String> tagKey,
|
||||
@JsonProperty("role") Optional<String> role) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
Utils.checkNotNull(filter, "filter");
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
Utils.checkNotNull(tagKey, "tagKey");
|
||||
Utils.checkNotNull(role, "role");
|
||||
this.id = id;
|
||||
this.filter = filter;
|
||||
this.thumb = thumb;
|
||||
this.tag = tag;
|
||||
this.tagKey = tagKey;
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesRole() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the tag or actor.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<Long> id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The filter used to find the actor or tag.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> filter() {
|
||||
return filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* The thumbnail of the actor
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> thumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the tag or actor.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> tag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier for the tag.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> tagKey() {
|
||||
return tagKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* The role of the actor or tag in the media.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> role() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the tag or actor.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withId(long id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = Optional.ofNullable(id);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the tag or actor.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withId(Optional<Long> id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The filter used to find the actor or tag.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withFilter(String filter) {
|
||||
Utils.checkNotNull(filter, "filter");
|
||||
this.filter = Optional.ofNullable(filter);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The filter used to find the actor or tag.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withFilter(Optional<String> filter) {
|
||||
Utils.checkNotNull(filter, "filter");
|
||||
this.filter = filter;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The thumbnail of the actor
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withThumb(String thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = Optional.ofNullable(thumb);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The thumbnail of the actor
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withThumb(Optional<String> thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the tag or actor.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withTag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the tag or actor.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withTag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier for the tag.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withTagKey(String tagKey) {
|
||||
Utils.checkNotNull(tagKey, "tagKey");
|
||||
this.tagKey = Optional.ofNullable(tagKey);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier for the tag.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withTagKey(Optional<String> tagKey) {
|
||||
Utils.checkNotNull(tagKey, "tagKey");
|
||||
this.tagKey = tagKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The role of the actor or tag in the media.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withRole(String role) {
|
||||
Utils.checkNotNull(role, "role");
|
||||
this.role = Optional.ofNullable(role);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The role of the actor or tag in the media.
|
||||
*/
|
||||
public GetSearchAllLibrariesRole withRole(Optional<String> role) {
|
||||
Utils.checkNotNull(role, "role");
|
||||
this.role = role;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesRole other = (GetSearchAllLibrariesRole) o;
|
||||
return
|
||||
Objects.deepEquals(this.id, other.id) &&
|
||||
Objects.deepEquals(this.filter, other.filter) &&
|
||||
Objects.deepEquals(this.thumb, other.thumb) &&
|
||||
Objects.deepEquals(this.tag, other.tag) &&
|
||||
Objects.deepEquals(this.tagKey, other.tagKey) &&
|
||||
Objects.deepEquals(this.role, other.role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
filter,
|
||||
thumb,
|
||||
tag,
|
||||
tagKey,
|
||||
role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesRole.class,
|
||||
"id", id,
|
||||
"filter", filter,
|
||||
"thumb", thumb,
|
||||
"tag", tag,
|
||||
"tagKey", tagKey,
|
||||
"role", role);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<Long> id = Optional.empty();
|
||||
|
||||
private Optional<String> filter = Optional.empty();
|
||||
|
||||
private Optional<String> thumb = Optional.empty();
|
||||
|
||||
private Optional<String> tag = Optional.empty();
|
||||
|
||||
private Optional<String> tagKey = Optional.empty();
|
||||
|
||||
private Optional<String> role = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the tag or actor.
|
||||
*/
|
||||
public Builder id(long id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = Optional.ofNullable(id);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the tag or actor.
|
||||
*/
|
||||
public Builder id(Optional<Long> id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The filter used to find the actor or tag.
|
||||
*/
|
||||
public Builder filter(String filter) {
|
||||
Utils.checkNotNull(filter, "filter");
|
||||
this.filter = Optional.ofNullable(filter);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The filter used to find the actor or tag.
|
||||
*/
|
||||
public Builder filter(Optional<String> filter) {
|
||||
Utils.checkNotNull(filter, "filter");
|
||||
this.filter = filter;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The thumbnail of the actor
|
||||
*/
|
||||
public Builder thumb(String thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = Optional.ofNullable(thumb);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The thumbnail of the actor
|
||||
*/
|
||||
public Builder thumb(Optional<String> thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the tag or actor.
|
||||
*/
|
||||
public Builder tag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the tag or actor.
|
||||
*/
|
||||
public Builder tag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier for the tag.
|
||||
*/
|
||||
public Builder tagKey(String tagKey) {
|
||||
Utils.checkNotNull(tagKey, "tagKey");
|
||||
this.tagKey = Optional.ofNullable(tagKey);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier for the tag.
|
||||
*/
|
||||
public Builder tagKey(Optional<String> tagKey) {
|
||||
Utils.checkNotNull(tagKey, "tagKey");
|
||||
this.tagKey = tagKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The role of the actor or tag in the media.
|
||||
*/
|
||||
public Builder role(String role) {
|
||||
Utils.checkNotNull(role, "role");
|
||||
this.role = Optional.ofNullable(role);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The role of the actor or tag in the media.
|
||||
*/
|
||||
public Builder role(Optional<String> role) {
|
||||
Utils.checkNotNull(role, "role");
|
||||
this.role = role;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesRole build() {
|
||||
return new GetSearchAllLibrariesRole(
|
||||
id,
|
||||
filter,
|
||||
thumb,
|
||||
tag,
|
||||
tagKey,
|
||||
role);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.lang.String;
|
||||
|
||||
/**
|
||||
* GetSearchAllLibrariesShowOrdering - Setting that indicates the episode ordering for the show
|
||||
* None = Library default,
|
||||
* tmdbAiring = The Movie Database (Aired),
|
||||
* aired = TheTVDB (Aired),
|
||||
* dvd = TheTVDB (DVD),
|
||||
* absolute = TheTVDB (Absolute)).
|
||||
*
|
||||
*/
|
||||
public enum GetSearchAllLibrariesShowOrdering {
|
||||
None("None"),
|
||||
TmdbAiring("tmdbAiring"),
|
||||
Aired("aired"),
|
||||
Dvd("dvd"),
|
||||
Absolute("absolute");
|
||||
|
||||
@JsonValue
|
||||
private final String value;
|
||||
|
||||
private GetSearchAllLibrariesShowOrdering(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.lang.String;
|
||||
|
||||
/**
|
||||
* GetSearchAllLibrariesType - The type of media content
|
||||
*
|
||||
*/
|
||||
public enum GetSearchAllLibrariesType {
|
||||
Movie("movie"),
|
||||
TvShow("show"),
|
||||
Season("season"),
|
||||
Episode("episode");
|
||||
|
||||
@JsonValue
|
||||
private final String value;
|
||||
|
||||
private GetSearchAllLibrariesType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesUltraBlurColors {
|
||||
|
||||
@JsonProperty("topLeft")
|
||||
private String topLeft;
|
||||
|
||||
@JsonProperty("topRight")
|
||||
private String topRight;
|
||||
|
||||
@JsonProperty("bottomRight")
|
||||
private String bottomRight;
|
||||
|
||||
@JsonProperty("bottomLeft")
|
||||
private String bottomLeft;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesUltraBlurColors(
|
||||
@JsonProperty("topLeft") String topLeft,
|
||||
@JsonProperty("topRight") String topRight,
|
||||
@JsonProperty("bottomRight") String bottomRight,
|
||||
@JsonProperty("bottomLeft") String bottomLeft) {
|
||||
Utils.checkNotNull(topLeft, "topLeft");
|
||||
Utils.checkNotNull(topRight, "topRight");
|
||||
Utils.checkNotNull(bottomRight, "bottomRight");
|
||||
Utils.checkNotNull(bottomLeft, "bottomLeft");
|
||||
this.topLeft = topLeft;
|
||||
this.topRight = topRight;
|
||||
this.bottomRight = bottomRight;
|
||||
this.bottomLeft = bottomLeft;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String topLeft() {
|
||||
return topLeft;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String topRight() {
|
||||
return topRight;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String bottomRight() {
|
||||
return bottomRight;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String bottomLeft() {
|
||||
return bottomLeft;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUltraBlurColors withTopLeft(String topLeft) {
|
||||
Utils.checkNotNull(topLeft, "topLeft");
|
||||
this.topLeft = topLeft;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUltraBlurColors withTopRight(String topRight) {
|
||||
Utils.checkNotNull(topRight, "topRight");
|
||||
this.topRight = topRight;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUltraBlurColors withBottomRight(String bottomRight) {
|
||||
Utils.checkNotNull(bottomRight, "bottomRight");
|
||||
this.bottomRight = bottomRight;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUltraBlurColors withBottomLeft(String bottomLeft) {
|
||||
Utils.checkNotNull(bottomLeft, "bottomLeft");
|
||||
this.bottomLeft = bottomLeft;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesUltraBlurColors other = (GetSearchAllLibrariesUltraBlurColors) o;
|
||||
return
|
||||
Objects.deepEquals(this.topLeft, other.topLeft) &&
|
||||
Objects.deepEquals(this.topRight, other.topRight) &&
|
||||
Objects.deepEquals(this.bottomRight, other.bottomRight) &&
|
||||
Objects.deepEquals(this.bottomLeft, other.bottomLeft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
topLeft,
|
||||
topRight,
|
||||
bottomRight,
|
||||
bottomLeft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesUltraBlurColors.class,
|
||||
"topLeft", topLeft,
|
||||
"topRight", topRight,
|
||||
"bottomRight", bottomRight,
|
||||
"bottomLeft", bottomLeft);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String topLeft;
|
||||
|
||||
private String topRight;
|
||||
|
||||
private String bottomRight;
|
||||
|
||||
private String bottomLeft;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder topLeft(String topLeft) {
|
||||
Utils.checkNotNull(topLeft, "topLeft");
|
||||
this.topLeft = topLeft;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder topRight(String topRight) {
|
||||
Utils.checkNotNull(topRight, "topRight");
|
||||
this.topRight = topRight;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder bottomRight(String bottomRight) {
|
||||
Utils.checkNotNull(bottomRight, "bottomRight");
|
||||
this.bottomRight = bottomRight;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder bottomLeft(String bottomLeft) {
|
||||
Utils.checkNotNull(bottomLeft, "bottomLeft");
|
||||
this.bottomLeft = bottomLeft;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesUltraBlurColors build() {
|
||||
return new GetSearchAllLibrariesUltraBlurColors(
|
||||
topLeft,
|
||||
topRight,
|
||||
bottomRight,
|
||||
bottomLeft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public class GetSearchAllLibrariesWriter {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("tag")
|
||||
private Optional<String> tag;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchAllLibrariesWriter(
|
||||
@JsonProperty("tag") Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesWriter() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Optional<String> tag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesWriter withTag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesWriter withTag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetSearchAllLibrariesWriter other = (GetSearchAllLibrariesWriter) o;
|
||||
return
|
||||
Objects.deepEquals(this.tag, other.tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchAllLibrariesWriter.class,
|
||||
"tag", tag);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<String> tag = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder tag(String tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = Optional.ofNullable(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder tag(Optional<String> tag) {
|
||||
Utils.checkNotNull(tag, "tag");
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchAllLibrariesWriter build() {
|
||||
return new GetSearchAllLibrariesWriter(
|
||||
tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,17 @@
|
||||
|
||||
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.lang.Integer;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetSearchLibraryRequestBuilder {
|
||||
|
||||
private Integer sectionKey;
|
||||
private GetSearchLibraryQueryParamType type;
|
||||
private Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallGetSearchLibrary sdk;
|
||||
|
||||
public GetSearchLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchLibrary sdk) {
|
||||
@@ -28,11 +32,26 @@ public class GetSearchLibraryRequestBuilder {
|
||||
this.type = type;
|
||||
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 {
|
||||
|
||||
Optional<Options> options = Optional.of(Options.builder()
|
||||
.retryConfig(retryConfig)
|
||||
.build());
|
||||
return sdk.getSearchLibrary(
|
||||
sectionKey,
|
||||
type);
|
||||
type,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user