nuking repo

This commit is contained in:
Luke Hagar
2024-07-01 16:02:39 +00:00
parent 791c875755
commit e01292f115
1051 changed files with 0 additions and 152151 deletions

View File

@@ -1,282 +0,0 @@
/*
* 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.openapitools.jackson.nullable.JsonNullable;
/**
* Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
* Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.
* Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
* - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
* - They must contain an `type` which is used by clients to distinguish the specific activity.
* - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
* - The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
*
*/
public class Activities implements
MethodCallGetServerActivities,
MethodCallCancelServerActivities {
private final SDKConfiguration sdkConfiguration;
Activities(SDKConfiguration sdkConfiguration) {
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);
}
/**
* Get Server Activities
* Get Server Activities
* @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 = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/activities");
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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse cancelServerActivities(
String activityUUID) throws Exception {
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequest request =
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequest
.builder()
.activityUUID(activityUUID)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesRequest.class,
_baseUrl,
"/activities/{activityUUID}",
request, this.sdkConfiguration.globals);
HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
}

View File

@@ -1,291 +0,0 @@
/*
* 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 regarding authentication for Plex Media Server
*
*/
public class Authentication implements
MethodCallGetTransientToken,
MethodCallGetSourceConnectionInformation {
private final SDKConfiguration sdkConfiguration;
Authentication(SDKConfiguration sdkConfiguration) {
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);
}
/**
* Get a Transient Token.
* This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
*
* @param type `delegation` - This is the only supported `type` parameter.
* @param scope `all` - This is the only supported `scope` parameter.
* @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,
lukehagar.plexapi.plexapi.models.operations.Scope scope) throws Exception {
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequest request =
lukehagar.plexapi.plexapi.models.operations.GetTransientTokenRequest
.builder()
.type(type)
.scope(scope)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/security/token");
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.GetTransientTokenRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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 Source Connection Information
* If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
* Note: requires Plex Media Server &gt;= 1.15.4.
*
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequestBuilder getSourceConnectionInformation() {
return new lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequestBuilder(this);
}
/**
* Get Source Connection Information
* If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
* Note: requires Plex Media Server &gt;= 1.15.4.
*
* @param source The source identifier with an included prefix.
* @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 {
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequest request =
lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationRequest
.builder()
.source(source)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/security/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.GetSourceConnectionInformationRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
}

View File

@@ -1,634 +0,0 @@
/*
* 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.openapitools.jackson.nullable.JsonNullable;
/**
* Butler is the task manager of the Plex Media Server Ecosystem.
*
*/
public class Butler implements
MethodCallGetButlerTasks,
MethodCallStartAllTasks,
MethodCallStopAllTasks,
MethodCallStartTask,
MethodCallStopTask {
private final SDKConfiguration sdkConfiguration;
Butler(SDKConfiguration sdkConfiguration) {
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);
}
/**
* Get Butler tasks
* Returns a list of butler tasks
* @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 = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/butler");
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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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);
}
/**
* 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 response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse startAllTasksDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/butler");
HTTPRequest _req = new HTTPRequest(_url, "POST");
_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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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 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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse stopAllTasksDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/butler");
HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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 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);
}
/**
* Start a single Butler task
* This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
* 1. Any tasks not scheduled to run on the current day will be skipped.
* 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
* 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
* 4. If we are outside the configured window, the task will start immediately.
*
* @param taskName the name of the task to be started.
* @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 {
lukehagar.plexapi.plexapi.models.operations.StartTaskRequest request =
lukehagar.plexapi.plexapi.models.operations.StartTaskRequest
.builder()
.taskName(taskName)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
lukehagar.plexapi.plexapi.models.operations.StartTaskRequest.class,
_baseUrl,
"/butler/{taskName}",
request, this.sdkConfiguration.globals);
HTTPRequest _req = new HTTPRequest(_url, "POST");
_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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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 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);
}
/**
* Stop a single Butler task
* This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
*
* @param taskName The name of the task to be started.
* @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 {
lukehagar.plexapi.plexapi.models.operations.StopTaskRequest request =
lukehagar.plexapi.plexapi.models.operations.StopTaskRequest
.builder()
.taskName(taskName)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
lukehagar.plexapi.plexapi.models.operations.StopTaskRequest.class,
_baseUrl,
"/butler/{taskName}",
request, this.sdkConfiguration.globals);
HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
}

View File

@@ -1,338 +0,0 @@
/*
* 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;
/**
* Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
*
*/
public class Hubs implements
MethodCallGetGlobalHubs,
MethodCallGetLibraryHubs {
private final SDKConfiguration sdkConfiguration;
Hubs(SDKConfiguration sdkConfiguration) {
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
*/
public lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse getGlobalHubs(
Optional<? extends Double> count,
Optional<? extends lukehagar.plexapi.plexapi.models.operations.OnlyTransient> onlyTransient) throws Exception {
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequest request =
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsRequest
.builder()
.count(count)
.onlyTransient(onlyTransient)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/hubs");
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.GetGlobalHubsRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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
*
* @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
*/
public lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse getLibraryHubs(
double sectionId,
Optional<? extends Double> count,
Optional<? extends lukehagar.plexapi.plexapi.models.operations.QueryParamOnlyTransient> onlyTransient) throws Exception {
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest request =
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest
.builder()
.sectionId(sectionId)
.count(count)
.onlyTransient(onlyTransient)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsRequest.class,
_baseUrl,
"/hubs/sections/{sectionId}",
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.GetLibraryHubsRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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

View File

@@ -1,446 +0,0 @@
/*
* 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.SerializedBody;
import lukehagar.plexapi.plexapi.utils.Utils;
import org.apache.http.NameValuePair;
import org.openapitools.jackson.nullable.JsonNullable;
/**
* Submit logs to the Log Handler for Plex Media Server
*
*/
public class Log implements
MethodCallLogLine,
MethodCallLogMultiLine,
MethodCallEnablePaperTrail {
private final SDKConfiguration sdkConfiguration;
Log(SDKConfiguration sdkConfiguration) {
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);
}
/**
* Logging a single line message.
* This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
*
* @param level An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose
* @param message The text of the message to write to the log.
* @param source a string indicating the source of the message.
* @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,
String message,
String source) throws Exception {
lukehagar.plexapi.plexapi.models.operations.LogLineRequest request =
lukehagar.plexapi.plexapi.models.operations.LogLineRequest
.builder()
.level(level)
.message(message)
.source(source)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/log");
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.LogLineRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
/**
* Logging a multi-line message
* This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
* It accepts a text/plain request body, where each line represents a distinct log entry.
* Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
*
* Log entries are separated by a newline character (`\n`).
* Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
* This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
*
* The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
* - `0`: Error - Critical issues that require immediate attention.
* - `1`: Warning - Important events that are not critical but may indicate potential issues.
* - `2`: Info - General informational messages about system operation.
* - `3`: Debug - Detailed information useful for debugging purposes.
* - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
*
* The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
*
* Example of a single log entry format:
* `level=4&amp;message=Sample%20log%20entry&amp;source=applicationName`
*
* Ensure each parameter is properly URL-encoded to avoid interpretation issues.
*
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.LogMultiLineRequestBuilder logMultiLine() {
return new lukehagar.plexapi.plexapi.models.operations.LogMultiLineRequestBuilder(this);
}
/**
* Logging a multi-line message
* This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
* It accepts a text/plain request body, where each line represents a distinct log entry.
* Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
*
* Log entries are separated by a newline character (`\n`).
* Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
* This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
*
* The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
* - `0`: Error - Critical issues that require immediate attention.
* - `1`: Warning - Important events that are not critical but may indicate potential issues.
* - `2`: Info - General informational messages about system operation.
* - `3`: Debug - Detailed information useful for debugging purposes.
* - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
*
* The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
*
* Example of a single log entry format:
* `level=4&amp;message=Sample%20log%20entry&amp;source=applicationName`
*
* Ensure each parameter is properly URL-encoded to avoid interpretation issues.
*
* @param request The request object containing all of the parameters for the API call.
* @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 = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/log");
HTTPRequest _req = new HTTPRequest(_url, "POST");
Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT,
new TypeReference<String>() {});
SerializedBody _serializedRequestBody = Utils.serializeRequestBody(
_convertedRequest, "request", "string", false);
if (_serializedRequestBody == null) {
throw new Exception("Request body is required");
}
_req.setBody(Optional.ofNullable(_serializedRequestBody));
_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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
/**
* 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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse enablePaperTrailDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/log/networked");
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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
}

View File

@@ -1,411 +0,0 @@
/*
* 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 interacting with Plex Media Server Media
*
*/
public class Media implements
MethodCallMarkPlayed,
MethodCallMarkUnplayed,
MethodCallUpdatePlayProgress {
private final SDKConfiguration sdkConfiguration;
Media(SDKConfiguration sdkConfiguration) {
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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse markPlayed(
double key) throws Exception {
lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequest request =
lukehagar.plexapi.plexapi.models.operations.MarkPlayedRequest
.builder()
.key(key)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/:/scrobble");
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.MarkPlayedRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
/**
* 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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse markUnplayed(
double key) throws Exception {
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequest request =
lukehagar.plexapi.plexapi.models.operations.MarkUnplayedRequest
.builder()
.key(key)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/:/unscrobble");
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.MarkUnplayedRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
/**
* 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);
}
/**
* Update Media Play Progress
* This API command can be used to update the play progress of a media item.
*
* @param key the media key
* @param time The time, in milliseconds, used to set the media playback progress.
* @param state The playback state of the media item.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse updatePlayProgress(
String key,
double time,
String state) throws Exception {
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequest request =
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequest
.builder()
.key(key)
.time(time)
.state(state)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/:/progress");
HTTPRequest _req = new HTTPRequest(_url, "POST");
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
this.sdkConfiguration.userAgent);
_req.addQueryParams(Utils.getQueryParams(
lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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

View File

@@ -1,481 +0,0 @@
/*
* 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.time.OffsetDateTime;
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 directly against https://Plex.tv
*
*/
public class Plex implements
MethodCallGetHomeData,
MethodCallGetPin,
MethodCallGetToken {
/**
* GET_PIN_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_PIN_SERVERS = {
"https://plex.tv/api/v2",
};
/**
* GET_TOKEN_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_TOKEN_SERVERS = {
"https://plex.tv/api/v2",
};
private final SDKConfiguration sdkConfiguration;
Plex(SDKConfiguration sdkConfiguration) {
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
* @param strong Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
* @param xPlexClientIdentifier The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
* @param 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
*/
public lukehagar.plexapi.plexapi.models.operations.GetPinResponse getPin(
Optional<? extends Boolean> strong,
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 = Utils.templateUrl(GET_PIN_SERVERS[0], new java.util.HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
}
String _url = Utils.generateURL(
_baseUrl,
"/pins");
HTTPRequest _req = new HTTPRequest(_url, "POST");
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
this.sdkConfiguration.userAgent);
_req.addQueryParams(Utils.getQueryParams(
lukehagar.plexapi.plexapi.models.operations.GetPinRequest.class,
request,
this.sdkConfiguration.globals));
_req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals));
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl("getPin", Optional.of(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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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")) {
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
* @param pinID The PinID to retrieve an access token for
* @param xPlexClientIdentifier The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
* @param 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.GetTokenResponse getToken(
String pinID,
Optional<? extends String> xPlexClientIdentifier,
java.util.Optional<String> serverURL) throws Exception {
lukehagar.plexapi.plexapi.models.operations.GetTokenRequest request =
lukehagar.plexapi.plexapi.models.operations.GetTokenRequest
.builder()
.pinID(pinID)
.xPlexClientIdentifier(xPlexClientIdentifier)
.build();
String _baseUrl = Utils.templateUrl(GET_TOKEN_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.GetTokenRequest.class,
_baseUrl,
"/pins/{pinID}",
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));
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.toByteArrayAndClose(_httpRes.body()));
}
}
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()));
}
}

View File

@@ -1,515 +0,0 @@
/*
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
*/
package lukehagar.plexapi.plexapi;
import com.fasterxml.jackson.annotation.JsonValue;
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;
import org.openapitools.jackson.nullable.JsonNullable;
/**
* Plex-API: A Plex Media Server API Map
* 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.
*/
public static final String[] SERVERS = {
/**
* The full address of your Plex Server
*/
"{protocol}://{ip}:{port}",
};
/**
* Operations against the Plex Media Server System.
*
*/
private final Server server;
/**
* API Calls interacting with Plex Media Server Media
*
*/
private final Media media;
/**
* API Calls that perform operations with Plex Media Server Videos
*
*/
private final Video video;
/**
* Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
* Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.
* Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
* - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
* - They must contain an `type` which is used by clients to distinguish the specific activity.
* - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
* - The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
*
*/
private final Activities activities;
/**
* Butler is the task manager of the Plex Media Server Ecosystem.
*
*/
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.
*
*/
private final Hubs hubs;
/**
* API Calls that perform search operations with Plex Media Server
*
*/
private final Search search;
/**
* API Calls interacting with Plex Media Server Libraries
*
*/
private final Library library;
/**
* Submit logs to the Log Handler for Plex Media Server
*
*/
private final Log log;
/**
* 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.
* Retrieving a playlist, or its items, will trigger a refresh of its metadata.
* This may cause the duration and number of items to change.
*
*/
private final Playlists playlists;
/**
* API Calls regarding authentication for Plex Media Server
*
*/
private final Authentication authentication;
/**
* API Calls that perform operations with Plex Media Server Statistics
*
*/
private final Statistics statistics;
/**
* API Calls that perform search operations with Plex Media Server Sessions
*
*/
private final Sessions sessions;
/**
* This describes the API for searching and applying updates to the Plex Media Server.
* Updates to the status can be observed via the Event API.
*
*/
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.
*
*/
public Server server() {
return server;
}
/**
* API Calls interacting with Plex Media Server Media
*
*/
public Media media() {
return media;
}
/**
* API Calls that perform operations with Plex Media Server Videos
*
*/
public Video video() {
return video;
}
/**
* Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
* Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.
* Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
* - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
* - They must contain an `type` which is used by clients to distinguish the specific activity.
* - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
* - The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
*
*/
public Activities activities() {
return activities;
}
/**
* Butler is the task manager of the Plex Media Server Ecosystem.
*
*/
public Butler butler() {
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.
*
*/
public Hubs hubs() {
return hubs;
}
/**
* API Calls that perform search operations with Plex Media Server
*
*/
public Search search() {
return search;
}
/**
* API Calls interacting with Plex Media Server Libraries
*
*/
public Library library() {
return library;
}
/**
* Submit logs to the Log Handler for Plex Media Server
*
*/
public Log log() {
return log;
}
/**
* 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.
* Retrieving a playlist, or its items, will trigger a refresh of its metadata.
* This may cause the duration and number of items to change.
*
*/
public Playlists playlists() {
return playlists;
}
/**
* API Calls regarding authentication for Plex Media Server
*
*/
public Authentication authentication() {
return authentication;
}
/**
* API Calls that perform operations with Plex Media Server Statistics
*
*/
public Statistics statistics() {
return statistics;
}
/**
* API Calls that perform search operations with Plex Media Server Sessions
*
*/
public Sessions sessions() {
return sessions;
}
/**
* This describes the API for searching and applying updates to the Plex Media Server.
* Updates to the status can be observed via the Event API.
*
*/
public Updater updater() {
return updater;
}
/**
* API Calls that perform operations with Plex Media Server Watchlists
*
*/
public Watchlist watchlist() {
return watchlist;
}
private final SDKConfiguration sdkConfiguration;
/**
* The Builder class allows the configuration of a new instance of the SDK.
*/
public static class Builder {
private final SDKConfiguration sdkConfiguration = new SDKConfiguration();
private Builder() {
}
/**
* Allows the default HTTP client to be overridden with a custom implementation.
*
* @param client The HTTP client to use for all requests.
* @return The builder instance.
*/
public Builder client(HTTPClient client) {
this.sdkConfiguration.defaultClient = client;
return this;
}
/**
* Configures the SDK security to use the provided secret.
*
* @param accessToken The secret to use for all requests.
* @return The builder instance.
*/
public Builder accessToken(String accessToken) {
this.sdkConfiguration.securitySource = SecuritySource.of(lukehagar.plexapi.plexapi.models.shared.Security.builder()
.accessToken(accessToken)
.build());
return this;
}
/**
* Configures the SDK to use a custom security source.
* @param securitySource The security source to use for all requests.
* @return The builder instance.
*/
public Builder securitySource(SecuritySource securitySource) {
this.sdkConfiguration.securitySource = securitySource;
return this;
}
/**
* Overrides the default server URL.
*
* @param serverUrl The server URL to use for all requests.
* @return The builder instance.
*/
public Builder serverURL(String serverUrl) {
this.sdkConfiguration.serverUrl = serverUrl;
return this;
}
/**
* Overrides the default server URL with a templated URL populated with the provided parameters.
*
* @param serverUrl The server URL to use for all requests.
* @param params The parameters to use when templating the URL.
* @return The builder instance.
*/
public Builder serverURL(String serverUrl, java.util.Map<String, String> params) {
this.sdkConfiguration.serverUrl = lukehagar.plexapi.plexapi.utils.Utils.templateUrl(serverUrl, params);
return this;
}
/**
* Overrides the default server by index.
*
* @param serverIdx The server to use for all requests.
* @return The builder instance.
*/
public Builder serverIndex(int serverIdx) {
this.sdkConfiguration.serverIdx = serverIdx;
this.sdkConfiguration.serverUrl = SERVERS[serverIdx];
return this;
}
/**
* Overrides the default configuration for retries
*
* @param retryConfig The retry configuration to use for all requests.
* @return The builder instance.
*/
public Builder retryConfig(RetryConfig retryConfig) {
this.sdkConfiguration.retryConfig = Optional.of(retryConfig);
return this;
}
public enum ServerProtocol {
HTTP("http"),
HTTPS("https");
@JsonValue
private final String value;
private ServerProtocol(String value) {
this.value = value;
}
public String value() {
return value;
}
}
/**
* Sets the protocol variable for url substitution.
*
* @param protocol The value to set.
* @return The builder instance.
*/
public Builder protocol(ServerProtocol protocol) {
for (java.util.Map<String, String> server : this.sdkConfiguration.serverDefaults) {
if (!server.containsKey("protocol")) {
continue;
}
server.put("protocol", protocol.toString());
}
return this;
}
/**
* Sets the ip variable for url substitution.
*
* @param ip The value to set.
* @return The builder instance.
*/
public Builder ip(String ip) {
for (java.util.Map<String, String> server : this.sdkConfiguration.serverDefaults) {
if (!server.containsKey("ip")) {
continue;
}
server.put("ip", ip.toString());
}
return this;
}
/**
* Sets the port variable for url substitution.
*
* @param port The value to set.
* @return The builder instance.
*/
public Builder port(String port) {
for (java.util.Map<String, String> server : this.sdkConfiguration.serverDefaults) {
if (!server.containsKey("port")) {
continue;
}
server.put("port", port.toString());
}
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.
*/
public PlexAPI build() {
if (sdkConfiguration.defaultClient == null) {
sdkConfiguration.defaultClient = new SpeakeasyHTTPClient();
}
if (sdkConfiguration.securitySource == null) {
sdkConfiguration.securitySource = SecuritySource.of(null);
}
if (sdkConfiguration.serverUrl == null || sdkConfiguration.serverUrl.isBlank()) {
sdkConfiguration.serverUrl = SERVERS[0];
sdkConfiguration.serverIdx = 0;
}
if (sdkConfiguration.serverUrl.endsWith("/")) {
sdkConfiguration.serverUrl = sdkConfiguration.serverUrl.substring(0, sdkConfiguration.serverUrl.length() - 1);
}
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.
*/
public static Builder builder() {
return new Builder();
}
private PlexAPI(SDKConfiguration sdkConfiguration) {
this.sdkConfiguration = sdkConfiguration;
this.server = new Server(sdkConfiguration);
this.media = new Media(sdkConfiguration);
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.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();
}}

View File

@@ -1,73 +0,0 @@
/*
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
*/
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;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Optional;
class SDKConfiguration {
public SecuritySource securitySource;
public Optional<SecuritySource> securitySource() {
return Optional.ofNullable(securitySource);
}
public HTTPClient defaultClient;
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.1.1";
public String genVersion = "2.356.0";
public String userAgent = "speakeasy-sdk/java 0.1.1 2.356.0 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();
}

View File

@@ -1,496 +0,0 @@
/*
* 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 search operations with Plex Media Server
*
*/
public class Search implements
MethodCallPerformSearch,
MethodCallPerformVoiceSearch,
MethodCallGetSearchResults {
private final SDKConfiguration sdkConfiguration;
Search(SDKConfiguration sdkConfiguration) {
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).
* - `&lt;hub identifier&gt;`: 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).
* - `&lt;hub identifier&gt;`: 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).
*
* 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).
* - `&lt;hub identifier&gt;`: 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
* @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
*/
public lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse performSearch(
String query,
Optional<? extends Double> sectionId,
Optional<? extends Double> limit) throws Exception {
lukehagar.plexapi.plexapi.models.operations.PerformSearchRequest request =
lukehagar.plexapi.plexapi.models.operations.PerformSearchRequest
.builder()
.query(query)
.sectionId(sectionId)
.limit(limit)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/hubs/search");
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.PerformSearchRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
/**
* 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.
* 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
* @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
*/
public lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse performVoiceSearch(
String query,
Optional<? extends Double> sectionId,
Optional<? extends Double> limit) throws Exception {
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequest request =
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequest
.builder()
.query(query)
.sectionId(sectionId)
.limit(limit)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
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);
_req.addQueryParams(Utils.getQueryParams(
lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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 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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse getSearchResults(
String query) throws Exception {
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequest request =
lukehagar.plexapi.plexapi.models.operations.GetSearchResultsRequest
.builder()
.query(query)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/search");
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.GetSearchResultsRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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()));
}
}

View File

@@ -1,28 +0,0 @@
/*
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
*/
package lukehagar.plexapi.plexapi;
import lukehagar.plexapi.plexapi.models.shared.Security;
public interface SecuritySource {
Security getSecurity();
public static SecuritySource of(Security security) {
return new DefaultSecuritySource(security);
}
public static class DefaultSecuritySource implements SecuritySource {
private Security security;
public DefaultSecuritySource(Security security) {
this.security = security;
}
public Security getSecurity() {
return security;
}
}
}

View File

@@ -1,990 +0,0 @@
/*
* 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;
/**
* Operations against the Plex Media Server System.
*
*/
public class Server implements
MethodCallGetServerCapabilities,
MethodCallGetServerPreferences,
MethodCallGetAvailableClients,
MethodCallGetDevices,
MethodCallGetServerIdentity,
MethodCallGetMyPlexAccount,
MethodCallGetResizedPhoto,
MethodCallGetServerList {
private final SDKConfiguration sdkConfiguration;
Server(SDKConfiguration sdkConfiguration) {
this.sdkConfiguration = sdkConfiguration;
}
/**
* Get Server Capabilities
* Get Server Capabilities
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesRequestBuilder getServerCapabilities() {
return new lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesRequestBuilder(this);
}
/**
* Get Server Capabilities
* Get Server Capabilities
* @return The response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/");
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("getServerCapabilities", 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("getServerCapabilities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl("getServerCapabilities", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(new AfterErrorContextImpl("getServerCapabilities", 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.GetServerCapabilitiesResponse.Builder _resBuilder =
lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponseBody>() {});
_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.GetServerCapabilitiesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody>() {});
_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 Server Preferences
* Get Server Preferences
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesRequestBuilder getServerPreferences() {
return new lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesRequestBuilder(this);
}
/**
* Get Server Preferences
* Get Server Preferences
* @return The response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse getServerPreferencesDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/:/prefs");
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("getServerPreferences", 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("getServerPreferences", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl("getServerPreferences", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(new AfterErrorContextImpl("getServerPreferences", 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.GetServerPreferencesResponse.Builder _resBuilder =
lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponseBody>() {});
_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.GetServerPreferencesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetServerPreferencesResponseBody>() {});
_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 Available Clients
* Get Available Clients
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsRequestBuilder getAvailableClients() {
return new lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsRequestBuilder(this);
}
/**
* Get Available Clients
* Get Available Clients
* @return The response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse getAvailableClientsDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/clients");
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("getAvailableClients", 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("getAvailableClients", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl("getAvailableClients", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(new AfterErrorContextImpl("getAvailableClients", 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.GetAvailableClientsResponse.Builder _resBuilder =
lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponseBody>() {});
_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.GetAvailableClientsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetAvailableClientsResponseBody>() {});
_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 Devices
* Get Devices
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetDevicesRequestBuilder getDevices() {
return new lukehagar.plexapi.plexapi.models.operations.GetDevicesRequestBuilder(this);
}
/**
* Get Devices
* Get Devices
* @return The response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse getDevicesDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/devices");
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("getDevices", 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("getDevices", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl("getDevices", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(new AfterErrorContextImpl("getDevices", 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.GetDevicesResponse.Builder _resBuilder =
lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
lukehagar.plexapi.plexapi.models.operations.GetDevicesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetDevicesResponseBody>() {});
_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.GetDevicesResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetDevicesResponseBody>() {});
_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 Server Identity
* Get Server Identity
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetServerIdentityRequestBuilder getServerIdentity() {
return new lukehagar.plexapi.plexapi.models.operations.GetServerIdentityRequestBuilder(this);
}
/**
* Get Server Identity
* Get Server Identity
* @return The response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse getServerIdentityDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/identity");
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("getServerIdentity", 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("getServerIdentity", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl("getServerIdentity", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(new AfterErrorContextImpl("getServerIdentity", 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.GetServerIdentityResponse.Builder _resBuilder =
lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponseBody>() {});
_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.GetServerIdentityResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetServerIdentityResponseBody>() {});
_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 MyPlex Account
* Returns MyPlex Account Information
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountRequestBuilder getMyPlexAccount() {
return new lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountRequestBuilder(this);
}
/**
* Get MyPlex Account
* Returns MyPlex Account Information
* @return The response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/myplex/account");
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("getMyPlexAccount", 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("getMyPlexAccount", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl("getMyPlexAccount", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(new AfterErrorContextImpl("getMyPlexAccount", 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.GetMyPlexAccountResponse.Builder _resBuilder =
lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponseBody>() {});
_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.GetMyPlexAccountResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetMyPlexAccountResponseBody>() {});
_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 Resized Photo
* Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
*
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequestBuilder getResizedPhoto() {
return new lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequestBuilder(this);
}
/**
* Get a Resized Photo
* Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
*
* @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.GetResizedPhotoResponse getResizedPhoto(
lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequest request) throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/photo/:/transcode");
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.GetResizedPhotoRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl("getResizedPhoto", 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("getResizedPhoto", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl("getResizedPhoto", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(new AfterErrorContextImpl("getResizedPhoto", 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.GetResizedPhotoResponse.Builder _resBuilder =
lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse _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.GetResizedPhotoResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetResizedPhotoResponseBody>() {});
_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 Server List
* Get Server List
* @return The call builder
*/
public lukehagar.plexapi.plexapi.models.operations.GetServerListRequestBuilder getServerList() {
return new lukehagar.plexapi.plexapi.models.operations.GetServerListRequestBuilder(this);
}
/**
* Get Server List
* Get Server List
* @return The response from the API call
* @throws Exception if the API call fails
*/
public lukehagar.plexapi.plexapi.models.operations.GetServerListResponse getServerListDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/servers");
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("getServerList", 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("getServerList", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl("getServerList", Optional.of(java.util.List.of()), sdkConfiguration.securitySource()),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(new AfterErrorContextImpl("getServerList", 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.GetServerListResponse.Builder _resBuilder =
lukehagar.plexapi.plexapi.models.operations.GetServerListResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
lukehagar.plexapi.plexapi.models.operations.GetServerListResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
lukehagar.plexapi.plexapi.models.operations.GetServerListResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.operations.GetServerListResponseBody>() {});
_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.GetServerListResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<lukehagar.plexapi.plexapi.models.errors.GetServerListResponseBody>() {});
_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()));
}
}

View File

@@ -1,551 +0,0 @@
/*
* 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 search operations with Plex Media Server Sessions
*
*/
public class Sessions implements
MethodCallGetSessions,
MethodCallGetSessionHistory,
MethodCallGetTranscodeSessions,
MethodCallStopTranscodeSession {
private final SDKConfiguration sdkConfiguration;
Sessions(SDKConfiguration sdkConfiguration) {
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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse getSessionsDirect() throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/status/sessions");
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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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);
}
/**
* 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
*/
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)
* @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 = Utils.generateURL(
_baseUrl,
"/status/sessions/history/all");
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.GetSessionHistoryRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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);
}
/**
* Get Transcode Sessions
* Get Transcode Sessions
* @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 = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/transcode/sessions");
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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse stopTranscodeSession(
String sessionKey) throws Exception {
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequest request =
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequest
.builder()
.sessionKey(sessionKey)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionRequest.class,
_baseUrl,
"/transcode/sessions/{sessionKey}",
request, this.sdkConfiguration.globals);
HTTPRequest _req = new HTTPRequest(_url, "DELETE");
_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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
}

View File

@@ -1,469 +0,0 @@
/*
* 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 Statistics
*
*/
public class Statistics implements
MethodCallGetStatistics,
MethodCallGetResourcesStatistics,
MethodCallGetBandwidthStatistics {
private final SDKConfiguration sdkConfiguration;
Statistics(SDKConfiguration sdkConfiguration) {
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
*/
public lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse getStatistics(
Optional<? extends Long> timespan) throws Exception {
lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequest request =
lukehagar.plexapi.plexapi.models.operations.GetStatisticsRequest
.builder()
.timespan(timespan)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/statistics/media");
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.GetStatisticsRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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()));
}
/**
* 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()));
}
}

View File

@@ -1,426 +0,0 @@
/*
* 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;
/**
* This describes the API for searching and applying updates to the Plex Media Server.
* Updates to the status can be observed via the Event API.
*
*/
public class Updater implements
MethodCallGetUpdateStatus,
MethodCallCheckForUpdates,
MethodCallApplyUpdates {
private final SDKConfiguration sdkConfiguration;
Updater(SDKConfiguration sdkConfiguration) {
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);
}
/**
* Querying status of updates
* Querying status of updates
* @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 = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/updater/status");
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("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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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.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.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
*/
public lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse checkForUpdates(
Optional<? extends lukehagar.plexapi.plexapi.models.operations.Download> download) throws Exception {
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequest request =
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequest
.builder()
.download(download)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/updater/check");
HTTPRequest _req = new HTTPRequest(_url, "PUT");
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
this.sdkConfiguration.userAgent);
_req.addQueryParams(Utils.getQueryParams(
lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse applyUpdates(
Optional<? extends lukehagar.plexapi.plexapi.models.operations.Tonight> tonight,
Optional<? extends lukehagar.plexapi.plexapi.models.operations.Skip> skip) throws Exception {
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequest request =
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequest
.builder()
.tonight(tonight)
.skip(skip)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/updater/apply");
HTTPRequest _req = new HTTPRequest(_url, "PUT");
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
this.sdkConfiguration.userAgent);
_req.addQueryParams(Utils.getQueryParams(
lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
}

View File

@@ -1,270 +0,0 @@
/*
* 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 Videos
*
*/
public class Video implements
MethodCallGetTimeline,
MethodCallStartUniversalTranscode {
private final SDKConfiguration sdkConfiguration;
Video(SDKConfiguration sdkConfiguration) {
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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse getTimeline(
lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest request) throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
_baseUrl,
"/:/timeline");
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.GetTimelineRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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 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);
}
/**
* 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
*/
public lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse startUniversalTranscode(
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest request) throws Exception {
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
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);
_req.addQueryParams(Utils.getQueryParams(
lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest.class,
request,
this.sdkConfiguration.globals));
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
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));
}
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()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
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(),
"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()));
}
}

