mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 12:37:47 +00:00
Regenerated SDK
This commit is contained in:
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
@@ -40,6 +45,12 @@ public class Activities implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Server Activities
|
||||
* Get Server Activities
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesRequestBuilder getServerActivities() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesRequestBuilder(this);
|
||||
}
|
||||
@@ -47,72 +58,117 @@ public class Activities implements
|
||||
/**
|
||||
* Get Server Activities
|
||||
* Get Server Activities
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse getServerActivitiesDirect() throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/activities");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getServerActivities", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesActivitiesResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesActivitiesResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetServerActivitiesResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetServerActivitiesResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Cancel Server Activities
|
||||
* Cancel Server Activities
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequestBuilder cancelServerActivities() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequestBuilder(this);
|
||||
}
|
||||
@@ -121,8 +177,8 @@ public class Activities implements
|
||||
* Cancel Server Activities
|
||||
* Cancel Server Activities
|
||||
* @param activityUUID The UUID of the activity to cancel.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse cancelServerActivities(
|
||||
String activityUUID) throws Exception {
|
||||
@@ -132,57 +188,95 @@ public class Activities implements
|
||||
.activityUUID(activityUUID)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
String _url = Utils.generateURL(
|
||||
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequest.class,
|
||||
baseUrl,
|
||||
_baseUrl,
|
||||
"/activities/{activityUUID}",
|
||||
request, null);
|
||||
request, this.sdkConfiguration.globals);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "DELETE");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("DELETE");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("cancelServerActivities", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("cancelServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("cancelServerActivities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.CancelServerActivitiesResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.CancelServerActivitiesResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -35,6 +40,13 @@ public class Authentication implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequestBuilder getTransientToken() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequestBuilder(this);
|
||||
}
|
||||
@@ -45,8 +57,8 @@ public class Authentication implements
|
||||
*
|
||||
* @param type `delegation` - This is the only supported `type` parameter.
|
||||
* @param scope `all` - This is the only supported `scope` parameter.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse getTransientToken(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenQueryParamType type,
|
||||
@@ -58,66 +70,109 @@ public class Authentication implements
|
||||
.scope(scope)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/security/token");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getTransientToken", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getTransientToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getTransientToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetTransientTokenResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetTransientTokenResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequestBuilder getSourceConnectionInformation() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequestBuilder(this);
|
||||
}
|
||||
@@ -128,8 +183,8 @@ public class Authentication implements
|
||||
* Note: requires Plex Media Server >= 1.15.4.
|
||||
*
|
||||
* @param source The source identifier with an included prefix.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse getSourceConnectionInformation(
|
||||
String source) throws Exception {
|
||||
@@ -139,63 +194,98 @@ public class Authentication implements
|
||||
.source(source)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/security/resources");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getSourceConnectionInformation", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getSourceConnectionInformation", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getSourceConnectionInformation", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetSourceConnectionInformationResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetSourceConnectionInformationResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
@@ -37,6 +42,12 @@ public class Butler implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Butler tasks
|
||||
* Returns a list of butler tasks
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetButlerTasksRequestBuilder getButlerTasks() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetButlerTasksRequestBuilder(this);
|
||||
}
|
||||
@@ -44,72 +55,122 @@ public class Butler implements
|
||||
/**
|
||||
* Get Butler tasks
|
||||
* Returns a list of butler tasks
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse getButlerTasksDirect() throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/butler");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getButlerTasks", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getButlerTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getButlerTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetButlerTasksButlerResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetButlerTasksButlerResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetButlerTasksResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetButlerTasksResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StartAllTasksRequestBuilder startAllTasks() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.StartAllTasksRequestBuilder(this);
|
||||
}
|
||||
@@ -122,62 +183,107 @@ public class Butler implements
|
||||
* 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.
|
||||
*
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse startAllTasksDirect() throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/butler");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "POST");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("POST");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("startAllTasks", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("startAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("startAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.StartAllTasksResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.StartAllTasksResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Stop all Butler tasks
|
||||
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StopAllTasksRequestBuilder stopAllTasks() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.StopAllTasksRequestBuilder(this);
|
||||
}
|
||||
@@ -186,62 +292,111 @@ public class Butler implements
|
||||
* Stop all Butler tasks
|
||||
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
||||
*
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse stopAllTasksDirect() throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/butler");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "DELETE");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("DELETE");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("stopAllTasks", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("stopAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("stopAllTasks", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.StopAllTasksResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.StopAllTasksResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StartTaskRequestBuilder startTask() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.StartTaskRequestBuilder(this);
|
||||
}
|
||||
@@ -255,8 +410,8 @@ public class Butler implements
|
||||
* 4. If we are outside the configured window, the task will start immediately.
|
||||
*
|
||||
* @param taskName the name of the task to be started.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StartTaskResponse startTask(
|
||||
lukehagar.plexapi.plexapi.models.operations.TaskName taskName) throws Exception {
|
||||
@@ -266,60 +421,105 @@ public class Butler implements
|
||||
.taskName(taskName)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
String _url = Utils.generateURL(
|
||||
lukehagar.plexapi.plexapi.models.operations.StartTaskRequest.class,
|
||||
baseUrl,
|
||||
_baseUrl,
|
||||
"/butler/{taskName}",
|
||||
request, null);
|
||||
request, this.sdkConfiguration.globals);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "POST");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("POST");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("startTask", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("startTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("startTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.StartTaskResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StartTaskResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StartTaskResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.StartTaskResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 202 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.StartTaskResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.StartTaskResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.StartTaskResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200", "202")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.StartTaskResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.StartTaskResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StopTaskRequestBuilder stopTask() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.StopTaskRequestBuilder(this);
|
||||
}
|
||||
@@ -329,8 +529,8 @@ public class Butler implements
|
||||
* 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.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StopTaskResponse stopTask(
|
||||
lukehagar.plexapi.plexapi.models.operations.PathParamTaskName taskName) throws Exception {
|
||||
@@ -340,57 +540,95 @@ public class Butler implements
|
||||
.taskName(taskName)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
String _url = Utils.generateURL(
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTaskRequest.class,
|
||||
baseUrl,
|
||||
_baseUrl,
|
||||
"/butler/{taskName}",
|
||||
request, null);
|
||||
request, this.sdkConfiguration.globals);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "DELETE");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("DELETE");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("stopTask", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("stopTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("stopTask", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTaskResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTaskResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTaskResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTaskResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400 || httpRes.statusCode() == 404) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTaskResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.StopTaskResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTaskResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.StopTaskResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.StopTaskResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -35,17 +40,32 @@ public class Hubs implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Global Hubs
|
||||
* Get Global Hubs filtered by the parameters provided.
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequestBuilder getGlobalHubs() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Global Hubs
|
||||
* Get Global Hubs filtered by the parameters provided.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse getGlobalHubsDirect() throws Exception {
|
||||
return getGlobalHubs(Optional.empty(), Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get Global Hubs
|
||||
* 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).
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse getGlobalHubs(
|
||||
Optional<? extends Double> count,
|
||||
@@ -57,80 +77,135 @@ public class Hubs implements
|
||||
.onlyTransient(onlyTransient)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/hubs");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getGlobalHubs", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getGlobalHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getGlobalHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsHubsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsHubsResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetGlobalHubsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetGlobalHubsResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get library specific hubs
|
||||
* This endpoint will return a list of library specific hubs
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequestBuilder getLibraryHubs() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get library specific hubs
|
||||
* This endpoint will return a list of library specific hubs
|
||||
*
|
||||
* @param sectionId the Id of the library to query
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse getLibraryHubs(
|
||||
double sectionId) throws Exception {
|
||||
return getLibraryHubs(sectionId, Optional.empty(), Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get library specific hubs
|
||||
* This endpoint will return a list of library specific hubs
|
||||
@@ -138,8 +213,8 @@ 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).
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse getLibraryHubs(
|
||||
double sectionId,
|
||||
@@ -153,75 +228,111 @@ public class Hubs implements
|
||||
.onlyTransient(onlyTransient)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
String _url = Utils.generateURL(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest.class,
|
||||
baseUrl,
|
||||
_baseUrl,
|
||||
"/hubs/sections/{sectionId}",
|
||||
request, null);
|
||||
request, this.sdkConfiguration.globals);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getLibraryHubs", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getLibraryHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getLibraryHubs", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsHubsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsHubsResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetLibraryHubsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetLibraryHubsResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.SerializedBody;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
@@ -37,6 +42,13 @@ public class Log implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.LogLineRequestBuilder logLine() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.LogLineRequestBuilder(this);
|
||||
}
|
||||
@@ -54,8 +66,8 @@ public class Log implements
|
||||
|
||||
* @param message The text of the message to write to the log.
|
||||
* @param source a string indicating the source of the message.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.LogLineResponse logLine(
|
||||
lukehagar.plexapi.plexapi.models.operations.Level level,
|
||||
@@ -69,66 +81,128 @@ public class Log implements
|
||||
.source(source)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/log");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.LogLineRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.LogLineRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("logLine", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("logLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("logLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.LogLineResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.LogLineResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.LogLineResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.LogLineResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.LogLineResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.LogLineResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.LogLineResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.LogLineResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.LogLineResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.LogMultiLineRequestBuilder logMultiLine() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.LogMultiLineRequestBuilder(this);
|
||||
}
|
||||
@@ -158,71 +232,116 @@ public class Log implements
|
||||
* 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.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse logMultiLine(
|
||||
String request) throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/log");
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("POST");
|
||||
req.setURL(url);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "POST");
|
||||
Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT,
|
||||
new TypeReference<String>() {});
|
||||
SerializedBody serializedRequestBody = lukehagar.plexapi.plexapi.utils.Utils.serializeRequestBody(
|
||||
SerializedBody _serializedRequestBody = Utils.serializeRequestBody(
|
||||
_convertedRequest, "request", "string", false);
|
||||
if (serializedRequestBody == null) {
|
||||
if (_serializedRequestBody == null) {
|
||||
throw new Exception("Request body is required");
|
||||
}
|
||||
req.setBody(serializedRequestBody);
|
||||
_req.setBody(Optional.ofNullable(_serializedRequestBody));
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("logMultiLine", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("logMultiLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("logMultiLine", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.LogMultiLineResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.LogMultiLineResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enabling Papertrail
|
||||
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailRequestBuilder enablePaperTrail() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailRequestBuilder(this);
|
||||
}
|
||||
@@ -231,59 +350,97 @@ public class Log implements
|
||||
* Enabling Papertrail
|
||||
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
|
||||
*
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse enablePaperTrailDirect() throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/log/networked");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("enablePaperTrail", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("enablePaperTrail", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("enablePaperTrail", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400 || httpRes.statusCode() == 403) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.EnablePaperTrailResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.EnablePaperTrailResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -36,6 +41,12 @@ public class Media implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mark Media Played
|
||||
* This will mark the provided media key as Played.
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequestBuilder markPlayed() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequestBuilder(this);
|
||||
}
|
||||
@@ -44,8 +55,8 @@ public class Media implements
|
||||
* Mark Media Played
|
||||
* This will mark the provided media key as Played.
|
||||
* @param key The media key to mark as played
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse markPlayed(
|
||||
double key) throws Exception {
|
||||
@@ -55,66 +66,107 @@ public class Media implements
|
||||
.key(key)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/:/scrobble");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("markPlayed", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("markPlayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("markPlayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.MarkPlayedResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.MarkPlayedResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Mark Media Unplayed
|
||||
* This will mark the provided media key as Unplayed.
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequestBuilder markUnplayed() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequestBuilder(this);
|
||||
}
|
||||
@@ -123,8 +175,8 @@ public class Media implements
|
||||
* Mark Media Unplayed
|
||||
* This will mark the provided media key as Unplayed.
|
||||
* @param key The media key to mark as Unplayed
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse markUnplayed(
|
||||
double key) throws Exception {
|
||||
@@ -134,66 +186,108 @@ public class Media implements
|
||||
.key(key)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/:/unscrobble");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("markUnplayed", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("markUnplayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("markUnplayed", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.MarkUnplayedResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.MarkUnplayedResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Update Media Play Progress
|
||||
* This API command can be used to update the play progress of a media item.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequestBuilder updatePlayProgress() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequestBuilder(this);
|
||||
}
|
||||
@@ -205,8 +299,8 @@ public class Media implements
|
||||
* @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.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse updatePlayProgress(
|
||||
String key,
|
||||
@@ -220,63 +314,98 @@ public class Media implements
|
||||
.state(state)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/:/progress");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "POST");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("POST");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("updatePlayProgress", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("updatePlayProgress", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("updatePlayProgress", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.UpdatePlayProgressResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.UpdatePlayProgressResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.OffsetDateTime;
|
||||
@@ -17,7 +18,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -27,6 +32,7 @@ import org.openapitools.jackson.nullable.JsonNullable;
|
||||
*
|
||||
*/
|
||||
public class Plex implements
|
||||
MethodCallGetHomeData,
|
||||
MethodCallGetPin,
|
||||
MethodCallGetToken {
|
||||
|
||||
@@ -50,10 +56,146 @@ public class Plex implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Plex Home Data
|
||||
* Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetHomeDataRequestBuilder getHomeData() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetHomeDataRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plex Home Data
|
||||
* Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse getHomeDataDirect() throws Exception {
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/home");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getHomeData", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getHomeData", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getHomeData", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse
|
||||
.builder()
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponseBody>() {});
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetHomeDataResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetHomeDataResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get a Pin
|
||||
* Retrieve a Pin from Plex.tv for authentication flows
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetPinRequestBuilder getPin() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetPinRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Pin
|
||||
* Retrieve a Pin from Plex.tv for authentication flows
|
||||
* @param xPlexProduct Product name of the application shown in the list of devices
|
||||
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetPinResponse getPin(
|
||||
String xPlexProduct) throws Exception {
|
||||
return getPin(Optional.empty(), Optional.empty(), xPlexProduct, Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get a Pin
|
||||
* Retrieve a Pin from Plex.tv for authentication flows
|
||||
@@ -65,103 +207,152 @@ public class Plex implements
|
||||
This is used to track the client application and its usage
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
||||
* @param xPlexProduct Product name of the application shown in the list of devices
|
||||
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetPinResponse getPin(
|
||||
Optional<? extends Boolean> strong,
|
||||
String xPlexClientIdentifier,
|
||||
Optional<? extends String> xPlexClientIdentifier,
|
||||
String xPlexProduct,
|
||||
java.util.Optional<String> serverURL) throws Exception {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinRequest request =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinRequest
|
||||
.builder()
|
||||
.strong(strong)
|
||||
.xPlexClientIdentifier(xPlexClientIdentifier)
|
||||
.xPlexProduct(xPlexProduct)
|
||||
.build();
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(GET_PIN_SERVERS[0], new java.util.HashMap<String, String>());
|
||||
String _baseUrl = Utils.templateUrl(GET_PIN_SERVERS[0], new java.util.HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
baseUrl = serverURL.get();
|
||||
_baseUrl = serverURL.get();
|
||||
}
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/pins");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "POST");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("POST");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getPin", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getPin", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getPin", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
java.util.Map<String, java.util.List<String>> headers = lukehagar.plexapi.plexapi.utils.Utils.getHeaders(request);
|
||||
if (headers != null) {
|
||||
for (java.util.Map.Entry<String, java.util.List<String>> header : headers.entrySet()) {
|
||||
for (String value : header.getValue()) {
|
||||
req.addHeader(header.getKey(), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HTTPClient client = this.sdkConfiguration.defaultClient;
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "201")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetPinResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetPinPlexResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetPinPlexResponseBody>() {});
|
||||
res.withFourHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Access Token
|
||||
* Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTokenRequestBuilder getToken() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetTokenRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Access Token
|
||||
* Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
||||
* @param pinID The PinID to retrieve an access token for
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTokenResponse getToken(
|
||||
String pinID) throws Exception {
|
||||
return getToken(pinID, Optional.empty(), Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get Access Token
|
||||
* Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
||||
@@ -171,12 +362,12 @@ public class Plex implements
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTokenResponse getToken(
|
||||
String pinID,
|
||||
String xPlexClientIdentifier,
|
||||
Optional<? extends String> xPlexClientIdentifier,
|
||||
java.util.Optional<String> serverURL) throws Exception {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenRequest request =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenRequest
|
||||
@@ -185,66 +376,106 @@ public class Plex implements
|
||||
.xPlexClientIdentifier(xPlexClientIdentifier)
|
||||
.build();
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(GET_TOKEN_SERVERS[0], new java.util.HashMap<String, String>());
|
||||
String _baseUrl = Utils.templateUrl(GET_TOKEN_SERVERS[0], new java.util.HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
baseUrl = serverURL.get();
|
||||
_baseUrl = serverURL.get();
|
||||
}
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
String _url = Utils.generateURL(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenRequest.class,
|
||||
baseUrl,
|
||||
_baseUrl,
|
||||
"/pins/{pinID}",
|
||||
request, null);
|
||||
request, this.sdkConfiguration.globals);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
java.util.Map<String, java.util.List<String>> headers = lukehagar.plexapi.plexapi.utils.Utils.getHeaders(request);
|
||||
if (headers != null) {
|
||||
for (java.util.Map.Entry<String, java.util.List<String>> header : headers.entrySet()) {
|
||||
for (String value : header.getValue()) {
|
||||
req.addHeader(header.getKey(), value);
|
||||
}
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getToken", Optional.of(java.util.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("getToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getToken", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = this.sdkConfiguration.defaultClient;
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTokenResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetTokenResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetTokenResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetTokenResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,11 +9,16 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.RetryConfig;
|
||||
import lukehagar.plexapi.plexapi.utils.SpeakeasyHTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
@@ -24,6 +29,8 @@ import org.openapitools.jackson.nullable.JsonNullable;
|
||||
* An Open API Spec for interacting with Plex.tv and Plex Servers
|
||||
*/
|
||||
public class PlexAPI {
|
||||
|
||||
|
||||
/**
|
||||
* SERVERS contains the list of server urls available to the SDK.
|
||||
*/
|
||||
@@ -70,6 +77,12 @@ public class PlexAPI {
|
||||
*/
|
||||
private final Butler butler;
|
||||
|
||||
/**
|
||||
* API Calls that perform operations directly against https://Plex.tv
|
||||
*
|
||||
*/
|
||||
private final Plex plex;
|
||||
|
||||
/**
|
||||
* Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
||||
*
|
||||
@@ -94,12 +107,6 @@ public class PlexAPI {
|
||||
*/
|
||||
private final Log log;
|
||||
|
||||
/**
|
||||
* API Calls that perform operations directly against https://Plex.tv
|
||||
*
|
||||
*/
|
||||
private final Plex plex;
|
||||
|
||||
/**
|
||||
* Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017").
|
||||
* They can be organized in (optionally nesting) folders.
|
||||
@@ -134,6 +141,12 @@ public class PlexAPI {
|
||||
*/
|
||||
private final Updater updater;
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Watchlists
|
||||
*
|
||||
*/
|
||||
private final Watchlist watchlist;
|
||||
|
||||
/**
|
||||
* Operations against the Plex Media Server System.
|
||||
*
|
||||
@@ -180,6 +193,14 @@ public class PlexAPI {
|
||||
return butler;
|
||||
}
|
||||
|
||||
/**
|
||||
* API Calls that perform operations directly against https://Plex.tv
|
||||
*
|
||||
*/
|
||||
public Plex plex() {
|
||||
return plex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
||||
*
|
||||
@@ -212,14 +233,6 @@ public class PlexAPI {
|
||||
return log;
|
||||
}
|
||||
|
||||
/**
|
||||
* API Calls that perform operations directly against https://Plex.tv
|
||||
*
|
||||
*/
|
||||
public Plex plex() {
|
||||
return plex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017").
|
||||
* They can be organized in (optionally nesting) folders.
|
||||
@@ -264,6 +277,14 @@ public class PlexAPI {
|
||||
return updater;
|
||||
}
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Watchlists
|
||||
*
|
||||
*/
|
||||
public Watchlist watchlist() {
|
||||
return watchlist;
|
||||
}
|
||||
|
||||
private final SDKConfiguration sdkConfiguration;
|
||||
|
||||
/**
|
||||
@@ -354,9 +375,6 @@ public class PlexAPI {
|
||||
this.sdkConfiguration.retryConfig = Optional.of(retryConfig);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* ServerProtocol - The protocol to use when connecting to your plex server.
|
||||
*/
|
||||
public enum ServerProtocol {
|
||||
HTTP("http"),
|
||||
HTTPS("https");
|
||||
@@ -424,6 +442,27 @@ public class PlexAPI {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows setting the xPlexClientIdentifier parameter for all supported operations.
|
||||
*
|
||||
* @param xPlexClientIdentifier The value to set.
|
||||
* @return The builder instance.
|
||||
*/
|
||||
public Builder xPlexClientIdentifier(String xPlexClientIdentifier) {
|
||||
if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) {
|
||||
this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>());
|
||||
}
|
||||
|
||||
this.sdkConfiguration.globals.get("parameters").get("header").put("xPlexClientIdentifier", xPlexClientIdentifier);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Visible for testing, will be accessed via reflection
|
||||
void _hooks(lukehagar.plexapi.plexapi.utils.Hooks hooks) {
|
||||
sdkConfiguration.setHooks(hooks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a new instance of the SDK.
|
||||
* @return The SDK instance.
|
||||
@@ -432,9 +471,9 @@ public class PlexAPI {
|
||||
if (sdkConfiguration.defaultClient == null) {
|
||||
sdkConfiguration.defaultClient = new SpeakeasyHTTPClient();
|
||||
}
|
||||
if (sdkConfiguration.securitySource == null) {
|
||||
sdkConfiguration.securitySource = SecuritySource.of(null);
|
||||
}
|
||||
if (sdkConfiguration.securitySource == null) {
|
||||
sdkConfiguration.securitySource = SecuritySource.of(null);
|
||||
}
|
||||
if (sdkConfiguration.serverUrl == null || sdkConfiguration.serverUrl.isBlank()) {
|
||||
sdkConfiguration.serverUrl = SERVERS[0];
|
||||
sdkConfiguration.serverIdx = 0;
|
||||
@@ -445,7 +484,7 @@ public class PlexAPI {
|
||||
return new PlexAPI(sdkConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a new instance of the SDK builder to configure a new instance of the SDK.
|
||||
* @return The SDK builder instance.
|
||||
@@ -461,74 +500,16 @@ public class PlexAPI {
|
||||
this.video = new Video(sdkConfiguration);
|
||||
this.activities = new Activities(sdkConfiguration);
|
||||
this.butler = new Butler(sdkConfiguration);
|
||||
this.plex = new Plex(sdkConfiguration);
|
||||
this.hubs = new Hubs(sdkConfiguration);
|
||||
this.search = new Search(sdkConfiguration);
|
||||
this.library = new Library(sdkConfiguration);
|
||||
this.log = new Log(sdkConfiguration);
|
||||
this.plex = new Plex(sdkConfiguration);
|
||||
this.playlists = new Playlists(sdkConfiguration);
|
||||
this.authentication = new Authentication(sdkConfiguration);
|
||||
this.statistics = new Statistics(sdkConfiguration);
|
||||
this.sessions = new Sessions(sdkConfiguration);
|
||||
this.updater = new Updater(sdkConfiguration);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
this.watchlist = new Watchlist(sdkConfiguration);
|
||||
this.sdkConfiguration.initialize();
|
||||
}}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
package lukehagar.plexapi.plexapi;
|
||||
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.SdkInitData;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.RetryConfig;
|
||||
import lukehagar.plexapi.plexapi.models.shared.Security;
|
||||
@@ -15,25 +16,58 @@ import java.util.Optional;
|
||||
|
||||
class SDKConfiguration {
|
||||
public SecuritySource securitySource;
|
||||
|
||||
public Optional<SecuritySource> securitySource() {
|
||||
return Optional.ofNullable(securitySource);
|
||||
}
|
||||
public HTTPClient defaultClient;
|
||||
public String serverUrl;
|
||||
public String serverUrl;
|
||||
public int serverIdx = 0;
|
||||
List<Map<String, String>> serverDefaults = new ArrayList<>(){{
|
||||
add(new HashMap<>(){{
|
||||
put("protocol", "http");
|
||||
put("ip", "10.10.10.47");
|
||||
put("port", "32400");
|
||||
}});
|
||||
}};
|
||||
public String language = "java";
|
||||
public String openapiDocVersion = "0.0.3";
|
||||
public String sdkVersion = "0.0.1";
|
||||
public String genVersion = "2.281.2";
|
||||
public String userAgent = "speakeasy-sdk/java 0.0.1 2.281.2 0.0.3 lukehagar.plexapi.plexapi";
|
||||
|
||||
|
||||
public Map<String, String> getServerVariableDefaults() {
|
||||
return serverDefaults.get(this.serverIdx);
|
||||
}
|
||||
List<Map<String, String>> serverDefaults = new ArrayList<>(){{
|
||||
add(new HashMap<>(){{
|
||||
put("protocol", "http");
|
||||
put("ip", "10.10.10.47");
|
||||
put("port", "32400");
|
||||
}});
|
||||
}};
|
||||
public String language = "java";
|
||||
public String openapiDocVersion = "0.0.3";
|
||||
public String sdkVersion = "0.1.1";
|
||||
public String genVersion = "2.354.2";
|
||||
public String userAgent = "speakeasy-sdk/java 0.1.1 2.354.2 0.0.3 lukehagar.plexapi.plexapi";
|
||||
|
||||
private lukehagar.plexapi.plexapi.utils.Hooks _hooks = createHooks();
|
||||
|
||||
private static lukehagar.plexapi.plexapi.utils.Hooks createHooks() {
|
||||
lukehagar.plexapi.plexapi.utils.Hooks hooks = new lukehagar.plexapi.plexapi.utils.Hooks();
|
||||
return hooks;
|
||||
}
|
||||
|
||||
public lukehagar.plexapi.plexapi.utils.Hooks hooks() {
|
||||
return _hooks;
|
||||
}
|
||||
|
||||
public void setHooks(lukehagar.plexapi.plexapi.utils.Hooks hooks) {
|
||||
this._hooks = hooks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes state (for example hooks).
|
||||
**/
|
||||
public void initialize() {
|
||||
lukehagar.plexapi.plexapi.hooks.SDKHooks.initialize(_hooks);
|
||||
// apply the sdk init hook immediately
|
||||
SdkInitData data = _hooks.sdkInit(new SdkInitData(serverUrl, defaultClient));
|
||||
this.serverUrl = data.baseUrl();
|
||||
this.defaultClient = data.client();
|
||||
}
|
||||
|
||||
public Map<String, Map<String, Map<String, java.lang.Object>>> globals = new HashMap<>(){{
|
||||
put("parameters", new HashMap<>());
|
||||
}};
|
||||
|
||||
public Map<String, String> getServerVariableDefaults() {
|
||||
return serverDefaults.get(this.serverIdx);
|
||||
}
|
||||
public Optional<RetryConfig> retryConfig = Optional.empty();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -36,10 +41,51 @@ public class Search implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Perform a search
|
||||
* This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
|
||||
*
|
||||
* In the response's items, the following extra attributes are returned to further describe or disambiguate the result:
|
||||
*
|
||||
* - `reason`: The reason for the result, if not because of a direct search term match; can be either:
|
||||
* - `section`: There are multiple identical results from different sections.
|
||||
* - `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language).
|
||||
* - `<hub identifier>`: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor`
|
||||
* - `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold").
|
||||
* - `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID.
|
||||
*
|
||||
* This request is intended to be very fast, and called as the user types.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.PerformSearchRequestBuilder performSearch() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.PerformSearchRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a search
|
||||
* This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
|
||||
*
|
||||
* In the response's items, the following extra attributes are returned to further describe or disambiguate the result:
|
||||
*
|
||||
* - `reason`: The reason for the result, if not because of a direct search term match; can be either:
|
||||
* - `section`: There are multiple identical results from different sections.
|
||||
* - `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language).
|
||||
* - `<hub identifier>`: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor`
|
||||
* - `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold").
|
||||
* - `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID.
|
||||
*
|
||||
* This request is intended to be very fast, and called as the user types.
|
||||
*
|
||||
* @param query The query term
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse performSearch(
|
||||
String query) throws Exception {
|
||||
return performSearch(query, Optional.empty(), Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Perform a search
|
||||
* This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
|
||||
@@ -58,8 +104,8 @@ 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
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse performSearch(
|
||||
String query,
|
||||
@@ -73,70 +119,130 @@ public class Search implements
|
||||
.limit(limit)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/hubs/search");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformSearchRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformSearchRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("performSearch", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("performSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("performSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformSearchResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.PerformSearchResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.PerformSearchResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.PerformSearchResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Perform a voice search
|
||||
* This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint.
|
||||
* It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint.
|
||||
* Whenever possible, clients should limit the search to the appropriate type.
|
||||
* Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequestBuilder performVoiceSearch() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a voice search
|
||||
* This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint.
|
||||
* It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint.
|
||||
* Whenever possible, clients should limit the search to the appropriate type.
|
||||
* Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
|
||||
*
|
||||
* @param query The query term
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse performVoiceSearch(
|
||||
String query) throws Exception {
|
||||
return performVoiceSearch(query, Optional.empty(), Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Perform a voice search
|
||||
* This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint.
|
||||
@@ -147,8 +253,8 @@ 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
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse performVoiceSearch(
|
||||
String query,
|
||||
@@ -162,66 +268,107 @@ public class Search implements
|
||||
.limit(limit)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/hubs/search/voice");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("performVoiceSearch", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("performVoiceSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("performVoiceSearch", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.PerformVoiceSearchResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.PerformVoiceSearchResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Search Results
|
||||
* This will search the database for the string provided.
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequestBuilder getSearchResults() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequestBuilder(this);
|
||||
}
|
||||
@@ -230,8 +377,8 @@ public class Search implements
|
||||
* Get Search Results
|
||||
* This will search the database for the string provided.
|
||||
* @param query The search query string to use
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse getSearchResults(
|
||||
String query) throws Exception {
|
||||
@@ -241,73 +388,109 @@ public class Search implements
|
||||
.query(query)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/search");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getSearchResults", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getSearchResults", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getSearchResults", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsSearchResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetSearchResultsSearchResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetSearchResultsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetSearchResultsResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,8 +17,13 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
/**
|
||||
@@ -36,6 +42,12 @@ public class Sessions implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Active Sessions
|
||||
* This will retrieve the "Now Playing" Information of the PMS.
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSessionsRequestBuilder getSessions() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetSessionsRequestBuilder(this);
|
||||
}
|
||||
@@ -43,72 +55,117 @@ public class Sessions implements
|
||||
/**
|
||||
* Get Active Sessions
|
||||
* This will retrieve the "Now Playing" Information of the PMS.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse getSessionsDirect() throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/status/sessions");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getSessions", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetSessionsResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionsSessionsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetSessionsSessionsResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetSessionsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetSessionsResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Session History
|
||||
* This will Retrieve a listing of all history views.
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequestBuilder getSessionHistory() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequestBuilder(this);
|
||||
}
|
||||
@@ -116,72 +173,153 @@ public class Sessions implements
|
||||
/**
|
||||
* Get Session History
|
||||
* This will Retrieve a listing of all history views.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse getSessionHistoryDirect() throws Exception {
|
||||
return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get Session History
|
||||
* This will Retrieve a listing of all history views.
|
||||
* @param sort Sorts the results by the specified field followed by the direction (asc, desc)
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
* @param accountId Filter results by those that are related to a specific users id
|
||||
|
||||
* @param filter Filters content by field and direction/equality
|
||||
(Unknown if viewedAt is the only supported column)
|
||||
|
||||
* @param librarySectionID Filters the results based on the id of a valid library section
|
||||
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse getSessionHistory(
|
||||
Optional<? extends String> sort,
|
||||
Optional<? extends Long> accountId,
|
||||
Optional<? extends lukehagar.plexapi.plexapi.models.operations.Filter> filter,
|
||||
Optional<? extends Long> librarySectionID) throws Exception {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequest request =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequest
|
||||
.builder()
|
||||
.sort(sort)
|
||||
.accountId(accountId)
|
||||
.filter(filter)
|
||||
.librarySectionID(librarySectionID)
|
||||
.build();
|
||||
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/status/sessions/history/all");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getSessionHistory", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getSessionHistory", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getSessionHistory", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetSessionHistorySessionsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetSessionHistorySessionsResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetSessionHistoryResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetSessionHistoryResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Transcode Sessions
|
||||
* Get Transcode Sessions
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsRequestBuilder getTranscodeSessions() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsRequestBuilder(this);
|
||||
}
|
||||
@@ -189,72 +327,117 @@ public class Sessions implements
|
||||
/**
|
||||
* Get Transcode Sessions
|
||||
* Get Transcode Sessions
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/transcode/sessions");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getTranscodeSessions", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getTranscodeSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getTranscodeSessions", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsSessionsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsSessionsResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetTranscodeSessionsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetTranscodeSessionsResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Stop a Transcode Session
|
||||
* Stop a Transcode Session
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequestBuilder stopTranscodeSession() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequestBuilder(this);
|
||||
}
|
||||
@@ -263,8 +446,8 @@ public class Sessions implements
|
||||
* Stop a Transcode Session
|
||||
* Stop a Transcode Session
|
||||
* @param sessionKey the Key of the transcode session to stop
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse stopTranscodeSession(
|
||||
String sessionKey) throws Exception {
|
||||
@@ -274,57 +457,95 @@ public class Sessions implements
|
||||
.sessionKey(sessionKey)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
String _url = Utils.generateURL(
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequest.class,
|
||||
baseUrl,
|
||||
_baseUrl,
|
||||
"/transcode/sessions/{sessionKey}",
|
||||
request, null);
|
||||
request, this.sdkConfiguration.globals);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "DELETE");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("DELETE");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("stopTranscodeSession", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("stopTranscodeSession", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("stopTranscodeSession", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 204 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "204")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.StopTranscodeSessionResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.StopTranscodeSessionResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -26,7 +31,9 @@ import org.openapitools.jackson.nullable.JsonNullable;
|
||||
*
|
||||
*/
|
||||
public class Statistics implements
|
||||
MethodCallGetStatistics {
|
||||
MethodCallGetStatistics,
|
||||
MethodCallGetResourcesStatistics,
|
||||
MethodCallGetBandwidthStatistics {
|
||||
|
||||
private final SDKConfiguration sdkConfiguration;
|
||||
|
||||
@@ -34,18 +41,33 @@ public class Statistics implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Media Statistics
|
||||
* This will return the media statistics for the server
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequestBuilder getStatistics() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Media Statistics
|
||||
* This will return the media statistics for the server
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse getStatisticsDirect() throws Exception {
|
||||
return getStatistics(Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get Media Statistics
|
||||
* This will return the media statistics for the server
|
||||
* @param timespan The timespan to retrieve statistics for
|
||||
the exact meaning of this parameter is not known
|
||||
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse getStatistics(
|
||||
Optional<? extends Long> timespan) throws Exception {
|
||||
@@ -55,73 +77,393 @@ public class Statistics implements
|
||||
.timespan(timespan)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/statistics/media");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getStatistics", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetStatisticsStatisticsResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetStatisticsStatisticsResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetStatisticsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetStatisticsResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
|
||||
/**
|
||||
* Get Resources Statistics
|
||||
* This will return the resources for the server
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequestBuilder getResourcesStatistics() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Resources Statistics
|
||||
* This will return the resources for the server
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse getResourcesStatisticsDirect() throws Exception {
|
||||
return getResourcesStatistics(Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get Resources Statistics
|
||||
* This will return the resources for the server
|
||||
* @param timespan The timespan to retrieve statistics for
|
||||
the exact meaning of this parameter is not known
|
||||
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse getResourcesStatistics(
|
||||
Optional<? extends Long> timespan) throws Exception {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequest request =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequest
|
||||
.builder()
|
||||
.timespan(timespan)
|
||||
.build();
|
||||
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/statistics/resources");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getResourcesStatistics", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getResourcesStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getResourcesStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse
|
||||
.builder()
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponseBody>() {});
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetResourcesStatisticsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetResourcesStatisticsResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Bandwidth Statistics
|
||||
* This will return the bandwidth statistics for the server
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequestBuilder getBandwidthStatistics() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Bandwidth Statistics
|
||||
* This will return the bandwidth statistics for the server
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse getBandwidthStatisticsDirect() throws Exception {
|
||||
return getBandwidthStatistics(Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get Bandwidth Statistics
|
||||
* This will return the bandwidth statistics for the server
|
||||
* @param timespan The timespan to retrieve statistics for
|
||||
the exact meaning of this parameter is not known
|
||||
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse getBandwidthStatistics(
|
||||
Optional<? extends Long> timespan) throws Exception {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequest request =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequest
|
||||
.builder()
|
||||
.timespan(timespan)
|
||||
.build();
|
||||
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/statistics/bandwidth");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getBandwidthStatistics", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getBandwidthStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getBandwidthStatistics", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse
|
||||
.builder()
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponseBody>() {});
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetBandwidthStatisticsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetBandwidthStatisticsResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -37,6 +42,12 @@ public class Updater implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Querying status of updates
|
||||
* Querying status of updates
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusRequestBuilder getUpdateStatus() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusRequestBuilder(this);
|
||||
}
|
||||
@@ -44,82 +55,136 @@ public class Updater implements
|
||||
/**
|
||||
* Querying status of updates
|
||||
* Querying status of updates
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse getUpdateStatusDirect() throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/updater/status");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getUpdateStatus", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getUpdateStatus", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getUpdateStatus", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponseBody>() {});
|
||||
res.withTwoHundredApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
}
|
||||
} else if (httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusUpdaterResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusUpdaterResponseBody>() {});
|
||||
res.withFourHundredAndOneApplicationJsonObject(java.util.Optional.ofNullable(out));
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetUpdateStatusResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetUpdateStatusResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checking for updates
|
||||
* Checking for updates
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequestBuilder checkForUpdates() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking for updates
|
||||
* Checking for updates
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse checkForUpdatesDirect() throws Exception {
|
||||
return checkForUpdates(Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Checking for updates
|
||||
* Checking for updates
|
||||
* @param download Indicate that you want to start download any updates found.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse checkForUpdates(
|
||||
Optional<? extends lukehagar.plexapi.plexapi.models.operations.Download> download) throws Exception {
|
||||
@@ -129,78 +194,130 @@ public class Updater implements
|
||||
.download(download)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/updater/check");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "PUT");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("PUT");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("checkForUpdates", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("checkForUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("checkForUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.CheckForUpdatesResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.CheckForUpdatesResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Apply Updates
|
||||
* Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequestBuilder applyUpdates() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply Updates
|
||||
* Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
|
||||
*
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse applyUpdatesDirect() throws Exception {
|
||||
return applyUpdates(Optional.empty(), Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Apply Updates
|
||||
* Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
|
||||
*
|
||||
* @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`.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse applyUpdates(
|
||||
Optional<? extends lukehagar.plexapi.plexapi.models.operations.Tonight> tonight,
|
||||
@@ -212,63 +329,98 @@ public class Updater implements
|
||||
.skip(skip)
|
||||
.build();
|
||||
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/updater/apply");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "PUT");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("PUT");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("applyUpdates", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("applyUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("applyUpdates", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400 || httpRes.statusCode() == 500) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "500", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.ApplyUpdatesResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.ApplyUpdatesResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
@@ -16,7 +17,11 @@ import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -35,6 +40,12 @@ public class Video implements
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the timeline for a media item
|
||||
* Get the timeline for a media item
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTimelineRequestBuilder getTimeline() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetTimelineRequestBuilder(this);
|
||||
}
|
||||
@@ -43,71 +54,112 @@ public class Video implements
|
||||
* 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.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse getTimeline(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest request) throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/:/timeline");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getTimeline", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getTimeline", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getTimeline", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetTimelineResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetTimelineResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetTimelineResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Start Universal Transcode
|
||||
* Begin a Universal Transcode Session
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequestBuilder startUniversalTranscode() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequestBuilder(this);
|
||||
}
|
||||
@@ -116,68 +168,103 @@ public class Video implements
|
||||
* Start Universal Transcode
|
||||
* Begin a Universal Transcode Session
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @return The response from the API call.
|
||||
* @throws Exception if the API call fails.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse startUniversalTranscode(
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest request) throws Exception {
|
||||
|
||||
String baseUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
|
||||
String url = lukehagar.plexapi.plexapi.utils.Utils.generateURL(
|
||||
baseUrl,
|
||||
String _url = Utils.generateURL(
|
||||
_baseUrl,
|
||||
"/video/:/transcode/universal/start.mpd");
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
HTTPRequest req = new HTTPRequest();
|
||||
req.setMethod("GET");
|
||||
req.setURL(url);
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
req.addHeader("Accept", "application/json");
|
||||
req.addHeader("user-agent", this.sdkConfiguration.userAgent);
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
java.util.List<NameValuePair> queryParams = lukehagar.plexapi.plexapi.utils.Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest.class, request, null);
|
||||
if (queryParams != null) {
|
||||
for (NameValuePair queryParam : queryParams) {
|
||||
req.addQueryParam(queryParam);
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("startUniversalTranscode", Optional.of(java.util.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(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("startUniversalTranscode", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("startUniversalTranscode", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
|
||||
HTTPClient client = lukehagar.plexapi.plexapi.utils.Utils.configureSecurityClient(
|
||||
this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HttpResponse<InputStream> httpRes = client.send(req);
|
||||
|
||||
String contentType = httpRes
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse.Builder resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse
|
||||
.builder()
|
||||
.contentType(contentType)
|
||||
.statusCode(httpRes.statusCode())
|
||||
.rawResponse(httpRes);
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse res = resBuilder.build();
|
||||
|
||||
res.withRawResponse(httpRes);
|
||||
|
||||
if (httpRes.statusCode() == 200 || httpRes.statusCode() == 400) {
|
||||
} else if (httpRes.statusCode() == 401) {
|
||||
if (lukehagar.plexapi.plexapi.utils.Utils.matchContentType(contentType, "application/json")) {
|
||||
ObjectMapper mapper = JSON.getMapper();
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponseBody out = mapper.readValue(
|
||||
Utils.toUtf8AndClose(httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponseBody>() {});
|
||||
res.withObject(java.util.Optional.ofNullable(out));
|
||||
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.StartUniversalTranscodeResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.StartUniversalTranscodeResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body()));
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
193
src/main/java/lukehagar/plexapi/plexapi/Watchlist.java
Normal file
193
src/main/java/lukehagar/plexapi/plexapi/Watchlist.java
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.models.errors.SDKError;
|
||||
import lukehagar.plexapi.plexapi.models.operations.SDKMethodInterfaces.*;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPClient;
|
||||
import lukehagar.plexapi.plexapi.utils.HTTPRequest;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterErrorContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.AfterSuccessContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.Hook.BeforeRequestContextImpl;
|
||||
import lukehagar.plexapi.plexapi.utils.JSON;
|
||||
import lukehagar.plexapi.plexapi.utils.Retries.NonRetryableException;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Watchlists
|
||||
*
|
||||
*/
|
||||
public class Watchlist implements
|
||||
MethodCallGetWatchlist {
|
||||
|
||||
/**
|
||||
* GET_WATCHLIST_SERVERS contains the list of server urls available to the SDK.
|
||||
*/
|
||||
public static final String[] GET_WATCHLIST_SERVERS = {
|
||||
/**
|
||||
* The plex metadata provider server
|
||||
*/
|
||||
"https://metadata.provider.plex.tv",
|
||||
};
|
||||
|
||||
private final SDKConfiguration sdkConfiguration;
|
||||
|
||||
Watchlist(SDKConfiguration sdkConfiguration) {
|
||||
this.sdkConfiguration = sdkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get User Watchlist
|
||||
* Get User Watchlist
|
||||
* @return The call builder
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequestBuilder getWatchlist() {
|
||||
return new lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get User Watchlist
|
||||
* Get User Watchlist
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse getWatchlist(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest request) throws Exception {
|
||||
return getWatchlist(request, Optional.empty());
|
||||
}
|
||||
/**
|
||||
* Get User Watchlist
|
||||
* Get User Watchlist
|
||||
* @param request The request object containing all of the parameters for the API call.
|
||||
* @param serverURL Overrides the server URL.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse getWatchlist(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest request,
|
||||
java.util.Optional<String> serverURL) throws Exception {
|
||||
String _baseUrl = Utils.templateUrl(GET_WATCHLIST_SERVERS[0], new java.util.HashMap<String, String>());
|
||||
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
|
||||
_baseUrl = serverURL.get();
|
||||
}
|
||||
String _url = Utils.generateURL(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest.class,
|
||||
_baseUrl,
|
||||
"/library/sections/watchlist/{filter}",
|
||||
request, this.sdkConfiguration.globals);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
this.sdkConfiguration.userAgent);
|
||||
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest.class,
|
||||
request,
|
||||
this.sdkConfiguration.globals));
|
||||
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl("getWatchlist", Optional.of(java.util.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("getWatchlist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl("getWatchlist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(new AfterErrorContextImpl("getWatchlist", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse.Builder _resBuilder =
|
||||
lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse
|
||||
.builder()
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponseBody>() {});
|
||||
_res.withObject(java.util.Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody>() {});
|
||||
_out.withRawResponse(java.util.Optional.ofNullable(_httpRes));
|
||||
|
||||
throw _out;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.toByteArrayAndClose(_httpRes.body()));
|
||||
}
|
||||
|
||||
}
|
||||
26
src/main/java/lukehagar/plexapi/plexapi/hooks/SDKHooks.java
Normal file
26
src/main/java/lukehagar/plexapi/plexapi/hooks/SDKHooks.java
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.hooks;
|
||||
|
||||
//
|
||||
// This file is written once by speakeasy code generation and
|
||||
// thereafter will not be overwritten by speakeasy updates. As a
|
||||
// consequence any customization of this class will be preserved.
|
||||
//
|
||||
|
||||
public final class SDKHooks {
|
||||
|
||||
private SDKHooks() {
|
||||
// prevent instantiation
|
||||
}
|
||||
|
||||
public static final void initialize(lukehagar.plexapi.plexapi.utils.Hooks hooks) {
|
||||
// register hooks here
|
||||
|
||||
// for more information see
|
||||
// https://www.speakeasyapi.dev/docs/additional-features/sdk-hooks
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class AddPlaylistContentsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class AddPlaylistContentsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public AddPlaylistContentsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class AddPlaylistContentsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public AddPlaylistContentsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* AddPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class AddPlaylistContentsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<AddPlaylistContentsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public AddPlaylistContentsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<AddPlaylistContentsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public AddPlaylistContentsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<AddPlaylistContentsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public AddPlaylistContentsResponseBody withErrors(java.util.List<AddPlaylistContentsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AddPlaylistContentsResponseBody withErrors(Optional<? extends java.util.List<AddPlaylistContentsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public AddPlaylistContentsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public AddPlaylistContentsResponseBody 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;
|
||||
}
|
||||
AddPlaylistContentsResponseBody other = (AddPlaylistContentsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(AddPlaylistContentsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<AddPlaylistContentsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<AddPlaylistContentsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<AddPlaylistContentsErrors>> 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 AddPlaylistContentsResponseBody build() {
|
||||
return new AddPlaylistContentsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class ApplyUpdatesErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class ApplyUpdatesErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public ApplyUpdatesErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class ApplyUpdatesErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public ApplyUpdatesErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* ApplyUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class ApplyUpdatesResponseBody {
|
||||
public class ApplyUpdatesResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<ApplyUpdatesErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public ApplyUpdatesResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<ApplyUpdatesErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<ApplyUpdatesErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public ApplyUpdatesResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<ApplyUpdatesErrors>> errors() {
|
||||
public Optional<? extends java.util.List<ApplyUpdatesErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class ApplyUpdatesResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public ApplyUpdatesResponseBody withErrors(Optional<? extends java.util.List<ApplyUpdatesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public ApplyUpdatesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public ApplyUpdatesResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class ApplyUpdatesResponseBody {
|
||||
return false;
|
||||
}
|
||||
ApplyUpdatesResponseBody other = (ApplyUpdatesResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(ApplyUpdatesResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<ApplyUpdatesErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<ApplyUpdatesErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class ApplyUpdatesResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<ApplyUpdatesErrors>> 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 ApplyUpdatesResponseBody build() {
|
||||
return new ApplyUpdatesResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* An exception associated with Authentication or Authorization.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AuthException extends RuntimeException {
|
||||
|
||||
private final Optional<Integer> statusCode;
|
||||
|
||||
private AuthException(Optional<Integer> statusCode, String message) {
|
||||
super(message);
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
|
||||
public AuthException(int statusCode, String message) {
|
||||
this(Optional.of(statusCode), message);
|
||||
}
|
||||
|
||||
public AuthException(String message) {
|
||||
this(Optional.empty(), message);
|
||||
}
|
||||
|
||||
public Optional<Integer> statusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class CancelServerActivitiesErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class CancelServerActivitiesErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public CancelServerActivitiesErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class CancelServerActivitiesErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public CancelServerActivitiesErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* CancelServerActivitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class CancelServerActivitiesResponseBody {
|
||||
public class CancelServerActivitiesResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public CancelServerActivitiesResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public CancelServerActivitiesResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors() {
|
||||
public Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class CancelServerActivitiesResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public CancelServerActivitiesResponseBody withErrors(Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public CancelServerActivitiesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public CancelServerActivitiesResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class CancelServerActivitiesResponseBody {
|
||||
return false;
|
||||
}
|
||||
CancelServerActivitiesResponseBody other = (CancelServerActivitiesResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(CancelServerActivitiesResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class CancelServerActivitiesResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<CancelServerActivitiesErrors>> 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 CancelServerActivitiesResponseBody build() {
|
||||
return new CancelServerActivitiesResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class CheckForUpdatesErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class CheckForUpdatesErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public CheckForUpdatesErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class CheckForUpdatesErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public CheckForUpdatesErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* CheckForUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class CheckForUpdatesResponseBody {
|
||||
public class CheckForUpdatesResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<CheckForUpdatesErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public CheckForUpdatesResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<CheckForUpdatesErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<CheckForUpdatesErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public CheckForUpdatesResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<CheckForUpdatesErrors>> errors() {
|
||||
public Optional<? extends java.util.List<CheckForUpdatesErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class CheckForUpdatesResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public CheckForUpdatesResponseBody withErrors(Optional<? extends java.util.List<CheckForUpdatesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public CheckForUpdatesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public CheckForUpdatesResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class CheckForUpdatesResponseBody {
|
||||
return false;
|
||||
}
|
||||
CheckForUpdatesResponseBody other = (CheckForUpdatesResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(CheckForUpdatesResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<CheckForUpdatesErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<CheckForUpdatesErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class CheckForUpdatesResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<CheckForUpdatesErrors>> 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 CheckForUpdatesResponseBody build() {
|
||||
return new CheckForUpdatesResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class ClearPlaylistContentsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class ClearPlaylistContentsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public ClearPlaylistContentsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class ClearPlaylistContentsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public ClearPlaylistContentsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* ClearPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class ClearPlaylistContentsResponseBody {
|
||||
public class ClearPlaylistContentsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public ClearPlaylistContentsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public ClearPlaylistContentsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors() {
|
||||
public Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class ClearPlaylistContentsResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public ClearPlaylistContentsResponseBody withErrors(Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public ClearPlaylistContentsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public ClearPlaylistContentsResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class ClearPlaylistContentsResponseBody {
|
||||
return false;
|
||||
}
|
||||
ClearPlaylistContentsResponseBody other = (ClearPlaylistContentsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(ClearPlaylistContentsResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class ClearPlaylistContentsResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<ClearPlaylistContentsErrors>> 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 ClearPlaylistContentsResponseBody build() {
|
||||
return new ClearPlaylistContentsResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class CreatePlaylistErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class CreatePlaylistErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public CreatePlaylistErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class CreatePlaylistErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public CreatePlaylistErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* CreatePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class CreatePlaylistResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<CreatePlaylistErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public CreatePlaylistResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<CreatePlaylistErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public CreatePlaylistResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<CreatePlaylistErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public CreatePlaylistResponseBody withErrors(java.util.List<CreatePlaylistErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CreatePlaylistResponseBody withErrors(Optional<? extends java.util.List<CreatePlaylistErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public CreatePlaylistResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public CreatePlaylistResponseBody 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;
|
||||
}
|
||||
CreatePlaylistResponseBody other = (CreatePlaylistResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(CreatePlaylistResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<CreatePlaylistErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<CreatePlaylistErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<CreatePlaylistErrors>> 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 CreatePlaylistResponseBody build() {
|
||||
return new CreatePlaylistResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class DeleteLibraryErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class DeleteLibraryErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public DeleteLibraryErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class DeleteLibraryErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public DeleteLibraryErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* DeleteLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class DeleteLibraryResponseBody {
|
||||
public class DeleteLibraryResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<DeleteLibraryErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public DeleteLibraryResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<DeleteLibraryErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<DeleteLibraryErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public DeleteLibraryResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<DeleteLibraryErrors>> errors() {
|
||||
public Optional<? extends java.util.List<DeleteLibraryErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class DeleteLibraryResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public DeleteLibraryResponseBody withErrors(Optional<? extends java.util.List<DeleteLibraryErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public DeleteLibraryResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public DeleteLibraryResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class DeleteLibraryResponseBody {
|
||||
return false;
|
||||
}
|
||||
DeleteLibraryResponseBody other = (DeleteLibraryResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(DeleteLibraryResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<DeleteLibraryErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<DeleteLibraryErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class DeleteLibraryResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<DeleteLibraryErrors>> 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 DeleteLibraryResponseBody build() {
|
||||
return new DeleteLibraryResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class DeletePlaylistErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class DeletePlaylistErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public DeletePlaylistErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class DeletePlaylistErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public DeletePlaylistErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* DeletePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class DeletePlaylistResponseBody {
|
||||
public class DeletePlaylistResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<DeletePlaylistErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public DeletePlaylistResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<DeletePlaylistErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<DeletePlaylistErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public DeletePlaylistResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<DeletePlaylistErrors>> errors() {
|
||||
public Optional<? extends java.util.List<DeletePlaylistErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class DeletePlaylistResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public DeletePlaylistResponseBody withErrors(Optional<? extends java.util.List<DeletePlaylistErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public DeletePlaylistResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public DeletePlaylistResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class DeletePlaylistResponseBody {
|
||||
return false;
|
||||
}
|
||||
DeletePlaylistResponseBody other = (DeletePlaylistResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(DeletePlaylistResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<DeletePlaylistErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<DeletePlaylistErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class DeletePlaylistResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<DeletePlaylistErrors>> 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 DeletePlaylistResponseBody build() {
|
||||
return new DeletePlaylistResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class EnablePaperTrailErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class EnablePaperTrailErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public EnablePaperTrailErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class EnablePaperTrailErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public EnablePaperTrailErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* EnablePaperTrailResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class EnablePaperTrailResponseBody {
|
||||
public class EnablePaperTrailResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<EnablePaperTrailErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public EnablePaperTrailResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<EnablePaperTrailErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<EnablePaperTrailErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public EnablePaperTrailResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<EnablePaperTrailErrors>> errors() {
|
||||
public Optional<? extends java.util.List<EnablePaperTrailErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class EnablePaperTrailResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public EnablePaperTrailResponseBody withErrors(Optional<? extends java.util.List<EnablePaperTrailErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public EnablePaperTrailResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public EnablePaperTrailResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class EnablePaperTrailResponseBody {
|
||||
return false;
|
||||
}
|
||||
EnablePaperTrailResponseBody other = (EnablePaperTrailResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(EnablePaperTrailResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<EnablePaperTrailErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<EnablePaperTrailErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class EnablePaperTrailResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<EnablePaperTrailErrors>> 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 EnablePaperTrailResponseBody build() {
|
||||
return new EnablePaperTrailResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class Errors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class Errors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public Errors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class Errors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public Errors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetAvailableClientsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetAvailableClientsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetAvailableClientsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetAvailableClientsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetAvailableClientsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetAvailableClientsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetAvailableClientsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetAvailableClientsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetAvailableClientsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetAvailableClientsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetAvailableClientsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetAvailableClientsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetAvailableClientsResponseBody withErrors(java.util.List<GetAvailableClientsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAvailableClientsResponseBody withErrors(Optional<? extends java.util.List<GetAvailableClientsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetAvailableClientsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetAvailableClientsResponseBody 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;
|
||||
}
|
||||
GetAvailableClientsResponseBody other = (GetAvailableClientsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetAvailableClientsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetAvailableClientsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetAvailableClientsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetAvailableClientsErrors>> 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 GetAvailableClientsResponseBody build() {
|
||||
return new GetAvailableClientsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
public class GetBandwidthStatisticsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("code")
|
||||
private Optional<? extends Double> code;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("message")
|
||||
private Optional<? extends String> message;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetBandwidthStatisticsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@JsonProperty("status") Optional<? extends Double> status) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
Utils.checkNotNull(message, "message");
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsErrors withCode(double code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsErrors withCode(Optional<? extends Double> code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsErrors withMessage(String message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = Optional.ofNullable(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsErrors withMessage(Optional<? extends String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsErrors withStatus(double status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsErrors withStatus(Optional<? extends Double> 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;
|
||||
}
|
||||
GetBandwidthStatisticsErrors other = (GetBandwidthStatisticsErrors) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.code, other.code) &&
|
||||
java.util.Objects.deepEquals(this.message, other.message) &&
|
||||
java.util.Objects.deepEquals(this.status, other.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetBandwidthStatisticsErrors.class,
|
||||
"code", code,
|
||||
"message", message,
|
||||
"status", status);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends Double> code = Optional.empty();
|
||||
|
||||
private Optional<? extends String> message = Optional.empty();
|
||||
|
||||
private Optional<? extends Double> status = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder code(double code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder code(Optional<? extends Double> 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<? extends String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(double status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(Optional<? extends Double> status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsErrors build() {
|
||||
return new GetBandwidthStatisticsErrors(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetBandwidthStatisticsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetBandwidthStatisticsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetBandwidthStatisticsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetBandwidthStatisticsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetBandwidthStatisticsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetBandwidthStatisticsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsResponseBody withErrors(java.util.List<GetBandwidthStatisticsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetBandwidthStatisticsResponseBody withErrors(Optional<? extends java.util.List<GetBandwidthStatisticsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetBandwidthStatisticsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetBandwidthStatisticsResponseBody 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;
|
||||
}
|
||||
GetBandwidthStatisticsResponseBody other = (GetBandwidthStatisticsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetBandwidthStatisticsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetBandwidthStatisticsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetBandwidthStatisticsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetBandwidthStatisticsErrors>> 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 GetBandwidthStatisticsResponseBody build() {
|
||||
return new GetBandwidthStatisticsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetButlerTasksErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetButlerTasksErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetButlerTasksErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetButlerTasksErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetButlerTasksErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetButlerTasksResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetButlerTasksResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetButlerTasksErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetButlerTasksResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetButlerTasksErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetButlerTasksResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetButlerTasksErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetButlerTasksResponseBody withErrors(java.util.List<GetButlerTasksErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetButlerTasksResponseBody withErrors(Optional<? extends java.util.List<GetButlerTasksErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetButlerTasksResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetButlerTasksResponseBody 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;
|
||||
}
|
||||
GetButlerTasksResponseBody other = (GetButlerTasksResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetButlerTasksResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetButlerTasksErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetButlerTasksErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetButlerTasksErrors>> 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 GetButlerTasksResponseBody build() {
|
||||
return new GetButlerTasksResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetDevicesErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetDevicesErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetDevicesErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetDevicesErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetDevicesErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetDevicesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetDevicesResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetDevicesErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetDevicesResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetDevicesErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetDevicesResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetDevicesErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetDevicesResponseBody withErrors(java.util.List<GetDevicesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetDevicesResponseBody withErrors(Optional<? extends java.util.List<GetDevicesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetDevicesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetDevicesResponseBody 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;
|
||||
}
|
||||
GetDevicesResponseBody other = (GetDevicesResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetDevicesResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetDevicesErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetDevicesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetDevicesErrors>> 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 GetDevicesResponseBody build() {
|
||||
return new GetDevicesResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetFileHashErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetFileHashErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetFileHashErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetFileHashErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetFileHashErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetFileHashResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class GetFileHashResponseBody {
|
||||
public class GetFileHashResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetFileHashErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetFileHashResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetFileHashErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetFileHashErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetFileHashResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetFileHashErrors>> errors() {
|
||||
public Optional<? extends java.util.List<GetFileHashErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class GetFileHashResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public GetFileHashResponseBody withErrors(Optional<? extends java.util.List<GetFileHashErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetFileHashResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetFileHashResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class GetFileHashResponseBody {
|
||||
return false;
|
||||
}
|
||||
GetFileHashResponseBody other = (GetFileHashResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetFileHashResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetFileHashErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<GetFileHashErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class GetFileHashResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetFileHashErrors>> 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 GetFileHashResponseBody build() {
|
||||
return new GetFileHashResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetGlobalHubsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetGlobalHubsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetGlobalHubsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetGlobalHubsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetGlobalHubsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetGlobalHubsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetGlobalHubsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetGlobalHubsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetGlobalHubsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetGlobalHubsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetGlobalHubsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetGlobalHubsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetGlobalHubsResponseBody withErrors(java.util.List<GetGlobalHubsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetGlobalHubsResponseBody withErrors(Optional<? extends java.util.List<GetGlobalHubsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetGlobalHubsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetGlobalHubsResponseBody 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;
|
||||
}
|
||||
GetGlobalHubsResponseBody other = (GetGlobalHubsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetGlobalHubsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetGlobalHubsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetGlobalHubsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetGlobalHubsErrors>> 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 GetGlobalHubsResponseBody build() {
|
||||
return new GetGlobalHubsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
public class GetHomeDataErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("code")
|
||||
private Optional<? extends Double> code;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("message")
|
||||
private Optional<? extends String> message;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetHomeDataErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@JsonProperty("status") Optional<? extends Double> status) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
Utils.checkNotNull(message, "message");
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public GetHomeDataErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetHomeDataErrors withCode(double code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetHomeDataErrors withCode(Optional<? extends Double> code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetHomeDataErrors withMessage(String message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = Optional.ofNullable(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetHomeDataErrors withMessage(Optional<? extends String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetHomeDataErrors withStatus(double status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetHomeDataErrors withStatus(Optional<? extends Double> 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;
|
||||
}
|
||||
GetHomeDataErrors other = (GetHomeDataErrors) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.code, other.code) &&
|
||||
java.util.Objects.deepEquals(this.message, other.message) &&
|
||||
java.util.Objects.deepEquals(this.status, other.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetHomeDataErrors.class,
|
||||
"code", code,
|
||||
"message", message,
|
||||
"status", status);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends Double> code = Optional.empty();
|
||||
|
||||
private Optional<? extends String> message = Optional.empty();
|
||||
|
||||
private Optional<? extends Double> status = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder code(double code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder code(Optional<? extends Double> 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<? extends String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(double status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(Optional<? extends Double> status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetHomeDataErrors build() {
|
||||
return new GetHomeDataErrors(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetHomeDataResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetHomeDataResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetHomeDataErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetHomeDataResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetHomeDataErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetHomeDataResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetHomeDataErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetHomeDataResponseBody withErrors(java.util.List<GetHomeDataErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetHomeDataResponseBody withErrors(Optional<? extends java.util.List<GetHomeDataErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetHomeDataResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetHomeDataResponseBody 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;
|
||||
}
|
||||
GetHomeDataResponseBody other = (GetHomeDataResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetHomeDataResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetHomeDataErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetHomeDataErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetHomeDataErrors>> 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 GetHomeDataResponseBody build() {
|
||||
return new GetHomeDataResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetLibrariesErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetLibrariesErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibrariesErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetLibrariesErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetLibrariesErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetLibrariesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetLibrariesResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetLibrariesErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibrariesResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetLibrariesErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetLibrariesResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetLibrariesErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetLibrariesResponseBody withErrors(java.util.List<GetLibrariesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibrariesResponseBody withErrors(Optional<? extends java.util.List<GetLibrariesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetLibrariesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetLibrariesResponseBody 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;
|
||||
}
|
||||
GetLibrariesResponseBody other = (GetLibrariesResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetLibrariesResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetLibrariesErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetLibrariesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetLibrariesErrors>> 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 GetLibrariesResponseBody build() {
|
||||
return new GetLibrariesResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetLibraryErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetLibraryErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetLibraryErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetLibraryErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetLibraryHubsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetLibraryHubsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryHubsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetLibraryHubsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetLibraryHubsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetLibraryHubsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetLibraryHubsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetLibraryHubsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryHubsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetLibraryHubsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetLibraryHubsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetLibraryHubsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetLibraryHubsResponseBody withErrors(java.util.List<GetLibraryHubsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryHubsResponseBody withErrors(Optional<? extends java.util.List<GetLibraryHubsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetLibraryHubsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetLibraryHubsResponseBody 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;
|
||||
}
|
||||
GetLibraryHubsResponseBody other = (GetLibraryHubsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetLibraryHubsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetLibraryHubsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetLibraryHubsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetLibraryHubsErrors>> 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 GetLibraryHubsResponseBody build() {
|
||||
return new GetLibraryHubsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
public class GetLibraryItemsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("code")
|
||||
private Optional<? extends Double> code;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("message")
|
||||
private Optional<? extends String> message;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryItemsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@JsonProperty("status") Optional<? extends Double> status) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
Utils.checkNotNull(message, "message");
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public GetLibraryItemsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetLibraryItemsErrors withCode(double code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsErrors withCode(Optional<? extends Double> code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsErrors withMessage(String message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = Optional.ofNullable(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsErrors withMessage(Optional<? extends String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsErrors withStatus(double status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsErrors withStatus(Optional<? extends Double> 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;
|
||||
}
|
||||
GetLibraryItemsErrors other = (GetLibraryItemsErrors) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.code, other.code) &&
|
||||
java.util.Objects.deepEquals(this.message, other.message) &&
|
||||
java.util.Objects.deepEquals(this.status, other.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetLibraryItemsErrors.class,
|
||||
"code", code,
|
||||
"message", message,
|
||||
"status", status);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends Double> code = Optional.empty();
|
||||
|
||||
private Optional<? extends String> message = Optional.empty();
|
||||
|
||||
private Optional<? extends Double> status = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder code(double code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder code(Optional<? extends Double> 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<? extends String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(double status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(Optional<? extends Double> status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsErrors build() {
|
||||
return new GetLibraryItemsErrors(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetLibraryItemsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetLibraryItemsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetLibraryItemsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryItemsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetLibraryItemsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetLibraryItemsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetLibraryItemsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetLibraryItemsResponseBody withErrors(java.util.List<GetLibraryItemsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryItemsResponseBody withErrors(Optional<? extends java.util.List<GetLibraryItemsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetLibraryItemsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetLibraryItemsResponseBody 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;
|
||||
}
|
||||
GetLibraryItemsResponseBody other = (GetLibraryItemsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetLibraryItemsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetLibraryItemsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetLibraryItemsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetLibraryItemsErrors>> 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 GetLibraryItemsResponseBody build() {
|
||||
return new GetLibraryItemsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetLibraryResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetLibraryErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetLibraryResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetLibraryErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetLibraryResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetLibraryErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetLibraryResponseBody withErrors(java.util.List<GetLibraryErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetLibraryResponseBody withErrors(Optional<? extends java.util.List<GetLibraryErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetLibraryResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetLibraryResponseBody 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;
|
||||
}
|
||||
GetLibraryResponseBody other = (GetLibraryResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetLibraryResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetLibraryErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetLibraryErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetLibraryErrors>> 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 GetLibraryResponseBody build() {
|
||||
return new GetLibraryResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetMetadataChildrenErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetMetadataChildrenErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetMetadataChildrenErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetMetadataChildrenErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetMetadataChildrenErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetMetadataChildrenResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetMetadataChildrenResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetMetadataChildrenErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetMetadataChildrenResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetMetadataChildrenErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetMetadataChildrenResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetMetadataChildrenErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetMetadataChildrenResponseBody withErrors(java.util.List<GetMetadataChildrenErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMetadataChildrenResponseBody withErrors(Optional<? extends java.util.List<GetMetadataChildrenErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetMetadataChildrenResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetMetadataChildrenResponseBody 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;
|
||||
}
|
||||
GetMetadataChildrenResponseBody other = (GetMetadataChildrenResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMetadataChildrenResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetMetadataChildrenErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetMetadataChildrenErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetMetadataChildrenErrors>> 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 GetMetadataChildrenResponseBody build() {
|
||||
return new GetMetadataChildrenResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetMetadataErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetMetadataErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetMetadataErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetMetadataErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetMetadataErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetMetadataResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetMetadataResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetMetadataErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetMetadataResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetMetadataErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetMetadataResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetMetadataErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetMetadataResponseBody withErrors(java.util.List<GetMetadataErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMetadataResponseBody withErrors(Optional<? extends java.util.List<GetMetadataErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetMetadataResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetMetadataResponseBody 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;
|
||||
}
|
||||
GetMetadataResponseBody other = (GetMetadataResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMetadataResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetMetadataErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetMetadataErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetMetadataErrors>> 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 GetMetadataResponseBody build() {
|
||||
return new GetMetadataResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetMyPlexAccountErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetMyPlexAccountErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetMyPlexAccountErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetMyPlexAccountErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetMyPlexAccountErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetMyPlexAccountResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetMyPlexAccountResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetMyPlexAccountErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetMyPlexAccountResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetMyPlexAccountErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetMyPlexAccountResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetMyPlexAccountErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetMyPlexAccountResponseBody withErrors(java.util.List<GetMyPlexAccountErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMyPlexAccountResponseBody withErrors(Optional<? extends java.util.List<GetMyPlexAccountErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetMyPlexAccountResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetMyPlexAccountResponseBody 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;
|
||||
}
|
||||
GetMyPlexAccountResponseBody other = (GetMyPlexAccountResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMyPlexAccountResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetMyPlexAccountErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetMyPlexAccountErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetMyPlexAccountErrors>> 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 GetMyPlexAccountResponseBody build() {
|
||||
return new GetMyPlexAccountResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetOnDeckErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetOnDeckErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetOnDeckErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetOnDeckErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetOnDeckErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetOnDeckResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetOnDeckResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetOnDeckErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetOnDeckResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetOnDeckErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetOnDeckResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetOnDeckErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetOnDeckResponseBody withErrors(java.util.List<GetOnDeckErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetOnDeckResponseBody withErrors(Optional<? extends java.util.List<GetOnDeckErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetOnDeckResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetOnDeckResponseBody 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;
|
||||
}
|
||||
GetOnDeckResponseBody other = (GetOnDeckResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetOnDeckResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetOnDeckErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetOnDeckErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetOnDeckErrors>> 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 GetOnDeckResponseBody build() {
|
||||
return new GetOnDeckResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetPinErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetPinErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetPinErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetPinErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetPinErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetPinResponseBody - X-Plex-Client-Identifier is missing
|
||||
*/
|
||||
public class GetPinResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetPinErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetPinResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetPinErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetPinResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetPinErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetPinResponseBody withErrors(java.util.List<GetPinErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetPinResponseBody withErrors(Optional<? extends java.util.List<GetPinErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetPinResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetPinResponseBody 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;
|
||||
}
|
||||
GetPinResponseBody other = (GetPinResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetPinResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetPinErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetPinErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetPinErrors>> 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 GetPinResponseBody build() {
|
||||
return new GetPinResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetPlaylistContentsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetPlaylistContentsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetPlaylistContentsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetPlaylistContentsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetPlaylistContentsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetPlaylistContentsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetPlaylistContentsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetPlaylistContentsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetPlaylistContentsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetPlaylistContentsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetPlaylistContentsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetPlaylistContentsResponseBody withErrors(java.util.List<GetPlaylistContentsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetPlaylistContentsResponseBody withErrors(Optional<? extends java.util.List<GetPlaylistContentsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetPlaylistContentsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetPlaylistContentsResponseBody 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;
|
||||
}
|
||||
GetPlaylistContentsResponseBody other = (GetPlaylistContentsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetPlaylistContentsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetPlaylistContentsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetPlaylistContentsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetPlaylistContentsErrors>> 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 GetPlaylistContentsResponseBody build() {
|
||||
return new GetPlaylistContentsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetPlaylistErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetPlaylistErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetPlaylistErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetPlaylistErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetPlaylistErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetPlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetPlaylistResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetPlaylistErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetPlaylistResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetPlaylistErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetPlaylistResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetPlaylistErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetPlaylistResponseBody withErrors(java.util.List<GetPlaylistErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetPlaylistResponseBody withErrors(Optional<? extends java.util.List<GetPlaylistErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetPlaylistResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetPlaylistResponseBody 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;
|
||||
}
|
||||
GetPlaylistResponseBody other = (GetPlaylistResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetPlaylistResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetPlaylistErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetPlaylistErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetPlaylistErrors>> 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 GetPlaylistResponseBody build() {
|
||||
return new GetPlaylistResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetPlaylistsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetPlaylistsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetPlaylistsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetPlaylistsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetPlaylistsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetPlaylistsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetPlaylistsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetPlaylistsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetPlaylistsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetPlaylistsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetPlaylistsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetPlaylistsResponseBody withErrors(java.util.List<GetPlaylistsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetPlaylistsResponseBody withErrors(Optional<? extends java.util.List<GetPlaylistsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetPlaylistsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetPlaylistsResponseBody 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;
|
||||
}
|
||||
GetPlaylistsResponseBody other = (GetPlaylistsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetPlaylistsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetPlaylistsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetPlaylistsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetPlaylistsErrors>> 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 GetPlaylistsResponseBody build() {
|
||||
return new GetPlaylistsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetRecentlyAddedErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetRecentlyAddedErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetRecentlyAddedErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetRecentlyAddedErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetRecentlyAddedErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetRecentlyAddedResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetRecentlyAddedResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetRecentlyAddedErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetRecentlyAddedResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetRecentlyAddedErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetRecentlyAddedResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetRecentlyAddedErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetRecentlyAddedResponseBody withErrors(java.util.List<GetRecentlyAddedErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetRecentlyAddedResponseBody withErrors(Optional<? extends java.util.List<GetRecentlyAddedErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetRecentlyAddedResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetRecentlyAddedResponseBody 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;
|
||||
}
|
||||
GetRecentlyAddedResponseBody other = (GetRecentlyAddedResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetRecentlyAddedResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetRecentlyAddedErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetRecentlyAddedErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetRecentlyAddedErrors>> 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 GetRecentlyAddedResponseBody build() {
|
||||
return new GetRecentlyAddedResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetResizedPhotoErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetResizedPhotoErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetResizedPhotoErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetResizedPhotoErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetResizedPhotoErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetResizedPhotoResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class GetResizedPhotoResponseBody {
|
||||
public class GetResizedPhotoResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetResizedPhotoErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetResizedPhotoResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetResizedPhotoErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetResizedPhotoErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetResizedPhotoResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetResizedPhotoErrors>> errors() {
|
||||
public Optional<? extends java.util.List<GetResizedPhotoErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class GetResizedPhotoResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public GetResizedPhotoResponseBody withErrors(Optional<? extends java.util.List<GetResizedPhotoErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetResizedPhotoResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetResizedPhotoResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class GetResizedPhotoResponseBody {
|
||||
return false;
|
||||
}
|
||||
GetResizedPhotoResponseBody other = (GetResizedPhotoResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetResizedPhotoResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetResizedPhotoErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<GetResizedPhotoErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class GetResizedPhotoResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetResizedPhotoErrors>> 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 GetResizedPhotoResponseBody build() {
|
||||
return new GetResizedPhotoResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
public class GetResourcesStatisticsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("code")
|
||||
private Optional<? extends Double> code;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("message")
|
||||
private Optional<? extends String> message;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetResourcesStatisticsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@JsonProperty("status") Optional<? extends Double> status) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
Utils.checkNotNull(message, "message");
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsErrors withCode(double code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsErrors withCode(Optional<? extends Double> code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsErrors withMessage(String message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = Optional.ofNullable(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsErrors withMessage(Optional<? extends String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsErrors withStatus(double status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsErrors withStatus(Optional<? extends Double> 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;
|
||||
}
|
||||
GetResourcesStatisticsErrors other = (GetResourcesStatisticsErrors) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.code, other.code) &&
|
||||
java.util.Objects.deepEquals(this.message, other.message) &&
|
||||
java.util.Objects.deepEquals(this.status, other.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetResourcesStatisticsErrors.class,
|
||||
"code", code,
|
||||
"message", message,
|
||||
"status", status);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends Double> code = Optional.empty();
|
||||
|
||||
private Optional<? extends String> message = Optional.empty();
|
||||
|
||||
private Optional<? extends Double> status = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder code(double code) {
|
||||
Utils.checkNotNull(code, "code");
|
||||
this.code = Optional.ofNullable(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder code(Optional<? extends Double> 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<? extends String> message) {
|
||||
Utils.checkNotNull(message, "message");
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(double status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = Optional.ofNullable(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder status(Optional<? extends Double> status) {
|
||||
Utils.checkNotNull(status, "status");
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsErrors build() {
|
||||
return new GetResourcesStatisticsErrors(
|
||||
code,
|
||||
message,
|
||||
status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetResourcesStatisticsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetResourcesStatisticsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetResourcesStatisticsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetResourcesStatisticsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetResourcesStatisticsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetResourcesStatisticsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsResponseBody withErrors(java.util.List<GetResourcesStatisticsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetResourcesStatisticsResponseBody withErrors(Optional<? extends java.util.List<GetResourcesStatisticsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetResourcesStatisticsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetResourcesStatisticsResponseBody 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;
|
||||
}
|
||||
GetResourcesStatisticsResponseBody other = (GetResourcesStatisticsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetResourcesStatisticsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetResourcesStatisticsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetResourcesStatisticsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetResourcesStatisticsErrors>> 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 GetResourcesStatisticsResponseBody build() {
|
||||
return new GetResourcesStatisticsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetSearchResultsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetSearchResultsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchResultsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetSearchResultsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetSearchResultsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetSearchResultsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetSearchResultsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetSearchResultsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetSearchResultsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetSearchResultsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetSearchResultsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetSearchResultsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSearchResultsResponseBody withErrors(java.util.List<GetSearchResultsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSearchResultsResponseBody withErrors(Optional<? extends java.util.List<GetSearchResultsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSearchResultsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSearchResultsResponseBody 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;
|
||||
}
|
||||
GetSearchResultsResponseBody other = (GetSearchResultsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSearchResultsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetSearchResultsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetSearchResultsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetSearchResultsErrors>> 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 GetSearchResultsResponseBody build() {
|
||||
return new GetSearchResultsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetServerActivitiesErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetServerActivitiesErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerActivitiesErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetServerActivitiesErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetServerActivitiesErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetServerActivitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetServerActivitiesResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetServerActivitiesErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerActivitiesResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetServerActivitiesErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetServerActivitiesResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetServerActivitiesErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetServerActivitiesResponseBody withErrors(java.util.List<GetServerActivitiesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetServerActivitiesResponseBody withErrors(Optional<? extends java.util.List<GetServerActivitiesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerActivitiesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerActivitiesResponseBody 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;
|
||||
}
|
||||
GetServerActivitiesResponseBody other = (GetServerActivitiesResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetServerActivitiesResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetServerActivitiesErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetServerActivitiesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetServerActivitiesErrors>> 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 GetServerActivitiesResponseBody build() {
|
||||
return new GetServerActivitiesResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetServerCapabilitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetServerCapabilitiesResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<Errors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerCapabilitiesResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<Errors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetServerCapabilitiesResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<Errors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetServerCapabilitiesResponseBody withErrors(java.util.List<Errors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetServerCapabilitiesResponseBody withErrors(Optional<? extends java.util.List<Errors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerCapabilitiesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerCapabilitiesResponseBody 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;
|
||||
}
|
||||
GetServerCapabilitiesResponseBody other = (GetServerCapabilitiesResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetServerCapabilitiesResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<Errors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<Errors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<Errors>> 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 GetServerCapabilitiesResponseBody build() {
|
||||
return new GetServerCapabilitiesResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetServerIdentityErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetServerIdentityErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerIdentityErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetServerIdentityErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetServerIdentityErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetServerIdentityResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetServerIdentityResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetServerIdentityErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerIdentityResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetServerIdentityErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetServerIdentityResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetServerIdentityErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetServerIdentityResponseBody withErrors(java.util.List<GetServerIdentityErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetServerIdentityResponseBody withErrors(Optional<? extends java.util.List<GetServerIdentityErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerIdentityResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerIdentityResponseBody 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;
|
||||
}
|
||||
GetServerIdentityResponseBody other = (GetServerIdentityResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetServerIdentityResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetServerIdentityErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetServerIdentityErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetServerIdentityErrors>> 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 GetServerIdentityResponseBody build() {
|
||||
return new GetServerIdentityResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetServerListErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetServerListErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerListErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetServerListErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetServerListErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetServerListResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetServerListResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetServerListErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerListResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetServerListErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetServerListResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetServerListErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetServerListResponseBody withErrors(java.util.List<GetServerListErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetServerListResponseBody withErrors(Optional<? extends java.util.List<GetServerListErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerListResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerListResponseBody 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;
|
||||
}
|
||||
GetServerListResponseBody other = (GetServerListResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetServerListResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetServerListErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetServerListErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetServerListErrors>> 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 GetServerListResponseBody build() {
|
||||
return new GetServerListResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetServerPreferencesErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetServerPreferencesErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerPreferencesErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetServerPreferencesErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetServerPreferencesErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetServerPreferencesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetServerPreferencesResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetServerPreferencesErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetServerPreferencesResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetServerPreferencesErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetServerPreferencesResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetServerPreferencesErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetServerPreferencesResponseBody withErrors(java.util.List<GetServerPreferencesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetServerPreferencesResponseBody withErrors(Optional<? extends java.util.List<GetServerPreferencesErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerPreferencesResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetServerPreferencesResponseBody 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;
|
||||
}
|
||||
GetServerPreferencesResponseBody other = (GetServerPreferencesResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetServerPreferencesResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetServerPreferencesErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetServerPreferencesErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetServerPreferencesErrors>> 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 GetServerPreferencesResponseBody build() {
|
||||
return new GetServerPreferencesResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetSessionHistoryErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetSessionHistoryErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetSessionHistoryErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetSessionHistoryErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetSessionHistoryErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetSessionHistoryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetSessionHistoryResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetSessionHistoryErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetSessionHistoryResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetSessionHistoryErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetSessionHistoryResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetSessionHistoryErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSessionHistoryResponseBody withErrors(java.util.List<GetSessionHistoryErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSessionHistoryResponseBody withErrors(Optional<? extends java.util.List<GetSessionHistoryErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSessionHistoryResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSessionHistoryResponseBody 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;
|
||||
}
|
||||
GetSessionHistoryResponseBody other = (GetSessionHistoryResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSessionHistoryResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetSessionHistoryErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetSessionHistoryErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetSessionHistoryErrors>> 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 GetSessionHistoryResponseBody build() {
|
||||
return new GetSessionHistoryResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetSessionsErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetSessionsErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetSessionsErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetSessionsErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetSessionsErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetSessionsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
public class GetSessionsResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetSessionsErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetSessionsResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetSessionsErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetSessionsResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetSessionsErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetSessionsResponseBody withErrors(java.util.List<GetSessionsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetSessionsResponseBody withErrors(Optional<? extends java.util.List<GetSessionsErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSessionsResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSessionsResponseBody 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;
|
||||
}
|
||||
GetSessionsResponseBody other = (GetSessionsResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSessionsResponseBody.class,
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetSessionsErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder errors(java.util.List<GetSessionsErrors> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetSessionsErrors>> 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 GetSessionsResponseBody build() {
|
||||
return new GetSessionsResponseBody(
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -16,7 +18,6 @@ import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
|
||||
public class GetSourceConnectionInformationErrors {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@@ -31,6 +32,7 @@ public class GetSourceConnectionInformationErrors {
|
||||
@JsonProperty("status")
|
||||
private Optional<? extends Double> status;
|
||||
|
||||
@JsonCreator
|
||||
public GetSourceConnectionInformationErrors(
|
||||
@JsonProperty("code") Optional<? extends Double> code,
|
||||
@JsonProperty("message") Optional<? extends String> message,
|
||||
@@ -42,17 +44,27 @@ public class GetSourceConnectionInformationErrors {
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> code() {
|
||||
return code;
|
||||
|
||||
public GetSourceConnectionInformationErrors() {
|
||||
this(Optional.empty(), Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends String> message() {
|
||||
return message;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> code() {
|
||||
return (Optional<Double>) code;
|
||||
}
|
||||
|
||||
public Optional<? extends Double> status() {
|
||||
return status;
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<String> message() {
|
||||
return (Optional<String>) message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<Double> status() {
|
||||
return (Optional<Double>) status;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -2,9 +2,11 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
package lukehagar.plexapi.plexapi.models.operations;
|
||||
package lukehagar.plexapi.plexapi.models.errors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -13,29 +15,51 @@ import java.io.InputStream;
|
||||
import java.lang.Deprecated;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.utils.Utils;
|
||||
|
||||
/**
|
||||
* GetSourceConnectionInformationResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
|
||||
public class GetSourceConnectionInformationResponseBody {
|
||||
public class GetSourceConnectionInformationResponseBody extends RuntimeException {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("errors")
|
||||
private Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> errors;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("-")
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public GetSourceConnectionInformationResponseBody(
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> errors) {
|
||||
@JsonProperty("errors") Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> errors,
|
||||
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.errors = errors;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
public GetSourceConnectionInformationResponseBody() {
|
||||
this(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> errors() {
|
||||
public Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> errors(){
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Optional<? extends HttpResponse<InputStream>> rawResponse(){
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -45,13 +69,31 @@ public class GetSourceConnectionInformationResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public GetSourceConnectionInformationResponseBody withErrors(Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> errors) {
|
||||
Utils.checkNotNull(errors, "errors");
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSourceConnectionInformationResponseBody withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = Optional.ofNullable(rawResponse);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetSourceConnectionInformationResponseBody 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) {
|
||||
@@ -61,26 +103,31 @@ public class GetSourceConnectionInformationResponseBody {
|
||||
return false;
|
||||
}
|
||||
GetSourceConnectionInformationResponseBody other = (GetSourceConnectionInformationResponseBody) o;
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors);
|
||||
return
|
||||
java.util.Objects.deepEquals(this.errors, other.errors) &&
|
||||
java.util.Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetSourceConnectionInformationResponseBody.class,
|
||||
"errors", errors);
|
||||
"errors", errors,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> errors = Optional.empty();
|
||||
|
||||
|
||||
private Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> errors = Optional.empty();
|
||||
|
||||
private Optional<? extends HttpResponse<InputStream>> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
@@ -90,17 +137,35 @@ public class GetSourceConnectionInformationResponseBody {
|
||||
this.errors = Optional.ofNullable(errors);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Builder errors(Optional<? extends java.util.List<GetSourceConnectionInformationErrors>> 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 GetSourceConnectionInformationResponseBody build() {
|
||||
return new GetSourceConnectionInformationResponseBody(
|
||||
errors);
|
||||
errors,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user