View File

@@ -1,193 +0,0 @@
/*
* 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()));
}
}

View File

@@ -1,26 +0,0 @@
/*
* 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
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 AddPlaylistContentsErrors {
@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 AddPlaylistContentsErrors(
@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 AddPlaylistContentsErrors() {
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 AddPlaylistContentsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public AddPlaylistContentsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public AddPlaylistContentsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public AddPlaylistContentsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public AddPlaylistContentsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public AddPlaylistContentsErrors 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;
}
AddPlaylistContentsErrors other = (AddPlaylistContentsErrors) 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(AddPlaylistContentsErrors.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 AddPlaylistContentsErrors build() {
return new AddPlaylistContentsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 ApplyUpdatesErrors {
@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 ApplyUpdatesErrors(
@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 ApplyUpdatesErrors() {
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 ApplyUpdatesErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public ApplyUpdatesErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public ApplyUpdatesErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public ApplyUpdatesErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public ApplyUpdatesErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public ApplyUpdatesErrors 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;
}
ApplyUpdatesErrors other = (ApplyUpdatesErrors) 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(ApplyUpdatesErrors.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 ApplyUpdatesErrors build() {
return new ApplyUpdatesErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* ApplyUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 ApplyUpdatesResponseBody withErrors(java.util.List<ApplyUpdatesErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ApplyUpdatesResponseBody other = (ApplyUpdatesResponseBody) 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(ApplyUpdatesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<ApplyUpdatesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<ApplyUpdatesErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,33 +0,0 @@
/*
* 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;
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 CancelServerActivitiesErrors {
@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 CancelServerActivitiesErrors(
@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 CancelServerActivitiesErrors() {
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 CancelServerActivitiesErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public CancelServerActivitiesErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public CancelServerActivitiesErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public CancelServerActivitiesErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public CancelServerActivitiesErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public CancelServerActivitiesErrors 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;
}
CancelServerActivitiesErrors other = (CancelServerActivitiesErrors) 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(CancelServerActivitiesErrors.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 CancelServerActivitiesErrors build() {
return new CancelServerActivitiesErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* CancelServerActivitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 CancelServerActivitiesResponseBody withErrors(java.util.List<CancelServerActivitiesErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CancelServerActivitiesResponseBody other = (CancelServerActivitiesResponseBody) 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(CancelServerActivitiesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<CancelServerActivitiesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<CancelServerActivitiesErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 CheckForUpdatesErrors {
@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 CheckForUpdatesErrors(
@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 CheckForUpdatesErrors() {
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 CheckForUpdatesErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public CheckForUpdatesErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public CheckForUpdatesErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public CheckForUpdatesErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public CheckForUpdatesErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public CheckForUpdatesErrors 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;
}
CheckForUpdatesErrors other = (CheckForUpdatesErrors) 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(CheckForUpdatesErrors.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 CheckForUpdatesErrors build() {
return new CheckForUpdatesErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* CheckForUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 CheckForUpdatesResponseBody withErrors(java.util.List<CheckForUpdatesErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CheckForUpdatesResponseBody other = (CheckForUpdatesResponseBody) 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(CheckForUpdatesResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<CheckForUpdatesErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<CheckForUpdatesErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 ClearPlaylistContentsErrors {
@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 ClearPlaylistContentsErrors(
@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 ClearPlaylistContentsErrors() {
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 ClearPlaylistContentsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public ClearPlaylistContentsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public ClearPlaylistContentsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public ClearPlaylistContentsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public ClearPlaylistContentsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public ClearPlaylistContentsErrors 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;
}
ClearPlaylistContentsErrors other = (ClearPlaylistContentsErrors) 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(ClearPlaylistContentsErrors.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 ClearPlaylistContentsErrors build() {
return new ClearPlaylistContentsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* ClearPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 ClearPlaylistContentsResponseBody withErrors(java.util.List<ClearPlaylistContentsErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ClearPlaylistContentsResponseBody other = (ClearPlaylistContentsResponseBody) 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(ClearPlaylistContentsResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<ClearPlaylistContentsErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<ClearPlaylistContentsErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 CreatePlaylistErrors {
@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 CreatePlaylistErrors(
@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 CreatePlaylistErrors() {
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 CreatePlaylistErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public CreatePlaylistErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public CreatePlaylistErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public CreatePlaylistErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public CreatePlaylistErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public CreatePlaylistErrors 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;
}
CreatePlaylistErrors other = (CreatePlaylistErrors) 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(CreatePlaylistErrors.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 CreatePlaylistErrors build() {
return new CreatePlaylistErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 DeleteLibraryErrors {
@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 DeleteLibraryErrors(
@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 DeleteLibraryErrors() {
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 DeleteLibraryErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public DeleteLibraryErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public DeleteLibraryErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public DeleteLibraryErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public DeleteLibraryErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public DeleteLibraryErrors 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;
}
DeleteLibraryErrors other = (DeleteLibraryErrors) 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(DeleteLibraryErrors.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 DeleteLibraryErrors build() {
return new DeleteLibraryErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* DeleteLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 DeleteLibraryResponseBody withErrors(java.util.List<DeleteLibraryErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DeleteLibraryResponseBody other = (DeleteLibraryResponseBody) 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(DeleteLibraryResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<DeleteLibraryErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<DeleteLibraryErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 DeletePlaylistErrors {
@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 DeletePlaylistErrors(
@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 DeletePlaylistErrors() {
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 DeletePlaylistErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public DeletePlaylistErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public DeletePlaylistErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public DeletePlaylistErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public DeletePlaylistErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public DeletePlaylistErrors 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;
}
DeletePlaylistErrors other = (DeletePlaylistErrors) 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(DeletePlaylistErrors.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 DeletePlaylistErrors build() {
return new DeletePlaylistErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* DeletePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 DeletePlaylistResponseBody withErrors(java.util.List<DeletePlaylistErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DeletePlaylistResponseBody other = (DeletePlaylistResponseBody) 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(DeletePlaylistResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<DeletePlaylistErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<DeletePlaylistErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 EnablePaperTrailErrors {
@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 EnablePaperTrailErrors(
@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 EnablePaperTrailErrors() {
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 EnablePaperTrailErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public EnablePaperTrailErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public EnablePaperTrailErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public EnablePaperTrailErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public EnablePaperTrailErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public EnablePaperTrailErrors 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;
}
EnablePaperTrailErrors other = (EnablePaperTrailErrors) 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(EnablePaperTrailErrors.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 EnablePaperTrailErrors build() {
return new EnablePaperTrailErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* EnablePaperTrailResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 EnablePaperTrailResponseBody withErrors(java.util.List<EnablePaperTrailErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EnablePaperTrailResponseBody other = (EnablePaperTrailResponseBody) 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(EnablePaperTrailResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<EnablePaperTrailErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<EnablePaperTrailErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 Errors {
@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 Errors(
@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 Errors() {
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 Errors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public Errors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public Errors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public Errors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public Errors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public Errors 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;
}
Errors other = (Errors) 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(Errors.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 Errors build() {
return new Errors(
code,
message,
status);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetAvailableClientsErrors {
@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 GetAvailableClientsErrors(
@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 GetAvailableClientsErrors() {
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 GetAvailableClientsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetAvailableClientsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetAvailableClientsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetAvailableClientsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetAvailableClientsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetAvailableClientsErrors 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;
}
GetAvailableClientsErrors other = (GetAvailableClientsErrors) 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(GetAvailableClientsErrors.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 GetAvailableClientsErrors build() {
return new GetAvailableClientsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetButlerTasksErrors {
@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 GetButlerTasksErrors(
@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 GetButlerTasksErrors() {
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 GetButlerTasksErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetButlerTasksErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetButlerTasksErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetButlerTasksErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetButlerTasksErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetButlerTasksErrors 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;
}
GetButlerTasksErrors other = (GetButlerTasksErrors) 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(GetButlerTasksErrors.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 GetButlerTasksErrors build() {
return new GetButlerTasksErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetDevicesErrors {
@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 GetDevicesErrors(
@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 GetDevicesErrors() {
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 GetDevicesErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetDevicesErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetDevicesErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetDevicesErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetDevicesErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetDevicesErrors 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;
}
GetDevicesErrors other = (GetDevicesErrors) 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(GetDevicesErrors.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 GetDevicesErrors build() {
return new GetDevicesErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetFileHashErrors {
@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 GetFileHashErrors(
@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 GetFileHashErrors() {
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 GetFileHashErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetFileHashErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetFileHashErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetFileHashErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetFileHashErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetFileHashErrors 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;
}
GetFileHashErrors other = (GetFileHashErrors) 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(GetFileHashErrors.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 GetFileHashErrors build() {
return new GetFileHashErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* GetFileHashResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 GetFileHashResponseBody withErrors(java.util.List<GetFileHashErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetFileHashResponseBody other = (GetFileHashResponseBody) 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(GetFileHashResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<GetFileHashErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<GetFileHashErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetGlobalHubsErrors {
@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 GetGlobalHubsErrors(
@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 GetGlobalHubsErrors() {
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 GetGlobalHubsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetGlobalHubsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetGlobalHubsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetGlobalHubsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetGlobalHubsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetGlobalHubsErrors 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;
}
GetGlobalHubsErrors other = (GetGlobalHubsErrors) 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(GetGlobalHubsErrors.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 GetGlobalHubsErrors build() {
return new GetGlobalHubsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetLibrariesErrors {
@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 GetLibrariesErrors(
@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 GetLibrariesErrors() {
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 GetLibrariesErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetLibrariesErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetLibrariesErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetLibrariesErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetLibrariesErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetLibrariesErrors 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;
}
GetLibrariesErrors other = (GetLibrariesErrors) 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(GetLibrariesErrors.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 GetLibrariesErrors build() {
return new GetLibrariesErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetLibraryErrors {
@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 GetLibraryErrors(
@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 GetLibraryErrors() {
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 GetLibraryErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetLibraryErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetLibraryErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetLibraryErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetLibraryErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetLibraryErrors 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;
}
GetLibraryErrors other = (GetLibraryErrors) 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(GetLibraryErrors.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 GetLibraryErrors build() {
return new GetLibraryErrors(
code,
message,
status);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetLibraryHubsErrors {
@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 GetLibraryHubsErrors(
@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 GetLibraryHubsErrors() {
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 GetLibraryHubsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetLibraryHubsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetLibraryHubsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetLibraryHubsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetLibraryHubsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetLibraryHubsErrors 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;
}
GetLibraryHubsErrors other = (GetLibraryHubsErrors) 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(GetLibraryHubsErrors.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 GetLibraryHubsErrors build() {
return new GetLibraryHubsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetMetadataChildrenErrors {
@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 GetMetadataChildrenErrors(
@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 GetMetadataChildrenErrors() {
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 GetMetadataChildrenErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetMetadataChildrenErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetMetadataChildrenErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetMetadataChildrenErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetMetadataChildrenErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetMetadataChildrenErrors 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;
}
GetMetadataChildrenErrors other = (GetMetadataChildrenErrors) 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(GetMetadataChildrenErrors.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 GetMetadataChildrenErrors build() {
return new GetMetadataChildrenErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetMetadataErrors {
@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 GetMetadataErrors(
@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 GetMetadataErrors() {
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 GetMetadataErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetMetadataErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetMetadataErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetMetadataErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetMetadataErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetMetadataErrors 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;
}
GetMetadataErrors other = (GetMetadataErrors) 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(GetMetadataErrors.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 GetMetadataErrors build() {
return new GetMetadataErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetMyPlexAccountErrors {
@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 GetMyPlexAccountErrors(
@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 GetMyPlexAccountErrors() {
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 GetMyPlexAccountErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetMyPlexAccountErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetMyPlexAccountErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetMyPlexAccountErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetMyPlexAccountErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetMyPlexAccountErrors 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;
}
GetMyPlexAccountErrors other = (GetMyPlexAccountErrors) 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(GetMyPlexAccountErrors.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 GetMyPlexAccountErrors build() {
return new GetMyPlexAccountErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetOnDeckErrors {
@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 GetOnDeckErrors(
@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 GetOnDeckErrors() {
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 GetOnDeckErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetOnDeckErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetOnDeckErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetOnDeckErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetOnDeckErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetOnDeckErrors 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;
}
GetOnDeckErrors other = (GetOnDeckErrors) 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(GetOnDeckErrors.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 GetOnDeckErrors build() {
return new GetOnDeckErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetPinErrors {
@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 GetPinErrors(
@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 GetPinErrors() {
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 GetPinErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetPinErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetPinErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetPinErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetPinErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetPinErrors 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;
}
GetPinErrors other = (GetPinErrors) 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(GetPinErrors.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 GetPinErrors build() {
return new GetPinErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetPlaylistContentsErrors {
@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 GetPlaylistContentsErrors(
@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 GetPlaylistContentsErrors() {
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 GetPlaylistContentsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetPlaylistContentsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetPlaylistContentsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetPlaylistContentsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetPlaylistContentsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetPlaylistContentsErrors 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;
}
GetPlaylistContentsErrors other = (GetPlaylistContentsErrors) 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(GetPlaylistContentsErrors.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 GetPlaylistContentsErrors build() {
return new GetPlaylistContentsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetPlaylistErrors {
@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 GetPlaylistErrors(
@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 GetPlaylistErrors() {
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 GetPlaylistErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetPlaylistErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetPlaylistErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetPlaylistErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetPlaylistErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetPlaylistErrors 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;
}
GetPlaylistErrors other = (GetPlaylistErrors) 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(GetPlaylistErrors.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 GetPlaylistErrors build() {
return new GetPlaylistErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetPlaylistsErrors {
@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 GetPlaylistsErrors(
@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 GetPlaylistsErrors() {
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 GetPlaylistsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetPlaylistsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetPlaylistsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetPlaylistsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetPlaylistsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetPlaylistsErrors 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;
}
GetPlaylistsErrors other = (GetPlaylistsErrors) 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(GetPlaylistsErrors.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 GetPlaylistsErrors build() {
return new GetPlaylistsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetRecentlyAddedErrors {
@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 GetRecentlyAddedErrors(
@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 GetRecentlyAddedErrors() {
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 GetRecentlyAddedErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetRecentlyAddedErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetRecentlyAddedErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetRecentlyAddedErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetRecentlyAddedErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetRecentlyAddedErrors 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;
}
GetRecentlyAddedErrors other = (GetRecentlyAddedErrors) 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(GetRecentlyAddedErrors.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 GetRecentlyAddedErrors build() {
return new GetRecentlyAddedErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetResizedPhotoErrors {
@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 GetResizedPhotoErrors(
@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 GetResizedPhotoErrors() {
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 GetResizedPhotoErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetResizedPhotoErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetResizedPhotoErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetResizedPhotoErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetResizedPhotoErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetResizedPhotoErrors 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;
}
GetResizedPhotoErrors other = (GetResizedPhotoErrors) 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(GetResizedPhotoErrors.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 GetResizedPhotoErrors build() {
return new GetResizedPhotoErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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;
/**
* GetResizedPhotoResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
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("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(){
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 GetResizedPhotoResponseBody withErrors(java.util.List<GetResizedPhotoErrors> errors) {
Utils.checkNotNull(errors, "errors");
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) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetResizedPhotoResponseBody other = (GetResizedPhotoResponseBody) 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(GetResizedPhotoResponseBody.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends java.util.List<GetResizedPhotoErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(java.util.List<GetResizedPhotoErrors> errors) {
Utils.checkNotNull(errors, "errors");
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,
rawResponse);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetSearchResultsErrors {
@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 GetSearchResultsErrors(
@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 GetSearchResultsErrors() {
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 GetSearchResultsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetSearchResultsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetSearchResultsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetSearchResultsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetSearchResultsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetSearchResultsErrors 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;
}
GetSearchResultsErrors other = (GetSearchResultsErrors) 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(GetSearchResultsErrors.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 GetSearchResultsErrors build() {
return new GetSearchResultsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetServerActivitiesErrors {
@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 GetServerActivitiesErrors(
@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 GetServerActivitiesErrors() {
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 GetServerActivitiesErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetServerActivitiesErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetServerActivitiesErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetServerActivitiesErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetServerActivitiesErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetServerActivitiesErrors 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;
}
GetServerActivitiesErrors other = (GetServerActivitiesErrors) 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(GetServerActivitiesErrors.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 GetServerActivitiesErrors build() {
return new GetServerActivitiesErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetServerIdentityErrors {
@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 GetServerIdentityErrors(
@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 GetServerIdentityErrors() {
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 GetServerIdentityErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetServerIdentityErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetServerIdentityErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetServerIdentityErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetServerIdentityErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetServerIdentityErrors 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;
}
GetServerIdentityErrors other = (GetServerIdentityErrors) 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(GetServerIdentityErrors.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 GetServerIdentityErrors build() {
return new GetServerIdentityErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetServerListErrors {
@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 GetServerListErrors(
@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 GetServerListErrors() {
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 GetServerListErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetServerListErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetServerListErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetServerListErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetServerListErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetServerListErrors 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;
}
GetServerListErrors other = (GetServerListErrors) 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(GetServerListErrors.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 GetServerListErrors build() {
return new GetServerListErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetServerPreferencesErrors {
@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 GetServerPreferencesErrors(
@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 GetServerPreferencesErrors() {
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 GetServerPreferencesErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetServerPreferencesErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetServerPreferencesErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetServerPreferencesErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetServerPreferencesErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetServerPreferencesErrors 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;
}
GetServerPreferencesErrors other = (GetServerPreferencesErrors) 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(GetServerPreferencesErrors.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 GetServerPreferencesErrors build() {
return new GetServerPreferencesErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetSessionHistoryErrors {
@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 GetSessionHistoryErrors(
@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 GetSessionHistoryErrors() {
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 GetSessionHistoryErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetSessionHistoryErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetSessionHistoryErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetSessionHistoryErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetSessionHistoryErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetSessionHistoryErrors 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;
}
GetSessionHistoryErrors other = (GetSessionHistoryErrors) 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(GetSessionHistoryErrors.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 GetSessionHistoryErrors build() {
return new GetSessionHistoryErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetSessionsErrors {
@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 GetSessionsErrors(
@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 GetSessionsErrors() {
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 GetSessionsErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetSessionsErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetSessionsErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetSessionsErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetSessionsErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetSessionsErrors 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;
}
GetSessionsErrors other = (GetSessionsErrors) 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(GetSessionsErrors.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 GetSessionsErrors build() {
return new GetSessionsErrors(
code,
message,
status);
}
}
}

View File

@@ -1,171 +0,0 @@
/*
* 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);
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 GetSourceConnectionInformationErrors {
@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 GetSourceConnectionInformationErrors(
@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 GetSourceConnectionInformationErrors() {
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 GetSourceConnectionInformationErrors withCode(double code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetSourceConnectionInformationErrors withCode(Optional<? extends Double> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetSourceConnectionInformationErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetSourceConnectionInformationErrors withMessage(Optional<? extends String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetSourceConnectionInformationErrors withStatus(double status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetSourceConnectionInformationErrors 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;
}
GetSourceConnectionInformationErrors other = (GetSourceConnectionInformationErrors) 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(GetSourceConnectionInformationErrors.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 GetSourceConnectionInformationErrors build() {
return new GetSourceConnectionInformationErrors(
code,
message,
status);
}
}
}

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